Compare commits

...
105 Commits
Author SHA1 Message Date
lexx 1dc6d541cc revenrt 2026-05-12 21:22:10 +03:00
lexx 7fef89b778 composer 2026-05-12 21:03:33 +03:00
lexx 6b713e4ffb composer 2026-05-12 20:58:50 +03:00
lexx b52a91bf52 update composer 2026-05-12 20:49:27 +03:00
lexx e8d8340448 remove sqlitge 2026-05-12 18:28:58 +03:00
lexx 81371c41a7 composer 2026-05-08 18:29:35 +03:00
lexx 3cf5f0173b css 2026-05-08 17:55:22 +03:00
lexx 65844e030d remove setup 2026-05-07 23:06:51 +03:00
lexx ba7e4ab151 ignore 2026-05-07 22:57:58 +03:00
lexx ec4e578aee composer update 2026-05-07 22:55:37 +03:00
lexx 1a5f300a78 cleanup 2026-05-07 22:54:33 +03:00
lexx a04cdd753d removed lodash and axios 2026-05-07 22:50:02 +03:00
lexx daa4b268a6 cli setup 2026-05-07 21:38:07 +03:00
lexx a5161cb6b4 setup 2026-05-07 21:34:43 +03:00
lexx 48e32bfdcb fix paths 2026-05-07 21:18:50 +03:00
lexx 639ee895cd import and export 2026-05-07 17:42:46 +03:00
lexx 8cf1dd9bfd fetch gfix 2026-05-07 13:29:49 +03:00
lexx fcadc8d7a1 doc update 2026-05-06 23:42:32 +03:00
lexx 1e2f941f47 cleanup 2026-05-06 23:28:23 +03:00
lexx eeee2afc05 removed axios 2026-05-06 23:18:34 +03:00
lexx 98efb76f7b removed blade and htmx 2026-05-06 23:16:09 +03:00
lexx dff3748623 revision fix 2026-05-06 21:48:56 +03:00
lexx 93a16ee916 cleanup 2026-05-06 21:43:13 +03:00
lexx 8b3a3964a5 fixes 2026-05-06 19:36:53 +03:00
lexx 43dd36e20e small fixes 2026-05-06 18:21:40 +03:00
lexx 5587e8b4b6 file uploads 2026-05-06 18:11:42 +03:00
lexx 16e50e2d49 wip upload files and select 2026-05-05 19:21:59 +03:00
lexx bd01e5c32c WIP uploading files 2026-04-29 19:40:37 +03:00
lexx e058ceadee docs updated 2026-04-20 21:13:31 +03:00
lexx 4a7eb217a1 boboko lulnar 2026-04-20 21:07:35 +03:00
lexx 57b0727788 fix image limit 2025-07-03 15:28:52 +03:00
lexx 58b047edd2 Merge pull request 'Fix gte' (#24) from Fixing-date-&-datetime-compare-bugs into dev
Reviewed-on: #24
2025-06-16 15:48:36 +00:00
arvanitakis a78b699a5e Fix 2025-06-16 18:23:14 +03:00
lexx e910ae9878 login 2025-05-16 13:53:41 +03:00
lexx 362c649d36 Merge branch 'dev' of ssh://code.radical-elements.com:2727/lucent/lucent-laravel into dev 2025-05-16 13:27:48 +03:00
lexx 852c4d608d thumbnail limit 2025-05-16 13:27:25 +03:00
lexx aa59e55a41 meta htmx 2025-05-15 19:18:03 +03:00
lexx 348bad80e0 Merge pull request 'Fix' (#23) from Catching-thumbnail-rebuild-error into dev
Reviewed-on: #23
2025-05-06 10:46:58 +00:00
arvanitakis f0d4686141 Fix 2025-05-06 13:46:00 +03:00
lexx a482ab3c7e login urls 2025-03-20 21:06:40 +02:00
lexx c580882ec0 fix url 2025-03-20 20:57:47 +02:00
lexx 2cf8379cbe urls update 2025-03-20 20:53:51 +02:00
lexx c39ec469df files bug 2025-01-22 20:03:12 +02:00
lexx 232fcc8845 csv render title 2024-12-18 13:02:09 +02:00
lexx 9d5d4dd930 csv relations 2024-12-14 18:56:04 +02:00
lexx c507dc6031 upload fix 2024-10-23 19:34:41 +03:00
lexx 843f560710 new build 2024-09-27 17:42:49 +03:00
lexx 7574d67d80 some styling in tables 2024-09-27 16:48:05 +03:00
lexx 19931cb4d1 update files script 2024-09-27 16:27:37 +03:00
lexx 6458c1e71d rebuilding thumbnails command 2024-09-27 15:32:35 +03:00
lexx 63232585ab storage and image model 2024-09-27 14:28:20 +03:00
lexx 6d15591601 wip stograge 2024-09-20 13:39:45 +03:00
lexx 32c8378020 refactor files 2024-09-19 23:36:43 +03:00
lexx d0cd8228cc fix replacing config 2024-09-13 18:13:15 +03:00
lexx c45a3847f8 fix rich editor embed image original 2024-09-13 18:11:57 +03:00
lexx c0b3878674 file route for template generation 2024-09-13 17:16:04 +03:00
lexx f868219981 fixes and stuff 2024-09-11 16:21:51 +03:00
lexx 8ac0567e66 fix graph ignoring missing fields 2024-09-07 15:57:31 +03:00
lexx 02f8f5970a codemirror insert 2024-09-07 15:31:56 +03:00
lexx 0cd4e08716 fixing database connections 2024-09-07 13:22:58 +03:00
lexx cf3d621587 helper commands 2024-09-07 00:03:11 +03:00
lexx 6fc0a65b6f setup complete 2024-09-06 23:30:12 +03:00
lexx a73ee21568 wip setup guide 2024-09-06 21:00:15 +03:00
lexx ff54bcc2ef wip setup guide 2024-09-06 20:59:56 +03:00
lexx ab1517cc8f tabs and date in modal fix 2024-08-30 13:38:34 +03:00
lexx 9f724a3243 better report 2024-08-27 17:59:12 +03:00
lexx ae65ca47f6 commands and logs to the database 2024-08-27 17:42:06 +03:00
lexx 74d2fcc4fa build assets 2024-08-27 12:25:42 +03:00
lexx 82174afdea fixing multiple references 2024-08-27 12:24:51 +03:00
lexx ffc39f078d trix 2024-08-25 14:45:49 +03:00
lexx 7c4e19afbc tip tap and trix 2024-08-25 14:23:20 +03:00
lexx 7b10bfca1d cleanup 2024-08-24 19:57:17 +03:00
lexx 0e5ac08641 actions 2024-08-24 19:35:07 +03:00
lexx 1505aaa909 multiple commands 2024-08-24 18:51:36 +03:00
lexx d9e2c4954a refactoring of filters 2024-08-24 17:22:40 +03:00
lexx 97ad9de3d2 readme 2024-08-24 01:30:44 +03:00
lexx 9e140be0ec updated readme 2024-08-23 21:06:53 +03:00
lexx a737c2d571 configurable disks 2024-08-23 20:58:45 +03:00
lexx c43c29eb14 modal save button 2024-08-23 19:37:20 +03:00
lexx 0c00f76657 fix tools and layhout 2024-08-23 18:15:18 +03:00
lexx 4165bfb95d build controller 2024-08-23 17:29:08 +03:00
lexx 570dbf747e channel 2024-08-23 17:23:43 +03:00
lexx 14cbd0a845 manifest fix 2024-08-23 17:15:40 +03:00
lexx c99634bb46 query 2024-08-23 16:54:33 +03:00
lexx 246696f331 assets build 2024-08-22 17:59:06 +03:00
lexx 0643578d15 record update 2024-08-22 17:58:30 +03:00
lexx 3aa9191cba file upload 2024-08-19 17:59:08 +03:00
lexx c97be8666e records and edgs 2024-08-19 17:48:10 +03:00
lexx 509d7c13f2 cleanup 2024-08-18 19:20:53 +03:00
lexx 50c8af7bda theming 2024-08-18 19:04:32 +03:00
lexx 5d6869c118 rich editor files 2024-08-18 17:23:18 +03:00
lexx ec15f21e67 here and there 2024-08-17 21:10:01 +03:00
lexx 36165444cf file previews 2024-08-17 20:31:04 +03:00
lexx 322962403d colors and filters 2024-08-17 19:23:19 +03:00
lexx db37653748 fixed zindex thing - brightness was the problem 2024-08-16 21:11:01 +03:00
lexx 5a13ddb2ec backlinks 2024-08-16 17:38:26 +03:00
lexx 9bbd53b586 references 2024-08-16 16:00:48 +03:00
lexx a04e338ce2 updated dependencies 2024-08-16 14:34:39 +03:00
lexx 2429d4acb5 dialog wip 2024-08-15 22:11:26 +03:00
lexx 113533408d content and edit record 2024-08-15 18:52:53 +03:00
lexx f9806f60c9 filters and sidebar 2024-08-15 14:44:53 +03:00
lexx 1f3ebafe69 transition 2024-08-14 22:04:34 +03:00
lexx 1ab3f678b7 untitled fix 2024-07-22 20:09:16 +03:00
lexx a54200c5e5 build 2024-05-22 17:05:56 +03:00
lexx 069ae72705 fix sort 2024-05-22 17:05:25 +03:00
333 changed files with 14931 additions and 9013 deletions

No files matched your search

+1
View File
@@ -6,3 +6,4 @@ front/node_modules
front/npm-debug.log front/npm-debug.log
/.idea /.idea
/.vscode /.vscode
/.claude
+4
View File
@@ -0,0 +1,4 @@
{
"$schema": "/phpactor.schema.json",
"language_server_phpstan.enabled": false
}
+25 -3
View File
@@ -9,8 +9,8 @@ include_toc: true
### Requirements ### Requirements
- PHP 8.2 - PHP 8.3
- Laravel 10 - Laravel 11
- Postgres or Sqlite database - Postgres or Sqlite database
- ImageMagick - ImageMagick
@@ -82,7 +82,9 @@ return [
### Database ### Database
The recommended database for small website is sqlite. But you can also use postresql The recommended database for small website is sqlite. But you can also use postresql
Make sure to delete the existing migration scripts in your database/migrations folder.
> [!CAUTION]
> Make sure to delete the existing migration scripts in your database/migrations folder.
Then run: Then run:
@@ -90,6 +92,26 @@ Then run:
php artisan migrate php artisan migrate
``` ```
### File Storage
You can use your local filesystem or s3 compatible storage. Lucent expects you to have a valid configuration inside ``config/filesystems.php``
example:
```php
return [
'disks' => [
'lucent' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => true,
],
],
];
```
### First user ### First user
To create your first user, head to your localhost:8000/lucent To create your first user, head to your localhost:8000/lucent
+32
View File
@@ -0,0 +1,32 @@
# Upgrade from 1.1.* to 1.2.0
## lucent.php config file
There is now an array of commands, accepting more than one.
from
```php
"generateCommand" => env("LUCENT_GENERATE_COMMAND", "generate:static"),
```
to
```php
"commands" => [
"generate:static" => "Build Website",
],
```
## config/filesystems.php
Lucent has its own filesystem.
You should now add:
```
'lucent' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => false,
],
```
+6 -9
View File
@@ -6,18 +6,17 @@
"require": { "require": {
"ext-xml": "*", "ext-xml": "*",
"ext-zip": "*", "ext-zip": "*",
"ext-sqlite3": "*",
"ext-imagick": "*", "ext-imagick": "*",
"php": "^8.2", "ext-pdo": "*",
"guzzlehttp/guzzle": "^7.2", "php": "^8.4",
"intervention/image": "^2.7", "intervention/image": "^2.7",
"phpoption/phpoption": "^1.9", "phpoption/phpoption": "^1.9",
"spatie/image-optimizer": "^1.6", "spatie/image-optimizer": "^1.6",
"staudenmeir/laravel-cte": "^1.0", "staudenmeir/laravel-cte": "^1.0"
"ext-pdo": "*"
}, },
"require-dev": { "require-dev": {
"phpstan/phpstan": "^1.8" "phpstan/phpstan": "^1.8",
"laravel/framework": "^10.10"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
@@ -25,8 +24,7 @@
}, },
"files": [ "files": [
"src/Response.php", "src/Response.php",
"src/macros.php", "src/macros.php"
"src/File/Uploader.php"
] ]
}, },
"extra": { "extra": {
@@ -38,5 +36,4 @@
}, },
"minimum-stability": "stable", "minimum-stability": "stable",
"prefer-stable": true "prefer-stable": true
} }
Generated
+3804 -685
View File
File diff suppressed because it is too large. Load diff
+145 -298
View File
@@ -5,374 +5,221 @@ include_toc: true
# Fields # Fields
Fields are similar to a table's columns in a relational databases. Fields define the columns of a schema. Each field has a `ui` type that controls both storage and the admin UI component rendered.
## Available fields for Collections and Files ## Common Optional Properties
Most fields share these optional properties:
| Property | Description |
|---|---|
| `required` | Whether the field must have a value to save as `published` |
| `nullable` | Allow saving as `null` |
| `help` | Help text shown below the input |
| `default` | Default value when creating a new record |
| `readonly` | Prevent editing from the UI |
| `group` | Tab group this field belongs to |
## Field Types
### text ### text
One-line text input
required One-line text input.
- **name**: The id of the field **Required:** `name`, `label`
- **label**: The friendly name of the field
optional | Property | Description |
|---|---|
| `min` | Minimum character count |
| `max` | Maximum character count |
| `selectOptions` | Array of options. Strings or `[{value, label}]` objects |
| `optionsFrom` | Schema name to load options from |
| `optionsField` | Field from `optionsFrom` to use as the value |
| `optionsSuggest` | Allow typing new values not in the options list |
- **required**: Is the field required to save the record ---
- **nullable**: Can the field be saved as null
- **min**: Minimum characters
- **max**: Maximum characters
- **help**: Help text
- **default**: Default value when creating new record
- **readonly**: Cannot edit this value from the UI
- **optionsFrom**: Schema to choose options from
- **optionsField**: Field's value to insert
- **optionsSuggest**: Allow to insert new values
- **selectOptions**: Array of options to select from. Or array of objects `[{value,label}]`
- **group**: The group that this field belongs to
### textarea ### textarea
textarea input
required Multi-line text input.
- **name**: The id of the field **Required:** `name`, `label`
- **label**: The friendly name of the field
optional | Property | Description |
|---|---|
| `min` | Minimum character count |
| `max` | Maximum character count |
- **required**: Is the field required to save the record ---
- **nullable**: Can the field be saved as null
- **min**: Minimum characters
- **max**: Maximum characters
- **help**: Help text
- **default**: Default value when creating new record
- **readonly**: Cannot edit this value from the UI
- **group**: The group that this field belongs to
### slug ### slug
Slug input. Generates automatically if left empty
required Slug input. Auto-generates from a source field if left empty.
- **name**: The id of the field **Required:** `name`, `label`, `source`
- **label**: The friendly name of the field
- **source**: The source field from which it generates
optional | Property | Description |
|---|---|
| `source` | Field name to generate the slug from |
| `min` | Minimum character count |
| `max` | Maximum character count |
- **required**: Is the field required to save the record ---
- **nullable**: Can the field be saved as null
- **min**: Minimum characters
- **max**: Maximum characters
- **help**: Help text
- **default**: Default value when creating new record
- **readonly**: Cannot edit this value from the UI
- **group**: The group that this field belongs to
### rich ### rich
WYSIWYG editor
required WYSIWYG rich text editor.
- **name**: The id of the field **Required:** `name`, `label`
- **label**: The friendly name of the field
optional | Property | Description |
|---|---|
| `min` | Minimum character count |
| `max` | Maximum character count |
- **required**: Is the field required to save the record ---
- **nullable**: Can the field be saved as null
- **min**: Minimum characters ### markdown
- **max**: Maximum characters
- **help**: Help text Markdown editor.
- **default**: Default value when creating new record
- **readonly**: Cannot edit this value from the UI **Required:** `name`, `label`
- **group**: The group that this field belongs to
| Property | Description |
|---|---|
| `min` | Minimum character count |
| `max` | Maximum character count |
---
### number ### number
Any numeric value
required Numeric input.
- **name**: The id of the field **Required:** `name`, `label`
- **label**: The friendly name of the field
optional | Property | Description |
|---|---|
| `decimals` | Number of decimal places. Default: `0` |
| `min` | Minimum value |
| `max` | Maximum value |
| `optionsFrom` | Schema name to load options from |
| `optionsField` | Field from `optionsFrom` to use as the value |
| `optionsSuggest` | Allow typing new values not in the options list |
- **decimals**: default is 0 ---
- **required**: Is the field required to save the record
- **nullable**: Can the field be saved as null
- **min**: Minimum characters
- **max**: Maximum characters
- **help**: Help text
- **default**: Default value when creating new record
- **readonly**: Cannot edit this value from the UI
- **optionsFrom**: Schema to choose options from
- **optionsField**: Field's value to insert
- **optionsSuggest**: Allow to insert new values
- **group**: The group that this field belongs to
### checkbox ### checkbox
True or false
required Boolean true/false toggle.
- **name**: The id of the field **Required:** `name`, `label`
- **label**: The friendly name of the field
optional ---
- **required**: Is the field required to save the record
- **nullable**: Can the field be saved as null
- **help**: Help text
- **default**: Default value when creating new record
- **readonly**: Cannot edit this value from the UI
- **group**: The group that this field belongs to
### color ### color
Color picker
required Color picker.
- **name**: The id of the field **Required:** `name`, `label`
- **label**: The friendly name of the field
optional | Property | Description |
|---|---|
| `selectOptions` | Restrict to a predefined palette |
| `optionsFrom` | Schema name to load options from |
| `optionsField` | Field from `optionsFrom` to use as the value |
| `optionsSuggest` | Allow typing new values not in the options list |
- **required**: Is the field required to save the record ---
- **nullable**: Can the field be saved as null
- **help**: Help text
- **default**: Default value when creating new record
- **readonly**: Cannot edit this value from the UI
- **optionsFrom**: Schema to choose options from
- **optionsField**: Field's value to insert
- **optionsSuggest**: Allow to insert new values
- **selectOptions**: Array of options to select from. Or array of objects `[{value,label}]`
- **group**: The group that this field belongs to
### date ### date
Date select
required Date selector. Stores as a date string.
- **name**: The id of the field **Required:** `name`, `label`
- **label**: The friendly name of the field
optional | Property | Description |
|---|---|
| `min` | Minimum date |
| `max` | Maximum date |
| `selectOptions` | Predefined date options |
| `optionsFrom` | Schema name to load options from |
| `optionsField` | Field from `optionsFrom` to use as the value |
- **required**: Is the field required to save the record ---
- **nullable**: Can the field be saved as null
- **min**: Minimum date
- **max**: Maximum date
- **help**: Help text
- **default**: Default value when creating new record
- **readonly**: Cannot edit this value from the UI
- **optionsFrom**: Schema to choose options from
- **optionsField**: Field's value to insert
- **optionsSuggest**: Allow to insert new values
- **selectOptions**: Array of options to select from. Or array of objects `[{value,label}]`
- **group**: The group that this field belongs to
### datetime ### datetime
Date and time selector
required Date and time selector. Stores as an ISO 8601 string.
- **name**: The id of the field **Required:** `name`, `label`
- **label**: The friendly name of the field
optional | Property | Description |
|---|---|
| `min` | Minimum datetime |
| `max` | Maximum datetime |
| `selectOptions` | Predefined datetime options |
| `optionsFrom` | Schema name to load options from |
| `optionsField` | Field from `optionsFrom` to use as the value |
- **required**: Is the field required to save the record ---
- **nullable**: Can the field be saved as null
- **min**: Minimum date ### uuid
- **max**: Maximum date
- **help**: Help text UUID text field. Stores an arbitrary UUID string. Typically used as a read-only external reference ID.
- **default**: Default value when creating new record
- **readonly**: Cannot edit this value from the UI **Required:** `name`, `label`
- **optionsFrom**: Schema to choose options from
- **optionsField**: Field's value to insert ---
- **optionsSuggest**: Allow to insert new values
- **selectOptions**: Array of options to select from. Or array of objects `[{value,label}]`
- **group**: The group that this field belongs to
### json ### json
Json data
required Raw JSON data field. Accepts either a JSON string or a plain array — both are stored as JSON.
- **name**: The id of the field **Required:** `name`, `label`
- **label**: The friendly name of the field
optional ---
- **required**: Is the field required to save the record
- **nullable**: Can the field be saved as null
- **help**: Help text
- **default**: Default value when creating new record
- **readonly**: Cannot edit this value from the UI
- **group**: The group that this field belongs to
### markdown
Markdown editor
required
- **name**: The id of the field
- **label**: The friendly name of the field
optional
- **required**: Is the field required to save the record
- **nullable**: Can the field be saved as null
- **min**: Minimum characters
- **max**: Maximum characters
- **help**: Help text
- **default**: Default value when creating new record
- **readonly**: Cannot edit this value from the UI
- **group**: The group that this field belongs to
### file ### file
Upload or select files
required Upload or select files from a files schema. Files can be uploaded directly or browsed from previously uploaded files. Image files (jpeg, png, webp, gif, tiff) automatically get a 300×300 thumbnail generated on upload.
- **name**: The id of the field **Required:** `name`, `label`, `collections`
- **label**: The friendly name of the field
- **collections**: File collections to choose from
optional | Property | Description |
|---|---|
- **mime**: The mime types allowed to select | `collections` | Array of file schema names to choose from |
- **nullable**: Can the field be saved as null | `mime` | Allowed MIME types e.g. `["image/*"]` |
- **min**: Minimum files | `min` | Minimum number of files |
- **max**: Maximum files | `max` | Maximum number of files |
- **help**: Help text
- **group**: The group that this field belongs to
---
### reference ### reference
Reference other records
required Reference records from another collection.
- **name**: The id of the field **Required:** `name`, `label`, `collections`
- **label**: The friendly name of the field
- **collections**: Collections to choose from
optional | Property | Description |
|---|---|
| `collections` | Array of collection schema names to reference |
| `min` | Minimum number of references |
| `max` | Maximum number of references |
- **nullable**: Can the field be saved as null ---
- **min**: Minimum files
- **max**: Maximum files
- **help**: Help text
- **group**: The group that this field belongs to
## Example Field
### block ```json
The block editor {
"ui": "text",
required "name": "title",
"label": "Title",
- **name**: The id of the field "required": true,
- **label**: The friendly name of the field "min": 3,
- **schema**: The block schema name "max": 200,
"help": "The main title of the post"
optional }
```
- **required**: Is the field required to save the record
- **nullable**: Can the field be saved as null
- **help**: Help text
- **default**: Default value when creating new record
- **readonly**: Cannot edit this value from the UI
- **group**: The group that this field belongs to
)
## Available fields for the Block Editor
### heading
Single-line text
required
- **name**: The id of the field
- **label**: The friendly name of the field
optional
- **min**: Minimum date
- **max**: Maximum date
- **default**: Default value when creating new record
### textarea
Multiline text
required
- **name**: The id of the field
- **label**: The friendly name of the field
optional
- **min**: Minimum date
- **max**: Maximum date
- **default**: Default value when creating new record
### rich
WYSIWYG editor
required
- **name**: The id of the field
- **label**: The friendly name of the field
optional
- **min**: Minimum date
- **max**: Maximum date
- **default**: Default value when creating new record
### markdown
Markdown editor
required
- **name**: The id of the field
- **label**: The friendly name of the field
optional
- **min**: Minimum date
- **max**: Maximum date
- **default**: Default value when creating new record
### file
Choose files
required
- **name**: The id of the field
- **label**: The friendly name of the field
- **collections**: File collections to choose from
optional
- **mime**: The mime types allowed to select
- **min**: Minimum date
- **max**: Maximum date
- **default**: Default value when creating new record
### reference
Choose files
required
- **name**: The id of the field
- **label**: The friendly name of the field
- **collections**: Collections to choose from
optional
- **min**: Minimum date
- **max**: Maximum date
- **default**: Default value when creating new record
+133 -52
View File
@@ -5,88 +5,169 @@ include_toc: true
# Queries # Queries
## Graph or Tree The `Query` class is the main way to fetch records. Inject it via the Laravel container.
Queries can return results in 2 formats. A graph or a tree.
Graphs results are a collection of records (nodes) and a collection of edges. This format is more useful for network visualization.
The tree format is more straightforward as it returns a collection of records. Each record has a **_children** and a **_parents** field and the tree can continue upwards or downwards according to the depth you have requested.
For example to request records with their children and their children's children:
```php ```php
$query->childrenDepth(2); public function __construct(private Query $query) {}
``` ```
Maybe you only want to get a specific type of relationship:
```php ## Return Formats
$query->childrenDepth(2)->childrenFields(["categories"]);
``` Queries return results in two formats:
**Graph** — via `->run()`. Returns a `Graph` object with `records` and `edges` collections. Useful for network-style data.
**Tree** — via `->tree()`. Returns a flat `Collection` of records where each record has `_children` and `_parents` arrays populated based on the requested depth. This is the most common format.
## Chaining Methods
All methods return `$this` and can be chained:
| Method | Description |
|---|---|
| `->filter(array)` | Add an AND filter |
| `->orFilter(array)` | Add an OR filter (grouped) |
| `->limit(int)` | Max number of root records to return |
| `->skip(int)` | Offset for pagination |
| `->sort(string)` | Sort by field. Prefix with `-` for descending e.g. `"-_sys.updatedAt"` |
| `->status(array)` | Filter by status array e.g. `["published", "draft"]` |
| `->onlyPublished()` | Shorthand for `->status(["published"])` |
| `->childrenDepth(int)` | How many levels of children to load |
| `->childrenLimit(int)` | Max children per record |
| `->childrenFields(array)` | Only follow specific relationship fields |
| `->parentsDepth(int)` | How many levels of parents to load |
| `->parentsLimit(int)` | Max parents per record |
| `->parentFields(array)` | Only follow specific relationship fields |
| `->notLinked(string)` | Return only records with no parents |
| `->run()` | Execute and return a `Graph` |
| `->tree()` | Execute and return a `Collection` (tree format) |
| `->runWithCount()` | Execute and return a `Graph` with a `total` count |
## Filters ## Filters
You can filter your query with the following format: Filter keys use the format `field_operator`. When no operator suffix is given, `eq` is assumed.
```php ```php
$query->filter(["field_operator" => "value"]); $query->filter(["field_operator" => "value"]);
// example: // No operator = eq
$query->filter(["schema" => "blogPosts"]);
$query->filter(["date_lt" => "2020-09-15"]); // With operator
$query->filter(["_sys.updatedAt_gte" => "2024-01-01"]);
``` ```
Or filters are also available: ### Operator Reference
| Operator | Description |
|---|---|
| _(none)_ or `eq` | Equals (string) |
| `ne` | Not equals (string) |
| `eqnum` | Equals (numeric) |
| `neqnum` | Not equals (numeric) |
| `eqtrue` | Equals `true` |
| `eqfalse` | Equals `false` |
| `netrue` | Not equals `true` |
| `nefalse` | Not equals `false` |
| `regex` | Regular expression match |
| `in` | Value is in array (strings) |
| `nin` | Value is not in array (strings) |
| `innum` | Value is in array (numeric) |
| `ninnum` | Value is not in array (numeric) |
| `lt` | Less than |
| `lte` | Less than or equal |
| `gt` | Greater than |
| `gte` | Greater than or equal |
| `null` | Field is null |
| `nnull` | Field is not null |
| `exists` | Field key exists |
| `nexists` | Field key does not exist |
| `filter` | Raw filter passthrough |
### OR Filters
```php ```php
$query $query
->filter(["price_eqn" => 10]) ->filter(["schema" => "blogPosts"])
->orFilter(["title_regex" => "search", "slug_regex" => "search"]) ->orFilter(["title_regex" => "search", "slug_regex" => "search"]);
;
``` ```
## Operator List
- regex Each `orFilter` call groups its arguments with OR between them. Multiple `orFilter` / `filter` calls are AND-ed together.
- eq
- ne
- eqnum
- neqnum
- filter
- eqtrue
- eqfalse
- netrue
- nefalse
- in:
- innum
- nin
- ninnum
- lt
- lte
- gt
- gte
- null
- nnull
- exists
- nexists
## Example ### Cross-Schema (Children) Filters
Get 10 posts from the sports category as a tree You can filter records by properties of their related records using the `children.` prefix:
```php
$query->filter([
"schema" => "blogPosts",
"children.categories.data.slug" => "sports",
]);
```
This returns `blogPosts` that have a child in `categories` where `slug` equals `sports`.
## Nested Data Fields
Use dot notation to filter on JSON data fields and system fields:
```php
// Filter on a data field
$query->filter(["data.status_eq" => "draft"]);
// Filter on a system field
$query->filter(["_sys.updatedAt_gte" => "2024-01-01"]);
```
## Examples
**Get published blog posts, newest first:**
```php
$posts = $query
->filter(["schema" => "blogPosts"])
->onlyPublished()
->sort("-_sys.updatedAt")
->limit(10)
->tree();
```
**Get posts from a specific category with children loaded:**
```php ```php
$posts = $query $posts = $query
->filter([ ->filter([
"schema" => "posts", "schema" => "blogPosts",
"children.categories.data.slug" => "sports", "children.categories.data.slug" => "sports",
] ])
)
->childrenDepth(1) ->childrenDepth(1)
->childrenFields(["categories"])
->limit(10) ->limit(10)
->tree(); ->tree();
$posts->map(...)->toArray();
``` ```
**Paginate records:**
```php
$graph = $query
->filter(["schema" => "blogPosts"])
->limit(20)
->skip(40)
->runWithCount();
$posts = $graph->tree();
$total = $graph->total;
```
**Search across fields:**
```php
$results = $query
->filter(["schema" => "blogPosts"])
->orFilter(["title_regex" => $term, "slug_regex" => $term])
->limit(10)
->tree();
```
+74 -41
View File
@@ -5,76 +5,106 @@ include_toc: true
# Schemas # Schemas
Schemas define both the shape of your data and how the UI on the admin will behave. Schemas define both the shape of your data and how the admin UI behaves.
There are 3 types of schemas There are 2 types of schemas:
- Collections: Normal data - **collection** — Regular data records
- Files: Images and files - **files** — Images and file uploads
- Block: Used in the block editor
## Collection Reference ## Collection Reference
- **name**: The ID of the collection. Camelcase and plural is the recommended format ex. blogPosts | Field | Required | Description |
- **label**: The friendly name of the schema |---|---|---|
- **type**: The type of the collection. Should be "collection" | `name` | yes | Unique ID. Use camelCase plural e.g. `blogPosts` |
- **visible**: An array of field id to show on the content browser _optional_ | `label` | yes | Friendly display name |
- **groups**: A list if group ids to separate your field in different tabs _optional_ | `type` | yes | Must be `"collection"` |
- **fields**: The list of your fields. Look the field reference for more | `fields` | yes | Array of field definitions. See [Fields](Fields.md) |
- **isEntry**: If this schema is important, it will show be visible on the main the sidebar. Default: false _optional_ | `visible` | no | Field IDs to show in the content browser list |
- **sortBy**: The default sorting in the content browser _optional_ | `groups` | no | Group IDs to split fields into tabs |
- **titleTemplate**: Mustache code to customize the preview field _optional_ | `isEntry` | no | Show in sidebar. Default: `false` |
- **revisions**: How many revisions are going to be kept for each record _optional_ | `sortBy` | no | Default sort in browser. Prefix with `-` for descending e.g. `-_sys.updatedAt` |
- **read**: Array of user groups that have read permissions _optional_ | `cardTitle` | no | Mustache template for the record preview title e.g. `{{name}} - {{slug}}` |
- **write**: Array of user groups that have write permissions _optional_ | `cardImage` | no | Field name to use as the preview image |
| `revisions` | no | Number of revisions to keep per record. Default: `0` (disabled) |
| `read` | no | Roles with read access. Empty means all roles can read |
| `write` | no | Roles with write access. Empty means all roles can write |
## Files Reference ## Files Reference
- **name**: The ID of the collection. Camelcase and plural is the recommended format ex. blogPosts | Field | Required | Description |
- **label**: The friendly name of the schema |---|---|---|
- **type**: The type of the collection. Should be "files" | `name` | yes | Unique ID. Use camelCase plural e.g. `heroImages` |
- **path**: The relative directory that these files will be stored. | `label` | yes | Friendly display name |
- **groups**: A list if group ids to separate your field in different tabs _optional_ | `type` | yes | Must be `"files"` |
- **fields**: The list of your fields. Look the field reference for more | `fields` | yes | Array of field definitions. See [Fields](Fields.md) |
- **isEntry**: If this schema is important, it will show be visible on the main the sidebar _optional_ | `groups` | no | Group IDs to split fields into tabs |
- **sortBy**: The default sorting in the content browser _optional_ | `isEntry` | no | Show in sidebar. Default: `false` |
- **titleTemplate**: Mustache code to customize the preview field _optional_ | `sortBy` | no | Default sort in browser |
- **revisions**: How many revisions are going to be kept for each record _optional_ | `cardTitle` | no | Mustache template for the record preview title |
- **read**: Array of user groups that have read permissions _optional_ | `cardImage` | no | Field name to use as the preview image |
- **write**: Array of user groups that have write permissions _optional_ | `revisions` | no | Number of revisions to keep per record |
| `read` | no | Roles with read access |
| `write` | no | Roles with write access |
### File Metadata
Every uploaded file is automatically stored with the following metadata (stored in `lucent_files`):
| Field | Description |
|---|---|
| `id` | Unique file ID |
| `recordId` | ID of the record this file belongs to |
| `originalName` | Original filename as uploaded |
| `mime` | MIME type e.g. `image/webp` |
| `path` | Storage path e.g. `files/{recordId}/{filename}` |
| `size` | File size in bytes |
| `width` | Image width in pixels (0 for non-images) |
| `height` | Image height in pixels (0 for non-images) |
| `checksum` | SHA-1 hash of the file contents |
Image files (jpeg, png, webp, gif, tiff) also get a 300×300 thumbnail generated automatically at `thumbs/{path}`, plus any image filter presets configured in `lucent.imageFilters`.
## Block Reference ## System Fields
- **name**: The ID of the collection. Camelcase and plural is the recommended format ex. blogPosts Every record automatically has these read-only system fields available in queries:
- **label**: The friendly name of the schema
- **type**: The type of the collection. Should be "block" | Field | Description |
- **fields**: The list of your fields. Look the field reference for more |---|---|
| `_sys.createdAt` | ISO 8601 creation timestamp |
| `_sys.updatedAt` | ISO 8601 last update timestamp |
| `_sys.createdBy` | User ID who created the record |
| `_sys.updatedBy` | User ID who last updated the record |
| `_sys.version` | Revision version number |
| `status` | `draft` or `published` |
A full Collection example without the fields: ## Example
```json ```json
{ {
"label": "Departments", "schemas": [
"name": "departments", {
"label": "Blog Posts",
"name": "blogPosts",
"isEntry": true, "isEntry": true,
"type": "collection", "type": "collection",
"visible": [ "visible": [
"title",
"slug", "slug",
"cover",
"_sys.updatedAt", "_sys.updatedAt",
"status" "status"
], ],
"groups": [ "groups": [
"Extra Info", "Content",
"Metadata",
"SEO" "SEO"
], ],
"sortBy": "-_sys.createdAt", "sortBy": "-_sys.createdAt",
"titleTemplate": "{{name}} {{slug}}", "cardTitle": "{{title}}",
"cardImage": "cover",
"revisions": 15, "revisions": 15,
"read": [ "read": [
"admin", "admin",
@@ -87,4 +117,7 @@ A full Collection example without the fields:
], ],
"fields": [] "fields": []
} }
],
"roles": ["admin", "editors", "reviewers"]
}
``` ```
+87 -28
View File
@@ -5,51 +5,94 @@ To generate the static content of the website, lucent provides a helper class.
## Laravel Command ## Laravel Command
Just create a command and name it as you like. Make sure to inject the StaticGenerator class. Create an Artisan command and inject `StaticGenerator`:
```php ```php
class GenerateStatic extends Command
{
protected $signature = 'generate:static';
public function __construct( public function __construct(
public StaticGenerator $staticGenerator, public StaticGenerator $staticGenerator,
public Context $ctx,
) { ) {
parent::__construct(); parent::__construct();
} }
```
## Redirect command public function handle(): void
{
There are cases which is useful to create a redirect like when you have a multilingual website: $this->staticGenerator->run('generate:static', function ($writer) {
```php
$this->staticGenerator->run(function ($writer) {
$writer->createRedirect("/", "/el");
});
```
## The Writer save command
In order to create an html file, you have to use the writer's save command
The first argument is the url and the second is the rendered HTML. That's where the page classes do come handy.
```php
$this->staticGenerator->run(function ($writer) {
$writer->save("/", $this->ctx->render("homepage")); $writer->save("/", $this->ctx->render("homepage"));
$writer->save("/about", $this->ctx->render("about")); $writer->save("/about", $this->ctx->render("about"));
}); });
}
}
``` ```
`run(string $signature, callable $callback)` — the first argument must match the command's artisan signature. This is used to stream live build logs in the Lucent UI. The callback receives a `Writer` instance.
## Writer: save
Writes an HTML file at the given path:
```php
$writer->save("/blog/my-post", $html);
// writes to: storage/lucent/build/blog/my-post/index.html
```
An optional third argument changes the file extension (default `"html"`).
## Writer: createRedirect
Generates an HTML meta-refresh redirect. Useful for root-level locale redirects:
```php
$writer->createRedirect("/", "/el");
$writer->createRedirect("/", "/el", "Redirecting", "Please wait...");
```
Arguments: `from`, `to`, `title` (default `"Redirecting"`), `message` (default `"Redirecting Soon..."`).
## Writer: recordIterator
Iterates over all records in paginated batches — useful when there are too many records to load at once:
```php
$writer->recordIterator(
query: fn(int $limit, int $skip) => $query
->filter(["schema" => "blogPosts"])
->onlyPublished()
->limit($limit)
->skip($skip)
->tree(),
parser: function ($records) use ($writer) {
foreach ($records as $record) {
$writer->save(
"/blog/" . $record->data->slug,
$this->ctx->render("blogPost", $record),
);
}
},
);
```
Signature: `recordIterator(callable $query, callable $parser, int $skip = 0, int $limit = 100): int`
The `$query` callable receives `($limit, $skip)` and must return a collection. Iteration stops automatically when a batch returns zero records.
## Storage and Permissions ## Storage and Permissions
All the generated html is stored on `storage/lucent/live` All generated HTML is written to `storage/lucent/build` during the run, then atomically swapped to `storage/lucent/live` on completion. Create the public symlink with:
In order to make it accessible you have to create symlink:
```bash ```bash
php artisan lucent:livelink php artisan lucent:livelink
``` ```
Now your static website is accessible in http://localhost:8000/live The static site is then accessible at `http://localhost:8000/live`. To serve it without the `/live` prefix, add this to your nginx vhost:
But it would not be nice to have the **live** prefix everywhere. That's why you need to make the following tweak in the nginx vhost
```nginxconf ```nginxconf
location / { location / {
@@ -57,14 +100,30 @@ location / {
} }
``` ```
## Artisan Commands
| Command | Description |
|---|---|
| `lucent:setup-db` | Create all Lucent database tables |
| `lucent:schemas` | Compile schema JSON files |
| `lucent:livelink` | Create the `public/live` symlink |
| `lucent:rebuild:thumbnails` | Regenerate thumbnails for all uploaded images |
| `lucent:removeOrphanEdges` | Remove edges pointing to deleted records |
| `lucent:generate:collection {name}` | Scaffold a new collection schema JSON file |
## Build from the Lucent UI ## Build from the Lucent UI
In your lucent.php config file you can define your command that is used to generate the static files: Register your generate command in `config/lucent.php` so admin users can trigger it from the UI:
```php ```php
"generateCommand" => "generate:static" "commands" => [
"generate:static" => "Generate Static Site",
],
``` ```
That way, the users will be able to initiate the build command through the user interface.
Only roles listed in `canBuild` can trigger commands from the UI.
+110
View File
@@ -99,3 +99,113 @@ class Context
``` ```
Add the middleware inside the HTTP Kernel file. Add the middleware inside the HTTP Kernel file.
## Configuration
After publishing the config (`php artisan vendor:publish --tag=lucent-config`), configure `config/lucent.php` via `.env`:
| Key | Env var | Default | Description |
|---|---|---|---|
| `env` | `LUCENT_ENV` | `production` | `production` or `development` |
| `auth` | `LUCENT_AUTH` | `lucent` | Auth driver: `lucent` or `lunar` |
| `disk` | `LUCENT_DISK` | `public` | Laravel filesystem disk for uploads |
| `schemas_path` | `LUCENT_SCHEMAS_PATH` | `resources/lucent/schemas` | Where schema JSON files live |
| `database` | `LUCENT_DB_CONNECTION` | `DB_CONNECTION` | Database connection name |
| `name` | `LUCENT_NAME` | `Lucent` | CMS display name |
| `url` | `LUCENT_URL` | `APP_URL` | Base URL of the CMS |
| `previewTarget` | `LUCENT_PREVIEW_TARGET` | `previewTarget` | Preview route parameter |
| `commands` | — | `[]` | Artisan commands exposed to admin users (see [Static Generator](Static%20Generator.md)) |
| `imageFilters` | — | `[]` | Image filter presets applied to uploads (see below) |
| `canInvite` | — | `["admin"]` | Roles that can invite new users |
| `canBuild` | — | `["admin"]` | Roles that can trigger static builds |
| `systemUserId` | — | `""` | User ID used for console-initiated record writes |
## Image Filters
Image filters are Intervention Image filter classes applied to every uploaded image, producing additional versions (e.g. a cropped or watermarked variant). Each preset is stored at `templates/{name}/{original-path}` on the configured disk.
Define filters in `config/lucent.php`:
```php
"imageFilters" => [
"hero" => \App\ImageFilters\HeroFilter::class,
"thumb" => \App\ImageFilters\ThumbFilter::class,
],
```
A filter class must implement `Intervention\Image\Filters\FilterInterface`:
```php
namespace App\ImageFilters;
use Intervention\Image\Filters\FilterInterface;
use Intervention\Image\Image;
class HeroFilter implements FilterInterface
{
public function applyFilter(Image $image): Image
{
return $image->fit(1200, 600)->encode('webp', 80);
}
}
```
Every uploaded image automatically gets a 300×300 WebP thumbnail at `thumbs/{path}` in addition to any configured presets.
## Authentication
Lucent uses **email-link (magic link) login** — no passwords. Users receive a time-limited link by email.
### Auth modes
Set `LUCENT_AUTH` to choose how users are stored:
| Value | Description |
|---|---|
| `lucent` | Users stored in the `lucent_users` table. Supports roles. |
| `lunar` | Delegates to Lunar's `lunar_staff` table. Roles not supported. |
### Login flow
1. User submits their email at `/lucent/login`
2. A 32-character token is stored against the user with a timestamp
3. Lucent emails a login link containing the token
4. User clicks the link → token is validated (must be used within **1 hour**)
5. Session is established; token is cleared
### First-time setup
The `/lucent/register` route is only available when **no users exist** in the system. Once the first admin registers, the route returns a redirect to `/lucent/login`. Registration automatically assigns the `admin` role and sends a login link.
### Middleware
Two middleware aliases are available for your routes:
| Alias | Description |
|---|---|
| `lucent.auth` | Requires an active Lucent session |
| `lucent.guest` | Redirects authenticated users away |
### Roles
Roles are defined in your channel config. Only roles listed there are valid — anything else is silently stripped on assignment. The `canInvite` and `canBuild` config keys control which roles can invite users and trigger builds respectively.
On console commands and non-`/lucent` routes, `currentUserId()` returns `config("lucent.systemUserId")` instead of the session user.
## Database Tables
All Lucent-managed tables use the `lucent_` prefix:
| Table | Description |
|---|---|
| `lucent_records` | All collection and file schema records |
| `lucent_files` | Uploaded file metadata |
| `lucent_edges` | Relationships between records |
| `lucent_revisions` | Record revision history |
| `lucent_users` | Users (when using `lucent` auth mode) |
| `lucent_command_logs` | Background command execution logs |
These are created automatically by running `php artisan lucent:setup`.
+1
View File
@@ -0,0 +1 @@
@charset "UTF-8";:root{--p10: #f4f9ff;--p20: #eaf1f9;--p30: #b3ceff;--p40: #8db5ff;--p50: #70a2ff;--p60: #679cff;--p70: #4284ff;--p80: #1c6bff;--p90: #002b7a;--p100: #000C23;--suc10: #d1ffb8;--suc20: #d1ffb8;--suc30: #b5ff8d;--suc40: #a2ff70;--suc50: #82cc5a;--suc80: #71b34e;--suc90: #314c22;--err10: #ffb9d0;--err20: #ff9bb3;--err30: #fe7e97;--err40: #de617b;--err50: #be4461;--err80: #61001a;--err90: #560012;--grey-dark: #424656;--grey-light: #a6abbd;--text: var(--p100);--text-light: var(--grey-dark);--text-error: var(--err50);--main-font: ‘Open Sans‘, Arial, Helvetica, sans-serif}*,*:before,*:after{box-sizing:border-box}*{margin:0}body{line-height:1.5;-webkit-font-smoothing:antialiased}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word}#root,#__next{isolation:isolate}.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-5{margin-top:20px}.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-5{margin-bottom:20px}.pt-1{padding-top:4px}.pt-2{padding-top:8px}.pt-3{padding-top:12px}.pt-4{padding-top:16px}.pt-5{padding-top:20px}.pb-1{padding-bottom:4px}.pb-2{padding-bottom:8px}.pb-3{padding-bottom:12px}.pb-4{padding-bottom:16px}.pb-5{padding-bottom:20px}.gap-1{gap:4px}.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-5{gap:20px}.hide{display:none!important}.hidden{visibility:hidden}.d-block{display:block}.d-inline-block{display:inline-block}.is-bold{font-weight:700}.in-place{padding:36px}.notice{background-color:var(--p20);padding:14px;margin:2rem 0;position:relative;font-size:16px;line-height:24px;border-radius:12px}.notice .title{content:"NOTE";border-radius:12px;display:block;font-weight:700}.notice.notice-success{background:var(--suc20)}.notice.notice-error{background:var(--err10)}.scope-login{display:flex;height:100vh}.scope-login .bg-image{width:50%;background:url(/vendor/lucent/public/art.jpg);background-size:cover;background-repeat:no-repeat;background-position:center center}.scope-login .login-form{width:50%;height:100vh;display:flex;align-items:center;justify-content:center}.content{font-size:16px;line-height:20px;font-family:var(--main-font);color:var(--text)}.content p{margin-bottom:14px}.content p:last-child{margin-bottom:0}.content h1{font-size:24px;line-height:34px}.content h2{font-size:20px;line-height:30px}.content h3{font-size:18px;line-height:28px}.content ul{padding:0 0 0 16px;list-style:none outside none}.content ul li:before{content:"—";opacity:.5;font-size:12px;padding-right:6px;vertical-align:10%}.content ul li{list-style:none;padding:0}.content code{background:var(--p30);padding:0 6px;border-radius:12px}.content img{margin-bottom:14px}.content blockquote{border:1px solid var(--p30);border-radius:12px;padding:12px 40px;position:relative}.content blockquote:before{content:"“";color:var(--p60);font-size:4em;position:absolute;left:10px;top:20px}.content blockquote:after{content:""}.content pre{background:var(--grey-light);border-radius:.5rem;color:var(--white);font-family:JetBrainsMono,monospace;margin:1.5rem 0;padding:.75rem 1rem}.content pre code{background:none;color:inherit;font-size:.8rem;padding:0}.lx-small-text{font-size:12px;line-height:15px}.light-text{color:var(--text-light)}.sidebar-top{border:0px solid var(--p30);font-size:18px;padding:20px;display:flex;align-items:center;justify-content:space-between;background:var(--p20);margin-bottom:15px;border-radius:12px}.sidebar{border-radius:12px;font-size:15px;line-height:28px;padding:20px;background:var(--p20);display:flex;flex-direction:column;gap:3px}.sidebar-header{display:flex;cursor:pointer;justify-content:space-between;align-items:center;background:var(--p30);font-size:16px;padding:3px 12px;color:var(--text);border:none;border-radius:12px}.sidebar-header:focus{box-shadow:none}.sidebar-header:hover{background:var(--p40)}.sidebar-header:last-child{border-bottom:none}.sidebar-item{color:var(--text);display:block;font-size:14px;padding:3px 12px;text-decoration:none;transition:.6s;border-radius:12px}.sidebar-item:last-child{border-bottom:none}.sidebar-item:hover{background:var(--p30)}.sidebar-item.active{background:var(--p40)}.top-nav{display:flex;justify-content:end;align-items:center;gap:10px}.top-nav-item{border-radius:12px;font-size:14px;background:var(--p20);padding:3px 10px}.top-nav-item:hover{background:var(--p30)}label{display:block;font-weight:700;margin-bottom:4px}input[type=text],input[type=number],input[type=search],input[type=email],textarea{width:100%;background:var(--p20);border:1px solid var(--p50);border-radius:5px;padding:5px 7px;font-size:16px}input[type=text]:focus,input[type=number]:focus,input[type=search]:focus,input[type=email]:focus,textarea:focus{background:var(--p10)}textarea{resize:none}select{width:100%;background:var(--p20);border:1px solid var(--p50);border-radius:5px;padding:5px 7px;font-size:16px}select:focus{backgrouLine truncated
+212
View File
@@ -0,0 +1,212 @@
var bP=Object.defineProperty;var vP=(i,e,t)=>e in i?bP(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Qh=(i,e,t)=>(vP(i,typeof e!="symbol"?e+"":e,t),t);function U(){}const wP=i=>i;function Cs(i,e){for(const t in e)i[t]=e[t];return i}function ty(i){return i()}function tg(){return Object.create(null)}function ut(i){i.forEach(ty)}function nh(i){return typeof i=="function"}function re(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let qa;function ad(i,e){return i===e?!0:(qa||(qa=document.createElement("a")),qa.href=e,i===qa.href)}function yP(i){return Object.keys(i).length===0}function Gl(i,e,t,n){if(i){const r=ny(i,e,t,n);return i[0](r)}}function ny(i,e,t,n){return i[1]&&n?Cs(t.ctx.slice(),i[1](n(e))):t.ctx}function Hl(i,e,t,n){if(i[2]&&n){const r=i[2](n(t));if(e.dirty===void 0)return r;if(typeof r=="object"){const s=[],o=Math.max(e.dirty.length,r.length);for(let l=0;l<o;l+=1)s[l]=e.dirty[l]|r[l];return s}return e.dirty|r}return e.dirty}function Kl(i,e,t,n,r,s){if(r){const o=ny(e,t,n,s);i.p(o,r)}}function Jl(i){if(i.ctx.length>32){const e=[],t=i.ctx.length/32;for(let n=0;n<t;n++)e[n]=-1;return e}return-1}function kP(i){return i&&nh(i.destroy)?i.destroy:U}function ng(i){const e=typeof i=="string"&&i.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[i,"px"]}const iy=typeof window<"u";let SP=iy?()=>window.performance.now():()=>Date.now(),Xm=iy?i=>requestAnimationFrame(i):U;const oo=new Set;function ry(i){oo.forEach(e=>{e.c(i)||(oo.delete(e),e.f())}),oo.size!==0&&Xm(ry)}function _P(i){let e;return oo.size===0&&Xm(ry),{promise:new Promise(t=>{oo.add(e={c:i,f:t})}),abort(){oo.delete(e)}}}const CP=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function v(i,e){i.appendChild(e)}function sy(i){if(!i)return document;const e=i.getRootNode?i.getRootNode():i.ownerDocument;return e&&e.host?e:i.ownerDocument}function PP(i){const e=y("style");return e.textContent="/* empty */",AP(sy(i),e),e.sheet}function AP(i,e){return v(i.head||i,e),e.sheet}function A(i,e,t){i.insertBefore(e,t||null)}function P(i){i.parentNode&&i.parentNode.removeChild(i)}function mt(i,e){for(let t=0;t<i.length;t+=1)i[t]&&i[t].d(e)}function y(i){return document.createElement(i)}function xP(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function W(i){return document.createTextNode(i)}function D(){return W(" ")}function De(){return W("")}function G(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function Ln(i){return function(e){return e.preventDefault(),i.call(this,e)}}function O(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function Ko(i,e,t){const n=e.toLowerCase();n in i?i[n]=typeof i[n]=="boolean"&&t===""?!0:t:e in i?i[e]=typeof i[e]=="boolean"&&t===""?!0:t:O(i,e,t)}function oy(i){let e;return{p(...t){e=t,e.forEach(n=>i.push(n))},r(){e.forEach(t=>i.splice(i.indexOf(t),1))}}}function ly(i){return i===""?null:+i}function TP(i){return Array.from(i.childNodes)}function K(i,e){e=""+e,i.data!==e&&(i.data=e)}function Ie(i,e){i.value=e??""}function fe(i,e,t,n){t==null?i.style.removeProperty(e):i.style.setProperty(e,t,"")}function ig(i,e,t){for(let n=0;n<i.options.length;n+=1){const r=i.options[n];if(r.__value===e){r.selected=!0;return}}(!t||e!==void 0)&&(i.selectedIndex=-1)}function QP(i){const e=i.querySelector(":checked");return e&&e.__value}function Ae(i,e,t){i.classList.toggle(e,!!t)}function ay(i,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:e,bubbles:t,cancelable:n})}function Fr(i,e){return new i(e)}const su=new Map;let ou=0;function MP(i){let e=5381,t=i.length;for(;t--;)e=(e<<5)-e^i.charCodeAt(t);return e>>>0}function EP(i,e){const t={stylesheet:PP(e),rules:{}};return su.set(i,t),t}function rg(i,e,t,n,r,s,o,l=0){const a=16.666/n;let c=`{
`;for(let g=0;g<=1;g+=a){const b=e+(t-e)*s(g);c+=g*100+`%{${o(b,1-b)}}
`}const u=c+`100% {${o(t,1-t)}}
}`,h=`__svelte_${MP(u)}_${l}`,f=sy(i),{stylesheet:d,rules:m}=su.get(f)||EP(f,i);m[h]||(m[h]=!0,d.insertRule(`@keyframes ${h} ${u}`,d.cssRules.length));const p=i.style.animation||"";return i.style.animation=`${p?`${p}, `:""}${h} ${n}ms linear ${r}ms 1 both`,ou+=1,h}function RP(i,e){const t=(i.style.animation||"").split(", "),n=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),r=t.length-n.length;r&&(i.style.animation=n.join(", "),ou-=r,ou||DP())}function DP(){Xm(()=>{ou||(su.forEach(i=>{const{ownerNode:e}=i.stylesheet;e&&P(e)}),su.clear())})}let ea;function xl(i){ea=i}function Zo(){if(!ea)throw new Error("Function called outside component initialization");return ea}function Ti(i){Zo().$$.on_mount.push(i)}function cy(i){Zo().$$.after_update.push(i)}function uy(i){Zo().$$.on_destroy.push(i)}function nn(){const i=Zo();return(e,t,{cancelable:n=!1}={})=>{const r=i.$$.callbacks[e];if(r){const s=ay(e,t,{cancelable:n});return r.slice().forEach(o=>{o.call(i,s)}),!s.defaultPrevented}return!0}}function Tl(i,e){return Zo().$$.context.set(i,e),e}function je(i){return Zo().$$.context.get(i)}function Lr(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const Gs=[],Se=[];let lo=[];const cd=[],$P=Promise.resolve();let ud=!1;function LP(){ud||(ud=!0,$P.then(hy))}function Ps(i){lo.push(i)}function nt(i){cd.push(i)}const Mh=new Set;let zs=0;function hy(){if(zs!==0)return;const i=ea;do{try{for(;zs<Gs.length;){const e=Gs[zs];zs++,xl(e),IP(e.$$)}}catch(e){throw Gs.length=0,zs=0,e}for(xl(null),Gs.length=0,zs=0;Se.length;)Se.pop()();for(let e=0;e<lo.length;e+=1){const t=lo[e];Mh.has(t)||(Mh.add(t),t())}lo.length=0}while(Gs.length);for(;cd.length;)cd.pop()();ud=!1,Mh.clear(),xl(i)}function IP(i){if(i.fragment!==null){i.update(),ut(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(Ps)}}function NP(i){const e=[],t=[];lo.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),lo=e}let Jo;function ZP(){return Jo||(Jo=Promise.resolve(),Jo.then(()=>{Jo=null})),Jo}function Eh(i,e,t){i.dispatchEvent(ay(`${e?"intro":"outro"}${t}`))}const Lc=new Set;let sr;function me(){sr={r:0,c:[],p:sr}}function pe(){sr.r||ut(sr.c),sr=sr.p}function T(i,e){i&&i.i&&(Lc.delete(i),i.i(e))}function R(i,e,t,n){if(i&&i.o){if(Lc.has(i))return;Lc.add(i),sr.c.push(()=>{Lc.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}const BP={duration:0};function lu(i,e,t,n){let s=e(i,t,{direction:"both"}),o=n?0:1,l=null,a=null,c=null,u;function h(){c&&RP(i,c)}function f(m,p){const g=m.b-o;return p*=Math.abs(g),{a:o,b:m.b,d:g,duration:p,start:m.start,end:m.start+p,group:m.group}}function d(m){const{delay:p=0,duration:g=300,easing:b=wP,tick:w=U,css:S}=s||BP,_={start:SP()+p,b:m};m||(_.group=sr,sr.r+=1),"inert"in i&&(m?u!==void 0&&(i.inert=u):(u=i.inert,i.inert=!0)),l||a?a=_:(S&&(h(),c=rg(i,o,m,g,p,b,S)),m&&w(0,1),l=f(_,g),Ps(()=>Eh(i,m,"start")),_P(k=>{if(a&&k>a.start&&(l=f(a,g),a=null,Eh(i,l.b,"start"),S&&(h(),c=rg(i,o,l.b,l.duration,0,b,s.css))),l){if(k>=l.end)w(o=l.b,1-o),Eh(i,l.b,"end"),a||(l.b?h():--l.group.r||ut(l.group.c)),l=null;else if(k>=l.start){const Q=k-l.start;o=l.a+l.d*b(Q/l.duration),w(o,1-o)}}return!!(l||a)}))}return{run(m){nh(s)?ZP().then(()=>{s=s({direction:m?"in":"out"}),d(m)}):d(m)},end(){h(),l=a=null}}}function ue(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function Fm(i,e){i.d(1),e.delete(i.key)}function mr(i,e){R(i,1,1,()=>{e.delete(i.key)})}function di(i,e,t,n,r,s,o,l,a,c,u,h){let f=i.length,d=s.length,m=f;const p={};for(;m--;)p[i[m].key]=m;const g=[],b=new Map,w=new Map,S=[];for(m=d;m--;){const x=h(r,s,m),C=t(x);let M=o.get(C);M?S.push(()=>M.p(x,e)):(M=c(C,x),M.c()),b.set(C,g[m]=M),C in p&&w.set(C,Math.abs(m-p[C]))}const _=new Set,k=new Set;function Q(x){T(x,1),x.m(l,u),o.set(x.key,x),u=x.first,d--}for(;f&&d;){const x=g[d-1],C=i[f-1],M=x.key,$=C.key;x===C?(u=x.first,f--,d--):b.has($)?!o.has(M)||_.has(M)?Q(x):k.has($)?f--:w.get(M)>w.get($)?(k.add(M),Q(x)):(_.add($),f--):(a(C,o),f--)}for(;f--;){const x=i[f];b.has(x.key)||a(x,o)}for(;d;)Q(g[d-1]);return ut(S),g}function So(i,e){const t={},n={},r={$$scope:1};let s=i.length;for(;s--;){const o=i[s],l=e[s];if(l){for(const a in o)a in l||(n[a]=1);for(const a in l)r[a]||(t[a]=l[a],r[a]=1);i[s]=l}else for(const a in o)r[a]=1}for(const o in n)o in t||(t[o]=void 0);return t}function _o(i){return typeof i=="object"&&i!==null?i:{}}function He(i,e,t){const n=i.$$.props[e];n!==void 0&&(i.$$.bound[n]=t,t(i.$$.ctx[n]))}function V(i){i&&i.c()}function Y(i,e,t){const{fragment:n,after_update:r}=i.$$;n&&n.m(e,t),Ps(()=>{const s=i.$$.on_mount.map(ty).filter(nh);i.$$.on_destroy?i.$$.on_destroy.push(...s):ut(s),i.$$.on_mount=[]}),r.forEach(Ps)}function z(i,e){const t=i.$$;t.fragment!==null&&(NP(t.after_update),ut(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function WP(i,e){i.$$.dirty[0]===-1&&(Gs.push(i),LP(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function se(i,e,t,n,r, Line truncated
<img alt="indicator" id="indicator" class="htmx-indicator" src="/img/spinner.svg"/>`,O(t,"class","mb-5"),O(u,"for","emailaddress"),O(u,"class","form-label"),O(f,"type","email"),O(f,"class","form-control"),O(f,"id","emailaddress"),f.required=!0,O(c,"class","mt-5 mb-3"),O(m,"class","bt bt-primary"),O(e,"class","form")},m(b,w){A(b,e,w),v(e,t),v(e,n),v(e,r),v(r,s),v(r,o),v(r,l),v(r,a),v(r,c),v(c,u),v(c,h),v(c,f),Ie(f,i[0]),v(r,d),v(r,m),p||(g=[G(f,"input",i[3]),G(r,"submit",i[2])],p=!0)},p(b,w){w&1&&f.value!==b[0]&&Ie(f,b[0])},d(b){b&&P(e),p=!1,ut(g)}}}function dx(i){let e,t,n,r,s,o,l,a;return{c(){e=y("div"),t=y("p"),n=W("You will receive an email with a login link at "),r=y("b"),s=W(i[0]),o=W("."),l=D(),a=y("p"),a.textContent="Check your spam folder",O(e,"class","alert alert-info"),O(e,"role","alert")},m(c,u){A(c,e,u),v(e,t),v(t,n),v(t,r),v(r,s),v(t,o),v(e,l),v(e,a)},p(c,u){u&1&&K(s,c[0])},d(c){c&&P(e)}}}function mx(i){let e,t,n,r;function s(a,c){return a[1]?dx:fx}let o=s(i),l=o(i);return{c(){e=y("div"),t=y("div"),n=D(),r=y("div"),l.c(),O(t,"class","bg-image"),O(r,"class","login-form"),O(e,"class","scope-login")},m(a,c){A(a,e,c),v(e,t),v(e,n),v(e,r),l.m(r,null)},p(a,[c]){o===(o=s(a))&&l?l.p(a,c):(l.d(1),l=o(a),l&&(l.c(),l.m(r,null)))},i:U,o:U,d(a){a&&P(e),l.d()}}}function px(i,e,t){const n=je("channel");let r="",s=!1;function o(a){a.preventDefault(),Jn(n.lucentUrl+"/login",{email:r}).then(()=>{t(1,s=!0)}).catch(()=>{})}function l(){r=this.value,t(0,r)}return[r,s,o,l]}class gx extends oe{constructor(e){super(),se(this,e,px,mx,re,{})}}function Ox(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,b,w;return{c(){e=y("div"),t=y("div"),n=D(),r=y("div"),s=y("div"),o=y("h2"),o.textContent="Welcome to Lucent",l=D(),a=y("form"),c=y("button"),u=W("Enter as "),h=W(i[0]),f=D(),d=y("img"),p=D(),g=y("div"),O(t,"class","bg-image"),O(o,"class","mb-5"),O(d,"alt","indicator"),O(d,"id","indicator"),O(d,"class","htmx-indicator"),ad(d.src,m="/img/spinner.svg")||O(d,"src",m),O(c,"class","bt bt-primary"),O(g,"class","form-errors"),O(s,"class","form"),O(r,"class","login-form"),O(e,"class","scope-login")},m(S,_){A(S,e,_),v(e,t),v(e,n),v(e,r),v(r,s),v(s,o),v(s,l),v(s,a),v(a,c),v(c,u),v(c,h),v(c,f),v(c,d),v(s,p),v(s,g),b||(w=G(a,"submit",i[1]),b=!0)},p(S,[_]){_&1&&K(h,S[0])},i:U,o:U,d(S){S&&P(e),b=!1,w()}}}function bx(i,e,t){const n=je("channel");let{email:r}=e,{token:s}=e;function o(l){l.preventDefault(),Jn(n.lucentUrl+"/verify",{email:r,token:s}).then(a=>{window.location=n.lucentUrl}).catch(a=>{})}return i.$$set=l=>{"email"in l&&t(0,r=l.email),"token"in l&&t(2,s=l.token)},[r,o,s]}class vx extends oe{constructor(e){super(),se(this,e,bx,Ox,re,{email:0,token:2})}}function wx(i){let e,t,n;return{c(){e=y("div"),t=y("div"),n=W(i[2]),O(t,"class","avatar__letters"),O(e,"class","avatar"),O(e,"title",i[0]),fe(e,"background-color",i[3][i[4]]),fe(e,"height",i[1]+"px"),fe(e,"width",i[1]+"px"),fe(e,"font-size",i[1]/2+"px")},m(r,s){A(r,e,s),v(e,t),v(t,n)},p(r,[s]){s&4&&K(n,r[2]),s&1&&O(e,"title",r[0]),s&2&&fe(e,"height",r[1]+"px"),s&2&&fe(e,"width",r[1]+"px"),s&2&&fe(e,"font-size",r[1]/2+"px")},i:U,o:U,d(r){r&&P(e)}}}function yx(i,e,t){let{name:n}=e,{side:r=48}=e;const s=["#00AA55","#009FD4","#B381B3","#939393","#E3BC00","#D47500","#DC2A2A","#3ede91","#377dd4","#0256b0","#053d82","#3d026e","#b378e3","#c4065c","#543208","#d97811","#0c6b40"];let o="";n.split(" ").length>1?o=n.split(" ")[0].charAt(0).toUpperCase()+n.split(" ")[1].charAt(0).toUpperCase():o=n.split(" ")[0].charAt(0).toUpperCase()+n.split(" ")[0].charAt(1).toUpperCase();let a=(n.charCodeAt(1)+n.length)%19;return i.$$set=c=>{"name"in c&&t(0,n=c.name),"side"in c&&t(1,r=c.side)},[n,r,o,s,a]}class Ci extends oe{constructor(e){super(),se(this,e,yx,wx,re,{name:0,side:1})}}function kx(i){const e=i-1;return e*e*e+1}function hu(i,{delay:e=0,duration:t=400,easing:n=kx,x:r=0,y:s=0,opacity:o=0}={}){const l=getComputedStyle(i),a=+l.opacity,c=l.transform==="none"?"":l.transform,u=a*(1-o),[h,f]=ng(r),[d,m]=ng(s);return{delay:e,duration:t,easing:n,css:(p,g)=>`
transform: ${c} translate(${(1-p)*h}${f}, ${(1-p)*d}${m});
opacity: ${a-u*g}`}}function pg(i){let e,t,n,r,s,o,l;return{c(){e=y("div"),t=y("div"),t.textContent="Success",n=D(),r=y("div"),s=W(i[1]),O(t,"class","title"),O(r,"class","content"),O(e,"class","notice notice-success"),O(e,"role","alert")},m(a,c){A(a,e,c),v(e,t),v(e,n),v(e,r),v(r,s),l=!0},p(a,c){(!l||c&2)&&K(s,a[1])},i(a){l||(a&&Ps(()=>{l&&(o||(o=lu(e,hu,{duration:500},!0)),o.run(1))}),l=!0)},o(a){a&&(o||(o=lu(e,hu,{duration:500},!1)),o.run(0)),l=!1},d(a){a&&P(e),a&&o&&o.end()}}}function Sx(i){let e,t=i[0]&&pg(i);return{c(){t&&t.c(),e=De()},m(n,r){t&&t.m(n,r),A(n,e,r)},p(n,[r]){n[0]?t?(t.p(n,r),r&1&&T(t,1)):(t=pg(n),t.c(),T(t,1),t.m(e.parentNode,e)):t&&(me(),R(t,1,1,()=>{t=null}),pe())},i(n){T(t)},o(n){R(t)},d(n){n&&P(e),t&&t.d(n)}}}function _x(i,e,t){let n,r;function s(o="Saved"){t(1,n=o),t(0,r=!0),setTimeout(function(){t(0,r=!1)},2e3)}return t(1,n="Saved"),t(0,r=!1),[r,n,s]}class vy extends oe{constructor(e){super(),se(this,e,_x,Sx,re,{show:2})}get show(){return this.$$.ctx[2]}}function Cx(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,b,w,S,_,k,Q,x,C,M,$;t=new Ma({props:{message:i[2]}});let N={};return r=new vy({props:N}),i[8](r),l=new Ci({props:{name:i[4].name}}),d=new uu({props:{label:"Update Name"}}),S=new uu({props:{label:"Update Email"}}),{c(){e=y("div"),V(t.$$.fragment),n=D(),V(r.$$.fragment),s=D(),o=y("h3"),V(l.$$.fragment),a=D(),c=y("form"),u=y("div"),h=y("input"),f=D(),V(d.$$.fragment),m=D(),p=y("form"),g=y("div"),b=y("input"),w=D(),V(S.$$.fragment),_=D(),k=y("div"),Q=y("a"),x=W("Logout from this device"),O(o,"class","header-small mb-5"),O(h,"type","text"),O(h,"class","form-control mb-3"),O(h,"placeholder","Name"),h.required=!0,O(u,"class","input-group mb-5"),O(b,"type","email"),O(b,"class","form-control mb-3"),O(b,"placeholder","Email"),b.required=!0,O(g,"class","input-group mb-5"),O(Q,"class","list-group-item list-group-item-action"),O(Q,"href",i[5].lucentUrl+"/logout"),O(k,"class","list-group"),O(e,"class","wrapper-tiny")},m(B,J){A(B,e,J),Y(t,e,null),v(e,n),Y(r,e,null),v(e,s),v(e,o),Y(l,o,null),v(e,a),v(e,c),v(c,u),v(u,h),Ie(h,i[0]),v(u,f),Y(d,u,null),v(e,m),v(e,p),v(p,g),v(g,b),Ie(b,i[1]),v(g,w),Y(S,g,null),v(e,_),v(e,k),v(k,Q),v(Q,x),C=!0,M||($=[G(h,"input",i[9]),G(c,"submit",i[6]),G(b,"input",i[10]),G(p,"submit",i[7])],M=!0)},p(B,[J]){const te={};J&4&&(te.message=B[2]),t.$set(te);const ie={};r.$set(ie),J&1&&h.value!==B[0]&&Ie(h,B[0]),J&2&&b.value!==B[1]&&Ie(b,B[1])},i(B){C||(T(t.$$.fragment,B),T(r.$$.fragment,B),T(l.$$.fragment,B),T(d.$$.fragment,B),T(S.$$.fragment,B),C=!0)},o(B){R(t.$$.fragment,B),R(r.$$.fragment,B),R(l.$$.fragment,B),R(d.$$.fragment,B),R(S.$$.fragment,B),C=!1},d(B){B&&P(e),z(t),i[8](null),z(r),z(l),z(d),z(S),M=!1,ut($)}}}function Px(i,e,t){const n=je("user"),r=je("channel");let s=n.name,o=n.email,l="",a;function c(m){m.preventDefault(),t(2,l=""),Jn(r.lucentUrl+"/account/update-name",{name:s}).then(p=>{a.show()}).catch(p=>{var g;t(2,l=(g=p.response)==null?void 0:g.data.error),console.log({errorMessage:l})})}function u(m){m.preventDefault(),t(2,l=""),Jn(r.lucentUrl+"/account/update-email",{email:o}).then(p=>{a.show()}).catch(p=>{var g;t(2,l=(g=p.response)==null?void 0:g.data.error),console.log({errorMessage:l})})}function h(m){Se[m?"unshift":"push"](()=>{a=m,t(3,a)})}function f(){s=this.value,t(0,s)}function d(){o=this.value,t(1,o)}return[s,o,l,a,n,r,c,u,h,f,d]}class Ax extends oe{constructor(e){super(),se(this,e,Px,Cx,re,{})}}function xx(i){let e,t,n;const r=[{channel:i[3]},{title:i[0]},i[2]];var s=i[4][i[1]];function o(l,a){let c={};for(let u=0;u<r.length;u+=1)c=Cs(c,r[u]);return a!==void 0&&a&13&&(c=Cs(c,So(r,[a&8&&{channel:l[3]},a&1&&{title:l[0]},a&4&&_o(l[2])]))),{props:c}}return s&&(t=Fr(s,o(i))),{c(){e=y("div"),t&&V(t.$$.fragment)},m(l,a){A(l,e,a),t&&Y(t,e,null),n=!0},p(l,[a]){if(a&2&&s!==(s=l[4][l[1]])){if(t){me();const c=t;R(c.$$.fragment,1,0,()=>{z(c,1)}),pe()}s?(t=Fr(s,o(l,a)),V(t.$$.fragment),T(t.$$.fragment,1),Y(t,e,null)):t=null}else if(s){const c=a&13?So(r,[a&8&&{channel:l[3]},a&1&&{title:l[0]},a&4&&_o(l[2])]):{};t.$set(c)}},i(l){n||(t&&T(t.$$.fragment,l),n=!0)},o(l){t&&R(t.$$.fragment,l),n=!1},d(l){l&&P(e),t&&z(t)}}}function Tx(i,e,t){const n={register:hx,login:gx,verify:vx,profile:Ax};let{title:r}=e,{view:s}=e,{user:o}=e,{data:l}=e,{channel:a}=e;return Tl("channel",a),Tl("user",o),i.$$set=c=>{"title"in c&&t(0,r=c.title),"view"in c&&t(1,s=c.view),"user"in c&&t(5,o=c.user),"data"in c&&t(2,l=c.data),"channel"in c&&t(3,a=c.channel)},[r,s,l,a,n,o]}class Qx extends oe{constructor(e){super(),se(this,e,Tx,xx,re,{title:0,view:1,user:5,data:2,channel:3})}}const Mx=i=>({}),gg=i=>({});function Ex(i){let e;return{c(){e=W("Dropdown")},m(t,n){A(t,e,n)},d(t){t&&P(e)}}}function Rx(i){let e,t,n,r,s,o,l,a;const c=i[6].button,u=Gl(c,i,i[5],gg),h=u||Ex(),f=i[6].default,d=Gl(f,i,i[5],null);return{c(){e=y("div"),t=y("button"),h&&h.c(),n=D(),r=y("div"),d&&d.c(),O(t,"class","button dropdown-button"),O(t,"type","button"),O(t,"aria-expanded","false"),O(r,"class",s="dropdown-menu hide ori Line truncated
Save`,O(e,"type","button"),O(e,"class","button primary ms-2 btn btn-primary btn-spinner")},m(r,s){A(r,e,s),t||(n=G(e,"click",i[10]),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function kT(i){let e,t,n;return{c(){e=y("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Create`,O(e,"class","button primary btn-spinner")},m(r,s){A(r,e,s),t||(n=G(e,"click",i[10]),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function Hg(i){let e,t,n,r;function s(a){i[14](a)}function o(a){i[15](a)}let l={field:i[24],schema:i[2],record:i[0],validationErrors:i[4],isCreateMode:i[3]};return i[0].data!==void 0&&(l.data=i[0].data),i[1]!==void 0&&(l.graph=i[1]),e=new gP({props:l}),Se.push(()=>He(e,"data",s)),Se.push(()=>He(e,"graph",o)),{c(){V(e.$$.fragment)},m(a,c){Y(e,a,c),r=!0},p(a,c){const u={};c&4&&(u.schema=a[2]),c&1&&(u.record=a[0]),c&16&&(u.validationErrors=a[4]),c&8&&(u.isCreateMode=a[3]),!t&&c&1&&(t=!0,u.data=a[0].data,nt(()=>t=!1)),!n&&c&2&&(n=!0,u.graph=a[1],nt(()=>n=!1)),e.$set(u)},i(a){r||(T(e.$$.fragment,a),r=!0)},o(a){R(e.$$.fragment,a),r=!1},d(a){z(e,a)}}}function Kg(i,e){let t,n,r,s=e[5]===e[24].group&&Hg(e);return{key:i,first:null,c(){t=De(),s&&s.c(),n=De(),this.first=t},m(o,l){A(o,t,l),s&&s.m(o,l),A(o,n,l),r=!0},p(o,l){e=o,e[5]===e[24].group?s?(s.p(e,l),l&32&&T(s,1)):(s=Hg(e),s.c(),T(s,1),s.m(n.parentNode,n)):s&&(me(),R(s,1,1,()=>{s=null}),pe())},i(o){r||(T(s),r=!0)},o(o){R(s),r=!1},d(o){o&&(P(t),P(n)),s&&s.d(o)}}}function ST(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,b,w=[],S=new Map,_,k,Q;function x(X){i[11](X)}function C(X){i[12](X)}let M={schema:i[2],isCreateMode:i[3]};i[0]!==void 0&&(M.record=i[0]),i[5]!==void 0&&(M.activeContentTab=i[5]),n=new wy({props:M}),Se.push(()=>He(n,"record",x)),Se.push(()=>He(n,"activeContentTab",C));function $(X,ee){if(X[3])return kT;if(X[6])return yT}let N=$(i),B=N&&N(i);a=new Dy({props:{schema:i[2],record:i[0],isCreateMode:i[3]}}),u=new Ma({props:{message:i[7]}});function J(X){i[13](X)}let te={schema:i[2],isCreateMode:i[3]};i[5]!==void 0&&(te.active=i[5]),d=new yy({props:te}),Se.push(()=>He(d,"active",J)),g=new gT({props:{record:i[0],schema:i[2]}});let ie=ue(i[8]);const le=X=>X[24].name;for(let X=0;X<ie.length;X+=1){let ee=Gg(i,ie,X),Te=le(ee);S.set(Te,w[X]=Kg(Te,ee))}return{c(){e=y("div"),t=y("div"),V(n.$$.fragment),o=D(),B&&B.c(),l=D(),V(a.$$.fragment),c=D(),V(u.$$.fragment),h=D(),f=y("div"),V(d.$$.fragment),p=D(),V(g.$$.fragment),b=D();for(let X=0;X<w.length;X+=1)w[X].c();O(t,"class","tools-header"),O(f,"class","mt-4"),fe(f,"margin-bottom","150px"),fe(f,"position","relative"),O(e,"class","inline-edit record-edit")},m(X,ee){A(X,e,ee),v(e,t),Y(n,t,null),v(t,o),B&&B.m(t,null),v(e,l),Y(a,e,null),v(e,c),Y(u,e,null),v(e,h),v(e,f),Y(d,f,null),v(f,p),Y(g,f,null),v(f,b);for(let Te=0;Te<w.length;Te+=1)w[Te]&&w[Te].m(f,null);_=!0,k||(Q=G(window,"beforeunload",i[9]),k=!0)},p(X,[ee]){const Te={};ee&4&&(Te.schema=X[2]),ee&8&&(Te.isCreateMode=X[3]),!r&&ee&1&&(r=!0,Te.record=X[0],nt(()=>r=!1)),!s&&ee&32&&(s=!0,Te.activeContentTab=X[5],nt(()=>s=!1)),n.$set(Te),N===(N=$(X))&&B?B.p(X,ee):(B&&B.d(1),B=N&&N(X),B&&(B.c(),B.m(t,null)));const ve={};ee&4&&(ve.schema=X[2]),ee&1&&(ve.record=X[0]),ee&8&&(ve.isCreateMode=X[3]),a.$set(ve);const Ue={};ee&128&&(Ue.message=X[7]),u.$set(Ue);const ne={};ee&4&&(ne.schema=X[2]),ee&8&&(ne.isCreateMode=X[3]),!m&&ee&32&&(m=!0,ne.active=X[5],nt(()=>m=!1)),d.$set(ne);const Ee={};ee&1&&(Ee.record=X[0]),ee&4&&(Ee.schema=X[2]),g.$set(Ee),ee&319&&(ie=ue(X[8]),me(),w=di(w,ee,le,1,X,ie,S,f,mr,Kg,null,Gg),pe())},i(X){if(!_){T(n.$$.fragment,X),T(a.$$.fragment,X),T(u.$$.fragment,X),T(d.$$.fragment,X),T(g.$$.fragment,X);for(let ee=0;ee<ie.length;ee+=1)T(w[ee]);_=!0}},o(X){R(n.$$.fragment,X),R(a.$$.fragment,X),R(u.$$.fragment,X),R(d.$$.fragment,X),R(g.$$.fragment,X);for(let ee=0;ee<w.length;ee+=1)R(w[ee]);_=!1},d(X){X&&P(e),z(n),B&&B.d(),z(a),z(u),z(d),z(g);for(let ee=0;ee<w.length;ee+=1)w[ee].d();k=!1,Q()}}}function _T(i,e,t){let n,r;const s=je("channel"),o=nn();let{schema:l}=e,{record:a}=e,{graph:c={records:[],edges:[]}}=e,{isCreateMode:u}=e,h,f="",d=!1,m=l.fields.filter(M=>M.name!=="id"),p="_default";l.fields.reduce((M,$)=>$.ui==="tab"?(p=$.name,M):(M[p]=[...M[p]??[],$.name],M),[]),Ti(()=>{g()});function g(){h={data:JSON.parse(JSON.stringify(a.data)),schema:a.schema,status:a.status,edges:JSON.parse(JSON.stringify(c.edges))}}cy(()=>{t(6,d=w())});function b(M){return d?M.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete M.returnValue,"...")}function w(){return u?!1:!na(h,{data:a.data,schema:a.schema,status:a.status,edges:c.edges})}function S(M){return M.preventDefault(),console.log("SAVE: Attempt"),t(4,n=null),t(7,r=""),new Promise(function($,N){var B;if(!d&&!u){$(null);return}if(!a){$(null);return}t(1,c.edges=((B=c.edges)==null?void 0:B.filter(J=>!J._isTrashed&&J.source===a.id))??[],c),Jn(s.lucentUrl+"/records",{record:a,edges:c.edges,isCreateMode:u}).then(function(J){console.log("SAVE: SAVED INLINE"),t(0,a=J.records[0]),t(1,c=J),u||g(),o("inlinesaved",{records:[a]}),$(null)}).catch(function(J){J.response&&(typeof J.response.data.error=="string"?t(7,r=J.response.data.error):t(4,n=J.response.data.error)),$(null)})})}function _(M){a=M,t(0,a)}function k(M){f=M,t(5,f)}function Q(M){f=M,t(5,f)}function x(M){i.$$.not_e Line truncated
Back`),r=D();for(let h=0;h<u.length;h+=1)u[h].c();s=De(),O(e,"class","dropdown-item button")},m(h,f){A(h,e,f),Y(t,e,null),v(e,n),A(h,r,f);for(let d=0;d<u.length;d+=1)u[d]&&u[d].m(h,f);A(h,s,f),o=!0,l||(a=G(e,"click",i[23]),l=!0)},p(h,f){if(f[0]&2560){c=ue(h[9]);let d;for(d=0;d<c.length;d+=1){const m=sO(h,c,d);u[d]?u[d].p(m,f):(u[d]=lO(m),u[d].c(),u[d].m(s.parentNode,s))}for(;d<u.length;d+=1)u[d].d(1);u.length=c.length}},i(h){o||(T(t.$$.fragment,h),o=!0)},o(h){R(t.$$.fragment,h),o=!1},d(h){h&&(P(e),P(r),P(s)),z(t),mt(u,h),l=!1,a()}}}function lO(i){let e,t,n;function r(...s){return i[24](i[39],...s)}return{c(){e=y("button"),e.textContent=`${i[39].label} `,O(e,"class","dropdown-item button")},m(s,o){A(s,e,o),t||(n=G(e,"click",r),t=!0)},p(s,o){i=s},d(s){s&&P(e),t=!1,n()}}}function aO(i){let e,t,n,r,s,o,l=i[3].label+"",a,c,u,h,f,d;t=new Ot({props:{icon:"arrow-left"}});let m=ue(i[7]),p=[];for(let g=0;g<m.length;g+=1)p[g]=cO(rO(i,m,g));return{c(){e=y("button"),V(t.$$.fragment),n=W(`
Back`),r=D(),s=y("div"),o=W("field: "),a=W(l),c=D();for(let g=0;g<p.length;g+=1)p[g].c();u=De(),O(e,"class","dropdown-item button"),O(s,"class","selected-filter")},m(g,b){A(g,e,b),Y(t,e,null),v(e,n),A(g,r,b),A(g,s,b),v(s,o),v(s,a),A(g,c,b);for(let w=0;w<p.length;w+=1)p[w]&&p[w].m(g,b);A(g,u,b),h=!0,f||(d=G(e,"click",i[25]),f=!0)},p(g,b){if((!h||b[0]&8)&&l!==(l=g[3].label+"")&&K(a,l),b[0]&8320){m=ue(g[7]);let w;for(w=0;w<m.length;w+=1){const S=rO(g,m,w);p[w]?p[w].p(S,b):(p[w]=cO(S),p[w].c(),p[w].m(u.parentNode,u))}for(;w<p.length;w+=1)p[w].d(1);p.length=m.length}},i(g){h||(T(t.$$.fragment,g),h=!0)},o(g){R(t.$$.fragment,g),h=!1},d(g){g&&(P(e),P(r),P(s),P(c),P(u)),z(t),mt(p,g),f=!1,d()}}}function cO(i){let e,t=i[42].label+"",n,r,s,o;function l(...a){return i[26](i[42],...a)}return{c(){e=y("button"),n=W(t),r=D(),O(e,"class","dropdown-item button")},m(a,c){A(a,e,c),v(e,n),v(e,r),s||(o=G(e,"click",l),s=!0)},p(a,c){i=a,c[0]&128&&t!==(t=i[42].label+"")&&K(n,t)},d(a){a&&P(e),s=!1,o()}}}function uO(i){let e,t,n,r,s,o,l=i[3].label+"",a,c,u=i[5].label+"",h,f,d,m,p,g,b,w,S;return t=new Ot({props:{icon:"arrow-left"}}),{c(){e=y("button"),V(t.$$.fragment),n=W(`
Back`),r=D(),s=y("div"),o=W("field: "),a=W(l),c=W(" operator: "),h=W(u),f=D(),d=y("div"),m=y("input"),p=D(),g=y("button"),g.textContent="Add filter",O(e,"class","dropdown-item button"),O(s,"class","selected-filter"),O(m,"type","text"),O(m,"class","form-control"),O(d,"class","filter-input"),O(g,"class","button applied-filter"),O(g,"type","button")},m(_,k){A(_,e,k),Y(t,e,null),v(e,n),A(_,r,k),A(_,s,k),v(s,o),v(s,a),v(s,c),v(s,h),A(_,f,k),A(_,d,k),v(d,m),Ie(m,i[2]),A(_,p,k),A(_,g,k),b=!0,w||(S=[G(e,"click",i[27]),G(m,"input",i[28]),G(g,"click",i[14])],w=!0)},p(_,k){(!b||k[0]&8)&&l!==(l=_[3].label+"")&&K(a,l),(!b||k[0]&32)&&u!==(u=_[5].label+"")&&K(h,u),k[0]&4&&m.value!==_[2]&&Ie(m,_[2])},i(_){b||(T(t.$$.fragment,_),b=!0)},o(_){R(t.$$.fragment,_),b=!1},d(_){_&&(P(e),P(r),P(s),P(f),P(d),P(p),P(g)),z(t),w=!1,ut(S)}}}function hO(i){let e,t,n,r,s,o,l,a;t=new Ot({props:{icon:"arrow-left"}});let c=ue(i[10]),u=[];for(let h=0;h<c.length;h+=1)u[h]=fO(iO(i,c,h));return{c(){e=y("button"),V(t.$$.fragment),n=W(`
Back`),r=D();for(let h=0;h<u.length;h+=1)u[h].c();s=De(),O(e,"class","dropdown-item button")},m(h,f){A(h,e,f),Y(t,e,null),v(e,n),A(h,r,f);for(let d=0;d<u.length;d+=1)u[d]&&u[d].m(h,f);A(h,s,f),o=!0,l||(a=G(e,"click",i[29]),l=!0)},p(h,f){if(f[0]&5120){c=ue(h[10]);let d;for(d=0;d<c.length;d+=1){const m=iO(h,c,d);u[d]?u[d].p(m,f):(u[d]=fO(m),u[d].c(),u[d].m(s.parentNode,s))}for(;d<u.length;d+=1)u[d].d(1);u.length=c.length}},i(h){o||(T(t.$$.fragment,h),o=!0)},o(h){R(t.$$.fragment,h),o=!1},d(h){h&&(P(e),P(r),P(s)),z(t),mt(u,h),l=!1,a()}}}function fO(i){let e,t,n;function r(...s){return i[30](i[39],...s)}return{c(){e=y("button"),e.textContent=`${i[39].label} `,O(e,"class","dropdown-item button")},m(s,o){A(s,e,o),t||(n=G(e,"click",r),t=!0)},p(s,o){i=s},d(s){s&&P(e),t=!1,n()}}}function dO(i){let e,t,n,r,s,o,l=i[4].label+"",a,c,u,h,f,d,m,p;t=new Ot({props:{icon:"arrow-left"}});function g(w){i[32](w)}let b={field:i[4]};return i[2]!==void 0&&(b.value=i[2]),h=new xT({props:b}),Se.push(()=>He(h,"value",g)),h.$on("addFilter",i[14]),{c(){e=y("button"),V(t.$$.fragment),n=W(`
Back`),r=D(),s=y("div"),o=W("field: "),a=W(l),c=D(),u=y("div"),V(h.$$.fragment),O(e,"class","dropdown-item button"),O(s,"class","selected-filter"),O(u,"class","mt-2")},m(w,S){A(w,e,S),Y(t,e,null),v(e,n),A(w,r,S),A(w,s,S),v(s,o),v(s,a),A(w,c,S),A(w,u,S),Y(h,u,null),d=!0,m||(p=G(e,"click",i[31]),m=!0)},p(w,S){(!d||S[0]&16)&&l!==(l=w[4].label+"")&&K(a,l);const _={};S[0]&16&&(_.field=w[4]),!f&&S[0]&4&&(f=!0,_.value=w[2],nt(()=>f=!1)),h.$set(_)},i(w){d||(T(t.$$.fragment,w),T(h.$$.fragment,w),d=!0)},o(w){R(t.$$.fragment,w),R(h.$$.fragment,w),d=!1},d(w){w&&(P(e),P(r),P(s),P(c),P(u)),z(t),z(h),m=!1,p()}}}function TT(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,b,w,S,_,k,Q,x,C,M,$,N=!i[3]&&oO(i),B=i[3]&&!i[5]&&aO(i),J=i[3]&&i[5]&&uO(i),te=!i[4]&&hO(i),ie=i[4]&&dO(i);return b=new Ot({props:{icon:"arrow-left"}}),{c(){e=y("div"),t=y("button"),t.textContent="Filter by field",n=D(),r=y("button"),r.textContent="Filter by Reference",s=D(),o=y("button"),o.textContent="Advanced filter",l=D(),a=y("div"),N&&N.c(),c=D(),B&&B.c(),u=D(),J&&J.c(),h=D(),f=y("div"),te&&te.c(),d=D(),ie&&ie.c(),m=D(),p=y("div"),g=y("button"),V(b.$$.fragment),w=W(`
Back`),S=D(),_=y("form"),k=y("input"),Q=D(),x=y("button"),x.textContent="Submit",O(t,"class","dropdown-item button"),O(r,"class","dropdown-item button"),O(o,"class","dropdown-item button"),Ae(e,"hide",i[6]!=="main"),Ae(a,"hide",i[6]!=="byField"),Ae(f,"hide",i[6]!=="byReference"),O(g,"class","dropdown-item button"),O(k,"type","search"),O(k,"class","mb-2 mt-2"),O(k,"placeholder","Advanced filters"),k.required=!0,O(x,"class","button applied-filter"),Ae(p,"hide",i[6]!=="advanced")},m(le,X){A(le,e,X),v(e,t),v(e,n),v(e,r),v(e,s),v(e,o),A(le,l,X),A(le,a,X),N&&N.m(a,null),v(a,c),B&&B.m(a,null),v(a,u),J&&J.m(a,null),A(le,h,X),A(le,f,X),te&&te.m(f,null),v(f,d),ie&&ie.m(f,null),A(le,m,X),A(le,p,X),v(p,g),Y(b,g,null),v(g,w),v(p,S),v(p,_),v(_,k),Ie(k,i[1]),v(_,Q),v(_,x),C=!0,M||($=[G(t,"click",i[20]),G(r,"click",i[21]),G(o,"click",i[22]),G(g,"click",i[33]),G(k,"input",i[34]),G(_,"submit",i[8])],M=!0)},p(le,X){(!C||X[0]&64)&&Ae(e,"hide",le[6]!=="main"),le[3]?N&&(me(),R(N,1,1,()=>{N=null}),pe()):N?(N.p(le,X),X[0]&8&&T(N,1)):(N=oO(le),N.c(),T(N,1),N.m(a,c)),le[3]&&!le[5]?B?(B.p(le,X),X[0]&40&&T(B,1)):(B=aO(le),B.c(),T(B,1),B.m(a,u)):B&&(me(),R(B,1,1,()=>{B=null}),pe()),le[3]&&le[5]?J?(J.p(le,X),X[0]&40&&T(J,1)):(J=uO(le),J.c(),T(J,1),J.m(a,null)):J&&(me(),R(J,1,1,()=>{J=null}),pe()),(!C||X[0]&64)&&Ae(a,"hide",le[6]!=="byField"),le[4]?te&&(me(),R(te,1,1,()=>{te=null}),pe()):te?(te.p(le,X),X[0]&16&&T(te,1)):(te=hO(le),te.c(),T(te,1),te.m(f,d)),le[4]?ie?(ie.p(le,X),X[0]&16&&T(ie,1)):(ie=dO(le),ie.c(),T(ie,1),ie.m(f,null)):ie&&(me(),R(ie,1,1,()=>{ie=null}),pe()),(!C||X[0]&64)&&Ae(f,"hide",le[6]!=="byReference"),X[0]&2&&k.value!==le[1]&&Ie(k,le[1]),(!C||X[0]&64)&&Ae(p,"hide",le[6]!=="advanced")},i(le){C||(T(N),T(B),T(J),T(te),T(ie),T(b.$$.fragment,le),C=!0)},o(le){R(N),R(B),R(J),R(te),R(ie),R(b.$$.fragment,le),C=!1},d(le){le&&(P(e),P(l),P(a),P(h),P(f),P(m),P(p)),N&&N.d(),B&&B.d(),J&&J.d(),te&&te.d(),ie&&ie.d(),z(b),M=!1,ut($)}}}function QT(i){let e,t,n,r,s;return t=new Ot({props:{icon:"filter"}}),{c(){e=y("div"),V(t.$$.fragment),n=D(),r=y("span"),r.textContent="Filter",O(r,"class","ms-1"),O(e,"slot","button")},m(o,l){A(o,e,l),Y(t,e,null),v(e,n),v(e,r),s=!0},p:U,i(o){s||(T(t.$$.fragment,o),s=!0)},o(o){R(t.$$.fragment,o),s=!1},d(o){o&&P(e),z(t)}}}function MT(i){let e,t,n,r={$$slots:{button:[QT],default:[TT]},$$scope:{ctx:i}};return t=new Gi({props:r}),i[35](t),{c(){e=y("div"),V(t.$$.fragment)},m(s,o){A(s,e,o),Y(t,e,null),n=!0},p(s,o){const l={};o[0]&254|o[1]&65536&&(l.$$scope={dirty:o,ctx:s}),t.$set(l)},i(s){n||(T(t.$$.fragment,s),n=!0)},o(s){R(t.$$.fragment,s),n=!1},d(s){s&&P(e),i[35](null),z(t)}}}function ET(i,e,t){const n=nn();let{schema:r}=e,{systemFields:s=[]}=e,{operators:o}=e,{inModal:l}=e,{modalUrl:a}=e,c,u="",h=s;r.type==="collection"&&(h=s.filter(H=>H.files===!1));function f(H){H.preventDefault();let Pe=u.split("=")[0]??"";if(!Pe)return;let Ye=`filter[${Pe}]`,Tt=u.split("=")[1]??"";if(!Tt)return;const yt=new URL(a??window.location.href);yt.searchParams.set("skip","0"),yt.searchParams.set(Ye,Tt),l?n("refresh",yt):window.location.replace(yt),M()}let d=null,m=null,p=null,g=null,b="main",w=null,S=[...r.fields,...h].filter(H=>{var Pe;return!["file","json","reference"].includes(((Pe=H.info)==null?void 0:Pe.name)??H.ui)}),_=[...r.fields].filter(H=>{var Pe;return["reference"].includes(((Pe=H.info)==null?void 0:Pe.name)??H.ui)});function k(H,Pe){t(3,m=Pe),t(7,w=o.filter(Ye=>{var Tt;return Ye.uis.includes((Tt=m==null?void 0:m.info)==null?void 0:Tt.name)||Ye.uis[0]==="*"}))}function Q(H,Pe){t(4,p=Pe),t(5,g=o.find(Ye=>Ye.name==="eq"))}function x(H,Pe){t(5,g=Pe),Pe.hasValue||C(H)}function C(H){H.preventDefault();let Pe="",Ye,Tt=m??p;r.fields.find(wt=>wt.name===Tt.name)&&(Tt.info.name==="reference"&&g.name==="eq"?(Pe="children."+Tt.name+".id",Ye=`filter[${Pe}]`):(Pe="data.",Ye=`filter[${Pe+Tt.name}_${g.name}]`));const yt=new URL(a??window.location.href);yt.searchParams.set("skip","0"),yt.searchParams.set(Ye,d),l?(n("refresh",yt),c.close()):window.location.href=yt.toString(),M()}function M(){t(3,m=null),t(5,g=null),t(6,b="main"),t(4,p=null)}const $=H=>t(6,b="byField"),N=H=>t(6,b="byReference"),B=H=>t(6,b="advanced"),J=H=>t(6,b="main"),te=(H,Pe)=>k(Pe,H),ie=H=>t(3,m=null),le=(H,Pe)=>x(Pe,H),X=H=>t(5,g=null);function ee(){d=this.value,t(2,d)}const Te=H=>t(6,b="main"),ve=(H,Pe)=>Q(Pe,H),Ue=H=>t(4,p=null);function ne(H){d=H,t(2,d)}const Ee=H=>t(6,b="main");function Re(){u=this.value,t(1,u)}function xt(H){Se[H?"unshift":"push"](()=>{c=H,t(0,c)})}return i.$$set=H=>{"schema"in H&&t(15,r=H.schema),"systemFields"in H&&t(16,s=H.systemFields),"operators"in H&&t(17,o=H.operators),"inModal"in H&&t(18,l=H.inModal),"modalUrl"in H&&t(19,a=H.modalUrl)},[c,u,d,m,p,g,b,w,f,S,_,k,Q,x,C,r,s,o,l,a,$,N,B,J,te,ie,le,X,ee,Te,ve,Ue,ne,Ee,Re,xt]}class RT extends oe{constructor(e){super(),se(this,e,ET,MT,re,{schema:15,systemFields:16,operators:17,inModal:18,modalUrl:19},null,[-1,-1])}}function mO(i,e,t){const n=i.slice();return n[18]=e[t],n}func Line truncated
`),n=y("button"),V(r.$$.fragment),O(n,"type","button"),O(n,"class","button-text"),O(n,"aria-label","Close"),O(e,"class","applied-filter")},m(a,c){A(a,e,c),v(e,t),v(e,n),Y(r,n,null),s=!0,o||(l=G(n,"click",Ln(i[4])),o=!0)},p:U,i(a){s||(T(r.$$.fragment,a),s=!0)},o(a){R(r.$$.fragment,a),s=!1},d(a){a&&P(e),z(r),o=!1,l()}}}function qT(i){let e=i[0].searchParams.get("notlinked"),t,n,r=e&&jT(i);return{c(){r&&r.c(),t=De()},m(s,o){r&&r.m(s,o),A(s,t,o),n=!0},p(s,[o]){e&&r.p(s,o)},i(s){n||(T(r),n=!0)},o(s){R(r),n=!1},d(s){s&&P(t),r&&r.d(s)}}}function GT(i,e,t){je("channel");const n=nn();let{inModal:r}=e,{modalUrl:s}=e;const o=new URL(s??window.location.href);function l(c){const u=new URL(s??window.location.href);u.searchParams.set("skip","0"),u.searchParams.delete("notlinked"),r?n("refresh",u):window.location.replace(u)}const a=()=>l();return i.$$set=c=>{"inModal"in c&&t(2,r=c.inModal),"modalUrl"in c&&t(3,s=c.modalUrl)},[o,l,r,s,a]}class HT extends oe{constructor(e){super(),se(this,e,GT,qT,re,{inModal:2,modalUrl:3})}}function bO(i,e,t){const n=i.slice();return n[21]=e[t][0],n[22]=e[t][1],n}function vO(i){let e,t,n;return{c(){e=y("a"),t=W("New Record"),O(e,"href",n=i[10].lucentUrl+"/records/new?schema="+i[0].name),O(e,"class","button")},m(r,s){A(r,e,s),v(e,t)},p(r,s){s&1&&n!==(n=r[10].lucentUrl+"/records/new?schema="+r[0].name)&&O(e,"href",n)},d(r){r&&P(e)}}}function wO(i){let e,t;return e=new Gi({props:{orientation:"right",$$slots:{button:[tQ],default:[eQ]},$$scope:{ctx:i}}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&33554577&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function KT(i){let e,t,n,r,s,o,l,a,c,u;return{c(){e=y("a"),t=W("Export to CSV"),n=D(),r=y("a"),s=W("View trashed records"),l=D(),a=y("a"),c=W("View unlinked records"),O(e,"class","dropdown-item"),O(e,"href",i[11]),O(r,"class","dropdown-item"),O(r,"href",o=i[10].lucentUrl+"/content/"+i[0].name+"?filter[status_in]=trashed"),O(a,"class","dropdown-item"),O(a,"href",u=i[10].lucentUrl+"/content/"+i[0].name+"?notlinked=*")},m(h,f){A(h,e,f),v(e,t),A(h,n,f),A(h,r,f),v(r,s),A(h,l,f),A(h,a,f),v(a,c)},p(h,f){f&1&&o!==(o=h[10].lucentUrl+"/content/"+h[0].name+"?filter[status_in]=trashed")&&O(r,"href",o),f&1&&u!==(u=h[10].lucentUrl+"/content/"+h[0].name+"?notlinked=*")&&O(a,"href",u)},d(h){h&&(P(e),P(n),P(r),P(l),P(a))}}}function JT(i){let e,t=i[7]&&yO(i);return{c(){t&&t.c(),e=De()},m(n,r){t&&t.m(n,r),A(n,e,r)},p(n,r){n[7]?t?t.p(n,r):(t=yO(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(n){n&&P(e),t&&t.d(n)}}}function yO(i){let e,t,n;return{c(){e=y("a"),t=W("Empty trash"),O(e,"class","dropdown-item"),O(e,"href",n=i[10].lucentUrl+"/content/"+i[0].name+"/emptyTrash")},m(r,s){A(r,e,s),v(e,t)},p(r,s){s&1&&n!==(n=r[10].lucentUrl+"/content/"+r[0].name+"/emptyTrash")&&O(e,"href",n)},d(r){r&&P(e)}}}function eQ(i){let e;function t(s,o){return s[4].status_in==="trashed"?JT:KT}let n=t(i),r=n(i);return{c(){r.c(),e=De()},m(s,o){r.m(s,o),A(s,e,o)},p(s,o){n===(n=t(s))&&r?r.p(s,o):(r.d(1),r=n(s),r&&(r.c(),r.m(e.parentNode,e)))},d(s){s&&P(e),r.d(s)}}}function tQ(i){let e,t,n;return t=new Ot({props:{icon:"ellipsis-vertical"}}),{c(){e=y("div"),V(t.$$.fragment),O(e,"slot","button")},m(r,s){A(r,e,s),Y(t,e,null),n=!0},p:U,i(r){n||(T(t.$$.fragment,r),n=!0)},o(r){R(t.$$.fragment,r),n=!1},d(r){r&&P(e),z(t)}}}function kO(i){let e,t,n=ue(Object.entries(i[4])),r=[];for(let o=0;o<n.length;o+=1)r[o]=SO(bO(i,n,o));const s=o=>R(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o<r.length;o+=1)r[o].c();e=De()},m(o,l){for(let a=0;a<r.length;a+=1)r[a]&&r[a].m(o,l);A(o,e,l),t=!0},p(o,l){if(l&377){n=ue(Object.entries(o[4]));let a;for(a=0;a<n.length;a+=1){const c=bO(o,n,a);r[a]?(r[a].p(c,l),T(r[a],1)):(r[a]=SO(c),r[a].c(),T(r[a],1),r[a].m(e.parentNode,e))}for(me(),a=n.length;a<r.length;a+=1)s(a);pe()}},i(o){if(!t){for(let l=0;l<n.length;l+=1)T(r[l]);t=!0}},o(o){r=r.filter(Boolean);for(let l=0;l<r.length;l+=1)R(r[l]);t=!1},d(o){o&&P(e),mt(r,o)}}}function SO(i){let e,t;return e=new UT({props:{schema:i[0],operators:i[3],key:i[21],value:i[22],inModal:i[5],modalUrl:i[6],graph:i[8]}}),e.$on("refresh",i[18]),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&1&&(s.schema=n[0]),r&8&&(s.operators=n[3]),r&16&&(s.key=n[21]),r&16&&(s.value=n[22]),r&32&&(s.inModal=n[5]),r&64&&(s.modalUrl=n[6]),r&256&&(s.graph=n[8]),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function nQ(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g=Object.entries(i[4]).length>0,b,w,S;n=new BT({props:{schema:i[0],sortParam:i[1],sortField:i[2],systemFields:i[9],inModal:i[5],modalUrl:i[6]}}),n.$on("refresh",i[14]);function _(M){i[15](M)}let k={systemFields:i[9],operators:i[3],filter:i[4],inModal:i[5],modalUrl:i[6]};i[0]!==void 0&&(k.schema=i[0]),s=new RT({props:k}),Se.push(()=>He(s,"schema",_)),s.$on("refresh",i[16]);let Q=!i[5]&&i[7]&&vO(i),x=!i[5]&&wO(i);m=new HT({props:{inModal:i[5],modalUrl: Line truncated
`),o=y("span"),a=W(l),c=W(`
to
`),u=y("span"),f=W(h),d=W(`
of
`),m=y("span"),p=W(i[4]),g=W(`
total`),O(t,"class","pagination"),O(o,"class","font-medium"),O(u,"class","font-medium"),O(m,"class","font-medium"),fe(r,"display","flex"),fe(r,"justify-content","center"),fe(r,"gap","4px")},m(S,_){A(S,e,_),v(e,t),w&&w.m(t,null),A(S,n,_),A(S,r,_),v(r,s),v(r,o),v(o,a),v(r,c),v(r,u),v(u,f),v(r,d),v(r,m),v(m,p),v(r,g),b=!0},p(S,[_]){S[5]>1?w?(w.p(S,_),_&32&&T(w,1)):(w=PO(S),w.c(),T(w,1),w.m(t,null)):w&&(me(),R(w,1,1,()=>{w=null}),pe()),(!b||_&8)&&l!==(l=+S[3]+1+"")&&K(a,l),(!b||_&28)&&h!==(h=(+S[3]+S[2]>S[4]?S[4]:+S[3]+S[2])+"")&&K(f,h),(!b||_&16)&&K(p,S[4])},i(S){b||(T(w),b=!0)},o(S){R(w),b=!1},d(S){S&&(P(e),P(n),P(r)),w&&w.d()}}}function hQ(i,e,t){let n,r,s;const o=nn();let{inModal:l}=e,{modalUrl:a}=e,{limit:c}=e,{skip:u}=e,{total:h}=e;const f=(b,w,S=1)=>Array.from({length:Math.ceil((w-b)/S)},(_,k)=>b+k*S);function d(b){b.preventDefault(),p(n)}function m(b){b.preventDefault(),p(1)}function p(b){const w=new URL(a??window.location.href);let S=b*c-c;w.searchParams.set("skip",S),l?o("refresh",w):window.location=w}function g(b){Lr.call(this,i,b)}return i.$$set=b=>{"inModal"in b&&t(0,l=b.inModal),"modalUrl"in b&&t(1,a=b.modalUrl),"limit"in b&&t(2,c=b.limit),"skip"in b&&t(3,u=b.skip),"total"in b&&t(4,h=b.total)},i.$$.update=()=>{i.$$.dirty&20&&t(5,n=Math.ceil(h/c)),i.$$.dirty&12&&t(6,r=Math.ceil((u-1)/c)+1),i.$$.dirty&96&&t(7,s=f(r-3,r+4).filter(b=>b>0&&b<=n))},[l,a,c,u,h,n,r,s,d,m,g]}class fQ extends oe{constructor(e){super(),se(this,e,hQ,uQ,re,{inModal:0,modalUrl:1,limit:2,skip:3,total:4})}}function dQ(i){let e,t,n;return{c(){e=y("button"),e.textContent="Move to trash",O(e,"type","button"),O(e,"class","button")},m(r,s){A(r,e,s),t||(n=G(e,"click",Ln(i[9])),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function mQ(i){let e,t,n,r,s,o,l=i[1].hasDrafts&&AO(i);return{c(){e=y("button"),e.textContent="Publish",t=D(),l&&l.c(),n=D(),r=y("button"),r.textContent="Delete forever",O(e,"type","button"),O(e,"class","button"),O(r,"type","button"),O(r,"class","button")},m(a,c){A(a,e,c),A(a,t,c),l&&l.m(a,c),A(a,n,c),A(a,r,c),s||(o=[G(e,"click",Ln(i[7])),G(r,"click",Ln(i[3]))],s=!0)},p(a,c){a[1].hasDrafts?l?l.p(a,c):(l=AO(a),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},d(a){a&&(P(e),P(t),P(n),P(r)),l&&l.d(a),s=!1,ut(o)}}}function AO(i){let e,t,n;return{c(){e=y("button"),e.textContent="Make Draft",O(e,"type","button"),O(e,"class","button")},m(r,s){A(r,e,s),t||(n=G(e,"click",Ln(i[8])),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function pQ(i){let e,t,n=i[0].length+"",r,s,o,l,a,c,u,h,f;function d(g,b){return g[2].status_in==="trashed"?mQ:dQ}let m=d(i),p=m(i);return{c(){e=y("div"),t=y("span"),r=W(n),s=W(" records selected"),o=D(),l=y("button"),l.textContent="Publish",a=D(),c=y("button"),c.textContent="Make Draft",u=D(),p.c(),O(t,"class","me-2"),O(l,"type","button"),O(l,"class","button"),O(c,"type","button"),O(c,"class","button"),fe(e,"display","flex"),fe(e,"align-items","center"),fe(e,"gap","8px")},m(g,b){A(g,e,b),v(e,t),v(t,r),v(t,s),v(e,o),v(e,l),v(e,a),v(e,c),v(e,u),p.m(e,null),h||(f=[G(l,"click",Ln(i[5])),G(c,"click",Ln(i[6]))],h=!0)},p(g,[b]){b&1&&n!==(n=g[0].length+"")&&K(r,n),m===(m=d(g))&&p?p.p(g,b):(p.d(1),p=m(g),p&&(p.c(),p.m(e,null)))},i:U,o:U,d(g){g&&P(e),p.d(),h=!1,ut(f)}}}function gQ(i,e,t){const n=je("channel");let{selected:r}=e,{schema:s}=e,{filter:o}=e;function l(m){m.preventDefault(),Jn(n.lucentUrl+"/records/delete",{ids:r.map(p=>p.id)}).then(p=>{window.location.reload()}).catch(p=>{console.log(p)})}function a(m,p){Jn(n.lucentUrl+"/records/status/"+p,{schemaName:s.name,records:r}).then(g=>{window.location.reload()}).catch(g=>{console.log(g)})}const c=m=>a(m,"published"),u=m=>a(m,"draft"),h=m=>a(m,"published"),f=m=>a(m,"draft"),d=m=>a(m,"trashed");return i.$$set=m=>{"selected"in m&&t(0,r=m.selected),"schema"in m&&t(1,s=m.schema),"filter"in m&&t(2,o=m.filter)},[r,s,o,l,a,c,u,h,f,d]}class OQ extends oe{constructor(e){super(),se(this,e,gQ,pQ,re,{selected:0,schema:1,filter:2})}}function bQ(i){let e;return{c(){e=W(i[0])},m(t,n){A(t,e,n)},p(t,[n]){n&1&&K(e,t[0])},i:U,o:U,d(t){t&&P(e)}}}function vQ(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}let wQ=class extends oe{constructor(e){super(),se(this,e,vQ,bQ,re,{value:0})}};function xO(i){let e,t,n,r;return{c(){e=y("div"),t=y("span"),n=D(),r=W(i[0]),O(t,"class","color border border-2 svelte-78o2k4"),fe(t,"background",i[0]),O(e,"class","d-inline-flex")},m(s,o){A(s,e,o),v(e,t),v(e,n),v(e,r)},p(s,o){o&1&&fe(t,"background",s[0]),o&1&&K(r,s[0])},d(s){s&&P(e)}}}function yQ(i){let e,t=i[0]&&xO(i);return{c(){t&&t.c(),e=De()},m(n,r){t&&t.m(n,r),A(n,e,r)},p(n,[r]){n[0]?t?t.p(n,r):(t=xO(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:U,o:U,d(n){n&&P(e),t&&t.d(n)}}}function kQ(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}let SQ=class extends oe{constructor(e){super(),se(this,e,kQ,yQ,re,{value:0})}};function TO(i){let e,t,n;return{c(){e=y("a"),t=W(i[1]),O(e,"href",n=i[2].lucentUrl+"/records/"+i[0].id),O(e,"title",i[1]),O(e,"class","reference svel Line truncated
* Sortable 1.15.2
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*/function i1(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function Hi(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?i1(Object(t),!0).forEach(function(n){DM(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):i1(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function Nc(i){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Nc=function(e){return typeof e}:Nc=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nc(i)}function DM(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function hr(){return hr=Object.assign||function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},hr.apply(this,arguments)}function $M(i,e){if(i==null)return{};var t={},n=Object.keys(i),r,s;for(s=0;s<n.length;s++)r=n[s],!(e.indexOf(r)>=0)&&(t[r]=i[r]);return t}function LM(i,e){if(i==null)return{};var t=$M(i,e),n,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(r=0;r<s.length;r++)n=s[r],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(t[n]=i[n])}return t}var IM="1.15.2";function lr(i){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(i)}var pr=lr(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ea=lr(/Edge/i),r1=lr(/firefox/i),Ql=lr(/safari/i)&&!lr(/chrome/i)&&!lr(/android/i),Zy=lr(/iP(ad|od|hone)/i),By=lr(/chrome/i)&&lr(/android/i),Wy={capture:!1,passive:!1};function dt(i,e,t){i.addEventListener(e,t,!pr&&Wy)}function lt(i,e,t){i.removeEventListener(e,t,!pr&&Wy)}function du(i,e){if(e){if(e[0]===">"&&(e=e.substring(1)),i)try{if(i.matches)return i.matches(e);if(i.msMatchesSelector)return i.msMatchesSelector(e);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(e)}catch{return!1}return!1}}function NM(i){return i.host&&i!==document&&i.host.nodeType?i.host:i.parentNode}function Si(i,e,t,n){if(i){t=t||document;do{if(e!=null&&(e[0]===">"?i.parentNode===t&&du(i,e):du(i,e))||n&&i===t)return i;if(i===t)break}while(i=NM(i))}return null}var s1=/\s+/g;function Fn(i,e,t){if(i&&e)if(i.classList)i.classList[t?"add":"remove"](e);else{var n=(" "+i.className+" ").replace(s1," ").replace(" "+e+" "," ");i.className=(n+(t?" "+e:"")).replace(s1," ")}}function $e(i,e,t){var n=i&&i.style;if(n){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(i,""):i.currentStyle&&(t=i.currentStyle),e===void 0?t:t[e];!(e in n)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),n[e]=t+(typeof t=="string"?"":"px")}}function ao(i,e){var t="";if(typeof i=="string")t=i;else do{var n=$e(i,"transform");n&&n!=="none"&&(t=n+" "+t)}while(!e&&(i=i.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(t)}function Xy(i,e,t){if(i){var n=i.getElementsByTagName(e),r=0,s=n.length;if(t)for(;r<s;r++)t(n[r],r);return n}return[]}function Ui(){var i=document.scrollingElement;return i||document.documentElement}function Gt(i,e,t,n,r){if(!(!i.getBoundingClientRect&&i!==window)){var s,o,l,a,c,u,h;if(i!==window&&i.parentNode&&i!==Ui()?(s=i.getBoundingClientRect(),o=s.top,l=s.left,a=s.bottom,c=s.right,u=s.height,h=s.width):(o=0,l=0,a=window.innerHeight,c=window.innerWidth,u=window.innerHeight,h=window.innerWidth),(e||t)&&i!==window&&(r=r||i.parentNode,!pr))do if(r&&r.getBoundingClientRect&&($e(r,"transform")!=="none"||t&&$e(r,"position")!=="static")){var f=r.getBoundingClientRect();o-=f.top+parseInt($e(r,"border-top-width")),l-=f.left+parseInt($e(r,"border-left-width")),a=o+s.height,c=l+s.width;break}while(r=r.parentNode);if(n&&i!==window){var d=ao(r||i),m=d&&d.a,p=d&&d.d;d&&(o/=p,l/=m,h/=m,u/=p,a=o+u,c=l+h)}return{top:o,left:l,bottom:a,right:c,width:h,height:u}}}function o1(i,e,t){for(var n=Ir(i,!0),r=Gt(i)[e];n;){var s=Gt(n)[t],o=void 0;if(o=r>=s,!o)return n;if(n===Ui())break;n=Ir(n,!1)}return!1}function Co(i,e,t,n){for(var r=0,s=0,o=i.children;s<o.length;){if(o[s].style.display!=="none"&&o[s]!==Le.ghost&&(n||o[s]!==Le.dragged)&&Si(o[s],t.draggable,i,!1)){if(r===e)return o[s];r++}s++}return null}function Vm(i,e){for(var t=i.lastElementChild;t&&(t===Le.ghost||$e(t,"display")==="none"||e&&!du(t,e));)t=t.previousElementSibling;return t||null}function ii(i,e){var t=0;if(!i||!i.parentNode)return-1;for(;i=i.previousElementSibling;)i.nodeName.toUpperCase()!=="TEMPLATE"&&i!==Le.clone&&(!e||du(i,e))&&t++;return t}function l1(i){var e=0,t=0,n=Ui();if(i)do{var r=ao(i),s=r.a,o=r.d;e+=i.scrollLeft*s,t+=i.scrollTop*o}while(i!==n&&(i=i.parentNode));returLine truncated
<span class='flatpickr-weekday'>
`+L.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function ve(){t.calendarContainer.classList.add("hasWeeks");var E=ft("div","flatpickr-weekwrapper");E.appendChild(ft("span","flatpickr-weekday",t.l10n.weekAbbreviation));var L=ft("div","flatpickr-weeks");return E.appendChild(L),{weekWrapper:E,weekNumbers:L}}function Ue(E,L){L===void 0&&(L=!0);var F=L?E:E-t.currentMonth;F<0&&t._hidePrevMonthArrow===!0||F>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=F,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,pt("onYearChange"),J()),B(),pt("onMonthChange"),er())}function ne(E,L){if(E===void 0&&(E=!0),L===void 0&&(L=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,L===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var F=qh(t.config),j=F.hours,ae=F.minutes,be=F.seconds;d(j,ae,be)}t.redraw(),E&&pt("onChange")}function Ee(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),pt("onClose")}function Re(){t.config!==void 0&&pt("onDestroy");for(var E=t._handlers.length;E--;)t._handlers[E].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 L=t.calendarContainer.parentNode;if(L.lastChild&&L.removeChild(L.lastChild),L.parentNode){for(;L.firstChild;)L.parentNode.insertBefore(L.firstChild,L);L.parentNode.removeChild(L)}}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(F){try{delete t[F]}catch{}})}function xt(E){return t.calendarContainer.contains(E)}function H(E){if(t.isOpen&&!t.config.inline){var L=Zn(E),F=xt(L),j=L===t.input||L===t.altInput||t.element.contains(L)||E.path&&E.path.indexOf&&(~E.path.indexOf(t.input)||~E.path.indexOf(t.altInput)),ae=!j&&!F&&!xt(E.relatedTarget),be=!t.config.ignoredFocusElements.some(function(We){return We.contains(L)});ae&&be&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function Pe(E){if(!(!E||t.config.minDate&&E<t.config.minDate.getFullYear()||t.config.maxDate&&E>t.config.maxDate.getFullYear())){var L=E,F=t.currentYear!==L;t.currentYear=L||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)),F&&(t.redraw(),pt("onYearChange"),J())}}function Ye(E,L){var F;L===void 0&&(L=!0);var j=t.parseDate(E,void 0,L);if(t.config.minDate&&j&&Yn(j,t.config.minDate,L!==void 0?L:!t.minDateHasTime)<0||t.config.maxDate&&j&&Yn(j,t.config.maxDate,L!==void 0?L:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(j===void 0)return!1;for(var ae=!!t.config.enable,be=(F=t.config.enable)!==null&&F!==void 0?F:t.config.disable,We=0,we=void 0;We<be.length;We++){if(we=be[We],typeof we=="function"&&we(j))return ae;if(we instanceof Date&&j!==void 0&&we.getTime()===j.getTime())return ae;if(typeof we=="string"){var Ne=t.parseDate(we,void 0,!0);return Ne&&Ne.getTime()===j.getTime()?ae:!ae}else if(typeof we=="object"&&j!==void 0&&we.from&&we.to&&j.getTime()>=we.from.getTime()&&j.getTime()<=we.to.getTime())return ae}return!ae}function Tt(E){return t.daysContainer!==void 0?E.className.indexOf("hidden")===-1&&E.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(E):!1}function yt(E){var L=E.target===t._input,F=t._input.value.trimEnd()!==yr();L&&F&&!(E.relatedTarget&&xt(E.relatedTarget))&&t.setDate(t._input.value,!0,E.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function wt(E){var L=Zn(E),F=t.config. Line truncated
Upload file
`),s=y("input"),O(n,"class","spinner-border spinner-border-sm"),O(n,"role","status"),O(n,"aria-hidden","true"),O(s,"class","form-control"),O(s,"type","file"),O(s,"id","formFile"),s.multiple=!0,O(s,"accept",JE),s.disabled=i[0],s.hidden=!0,O(t,"class","button primary btn-spinner"),O(e,"class","upload-button"),e.disabled=i[0]},m(a,c){A(a,e,c),v(e,t),v(t,n),v(t,r),v(t,s),o||(l=G(s,"input",i[1]),o=!0)},p(a,[c]){c&1&&(s.disabled=a[0]),c&1&&(e.disabled=a[0])},i:U,o:U,d(a){a&&P(e),o=!1,l()}}}let JE="";function eR(i,e,t){const n=nn(),r=je("channel");let{recordId:s}=e,o=[],l=!1;function a(c){t(0,l=!0),o=c.target.files?[...c.target.files]:[];let u=new FormData;u.append("recordId",s),Array.from(o).forEach(function(h){u.append("files[]",h)}),n("beforeUpload",o),fetch(r.lucentUrl+"/files/upload",{method:"POST",body:u,headers:{"X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').content}}).then(h=>h.json()).then(h=>{h.error?n("uploadError",h.error):n("uploadComplete",h),t(0,l=!1)})}return i.$$set=c=>{"recordId"in c&&t(2,s=c.recordId)},[l,a,s]}class tR extends oe{constructor(e){super(),se(this,e,eR,KE,re,{recordId:2})}}function N1(i,e,t){const n=i.slice();return n[10]=e[t],n}function Z1(i){let e,t;return e=new Jy({props:{sortableClass:"mt-3",$$slots:{default:[nR]},$$scope:{ctx:i}}}),e.$on("update",i[4]),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&8193&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function B1(i,e){let t,n,r,s;return n=new qm({props:{file:e[10],hasDelete:!0}}),n.$on("remove_file",e[3]),{key:i,first:null,c(){t=y("div"),V(n.$$.fragment),r=D(),this.first=t},m(o,l){A(o,t,l),Y(n,t,null),v(t,r),s=!0},p(o,l){e=o;const a={};l&1&&(a.file=e[10]),n.$set(a)},i(o){s||(T(n.$$.fragment,o),s=!0)},o(o){R(n.$$.fragment,o),s=!1},d(o){o&&P(t),z(n)}}}function nR(i){let e=[],t=new Map,n,r,s=ue(i[0]??[]);const o=l=>l[10].id;for(let l=0;l<s.length;l+=1){let a=N1(i,s,l),c=o(a);t.set(c,e[l]=B1(c,a))}return{c(){for(let l=0;l<e.length;l+=1)e[l].c();n=De()},m(l,a){for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(l,a);A(l,n,a),r=!0},p(l,a){a&9&&(s=ue(l[0]??[]),me(),e=di(e,a,o,1,l,s,t,n.parentNode,mr,B1,n,N1),pe())},i(l){if(!r){for(let a=0;a<s.length;a+=1)T(e[a]);r=!0}},o(l){for(let a=0;a<e.length;a+=1)R(e[a]);r=!1},d(l){l&&P(n);for(let a=0;a<e.length;a+=1)e[a].d(l)}}}function iR(i){let e,t,n,r,s,o,l,a,c,u,h;s=new tR({props:{recordId:i[1].id}}),s.$on("uploadComplete",rR);let f=i[0].length>0&&Z1(i),d={};return a=new HE({props:d}),i[9](a),a.$on("insert_files",i[5]),a.$on("replace_files",i[6]),{c(){e=y("div"),t=y("button"),t.textContent="Browse",n=D(),r=y("div"),V(s.$$.fragment),o=D(),f&&f.c(),l=D(),V(a.$$.fragment),O(t,"class","button"),O(e,"class","mb-0")},m(m,p){A(m,e,p),v(e,t),v(e,n),v(e,r),Y(s,r,null),A(m,o,p),f&&f.m(m,p),A(m,l,p),Y(a,m,p),c=!0,u||(h=G(t,"click",i[7]),u=!0)},p(m,[p]){const g={};p&2&&(g.recordId=m[1].id),s.$set(g),m[0].length>0?f?(f.p(m,p),p&1&&T(f,1)):(f=Z1(m),f.c(),T(f,1),f.m(l.parentNode,l)):f&&(me(),R(f,1,1,()=>{f=null}),pe());const b={};a.$set(b)},i(m){c||(T(s.$$.fragment,m),T(f),T(a.$$.fragment,m),c=!0)},o(m){R(s.$$.fragment,m),R(f),R(a.$$.fragment,m),c=!1},d(m){m&&(P(e),P(o),P(l)),z(s),f&&f.d(m),i[9](null),z(a,m),u=!1,h()}}}function rR(i){}function sR(i,e,t){let{field:n}=e,{record:r}=e,{value:s=[]}=e,o;function l(d){d.preventDefault(),t(0,s=s.filter(m=>m.id!==d.detail))}async function a(d){t(0,s=await Ry(s,d.detail.source,d.detail.target))}function c(d){d.preventDefault(),o.close(),t(0,s=[...s??[],...d.detail??[]])}function u(d){d.preventDefault(),o.close(),t(0,s=d.detail??[])}function h(d){d.preventDefault(),o.open(r.id)}function f(d){Se[d?"unshift":"push"](()=>{o=d,t(2,o)})}return i.$$set=d=>{"field"in d&&t(8,n=d.field),"record"in d&&t(1,r=d.record),"value"in d&&t(0,s=d.value)},[s,r,o,l,a,c,u,h,n,f]}class oR extends oe{constructor(e){super(),se(this,e,sR,iR,re,{field:8,record:1,value:0})}}function W1(i){let e,t;return{c(){e=y("div"),t=W(i[5]),O(e,"class","invalid-feedback d-block")},m(n,r){A(n,e,r),v(e,t)},p(n,r){r&32&&K(t,n[5])},d(n){n&&P(e)}}}function lR(i){let e,t,n,r,s,o,l=i[5]&&W1(i);return{c(){e=y("div"),t=y("textarea"),r=D(),l&&l.c(),O(t,"id",i[3]),O(t,"class","form-control svelte-1er4ovm"),O(t,"rows","2"),t.readOnly=n=i[1].readonly&&!i[2],Ae(t,"is-invalid",i[5]),O(e,"class","mb-0")},m(a,c){A(a,e,c),v(e,t),Ie(t,i[0]),i[8](t),v(e,r),l&&l.m(e,null),s||(o=[G(t,"input",i[7]),G(t,"input",kd),G(t,"focus",kd)],s=!0)},p(a,[c]){c&8&&O(t,"id",a[3]),c&6&&n!==(n=a[1].readonly&&!a[2])&&(t.readOnly=n),c&1&&Ie(t,a[0]),c&32&&Ae(t,"is-invalid",a[5]),a[5]?l?l.p(a,c):(l=W1(a),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},i:U,o:U,d(a){a&&P(e),i[8](null),l&&l.d(),s=!1,ut(o)}}}function kd(i){let e;i.target?e=i.target:e=i,e.style.overflow="hidden",e.style.height="1px",e.style.height=+e.scrollHeight+"px"}function aR(i,e,t){let n,{field:r}=e,{value:s}=e,{isCreateMode:o}=e,{validationErrors:l}=e,a,{id:c}=e;Ti(()=>{kd(a)});function u Line truncated
`},As={bold:{tagName:"strong",inheritable:!0,parser(i){const e=window.getComputedStyle(i);return e.fontWeight==="bold"||e.fontWeight>=600}},italic:{tagName:"em",inheritable:!0,parser:i=>window.getComputedStyle(i).fontStyle==="italic"},href:{groupTagName:"a",parser(i){const e="a:not(".concat(Ss,")"),t=i.closest(e);if(t)return t.getAttribute("href")}},strike:{tagName:"del",inheritable:!0},frozen:{style:{backgroundColor:"highlight"}}},hk={getDefaultHTML:()=>`<div class="trix-button-row">
<span class="trix-button-group trix-button-group--text-tools" data-trix-button-group="text-tools">
<button type="button" class="trix-button trix-button--icon trix-button--icon-bold" data-trix-attribute="bold" data-trix-key="b" title="`.concat(Ve.bold,'" tabindex="-1">').concat(Ve.bold,`</button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-italic" data-trix-attribute="italic" data-trix-key="i" title="`).concat(Ve.italic,'" tabindex="-1">').concat(Ve.italic,`</button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-strike" data-trix-attribute="strike" title="`).concat(Ve.strike,'" tabindex="-1">').concat(Ve.strike,`</button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-link" data-trix-attribute="href" data-trix-action="link" data-trix-key="k" title="`).concat(Ve.link,'" tabindex="-1">').concat(Ve.link,`</button>
</span>
<span class="trix-button-group trix-button-group--block-tools" data-trix-button-group="block-tools">
<button type="button" class="trix-button trix-button--icon trix-button--icon-heading-1" data-trix-attribute="heading1" title="`).concat(Ve.heading1,'" tabindex="-1">').concat(Ve.heading1,`</button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-quote" data-trix-attribute="quote" title="`).concat(Ve.quote,'" tabindex="-1">').concat(Ve.quote,`</button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-code" data-trix-attribute="code" title="`).concat(Ve.code,'" tabindex="-1">').concat(Ve.code,`</button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-bullet-list" data-trix-attribute="bullet" title="`).concat(Ve.bullets,'" tabindex="-1">').concat(Ve.bullets,`</button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-number-list" data-trix-attribute="number" title="`).concat(Ve.numbers,'" tabindex="-1">').concat(Ve.numbers,`</button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-decrease-nesting-level" data-trix-action="decreaseNestingLevel" title="`).concat(Ve.outdent,'" tabindex="-1">').concat(Ve.outdent,`</button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-increase-nesting-level" data-trix-action="increaseNestingLevel" title="`).concat(Ve.indent,'" tabindex="-1">').concat(Ve.indent,`</button>
</span>
<span class="trix-button-group trix-button-group--file-tools" data-trix-button-group="file-tools">
<button type="button" class="trix-button trix-button--icon trix-button--icon-attach" data-trix-action="attachFiles" title="`).concat(Ve.attachFiles,'" tabindex="-1">').concat(Ve.attachFiles,`</button>
</span>
<span class="trix-button-group-spacer"></span>
<span class="trix-button-group trix-button-group--history-tools" data-trix-button-group="history-tools">
<button type="button" class="trix-button trix-button--icon trix-button--icon-undo" data-trix-action="undo" data-trix-key="z" title="`).concat(Ve.undo,'" tabindex="-1">').concat(Ve.undo,`</button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-redo" data-trix-action="redo" data-trix-key="shift+z" title="`).concat(Ve.redo,'" tabindex="-1">').concat(Ve.redo,`</button>
</span>
</div>
<div class="trix-dialogs" data-trix-dialogs>
<div class="trix-dialog trix-dialog--link" data-trix-dialog="href" data-trix-dialog-attribute="href">
<div class="trix-dialog__link-fields">
<input type="url" name="href" class="trix-input trix-input--dialog" placeholder="`).concat(Ve.urlPlaceholder,'" aria-label="').concat(Ve.url,`" data-trix-validate-href required data-trix-input>
<div class="trix-button-group">
<input type="button" class="trix-button trix-button--dialog" value="`).concat(Ve.link,`" data-trix-method="setAttribute">
<input type="button" class="trix-button trix-button--dialog" value="`).concat(Ve.unlink,`" data-trix-method="removeAttribute">
</div>
</div>
</div>
</div>`)};const Sd={interval:5e3};var $a=Object.freeze({__proto__:null,attachments:Gm,blockAttributes:Sn,browser:Da,css:{attachment:"attachment",attachmentCaption:"attachment__caption",attachmentCaptionEditor:"attachment__caption-editor",attachmentMetadata:"attachment__metadata",attachmentMetadataContainer:"attachment__metadata-container",attachmentName:"attachment__name",attachmentProgress:"attachment__progress",attachmentSize:"attachment__size",attachmentToolbar:"attachment__toolbar",attachmentGallery:"attachment-gallery"},dompurify:sk,fileSize:ok,input:Jm,keyNames:{8:"backspace",9:"tab",13:"return",27:"escape",37:"left",39:"right",46:"delete",68:"d",72:"h",79:"o"},lang:Ve,parser:Fc,textAttributes:As,toolbar:hk,undo:Sd});class Kt{static proxyMethod(e){const{name:t,toMethod:n,toProperty:r,optional:s}=kR(e);this.prototype[t]=function(){let o,l;var a,c;return n?l=s?(a=this[n])===null||a===void 0?void 0:a.call(this):this[n]():r&&(l=this[r]),s?(o=(c=l)===null||c===void 0?void 0:c[t],o?G1.call(o,l,arguments):void 0):(o=l[t],G1.call(o,l,arguments))}}}const kR=function(i){const e=i.match(SR);if(!e)throw new Error("can't parse @proxyMethod expression: ".concat(i));const t={name:e[4]};return e[2]!=null?t.toMethod=e[1]:t.toProperty=e[1],e[3]!=null&&(t.optional=!0),t},{apply:G1}=Function.prototype,SR=new RegExp("^(.+?)(\\(\\))?(\\?)?\\.(.+?)$");var ef,tf,nf;class sa extends Kt{static box(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return e instanceof this?e:this.fromUCS2String(e==null?void 0:e.toString())}static fromUCS2String(e){return new this(e,_d(e))}static fromCodepoints(e){return new this(Cd(e),e)}constructor(e,t){super(...arguments),this.ucs2String=e,this.codepoints=t,this.length=this.codepoints.length,this.ucs2Length=this.ucs2String.length}offsetToUCS2Offset(e){return Cd(this.codepoints.slice(0,Math.max(0,e))).length}offsetFromUCS2Offset(e){return _d(this.ucs2String.slice(0,Math.max(0,e))).length}slice(){return this.constructor.fromCodepoints(this.codepoints.slice(...arguments))}charAt(e){return this.slice(e,e+1)}isEqualTo(e){return this.constructor.box(e).ucs2String===this.ucs2String}toJSON(){return this.ucs2String}getCacheKey(){return this.ucs2String}toString(){return this.ucs2String}}const _R=((ef=Array.from)===null||ef===void 0?void 0:ef.call(Array,"👼").length)===1,CR=((tf=" ".codePointAt)===null||tf===void 0?void 0:tf.call(" ",0))!=null,PR=((nf=String.fromCodePoint)===null||nf===void 0?void 0:nf.call(String,32,128124))===" 👼";let _d,Cd;_d=_R&&CR?i=>Array.from(i).map(e=>e.codePointAt(0)):function(i){const e=[];let t=0;const{length:n}=i;for(;t<n;){let r=i.charCodeAt(t++);if(55296<=r&&r<=56319&&t<n){const s=i.charCodeAt(t++);(64512&s)==56320?r=((1023&r)<<10)+(1023&s)+65536:t--}e.push(r)}return e},Cd=PR?i=>String.fromCodePoint(...Array.from(i||[])):function(i){return(()=>{const e=[];return Array.from(i).forEach(t=>{let n="";t>65535&&(t-=65536,n+=String.fromCharCode(t>>>10&1023|55296),t=56320|1023&t),e.push(n+String.fromCharCode(t))}),e})().join("")};let AR=0;class Is extends Kt{static fromJSONString(e){return this.fromJSON(JSON.parse(e))}constructor(){super(...arguments),this.id=++AR}hasSameConstructorAs(e){return this.constructor===(e==null?void 0:e.constructor)}isEqualTo(e){return this===e}inspect(){const e=[],t=this.contentsForInspection()||{};for(const n in t){const r=t[n];e.push("".concat(n,"=").concat(r))}return"#<".concat(this.constructor.name,":").concat(this.id).concat(e.length?" ".concat(e.join(", ")):"",">")}contentsForInspection(){}toJSONString(){return JSON.stringify(this)}toUTF16String(){return sa.box(this)}getCacheKey(){return this.id.toString()}}const xs=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(i.length!==e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!==e[t])return!1;return!0},ep=function(i){const e=i.slice(0);for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.splice(...n),e},xR=/[\u05BE\u05C0\u05C3\u05D0-\u05EA\u05F0-\u05F4\u061B\u061F\u0621-\u063A\u0640-\u064A\u066D\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D5\u06E5\u06E6\u200F\u202B\u202E\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE72\uFE74\uFE76-\uFEFC]/,TR=function(){const i=Ge("input",{dir:"auto",name:"x",dirName:"x.dir"}),e=Ge("textarea",{dir:"auto",name:"y",dirName:"y.dir"}),t=Ge("form");t.appendChild(i),t.appendChild(e);const n=function(){try{return new FormData(t).has(e.dirName)}catch{return!1}}(),r=function(){try{return i.matches(":dir(ltr),:dir(rtl)")}catch{return!1}}();return n?function(s){return e.value=s,new FormData(t).get(e.dirName)}:r?function(s){return i.value=s,i.matches(":dir(rtl)")?"rtl":"ltr"}:function(s){const o=s.trim().charAt(0);return xR.test(o)?"rtl":"ltr"}}();let rf=null,sf=null,of=null,rc=null;const Pd=()=>(rf||(rf=MR().concat(QR())),rLine truncated
`+Sr),Ke&&sc([J,te,ie],vi=>{Sr=sl(Sr,vi," ")}),k&&Ri?k.createHTML(Sr):Sr},t.setConfig=function(){ae(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),qe=!0},t.clearConfig=function(){L=null,qe=!1},t.isValidAttribute=function(Z,Ce,ge){L||ae({});const Je=E(Z),ot=E(Ce);return tr(Je,ot,ge)},t.addHook=function(Z,Ce){typeof Ce=="function"&&rl(B[Z],Ce)},t.removeHook=function(Z,Ce){if(Ce!==void 0){const ge=YR(B[Z],Ce);return ge===-1?void 0:zR(B[Z],ge,1)[0]}return r0(B[Z])},t.removeHooks=function(Z){B[Z]=[]},t.removeAllHooks=function(){B={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},t}();Po.addHook("uponSanitizeAttribute",function(i,e){if(e.attrName==="data-trix-serialized-attributes")return void(e.keepAttr=!1);/^data-trix-/.test(e.attrName)&&(e.forceKeepAttr=!0)});const h4="style href src width height language class".split(" "),f4="javascript:".split(" "),d4="script iframe form noscript".split(" ");class lh extends Kt{static setHTML(e,t,n){const r=new this(t,n).sanitize(),s=r.getHTML?r.getHTML():r.outerHTML;e.innerHTML=s}static sanitize(e,t){const n=new this(e,t);return n.sanitize(),n}constructor(e){let{allowedAttributes:t,forbiddenProtocols:n,forbiddenElements:r,purifyOptions:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.allowedAttributes=t||h4,this.forbiddenProtocols=n||f4,this.forbiddenElements=r||d4,this.purifyOptions=s||{},this.body=m4(e)}sanitize(){this.sanitizeElements(),this.normalizeListElementNesting();const e=Object.assign({},sk,this.purifyOptions);return Po.setConfig(e),this.body=Po.sanitize(this.body),this.body}getHTML(){return this.body.innerHTML}getBody(){return this.body}sanitizeElements(){const e=vu(this.body),t=[];for(;e.nextNode();){const n=e.currentNode;switch(n.nodeType){case Node.ELEMENT_NODE:this.elementIsRemovable(n)?t.push(n):this.sanitizeElement(n);break;case Node.COMMENT_NODE:t.push(n)}}return t.forEach(n=>Vr(n)),this.body}sanitizeElement(e){return e.hasAttribute("href")&&this.forbiddenProtocols.includes(e.protocol)&&e.removeAttribute("href"),Array.from(e.attributes).forEach(t=>{let{name:n}=t;this.allowedAttributes.includes(n)||n.indexOf("data-trix")===0||e.removeAttribute(n)}),e}normalizeListElementNesting(){return Array.from(this.body.querySelectorAll("ul,ol")).forEach(e=>{const t=e.previousElementSibling;t&&kn(t)==="li"&&t.appendChild(e)}),this.body}elementIsRemovable(e){if((e==null?void 0:e.nodeType)===Node.ELEMENT_NODE)return this.elementIsForbidden(e)||this.elementIsntSerializable(e)}elementIsForbidden(e){return this.forbiddenElements.includes(kn(e))}elementIsntSerializable(e){return e.getAttribute("data-trix-serialize")==="false"&&!_s(e)}}const m4=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";i=i.replace(/<\/html[^>]*>[^]*$/i,"</html>");const e=document.implementation.createHTMLDocument("");return e.documentElement.innerHTML=i,Array.from(e.head.querySelectorAll("style")).forEach(t=>{e.body.appendChild(t)}),e.body},{css:Cr}=$a;class sp extends Ns{constructor(){super(...arguments),this.attachment=this.object,this.attachment.uploadProgressDelegate=this,this.attachmentPiece=this.options.piece}createContentNodes(){return[]}createNodes(){let e;const t=e=Ge({tagName:"figure",className:this.getClassName(),data:this.getData(),editable:!1}),n=this.getHref();return n&&(e=Ge({tagName:"a",editable:!1,attributes:{href:n,tabindex:-1}}),t.appendChild(e)),this.attachment.hasContent()?lh.setHTML(e,this.attachment.getContent()):this.createContentNodes().forEach(r=>{e.appendChild(r)}),e.appendChild(this.createCaptionElement()),this.attachment.isPending()&&(this.progressElement=Ge({tagName:"progress",attributes:{class:Cr.attachmentProgress,value:this.attachment.getUploadProgress(),max:100},data:{trixMutable:!0,trixStoreKey:["progressElement",this.attachment.id].join("/")}}),t.appendChild(this.progressElement)),[h0("left"),t,h0("right")]}createCaptionElement(){const e=Ge({tagName:"figcaption",className:Cr.attachmentCaption}),t=this.attachmentPiece.getCaption();if(t)e.classList.add("".concat(Cr.attachmentCaption,"--edited")),e.textContent=t;else{let n,r;const s=this.getCaptionConfig();if(s.name&&(n=this.attachment.getFilename()),s.size&&(r=this.attachment.getFormattedFilesize()),n){const o=Ge({tagName:"span",className:Cr.attachmentName,textContent:n});e.appendChild(o)}if(r){n&&e.appendChild(document.createTextNode(" "));const o=Ge({tagName:"span",className:Cr.attachmentSize,textContent:r});e.appendChild(o)}}return e}getClassName(){const e=[Cr.attachment,"".concat(Cr.attachment,"--").concat(this.attachment.getType())],t=this.attachment.getExtension();return t&&e.push("".concat(Cr.attachment,"--").concat(t)),e.join(" ")}getData(){const e={trixAttachment:JSON.stringify(this.attachment),trixContentType:this.attachment.getContentType(),trixId:thi Line truncated
`);for(let r=0;r<n.length;r++){const s=n[r];if(r>0){const o=Ge("br");t.push(o)}if(s.length){const o=document.createTextNode(this.preserveSpaces(s));t.push(o)}}return t}}createElement(){let e,t,n;const r={};for(t in this.attributes){n=this.attributes[t];const o=Ad(t);if(o){if(o.tagName){var s;const l=Ge(o.tagName);s?(s.appendChild(l),s=l):e=s=l}if(o.styleProperty&&(r[o.styleProperty]=n),o.style)for(t in o.style)n=o.style[t],r[t]=n}}if(Object.keys(r).length)for(t in e||(e=Ge("span")),r)n=r[t],e.style[t]=n;return e}createContainerElement(){for(const e in this.attributes){const t=this.attributes[e],n=Ad(e);if(n&&n.groupTagName){const r={};return r[e]=t,Ge(n.groupTagName,r)}}}preserveSpaces(e){return this.context.isLast&&(e=e.replace(/\ $/,Rr)),e=e.replace(/(\S)\ {3}(\S)/g,"$1 ".concat(Rr," $2")).replace(/\ {2}/g,"".concat(Rr," ")).replace(/\ {2}/g," ".concat(Rr)),(this.context.isFirst||this.context.followsWhitespace)&&(e=e.replace(/^\ /,Rr)),e}}class Ck extends Ns{constructor(){super(...arguments),this.text=this.object,this.textConfig=this.options.textConfig}createNodes(){const e=[],t=rp.groupObjects(this.getPieces()),n=t.length-1;for(let s=0;s<t.length;s++){const o=t[s],l={};s===0&&(l.isFirst=!0),s===n&&(l.isLast=!0),g4(r)&&(l.followsWhitespace=!0);const a=this.findOrCreateCachedChildView(_k,o,{textConfig:this.textConfig,context:l});e.push(...Array.from(a.getNodes()||[]));var r=o}return e}getPieces(){return Array.from(this.text.getPieces()).filter(e=>!e.hasAttribute("blockBreak"))}}const g4=i=>/\s$/.test(i==null?void 0:i.toString()),{css:f0}=$a;class Pk extends Ns{constructor(){super(...arguments),this.block=this.object,this.attributes=this.block.getAttributes()}createNodes(){const e=[document.createComment("block")];if(this.block.isEmpty())e.push(Ge("br"));else{var t;const n=(t=zt(this.block.getLastAttribute()))===null||t===void 0?void 0:t.text,r=this.findOrCreateCachedChildView(Ck,this.block.text,{textConfig:n});e.push(...Array.from(r.getNodes()||[])),this.shouldAddExtraNewlineElement()&&e.push(Ge("br"))}if(this.attributes.length)return e;{let n;const{tagName:r}=Sn.default;this.block.isRTL()&&(n={dir:"rtl"});const s=Ge({tagName:r,attributes:n});return e.forEach(o=>s.appendChild(o)),[s]}}createContainerElement(e){const t={};let n;const r=this.attributes[e],{tagName:s,htmlAttributes:o=[]}=zt(r);if(e===0&&this.block.isRTL()&&Object.assign(t,{dir:"rtl"}),r==="attachmentGallery"){const l=this.block.getBlockBreakPosition();n="".concat(f0.attachmentGallery," ").concat(f0.attachmentGallery,"--").concat(l)}return Object.entries(this.block.htmlAttributes).forEach(l=>{let[a,c]=l;o.includes(a)&&(t[a]=c)}),Ge({tagName:s,className:n,attributes:t})}shouldAddExtraNewlineElement(){return/\n\n$/.test(this.block.toString())}}class ah extends Ns{static render(e){const t=Ge("div"),n=new this(e,{element:t});return n.render(),n.sync(),t}constructor(){super(...arguments),this.element=this.options.element,this.elementStore=new ZR,this.setDocument(this.object)}setDocument(e){e.isEqualTo(this.document)||(this.document=this.object=e)}render(){if(this.childViews=[],this.shadowElement=Ge("div"),!this.document.isEmpty()){const e=rp.groupObjects(this.document.getBlocks(),{asTree:!0});Array.from(e).forEach(t=>{const n=this.findOrCreateCachedChildView(Pk,t);Array.from(n.getNodes()).map(r=>this.shadowElement.appendChild(r))})}}isSynced(){return O4(this.shadowElement,this.element)}sync(){const e=ak("trix-before-render",{cancelable:!1,attributes:{render:(n,r)=>{for(;n.lastChild;)n.removeChild(n.lastChild);n.appendChild(r)}}});this.element.dispatchEvent(e);const t=this.createDocumentFragmentForSync();return e.render(this.element,t),this.didSync()}didSync(){return this.elementStore.reset(d0(this.element)),tp(()=>this.garbageCollectCachedViews())}createDocumentFragmentForSync(){const e=document.createDocumentFragment();return Array.from(this.shadowElement.childNodes).forEach(t=>{e.appendChild(t.cloneNode(!0))}),Array.from(d0(e)).forEach(t=>{const n=this.elementStore.remove(t);n&&t.parentNode.replaceChild(n,t)}),e}}const d0=i=>i.querySelectorAll("[data-trix-store-key]"),O4=(i,e)=>m0(i.innerHTML)===m0(e.innerHTML),m0=i=>i.replace(/&nbsp;/g," ");function b4(i){var e=function(t,n){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var s=r.call(t,n);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(t)}(i,"string");return typeof e=="symbol"?e:String(e)}function gn(i,e,t){return(e=b4(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function rt(i,e){return v4(i,Ak(i,e,"get"))}function Bl(i,e,t){return w4(i,Ak(i,e,"set"),t),t}function Ak(i,e,t){if(!e.has(i))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(i)}function v4(i,e){return e.get?e.get.call(i):e.value}function w4(i,e,t){if(e.set)e.set.call(i,t);else{if(!e.writable)throw new TypeError("attempted to set read Line truncated
`))(e),this.length=this.string.length}getValue(){return this.string}toString(){return this.string.toString()}isBlockBreak(){return this.toString()===`
`&&this.getAttribute("blockBreak")===!0}toJSON(){const e=super.toJSON(...arguments);return e.string=this.string,e}canBeConsolidatedWith(e){return e&&this.hasSameConstructorAs(e)&&this.hasSameAttributesAsPiece(e)}consolidateWith(e){return new this.constructor(this.toString()+e.toString(),this.attributes)}splitAtOffset(e){let t,n;return e===0?(t=null,n=this):e===this.length?(t=this,n=null):(t=new this.constructor(this.string.slice(0,e),this.attributes),n=new this.constructor(this.string.slice(e),this.attributes)),[t,n]}toConsole(){let{string:e}=this;return e.length>15&&(e=e.slice(0,14)+"…"),JSON.stringify(e.toString())}}Zs.registerType("string",op);class ku extends Is{static box(e){return e instanceof this?e:new this(e)}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.objects=e.slice(0),this.length=this.objects.length}indexOf(e){return this.objects.indexOf(e)}splice(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new this.constructor(ep(this.objects,...t))}eachObject(e){return this.objects.map((t,n)=>e(t,n))}insertObjectAtIndex(e,t){return this.splice(t,0,e)}insertSplittableListAtIndex(e,t){return this.splice(t,0,...e.objects)}insertSplittableListAtPosition(e,t){const[n,r]=this.splitObjectAtPosition(t);return new this.constructor(n).insertSplittableListAtIndex(e,r)}editObjectAtIndex(e,t){return this.replaceObjectAtIndex(t(this.objects[e]),e)}replaceObjectAtIndex(e,t){return this.splice(t,1,e)}removeObjectAtIndex(e){return this.splice(e,1)}getObjectAtIndex(e){return this.objects[e]}getSplittableListInRange(e){const[t,n,r]=this.splitObjectsAtRange(e);return new this.constructor(t.slice(n,r+1))}selectSplittableList(e){const t=this.objects.filter(n=>e(n));return new this.constructor(t)}removeObjectsInRange(e){const[t,n,r]=this.splitObjectsAtRange(e);return new this.constructor(t).splice(n,r-n+1)}transformObjectsInRange(e,t){const[n,r,s]=this.splitObjectsAtRange(e),o=n.map((l,a)=>r<=a&&a<=s?t(l):l);return new this.constructor(o)}splitObjectsAtRange(e){let t,[n,r,s]=this.splitObjectAtPosition(k4(e));return[n,t]=new this.constructor(n).splitObjectAtPosition(S4(e)+s),[n,r,t-1]}getObjectAtPosition(e){const{index:t}=this.findIndexAndOffsetAtPosition(e);return this.objects[t]}splitObjectAtPosition(e){let t,n;const{index:r,offset:s}=this.findIndexAndOffsetAtPosition(e),o=this.objects.slice(0);if(r!=null)if(s===0)t=r,n=0;else{const l=this.getObjectAtIndex(r),[a,c]=l.splitAtOffset(s);o.splice(r,1,a,c),t=r+1,n=a.getLength()-s}else t=o.length,n=0;return[o,t,n]}consolidate(){const e=[];let t=this.objects[0];return this.objects.slice(1).forEach(n=>{var r,s;(r=(s=t).canBeConsolidatedWith)!==null&&r!==void 0&&r.call(s,n)?t=t.consolidateWith(n):(e.push(t),t=n)}),t&&e.push(t),new this.constructor(e)}consolidateFromIndexToIndex(e,t){const n=this.objects.slice(0).slice(e,t+1),r=new this.constructor(n).consolidate().toArray();return this.splice(e,n.length,...r)}findIndexAndOffsetAtPosition(e){let t,n=0;for(t=0;t<this.objects.length;t++){const r=n+this.objects[t].getLength();if(n<=e&&e<r)return{index:t,offset:e-n};n=r}return{index:null,offset:null}}findPositionAtIndexAndOffset(e,t){let n=0;for(let r=0;r<this.objects.length;r++){const s=this.objects[r];if(r<e)n+=s.getLength();else if(r===e){n+=t;break}}return n}getEndPosition(){return this.endPosition==null&&(this.endPosition=0,this.objects.forEach(e=>this.endPosition+=e.getLength())),this.endPosition}toString(){return this.objects.join("")}toArray(){return this.objects.slice(0)}toJSON(){return this.toArray()}isEqualTo(e){return super.isEqualTo(...arguments)||y4(this.objects,e==null?void 0:e.objects)}contentsForInspection(){return{objects:"[".concat(this.objects.map(e=>e.inspect()).join(", "),"]")}}}const y4=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(i.length!==e.length)return!1;let t=!0;for(let n=0;n<i.length;n++){const r=i[n];t&&!r.isEqualTo(e[n])&&(t=!1)}return t},k4=i=>i[0],S4=i=>i[1];class _i extends Is{static textForAttachmentWithAttributes(e,t){return new this([new Ao(e,t)])}static textForStringWithAttributes(e,t){return new this([new op(e,t)])}static fromJSON(e){return new this(Array.from(e).map(t=>Zs.fromJSON(t)))}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments);const t=e.filter(n=>!n.isEmpty());this.pieceList=new ku(t)}copy(){return this.copyWithPieceList(this.pieceList)}copyWithPieceList(e){return new this.constructor(e.consolidate().toArray())}copyUsingObjectMap(e){const t=this.getPieces().map(n=>e.find(n)||n);return new this.constructor(t)}appendText(e){return this.insertTextAtPosition(e,this.getLength())}insertTextAtPosition(e,t){return this.copyWithPieceList(this.pieceList.insertSplittableListAtPosition(e.pieceList,t))}removeTextAtRange(e){return this.copyWithPieceList(this.pieceList.removeObjectsInRange(e))}replaceTextAtRange(e,t){return this.removeTextAtRange(t).insertTextAtPosition(e,t[0])}moveTe Line truncated
`,t);break;case"backward":r=n.slice(0,t).lastIndexOf(`
`)}if(r!==-1)return r}contentsForInspection(){return{text:this.text.inspect(),attributes:this.attributes}}toString(){return this.text.toString()}toJSON(){return{text:this.text,attributes:this.attributes,htmlAttributes:this.htmlAttributes}}getDirection(){return this.text.getDirection()}isRTL(){return this.text.isRTL()}getLength(){return this.text.getLength()}canBeConsolidatedWith(e){return!this.hasAttributes()&&!e.hasAttributes()&&this.getDirection()===e.getDirection()}consolidateWith(e){const t=_i.textForStringWithAttributes(`
`),n=this.getTextWithoutBlockBreak().appendText(t);return this.copyWithText(n.appendText(e.text))}splitAtOffset(e){let t,n;return e===0?(t=null,n=this):e===this.getLength()?(t=this,n=null):(t=this.copyWithText(this.text.getTextAtRange([0,e])),n=this.copyWithText(this.text.getTextAtRange([e,this.getLength()]))),[t,n]}getBlockBreakPosition(){return this.text.getLength()-1}getTextWithoutBlockBreak(){return Qk(this.text)?this.text.getTextAtRange([0,this.getBlockBreakPosition()]):this.text.copy()}canBeGrouped(e){return this.attributes[e]}canBeGroupedWith(e,t){const n=e.getAttributes(),r=n[t],s=this.attributes[t];return s===r&&!(zt(s).group===!1&&!(()=>{if(!rc){rc=[];for(const o in Sn){const{listAttribute:l}=Sn[o];l!=null&&rc.push(l)}}return rc})().includes(n[t+1]))&&(this.getDirection()===e.getDirection()||e.isEmpty())}}const _4=function(i){return i=C4(i),i=A4(i)},C4=function(i){let e=!1;const t=i.getPieces();let n=t.slice(0,t.length-1);const r=t[t.length-1];return r?(n=n.map(s=>s.isBlockBreak()?(e=!0,x4(s)):s),e?new _i([...n,r]):i):i},P4=_i.textForStringWithAttributes(`
`,{blockBreak:!0}),A4=function(i){return Qk(i)?i:i.appendText(P4)},Qk=function(i){const e=i.getLength();return e===0?!1:i.getTextAtRange([e-1,e]).isBlockBreak()},x4=i=>i.copyWithoutAttribute("blockBreak"),p0=function(i){const{listAttribute:e}=zt(i);return e?[e,i]:[i]},g0=i=>i.slice(-1)[0],O0=function(i,e){const t=i.lastIndexOf(e);return t===-1?i:ep(i,t,1)};class si extends Is{static fromJSON(e){return new this(Array.from(e).map(t=>Xi.fromJSON(t)))}static fromString(e,t){const n=_i.textForStringWithAttributes(e,t);return new this([new Xi(n)])}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),e.length===0&&(e=[new Xi]),this.blockList=ku.box(e)}isEmpty(){const e=this.getBlockAtIndex(0);return this.blockList.length===1&&e.isEmpty()&&!e.hasAttributes()}copy(){const e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).consolidateBlocks?this.blockList.consolidate().toArray():this.blockList.toArray();return new this.constructor(e)}copyUsingObjectsFromDocument(e){const t=new NR(e.getObjects());return this.copyUsingObjectMap(t)}copyUsingObjectMap(e){const t=this.getBlocks().map(n=>e.find(n)||n.copyUsingObjectMap(e));return new this.constructor(t)}copyWithBaseBlockAttributes(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const t=this.getBlocks().map(n=>{const r=e.concat(n.getAttributes());return n.copyWithAttributes(r)});return new this.constructor(t)}replaceBlock(e,t){const n=this.blockList.indexOf(e);return n===-1?this:new this.constructor(this.blockList.replaceObjectAtIndex(t,n))}insertDocumentAtRange(e,t){const{blockList:n}=e;t=bt(t);let[r]=t;const{index:s,offset:o}=this.locationFromPosition(r);let l=this;const a=this.getBlockAtPosition(r);return or(t)&&a.isEmpty()&&!a.hasAttributes()?l=new this.constructor(l.blockList.removeObjectAtIndex(s)):a.getBlockBreakPosition()===o&&r++,l=l.removeTextAtRange(t),new this.constructor(l.blockList.insertSplittableListAtPosition(n,r))}mergeDocumentAtRange(e,t){let n,r;t=bt(t);const[s]=t,o=this.locationFromPosition(s),l=this.getBlockAtIndex(o.index).getAttributes(),a=e.getBaseBlockAttributes(),c=l.slice(-a.length);if(xs(a,c)){const f=l.slice(0,-a.length);n=e.copyWithBaseBlockAttributes(f)}else n=e.copy({consolidateBlocks:!0}).copyWithBaseBlockAttributes(l);const u=n.getBlockCount(),h=n.getBlockAtIndex(0);if(xs(l,h.getAttributes())){const f=h.getTextWithoutBlockBreak();if(r=this.insertTextAtRange(f,t),u>1){n=new this.constructor(n.getBlocks().slice(1));const d=s+f.getLength();r=r.insertDocumentAtRange(n,d)}}else r=this.insertDocumentAtRange(n,t);return r}insertTextAtRange(e,t){t=bt(t);const[n]=t,{index:r,offset:s}=this.locationFromPosition(n),o=this.removeTextAtRange(t);return new this.constructor(o.blockList.editObjectAtIndex(r,l=>l.copyWithText(l.text.insertTextAtPosition(e,s))))}removeTextAtRange(e){let t;e=bt(e);const[n,r]=e;if(or(e))return this;const[s,o]=Array.from(this.locationRangeFromRange(e)),l=s.index,a=s.offset,c=this.getBlockAtIndex(l),u=o.index,h=o.offset,f=this.getBlockAtIndex(u);if(r-n==1&&c.getBlockBreakPosition()===a&&f.getBlockBreakPosition()!==h&&f.text.getStringAtPosition(h)===`
`)t=this.blockList.editObjectAtIndex(u,d=>d.copyWithText(d.text.removeTextAtRange([h,h+1])));else{let d;const m=c.text.getTextAtRange([0,a]),p=f.text.getTextAtRange([h,f.getLength()]),g=m.appendText(p);d=l!==u&&a===0&&c.getAttributeLevel()>=f.getAttributeLevel()?f.copyWithText(g):c.copyWithText(g);const b=u+1-l;t=this.blockList.splice(l,b,d)}return new this.constructor(t)}moveTextFromRangeToPosition(e,t){let n;e=bt(e);const[r,s]=e;if(r<=t&&t<=s)return this;let o=this.getDocumentAtRange(e),l=this.removeTextAtRange(e);const a=r<t;a&&(t-=o.getLength());const[c,...u]=o.getBlocks();return u.length===0?(n=c.getTextWithoutBlockBreak(),a&&(t+=1)):n=c.text,l=l.insertTextAtRange(n,t),u.length===0?l:(o=new this.constructor(u),t+=n.getLength(),l.insertDocumentAtRange(o,t))}addAttributeAtRange(e,t,n){let{blockList:r}=this;return this.eachBlockAtRange(n,(s,o,l)=>r=r.editObjectAtIndex(l,function(){return zt(e)?s.addAttribute(e,t):o[0]===o[1]?s:s.copyWithText(s.text.addAttributeAtRange(e,t,o))})),new this.constructor(r)}addAttribute(e,t){let{blockList:n}=this;return this.eachBlock((r,s)=>n=n.editObjectAtIndex(s,()=>r.addAttribute(e,t))),new this.constructor(n)}removeAttributeAtRange(e,t){let{blockList:n}=this;return this.eachBlockAtRange(t,function(r,s,o){zt(e)?n=n.editObjectAtIndex(o,()=>r.removeAttribute(e)):s[0]!==s[1]&&(n=n.editObjectAtIndex(o,()=>r.copyWithText(r.text.removeAttributeAtRange(e,s))))}),new this.constructor(n)}updateAttributesForAttachment(e,t){const n=this.getRangeOfAttachment(t),[r]=Array.from(n),{index:s}=this.locationFromPosition(r),o=this.getTextAtIndex(s);return new this.constructor(this.blockList.editObjectAtIndex(s,l=>l.copyWithText(o.updateAttributesForAttachment(e,t))))}removeAttributeForAttachment(e,t){const n=this.getRangeOfAttachment(t);return this.removeAttributeAtRange(e,n)}setHTMLAttributeAtPosition(e,t,n){const r=this.getBlockAtPosition(e),s=r.addHTMLAttribute(t,n);return this.replaceBlock(r,s)}insertBlockBreakAtRange(e){let t;e=bt(e);const[n]=e,{offset:r}=this.locationFromPosition(n),s=this.removeTextAtRange(e);return r===0&&(t=[new Xi]),new this.constructor(s.blockList.insertSplittableListAtPosition(new ku(t),n))}applyBlockAttributeAtRange(e,t,n){const r=this.expandRangeToLineBreaksAndSplitBlocks(n);let s=r.document;n=r.range;const o=zt(e);if(o.listAttribute){s=s.removeLastListAttributeAtRange(n,{exceptAttributeName:e});const l=s.convertLineBreaksToBlockBreaksInRange(n);s=l.document,n=l.range}else s=o.exclusive?s.removeBlockAttributesAtRange(n):o.terminal?s.removeLastTerminalAttributeAtRange(n):s.consolidateBlocksAtRange(n);return s.addAttributeAtRange(e,t,n)}removeLastListAttributeAtRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{blockList:n}=this;return this.eachBlockAtRange(e,function(r,s,o){const l=r.getLastAttribute();l&&zt(l).listAttribute&&l!==t.exceptAttributeName&&(n=n.editObjectAtIndex(o,()=>r.removeAttribute(l)))}),new this.constructor(n)}removeLastTerminalAttributeAtRange(e){let{blockList:t}=this;return this.eachBlockAtRange(e,function(n,r,s){const o=n.getLastAttribute();o&&zt(o).terminal&&(t=t.editObjectAtIndex(s,()=>n.removeAttribute(o)))}),new this.constructor(t)}removeBlockAttributesAtRange(e){let{blockList:t}=this;return this.eachBlockAtRange(e,function(n,r,s){n.hasAttributes()&&(t=t.editObjectAtIndex(s,()=>n.copyWithoutAttributes()))}),new this.constructor(t)}expandRangeToLineBreaksAndSplitBlocks(e){let t;e=bt(e);let[n,r]=e;const s=this.locationFromPosition(n),o=this.locationFromPosition(r);let l=this;const a=l.getBlockAtIndex(s.index);if(s.offset=a.findLineBreakInDirectionFromPosition("backward",s.offset),s.offset!=null&&(t=l.positionFromLocation(s),l=l.insertBlockBreakAtRange([t,t+1]),o.index+=1,o.offset-=l.getBlockAtIndex(s.index).getLength(),s.index+=1),s.offset=0,o.offset===0&&o.index>s.index)o.index-=1,o.offset=l.getBlockAtIndex(o.index).getBlockBreakPosition();else{const c=l.getBlockAtIndex(o.index);c.text.getStringAtRange([o.offset-1,o.offset])===`
`?o.offset-=1:o.offset=c.findLineBreakInDirectionFromPosition("forward",o.offset),o.offset!==c.getBlockBreakPosition()&&(t=l.positionFromLocation(o),l=l.insertBlockBreakAtRange([t,t+1]))}return n=l.positionFromLocation(s),r=l.positionFromLocation(o),{document:l,range:e=bt([n,r])}}convertLineBreaksToBlockBreaksInRange(e){e=bt(e);let[t]=e;const n=this.getStringAtRange(e).slice(0,-1);let r=this;return n.replace(/.*?\n/g,function(s){t+=s.length,r=r.insertBlockBreakAtRange([t-1,t])}),{document:r,range:e}}consolidateBlocksAtRange(e){e=bt(e);const[t,n]=e,r=this.locationFromPosition(t).index,s=this.locationFromPosition(n).index;return new this.constructor(this.blockList.consolidateFromIndexToIndex(r,s))}getDocumentAtRange(e){e=bt(e);const t=this.blockList.getSplittableListInRange(e).toArray();return new this.constructor(t)}getStringAtRange(e){let t;const n=e=bt(e);return n[n.length-1]!==this.getLength()&&(t=-1),this.getDocumentAtRange(e).toString().slice(0,t)}getBlockAtIndex(e){return this.blockList.getObjectAtIndex(e)}getBlockAtPosition(e){const{index:t}=this.locationFromPosition(e);return this.getBlockAtIndex(t)}getTextAtIndex(e){var t;return(t=this.getBlockAtIndex(e))===null||t===void 0?void 0:t.text}getTextAtPosition(e){const{index:t}=this.locationFromPosition(e);return this.getTextAtIndex(t)}getPieceAtPosition(e){const{index:t,offset:n}=this.locationFromPosition(e);return this.getTextAtIndex(t).getPieceAtPosition(n)}getCharacterAtPosition(e){const{index:t,offset:n}=this.locationFromPosition(e);return this.getTextAtIndex(t).getStringAtRange([n,n+1])}getLength(){return this.blockList.getEndPosition()}getBlocks(){return this.blockList.toArray()}getBlockCount(){return this.blockList.length}getEditCount(){return this.editCount}eachBlock(e){return this.blockList.eachObject(e)}eachBlockAtRange(e,t){let n,r;e=bt(e);const[s,o]=e,l=this.locationFromPosition(s),a=this.locationFromPosition(o);if(l.index===a.index)return n=this.getBlockAtIndex(l.index),r=[l.offset,a.offset],t(n,r,l.index);for(let c=l.index;c<=a.index;c++)if(n=this.getBlockAtIndex(c),n){switch(c){case l.index:r=[l.offset,n.text.getLength()];break;case a.index:r=[0,a.offset];break;default:r=[0,n.text.getLength()]}t(n,r,c)}}getCommonAttributesAtRange(e){e=bt(e);const[t]=e;if(or(e))return this.getCommonAttributesAtPosition(t);{const n=[],r=[];return this.eachBlockAtRange(e,function(s,o){if(o[0]!==o[1])return n.push(s.text.getCommonAttributesAtRange(o)),r.push(b0(s))}),Kn.fromCommonAttributesOfObjects(n).merge(Kn.fromCommonAttributesOfObjects(r)).toObject()}}getCommonAttributesAtPosition(e){let t,n;const{index:r,offset:s}=this.locationFromPosition(e),o=this.getBlockAtIndex(r);if(!o)return{};const l=b0(o),a=o.text.getAttributesAtPosition(s),c=o.text.getAttributesAtPosition(s-1),u=Object.keys(As).filter(h=>As[h].inheritable);for(t in c)n=c[t],(n===a[t]||u.includes(t))&&(l[t]=n);return l}getRangeOfCommonAttributeAtPosition(e,t){const{index:n,offset:r}=this.locationFromPosition(t),s=this.getTextAtIndex(n),[o,l]=Array.from(s.getExpandedRangeForAttributeAtOffset(e,r)),a=this.positionFromLocation({index:n,offset:o}),c=this.positionFromLocation({index:n,offset:l});return bt([a,c])}getBaseBlockAttributes(){let e=this.getBlockAtIndex(0).getAttributes();for(let t=1;t<this.getBlockCount();t++){const n=this.getBlockAtIndex(t).getAttributes(),r=Math.min(e.length,n.length);e=(()=>{const s=[];for(let o=0;o<r&&n[o]===e[o];o++)s.push(n[o]);return s})()}return e}getAttachmentById(e){for(const t of this.getAttachments())if(t.id===e)return t}getAttachmentPieces(){let e=[];return this.blockList.eachObject(t=>{let{text:n}=t;return e=e.concat(n.getAttachmentPieces())}),e}getAttachments(){return this.getAttachmentPieces().map(e=>e.attachment)}getRangeOfAttachment(e){let t=0;const n=this.blockList.toArray();for(let r=0;r<n.length;r++){const{text:s}=n[r],o=s.getRangeOfAttachment(e);if(o)return bt([t+o[0],t+o[1]]);t+=s.getLength()}}getLocationRangeOfAttachment(e){const t=this.getRangeOfAttachment(e);return this.locationRangeFromRange(t)}getAttachmentPieceForAttachment(e){for(const t of this.getAttachmentPieces())if(t.attachment===e)return t}findRangesForBlockAttribute(e){let t=0;const n=[];return this.getBlocks().forEach(r=>{const s=r.getLength();r.hasAttribute(e)&&n.push([t,t+s]),t+=s}),n}findRangesForTextAttribute(e){let{withValue:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=0,r=[];const s=[];return this.getPieces().forEach(o=>{const l=o.getLength();(function(a){return t?a.getAttribute(e)===t:a.hasAttribute(e)})(o)&&(r[1]===n?r[1]=n+l:s.push(r=[n,n+l])),n+=l}),s}locationFromPosition(e){const t=this.blockList.findIndexAndOffsetAtPosition(Math.max(0,e));if(t.index!=null)return t;{const n=this.getBlocks();return{index:n.length-1,offset:n[n.length-1].getLength()}}}positionFromLocation(e){return this.blockList.findPositionAtIndexAndOffset(e.index,e.offset)}locationRangeFromPosition(e){return bt(this.locationFromPosition(e))}locationRangeFromRange(e){if(!(e=bt(e)))return;co Line truncated
`);if(t===this.containerElement||this.isBlockElement(t)){var n;const r=this.getBlockAttributes(t),s=this.getBlockHTMLAttributes(t);xs(r,(n=this.currentBlock)===null||n===void 0?void 0:n.attributes)||(this.currentBlock=this.appendBlockForAttributesWithElement(r,t,s),this.currentBlockElement=t)}}appendBlockForElement(e){const t=this.isBlockElement(e),n=vs(this.currentBlockElement,e);if(t&&!this.isBlockElement(e.firstChild)){if(!this.isInsignificantTextNode(e.firstChild)||!this.isBlockElement(e.firstElementChild)){const r=this.getBlockAttributes(e),s=this.getBlockHTMLAttributes(e);if(e.firstChild){if(n&&xs(r,this.currentBlock.attributes))return this.appendStringWithAttributes(`
`);this.currentBlock=this.appendBlockForAttributesWithElement(r,e,s),this.currentBlockElement=e}}}else if(this.currentBlockElement&&!n&&!t){const r=this.findParentBlockElement(e);if(r)return this.appendBlockForElement(r);this.currentBlock=this.appendEmptyBlock(),this.currentBlockElement=null}}findParentBlockElement(e){let{parentElement:t}=e;for(;t&&t!==this.containerElement;){if(this.isBlockElement(t)&&this.blockElements.includes(t))return t;t=t.parentElement}return null}processTextNode(e){let t=e.data;var n;return w0(e.parentNode)||(t=ip(t),Mk((n=e.previousSibling)===null||n===void 0?void 0:n.textContent)&&(t=M4(t))),this.appendStringWithAttributes(t,this.getTextAttributes(e.parentNode))}processElement(e){let t;if(_s(e)){if(t=v0(e,"attachment"),Object.keys(t).length){const n=this.getTextAttributes(e);this.appendAttachmentWithAttributes(t,n),e.innerHTML=""}return this.processedElements.push(e)}switch(kn(e)){case"br":return this.isExtraBR(e)||this.isBlockElement(e.nextSibling)||this.appendStringWithAttributes(`
`,this.getTextAttributes(e)),this.processedElements.push(e);case"img":t={url:e.getAttribute("src"),contentType:"image"};const n=(r=>{const s=r.getAttribute("width"),o=r.getAttribute("height"),l={};return s&&(l.width=parseInt(s,10)),o&&(l.height=parseInt(o,10)),l})(e);for(const r in n){const s=n[r];t[r]=s}return this.appendAttachmentWithAttributes(t,this.getTextAttributes(e)),this.processedElements.push(e);case"tr":if(this.needsTableSeparator(e))return this.appendStringWithAttributes(Fc.tableRowSeparator);break;case"td":if(this.needsTableSeparator(e))return this.appendStringWithAttributes(Fc.tableCellSeparator)}}appendBlockForAttributesWithElement(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.blockElements.push(t);const r=function(){return{text:[],attributes:arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},htmlAttributes:arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}}}(e,n);return this.blocks.push(r),r}appendEmptyBlock(){return this.appendBlockForAttributesWithElement([],null)}appendStringWithAttributes(e,t){return this.appendPiece(mf(e,t))}appendAttachmentWithAttributes(e,t){return this.appendPiece(function(n){return{attachment:n,attributes:arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},type:"attachment"}}(e,t))}appendPiece(e){return this.blocks.length===0&&this.appendEmptyBlock(),this.blocks[this.blocks.length-1].text.push(e)}appendStringToTextAtIndex(e,t){const{text:n}=this.blocks[t],r=n[n.length-1];if((r==null?void 0:r.type)!=="string")return n.push(mf(e));r.string+=e}prependStringToTextAtIndex(e,t){const{text:n}=this.blocks[t],r=n[0];if((r==null?void 0:r.type)!=="string")return n.unshift(mf(e));r.string=e+r.string}getTextAttributes(e){let t;const n={};for(const r in As){const s=As[r];if(s.tagName&&zr(e,{matchingSelector:s.tagName,untilNode:this.containerElement}))n[r]=!0;else if(s.parser){if(t=s.parser(e),t){let o=!1;for(const l of this.findBlockElementAncestors(e))if(s.parser(l)===t){o=!0;break}o||(n[r]=t)}}else s.styleProperty&&(t=e.style[s.styleProperty],t&&(n[r]=t))}if(_s(e)){const r=v0(e,"attributes");for(const s in r)t=r[s],n[s]=t}return n}getBlockAttributes(e){const t=[];for(;e&&e!==this.containerElement;){for(const r in Sn){const s=Sn[r];var n;s.parse!==!1&&kn(e)===s.tagName&&((n=s.test)!==null&&n!==void 0&&n.call(s,e)||!s.test)&&(t.push(r),s.listAttribute&&t.push(s.listAttribute))}e=e.parentNode}return t.reverse()}getBlockHTMLAttributes(e){const t={},n=Object.values(Sn).find(r=>r.tagName===kn(e));return((n==null?void 0:n.htmlAttributes)||[]).forEach(r=>{e.hasAttribute(r)&&(t[r]=e.getAttribute(r))}),t}findBlockElementAncestors(e){const t=[];for(;e&&e!==this.containerElement;){const n=kn(e);Il().includes(n)&&t.push(e),e=e.parentNode}return t}isBlockElement(e){if((e==null?void 0:e.nodeType)===Node.ELEMENT_NODE&&!_s(e)&&!zr(e,{matchingSelector:"td",untilNode:this.containerElement}))return Il().includes(kn(e))||window.getComputedStyle(e).display==="block"}isInsignificantTextNode(e){if((e==null?void 0:e.nodeType)!==Node.TEXT_NODE||!E4(e.data))return;const{parentNode:t,previousSibling:n,nextSibling:r}=e;return T4(t.previousSibling)&&!this.isBlockElement(t.previousSibling)||w0(t)?void 0:!n||this.isBlockElement(n)||!r||this.isBlockElement(r)}isExtraBR(e){return kn(e)==="br"&&this.isBlockElement(e.parentNode)&&e.parentNode.lastChild===e}needsTableSeparator(e){if(Fc.removeBlankTableCells){var t;const n=(t=e.previousSibling)===null||t===void 0?void 0:t.textContent;return n&&/\S/.test(n)}return e.previousSibling}translateBlockElementMarginsToNewlines(){const e=this.getMarginOfDefaultBlockElement();for(let t=0;t<this.blocks.length;t++){const n=this.getMarginOfBlockElementAtIndex(t);n&&(n.top>2*e.top&&this.prependStringToTextAtIndex(`
`,t),n.bottom>2*e.bottom&&this.appendStringToTextAtIndex(`
`,t))}}getMarginOfBlockElementAtIndex(e){const t=this.blockElements[e];if(t&&t.textContent&&!Il().includes(kn(t))&&!this.processedElements.includes(t))return y0(t)}getMarginOfDefaultBlockElement(){const e=Ge(Sn.default.tagName);return this.containerElement.appendChild(e),y0(e)}}const w0=function(i){const{whiteSpace:e}=window.getComputedStyle(i);return["pre","pre-wrap","pre-line"].includes(e)},T4=i=>i&&!Mk(i.textContent),y0=function(i){const e=window.getComputedStyle(i);if(e.display==="block")return{top:parseInt(e.marginTop),bottom:parseInt(e.marginBottom)}},Q4=function(i){return kn(i)==="style"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},M4=i=>i.replace(new RegExp("^".concat(np.source,"+")),""),E4=i=>new RegExp("^".concat(np.source,"*$")).test(i),Mk=i=>/\s$/.test(i),R4=["contenteditable","data-trix-id","data-trix-store-key","data-trix-mutable","data-trix-placeholder","tabindex"],Md="data-trix-serialized-attributes",D4="[".concat(Md,"]"),$4=new RegExp("<!--block-->","g"),L4={"application/json":function(i){let e;if(i instanceof si)e=i;else{if(!(i instanceof HTMLElement))throw new Error("unserializable object");e=oa.parse(i.innerHTML).getDocument()}return e.toSerializableDocument().toJSONString()},"text/html":function(i){let e;if(i instanceof si)e=ah.render(i);else{if(!(i instanceof HTMLElement))throw new Error("unserializable object");e=i.cloneNode(!0)}return Array.from(e.querySelectorAll("[data-trix-serialize=false]")).forEach(t=>{Vr(t)}),R4.forEach(t=>{Array.from(e.querySelectorAll("[".concat(t,"]"))).forEach(n=>{n.removeAttribute(t)})}),Array.from(e.querySelectorAll(D4)).forEach(t=>{try{const n=JSON.parse(t.getAttribute(Md));t.removeAttribute(Md);for(const r in n){const s=n[r];t.setAttribute(r,s)}}catch{}}),e.innerHTML.replace($4,"")}};var I4=Object.freeze({__proto__:null});class Nt extends Kt{constructor(e,t){super(...arguments),this.attachmentManager=e,this.attachment=t,this.id=this.attachment.id,this.file=this.attachment.file}remove(){return this.attachmentManager.requestRemovalOfAttachment(this.attachment)}}Nt.proxyMethod("attachment.getAttribute"),Nt.proxyMethod("attachment.hasAttribute"),Nt.proxyMethod("attachment.setAttribute"),Nt.proxyMethod("attachment.getAttributes"),Nt.proxyMethod("attachment.setAttributes"),Nt.proxyMethod("attachment.isPending"),Nt.proxyMethod("attachment.isPreviewable"),Nt.proxyMethod("attachment.getURL"),Nt.proxyMethod("attachment.getPreviewURL"),Nt.proxyMethod("attachment.setPreviewURL"),Nt.proxyMethod("attachment.getHref"),Nt.proxyMethod("attachment.getFilename"),Nt.proxyMethod("attachment.getFilesize"),Nt.proxyMethod("attachment.getFormattedFilesize"),Nt.proxyMethod("attachment.getExtension"),Nt.proxyMethod("attachment.getContentType"),Nt.proxyMethod("attachment.getFile"),Nt.proxyMethod("attachment.setFile"),Nt.proxyMethod("attachment.releaseFile"),Nt.proxyMethod("attachment.getUploadProgress"),Nt.proxyMethod("attachment.setUploadProgress");class Ek extends Kt{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.managedAttachments={},Array.from(e).forEach(t=>{this.manageAttachment(t)})}getAttachments(){const e=[];for(const t in this.managedAttachments){const n=this.managedAttachments[t];e.push(n)}return e}manageAttachment(e){return this.managedAttachments[e.id]||(this.managedAttachments[e.id]=new Nt(this,e)),this.managedAttachments[e.id]}attachmentIsManaged(e){return e.id in this.managedAttachments}requestRemovalOfAttachment(e){var t,n;if(this.attachmentIsManaged(e))return(t=this.delegate)===null||t===void 0||(n=t.attachmentManagerDidRequestRemovalOfAttachment)===null||n===void 0?void 0:n.call(t,e)}unmanageAttachment(e){const t=this.managedAttachments[e.id];return delete this.managedAttachments[e.id],t}}class Rk{constructor(e){this.composition=e,this.document=this.composition.document;const t=this.composition.getSelectedRange();this.startPosition=t[0],this.endPosition=t[1],this.startLocation=this.document.locationFromPosition(this.startPosition),this.endLocation=this.document.locationFromPosition(this.endPosition),this.block=this.document.getBlockAtIndex(this.endLocation.index),this.breaksOnReturn=this.block.breaksOnReturn(),this.previousCharacter=this.block.text.getStringAtPosition(this.endLocation.offset-1),this.nextCharacter=this.block.text.getStringAtPosition(this.endLocation.offset)}shouldInsertBlockBreak(){return this.block.hasAttributes()&&this.block.isListItem()&&!this.block.isEmpty()?this.startLocation.offset!==0:this.breaksOnReturn&&this.nextCharacter!==`
`}shouldBreakFormattedBlock(){return this.block.hasAttributes()&&!this.block.isListItem()&&(this.breaksOnReturn&&this.nextCharacter===`
`||this.previousCharacter===`
`)}shouldDecreaseListLevel(){return this.block.hasAttributes()&&this.block.isListItem()&&this.block.isEmpty()}shouldPrependListItem(){return this.block.isListItem()&&this.startLocation.offset===0&&!this.block.isEmpty()}shouldRemoveLastBlockAttribute(){return this.block.hasAttributes()&&!this.block.isListItem()&&this.block.isEmpty()}}class Tr extends Kt{constructor(){super(...arguments),this.document=new si,this.attachments=[],this.currentAttributes={},this.revision=0}setDocument(e){var t,n;if(!e.isEqualTo(this.document))return this.document=e,this.refreshAttachments(),this.revision++,(t=this.delegate)===null||t===void 0||(n=t.compositionDidChangeDocument)===null||n===void 0?void 0:n.call(t,e)}getSnapshot(){return{document:this.document,selectedRange:this.getSelectedRange()}}loadSnapshot(e){var t,n,r,s;let{document:o,selectedRange:l}=e;return(t=this.delegate)===null||t===void 0||(n=t.compositionWillLoadSnapshot)===null||n===void 0||n.call(t),this.setDocument(o??new si),this.setSelection(l??[0,0]),(r=this.delegate)===null||r===void 0||(s=r.compositionDidLoadSnapshot)===null||s===void 0?void 0:s.call(r)}insertText(e){let{updatePosition:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{updatePosition:!0};const n=this.getSelectedRange();this.setDocument(this.document.insertTextAtRange(e,n));const r=n[0],s=r+e.getLength();return t&&this.setSelection(s),this.notifyDelegateOfInsertionAtRange([r,s])}insertBlock(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Xi;const t=new si([e]);return this.insertDocument(t)}insertDocument(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new si;const t=this.getSelectedRange();this.setDocument(this.document.insertDocumentAtRange(e,t));const n=t[0],r=n+e.getLength();return this.setSelection(r),this.notifyDelegateOfInsertionAtRange([n,r])}insertString(e,t){const n=this.getCurrentTextAttributes(),r=_i.textForStringWithAttributes(e,n);return this.insertText(r,t)}insertBlockBreak(){const e=this.getSelectedRange();this.setDocument(this.document.insertBlockBreakAtRange(e));const t=e[0],n=t+1;return this.setSelection(n),this.notifyDelegateOfInsertionAtRange([t,n])}insertLineBreak(){const e=new Rk(this);if(e.shouldDecreaseListLevel())return this.decreaseListLevel(),this.setSelection(e.startPosition);if(e.shouldPrependListItem()){const t=new si([e.block.copyWithoutText()]);return this.insertDocument(t)}return e.shouldInsertBlockBreak()?this.insertBlockBreak():e.shouldRemoveLastBlockAttribute()?this.removeLastBlockAttribute():e.shouldBreakFormattedBlock()?this.breakFormattedBlock(e):this.insertString(`
`)}insertHTML(e){const t=oa.parse(e,{purifyOptions:{SAFE_FOR_XML:!0}}).getDocument(),n=this.getSelectedRange();this.setDocument(this.document.mergeDocumentAtRange(t,n));const r=n[0],s=r+t.getLength()-1;return this.setSelection(s),this.notifyDelegateOfInsertionAtRange([r,s])}replaceHTML(e){const t=oa.parse(e).getDocument().copyUsingObjectsFromDocument(this.document),n=this.getLocationRange({strict:!1}),r=this.document.rangeFromLocationRange(n);return this.setDocument(t),this.setSelection(r)}insertFile(e){return this.insertFiles([e])}insertFiles(e){const t=[];return Array.from(e).forEach(n=>{var r;if((r=this.delegate)!==null&&r!==void 0&&r.compositionShouldAcceptFile(n)){const s=Fo.attachmentForFile(n);t.push(s)}}),this.insertAttachments(t)}insertAttachment(e){return this.insertAttachments([e])}insertAttachments(e){let t=new _i;return Array.from(e).forEach(n=>{var r;const s=n.getType(),o=(r=Gm[s])===null||r===void 0?void 0:r.presentation,l=this.getCurrentTextAttributes();o&&(l.presentation=o);const a=_i.textForAttachmentWithAttributes(n,l);t=t.appendText(a)}),this.insertText(t)}shouldManageDeletingInDirection(e){const t=this.getLocationRange();if(or(t)){if(e==="backward"&&t[0].offset===0||this.shouldManageMovingCursorInDirection(e))return!0}else if(t[0].index!==t[1].index)return!0;return!1}deleteInDirection(e){let t,n,r,{length:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const o=this.getLocationRange();let l=this.getSelectedRange();const a=or(l);if(a?n=e==="backward"&&o[0].offset===0:r=o[0].index!==o[1].index,n&&this.canDecreaseBlockAttributeLevel()){const c=this.getBlock();if(c.isListItem()?this.decreaseListLevel():this.decreaseBlockAttributeLevel(),this.setSelection(l[0]),c.isEmpty())return!1}return a&&(l=this.getExpandedRangeInDirection(e,{length:s}),e==="backward"&&(t=this.getAttachmentAtRange(l))),t?(this.editAttachment(t),!1):(this.setDocument(this.document.removeTextAtRange(l)),this.setSelection(l[0]),!n&&!r&&void 0)}moveTextFromRange(e){const[t]=Array.from(this.getSelectedRange());return this.setDocument(this.document.moveTextFromRangeToPosition(e,t)),this.setSelection(t)}removeAttachment(e){const t=this.document.getRangeOfAttachment(e);if(t)return this.stopEditingAttachment(),this.setDocument(this.document.removeTextAtRange(t)),this.setSelection(t[0])}removeLastBlockAttribute(){const[e,t]=Array.from(this.getSelectedRange()),n=this.document.getBlockAtPosition(t);return this.removeCurrentAttribute(n.getLastAttribute()),this.setSelection(e)}insertPlaceholder(){return this.placeholderPosition=this.getPosition(),this.insertString(" ")}selectPlaceholder(){if(this.placeholderPosition!=null)return this.setSelectedRange([this.placeholderPosition,this.placeholderPosition+1]),this.getSelectedRange()}forgetPlaceholder(){this.placeholderPosition=null}hasCurrentAttribute(e){const t=this.currentAttributes[e];return t!=null&&t!==!1}toggleCurrentAttribute(e){const t=!this.currentAttributes[e];return t?this.setCurrentAttribute(e,t):this.removeCurrentAttribute(e)}canSetCurrentAttribute(e){return zt(e)?this.canSetCurrentBlockAttribute(e):this.canSetCurrentTextAttribute(e)}canSetCurrentTextAttribute(e){const t=this.getSelectedDocument();if(t){for(const n of Array.from(t.getAttachments()))if(!n.hasContent())return!1;return!0}}canSetCurrentBlockAttribute(e){const t=this.getBlock();if(t)return!t.isTerminalBlock()}setCurrentAttribute(e,t){return zt(e)?this.setBlockAttribute(e,t):(this.setTextAttribute(e,t),this.currentAttributes[e]=t,this.notifyDelegateOfCurrentAttributesChange())}setHTMLAtributeAtPosition(e,t,n){var r;const s=this.document.getBlockAtPosition(e),o=(r=zt(s.getLastAttribute()))===null||r===void 0?void 0:r.htmlAttributes;if(s&&o!=null&&o.includes(t)){const l=this.document.setHTMLAttributeAtPosition(e,t,n);this.setDocument(l)}}setTextAttribute(e,t){const n=this.getSelectedRange();if(!n)return;const[r,s]=Array.from(n);if(r!==s)return this.setDocument(this.document.addAttributeAtRange(e,t,n));if(e==="href"){const o=_i.textForStringWithAttributes(t,{href:t});return this.insertText(o)}}setBlockAttribute(e,t){const n=this.getSelectedRange();if(this.canSetCurrentAttribute(e))return this.setDocument(this.document.applyBlockAttributeAtRange(e,t,n)),this.setSelection(n)}removeCurrentAttribute(e){return zt(e)?(this.removeBlockAttribute(e),this.updateCurrentAttributes()):(this.removeTextAttribute(e),delete this.currentAttributes[e],this.notifyDelegateOfCurrentAttributesChange())}removeTextAttribute(e){const t=this.getSelectedRange();if(t)return this.setDocument(this.document.removeAttributeAtRange(e,t))}removeBlockAttribute(e){const t=this.getSelectedRange();if(t)return this.setDocument(this.document.removeAttributeAtRange(e,t))}canDecreaseNestingLevel(){var e;return((e=this.getBlock())===null||e===void 0?void 0:e.getNestingLevel())>0}canIncreaseNestingLevel(){var e;const t=this.getBlock();if(t){if((e=zt(t.getLastNestableAttribute()))===null||e===void 0||!e.listAttribute)return t.getNestingLevel()>0;{cons Line truncated
`?r+=1:t=t.removeTextAtRange(s),s=[r,r]):e.nextCharacter===`
`?e.previousCharacter===`
`?s=[r-1,r+1]:(s=[r,r+1],r+=1):e.startLocation.offset-1!=0&&(r+=1);const o=new si([n.removeLastAttribute().copyWithoutText()]);return this.setDocument(t.insertDocumentAtRange(o,s)),this.setSelection(r)}getPreviousBlock(){const e=this.getLocationRange();if(e){const{index:t}=e[0];if(t>0)return this.document.getBlockAtIndex(t-1)}}getBlock(){const e=this.getLocationRange();if(e)return this.document.getBlockAtIndex(e[0].index)}getAttachmentAtRange(e){const t=this.document.getDocumentAtRange(e);if(t.toString()==="".concat("",`
`))return t.getAttachments()[0]}notifyDelegateOfCurrentAttributesChange(){var e,t;return(e=this.delegate)===null||e===void 0||(t=e.compositionDidChangeCurrentAttributes)===null||t===void 0?void 0:t.call(e,this.currentAttributes)}notifyDelegateOfInsertionAtRange(e){var t,n;return(t=this.delegate)===null||t===void 0||(n=t.compositionDidPerformInsertionAtRange)===null||n===void 0?void 0:n.call(t,e)}translateUTF16PositionFromOffset(e,t){const n=this.document.toUTF16String(),r=n.offsetFromUCS2Offset(e);return n.offsetToUCS2Offset(r+t)}}Tr.proxyMethod("getSelectionManager().getPointRange"),Tr.proxyMethod("getSelectionManager().setLocationRangeFromPointRange"),Tr.proxyMethod("getSelectionManager().createLocationRangeFromDOMRange"),Tr.proxyMethod("getSelectionManager().locationIsCursorTarget"),Tr.proxyMethod("getSelectionManager().selectionIsExpanded"),Tr.proxyMethod("delegate?.getSelectionManager");class Ed extends Kt{constructor(e){super(...arguments),this.composition=e,this.undoEntries=[],this.redoEntries=[]}recordUndoEntry(e){let{context:t,consolidatable:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.undoEntries.slice(-1)[0];if(!n||!N4(r,e,t)){const s=this.createEntry({description:e,context:t});this.undoEntries.push(s),this.redoEntries=[]}}undo(){const e=this.undoEntries.pop();if(e){const t=this.createEntry(e);return this.redoEntries.push(t),this.composition.loadSnapshot(e.snapshot)}}redo(){const e=this.redoEntries.pop();if(e){const t=this.createEntry(e);return this.undoEntries.push(t),this.composition.loadSnapshot(e.snapshot)}}canUndo(){return this.undoEntries.length>0}canRedo(){return this.redoEntries.length>0}createEntry(){let{description:e,context:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{description:e==null?void 0:e.toString(),context:JSON.stringify(t),snapshot:this.composition.getSnapshot()}}}const N4=(i,e,t)=>(i==null?void 0:i.description)===(e==null?void 0:e.toString())&&(i==null?void 0:i.context)===JSON.stringify(t),pf="attachmentGallery";class Dk{constructor(e){this.document=e.document,this.selectedRange=e.selectedRange}perform(){return this.removeBlockAttribute(),this.applyBlockAttribute()}getSnapshot(){return{document:this.document,selectedRange:this.selectedRange}}removeBlockAttribute(){return this.findRangesOfBlocks().map(e=>this.document=this.document.removeAttributeAtRange(pf,e))}applyBlockAttribute(){let e=0;this.findRangesOfPieces().forEach(t=>{t[1]-t[0]>1&&(t[0]+=e,t[1]+=e,this.document.getCharacterAtPosition(t[1])!==`
`&&(this.document=this.document.insertBlockBreakAtRange(t[1]),t[1]<this.selectedRange[1]&&this.moveSelectedRangeForward(),t[1]++,e++),t[0]!==0&&this.document.getCharacterAtPosition(t[0]-1)!==`
`&&(this.document=this.document.insertBlockBreakAtRange(t[0]),t[0]<this.selectedRange[0]&&this.moveSelectedRangeForward(),t[0]++,e++),this.document=this.document.applyBlockAttributeAtRange(pf,!0,t))})}findRangesOfBlocks(){return this.document.findRangesForBlockAttribute(pf)}findRangesOfPieces(){return this.document.findRangesForTextAttribute("presentation",{withValue:"gallery"})}moveSelectedRangeForward(){this.selectedRange[0]+=1,this.selectedRange[1]+=1}}const $k=function(i){const e=new Dk(i);return e.perform(),e.getSnapshot()},Z4=[$k];class Lk{constructor(e,t,n){this.insertFiles=this.insertFiles.bind(this),this.composition=e,this.selectionManager=t,this.element=n,this.undoManager=new Ed(this.composition),this.filters=Z4.slice(0)}loadDocument(e){return this.loadSnapshot({document:e,selectedRange:[0,0]})}loadHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const t=oa.parse(e,{referenceElement:this.element}).getDocument();return this.loadDocument(t)}loadJSON(e){let{document:t,selectedRange:n}=e;return t=si.fromJSON(t),this.loadSnapshot({document:t,selectedRange:n})}loadSnapshot(e){return this.undoManager=new Ed(this.composition),this.composition.loadSnapshot(e)}getDocument(){return this.composition.document}getSelectedDocument(){return this.composition.getSelectedDocument()}getSnapshot(){return this.composition.getSnapshot()}toJSON(){return this.getSnapshot()}deleteInDirection(e){return this.composition.deleteInDirection(e)}insertAttachment(e){return this.composition.insertAttachment(e)}insertAttachments(e){return this.composition.insertAttachments(e)}insertDocument(e){return this.composition.insertDocument(e)}insertFile(e){return this.composition.insertFile(e)}insertFiles(e){return this.composition.insertFiles(e)}insertHTML(e){return this.composition.insertHTML(e)}insertString(e){return this.composition.insertString(e)}insertText(e){return this.composition.insertText(e)}insertLineBreak(){return this.composition.insertLineBreak()}getSelectedRange(){return this.composition.getSelectedRange()}getPosition(){return this.composition.getPosition()}getClientRectAtPosition(e){const t=this.getDocument().locationRangeFromRange([e,e+1]);return this.selectionManager.getClientRectAtLocationRange(t)}expandSelectionInDirection(e){return this.composition.expandSelectionInDirection(e)}moveCursorInDirection(e){return this.composition.moveCursorInDirection(e)}setSelectedRange(e){return this.composition.setSelectedRange(e)}activateAttribute(e){let t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return this.composition.setCurrentAttribute(e,t)}attributeIsActive(e){return this.composition.hasCurrentAttribute(e)}canActivateAttribute(e){return this.composition.canSetCurrentAttribute(e)}deactivateAttribute(e){return this.composition.removeCurrentAttribute(e)}setHTMLAtributeAtPosition(e,t,n){this.composition.setHTMLAtributeAtPosition(e,t,n)}canDecreaseNestingLevel(){return this.composition.canDecreaseNestingLevel()}canIncreaseNestingLevel(){return this.composition.canIncreaseNestingLevel()}decreaseNestingLevel(){if(this.canDecreaseNestingLevel())return this.composition.decreaseNestingLevel()}increaseNestingLevel(){if(this.canIncreaseNestingLevel())return this.composition.increaseNestingLevel()}canRedo(){return this.undoManager.canRedo()}canUndo(){return this.undoManager.canUndo()}recordUndoEntry(e){let{context:t,consolidatable:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.undoManager.recordUndoEntry(e,{context:t,consolidatable:n})}redo(){if(this.canRedo())return this.undoManager.redo()}undo(){if(this.canUndo())return this.undoManager.undo()}}class Ik{constructor(e){this.element=e}findLocationFromContainerAndOffset(e,t){let{strict:n}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{strict:!0},r=0,s=!1;const o={index:0,offset:0},l=this.findAttachmentElementParentForNode(e);l&&(e=l.parentNode,t=Hh(l));const a=vu(this.element,{usingFilter:Nk});for(;a.nextNode();){const c=a.currentNode;if(c===e&&Nl(e)){fo(c)||(o.offset+=t);break}if(c.parentNode===e){if(r++===t){!n&&Jh(c,{strict:n})&&(s&&o.index++,o.offset=0,s=!0);break}}else if(!vs(e,c)&&r>0)break;Jh(c,{strict:n})?(s&&o.index++,o.offset=0,s=!0):o.offset+=gf(c)}return o}findContainerAndOffsetFromLocation(e){let t,n;if(e.index===0&&e.offset===0){for(t=this.element,n=0;t.firstChild;)if(t=t.firstChild,Kh(t)){n=1;break}return[t,n]}let[r,s]=this.findNodeAndOffsetFromLocation(e);if(r){if(Nl(r))gf(r)===0?(t=r.parentNode.parentNode,n=Hh(r.parentNode),fo(r,{name:"right"})&&n++):(t=r,n=e.offset-s);else{if(t=r.parentNode,!Jh(r.previousSibling)&&!Kh(t))for(;r===t.lastChild&&(r=t,t=t.parentNode,!Kh(t)););n=Hh(r),e.offset!==0&&n++}return[t,n]}}findNodeAndOffsetFromLocation(e){let t,n,r=0;for(const s of this.getSignificantNodesForIndex(e.index)){const o=gf(s);if(e.offset<=r+o)if(Nl(s)){if(t=s,n=r,e.offset===n&&fo(t))break}else t||(t=s,n=r);if(r+=o,r>e.offset)break}return[t,n]}findAttachmentElementParentForNode(e){for(;e&&e!==this.eleme Line truncated
`]):(e=Rd(n),t=Rd(r));const s=e.filter((l,a)=>l!==t[a]).map(yl),o=t.filter((l,a)=>l!==e[a]).map(yl);return{additions:s,deletions:o}}getTextChangesFromCharacterData(){let e,t;const n=this.getMutationsByType("characterData");if(n.length){const r=n[0],s=n[n.length-1],o=function(l,a){let c,u;return l=sa.box(l),(a=sa.box(a)).length<l.length?[u,c]=t0(l,a):[c,u]=t0(a,l),{added:c,removed:u}}(yl(r.oldValue),yl(s.target.data));e=o.added,t=o.removed}return{additions:e?[e]:[],deletions:t?[t]:[]}}}const Rd=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const e=[];for(const t of Array.from(i))switch(t.nodeType){case Node.TEXT_NODE:e.push(t.data);break;case Node.ELEMENT_NODE:kn(t)==="br"?e.push(`
`):e.push(...Array.from(Rd(t.childNodes)||[]))}return e};class Vk extends yu{constructor(e){super(...arguments),this.file=e}perform(e){const t=new FileReader;return t.onerror=()=>e(!1),t.onload=()=>{t.onerror=null;try{t.abort()}catch{}return e(!0,this.file)},t.readAsArrayBuffer(this.file)}}class V4{constructor(e){this.element=e}shouldIgnore(e){return!!Da.samsungAndroid&&(this.previousEvent=this.event,this.event=e,this.checkSamsungKeyboardBuggyModeStart(),this.checkSamsungKeyboardBuggyModeEnd(),this.buggyMode)}checkSamsungKeyboardBuggyModeStart(){this.insertingLongTextAfterUnidentifiedChar()&&U4(this.element.innerText,this.event.data)&&(this.buggyMode=!0,this.event.preventDefault())}checkSamsungKeyboardBuggyModeEnd(){this.buggyMode&&this.event.inputType!=="insertText"&&(this.buggyMode=!1)}insertingLongTextAfterUnidentifiedChar(){var e;return this.isBeforeInputInsertText()&&this.previousEventWasUnidentifiedKeydown()&&((e=this.event.data)===null||e===void 0?void 0:e.length)>50}isBeforeInputInsertText(){return this.event.type==="beforeinput"&&this.event.inputType==="insertText"}previousEventWasUnidentifiedKeydown(){var e,t;return((e=this.previousEvent)===null||e===void 0?void 0:e.type)==="keydown"&&((t=this.previousEvent)===null||t===void 0?void 0:t.key)==="Unidentified"}}const U4=(i,e)=>k0(i)===k0(e),j4=new RegExp("(".concat("","|").concat(oh,"|").concat(Rr,"|\\s)+"),"g"),k0=i=>i.replace(j4," ").trim();class ch extends Kt{constructor(e){super(...arguments),this.element=e,this.mutationObserver=new zk(this.element),this.mutationObserver.delegate=this,this.flakyKeyboardDetector=new V4(this.element);for(const t in this.constructor.events)Zt(t,{onElement:this.element,withCallback:this.handlerFor(t)})}elementDidMutate(e){}editorWillSyncDocumentView(){return this.mutationObserver.stop()}editorDidSyncDocumentView(){return this.mutationObserver.start()}requestRender(){var e,t;return(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidRequestRender)===null||t===void 0?void 0:t.call(e)}requestReparse(){var e,t;return(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidRequestReparse)===null||t===void 0||t.call(e),this.requestRender()}attachFiles(e){const t=Array.from(e).map(n=>new Vk(n));return Promise.all(t).then(n=>{this.handleInput(function(){var r,s;return(r=this.delegate)===null||r===void 0||r.inputControllerWillAttachFiles(),(s=this.responder)===null||s===void 0||s.insertFiles(n),this.requestRender()})})}handlerFor(e){return t=>{t.defaultPrevented||this.handleInput(()=>{if(!Km(this.element)){if(this.flakyKeyboardDetector.shouldIgnore(t))return;this.eventName=e,this.constructor.events[e].call(this,t)}})}}handleInput(e){try{var t;(t=this.delegate)===null||t===void 0||t.inputControllerWillHandleInput(),e.call(this)}finally{var n;(n=this.delegate)===null||n===void 0||n.inputControllerDidHandleInput()}}createLinkHTML(e,t){const n=document.createElement("a");return n.href=e,n.textContent=t||e,n.outerHTML}}var vf;gn(ch,"events",{});const{browser:q4,keyNames:Uk}=$a;let G4=0;class ir extends ch{constructor(){super(...arguments),this.resetInputSummary()}setInputSummary(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.inputSummary.eventName=this.eventName;for(const t in e){const n=e[t];this.inputSummary[t]=n}return this.inputSummary}resetInputSummary(){this.inputSummary={}}reset(){return this.resetInputSummary(),Ts.reset()}elementDidMutate(e){var t,n;return this.isComposing()?(t=this.delegate)===null||t===void 0||(n=t.inputControllerDidAllowUnhandledInput)===null||n===void 0?void 0:n.call(t):this.handleInput(function(){return this.mutationIsSignificant(e)&&(this.mutationIsExpected(e)?this.requestRender():this.requestReparse()),this.reset()})}mutationIsExpected(e){let{textAdded:t,textDeleted:n}=e;if(this.inputSummary.preferDocument)return!0;const r=t!=null?t===this.inputSummary.textAdded:!this.inputSummary.textAdded,s=n!=null?this.inputSummary.didDelete:!this.inputSummary.didDelete,o=[`
`,`
`].includes(t)&&!r,l=n===`
`&&!s;if(o&&!l||l&&!o){const c=this.getSelectedRange();if(c){var a;const u=o?t.replace(/\n$/,"").length||-1:(t==null?void 0:t.length)||1;if((a=this.responder)!==null&&a!==void 0&&a.positionIsBlockBreak(c[1]+u))return!0}}return r&&s}mutationIsSignificant(e){var t;const n=Object.keys(e).length>0,r=((t=this.compositionInput)===null||t===void 0?void 0:t.getEndData())==="";return n||!r}getCompositionInput(){if(this.isComposing())return this.compositionInput;this.compositionInput=new Ar(this)}isComposing(){return this.compositionInput&&!this.compositionInput.isEnded()}deleteInDirection(e,t){var n;return((n=this.responder)===null||n===void 0?void 0:n.deleteInDirection(e))!==!1?this.setInputSummary({didDelete:!0}):t?(t.preventDefault(),this.requestRender()):void 0}serializeSelectionToDataTransfer(e){var t;if(!function(r){if(r==null||!r.setData)return!1;for(const s in K1){const o=K1[s];try{if(r.setData(s,o),!r.getData(s)===o)return!1}catch{return!1}}return!0}(e))return;const n=(t=this.responder)===null||t===void 0?void 0:t.getSelectedDocument().toSerializableDocument();return e.setData("application/x-trix-document",JSON.stringify(n)),e.setData("text/html",ah.render(n).innerHTML),e.setData("text/plain",n.toString().replace(/\n$/,"")),!0}canAcceptDataTransfer(e){const t={};return Array.from((e==null?void 0:e.types)||[]).forEach(n=>{t[n]=!0}),t.Files||t["application/x-trix-document"]||t["text/html"]||t["text/plain"]}getPastedHTMLUsingHiddenElement(e){const t=this.getSelectedRange(),n={position:"absolute",left:"".concat(window.pageXOffset,"px"),top:"".concat(window.pageYOffset,"px"),opacity:0},r=Ge({style:n,tagName:"div",editable:!0});return document.body.appendChild(r),r.focus(),requestAnimationFrame(()=>{const s=r.innerHTML;return Vr(r),this.setSelectedRange(t),e(s)})}}gn(ir,"events",{keydown(i){this.isComposing()||this.resetInputSummary(),this.inputSummary.didInput=!0;const e=Uk[i.keyCode];if(e){var t;let r=this.keys;["ctrl","alt","shift","meta"].forEach(s=>{var o;i["".concat(s,"Key")]&&(s==="ctrl"&&(s="control"),r=(o=r)===null||o===void 0?void 0:o[s])}),((t=r)===null||t===void 0?void 0:t[e])!=null&&(this.setInputSummary({keyName:e}),Ts.reset(),r[e].call(this,i))}if(mk(i)){const r=String.fromCharCode(i.keyCode).toLowerCase();if(r){var n;const s=["alt","shift"].map(o=>{if(i["".concat(o,"Key")])return o}).filter(o=>o);s.push(r),(n=this.delegate)!==null&&n!==void 0&&n.inputControllerDidReceiveKeyboardCommand(s)&&i.preventDefault()}}},keypress(i){if(this.inputSummary.eventName!=null||i.metaKey||i.ctrlKey&&!i.altKey)return;const e=J4(i);var t,n;return e?((t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(n=this.responder)===null||n===void 0||n.insertString(e),this.setInputSummary({textAdded:e,didDelete:this.selectionIsExpanded()})):void 0},textInput(i){const{data:e}=i,{textAdded:t}=this.inputSummary;if(t&&t!==e&&t.toUpperCase()===e){var n;const r=this.getSelectedRange();return this.setSelectedRange([r[0],r[1]+t.length]),(n=this.responder)===null||n===void 0||n.insertString(e),this.setInputSummary({textAdded:e}),this.setSelectedRange(r)}},dragenter(i){i.preventDefault()},dragstart(i){var e,t;return this.serializeSelectionToDataTransfer(i.dataTransfer),this.draggedRange=this.getSelectedRange(),(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidStartDrag)===null||t===void 0?void 0:t.call(e)},dragover(i){if(this.draggedRange||this.canAcceptDataTransfer(i.dataTransfer)){i.preventDefault();const n={x:i.clientX,y:i.clientY};var e,t;if(!Xo(n,this.draggingPoint))return this.draggingPoint=n,(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidReceiveDragOverPoint)===null||t===void 0?void 0:t.call(e,this.draggingPoint)}},dragend(i){var e,t;(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidCancelDrag)===null||t===void 0||t.call(e),this.draggedRange=null,this.draggingPoint=null},drop(i){var e,t;i.preventDefault();const n=(e=i.dataTransfer)===null||e===void 0?void 0:e.files,r=i.dataTransfer.getData("application/x-trix-document"),s={x:i.clientX,y:i.clientY};if((t=this.responder)===null||t===void 0||t.setLocationRangeFromPointRange(s),n!=null&&n.length)this.attachFiles(n);else if(this.draggedRange){var o,l;(o=this.delegate)===null||o===void 0||o.inputControllerWillMoveText(),(l=this.responder)===null||l===void 0||l.moveTextFromRange(this.draggedRange),this.draggedRange=null,this.requestRender()}else if(r){var a;const c=si.fromJSONString(r);(a=this.responder)===null||a===void 0||a.insertDocument(c),this.requestRender()}this.draggedRange=null,this.draggingPoint=null},cut(i){var e,t;if((e=this.responder)!==null&&e!==void 0&&e.selectionIsExpanded()&&(this.serializeSelectionToDataTransfer(i.clipboardData)&&i.preventDefault(),(t=this.delegate)===null||t===void 0||t.inputControllerWillCutText(),this.deleteInDirection("backward"),i.defaultPrevented))return this.requestRender()},copy(i){var e;(e=this.responder)!==null&&e!==void 0&&e.selectionIsExpanded()&&this.serializeSelectionToDataTransfer Line truncated
`,{updatePosition:!1}),this.requestRender()}},shift:{return(i){var e,t;(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),(t=this.responder)===null||t===void 0||t.insertString(`
`),this.requestRender(),i.preventDefault()},tab(i){var e,t;(e=this.responder)!==null&&e!==void 0&&e.canDecreaseNestingLevel()&&((t=this.responder)===null||t===void 0||t.decreaseNestingLevel(),this.requestRender(),i.preventDefault())},left(i){if(this.selectionIsInCursorTarget())return i.preventDefault(),this.expandSelectionInDirection("backward")},right(i){if(this.selectionIsInCursorTarget())return i.preventDefault(),this.expandSelectionInDirection("forward")}},alt:{backspace(i){var e;return this.setInputSummary({preferDocument:!1}),(e=this.delegate)===null||e===void 0?void 0:e.inputControllerWillPerformTyping()}},meta:{backspace(i){var e;return this.setInputSummary({preferDocument:!1}),(e=this.delegate)===null||e===void 0?void 0:e.inputControllerWillPerformTyping()}}}),ir.proxyMethod("responder?.getSelectedRange"),ir.proxyMethod("responder?.setSelectedRange"),ir.proxyMethod("responder?.expandSelectionInDirection"),ir.proxyMethod("responder?.selectionIsInCursorTarget"),ir.proxyMethod("responder?.selectionIsExpanded");const H4=i=>{var e;return(e=i.type)===null||e===void 0||(e=e.match(/\/(\w+)$/))===null||e===void 0?void 0:e[1]},K4=!((vf=" ".codePointAt)===null||vf===void 0||!vf.call(" ",0)),J4=function(i){if(i.key&&K4&&i.key.codePointAt(0)===i.keyCode)return i.key;{let e;if(i.which===null?e=i.keyCode:i.which!==0&&i.charCode!==0&&(e=i.charCode),e!=null&&Uk[e]!=="escape")return sa.fromCodepoints([e]).toString()}},eD=function(i){const e=i.clipboardData;if(e){if(e.types.includes("text/html")){for(const t of e.types){const n=/^CorePasteboardFlavorType/.test(t),r=/^dyn\./.test(t)&&e.getData(t);if(n||r)return!0}return!1}{const t=e.types.includes("com.apple.webarchive"),n=e.types.includes("com.apple.flat-rtfd");return t||n}}};class Ar extends Kt{constructor(e){super(...arguments),this.inputController=e,this.responder=this.inputController.responder,this.delegate=this.inputController.delegate,this.inputSummary=this.inputController.inputSummary,this.data={}}start(e){if(this.data.start=e,this.isSignificant()){var t,n;this.inputSummary.eventName==="keypress"&&this.inputSummary.textAdded&&((n=this.responder)===null||n===void 0||n.deleteInDirection("left")),this.selectionIsExpanded()||(this.insertPlaceholder(),this.requestRender()),this.range=(t=this.responder)===null||t===void 0?void 0:t.getSelectedRange()}}update(e){if(this.data.update=e,this.isSignificant()){const t=this.selectPlaceholder();t&&(this.forgetPlaceholder(),this.range=t)}}end(e){return this.data.end=e,this.isSignificant()?(this.forgetPlaceholder(),this.canApplyToDocument()?(this.setInputSummary({preferDocument:!0,didInput:!1}),(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(n=this.responder)===null||n===void 0||n.setSelectedRange(this.range),(r=this.responder)===null||r===void 0||r.insertString(this.data.end),(s=this.responder)===null||s===void 0?void 0:s.setSelectedRange(this.range[0]+this.data.end.length)):this.data.start!=null||this.data.update!=null?(this.requestReparse(),this.inputController.reset()):void 0):this.inputController.reset();var t,n,r,s}getEndData(){return this.data.end}isEnded(){return this.getEndData()!=null}isSignificant(){return!q4.composesExistingText||this.inputSummary.didInput}canApplyToDocument(){var e,t;return((e=this.data.start)===null||e===void 0?void 0:e.length)===0&&((t=this.data.end)===null||t===void 0?void 0:t.length)>0&&this.range}}Ar.proxyMethod("inputController.setInputSummary"),Ar.proxyMethod("inputController.requestRender"),Ar.proxyMethod("inputController.requestReparse"),Ar.proxyMethod("responder?.selectionIsExpanded"),Ar.proxyMethod("responder?.insertPlaceholder"),Ar.proxyMethod("responder?.selectPlaceholder"),Ar.proxyMethod("responder?.forgetPlaceholder");class Wl extends ch{constructor(){super(...arguments),this.render=this.render.bind(this)}elementDidMutate(){return this.scheduledRender?this.composing?(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidAllowUnhandledInput)===null||t===void 0?void 0:t.call(e):void 0:this.reparse();var e,t}scheduleRender(){return this.scheduledRender?this.scheduledRender:this.scheduledRender=requestAnimationFrame(this.render)}render(){var e,t;cancelAnimationFrame(this.scheduledRender),this.scheduledRender=null,this.composing||(t=this.delegate)===null||t===void 0||t.render(),(e=this.afterRender)===null||e===void 0||e.call(this),this.afterRender=null}reparse(){var e;return(e=this.delegate)===null||e===void 0?void 0:e.reparse()}insertString(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var r;return(r=this.responder)===null||r===void 0?void 0:r.insertString(t,n)})}toggleAttributeIfSupported(e){var t;if(Pd().includes(e))return(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformFormatting(e),this.withTargetDOMRange(function(){var n;return(n=this.responder)===nul Line truncated
`)},insertLink(){return this.activateAttributeIfSupported("href",this.event.data)},insertOrderedList(){return this.toggleAttributeIfSupported("number")},insertParagraph(){var i;return(i=this.delegate)===null||i===void 0||i.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var e;return(e=this.responder)===null||e===void 0?void 0:e.insertLineBreak()})},insertReplacementText(){const i=this.event.dataTransfer.getData("text/plain"),e=this.event.getTargetRanges()[0];this.withTargetDOMRange(e,()=>{this.insertString(i,{updatePosition:!1})})},insertText(){var i;return this.insertString(this.event.data||((i=this.event.dataTransfer)===null||i===void 0?void 0:i.getData("text/plain")))},insertTranspose(){return this.insertString(this.event.data)},insertUnorderedList(){return this.toggleAttributeIfSupported("bullet")}});const tD=function(i){const e=document.createRange();return e.setStart(i.startContainer,i.startOffset),e.setEnd(i.endContainer,i.endOffset),e},wf=i=>{var e;return Array.from(((e=i.dataTransfer)===null||e===void 0?void 0:e.types)||[]).includes("Files")},nD=i=>{var e;return((e=i.dataTransfer.files)===null||e===void 0?void 0:e[0])&&!jk(i)&&!(t=>{let{dataTransfer:n}=t;return n.types.includes("Files")&&n.types.includes("text/html")&&n.getData("text/html").includes("urn:schemas-microsoft-com:office:office")})(i)},jk=function(i){const e=i.clipboardData;if(e)return Array.from(e.types).filter(t=>t.match(/file/i)).length===e.types.length&&e.files.length>=1},iD=function(i){const e=i.clipboardData;if(e)return e.types.includes("text/plain")&&e.types.length===1},rD=function(i){const e=[];return i.altKey&&e.push("alt"),i.shiftKey&&e.push("shift"),e.push(i.key),e},yf=i=>({x:i.clientX,y:i.clientY}),Dd="[data-trix-attribute]",$d="[data-trix-action]",sD="".concat(Dd,", ").concat($d),uh="[data-trix-dialog]",oD="".concat(uh,"[data-trix-active]"),lD="".concat(uh," [data-trix-method]"),S0="".concat(uh," [data-trix-input]"),_0=(i,e)=>(e||(e=Ks(i)),i.querySelector("[data-trix-input][name='".concat(e,"']"))),C0=i=>i.getAttribute("data-trix-action"),Ks=i=>i.getAttribute("data-trix-attribute")||i.getAttribute("data-trix-dialog-attribute");class qk extends Kt{constructor(e){super(e),this.didClickActionButton=this.didClickActionButton.bind(this),this.didClickAttributeButton=this.didClickAttributeButton.bind(this),this.didClickDialogButton=this.didClickDialogButton.bind(this),this.didKeyDownDialogInput=this.didKeyDownDialogInput.bind(this),this.element=e,this.attributes={},this.actions={},this.resetDialogInputs(),Zt("mousedown",{onElement:this.element,matchingSelector:$d,withCallback:this.didClickActionButton}),Zt("mousedown",{onElement:this.element,matchingSelector:Dd,withCallback:this.didClickAttributeButton}),Zt("click",{onElement:this.element,matchingSelector:sD,preventDefault:!0}),Zt("click",{onElement:this.element,matchingSelector:lD,withCallback:this.didClickDialogButton}),Zt("keydown",{onElement:this.element,matchingSelector:S0,withCallback:this.didKeyDownDialogInput})}didClickActionButton(e,t){var n;(n=this.delegate)===null||n===void 0||n.toolbarDidClickButton(),e.preventDefault();const r=C0(t);return this.getDialog(r)?this.toggleDialog(r):(s=this.delegate)===null||s===void 0?void 0:s.toolbarDidInvokeAction(r,t);var s}didClickAttributeButton(e,t){var n;(n=this.delegate)===null||n===void 0||n.toolbarDidClickButton(),e.preventDefault();const r=Ks(t);var s;return this.getDialog(r)?this.toggleDialog(r):(s=this.delegate)===null||s===void 0||s.toolbarDidToggleAttribute(r),this.refreshAttributeButtons()}didClickDialogButton(e,t){const n=zr(t,{matchingSelector:uh});return this[t.getAttribute("data-trix-method")].call(this,n)}didKeyDownDialogInput(e,t){if(e.keyCode===13){e.preventDefault();const n=t.getAttribute("name"),r=this.getDialog(n);this.setAttribute(r)}if(e.keyCode===27)return e.preventDefault(),this.hideDialog()}updateActions(e){return this.actions=e,this.refreshActionButtons()}refreshActionButtons(){return this.eachActionButton((e,t)=>{e.disabled=this.actions[t]===!1})}eachActionButton(e){return Array.from(this.element.querySelectorAll($d)).map(t=>e(t,C0(t)))}updateAttributes(e){return this.attributes=e,this.refreshAttributeButtons()}refreshAttributeButtons(){return this.eachAttributeButton((e,t)=>(e.disabled=this.attributes[t]===!1,this.attributes[t]||this.dialogIsVisible(t)?(e.setAttribute("data-trix-active",""),e.classList.add("trix-active")):(e.removeAttribute("data-trix-active"),e.classList.remove("trix-active"))))}eachAttributeButton(e){return Array.from(this.element.querySelectorAll(Dd)).map(t=>e(t,Ks(t)))}applyKeyboardCommand(e){const t=JSON.stringify(e.sort());for(const n of Array.from(this.element.querySelectorAll("[data-trix-key]"))){const r=n.getAttribute("data-trix-key").split("+");if(JSON.stringify(r.sort())===t)return Ll("mousedown",{onElement:n}),!0}return!1}dialogIsVisible(e){const t=this.getDialog(e);if(t)return t.hasAttribute("data-trix-active")}toggleDialog(e){return this.dialogIsVisibl Line truncated
display: block;
}
%t {
white-space: nowrap;
}
%t [data-trix-dialog] {
display: none;
}
%t [data-trix-dialog][data-trix-active] {
display: block;
}
%t [data-trix-dialog] [data-trix-validate]:invalid {
background-color: #ffdddd;
}`);class Gk extends HTMLElement{connectedCallback(){this.innerHTML===""&&(this.innerHTML=hk.getDefaultHTML())}get editorElements(){if(this.id){var e;const t=(e=this.ownerDocument)===null||e===void 0?void 0:e.querySelectorAll('trix-editor[toolbar="'.concat(this.id,'"]'));return Array.from(t)}return[]}get editorElement(){const[e]=this.editorElements;return e}}let hD=0;const fD=function(i){if(!i.hasAttribute("contenteditable"))return i.toggleAttribute("contenteditable",!i.disabled),function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.times=1,Zt(e,t)}("focus",{onElement:i,withCallback:()=>dD(i)})},dD=function(i){return mD(i),pD()},mD=function(i){var e,t;if((e=(t=document).queryCommandSupported)!==null&&e!==void 0&&e.call(t,"enableObjectResizing"))return document.execCommand("enableObjectResizing",!1,!1),Zt("mscontrolselect",{onElement:i,preventDefault:!0})},pD=function(i){var e,t;if((e=(t=document).queryCommandSupported)!==null&&e!==void 0&&e.call(t,"DefaultParagraphSeparator")){const{tagName:n}=Sn.default;if(["div","p"].includes(n))return document.execCommand("DefaultParagraphSeparator",!1,n)}},P0=Da.forcesObjectResizing?{display:"inline",width:"auto"}:{display:"inline-block",width:"1px"};fk("trix-editor",`%t {
display: block;
}
%t:empty::before {
content: attr(placeholder);
color: graytext;
cursor: text;
pointer-events: none;
white-space: pre-line;
}
%t a[contenteditable=false] {
cursor: text;
}
%t img {
max-width: 100%;
height: auto;
}
%t `.concat(Ss,` figcaption textarea {
resize: none;
}
%t `).concat(Ss,` figcaption textarea.trix-autoresize-clone {
position: absolute;
left: -9999px;
max-height: 0px;
}
%t `).concat(Ss,` figcaption[data-trix-placeholder]:empty::before {
content: attr(data-trix-placeholder);
color: graytext;
}
%t [data-trix-cursor-target] {
display: `).concat(P0.display,` !important;
width: `).concat(P0.width,` !important;
padding: 0 !important;
margin: 0 !important;
border: none !important;
}
%t [data-trix-cursor-target=left] {
vertical-align: top !important;
margin-left: -1px !important;
}
%t [data-trix-cursor-target=right] {
vertical-align: bottom !important;
margin-right: -1px !important;
}`));var yi=new WeakMap,ac=new WeakMap,al=new WeakSet;class gD{constructor(e){var t,n;xk(t=this,n=al),n.add(t),gn(this,"value",""),mo(this,yi,{writable:!0,value:void 0}),mo(this,ac,{writable:!0,value:void 0}),this.element=e,Bl(this,yi,e.attachInternals()),Bl(this,ac,!1)}connectedCallback(){lc(this,al,cc).call(this)}disconnectedCallback(){}get form(){return rt(this,yi).form}get name(){return this.element.getAttribute("name")}set name(e){this.element.setAttribute("name",e)}get labels(){return rt(this,yi).labels}get disabled(){return rt(this,ac)||this.element.hasAttribute("disabled")}set disabled(e){this.element.toggleAttribute("disabled",e)}get required(){return this.element.hasAttribute("required")}set required(e){this.element.toggleAttribute("required",e),lc(this,al,cc).call(this)}get validity(){return rt(this,yi).validity}get validationMessage(){return rt(this,yi).validationMessage}get willValidate(){return rt(this,yi).willValidate}formDisabledCallback(e){Bl(this,ac,e)}setFormValue(e){this.value=e,lc(this,al,cc).call(this),rt(this,yi).setFormValue(this.element.disabled?void 0:this.value)}checkValidity(){return rt(this,yi).checkValidity()}reportValidity(){return rt(this,yi).reportValidity()}setCustomValidity(e){lc(this,al,cc).call(this,e)}}function cc(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{required:e,value:t}=this.element,n=e&&!t,r=!!i,s=Ge("input",{required:e}),o=i||s.validationMessage;rt(this,yi).setValidity({valueMissing:n,customError:r},o)}var kf=new WeakMap,Sf=new WeakMap,_f=new WeakMap;class OD{constructor(e){mo(this,kf,{writable:!0,value:void 0}),mo(this,Sf,{writable:!0,value:t=>{t.defaultPrevented||t.target===this.element.form&&this.element.reset()}}),mo(this,_f,{writable:!0,value:t=>{if(t.defaultPrevented||this.element.contains(t.target))return;const n=zr(t.target,{matchingSelector:"label"});n&&Array.from(this.labels).includes(n)&&this.element.focus()}}),this.element=e}connectedCallback(){Bl(this,kf,function(e){if(e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby"))return;const t=function(){const n=Array.from(e.labels).map(s=>{if(!s.contains(e))return s.textContent}).filter(s=>s),r=n.join(" ");return r?e.setAttribute("aria-label",r):e.removeAttribute("aria-label")};return t(),Zt("focus",{onElement:e,withCallback:t})}(this.element)),window.addEventListener("reset",rt(this,Sf),!1),window.addEventListener("click",rt(this,_f),!1)}disconnectedCallback(){var e;(e=rt(this,kf))===null||e===void 0||e.destroy(),window.removeEventListener("reset",rt(this,Sf),!1),window.removeEventListener("click",rt(this,_f),!1)}get labels(){const e=[];this.element.id&&this.element.ownerDocument&&e.push(...Array.from(this.element.ownerDocument.querySelectorAll("label[for='".concat(this.element.id,"']"))||[]));const t=zr(this.element,{matchingSelector:"label"});return t&&[this.element,null].includes(t.control)&&e.push(t),e}get form(){return console.warn("This browser does not support the .form property for trix-editor elements."),null}get name(){return console.warn("This browser does not support the .name property for trix-editor elements."),null}set name(e){console.warn("This browser does not support the .name property for trix-editor elements.")}get disabled(){return console.warn("This browser does not support the [disabled] attribute for trix-editor elements."),!1}set disabled(e){console.warn("This browser does not support the [disabled] attribute for trix-editor elements.")}get required(){return console.warn("This browser does not support the [required] attribute for trix-editor elements."),!1}set required(e){console.warn("This browser does not support the [required] attribute for trix-editor elements.")}get validity(){return console.warn("This browser does not support the validity property for trix-editor elements."),null}get validationMessage(){return console.warn("This browser does not support the validationMessage property for trix-editor elements."),""}get willValidate(){return console.warn("This browser does not support the willValidate property for trix-editor elements."),!1}formDisabledCallback(e){}setFormValue(e){}checkValidity(){return console.warn("This browser does not support checkValidity() for trix-editor elements."),!0}reportValidity(){return console.warn("This browser does not support reportValidity() for trix-editor elements."),!0}setCustomValidity(e){console.warn("This browser does not support setCustomValidity(validationMessage) for trix-editor elements.")}}var Xt=new WeakMap;class Su extends HTMLElement{constructor(){super(),mo(this,Xt,{writable:!0,value:void 0}),this.willCreateInput=!0,Bl(this,Xt,this.constructor.formAssociated?new gD(this):new OD(this))}get trixId(){return this.hasAttribute("trix-id")?this.getAttribute("trix-id"):(this.setAttribute("trix-id",++hD),this.trixId)}get labels(){return rt(this,Xt).labels}get disabled(){const{inputElement:e}=this;return e?e.disabled:rt(this,Xt).disabled}set disabled(e){const{inputElement:t}=this;t&&(t.disabled=e Line truncated
`){[e,t]=xo(this,e,t);let r="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let l=this.text[o],a=s+l.length;s>e&&o&&(r+=n),e<a&&t>s&&(r+=l.slice(Math.max(0,e-s),t-s)),s=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(t.push(new Ft(n,r)),n=[],r=-1);return r>-1&&t.push(new Ft(n,r)),t}}class Ni extends at{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=n+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,n,r);r=l+1,n=a+1}}decompose(e,t,n,r){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let l=this.children[s],a=o+l.length;if(e<=a&&t>=o){let c=r&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!c?n.push(l):l.decompose(e-o,t-o,n,c)}o=a+1}}replace(e,t,n){if([e,t]=xo(this,e,t),n.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let o=this.children[r],l=s+o.length;if(e>=s&&t<=l){let a=o.replace(e-s,t-s,n),c=this.lines-o.lines+a.lines;if(a.lines<c>>4&&a.lines>c>>6){let u=this.children.slice();return u[r]=a,new Ni(u,this.length-(t-e)+n.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=`
`){[e,t]=xo(this,e,t);let r="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let l=this.children[s],a=o+l.length;o>e&&s&&(r+=n),e<a&&t>o&&(r+=l.sliceString(e-o,t-o,n)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ni))return 0;let n=0,[r,s,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==l)return n;let a=this.children[r],c=e.children[s];if(a!=c)return n+a.scanIdentical(c,t);n+=a.length+1}}static from(e,t=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let d of e)n+=d.lines;if(n<32){let d=[];for(let m of e)m.flatten(d);return new Ft(d,t)}let r=Math.max(32,n>>5),s=r<<1,o=r>>1,l=[],a=0,c=-1,u=[];function h(d){let m;if(d.lines>s&&d instanceof Ni)for(let p of d.children)h(p);else d.lines>o&&(a>o||!a)?(f(),l.push(d)):d instanceof Ft&&a&&(m=u[u.length-1])instanceof Ft&&d.lines+m.lines<=32?(a+=d.lines,c+=d.length+1,u[u.length-1]=new Ft(m.text.concat(d.text),m.length+1+d.length)):(a+d.lines>r&&f(),a+=d.lines,c+=d.length+1,u.push(d))}function f(){a!=0&&(l.push(u.length==1?u[0]:Ni.from(u,c)),c=-1,a=u.length=0)}for(let d of e)h(d);return f(),l.length==1?l[0]:new Ni(l,t)}}at.empty=new Ft([""],0);function SD(i){let e=-1;for(let t of i)e+=t.length+1;return e}function Vc(i,e,t=0,n=1e9){for(let r=0,s=0,o=!0;s<i.length&&r<=n;s++){let l=i[s],a=r+l.length;a>=t&&(a>n&&(l=l.slice(0,n-r)),r<t&&(l=l.slice(t-r)),o?(e[e.length-1]+=l,o=!1):e.push(l)),r=a+1}return e}function T0(i,e,t){return Vc(i,[""],e,t)}class Fl{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Ft?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],s=this.offsets[n],o=s>>1,l=r instanceof Ft?r.text.length:r.children.length;if(o==(t>0?l:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(r instanceof Ft){let a=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof Ft?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Kk{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Fl(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Jk{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(at.prototype[Symbol.iterator]=function(){return this.iter()},Fl.prototype[Symbol.iterator]=Kk.prototype[Symbol.iterator]=Jk.prototype[Symbol.iterator]=function(){return this});let _D=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function xo(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}let po="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(i=>i?parseInt(i,36):1);for(let i=1;i<po.length;i++)po[i]+=po[i-1];function CD(i){for(let e=1;e<po.length;e+=2)if(po[e]>i)return po[e-1]<=i;return!1}function Q0(i){return i>=127462&&i<=127487}const M0=8205;function hn(i,e,t=!0,n=!0){return(t?eS:PD)(i,e,n)}function eS(i,e,t){if(e==i.length)return e;e&&tS(i.charCodeAt(e))&&nS(i.charCodeAt(e-1))&&e--;let n=ln(i,e);for(e+=oi(n);e<i.length;){let r=ln(i,e);if(n==M0||r==M0||t&&CD(r))e+=oi(r),n=r;else if(Q0(r)){let s=0,o=e-2;for(;o>=0&&Q0(ln(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function PD(i,e,t){for(;e>0;){let n=eS(i,e-2,t);if(n<e)return n;e--}return 0}function tS(i){return i>=56320&&i<57344}function nS(i){return i>=55296&&i<56320}function ln(i,e){let t=i.charCodeAt(e);if(!nS(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return tS(n)?(t-55296<<10)+(n-56320)+65536:t}function lp(i){return i<=65535?String.fromCharCode(i):(i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320))}function oi(i){return i<65536?1:2}const Ld=/\r\n?|\n/;var cn=function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i}(cn||(cn={}));class ji{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(n,r,s),r+=s):r+=o,n+=s}}iterChangedRan Line truncated
`}get readOnly(){return this.facet(hS)}phrase(e,...t){for(let n of this.facet(tt.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let s of this.facet(oS))for(let o of s(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){return ID(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,l=e-n;for(;o>0;){let a=hn(t,o,!1);if(s(t.slice(a,o))!=$t.Word)break;o=a}for(;l<r;){let a=hn(t,l);if(s(t.slice(l,a))!=$t.Word)break;l=a}return o==l?null:q.range(o+n,l+n)}}tt.allowMultipleSelections=Wd;tt.tabSize=ye.define({combine:i=>i.length?i[0]:4});tt.lineSeparator=lS;tt.readOnly=hS;tt.phrases=ye.define({compare(i,e){let t=Object.keys(i),n=Object.keys(e);return t.length==n.length&&t.every(r=>i[r]==e[r])}});tt.languageData=oS;tt.changeFilter=aS;tt.transactionFilter=cS;tt.transactionExtender=uS;Ur.reconfigure=Fe.define();function Qi(i,e,t={}){let n={};for(let r of i)for(let s of Object.keys(r)){let o=r[s],l=n[s];if(l===void 0)n[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,s))n[s]=t[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)n[r]===void 0&&(n[r]=e[r]);return n}class Qs{eq(e){return this==e}range(e,t=e){return Yd.create(e,t,this)}}Qs.prototype.startSide=Qs.prototype.endSide=0;Qs.prototype.point=!1;Qs.prototype.mapMode=cn.TrackDel;let Yd=class mS{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new mS(e,t,n)}};function zd(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}class up{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let s=n?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,c=s[a]-e||(n?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(e,t,n,r){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,s);s<o;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let n=[],r=[],s=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let c=this.value[a],u=this.from[a]+e,h=this.to[a]+e,f,d;if(u==h){let m=t.mapPos(u,c.startSide,c.mapMode);if(m==null||(f=d=m,c.startSide!=c.endSide&&(d=t.mapPos(u,c.endSide),d<f)))continue}else if(f=t.mapPos(u,c.startSide),d=t.mapPos(h,c.endSide),f>d||f==d&&c.startSide>0&&c.endSide<=0)continue;(d-f||c.endSide-c.startSide)<0||(o<0&&(o=f),c.point&&(l=Math.max(l,d-f)),n.push(c),r.push(f-o),s.push(d-o))}return{mapped:n.length?new up(r,s,n,l):null,pos:o}}}class it{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new it(e,t,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(n&&(t=t.slice().sort(zd)),this.isEmpty)return t.length?it.of(t):this;let l=new pS(this,null,-1).goto(0),a=0,c=[],u=new jr;for(;l.value||a<t.length;)if(a<t.length&&(l.from-t[a].from||l.startSide-t[a].value.startSide)>=0){let h=t[a++];u.addInner(h.from,h.to,h.value)||c.push(h)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(l.chunkIndex)<t[a].from)&&(!o||r>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&u.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||r>l.to||s<l.from||o(l.from,l.to,l.value))&&(u.addInner(l.from,l.to,l.value)||c.push(Yd.create(l.from,l.to,l.value))),l.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?it.empty:this.nextLayer.update({add:c,filter:o,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],r=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],c=e.touchesRange(l,l+a.length);if(c===!1)r=Math.max(r,a.maxPoint),t.push(a),n.push(e.mapPos(l));else if(c===!0){let{mapped:u,pos:h}=a.map(l,e);u&&(r=Math.max(r,u.maxPoint),t.push(u),n.push(h))}}let s=this.nextLayer.map(e);return t.length==0?s:new it(n,t,s||it.empty,r)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r];if(t>=s&&e<=s+o.length&&o.between(s,e-s,t-s,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return aa.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return aa.from(e).goto(t)}static compare(e,t,n,r,s=-1){let o=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),l=t.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),a=D0(o,l,n) Line truncated
`)}static newName(){let e=N0[I0]||1;return N0[I0]=e+1,jd+e.toString(36)}static mount(e,t,n){let r=e[qd],s=n&&n.nonce;r?s&&r.setNonce(s):r=new ZD(e,s),r.mount(Array.isArray(t)?t:[t],e)}}let Z0=new Map;class ZD{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=Z0.get(n);if(s)return e[qd]=s;this.sheet=new r.CSSStyleSheet,Z0.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[qd]=this}mount(e,t){let n=this.sheet,r=0,s=0;for(let o=0;o<e.length;o++){let l=e[o],a=this.modules.indexOf(l);if(a<s&&a>-1&&(this.modules.splice(a,1),s--,a=-1),a==-1){if(this.modules.splice(s++,0,l),n)for(let c=0;c<l.rules.length;c++)n.insertRule(l.rules[c],r++)}else{for(;s<a;)r+=this.modules[s++].rules.length;r+=l.rules.length,s++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o="";for(let a=0;a<this.modules.length;a++)o+=this.modules[a].getRules()+`
`;this.styleTag.textContent=o;let l=t.head||t;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Gr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ca={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},BD=typeof navigator<"u"&&/Mac/.test(navigator.platform),WD=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var an=0;an<10;an++)Gr[48+an]=Gr[96+an]=String(an);for(var an=1;an<=24;an++)Gr[an+111]="F"+an;for(var an=65;an<=90;an++)Gr[an]=String.fromCharCode(an+32),ca[an]=String.fromCharCode(an);for(var Pf in Gr)ca.hasOwnProperty(Pf)||(ca[Pf]=Gr[Pf]);function XD(i){var e=BD&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||WD&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?ca:Gr)[i.keyCode]||i.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function ua(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function Gd(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function FD(i){let e=i.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function jc(i,e){if(!e.anchorNode)return!1;try{return Gd(i,e.anchorNode)}catch{return!1}}function ha(i){return i.nodeType==3?Es(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function zl(i,e,t,n){return t?B0(i,e,t,n,-1)||B0(i,e,t,n,1):!1}function Ms(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function Pu(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(i.nodeName)}function B0(i,e,t,n,r){for(;;){if(i==t&&e==n)return!0;if(e==(r<0?0:fr(i))){if(i.nodeName=="DIV")return!1;let s=i.parentNode;if(!s||s.nodeType!=1)return!1;e=Ms(i)+(r<0?0:1),i=s}else if(i.nodeType==1){if(i=i.childNodes[e+(r<0?-1:0)],i.nodeType==1&&i.contentEditable=="false")return!1;e=r<0?fr(i):0}else return!1}}function fr(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function hh(i,e){let t=e?i.left:i.right;return{left:t,right:t,top:i.top,bottom:i.bottom}}function YD(i){let e=i.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:i.innerWidth,top:0,bottom:i.innerHeight}}function gS(i,e){let t=e.width/i.offsetWidth,n=e.height/i.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-i.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-i.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function zD(i,e,t,n,r,s,o,l){let a=i.ownerDocument,c=a.defaultView||window;for(let u=i,h=!1;u&&!h;)if(u.nodeType==1){let f,d=u==a.body,m=1,p=1;if(d)f=YD(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(h=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let w=u.getBoundingClientRect();({scaleX:m,scaleY:p}=gS(u,w)),f={left:w.left,right:w.left+u.clientWidth*m,top:w.top,bottom:w.top+u.clientHeight*p}}let g=0,b=0;if(r=="nearest")e.top<f.top?(b=-(f.top-e.top+o),t>0&&e.bottom>f.bottom+b&&(b=e.bottom-f.bottom+b+o)):e.bottom>f.bottom&&(b=e.bottom-f.bottom+o,t<0&&e.top-b<f.top&&(b=-(f.top+b-e.top+o)));else{let w=e.bottom-e.top,S=f.bottom-f.top;b=(r=="center"&&w<=S?e.top+w/2-S/2:r=="start"||r=="center"&&t<0?e.top-o:e.bottom-S+o)-f.top}if(n=="nearest"?e.left<f.left?(g=-(f.left-e.left+s),t>0&&e.right>f.right+g&&(g=e.right-f.right+g+s)):e.right>f.right&&(g=e.right-f.right+s,t<0&&e.left<f.left+g&&(g=-(f.left+g-e.left+s))):g=(n=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:n=="start"==l?e.left-s:e.right-(f.right-f.left)+s)-f.left,g||b)if(d)c.scrollBy(g,b);else{let w=0,S=0;if(b){let _=u.scrollTop;u.scrollTop+=b/p,S=(u.scrollTop-_)*p}if(g){let _=u.scrollLeft;u.scrollLeft+=g/m,w=(u.scrollLeft-_)*m}e={left:e.left-w,top:e.top-S,right:e.right-w,bottom:e.bottom-S},w&&Math.abs(w-g)<1&&(n="nearest"),S&&Math.abs(S-b)<1&&(r="nearest")}if(d)break;u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function VD(i){let e=i.ownerDocument,t,n;for(let r=i.parentNode;r&&!(r==e.body||t&&n);)if(r.nodeType==1)!n&&r.scrollHeight>r.clientHeight&&(n=r),!t&&r.scrollWidth>r.clientWidth&&(t=r),r=rLine truncated
`,r=i.state.doc.line(r.number+(t?1:-1)),s=i.bidiSpans(r),c=i.visualLineSide(r,!t)}if(a){if(!a(u))return l}else{if(!n)return c;a=n(u)}l=c}}function C5(i,e,t){let n=i.state.charCategorizer(e),r=n(t);return s=>{let o=n(s);return r==$t.Space&&(r=o),r==o}}function P5(i,e,t,n){let r=e.head,s=t?1:-1;if(r==(t?i.state.doc.length:0))return q.cursor(r,e.assoc);let o=e.goalColumn,l,a=i.contentDOM.getBoundingClientRect(),c=i.coordsAtPos(r,e.assoc||-1),u=i.documentTop;if(c)o==null&&(o=c.left-a.left),l=s<0?c.top:c.bottom;else{let d=i.viewState.lineBlockAt(r);o==null&&(o=Math.min(a.right-a.left,i.defaultCharacterWidth*(r-d.from))),l=(s<0?d.top:d.bottom)+u}let h=a.left+o,f=n??i.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let m=l+(f+d)*s,p=KS(i,{x:h,y:m},!1,s);if(m<a.top||m>a.bottom||(s<0?p<r:p>r)){let g=i.docView.coordsForChar(p),b=!g||m<g.top?-1:1;return q.cursor(p,b,void 0,o)}}}function qc(i,e,t){for(;;){let n=0;for(let r of i)r.between(e-1,e+1,(s,o,l)=>{if(e>s&&e<o){let a=n||t||(e-s<o-e?-1:1);e=a<0?s:o,n=a}});if(!n)return e}}function Qf(i,e,t){let n=qc(i.state.facet(mp).map(r=>r(i)),t.from,e.head>t.from?-1:1);return n==t.from?t:q.cursor(n,n<t.from?1:-1)}const _l="￿";class A5{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(tt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=_l}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let s=this.text.length;this.readNode(r);let o=r.nextSibling;if(o==t)break;let l=St.get(r),a=St.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:Pu(r))||Pu(o)&&(r.nodeName!="BR"||r.cmIgnore)&&this.text.length>s)&&this.lineBreak(),r=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(l=r.exec(t))&&(s=l.index,o=l[0].length),this.append(t.slice(n,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);n=s+o}}readNode(e){if(e.cmIgnore)return;let t=St.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(x5(e,n.node,n.offset)?t:0))}}function x5(i,e,t){for(;;){if(!e||t<fr(e))return!1;if(e==i)return!0;t=Ms(e)+1,e=e.parentNode}}class J0{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class T5{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let l=s||o?[]:E5(e),a=new A5(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=R5(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=s&&s.node==l.focusNode&&s.offset==l.focusOffset||!Gd(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),c=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Gd(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),u=e.viewport;if((ke.ios||ke.chrome)&&e.state.selection.main.empty&&a!=c&&(u.from>0||u.to<e.state.doc.length)){let h=Math.min(a,c),f=Math.max(a,c),d=u.from-h,m=u.to-f;(d==0||d==1||h==0)&&(m==0||m==-1||f==e.state.doc.length)&&(a=0,c=e.state.doc.length)}this.newSel=q.single(c,a)}}}function JS(i,e){let t,{newSel:n}=e,r=i.state.selection.main,s=i.inputState.lastKeyTime>Date.now()-100?i.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=r.from,c=null;(s===8||ke.android&&e.text.length<l-o)&&(a=r.to,c="end");let u=M5(i.state.doc.sliceString(o,l,_l),e.text,a-o,c);u&&(ke.chrome&&s==13&&u.toB==u.from+2&&e.text.slice(u.from,u.toB)==_l+_l&&u.toB--,t={from:o+u.from,to:o+u.toA,insert:at.of(e.text.slice(u.from,u.toB).split(_l))})}else n&&(!i.hasFocus&&i.state.facet(Dr)||n.main.eq(r))&&(n=null);if(!t&&!n)return!1;if(!t&&e.typeOver&&!r.empty&&n&&n.main.empty?t={from:r.from,to:r.to,insert:i.state.doc.slice(r.from,r.to)}:t&&t.from>=r.from&&t.to<=r.to&&(t.from!=r.from||t.to!=r.to)&&r.to-r.from-(t.to-t.from)<=4?t={from:r.from,to:r.to,insert:i.state.doc.slice(r.from,t.from).append(t.insert).append(i.state.doc.slice(t.to,r.to))}:(ke.mac||ke.android)&&t&&t.from==t.to&&t.from==r.head-1&&/^\. ?$/.test(t.insert.toString())&&i.contentDOM.getAttribute("autocorrect")=="off"?(n&&t.insert.length==2&&(n=q.single(n.main.anchor- Line truncated
`&&i.lineWrapping&&(n&&(n=q.single(n.main.anchor-1,n.main.head-1)),t={from:r.from,to:r.to,insert:at.of([" "])}),t)return pp(i,t,n,s);if(n&&!n.main.eq(r)){let o=!1,l="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(o=!0),l=i.inputState.lastSelectionOrigin),i.dispatch({selection:n,scrollIntoView:o,userEvent:l}),!0}else return!1}function pp(i,e,t,n=-1){if(ke.ios&&i.inputState.flushIOSKey(e))return!0;let r=i.state.selection.main;if(ke.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&i.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Oo(i.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&Oo(i.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Oo(i.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,l=()=>o||(o=Q5(i,e,t));return i.state.facet(BS).some(a=>a(i,e.from,e.to,s,l))||i.dispatch(l()),!0}function Q5(i,e,t){let n,r=i.state,s=r.selection.main;if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let l=s.from<e.from?r.sliceDoc(s.from,e.from):"",a=s.to>e.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(i.state.toText(l+e.insert.sliceString(0,void 0,i.state.lineBreak)+a))}else{let l=r.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(r.selection.ranges.length>1&&i.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let c=i.state.sliceDoc(e.from,e.to),u,h=t&&HS(i,t.main.head);if(h){let m=e.insert.length-(e.to-e.from);u={from:h.from,to:h.to-m}}else u=i.state.doc.lineAt(s.head);let f=s.to-e.to,d=s.to-s.from;n=r.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:l,range:a||m.map(l)};let p=m.to-f,g=p-c.length;if(m.to-m.from!=d||i.state.sliceDoc(g,p)!=c||m.to>=u.from&&m.from<=u.to)return{range:m};let b=r.changes({from:g,to:p,insert:e.insert}),w=m.to-s.to;return{changes:b,range:a?q.range(Math.max(0,a.anchor+w),Math.max(0,a.head+w)):m.map(b)}})}else n={changes:l,selection:a&&r.selection.replaceRange(a)}}let o="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,o+=".compose",i.inputState.compositionFirstChange&&(o+=".start",i.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:o,scrollIntoView:!0})}function M5(i,e,t,n){let r=Math.min(i.length,e.length),s=0;for(;s<r&&i.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&i.length==e.length)return null;let o=i.length,l=e.length;for(;o>0&&l>0&&i.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(n=="end"){let a=Math.max(0,s-Math.min(o,l));t-=o+a-s}if(o<s&&i.length<e.length){let a=t<=s&&t>=o?s-t:0;s-=a,l=s+(l-o),o=s}else if(l<s){let a=t<=s&&t>=l?s-t:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function E5(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}=i.observer.selectionRange;return t&&(e.push(new J0(t,n)),(r!=t||s!=n)&&e.push(new J0(r,s))),e}function R5(i,e){if(i.length==0)return null;let t=i[0].pos,n=i.length==2?i[1].pos:t;return t>-1&&n>-1?q.single(t+e,n+e):null}class D5{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,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=e.hasFocus,ke.safari&&e.contentDOM.addEventListener("input",()=>null),ke.gecko&&G5(e.contentDOM.ownerDocument)}handleEvent(e){!X5(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,t);for(let r of n.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=$5(e),n=this.handlers,r=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].handlers.length,l=n[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in n)s!="scroll"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&t2.indexOf(e.keyCode)<0&&(thi Line truncated
`))};s.from==this.from&&r<this.from?s.from=r:s.to==this.to&&r>this.to&&(s.to=r),!(s.from==s.to&&!s.insert.length)&&(this.pendingContextChange=s,e.state.readOnly||pp(e,s,q.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=n=>{let r=[],s=null;for(let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);o<l;o++){let a=e.coordsForChar(o);s=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||s||new DOMRect,r.push(s)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=n=>{let r=[];for(let s of n.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(o!="None"&&l!="None"){let a=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;r.push(Qe.mark({attributes:{style:a}}).range(this.toEditorPos(s.rangeStart),this.toEditorPos(s.rangeEnd)))}}e.dispatch({effects:zS.of(Qe.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let n in this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let r=ua(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,c)=>{if(n)return;let u=c.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=u,this.to+=u;return}else r=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=u,this.to+=u;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=u}t+=u}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Oe{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var 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),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(r=>r.forEach(s=>n(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||jD(e.parent)||document,this.viewState=new fb(e.state||tt.create(e)),e.scrollTo&&e.scrollTo.is(dc)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(kl).map(r=>new xf(r));for(let r of this.plugins)r.update(this);this.observer=new u$(this),this.inputState=new D5(this) Line truncated
--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,gm),E$={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 Rf=null;function R$(){var i;if(Rf==null&&typeof document<"u"&&document.body){let e=document.body.style;Rf=((i=e.tabSize)!==null&&i!==void 0?i:e.MozTabSize)!=null}return Rf||!1}const Kc=ye.define({combine(i){let e=Qi(i,{render:null,specialChars:M$,addSpecialChars:null});return(e.replaceTabs=!R$())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,gm)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,gm)),e}});function D$(i={}){return[Kc.of(i),$$()]}let kb=null;function $$(){return kb||(kb=Vt.fromClass(class{constructor(i){this.view=i,this.decorations=Qe.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(i.state.facet(Kc)),this.decorations=this.decorator.createDeco(i)}makeDecorator(i){return new Q$({regexp:i.specialChars,decoration:(e,t,n)=>{let{doc:r}=t.state,s=ln(e[0],0);if(s==9){let o=r.lineAt(n),l=t.state.tabSize,a=Pi(o.text,l,n-o.from);return Qe.replace({widget:new Z$((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Qe.replace({widget:new N$(i,s)}))},boundary:i.replaceTabs?void 0:/[^]/})}update(i){let e=i.state.facet(Kc);i.startState.facet(Kc)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(i.view)):this.decorations=this.decorator.updateDeco(i,this.decorations)}},{decorations:i=>i.decorations}))}const L$="•";function I$(i){return i>=32?L$:i==10?"␤":String.fromCharCode(9216+i)}class N$ extends br{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=I$(this.code),n=e.state.phrase("Control character")+" "+(E$[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let s=document.createElement("span");return s.textContent=t,s.title=n,s.setAttribute("aria-label",n),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class Z$ extends br{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function B$(){return X$}const W$=Qe.line({class:"cm-activeLine"}),X$=Vt.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.docChanged||i.selectionSet)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=-1,t=[];for(let n of i.state.selection.ranges){let r=i.lineBlockAt(n.head);r.from>e&&(t.push(W$.range(r.from)),e=r.from)}return Qe.set(t)}},{decorations:i=>i.decorations}),Om=2e3;function F$(i,e,t){let n=Math.min(e.line,t.line),r=Math.max(e.line,t.line),s=[];if(e.off>Om||t.off>Om||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=n;a<=r;a++){let c=i.doc.line(a);c.length<=l&&s.push(q.range(c.from+o,c.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=n;a<=r;a++){let c=i.doc.line(a),u=Ud(c.text,o,i.tabSize,!0);if(u<0)s.push(q.cursor(c.to));else{let h=Ud(c.text,l,i.tabSize);s.push(q.range(c.from+u,c.from+h))}}}return s}function Y$(i,e){let t=i.coordsAtPos(i.viewport.from);return t?Math.round(Math.abs((t.left-e)/i.defaultCharacterWidth)):-1}function Sb(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1),n=i.state.doc.lineAt(t),r=t-n.from,s=r>Om?-1:r==n.length?Y$(i,e.clientX):Pi(n.text,i.state.tabSize,t-n.from);return{line:n.number,col:s,off:r}}function z$(i,e){let t=Sb(i,e),n=i.state.selection;return t?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(t.line).from),o=r.state.doc.lineAt(s);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},n=n.map(r.changes)}},get(r,s,o){let l=Sb(i,r);if(!l)return n;let a=F$(i.state,t,l);return a.length?o?q.create(a.concat(n.ranges)):q.create(a):n}}:null}function V$(i){let e=t=>t.altKey&&t.button==0;return Oe.mouseSelectionStyle.of((t,n)=>e(n)?z$(t,n):null)}const U$={Alt:[18,i=>!!i.altKey],Control:[17,i=>!!i.ctrlKey],Shift:[16,i=>!!i.shiftKey],Meta:[91,i=>!!i.metaKey]},j$={style:"cursor: crosshair"};function q$(i={}){let[e,t]=U$[i.key||"Alt"],n=Vt.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[n,Oe.contentAttributes.of(r=>{var s;return!((s=r.plugin(n))===null||s===void 0) Line truncated
`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new eI(this):new K7(this)}getCursor(e,t=0,n){let r=e.doc?e:tt.create({doc:e});return n==null&&(n=r.doc.length),this.regexp?eo(this,r,t,n):Js(this,r,t,n)}}class R_{constructor(e){this.spec=e}}function Js(i,e,t,n){return new Do(e.doc,i.unquoted,t,n,i.caseSensitive?void 0:r=>r.toLowerCase(),i.wholeWord?H7(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function H7(i,e){return(t,n,r,s)=>((s>t||s+r.length<n)&&(s=Math.max(0,t-2),r=i.sliceString(s,Math.min(i.length,n+2))),(e(Xu(r,t-s))!=$t.Word||e(Fu(r,t-s))!=$t.Word)&&(e(Fu(r,n-s))!=$t.Word||e(Xu(r,n-s))!=$t.Word))}class K7 extends R_{constructor(e){super(e)}nextMatch(e,t,n){let r=Js(this.spec,e,n,e.doc.length).nextOverlapping();return r.done&&(r=Js(this.spec,e,0,t).nextOverlapping()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let s=Math.max(t,r-1e4-this.spec.unquoted.length),o=Js(this.spec,e,s,r),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(s==t)return null;r-=1e4}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=Js(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let s=Js(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function eo(i,e,t,n){return new Q_(e.doc,i.search,{ignoreCase:!i.caseSensitive,test:i.wholeWord?J7(e.charCategorizer(e.selection.main.head)):void 0},t,n)}function Xu(i,e){return i.slice(hn(i,e,!1),e)}function Fu(i,e){return i.slice(e,hn(i,e))}function J7(i){return(e,t,n)=>!n[0].length||(i(Xu(n.input,n.index))!=$t.Word||i(Fu(n.input,n.index))!=$t.Word)&&(i(Fu(n.input,n.index+n[0].length))!=$t.Word||i(Xu(n.input,n.index+n[0].length))!=$t.Word)}class eI extends R_{nextMatch(e,t,n){let r=eo(this.spec,e,n,e.doc.length).next();return r.done&&(r=eo(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let s=Math.max(t,n-r*1e4),o=eo(this.spec,e,s,n),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==t||l.from>s+10))return l;if(s==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(t,n)=>n=="$"?"$":n=="&"?e.match[0]:n!="0"&&+n<e.match.length?e.match[n]:t)}matchAll(e,t){let n=eo(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let s=eo(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const wa=Fe.define(),Ep=Fe.define(),Wr=Jt.define({create(i){return new zf(Qm(i).create(),null)},update(i,e){for(let t of e.effects)t.is(wa)?i=new zf(t.value.create(),i.panel):t.is(Ep)&&(i=new zf(i.query,t.value?Rp:null));return i},provide:i=>pa.from(i,e=>e.panel)});class zf{constructor(e,t){this.query=e,this.panel=t}}const tI=Qe.mark({class:"cm-searchMatch"}),nI=Qe.mark({class:"cm-searchMatch cm-searchMatch-selected"}),iI=Vt.fromClass(class{constructor(i){this.view=i,this.decorations=this.highlight(i.state.field(Wr))}update(i){let e=i.state.field(Wr);(e!=i.startState.field(Wr)||i.docChanged||i.selectionSet||i.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:i,panel:e}){if(!e||!i.spec.valid)return Qe.none;let{view:t}=this,n=new jr;for(let r=0,s=t.visibleRanges,o=s.length;r<o;r++){let{from:l,to:a}=s[r];for(;r<o-1&&a>s[r+1].from-2*250;)a=s[++r].to;i.highlight(t.state,l,a,(c,u)=>{let h=t.state.selection.ranges.some(f=>f.from==c&&f.to==u);n.add(c,u,h?nI:tI)})}return n.finish()}},{decorations:i=>i.decorations});function Fa(i){return e=>{let t=e.state.field(Wr,!1);return t&&t.query.spec.valid?i(e,t):L_(e)}}const Yu=Fa((i,{query:e})=>{let{to:t}=i.state.selection.main,n=e.nextMatch(i.state,t,t);if(!n)return!1;let r=q.single(n.from,n.to),s=i.state.facet(Vo);return i.dispatch({selection:r,effects:[Dp(i,n),s.scrollToMatch(r.main,i)],userEvent:"select.search"}),$_(i),!0}),zu=Fa((i,{query:e})=>{let{state:t}=i,{from:n}=t.selection.main,r=e.prevMatch(t,n,n);if(!r)return!1;let s=q.single(r.from,r.to),o=i.state.facet(Vo);return i.dispatch({selection:s,effects:[Dp(i,r),o.scrollToMatch(s.main,i)],userEvent:"select.search"}),$_(i),!0}),rI=Fa((i,{query:e})=>{let t=e.matchAll(i.state,1e3);return!t||!t.length?!1:(i.dispatch({selection:q.create(t.map(n=>q.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),sI=({state:i,dispatch:e})=>{let t=i.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:n,to:r}=t.main,s=[],o=0;for(let l=new Do(i.doc,i.sliceDoc(n,r));!l.next().done;){if(s.length>1e3)return!1;l.va Line truncated
`+t.scrub(),s=this.advance(r);return s>-1&&s<r.length?this.complete(e,n,s):!1}finish(e,t){return(this.stage==2||this.stage==3)&&jl(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,n){return e.addLeafElement(t,st(ce.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(CC(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(st(ce.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(SC(e,jl(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=jl(e,this.pos),n=0;if(t>this.pos){let r=_C(e,t,this.start);if(r){let s=Gf(e,r.to-this.start);s>0&&(this.nextStage(r),n=s)}}return n||(n=Gf(e,this.pos)),n>0&&n<e.length?n:-1}else return Gf(e,this.pos)}}}function Gf(i,e){for(;e<i.length;e++){let t=i.charCodeAt(e);if(t==10)break;if(!pi(t))return-1}return e}class VN{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:dC(t),s=t.next;if(r<0)return!1;let o=st(ce.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,st(s==61?ce.SetextHeading1:ce.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),o])),!0}finish(){return!1}}const UN={LinkReference(i,e){return e.content.charCodeAt(0)==91?new zN(e):null},SetextHeading(){return new VN}},jN=[(i,e)=>fC(e)>=0,(i,e)=>cC(e)>=0,(i,e)=>uC(e)>=0,(i,e)=>Vp(e,i,!0)>=0,(i,e)=>Up(e,i,!0)>=0,(i,e)=>zp(e,i,!0)>=0,(i,e)=>gC(e,i,!0)>=0],qN={text:"",end:0};class GN{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new YN,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=Ku.create(ce.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new eZ(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let n=0;;){let r=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;n<e.markers.length&&(!r||e.markers[n].from<r.end);){let s=e.markers[n++];this.addNode(s.type,s.from,s.to)}if(!r)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let n of this.parser.blockParsers)if(n){let r=n(this,e);if(r!=!1){if(r==!0)return null;e.forward();continue e}}break}let t=new FN(this.lineStart+e.pos,e.text.slice(e.pos));for(let n of this.parser.leafBlockParsers)if(n){let r=n(this,t);r&&t.parsers.push(r)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break e}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
`+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=PC(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=qN;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let n=this.absoluteLineStart,r=this.rangeI;for(;this.ranges[r].to<t.end;){r++;let s=this.ranges[r].from,o=this.lineChunkAt(s);t.end=s+o.length,t.text=t.text.slice(0,this.ranges[r-1].to-n)+o,n=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let r=this.stack[e.depth],s=this.parser.skipContextMarkup[r.type];if(!s)throw new Error("Unhandled block context "+ce[r.type]);if(!s(r,this,e))break;e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
`?"":t;else{let r=t.indexOf(`
`);n=r<0?t:t.slice(0,r)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=Ku.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e=="number"&&(e=new gt(this.parser.nodeSet.types[e],Lo,Lo,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements($m(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?OC(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let n of e.parsers)if(n.finish(this,e))return;let t=$m(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(ce.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e=="string"?st(this.parser.getNodeType(e),t,n,r):new wC(e,t)}get buffer(){return new vC(this.parser.nodeSet)}}function OC(i,e,t,n,r){let s=i[e].to,o=[],l=[],a=t.from+n;function c(u,h){for(;h?u>=s:u>s;){let f=i[e+1].from-s;n+=f,u+=f,e++,s=i[e].to}}for(let u=t.firstChild;u;u=u.nextSibling){c(u.from+n,!0);let h=u.from+n,f,d=r.get(u.tree);d?f=d:u.to+n>s?(f=OC(i,e,u,n,r),c(u.to+n,!1)):f=u.toTree(),o.push(f),l.push(h-a)}return c(t.to+n,!1),new gt(t.type,o,l,t.to+n-a,t.tree?t.tree.propValues:void 0)}class Ch extends kp{constructor(e,t,n,r,s,o,l,a,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=l,this.inlineNames=a,this.wrappers=c,this.nodeTypes=Object.create(null);for(let u of e.types)this.nodeTypes[u.name]=u.id}createParse(e,t,n){let r=new GN(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}configure(e){let t=Rm(e);if(!t)return this;let{nodeSet:n,skipContextMarkup:r}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),l=this.blockNames.slice(),a=this.inlineParsers.slice(),c=this.inlineNames.slice(),u=this.endLeafBlock.slice(),h=this.wrappers;if(pl(t.defineNodes)){r=Object.assign({},r);let f=n.types.slice(),d;for(let m of t.defineNodes){let{name:p,block:g,composite:b,style:w}=typeof m=="string"?{name:m}:m;if(f.some(k=>k.name==p))continue;b&&(r[f.length]=(k,Q,x)=>b(Q,x,k.value));let S=f.length,_=b?["Block","BlockContext"]:g?S>=ce.ATXHeading1&&S<=ce.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;f.push(tn.define({id:S,name:p,props:_&&[[Ze.group,_]]})),w&&(d||(d={}),Array.isArray(w)||w instanceof jn?d[p]=w:Object.assign(d,w))}n=new Za(f),d&&(n=n.extend(Ws(d)))}if(pl(t.props)&&(n=n.extend(...t.props)),pl(t.remove))for(let f of t.remove){let d=this.blockNames.indexOf(f),m=this.inlineNames.indexOf(f);d>-1&&(s[d]=o[d]=void 0),m>-1&&(a[m]=void 0)}if(pl(t.parseBlock))for(let f of t.parseBlock){let d=l.indexOf(f.name);if(d>-1)s[d]=f.parse,o[d]=f.leaf;else{let m=f.before?Rc(l,f.before):f.after?Rc(l,f.after)+1:l.length-1;s.splice(m,0,f.parse),o.splice(m,0,f.leaf),l.splice(m,0,f.name)}f.endLeaf&&u.push(f.endLeaf)}if(pl(t.parseInline))for(let f of t.parseInline){let d=c.indexOf(f.name);if(d>-1)a[d]=f.parse;else{let m=f.before?Rc(c,f.before):f.after?Rc(c,f.after)+1:c.length-1;a.splice(m,0,f.parse),c.splice(m,0,f.name)}}return t.wrap&&(h=h.concat(t.wrap)),new Ch(n,s,o,l,u,r,a,c,h)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new KN(this,e,t);e:for(let r=t;r<n.end;){let s=n.char(r);for(let o of this.inlineParsers)if(o){let l=o(n,s,r);if(l>=0){r=l;continue e}}r++}return n.resolveMarkers(0)}}function pl(i){return i!=null&&i.length>0}function Rm(i){if(!Array.isArray(i))return i;if(i.length==0)return null;let e=Rm(i[0]);if(i.length==1)return e;let t=Rm(i.slice(1));if(!t||!e)return e||t;let n=(o,l)=>(o||Lo).concat(l||Lo),r=e.wrap,s=t.wrap;return{props:n(e.props,t.props),defineNodes:n(e.defineNodes,t.defineNodes),parseBlock:n(e.parseBlock,t.parseBlock),parseInline:n(e.parseInline,t.parseInline),remove:n(e.remove,t.remove),wrap:r?s?(o,l,a,c)=>r(s(o,l,a,c),l,a,c):r:s}}function Rc(i,e){let t=i.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}let bC=[tn.none];for(let i=1,e;e=ce[i];i++)bC[i]=tn.define({id:i,name:e,props:i>=ce.Escape?[]:[[Ze.group,i in aC?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const Lo=[];class vC{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){re Line truncated
`;)s--;this.fragmentEnd=s?s-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(Ze.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,l=e.block.children.length,a=o,c=l;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let u=PC(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,u);else{let h=new gt(e.parser.nodeSet.types[ce.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(h,t.tree),e.addNode(h,u)}if(t.type.is("Block")&&(JN.indexOf(t.type.id)<0?(o=t.to-n,l=e.block.children.length):(o=a,l=c,a=t.to-n,c=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>l;)e.block.children.pop(),e.block.positions.pop();return o-s}}function PC(i,e){let t=i;for(let n=1;n<e.length;n++){let r=e[n-1].to,s=e[n].from;r<i&&(t-=s-r)}return t}const tZ=Ws({"Blockquote/...":I.quote,HorizontalRule:I.contentSeparator,"ATXHeading1/... SetextHeading1/...":I.heading1,"ATXHeading2/... SetextHeading2/...":I.heading2,"ATXHeading3/...":I.heading3,"ATXHeading4/...":I.heading4,"ATXHeading5/...":I.heading5,"ATXHeading6/...":I.heading6,"Comment CommentBlock":I.comment,Escape:I.escape,Entity:I.character,"Emphasis/...":I.emphasis,"StrongEmphasis/...":I.strong,"Link/... Image/...":I.link,"OrderedList/... BulletList/...":I.list,"BlockQuote/...":I.quote,"InlineCode CodeText":I.monospace,"URL Autolink":I.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":I.processingInstruction,"CodeInfo LinkLabel":I.labelName,LinkTitle:I.string,Paragraph:I.content}),nZ=new Ch(new Za(bC).extend(tZ),Object.keys(Ec).map(i=>Ec[i]),Object.keys(Ec).map(i=>UN[i]),Object.keys(Ec),jN,aC,Object.keys(Hf).map(i=>Hf[i]),Object.keys(Hf),[]);function iZ(i,e,t){let n=[];for(let r=i.firstChild,s=e;;r=r.nextSibling){let o=r?r.from:t;if(o>s&&n.push({from:s,to:o}),!r)break;s=r.to}return n}function rZ(i){let{codeParser:e,htmlParser:t}=i;return{wrap:Q2((r,s)=>{let o=r.type.id;if(e&&(o==ce.CodeBlock||o==ce.FencedCode)){let l="";if(o==ce.FencedCode){let c=r.node.getChild(ce.CodeInfo);c&&(l=s.read(c.from,c.to))}let a=e(l);if(a)return{parser:a,overlay:c=>c.type.id==ce.CodeText}}else if(t&&(o==ce.HTMLBlock||o==ce.HTMLTag))return{parser:t,overlay:iZ(r.node,r.from,r.to)};return null})}}const sZ={resolve:"Strikethrough",mark:"StrikethroughMark"},oZ={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":I.strikethrough}},{name:"StrikethroughMark",style:I.processingInstruction}],parseInline:[{name:"Strikethrough",parse(i,e,t){if(e!=126||i.char(t+1)!=126||i.char(t+2)==126)return-1;let n=i.slice(t-1,t),r=i.slice(t+2,t+3),s=/\s|^$/.test(n),o=/\s|^$/.test(r),l=Pa.test(n),a=Pa.test(r);return i.addDelimiter(sZ,t,t+2,!o&&(!a||s||l),!s&&(!l||o||a))},after:"Emphasis"}]};function ql(i,e,t=0,n,r=0){let s=0,o=!0,l=-1,a=-1,c=!1,u=()=>{n.push(i.elt("TableCell",r+l,r+a,i.parser.parseInline(e.slice(l,a),r+l)))};for(let h=t;h<e.length;h++){let f=e.charCodeAt(h);f==124&&!c?((!o||l>-1)&&s++,o=!1,n&&(l>-1&&u(),n.push(i.elt("TableDelimiter",h+r,h+r+1))),l=a=-1):(c||f!=32&&f!=9)&&(l<0&&(l=h),a=h+1),c=!c&&f==92}return l>-1&&(s++,n&&u()),s}function Qv(i,e){for(let t=e;t<i.length;t++){let n=i.charCodeAt(t);if(n==124)return!0;n==92&&t++}return!1}const AC=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class Mv{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&AC.test(r=t.text.slice(t.pos))){let s=[];ql(e,n.content,0,s,n.start)==ql(e,r,t.pos)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,s),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let r=[];ql(e,t.text,t.pos,r,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,r))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows)),!0):!1}}const lZ={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":I.heading}},"TableRow",{name:"TableCell",style:I.content},{name:"TableDelimiter",style:I.processingInstruction}],parseBlock:[{name:"Table",leaf(i,e){return Qv(e.content,0)?new Mv:null},endLeaf(i,e,t){if(t.parsers.some(r=>r instanceof Mv)||!Qv(e.text,e.basePos))return!1;let n=i.scanLine(i.absoluteLineEnd+1).text;return AC.test(n)&&ql(i,e.text,e.basePos)==ql(i,n,e.basePos)},before:"SetextHeading"}]};class aZ{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const cZ={defineNodes:[{name:"Task",block:!0,style:I.list},{name:"TaskMarker",style:I.atom}],parseBlock:[ Line truncated
\${}
} catch (\${error}) {
\${}
}`,{label:"try",detail:"/ catch block",type:"keyword"}),Qn("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Qn(`if (\${}) {
\${}
} else {
\${}
}`,{label:"if",detail:"/ else block",type:"keyword"}),Qn(`class \${name} {
constructor(\${params}) {
\${}
}
}`,{label:"class",detail:"definition",type:"keyword"}),Qn('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Qn('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],nB=zC.concat([Qn("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Qn("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Qn("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Kv=new T2,VC=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function gl(i){return(e,t)=>{let n=e.node.getChild("VariableDefinition");return n&&t(n,i),!0}}const iB=["FunctionDeclaration"],rB={FunctionDeclaration:gl("function"),ClassDeclaration:gl("class"),ClassExpression:()=>!0,EnumDeclaration:gl("constant"),TypeAliasDeclaration:gl("type"),NamespaceDeclaration:gl("namespace"),VariableDefinition(i,e){i.matchContext(iB)||e(i,"variable")},TypeDefinition(i,e){e(i,"type")},__proto__:null};function UC(i,e){let t=Kv.get(e);if(t)return t;let n=[],r=!0;function s(o,l){let a=i.sliceString(o.from,o.to);n.push({label:a,type:l})}return e.cursor(Pt.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let l=rB[o.name];if(l&&l(o,s)||VC.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of UC(i,o.node))n.push(l);return!1}}),Kv.set(e,n),n}const Jv=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,jC=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function sB(i){let e=At(i.state).resolveInner(i.pos,-1);if(jC.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&Jv.test(i.state.sliceDoc(e.from,e.to));if(!t&&!i.explicit)return null;let n=[];for(let r=e;r;r=r.parent)VC.has(r.name)&&(n=n.concat(UC(i.state.doc,r)));return{options:n,from:t?e.from:i.pos,validFor:Jv}}const qi=Ds.define({name:"javascript",parser:tB.configure({props:[Yo.add({IfStatement:vo({except:/^\s*({|else\b)/}),TryStatement:vo({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:jL,SwitchBody:i=>{let e=i.textAfter,t=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return i.baseIndent+(t?0:n?1:2)*i.unit},Block:UL({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"TemplateString BlockComment":()=>null,"Statement Property":vo({except:/^{/}),JSXElement(i){let e=/^\s*<\//.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},JSXEscape(i){let e=/\s*\}/.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"JSXOpenTag JSXSelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),Xs.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Ap,BlockComment(i){return{from:i.from+2,to:i.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),qC={test:i=>/^JSX/.test(i.name),facet:Sp({commentTokens:{block:{open:"{/*",close:"*/}"}}})},GC=qi.configure({dialect:"ts"},"typescript"),HC=qi.configure({dialect:"jsx",props:[_p.add(i=>i.isTop?[qC]:void 0)]}),KC=qi.configure({dialect:"jsx ts",props:[_p.add(i=>i.isTop?[qC]:void 0)]},"typescript");let JC=i=>({label:i,type:"keyword"});const eP="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(JC),oB=eP.concat(["declare","implements","private","protected","public"].map(JC));function lB(i={}){let e=i.jsx?i.typescript?KC:HC:i.typescript?GC:qi,t=i.typescript?nB.concat(oB):zC.concat(eP);return new Ro(e,[qi.data.of({autocomplete:fI(jC,N_(t))}),qi.data.of({autocomplete:sB}),i.jsx?uB:[]])}function aB(i){for(;;){if(i.name=="JSXOpenTag"||i.name=="JSXSelfClosingTag"||i.name=="JSXFragmentTag")return i;if(i.name=="JSXEscape"||!i.parent)return null;i=i.parent}}function ew(i,e,t=i.length){for(let n=e==null?void 0:e.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return i.sliceString(n.from,Math.min(n.to,t));return""}const cB=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),uB=Oe.inputHandler.of((i,e,t,n,r)=>{if((cB?i.composing:i.compositionStarted)||i.state.readOnly||e!=t||n!=">"&&n!="/"||!qi.isActiveAt(i.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(a=>{var c;let{head:u}=a,h=At(o).resolveInner(u-1,-1),f;if(h.name=="JSXStartTag"&&(h=h.parent),!(o.doc.sliceString(u-1,u)!=n||h.name=="JSXAttributeValue"&&h.to>u)){if(n==">"&&h.name=="JSXFragmentTag")return{range:a,changes:{from:u,insert:"</>"}};if(n=="/"&&h.name=="JSXStartCloseTag"){let d=h.parent,m=d.parent;if(m&&d.from==u-2&&((f=ew(o.doc,m.firstChild,u))||((c=m.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let Line truncated
versions`),xt=D(),H=y("div"),Ye.c(),Tt=D(),yt=y("div"),ct&&ct.c(),O(s,"class","label text-end text-muted"),O(f,"class","label text-end text-muted"),O(w,"class","label text-end text-muted"),O($,"class","label text-end text-muted"),O(n,"class","col-8"),O(ee,"class","label d-block text-muted"),O(X,"class","col-4"),O(t,"class","row"),O(e,"class","lx-card"),O(H,"class","revisions")},m(qe,Mt){A(qe,e,Mt),v(e,t),v(t,n),v(n,r),v(r,s),v(r,o),v(r,l),v(l,c),v(n,u),v(n,h),v(h,f),v(h,d),v(h,p),v(n,g),v(n,b),v(b,w),v(b,S),Y(_,b,null),v(b,k),v(b,x),v(n,C),v(n,M),v(M,$),v(M,N),Y(B,M,null),v(M,J),v(M,ie),v(t,le),v(t,X),v(X,ee),v(X,Te),v(X,ve),v(ve,Ue),v(ve,Ee),v(ve,Re),A(qe,xt,Mt),A(qe,H,Mt),Ke[Pe].m(H,null),A(qe,Tt,Mt),A(qe,yt,Mt),ct&&ct.m(yt,null),i[13](yt),wt=!0},p(qe,[Mt]){(!wt||Mt&1)&&a!==(a=qe[0].id+"")&&K(c,a),(!wt||Mt&1)&&m!==(m=qe[0].version+"")&&K(p,m);const ei={};Mt&3&&(ei.name=Dn(qe[1],qe[0].createdBy)),_.$set(ei),(!wt||Mt&1)&&Q!==(Q=Bi(qe[0].createdAt)+"")&&K(x,Q);const ti={};Mt&3&&(ti.name=Dn(qe[1],qe[0].updatedBy)),B.$set(ti),(!wt||Mt&1)&&te!==(te=Bi(qe[0].updatedAt)+"")&&K(ie,te),(!wt||Mt&4)&&ne!==(ne=qe[2].revisions+"")&&K(Ee,ne);let Ri=Pe;Pe=Ut(qe),Pe===Ri?Ke[Pe].p(qe,Mt):(me(),R(Ke[Ri],1,1,()=>{Ke[Ri]=null}),pe(),Ye=Ke[Pe],Ye?Ye.p(qe,Mt):(Ye=Ke[Pe]=Qt[Pe](qe),Ye.c()),T(Ye,1),Ye.m(H,null)),qe[5]?ct?(ct.p(qe,Mt),Mt&32&&T(ct,1)):(ct=Dw(qe),ct.c(),T(ct,1),ct.m(yt,null)):ct&&(me(),R(ct,1,1,()=>{ct=null}),pe())},i(qe){wt||(T(_.$$.fragment,qe),T(B.$$.fragment,qe),T(Ye),T(ct),wt=!0)},o(qe){R(_.$$.fragment,qe),R(B.$$.fragment,qe),R(Ye),R(ct),wt=!1},d(qe){qe&&(P(e),P(xt),P(H),P(Tt),P(yt)),z(_),z(B),Ke[Pe].d(),ct&&ct.d(),i[13](null)}}}function vW(i,e,t){let n,r,s,o;const l=je("channel");let{record:a}=e,{graph:c}=e,{users:u}=e,{schema:h}=e,f,d="";axios.get(`${l.lucentUrl}/records/${a.id}/revisions`).then(S=>{t(8,n=S.data)}).catch(S=>{console.log(S)});function m(S,_){t(7,o=c.edges.filter(k=>k.depth===1).reduce((k,Q)=>(k[Q.field]||(k[Q.field]={record:[],revision:[]}),k[Q.field].record.push(Q),k),{})),t(7,o=_._edges.reduce((k,Q)=>(k[Q.field]||(k[Q.field]={record:[],revision:[]}),k[Q.field].revision.push(Q),k),o))}function p(S,_){S.preventDefault(),t(5,s=_),t(6,r=h.fields.filter(k=>!na(s.data[k.name],a.data[k.name]))),m(r,_),f.scrollIntoView()}function g(S){S.preventDefault(),t(4,d=""),axios.post(`${l.lucentUrl}/records/${a.id}/rollback/${s.version}`).then(_=>{window.location.reload()}).catch(_=>{const k=_.response.data.error;t(4,d=k.fieldLabel+": "+k.message)})}const b=(S,_)=>p(_,S);function w(S){Se[S?"unshift":"push"](()=>{f=S,t(3,f)})}return i.$$set=S=>{"record"in S&&t(0,a=S.record),"graph"in S&&t(11,c=S.graph),"users"in S&&t(1,u=S.users),"schema"in S&&t(2,h=S.schema)},t(8,n=[]),t(6,r=[]),t(5,s=null),t(7,o={}),[a,u,h,f,d,s,r,o,n,p,g,c,b,w]}class wW extends oe{constructor(e){super(),se(this,e,vW,bW,re,{record:0,graph:11,users:1,schema:2})}}const{window:yW}=CP;function Xw(i,e,t){const n=i.slice();return n[21]=e[t],n}function kW(i){let e,t,n;return{c(){e=y("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Save`,O(e,"type","button"),O(e,"class","button primary ms-2 btn btn-primary btn-spinner")},m(r,s){A(r,e,s),t||(n=G(e,"click",i[11]),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function SW(i){let e,t,n;return{c(){e=y("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Create`,O(e,"class","button primary btn-spinner")},m(r,s){A(r,e,s),t||(n=G(e,"click",i[11]),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function _W(i){let e,t;return e=new wW({props:{record:i[0],graph:i[1],users:i[4],schema:i[2]}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&1&&(s.record=n[0]),r&2&&(s.graph=n[1]),r&16&&(s.users=n[4]),r&4&&(s.schema=n[2]),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function CW(i){let e,t;return e=new rW({props:{graph:i[1],record:i[0]}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&2&&(s.graph=n[1]),r&1&&(s.record=n[0]),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function PW(i){let e=[],t=new Map,n,r,s=ue(i[9]);const o=l=>l[21].name;for(let l=0;l<s.length;l+=1){let a=Xw(i,s,l),c=o(a);t.set(c,e[l]=Yw(c,a))}return{c(){for(let l=0;l<e.length;l+=1)e[l].c();n=De()},m(l,a){for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(l,a);A(l,n,a),r=!0},p(l,a){a&623&&(s=ue(l[9]),me(),e=di(e,a,o,1,l,s,t,n.parentNode,mr,Yw,n,Xw),pe())},i(l){if(!r){for(let a=0;a<s.length;a+=1)T(e[a]);r=!0}},o(l){for(let a=0;a<e.length;a+=1)R(e[a]);r=!1},d(l){l&&P(n);for(let a=0;a<e.length;a+=1)e[a].d(l)}}}function Fw(i){let e,t,n,r;function s(a){i[15](a)}function o(a){i[16](a)}let l={field:i[21],schema:i[2],record:i[0],validationErrors:i[5],isCreateMode:i[3]};return i[0].data!==void 0&&(l.data=i[0].data),i[1]!==void 0&&(l.graph=i[1]),e=new gP({props:l}),Se.push(()=>He(e,"data",s)),Se.push(()=>He(e,"graph",o)),{c(){V(e.$$.fragment)},m(a,c){Y(e,a,c),r=!0},p(a,c){const u={};c&4&&(u.schema=a[2]),c&1&&(u.record=a[0]),c&32&&(u.validationErrors=a[5]),c&8&&(u.isCreateMode=a[3]),!t&&c&1&&(t=!0,u.data=a[0].data,nt(()=>t=!1)),!n&&c&2&&(n=!0,u.graph=a[1],nt(()=>n=!1)),e.$set(u)},i(a){r||(T(e.$$.fragment,a),r=!0)},o(a){R(e.$$.fragment,a),r=!1},d(a){z(e,a)}}}function Yw(i,e){let t,n,r,s=e[6]===e[21].group&&Fw(e);return{key:i,first:null,c(){t=De(),s&&s.c(),n=De(),this.first=t},m(o,l){A(o,t,l),s&&s.m(o,l),A(o,n,l),r=!0},p(o,l){e=o,e[6]===e[21].group?s?(s.p(e,l),l&64&&T(s,1)):(s=Fw(e),s.c(),T(s,1),s.m(n.parentNode,n)):s&&(me(),R(s,1,1,()=>{s=null}),pe())},i(o){r||(T(s),r=!0)},o(o){R(s),r=!1},d(o){o&&(P(t),P(n)),s&&s.d(o)}}}function AW(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,b,w,S,_,k;function Q(X){i[12](X)}function x(X){i[13](X)}let C={schema:i[2],isCreateMode:i[3]};i[0]!==void 0&&(C.record=i[0]),i[6]!==void 0&&(C.activeContentTab=i[6]),n=new wy({props:C}),Se.push(()=>He(n,"record",Q)),Se.push(()=>He(n,"activeContentTab",x));function M(X,ee){if(X[3])return SW;if(X[8])return kW}let $=M(i),N=$&&$(i);a=new Dy({props:{schema:i[2],record:i[0],isCreateMode:i[3]}}),u=new Ma({props:{message:i[7]}});function B(X){i[14](X)}let J={schema:i[2],isCreateMode:i[3]};i[6]!==void 0&&(J.active=i[6]),d=new yy({props:J}),Se.push(()=>He(d,"active",B));const te=[PW,CW,_W],ie=[];function le(X,ee){return ee&64&&(g=null),g==null&&(g=!["_graph","_info"].includes(X[6])),g?0:X[6]==="_graph"?1:X[6]==="_info"?2:-1}return~(b=le(i,-1))&&(w=ie[b]=te[b](i)),{c(){e=y("div"),t=y("div"),V(n.$$.fragment),o=D(),N&&N.c(),l=D(),V(a.$$.fragment),c=D(),V(u.$$.fragment),h=D(),f=y("div"),V(d.$$.fragment),p=D(),w&&w.c(),O(t,"class","tools-header"),O(f,"class","mt-4"),fe(f,"margin-bottom","150px"),fe(f,"position","relative"),O(e,"class","record-edit")},m(X,ee){A(X,e,ee),v(e,t),Y(n,t,null),v(t,o),N&&N.m(t,null),v(e,l),Y(a,e,null),v(e,c),Y(u,e,null),v(e,h),v(e,f),Y(d,f,null),v(f,p),~b&&ie[b].m(f,null),S=!0,_||(k=G(yW,"beforeunload",i[10]),_=!0)},p(X,[ee]){const Te={};ee&4&&(Te.schema=X[2]),ee&8&&(Te.isCreateMode=X[3]),!r&&ee&1&&(r=!0,Te.record=X[0],nt(()=>r=!1)),!s&&ee&64&&(s=!0,Te.activeContentTab=X[6],nt(()=>s=!1)),n.$set(Te),$===($=M(X))&&N?N.p(X,ee):(N&&N.d(1),N=$&&$(X),N&&(N.c(),N.m(t,null)));const ve={};ee&4&&(ve.schema=X[2]),ee&1&&(ve.record=X[0]),ee&8&&(ve.isCreateMode=X[3]),a.$set(ve);const Ue={};ee&128&&(Ue.message=X[7]),u.$set(Ue);const ne={};ee&4&&(ne.schema=X[2]),ee&8&&(ne.isCreateMode=X[3]),!m&&ee&64&&(m=!0,ne.active=X[6],nt(()=>m=!1)),d.$set(ne);let Ee=b;b=le(X,ee),b===Ee?~b&&ie[b].p(X,ee):(w&&(me(),R(ie[Ee],1,1,()=>{ie[Ee]=null}),pe()),~b?(w=ie[b],w?w.p(X,ee):(w=ie[b]=te[b](X),w.c()),T(w,1),w.m(f,null)):w=null)},i(X){S||(T(n.$$.fragment,X),T(a.$$.fragment,X),T(u.$$.fragment,X),T(d.$$.fragment,X),T(w),S=!0)},o(X){R(n.$$.fragment,X),R(a.$$.fragment,X),R(u.$$.fragment,X),R(d.$$.fragment,X),R(w),S=!1},d(X){X&&P(e),z(n),N&&N.d(),z(a),z(u),z(d),~b&&ie[b].d(),_=!1,k()}}}function xW(i,e,t){let n,r,s;const o=je("channel");let{schema:l}=e,{record:a}=e,{graph:c={records:[],edges:[]}}=e,{isCreateMode:u}=e,{users:h}=e,f,d="",m=l.fields.filter(C=>C.name!=="id");Ti(()=>{p()});function p(){f={data:JSON.parse(JSON.stringify(a.data)),status:a.status,edges:JSON.parse(JSON.stringify(c.edges))}}cy(()=>{t(8,n=b())});function g(C){return n?C.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete C.returnValue,"...")}function b(){retu Line truncated
`),p=y("div"),p.textContent=" ",g=W(`
`),O(n,"class","header-small mb-5"),O(o,"class","button primary mb-3"),o.disabled=i[2],O(c,"class","mb-3"),O(f,"class","logs svelte-16mig2w"),O(t,"class","lx-card mt-5"),O(e,"class","common-wrapper")},m(k,Q){A(k,e,Q),v(e,t),v(t,n),v(n,r),v(t,s),v(t,o),v(o,l),v(t,a),v(t,c),S&&S.m(c,null),v(c,u),_&&_.m(c,null),v(t,h),v(t,f),v(f,d),v(f,m),v(f,p),i[6](p),v(f,g),b||(w=G(o,"click",i[4]),b=!0)},p(k,[Q]){Q&1&&K(r,k[0]),Q&4&&(o.disabled=k[2]),k[2]?S||(S=Hw(),S.c(),S.m(c,u)):S&&(S.d(1),S=null),!k[2]&&k[3]?_||(_=Kw(),_.c(),_.m(c,null)):_&&(_.d(1),_=null),Q&8&&K(d,k[3])},i:U,o:U,d(k){k&&P(e),S&&S.d(),_&&_.d(),i[6](null),b=!1,w()}}}function XW(i,e,t){let n;const r=je("channel");let{title:s}=e,{command:o}=e,l,a=!1;function c(){const f=new EventSource(r.lucentUrl+"/command-report-source/"+o.signature);f.onmessage=function(d){t(2,a=!0);const m=JSON.parse(d.data);m.date,t(3,n=m.logs),l.scrollIntoView()},f.onerror=d=>{console.log(d),f.close(),t(2,a=!1)}}function u(f){f.preventDefault(),t(2,a=!0),Jn(r.lucentUrl+"/command/"+o.signature).then(d=>{c()})}Ti(()=>{c()});function h(f){Se[f?"unshift":"push"](()=>{l=f,t(1,l)})}return i.$$set=f=>{"title"in f&&t(0,s=f.title),"command"in f&&t(5,o=f.command)},t(3,n=""),[s,l,a,n,u,o,h]}class FW extends oe{constructor(e){super(),se(this,e,XW,WW,re,{title:0,command:5})}}function Jw(i,e,t){const n=i.slice();return n[2]=e[t],n}function YW(i){let e,t;return{c(){e=y("a"),t=W("Members"),O(e,"class","top-nav-item"),O(e,"href",i[0].lucentUrl+"/members")},m(n,r){A(n,e,r),v(e,t)},p:U,d(n){n&&P(e)}}}function zW(i){let e,t;return e=new Gi({props:{$$slots:{button:[UW],default:[VW]},$$scope:{ctx:i}}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&32&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function ey(i){let e,t=i[2].name+"",n;return{c(){e=y("a"),n=W(t),O(e,"href",i[0].lucentUrl+"/command-report/"+i[2].signature),O(e,"class","top-nav-item")},m(r,s){A(r,e,s),v(e,n)},p:U,d(r){r&&P(e)}}}function VW(i){let e,t=ue(i[0].commands),n=[];for(let r=0;r<t.length;r+=1)n[r]=ey(Jw(i,t,r));return{c(){for(let r=0;r<n.length;r+=1)n[r].c();e=De()},m(r,s){for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(r,s);A(r,e,s)},p(r,s){if(s&1){t=ue(r[0].commands);let o;for(o=0;o<t.length;o+=1){const l=Jw(r,t,o);n[o]?n[o].p(l,s):(n[o]=ey(l),n[o].c(),n[o].m(e.parentNode,e))}for(;o<n.length;o+=1)n[o].d(1);n.length=t.length}},d(r){r&&P(e),mt(n,r)}}}function UW(i){let e;return{c(){e=y("div"),e.textContent="Actions",O(e,"slot","button")},m(t,n){A(t,e,n)},p:U,d(t){t&&P(e)}}}function jW(i){let e,t;return e=new Ci({props:{side:"28",name:i[1].name}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p:U,i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function qW(i){let e,t,n;return t=new Ci({props:{side:"28",name:i[1].name}}),{c(){e=y("a"),V(t.$$.fragment),O(e,"href",i[0].lucentUrl+"/profile")},m(r,s){A(r,e,s),Y(t,e,null),n=!0},p:U,i(r){n||(T(t.$$.fragment,r),n=!0)},o(r){R(t.$$.fragment,r),n=!1},d(r){r&&P(e),z(t)}}}function GW(i){let e,t,n,r,s,o,l=i[0].auth=="lucent"&&YW(i),a=i[0].commands.length>0&&zW(i);const c=[qW,jW],u=[];function h(f,d){return f[0].auth=="lucent"?0:1}return r=h(i),s=u[r]=c[r](i),{c(){e=y("div"),l&&l.c(),t=D(),a&&a.c(),n=D(),s.c(),O(e,"class","top-nav")},m(f,d){A(f,e,d),l&&l.m(e,null),v(e,t),a&&a.m(e,null),v(e,n),u[r].m(e,null),o=!0},p(f,[d]){f[0].auth=="lucent"&&l.p(f,d),f[0].commands.length>0&&a.p(f,d),s.p(f,d)},i(f){o||(T(a),T(s),o=!0)},o(f){R(a),R(s),o=!1},d(f){f&&P(e),l&&l.d(),a&&a.d(),u[r].d()}}}function HW(i){const e=je("channel"),t=je("user");return[e,t]}class KW extends oe{constructor(e){super(),se(this,e,HW,GW,re,{})}}function JW(i){let e,t,n,r,s,o,l,a,c;n=new EW({props:{schema:i[2].schema}}),o=new KW({});const u=[{title:i[0]},i[2]];var h=i[3][i[1]];function f(d,m){let p={};for(let g=0;g<u.length;g+=1)p=Cs(p,u[g]);return m!==void 0&&m&5&&(p=Cs(p,So(u,[m&1&&{title:d[0]},m&4&&_o(d[2])]))),{props:p}}return h&&(a=Fr(h,f(i))),{c(){e=y("div"),t=y("div"),V(n.$$.fragment),r=D(),s=y("div"),V(o.$$.fragment),l=D(),a&&V(a.$$.fragment),O(t,"class","sidebar-content"),O(s,"class","main-content"),O(e,"class","main-wrapper")},m(d,m){A(d,e,m),v(e,t),Y(n,t,null),v(e,r),v(e,s),Y(o,s,null),v(s,l),a&&Y(a,s,null),c=!0},p(d,[m]){const p={};if(m&4&&(p.schema=d[2].schema),n.$set(p),m&2&&h!==(h=d[3][d[1]])){if(a){me();const g=a;R(g.$$.fragment,1,0,()=>{z(g,1)}),pe()}h?(a=Fr(h,f(d,m)),V(a.$$.fragment),T(a.$$.fragment,1),Y(a,s,null)):a=null}else if(h){const g=m&5?So(u,[m&1&&{title:d[0]},m&4&&_o(d[2])]):{};a.$set(g)}},i(d){c||(T(n.$$.fragment,d),T(o.$$.fragment,d),a&&T(a.$$.fragment,d),c=!0)},o(d){R(n.$$.fragment,d),R(o.$$.fragment,d),a&&R(a.$$.fragment,d),c=!1},d(d){d&&P(e),z(n),z(o),a&&z(a)}}}function e9(i,e,t){const n={members:Xx,recordEdit:TW,recordNotFound:zx,contentIndex:Iy,homeIndex:BW,buildReport:FW};let{title:r}=e,{view:s}=e,{user:o}=e,{data:l}=e,{channel:a}=e,{readableSchemas:c}=e;return Tl("channel",a),Tl("rea Line truncated
-5
View File
@@ -1,5 +0,0 @@
@charset "UTF-8";/*!
* Bootstrap v5.3.2 (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/:root,[data-bs-theme=light]{--bs-blue: #0d6efd;--bs-indigo: #6610f2;--bs-purple: #6f42c1;--bs-pink: #d63384;--bs-red: #dc3545;--bs-orange: #fd7e14;--bs-yellow: #ffc107;--bs-green: #198754;--bs-teal: #20c997;--bs-cyan: #0dcaf0;--bs-black: black;--bs-white: #fff;--bs-gray: #6c757d;--bs-gray-dark: #343a40;--bs-gray-100: #f8f9fa;--bs-gray-200: #e9ecef;--bs-gray-300: #dee2e6;--bs-gray-400: #ced4da;--bs-gray-500: #adb5bd;--bs-gray-600: #6c757d;--bs-gray-700: #495057;--bs-gray-800: #343a40;--bs-gray-900: #212529;--bs-primary: #0b5d1e;--bs-secondary: #6c757d;--bs-success: #198754;--bs-info: #0dcaf0;--bs-warning: #ffc107;--bs-danger: #dc3545;--bs-light: #f8f9fa;--bs-dark: #212529;--bs-primary-rgb: 11, 93, 30;--bs-secondary-rgb: 108, 117, 125;--bs-success-rgb: 25, 135, 84;--bs-info-rgb: 13, 202, 240;--bs-warning-rgb: 255, 193, 7;--bs-danger-rgb: 220, 53, 69;--bs-light-rgb: 248, 249, 250;--bs-dark-rgb: 33, 37, 41;--bs-primary-text-emphasis: #04250c;--bs-secondary-text-emphasis: #2b2f32;--bs-success-text-emphasis: #0a3622;--bs-info-text-emphasis: #055160;--bs-warning-text-emphasis: #664d03;--bs-danger-text-emphasis: #58151c;--bs-light-text-emphasis: #495057;--bs-dark-text-emphasis: #495057;--bs-primary-bg-subtle: #cedfd2;--bs-secondary-bg-subtle: #e2e3e5;--bs-success-bg-subtle: #d1e7dd;--bs-info-bg-subtle: #cff4fc;--bs-warning-bg-subtle: #fff3cd;--bs-danger-bg-subtle: #f8d7da;--bs-light-bg-subtle: #fcfcfd;--bs-dark-bg-subtle: #ced4da;--bs-primary-border-subtle: #9dbea5;--bs-secondary-border-subtle: #c4c8cb;--bs-success-border-subtle: #a3cfbb;--bs-info-border-subtle: #9eeaf9;--bs-warning-border-subtle: #ffe69c;--bs-danger-border-subtle: #f1aeb5;--bs-light-border-subtle: #e9ecef;--bs-dark-border-subtle: #adb5bd;--bs-white-rgb: 255, 255, 255;--bs-black-rgb: 0, 0, 0;--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, 0));--bs-body-font-family: var(--bs-font-sans-serif);--bs-body-font-size: 1rem;--bs-body-font-weight: 400;--bs-body-line-height: 1.5;--bs-body-color: #212529;--bs-body-color-rgb: 33, 37, 41;--bs-body-bg: #fff;--bs-body-bg-rgb: 255, 255, 255;--bs-emphasis-color: black;--bs-emphasis-color-rgb: 0, 0, 0;--bs-secondary-color: rgba(33, 37, 41, .75);--bs-secondary-color-rgb: 33, 37, 41;--bs-secondary-bg: #e9ecef;--bs-secondary-bg-rgb: 233, 236, 239;--bs-tertiary-color: rgba(33, 37, 41, .5);--bs-tertiary-color-rgb: 33, 37, 41;--bs-tertiary-bg: #f8f9fa;--bs-tertiary-bg-rgb: 248, 249, 250;--bs-heading-color: inherit;--bs-link-color: #0b5d1e;--bs-link-color-rgb: 11, 93, 30;--bs-link-decoration: underline;--bs-link-hover-color: #094a18;--bs-link-hover-color-rgb: 9, 74, 24;--bs-code-color: #d63384;--bs-highlight-color: #212529;--bs-highlight-bg: #fff3cd;--bs-border-width: 1px;--bs-border-style: solid;--bs-border-color: #dee2e6;--bs-border-color-translucent: rgba(0, 0, 0, .175);--bs-border-radius: .375rem;--bs-border-radius-sm: .25rem;--bs-border-radius-lg: .5rem;--bs-border-radius-xl: 1rem;--bs-border-radius-xxl: 2rem;--bs-border-radius-2xl: var(--bs-border-radius-xxl);--bs-border-radius-pill: 50rem;--bs-box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);--bs-box-shadow-sm: 0 .125rem .25rem rgba(0, 0, 0, .075);--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, .175);--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, .075);--bs-focus-ring-width: .25rem;--bs-focus-ring-opacity: .25;--bs-focus-ring-color: rgba(11, 93, 30, .25);--bs-form-valid-color: #198754;--bs-form-valid-border-color: #198754;--bs-form-invalid-color: #dc3545;--bs-form-invalid-border-color: #dc3545}[data-bs-theme=dark]{color-scheme:dark;--bs-body-color: #dee2e6;--bs-body-color-rgb: 222, 226, 230;--bs-body-bg: #212529;--bs-body-bg-rgb: 33, 37, 41;--bs-emphasis-color: #fff;--bs-emphasis-color-rgb: 255, 255, 255;--bs-secondary-color: rgba(222, 226, 230, .75);--bs-secondary-color-rgb: 222, 226, 230;--bs-secondary-bg: #343a40;--bs-secondary-bg-rgb: 52, 58, 64;--bs-tertiary-color: rgba(222, 226, 230, .5);--bs-tertiary-color-rgb: 222, 226, 230;--bs-tertiary-bg: #2b3035;--bs-tertiary-bg-rgb: 43, 48, 53;--bs-primary-text-emphasis: #6d9e78;--bs-secondary-text-emphasis: #a7acb1;--bs-success-text-emphasis: #75b798;--bs-info-text-emphasis: #6edff6;--bs-warning-text-emphasis: #ffda6a;--bs-danger-text-emphasis: #ea868f;--bs-light-text-emphasis: #f8f9fa;--bs-dark-text-emphasis: #dee2e6;--bs-primary-bg-subtle: #021306;--bs-secondary-bg-subtle: #161719;--bs-success-bg-subtle: #051b11;--bs-info-bg-subtle: #032830;--bs-warning-bg-subtle: #332701;--bs-danger-bg-subtle: #2c0b0e;--bs-light-bg-subtle: #343a40;--bs-dark-bg-subtle: #1a1d20;--bs-primary-border-subtle: #073812;--bs-secondary-border-subtle: #41464b;--bs-success-border-subtle: #0fLine truncated
-188
View File
@@ -1,188 +0,0 @@
var NN=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function o2e(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var epe={exports:{}},Gse={exports:{}},tpe=function(e,t){return function(){for(var a=new Array(arguments.length),l=0;l<a.length;l++)a[l]=arguments[l];return e.apply(t,a)}},s2e=tpe,FC=Object.prototype.toString;function Kse(o){return Array.isArray(o)}function Doe(o){return typeof o>"u"}function r2e(o){return o!==null&&!Doe(o)&&o.constructor!==null&&!Doe(o.constructor)&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}function npe(o){return FC.call(o)==="[object ArrayBuffer]"}function i2e(o){return FC.call(o)==="[object FormData]"}function a2e(o){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(o):e=o&&o.buffer&&npe(o.buffer),e}function l2e(o){return typeof o=="string"}function c2e(o){return typeof o=="number"}function ope(o){return o!==null&&typeof o=="object"}function wH(o){if(FC.call(o)!=="[object Object]")return!1;var e=Object.getPrototypeOf(o);return e===null||e===Object.prototype}function u2e(o){return FC.call(o)==="[object Date]"}function f2e(o){return FC.call(o)==="[object File]"}function d2e(o){return FC.call(o)==="[object Blob]"}function spe(o){return FC.call(o)==="[object Function]"}function h2e(o){return ope(o)&&spe(o.pipe)}function m2e(o){return FC.call(o)==="[object URLSearchParams]"}function g2e(o){return o.trim?o.trim():o.replace(/^\s+|\s+$/g,"")}function p2e(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function Jse(o,e){if(!(o===null||typeof o>"u"))if(typeof o!="object"&&(o=[o]),Kse(o))for(var t=0,s=o.length;t<s;t++)e.call(null,o[t],t,o);else for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&e.call(null,o[a],a,o)}function Poe(){var o={};function e(a,l){wH(o[l])&&wH(a)?o[l]=Poe(o[l],a):wH(a)?o[l]=Poe({},a):Kse(a)?o[l]=a.slice():o[l]=a}for(var t=0,s=arguments.length;t<s;t++)Jse(arguments[t],e);return o}function b2e(o,e,t){return Jse(e,function(a,l){t&&typeof a=="function"?o[l]=s2e(a,t):o[l]=a}),o}function v2e(o){return o.charCodeAt(0)===65279&&(o=o.slice(1)),o}var Hp={isArray:Kse,isArrayBuffer:npe,isBuffer:r2e,isFormData:i2e,isArrayBufferView:a2e,isString:l2e,isNumber:c2e,isObject:ope,isPlainObject:wH,isUndefined:Doe,isDate:u2e,isFile:f2e,isBlob:d2e,isFunction:spe,isStream:h2e,isURLSearchParams:m2e,isStandardBrowserEnv:p2e,forEach:Jse,merge:Poe,extend:b2e,trim:g2e,stripBOM:v2e},q4=Hp;function Uae(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var rpe=function(e,t,s){if(!t)return e;var a;if(s)a=s(t);else if(q4.isURLSearchParams(t))a=t.toString();else{var l=[];q4.forEach(t,function(h,b){h===null||typeof h>"u"||(q4.isArray(h)?b=b+"[]":h=[h],q4.forEach(h,function(C){q4.isDate(C)?C=C.toISOString():q4.isObject(C)&&(C=JSON.stringify(C)),l.push(Uae(b)+"="+Uae(C))}))}),a=l.join("&")}if(a){var u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e},O2e=Hp;function Yz(){this.handlers=[]}Yz.prototype.use=function(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1};Yz.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};Yz.prototype.forEach=function(e){O2e.forEach(this.handlers,function(s){s!==null&&e(s)})};var y2e=Yz,w2e=Hp,_2e=function(e,t){w2e.forEach(e,function(a,l){l!==t&&l.toUpperCase()===t.toUpperCase()&&(e[t]=a,delete e[l])})},ipe=function(e,t,s,a,l){return e.config=t,s&&(e.code=s),e.request=a,e.response=l,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},jte,Yae;function ape(){if(Yae)return jte;Yae=1;var o=ipe;return jte=function(t,s,a,l,u){var d=new Error(t);return o(d,s,a,l,u)},jte}var qte,Xae;function S2e(){if(Xae)return qte;Xae=1;var o=ape();return qte=function(t,s,a){var l=a.config.validateStatus;!a.status||!l||l(a.status)?t(a):s(o("Request failed with status code "+a.status,a.config,null,a.request,a))},qte}var Gte,jae;function C2e(){if(jae)return Gte;jae=1;var o=Hp;return Gte=o.isStandardBrowserEnv()?function(){return{write:function(s,a,l,u,d,h){var b=[];b.push(s+"="+encodeURIComponent(a)),o.isNumber(l)&&b.push("expires="+new Date(l).toGMTString()),o.isString(u)&&b.push("path="+u),o.isString(d)&&b.push("domain="+d),h===!0&&b.push("secure"),document.cookie=b.join("; ")},read:function(s){var a=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return a?decodeURIComponent(a[3Line truncated
`),function(b){if(d=b.indexOf(":"),l=o.trim(b.substr(0,d)).toLowerCase(),u=o.trim(b.substr(d+1)),l){if(a[l]&&e.indexOf(l)>=0)return;l==="set-cookie"?a[l]=(a[l]?a[l]:[]).concat([u]):a[l]=a[l]?a[l]+", "+u:u}}),a},tne}var nne,ele;function A2e(){if(ele)return nne;ele=1;var o=Hp;return nne=o.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a"),a;function l(u){var d=u;return t&&(s.setAttribute("href",d),d=s.href),s.setAttribute("href",d),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:s.pathname.charAt(0)==="/"?s.pathname:"/"+s.pathname}}return a=l(window.location.href),function(d){var h=o.isString(d)?l(d):d;return h.protocol===a.protocol&&h.host===a.host}}():function(){return function(){return!0}}(),nne}var one,tle;function Xz(){if(tle)return one;tle=1;function o(e){this.message=e}return o.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},o.prototype.__CANCEL__=!0,one=o,one}var sne,nle;function ole(){if(nle)return sne;nle=1;var o=Hp,e=S2e(),t=C2e(),s=rpe,a=T2e(),l=E2e(),u=A2e(),d=ape(),h=jz(),b=Xz();return sne=function(C){return new Promise(function(R,$){var Q=C.data,F=C.headers,U=C.responseType,K;function L(){C.cancelToken&&C.cancelToken.unsubscribe(K),C.signal&&C.signal.removeEventListener("abort",K)}o.isFormData(Q)&&delete F["Content-Type"];var te=new XMLHttpRequest;if(C.auth){var ne=C.auth.username||"",oe=C.auth.password?unescape(encodeURIComponent(C.auth.password)):"";F.Authorization="Basic "+btoa(ne+":"+oe)}var G=a(C.baseURL,C.url);te.open(C.method.toUpperCase(),s(G,C.params,C.paramsSerializer),!0),te.timeout=C.timeout;function we(){if(!!te){var Re="getAllResponseHeaders"in te?l(te.getAllResponseHeaders()):null,Oe=!U||U==="text"||U==="json"?te.responseText:te.response,ce={data:Oe,status:te.status,statusText:te.statusText,headers:Re,config:C,request:te};e(function(tt){R(tt),L()},function(tt){$(tt),L()},ce),te=null}}if("onloadend"in te?te.onloadend=we:te.onreadystatechange=function(){!te||te.readyState!==4||te.status===0&&!(te.responseURL&&te.responseURL.indexOf("file:")===0)||setTimeout(we)},te.onabort=function(){!te||($(d("Request aborted",C,"ECONNABORTED",te)),te=null)},te.onerror=function(){$(d("Network Error",C,null,te)),te=null},te.ontimeout=function(){var Oe=C.timeout?"timeout of "+C.timeout+"ms exceeded":"timeout exceeded",ce=C.transitional||h.transitional;C.timeoutErrorMessage&&(Oe=C.timeoutErrorMessage),$(d(Oe,C,ce.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",te)),te=null},o.isStandardBrowserEnv()){var ve=(C.withCredentials||u(G))&&C.xsrfCookieName?t.read(C.xsrfCookieName):void 0;ve&&(F[C.xsrfHeaderName]=ve)}"setRequestHeader"in te&&o.forEach(F,function(Oe,ce){typeof Q>"u"&&ce.toLowerCase()==="content-type"?delete F[ce]:te.setRequestHeader(ce,Oe)}),o.isUndefined(C.withCredentials)||(te.withCredentials=!!C.withCredentials),U&&U!=="json"&&(te.responseType=C.responseType),typeof C.onDownloadProgress=="function"&&te.addEventListener("progress",C.onDownloadProgress),typeof C.onUploadProgress=="function"&&te.upload&&te.upload.addEventListener("progress",C.onUploadProgress),(C.cancelToken||C.signal)&&(K=function(Re){!te||($(!Re||Re&&Re.type?new b("canceled"):Re),te.abort(),te=null)},C.cancelToken&&C.cancelToken.subscribe(K),C.signal&&(C.signal.aborted?K():C.signal.addEventListener("abort",K))),Q||(Q=null),te.send(Q)})},sne}var rne,sle;function jz(){if(sle)return rne;sle=1;var o=Hp,e=_2e,t=ipe,s={"Content-Type":"application/x-www-form-urlencoded"};function a(h,b){!o.isUndefined(h)&&o.isUndefined(h["Content-Type"])&&(h["Content-Type"]=b)}function l(){var h;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(h=ole()),h}function u(h,b,y){if(o.isString(h))try{return(b||JSON.parse)(h),o.trim(h)}catch(C){if(C.name!=="SyntaxError")throw C}return(y||JSON.stringify)(h)}var d={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:l(),transformRequest:[function(b,y){return e(y,"Accept"),e(y,"Content-Type"),o.isFormData(b)||o.isArrayBuffer(b)||o.isBuffer(b)||o.isStream(b)||o.isFile(b)||o.isBlob(b)?b:o.isArrayBufferView(b)?b.buffer:o.isURLSearchParams(b)?(a(y,"application/x-www-form-urlencoded;charset=utf-8"),b.toString()):o.isObject(b)||y&&y["Content-Type"]==="application/json"?(a(y,"application/json"),u(b)):b}],transformResponse:[function(b){var y=this.transitional||d.transitional,C=y&&y.silentJSONParsing,E=y&&y.forcedJSONParsing,R=!C&&this.responseType==="json";if(R||E&&o.isString(b)&&b.length)try{return JSON.parse(b)}catch($){if(R)throw $.name==="SyntaxError"?t($,this,"E_JSON_PARSE"):$}return b}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(b){return b>=200&&b<300},headers:{common:{Accept: Line truncated
`;for(let F=0;F<=1;F+=h){const U=e+(t-e)*l(F);b+=F*100+`%{${u(U,1-U)}}
`}const y=b+`100% {${u(t,1-t)}}
}`,C=`__svelte_${twe(y)}_${d}`,E=_pe(o),{stylesheet:R,rules:$}=KH.get(E)||nwe(E,o);$[C]||($[C]=!0,R.insertRule(`@keyframes ${C} ${y}`,R.cssRules.length));const Q=o.style.animation||"";return o.style.animation=`${Q?`${Q}, `:""}${C} ${s}ms linear ${a}ms 1 both`,JH+=1,C}function kpe(o,e){const t=(o.style.animation||"").split(", "),s=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),a=t.length-s.length;a&&(o.style.animation=s.join(", "),JH-=a,JH||owe())}function owe(){tre(()=>{JH||(KH.forEach(o=>{const{ownerNode:e}=o.stylesheet;e&&ke(e)}),KH.clear())})}function xpe(o,e,t,s){if(!e)return un;const a=o.getBoundingClientRect();if(e.left===a.left&&e.right===a.right&&e.top===a.top&&e.bottom===a.bottom)return un;const{delay:l=0,duration:u=300,easing:d=gpe,start:h=Ope()+l,end:b=h+u,tick:y=un,css:C}=t(o,{from:e,to:a},s);let E=!0,R=!1,$;function Q(){C&&($=Moe(o,0,1,u,l,d,C)),l||(R=!0)}function F(){C&&kpe(o,$),E=!1}return wpe(U=>{if(!R&&U>=h&&(R=!0),R&&U>=b&&(y(1,0),F()),!E)return!1;if(R){const K=U-h,L=0+1*d(K/u);y(L,1-L)}return!0}),Q(),y(0,1),F}function Tpe(o){const e=getComputedStyle(o);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:s}=e,a=o.getBoundingClientRect();o.style.position="absolute",o.style.width=t,o.style.height=s,swe(o,a)}}function swe(o,e){const t=o.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const s=getComputedStyle(o),a=s.transform==="none"?"":s.transform;o.style.transform=`${a} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let y6;function r6(o){y6=o}function YD(){if(!y6)throw new Error("Function called outside component initialization");return y6}function W1(o){YD().$$.on_mount.push(o)}function Epe(o){YD().$$.after_update.push(o)}function ore(o){YD().$$.on_destroy.push(o)}function Fg(){const o=YD();return(e,t,{cancelable:s=!1}={})=>{const a=o.$$.callbacks[e];if(a){const l=Cpe(e,t,{cancelable:s});return a.slice().forEach(u=>{u.call(o,l)}),!l.defaultPrevented}return!0}}function dD(o,e){return YD().$$.context.set(o,e),e}function Ur(o){return YD().$$.context.get(o)}function SH(o,e){const t=o.$$.callbacks[e.type];t&&t.slice().forEach(s=>s.call(this,e))}const rD=[],Ro=[];let vD=[];const Roe=[],rwe=Promise.resolve();let $oe=!1;function iwe(){$oe||($oe=!0,rwe.then(Ape))}function AC(o){vD.push(o)}function lr(o){Roe.push(o)}const hne=new Set;let K4=0;function Ape(){if(K4!==0)return;const o=y6;do{try{for(;K4<rD.length;){const e=rD[K4];K4++,r6(e),awe(e.$$)}}catch(e){throw rD.length=0,K4=0,e}for(r6(null),rD.length=0,K4=0;Ro.length;)Ro.pop()();for(let e=0;e<vD.length;e+=1){const t=vD[e];hne.has(t)||(hne.add(t),t())}vD.length=0}while(rD.length);for(;Roe.length;)Roe.pop()();$oe=!1,hne.clear(),r6(o)}function awe(o){if(o.fragment!==null){o.update(),vi(o.before_update);const e=o.dirty;o.dirty=[-1],o.fragment&&o.fragment.p(o.ctx,e),o.after_update.forEach(AC)}}function lwe(o){const e=[],t=[];vD.forEach(s=>o.indexOf(s)===-1?e.push(s):t.push(s)),t.forEach(s=>s()),vD=e}let IN;function cwe(){return IN||(IN=Promise.resolve(),IN.then(()=>{IN=null})),IN}function mne(o,e,t){o.dispatchEvent(Cpe(`${e?"intro":"outro"}${t}`))}const CH=new Set;let Lw;function mo(){Lw={r:0,c:[],p:Lw}}function go(){Lw.r||vi(Lw.c),Lw=Lw.p}function xe(o,e){o&&o.i&&(CH.delete(o),o.i(e))}function Be(o,e,t,s){if(o&&o.o){if(CH.has(o))return;CH.add(o),Lw.c.push(()=>{CH.delete(o),s&&(t&&o.d(1),s())}),o.o(e)}else s&&s()}const uwe={duration:0};function ez(o,e,t,s){const a={direction:"both"};let l=e(o,t,a),u=s?0:1,d=null,h=null,b=null;function y(){b&&kpe(o,b)}function C(R,$){const Q=R.b-u;return $*=Math.abs(Q),{a:u,b:R.b,d:Q,duration:$,start:R.start,end:R.start+$,group:R.group}}function E(R){const{delay:$=0,duration:Q=300,easing:F=gpe,tick:U=un,css:K}=l||uwe,L={start:Ope()+$,b:R};R||(L.group=Lw,Lw.r+=1),d||h?h=L:(K&&(y(),b=Moe(o,u,R,Q,$,F,K)),R&&U(0,1),d=C(L,Q),AC(()=>mne(o,R,"start")),wpe(te=>{if(h&&te>h.start&&(d=C(h,Q),h=null,mne(o,d.b,"start"),K&&(y(),b=Moe(o,u,d.b,d.duration,0,F,l.css))),d){if(te>=d.end)U(u=d.b,1-u),mne(o,d.b,"end"),h||(d.b?y():--d.group.r||vi(d.group.c)),d=null;else if(te>=d.start){const ne=te-d.start;u=d.a+d.d*F(ne/d.duration),U(u,1-u)}}return!!(d||h)}))}return{run(R){Ub(l)?cwe().then(()=>{l=l(a),E(R)}):E(R)},end(){y(),d=h=null}}}function XD(o,e){o.d(1),e.delete(o.key)}function xv(o,e){Be(o,1,1,()=>{e.delete(o.key)})}function Dpe(o,e){o.f(),xv(o,e)}function Jd(o,e,t,s,a,l,u,d,h,b,y,C){let E=o.length,R=l.length,$=E;const Q={};for(;$--;)Q[o[$].key]=$;const F=[],U=new Map,K=new Map,L=[];for($=R;$--;){const G=C(a,l,$),we=t(G);let ve=u.get(we);ve?s&&L.push(()=>ve.p(G,e)):(ve=b(we,G),ve.c()),U.set(we,F[$]=ve),we in Q&&K.set(we,Math.abs($-Q[we]))}const te=new Set,ne=new Set;function oe(G){xe(G,1),G.m(d,y),u.set(G.key,G),y=G.first,R--}for(;E&&R;){const G=F[R-1],we=o[E-1],ve=G.key,Re=we.key;G===we?(y=G.first,E--,R--):U.has(Re)?!u.has(ve)||te.has(ve)?oe(G):ne.has(Re)?E--:K.get(ve)>K.get(Re)?(ne.add(ve),oe(G)):(te.add(Re),E--):(h(we,u),E--)}for(;E--;){const G=o[E];U.has(G.key)||h(G,u)}for(;R;)oe(F[R-1 Line truncated
transform: ${b} translate(${(1-Q)*C}${E}, ${(1-Q)*R}${$});
opacity: ${h-y*F}`}}function yle(o){let e,t,s,a;return{c(){e=re("div"),t=Ht(o[1]),Z(e,"class","lx-alert text-white bg-success border-1 border rounded px-3 py-0 text-center svelte-190ow44"),Z(e,"role","alert")},m(l,u){Te(l,e,u),X(e,t),a=!0},p(l,u){(!a||u&2)&&Fn(t,l[1])},i(l){a||(AC(()=>{!a||(s||(s=ez(e,tz,{duration:500},!0)),s.run(1))}),a=!0)},o(l){s||(s=ez(e,tz,{duration:500},!1)),s.run(0),a=!1},d(l){l&&ke(e),l&&s&&s.end()}}}function Cwe(o){let e,t,s=o[0]&&yle(o);return{c(){s&&s.c(),e=Rs()},m(a,l){s&&s.m(a,l),Te(a,e,l),t=!0},p(a,[l]){a[0]?s?(s.p(a,l),l&1&&xe(s,1)):(s=yle(a),s.c(),xe(s,1),s.m(e.parentNode,e)):s&&(mo(),Be(s,1,1,()=>{s=null}),go())},i(a){t||(xe(s),t=!0)},o(a){Be(s),t=!1},d(a){s&&s.d(a),a&&ke(e)}}}function kwe(o,e,t){let s,a;function l(u="Saved"){t(1,s=u),t(0,a=!0),setTimeout(function(){t(0,a=!1)},2e3)}return t(1,s="Saved"),t(0,a=!1),[a,s,l]}class sre extends uo{constructor(e){super(),co(this,e,kwe,Cwe,lo,{show:2})}get show(){return this.$$.ctx[2]}}function xwe(o){let e,t,s,a,l,u,d,h,b,y,C,E,R,$,Q={};return e=new sre({props:Q}),o[4](e),C=new AD({props:{label:"Enter"}}),{c(){en(e.$$.fragment),t=Ze(),s=re("div"),a=re("form"),l=re("div"),u=re("h3"),d=Ht("Login as "),h=Ht(o[0]),b=Ze(),y=re("div"),en(C.$$.fragment),Z(l,"class","mb-3 text-center"),Z(y,"class","text-center mt-5 d-block"),Z(s,"class","wrapper-tiny")},m(F,U){Kt(e,F,U),Te(F,t,U),Te(F,s,U),X(s,a),X(a,l),X(l,u),X(u,d),X(u,h),X(a,b),X(a,y),Kt(C,y,null),E=!0,R||($=mn(a,"submit",o[2]),R=!0)},p(F,[U]){const K={};e.$set(K),(!E||U&1)&&Fn(h,F[0])},i(F){E||(xe(e.$$.fragment,F),xe(C.$$.fragment,F),E=!0)},o(F){Be(e.$$.fragment,F),Be(C.$$.fragment,F),E=!1},d(F){o[4](null),Jt(e,F),F&&ke(t),F&&ke(s),Jt(C),R=!1,$()}}}function Twe(o,e,t){const s=Ur("channel");let{email:a}=e,{token:l}=e,u;function d(b){b.preventDefault(),axios.post(s.lucentUrl+"/verify",{email:a,token:l}).then(y=>{window.location=s.lucentUrl}).catch(y=>{})}function h(b){Ro[b?"unshift":"push"](()=>{u=b,t(1,u)})}return o.$$set=b=>{"email"in b&&t(0,a=b.email),"token"in b&&t(3,l=b.token)},[a,u,d,l,h]}class Ewe extends uo{constructor(e){super(),co(this,e,Twe,xwe,lo,{email:0,token:3})}}function Awe(o){let e,t,s;return{c(){e=re("div"),t=re("div"),s=Ht(o[2]),Z(t,"class","avatar__letters"),Z(e,"class","avatar"),Z(e,"title",o[0]),rs(e,"background-color",o[3][o[4]]),rs(e,"height",o[1]+"px"),rs(e,"width",o[1]+"px"),rs(e,"font-size",o[1]/2+"px")},m(a,l){Te(a,e,l),X(e,t),X(t,s)},p(a,[l]){l&4&&Fn(s,a[2]),l&1&&Z(e,"title",a[0]),l&2&&rs(e,"height",a[1]+"px"),l&2&&rs(e,"width",a[1]+"px"),l&2&&rs(e,"font-size",a[1]/2+"px")},i:un,o:un,d(a){a&&ke(e)}}}function Dwe(o,e,t){let{name:s}=e,{side:a=48}=e;const l=["#00AA55","#009FD4","#B381B3","#939393","#E3BC00","#D47500","#DC2A2A","#3ede91","#377dd4","#0256b0","#053d82","#3d026e","#b378e3","#c4065c","#543208","#d97811","#0c6b40"];let u="";s.split(" ").length>1?u=s.split(" ")[0].charAt(0).toUpperCase()+s.split(" ")[1].charAt(0).toUpperCase():u=s.split(" ")[0].charAt(0).toUpperCase()+s.split(" ")[0].charAt(1).toUpperCase();let h=(s.charCodeAt(1)+s.length)%19;return o.$$set=b=>{"name"in b&&t(0,s=b.name),"side"in b&&t(1,a=b.side)},[s,a,u,l,h]}class vy extends uo{constructor(e){super(),co(this,e,Dwe,Awe,lo,{name:0,side:1})}}function Pwe(o){let e,t,s,a,l,u,d,h,b,y,C,E,R,$,Q,F,U,K,L,te,ne,oe,G,we,ve,Re;t=new X6({props:{message:o[2]}});let Oe={};return a=new sre({props:Oe}),o[8](a),d=new vy({props:{name:o[4].name}}),R=new AD({props:{label:"Update"}}),L=new AD({props:{label:"Update"}}),{c(){e=re("div"),en(t.$$.fragment),s=Ze(),en(a.$$.fragment),l=Ze(),u=re("h3"),en(d.$$.fragment),h=Ze(),b=re("form"),y=re("div"),C=re("input"),E=Ze(),en(R.$$.fragment),$=Ze(),Q=re("form"),F=re("div"),U=re("input"),K=Ze(),en(L.$$.fragment),te=Ze(),ne=re("div"),oe=re("a"),G=Ht(`Logout from this
device`),Z(u,"class","header-small mb-5"),Z(C,"type","text"),Z(C,"class","form-control"),Z(C,"placeholder","Name"),C.required=!0,Z(y,"class","input-group mb-3"),Z(U,"type","email"),Z(U,"class","form-control"),Z(U,"placeholder","Email"),U.required=!0,Z(F,"class","input-group mb-3"),Z(oe,"class","list-group-item list-group-item-action"),Z(oe,"href",o[5].lucentUrl+"/logout"),Z(ne,"class","list-group"),Z(e,"class","wrapper-tiny")},m(ce,Xe){Te(ce,e,Xe),Kt(t,e,null),X(e,s),Kt(a,e,null),X(e,l),X(e,u),Kt(d,u,null),X(e,h),X(e,b),X(b,y),X(y,C),ar(C,o[0]),X(y,E),Kt(R,y,null),X(e,$),X(e,Q),X(Q,F),X(F,U),ar(U,o[1]),X(F,K),Kt(L,F,null),X(e,te),X(e,ne),X(ne,oe),X(oe,G),we=!0,ve||(Re=[mn(C,"input",o[9]),mn(b,"submit",o[6]),mn(U,"input",o[10]),mn(Q,"submit",o[7])],ve=!0)},p(ce,[Xe]){const tt={};Xe&4&&(tt.message=ce[2]),t.$set(tt);const ot={};a.$set(ot),Xe&1&&C.value!==ce[0]&&ar(C,ce[0]),Xe&2&&U.value!==ce[1]&&ar(U,ce[1])},i(ce){we||(xe(t.$$.fragment,ce),xe(a.$$.fragment,ce),xe(d.$$.fragment,ce),xe(R.$$.fragment,ce),xe(L.$$.fragment,ce),we=!0)},o(ce){Be(t.$$.fragment,ce),Be(a.$$.fragment,ce),Be(d.$$.fragment,ce),Be(R.$$.fragment,ce),Be(L.$$.fragment,ce),we=!1},d(ce){ce&&ke(e),Jt(t),o[8](null),Jt(a),Jt(d),Jt(R),Jt(L),ve=!1,vi(Re)}}}function Mwe(o,e,t){const s=Ur("user"),a=Ur("channel");let l=s.name,u=s.email,d="",h;function b($){$.preventDefault(),t(2,d=""),axios.post(a.lucentUrl+"/account/update-name",{name:l}).then(Q=>{h.show()}).catch(Q=>{var F;t(2,d=(F=Q.response)==null?void 0:F.data.error),console.log({errorMessage:d})})}function y($){$.preventDefault(),t(2,d=""),axios.post(a.lucentUrl+"/account/update-email",{email:u}).then(Q=>{h.show()}).catch(Q=>{var F;t(2,d=(F=Q.response)==null?void 0:F.data.error),console.log({errorMessage:d})})}function C($){Ro[$?"unshift":"push"](()=>{h=$,t(3,h)})}function E(){l=this.value,t(0,l)}function R(){u=this.value,t(1,u)}return[l,u,d,h,s,a,b,y,C,E,R]}class Rwe extends uo{constructor(e){super(),co(this,e,Mwe,Pwe,lo,{})}}function $we(o){let e,t,s,a=o[3].name+"",l,u,d,h,b,y;const C=[{title:o[0]},o[2]];var E=o[4][o[1]];function R($){let Q={};for(let F=0;F<C.length;F+=1)Q=Y6(Q,C[F]);return{props:Q}}return E&&(b=EC(E,R())),{c(){e=re("div"),t=re("h1"),s=re("a"),l=Ht(a),d=Ze(),h=re("div"),b&&en(b.$$.fragment),Z(s,"class","text-decoration-none"),Z(s,"href",u=o[3].lucentUrl),Z(e,"class","text-center")},m($,Q){Te($,e,Q),X(e,t),X(t,s),X(s,l),Te($,d,Q),Te($,h,Q),b&&Kt(b,h,null),y=!0},p($,[Q]){(!y||Q&8)&&a!==(a=$[3].name+"")&&Fn(l,a),(!y||Q&8&&u!==(u=$[3].lucentUrl))&&Z(s,"href",u);const F=Q&5?Gz(C,[Q&1&&{title:$[0]},Q&4&&Kz($[2])]):{};if(Q&2&&E!==(E=$[4][$[1]])){if(b){mo();const U=b;Be(U.$$.fragment,1,0,()=>{Jt(U,1)}),go()}E?(b=EC(E,R()),en(b.$$.fragment),xe(b.$$.fragment,1),Kt(b,h,null)):b=null}else E&&b.$set(F)},i($){y||(b&&xe(b.$$.fragment,$),y=!0)},o($){b&&Be(b.$$.fragment,$),y=!1},d($){$&&ke(e),$&&ke(d),$&&ke(h),b&&Jt(b)}}}function Nwe(o,e,t){const s={register:vwe,login:Swe,verify:Ewe,profile:Rwe};let{title:a}=e,{view:l}=e,{user:u}=e,{data:d}=e,{channel:h}=e;return dD("channel",h),dD("user",u),o.$$set=b=>{"title"in b&&t(0,a=b.title),"view"in b&&t(1,l=b.view),"user"in b&&t(5,u=b.user),"data"in b&&t(2,d=b.data),"channel"in b&&t(3,h=b.channel)},[a,l,d,h,s,u]}class Iwe extends uo{constructor(e){super(),co(this,e,Nwe,$we,lo,{title:0,view:1,user:5,data:2,channel:3})}}var Lc={exports:{}};/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/(function(o,e){(function(){var t,s="4.17.21",a=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",d="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",b=500,y="__lodash_placeholder__",C=1,E=2,R=4,$=1,Q=2,F=1,U=2,K=4,L=8,te=16,ne=32,oe=64,G=128,we=256,ve=512,Re=30,Oe="...",ce=800,Xe=16,tt=1,ot=2,V=3,ut=1/0,Qe=9007199254740991,Bt=17976931348623157e292,Ct=0/0,He=4294967295,st=He-1,rn=He>>>1,Et=[["ary",G],["bind",F],["bindKey",U],["curry",L],["curryRight",te],["flip",ve],["partial",ne],["partialRight",oe],["rearg",we]],Cn="[object Arguments]",je="[object Array]",mt="[object AsyncFunction]",he="[object Boolean]",Zo="[object Date]",Kn="[object DOMException]",so="[object Error]",Yo="[object Function]",as="[object GeneratorFunction]",kt="[object Map]",jt="[object Number]",pt="[object Null]",Ne="[object Object]",Gt="[object Promise]",bn="[object Proxy]",At="[object RegExp]",An="[object Set]",zn="[object String]",ps="[object Symbol]",oo="[object Undefined]",Ss="[object WeakMap]",Mr="[object WeakSet]",$s="[object ArrayBuffer]",tr="[object DataView]",Xs="[object Float32Array]",wa="[object Float64Array]",dr="[object Int8Array]",Ns="[object Int16Array]",qr="[object Int32Array]",$o="[object Uint8Array]",Po="[object Uint8ClampedArray]",Rr="[object Uint16Array]",Ls="[object Uint32Array]",aa=/\b__p \+= '';/g,bs=/\b(__p \+=) '' \+/g,_a=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ln=/&(?:amp|lt|gt|quot|#39);/g,vs=/[&<>"']/g,Qi=RegExp(ln.source),ze=RegExp(vs.source),et=/<%-([\s\S]+?)%>/g,Tt=/<%([\s\S]+?)%>/g,Wt=/<%=([\s\S]+?)%>/g,Yn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,po=/^\w*$/,wo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fn=/[\\^$.*+?()[\]{}|]/g,os=RegExp(fn.source),xo=/^\s+/,fs=/\s/,kr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Lr=/\{\n\/\* \[wrapped with (.+)\] \*/,Vs=/,? & /,Yr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Zi=/[()=,{}\[\]\/\s]/,Qa=/\\(\\)?/g,Oi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ge=/\w*$/,qe=/^[-+]0x[0-9a-f]+$/i,Nt=/^0b[01]+$/i,Ut=/^\[object .+?Constructor\]$/,bo=/^0o[0-7]+$/i,Lo=/^(?:0|[1-9]\d*)$/,Go=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ei=/($^)/,lt=/['\n\r\u2028\u2029\\]/g,Xo="\\ud800-\\udfff",Ni="\\u0300-\\u036f",la="\\ufe20-\\ufe2f",ma="\\u20d0-\\u20ff",gr=Ni+la+ma,Fc="\\u2700-\\u27bf",Cc="a-z\\xdf-\\xf6\\xf8-\\xff",nl="\\xac\\xb1\\xd7\\xf7",ga="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",nr="\\u2000-\\u206f",Ar=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ki="A-Z\\xc0-\\xd6\\xd8-\\xde",gl="\\ufe0e\\ufe0f",kc=nl+ga+nr+Ar,nu="['\u2019]",xu="["+Xo+"]",yr="["+kc+"]",ol="["+gr+"]",Tu="\\d+",ou="["+Fc+"]",Yl="["+Cc+"]",Aa="[^"+Xo+kc+Tu+Fc+Cc+Ki+"]",Dr="\\ud83c[\\udffb-\\udfff]",Qm="(?:"+ol+"|"+Dr+")",xf="[^"+Xo+"]",xr="(?:\\ud83c[\\udde6-\\uddff]){2}",Za="[\\ud800-\\udbff][\\udc00-\\udfff]",ca="["+Ki+"]",Ji="\\u200d",Eu="(?:"+Yl+"|"+Aa+")",Qc="(?:"+ca+"|"+Aa+")",Ha="(?:"+nu+"(?:d|ll|m|re|s|t|ve))?",Zc="(?:"+nu+"(?:D|LL|M|RE|S|T|VE))?",xc=Qm+"?",Cd="["+gl+"]?",Yf="(?:"+Ji+"(?:"+[xf,xr,Za].join("|")+")"+Cd+xc+")*",Au="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Xl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Hc=Cd+xc+Yf,Tf="(?:"+[ou,xr,Za].join("|")+")"+Hc,su="(?:"+[xf+ol+"?",ol,xr,Za,xu].join("|")+")",kd=RegExp(nu,"g"),De=RegExp(ol,"g"),nt=RegExp(Dr+"(?="+Dr+")|"+su+Hc,"g"),bt=RegExp([ca+"?"+Yl+"+"+Ha+"(?="+[yr,ca,"$"].join("|")+")",Qc+"+"+Zc+"(?="+[yr,ca+Eu,"$"].join("|")+")",ca+"?"+Eu+"+"+Ha,ca+"+"+Zc,Xl,Au,Tu,Tf].join("|"),"g"),$t=RegExp("["+Ji+Xo+gr+gl+"]"),On=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Mo=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$r=-1,ys={};ys[Xs]=ys[wa]=ys[dr]=ys[Ns]=ys[qr]=ys[$o]=ys[Po]=ys[Rr]=ys[Ls]=!0,ys[Cn]=ys[je]=ys[$s]=ys[he]=ys[tr]=ys[Zo]=ys[so]=ys[Yo]=ys[kt]=ys[jt]=ys[Ne]=ys[At]=ys[An]=ys[zn]=ys[Ss]=!1;var ls={};ls[Cn]=ls[je]=ls[$s]=ls[tr]=ls[he]=ls[Zo]=ls[Xs]=ls[wa]=ls[dr]=ls[Ns]=ls[qr]=ls[kt]=ls[jt]=ls[Ne]=ls[At]=ls[An]=ls[zn]=ls[ps]=ls[$o]=ls[Po]=ls[Rr]=ls[Ls]=!0,ls[so]=ls[Yo]=ls[Ss]=!1;var Di={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"ULine truncated
/* [wrapped with `+A+`] */
`)}function My(S){return Sr(S)||dm(S)||!!(Ed&&S&&S[Ed])}function lm(S,A){var H=typeof S;return A=A==null?Qe:A,!!A&&(H=="number"||H!="symbol"&&Lo.test(S))&&S>-1&&S%1==0&&S<A}function lf(S,A,H){if(!Ol(H))return!1;var le=typeof A;return(le=="number"?bu(H)&&lm(A,H.length):le=="string"&&A in H)?Zr(H[A],S):!1}function Oh(S,A){if(Sr(S))return!1;var H=typeof S;return H=="number"||H=="symbol"||H=="boolean"||S==null||al(S)?!0:po.test(S)||!Yn.test(S)||A!=null&&S in wi(A)}function rp(S){var A=typeof S;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?S!=="__proto__":S===null}function yh(S){var A=Fd(S),H=Ae[A];if(typeof H!="function"||!(A in hi.prototype))return!1;if(S===H)return!0;var le=Ld(H);return!!le&&S===le[0]}function g0(S){return!!dc&&dc in S}var Lf=Da?hm:gm;function ip(S){var A=S&&S.constructor,H=typeof A=="function"&&A.prototype||il;return S===H}function Ry(S){return S===S&&!Ol(S)}function qp(S,A){return function(H){return H==null?!1:H[S]===A&&(A!==t||S in wi(H))}}function rd(S){var A=A0(S,function(le){return H.size===b&&H.clear(),le}),H=A.cache;return A}function $y(S,A){var H=S[1],le=A[1],Ce=H|le,We=Ce<(F|U|G),ht=le==G&&H==L||le==G&&H==we&&S[7].length<=A[8]||le==(G|we)&&A[7].length<=A[8]&&H==L;if(!(We||ht))return S;le&F&&(S[2]=A[2],Ce|=H&F?0:K);var St=A[3];if(St){var zt=S[3];S[3]=zt?ep(zt,St,A[4]):St,S[4]=zt?zc(S[3],y):A[4]}return St=A[5],St&&(zt=S[5],S[5]=zt?og(zt,St,A[6]):St,S[6]=zt?zc(S[5],y):A[6]),St=A[7],St&&(S[7]=St),le&G&&(S[8]=S[8]==null?A[8]:Tr(S[8],A[8])),S[9]==null&&(S[9]=A[9]),S[0]=A[0],S[1]=Ce,S}function wh(S){var A=[];if(S!=null)for(var H in wi(S))A.push(H);return A}function Qv(S){return Jh.call(S)}function n_(S,A,H){return A=vo(A===t?S.length-1:A,0),function(){for(var le=arguments,Ce=-1,We=vo(le.length-A,0),ht=an(We);++Ce<We;)ht[Ce]=le[A+Ce];Ce=-1;for(var St=an(A+1);++Ce<A;)St[Ce]=le[Ce];return St[A]=H(ht),ri(S,this,St)}}function Ny(S,A){return A.length<2?S:Hl(S,Ps(A,0,-1))}function ap(S,A){for(var H=S.length,le=Tr(A.length,H),Ce=du(S);le--;){var We=A[le];S[le]=lm(We,H)?Ce[We]:t}return S}function Ff(S,A){if(!(A==="constructor"&&typeof S[A]=="function")&&A!="__proto__")return S[A]}var mu=p0(uu),lp=ue||function(S,A){return me.setTimeout(S,A)},Iy=p0(Xp);function o_(S,A,H){var le=A+"";return Iy(S,XC(le,cm(sp(le),H)))}function p0(S){var A=0,H=0;return function(){var le=Gl(),Ce=Xe-(le-H);if(H=le,Ce>0){if(++A>=ce)return arguments[0]}else A=0;return S.apply(t,arguments)}}function Yc(S,A){var H=-1,le=S.length,Ce=le-1;for(A=A===t?le:A;++H<A;){var We=Nf(H,Ce),ht=S[We];S[We]=S[H],S[H]=ht}return S.length=A,S}var b0=rd(function(S){var A=[];return S.charCodeAt(0)===46&&A.push(""),S.replace(wo,function(H,le,Ce,We){A.push(Ce?We.replace(Qa,"$1"):le||H)}),A});function cf(S){if(typeof S=="string"||al(S))return S;var A=S+"";return A=="0"&&1/S==-ut?"-0":A}function cp(S){if(S!=null){try{return tf.call(S)}catch{}try{return S+""}catch{}}return""}function cm(S,A){return ks(Et,function(H){var le="_."+H[0];A&H[1]&&!Ii(S,le)&&S.push(le)}),S.sort()}function Zv(S){if(S instanceof hi)return S.clone();var A=new $u(S.__wrapped__,S.__chain__);return A.__actions__=du(S.__actions__),A.__index__=S.__index__,A.__values__=S.__values__,A}function s_(S,A,H){(H?lf(S,A,H):A===t)?A=1:A=vo(jr(A),0);var le=S==null?0:S.length;if(!le||A<1)return[];for(var Ce=0,We=0,ht=an(Se(le/A));Ce<le;)ht[We++]=Ps(S,Ce,Ce+=A);return ht}function Gp(S){for(var A=-1,H=S==null?0:S.length,le=0,Ce=[];++A<H;){var We=S[A];We&&(Ce[le++]=We)}return Ce}function By(){var S=arguments.length;if(!S)return[];for(var A=an(S-1),H=arguments[0],le=S;le--;)A[le-1]=arguments[le];return jf(Sr(H)?du(H):[H],Ua(A,1))}var up=hr(function(S,A){return Dl(S)?Wa(S,Ua(A,1,Dl,!0)):[]}),v0=hr(function(S,A){var H=_h(A);return Dl(H)&&(H=t),Dl(S)?Wa(S,Ua(A,1,Dl,!0),Qs(H,2)):[]}),sb=hr(function(S,A){var H=_h(A);return Dl(H)&&(H=t),Dl(S)?Wa(S,Ua(A,1,Dl,!0),t,H):[]});function Ly(S,A,H){var le=S==null?0:S.length;return le?(A=H||A===t?1:jr(A),Ps(S,A<0?0:A,le)):[]}function Fy(S,A,H){var le=S==null?0:S.length;return le?(A=H||A===t?1:jr(A),A=le-A,Ps(S,0,A<0?0:A)):[]}function r_(S,A){return S&&S.length?om(S,Qs(A,3),!0,!0):[]}function jC(S,A){return S&&S.length?om(S,Qs(A,3),!0):[]}function Qr(S,A,H,le){var Ce=S==null?0:S.length;return Ce?(H&&typeof H!="number"&&lf(S,A,H)&&(H=0,le=Ce),a0(S,A,H,le)):[]}function Hv(S,A,H){var le=S==null?0:S.length;if(!le)return-1;var Ce=H==null?0:jr(H);return Ce<0&&(Ce=vo(le+Ce,0)),ta(S,Qs(A,3),Ce)}function Qy(S,A,H){var le=S==null?0:S.length;if(!le)return-1;var Ce=le-1;return H!==t&&(Ce=jr(H),Ce=H<0?vo(le+Ce,0):Tr(Ce,le-1)),ta(S,Qs(A,3),Ce,!0)}function Zy(S){var A=S==null?0:S.length;return A?Ua(S,1):[]}function O0(S){var A=S==null?0:S.length;return A?Ua(S,ut):[]}function qC(S,A){var H=S==null?0:S.length;return H?(A=A===t?1:jr(A),Ua(S,A)):[]}function um(S){for(var A=-1,H=S==null?0:S.length,le={};++A<H;){var Ce=S[A];le[Ce[0]]=Ce[1]}return le}function Ga(S){return S&&S.length?S[0]:t}function y0(S,A,H){var le=S==null?0:S.length;if(!le)return-1;var Ce=H==null?0:jr(H); Line truncated
`;S.replace(Fo,function(Zs,gi,ki,Ou,Zu,Zf){return ki||(ki=Ou),Vn+=S.slice(vn,Zf).replace(lt,Ql),gi&&(St=!0,Vn+=`' +
__e(`+gi+`) +
'`),Zu&&(zt=!0,Vn+=`';
`+Zu+`;
__p += '`),ki&&(Vn+=`' +
((__t = (`+ki+`)) == null ? '' : __t) +
'`),vn=Zf+Zs.length,Zs}),Vn+=`';
`;var Is=ii.call(A,"variable")&&A.variable;if(!Is)Vn=`with (obj) {
`+Vn+`
}
`;else if(Zi.test(Is))throw new or(d);Vn=(zt?Vn.replace(aa,""):Vn).replace(bs,"$1").replace(_a,"$1;"),Vn="function("+(Is||"obj")+`) {
`+(Is?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(St?", __e = _.escape":"")+(zt?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+Vn+`return __p
}`;var Hr=b2(function(){return Xr(We,ms+"return "+Vn).apply(t,ht)});if(Hr.source=Vn,r2(Hr))throw Hr;return Hr}function g2(S){return fa(S).toLowerCase()}function p2(S){return fa(S).toUpperCase()}function Sk(S,A,H){if(S=fa(S),S&&(H||A===t))return Fl(S);if(!S||!(A=Gi(A)))return S;var le=jl(S),Ce=jl(A),We=fc(le,Ce),ht=Kf(le,Ce)+1;return mh(le,We,ht).join("")}function Ck(S,A,H){if(S=fa(S),S&&(H||A===t))return S.slice(0,zg(S)+1);if(!S||!(A=Gi(A)))return S;var le=jl(S),Ce=Kf(le,jl(A))+1;return mh(le,0,Ce).join("")}function lO(S,A,H){if(S=fa(S),S&&(H||A===t))return S.replace(xo,"");if(!S||!(A=Gi(A)))return S;var le=jl(S),Ce=fc(le,jl(A));return mh(le,Ce).join("")}function z_(S,A){var H=Re,le=Oe;if(Ol(A)){var Ce="separator"in A?A.separator:Ce;H="length"in A?jr(A.length):H,le="omission"in A?Gi(A.omission):le}S=fa(S);var We=S.length;if(rl(S)){var ht=jl(S);We=ht.length}if(H>=We)return S;var St=H-Jf(le);if(St<1)return le;var zt=ht?mh(ht,0,St).join(""):S.slice(0,St);if(Ce===t)return zt+le;if(ht&&(St+=zt.length-St),gf(Ce)){if(S.slice(St).search(Ce)){var vn,Zn=zt;for(Ce.global||(Ce=oh(Ce.source,fa(Ge.exec(Ce))+"g")),Ce.lastIndex=0;vn=Ce.exec(Zn);)var Vn=vn.index;zt=zt.slice(0,Vn===t?St:Vn)}}else if(S.indexOf(Gi(Ce),St)!=St){var Fo=zt.lastIndexOf(Ce);Fo>-1&&(zt=zt.slice(0,Fo))}return zt+le}function cO(S){return S=fa(S),S&&Qi.test(S)?S.replace(ln,Ke):S}var N0=ph(function(S,A,H){return S+(H?" ":"")+A.toUpperCase()}),bb=$v("toUpperCase");function uO(S,A,H){return S=fa(S),A=H?t:A,A===t?Df(S)?Vg(S):eh(S):S.match(A)||[]}var b2=hr(function(S,A){try{return ri(S,t,A)}catch(H){return r2(H)?H:new or(H)}}),V_=Bd(function(S,A){return ks(A,function(H){H=cf(H),mi(S,H,Jy(S[H],S))}),S});function v2(S){var A=S==null?0:S.length,H=Qs();return S=A?pa(S,function(le){if(typeof le[1]!="function")throw new Sa(u);return[H(le[0]),le[1]]}):[],hr(function(le){for(var Ce=-1;++Ce<A;){var We=S[Ce];if(ri(We[0],this,le))return ri(We[1],this,le)}})}function kk(S){return Rd(Es(S,C))}function fO(S){return function(){return S}}function I0(S,A){return S==null||S!==S?A:S}var xk=Iv(),dO=Iv(!0);function bf(S){return S}function hO(S){return z(typeof S=="function"?S:Es(S,C))}function W_(S){return Ft(Es(S,C))}function mO(S,A){return Sn(S,Es(A,C))}var Tk=hr(function(S,A){return function(H){return hc(H,S,A)}}),B0=hr(function(S,A){return function(H){return hc(S,H,A)}});function O2(S,A,H){var le=oc(A),Ce=Yp(A,le);H==null&&!(Ol(A)&&(Ce.length||!le.length))&&(H=A,A=S,S=this,Ce=Yp(A,oc(A)));var We=!(Ol(H)&&"chain"in H)||!!H.chain,ht=hm(S);return ks(Ce,function(St){var zt=A[St];S[St]=zt,ht&&(S.prototype[St]=function(){var vn=this.__chain__;if(We||vn){var Zn=S(this.__wrapped__),Vn=Zn.__actions__=du(this.__actions__);return Vn.push({func:zt,args:arguments,thisArg:S}),Zn.__chain__=vn,Zn}return zt.apply(S,jf([this.value()],arguments))})}),S}function Ek(){return me._===this&&(me._=sh),this}function gO(){}function yl(S){return S=jr(S),hr(function(A){return ts(A,S)})}var Ak=nb(pa),vb=nb(Pi),Dk=nb(Ku);function Ob(S){return Oh(S)?sl(cf(S)):Uc(S)}function y2(S){return function(A){return S==null?t:Hl(S,A)}}var Pk=Bv(),Mk=Bv(!0);function L0(){return[]}function gm(){return!1}function yb(){return{}}function vu(){return""}function a1(){return!0}function U_(S,A){if(S=jr(S),S<1||S>Qe)return[];var H=He,le=Tr(S,He);A=Qs(A),S-=He;for(var Ce=Pr(le,A);++H<S;)A(H);return Ce}function Y_(S){return Sr(S)?pa(S,cf):al(S)?[S]:du(b0(fa(S)))}function w2(S){var A=++Mu;return fa(S)+A}var _2=bh(function(S,A){return S+A},0),S2=ob("ceil"),Rk=bh(function(S,A){return S/A},1),F0=ob("floor");function pO(S){return S&&S.length?Kr(S,bf,fh):t}function bp(S,A){return S&&S.length?Kr(S,Qs(A,2),fh):t}function Q0(S){return kl(S,bf)}function Ah(S,A){return kl(S,Qs(A,2))}function $k(S){return S&&S.length?Kr(S,bf,Pe):t}function pm(S,A){return S&&S.length?Kr(S,Qs(A,2),Pe):t}var Hd=bh(function(S,A){return S*A},1),wb=ob("round"),C2=bh(function(S,A){return S-A},0);function _b(S){return S&&S.length?Af(S,bf):0}function Og(S,A){return S&&S.length?Af(S,Qs(A,2)):0}return Ae.after=fm,Ae.ary=Vt,Ae.assign=ak,Ae.assignIn=eO,Ae.assignInWith=tO,Ae.assignWith=k_,Ae.at=lk,Ae.before=T0,Ae.bind=Jy,Ae.bindAll=V_,Ae.bindKey=E0,Ae.castArray=y_,Ae.chain=dp,Ae.chunk=s_,Ae.compact=Gp,Ae.concat=By,Ae.cond=v2,Ae.conforms=kk,Ae.constant=fO,Ae.countBy=t1,Ae.create=hb,Ae.curry=Ch,Ae.curryRight=mf,Ae.debounce=ub,Ae.defaults=x_,Ae.defaultsDeep=ck,Ae.defer=Xv,Ae.delay=e2,Ae.difference=up,Ae.differenceBy=v0,Ae.differenceWith=sb,Ae.drop=Ly,Ae.dropRight=Fy,Ae.dropRightWhile=r_,Ae.dropWhile=jC,Ae.fill=Qr,Ae.filter=ld,Ae.flatMap=g_,Ae.flatMapDeep=nk,Ae.flatMapDepth=p_,Ae.flatten=Zy,Ae.flattenDeep=O0,Ae.flattenDepth=qC,Ae.flip=jv,Ae.flow=xk,Ae.flowRight=dO,Ae.fromPairs=um,Ae.functions=Xi,Ae.functionsIn=d2,Ae.groupBy=b_,Ae.initial=rb,Ae.intersection=i_,Ae.intersectionBy=w0,Ae.intersectionWith=Hy,Ae.invert=A_,Ae.invertBy=mm,Ae.invokeMap=n1,Ae.iteratee=hO,Ae.keyBy=v_,Ae.keys=oc,Ae.keysIn=pf,Ae.map=o1,Ae.mapKeys=P0,Ae.mapValues=dk,Ae.matches=W_,Ae.matchesProperty=mO,Ae Line truncated
* mustache.js - Logic-less {{mustache}} templates with JavaScript
* http://github.com/janl/mustache.js
*/var Gwe=Object.prototype.toString,jD=Array.isArray||function(e){return Gwe.call(e)==="[object Array]"};function rre(o){return typeof o=="function"}function Kwe(o){return jD(o)?"array":typeof o}function gne(o){return o.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Rle(o,e){return o!=null&&typeof o=="object"&&e in o}function Jwe(o,e){return o!=null&&typeof o!="object"&&o.hasOwnProperty&&o.hasOwnProperty(e)}var e_e=RegExp.prototype.test;function t_e(o,e){return e_e.call(o,e)}var n_e=/\S/;function o_e(o){return!t_e(n_e,o)}var s_e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function r_e(o){return String(o).replace(/[&<>"'`=\/]/g,function(t){return s_e[t]})}var i_e=/\s*/,a_e=/\s+/,$le=/\s*=/,l_e=/\s*\}/,c_e=/#|\^|\/|>|\{|&|=|!/;function u_e(o,e){if(!o)return[];var t=!1,s=[],a=[],l=[],u=!1,d=!1,h="",b=0;function y(){if(u&&!d)for(;l.length;)delete a[l.pop()];else l=[];u=!1,d=!1}var C,E,R;function $(we){if(typeof we=="string"&&(we=we.split(a_e,2)),!jD(we)||we.length!==2)throw new Error("Invalid tags: "+we);C=new RegExp(gne(we[0])+"\\s*"),E=new RegExp("\\s*"+gne(we[1])),R=new RegExp("\\s*"+gne("}"+we[1]))}$(e||Zp.tags);for(var Q=new j6(o),F,U,K,L,te,ne;!Q.eos();){if(F=Q.pos,K=Q.scanUntil(C),K)for(var oe=0,G=K.length;oe<G;++oe)L=K.charAt(oe),o_e(L)?(l.push(a.length),h+=L):(d=!0,t=!0,h+=" "),a.push(["text",L,F,F+1]),F+=1,L===`
`&&(y(),h="",b=0,t=!1);if(!Q.scan(C))break;if(u=!0,U=Q.scan(c_e)||"name",Q.scan(i_e),U==="="?(K=Q.scanUntil($le),Q.scan($le),Q.scanUntil(E)):U==="{"?(K=Q.scanUntil(R),Q.scan(l_e),Q.scanUntil(E),U="&"):K=Q.scanUntil(E),!Q.scan(E))throw new Error("Unclosed tag at "+Q.pos);if(U==">"?te=[U,K,F,Q.pos,h,b,t]:te=[U,K,F,Q.pos],b++,a.push(te),U==="#"||U==="^")s.push(te);else if(U==="/"){if(ne=s.pop(),!ne)throw new Error('Unopened section "'+K+'" at '+F);if(ne[1]!==K)throw new Error('Unclosed section "'+ne[1]+'" at '+F)}else U==="name"||U==="{"||U==="&"?d=!0:U==="="&&$(K)}if(y(),ne=s.pop(),ne)throw new Error('Unclosed section "'+ne[1]+'" at '+Q.pos);return d_e(f_e(a))}function f_e(o){for(var e=[],t,s,a=0,l=o.length;a<l;++a)t=o[a],t&&(t[0]==="text"&&s&&s[0]==="text"?(s[1]+=t[1],s[3]=t[3]):(e.push(t),s=t));return e}function d_e(o){for(var e=[],t=e,s=[],a,l,u=0,d=o.length;u<d;++u)switch(a=o[u],a[0]){case"#":case"^":t.push(a),s.push(a),t=a[4]=[];break;case"/":l=s.pop(),l[5]=a[2],t=s.length>0?s[s.length-1][4]:e;break;default:t.push(a)}return e}function j6(o){this.string=o,this.tail=o,this.pos=0}j6.prototype.eos=function(){return this.tail===""};j6.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var s=t[0];return this.tail=this.tail.substring(s.length),this.pos+=s.length,s};j6.prototype.scanUntil=function(e){var t=this.tail.search(e),s;switch(t){case-1:s=this.tail,this.tail="";break;case 0:s="";break;default:s=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=s.length,s};function DD(o,e){this.view=o,this.cache={".":this.view},this.parent=e}DD.prototype.push=function(e){return new DD(e,this)};DD.prototype.lookup=function(e){var t=this.cache,s;if(t.hasOwnProperty(e))s=t[e];else{for(var a=this,l,u,d,h=!1;a;){if(e.indexOf(".")>0)for(l=a.view,u=e.split("."),d=0;l!=null&&d<u.length;)d===u.length-1&&(h=Rle(l,u[d])||Jwe(l,u[d])),l=l[u[d++]];else l=a.view[e],h=Rle(a.view,e);if(h){s=l;break}a=a.parent}t[e]=s}return rre(s)&&(s=s.call(this.view)),s};function Qg(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}Qg.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};Qg.prototype.parse=function(e,t){var s=this.templateCache,a=e+":"+(t||Zp.tags).join(":"),l=typeof s<"u",u=l?s.get(a):void 0;return u==null&&(u=u_e(e,t),l&&s.set(a,u)),u};Qg.prototype.render=function(e,t,s,a){var l=this.getConfigTags(a),u=this.parse(e,l),d=t instanceof DD?t:new DD(t,void 0);return this.renderTokens(u,d,s,e,a)};Qg.prototype.renderTokens=function(e,t,s,a,l){for(var u="",d,h,b,y=0,C=e.length;y<C;++y)b=void 0,d=e[y],h=d[0],h==="#"?b=this.renderSection(d,t,s,a,l):h==="^"?b=this.renderInverted(d,t,s,a,l):h===">"?b=this.renderPartial(d,t,s,l):h==="&"?b=this.unescapedValue(d,t):h==="name"?b=this.escapedValue(d,t,l):h==="text"&&(b=this.rawValue(d)),b!==void 0&&(u+=b);return u};Qg.prototype.renderSection=function(e,t,s,a,l){var u=this,d="",h=t.lookup(e[1]);function b(E){return u.render(E,t,s,l)}if(!!h){if(jD(h))for(var y=0,C=h.length;y<C;++y)d+=this.renderTokens(e[4],t.push(h[y]),s,a,l);else if(typeof h=="object"||typeof h=="string"||typeof h=="number")d+=this.renderTokens(e[4],t.push(h),s,a,l);else if(rre(h)){if(typeof a!="string")throw new Error("Cannot use higher-order sections without the original template");h=h.call(t.view,a.slice(e[3],e[5]),b),h!=null&&(d+=h)}else d+=this.renderTokens(e[4],t,s,a,l);return d}};Qg.prototype.renderInverted=function(e,t,s,a,l){var u=t.lookup(e[1]);if(!u||jD(u)&&u.length===0)return this.renderTokens(e[4],t,s,a,l)};Qg.prototype.indentPartial=function(e,t,s){for(var a=t.replace(/[^ \t]/g,""),l=e.split(`
`),u=0;u<l.length;u++)l[u].length&&(u>0||!s)&&(l[u]=a+l[u]);return l.join(`
`)};Qg.prototype.renderPartial=function(e,t,s,a){if(!!s){var l=this.getConfigTags(a),u=rre(s)?s(e[1]):s[e[1]];if(u!=null){var d=e[6],h=e[5],b=e[4],y=u;h==0&&b&&(y=this.indentPartial(u,b,d));var C=this.parse(y,l);return this.renderTokens(C,t,s,y,a)}}};Qg.prototype.unescapedValue=function(e,t){var s=t.lookup(e[1]);if(s!=null)return s};Qg.prototype.escapedValue=function(e,t,s){var a=this.getConfigEscape(s)||Zp.escape,l=t.lookup(e[1]);if(l!=null)return typeof l=="number"&&a===Zp.escape?String(l):a(l)};Qg.prototype.rawValue=function(e){return e[1]};Qg.prototype.getConfigTags=function(e){return jD(e)?e:e&&typeof e=="object"?e.tags:void 0};Qg.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!jD(e))return e.escape};var Zp={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(o){w6.templateCache=o},get templateCache(){return w6.templateCache}},w6=new Qg;Zp.clearCache=function(){return w6.clearCache()};Zp.parse=function(e,t){return w6.parse(e,t)};Zp.render=function(e,t,s,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Kwe(e)+'" was given as the first argument for mustache#render(template, view, partials)');return w6.render(e,t,s,a)};Zp.escape=r_e;Zp.Scanner=j6;Zp.Context=DD;Zp.Writer=Qg;function nz(o){return nz=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nz(o)}function hE(o){if(o===null||o===!0||o===!1)return NaN;var e=Number(o);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Sc(o,e){if(e.length<o)throw new TypeError(o+" argument"+(o>1?"s":"")+" required, but only "+e.length+" present")}function cc(o){Sc(1,arguments);var e=Object.prototype.toString.call(o);return o instanceof Date||nz(o)==="object"&&e==="[object Date]"?new Date(o.getTime()):typeof o=="number"||e==="[object Number]"?new Date(o):((typeof o=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function h_e(o,e){Sc(2,arguments);var t=cc(o).getTime(),s=hE(e);return new Date(t+s)}var m_e={};function q6(){return m_e}function Noe(o){var e=new Date(Date.UTC(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds()));return e.setUTCFullYear(o.getFullYear()),o.getTime()-e.getTime()}function kH(o,e){Sc(2,arguments);var t=cc(o),s=cc(e),a=t.getTime()-s.getTime();return a<0?-1:a>0?1:a}function g_e(o){return Sc(1,arguments),o instanceof Date||nz(o)==="object"&&Object.prototype.toString.call(o)==="[object Date]"}function p_e(o){if(Sc(1,arguments),!g_e(o)&&typeof o!="number")return!1;var e=cc(o);return!isNaN(Number(e))}function b_e(o,e){Sc(2,arguments);var t=cc(o),s=cc(e),a=t.getFullYear()-s.getFullYear(),l=t.getMonth()-s.getMonth();return a*12+l}function v_e(o,e){return Sc(2,arguments),cc(o).getTime()-cc(e).getTime()}var Nle={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},O_e="trunc";function y_e(o){return o?Nle[o]:Nle[O_e]}function w_e(o){Sc(1,arguments);var e=cc(o);return e.setHours(23,59,59,999),e}function __e(o){Sc(1,arguments);var e=cc(o),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function S_e(o){Sc(1,arguments);var e=cc(o);return w_e(e).getTime()===__e(e).getTime()}function C_e(o,e){Sc(2,arguments);var t=cc(o),s=cc(e),a=kH(t,s),l=Math.abs(b_e(t,s)),u;if(l<1)u=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-a*l);var d=kH(t,s)===-a;S_e(cc(o))&&l===1&&kH(o,s)===1&&(d=!1),u=a*(l-Number(d))}return u===0?0:u}function k_e(o,e,t){Sc(2,arguments);var s=v_e(o,e)/1e3;return y_e(t==null?void 0:t.roundingMethod)(s)}function x_e(o,e){Sc(2,arguments);var t=hE(e);return h_e(o,-t)}var T_e=864e5;function E_e(o){Sc(1,arguments);var e=cc(o),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var s=e.getTime(),a=t-s;return Math.floor(a/T_e)+1}function oz(o){Sc(1,arguments);var e=1,t=cc(o),s=t.getUTCDay(),a=(s<e?7:0)+s-e;return t.setUTCDate(t.getUTCDate()-a),t.setUTCHours(0,0,0,0),t}function Rpe(o){Sc(1,arguments);var e=cc(o),t=e.getUTCFullYear(),s=new Date(0);s.setUTCFullYear(t+1,0,4),s.setUTCHours(0,0,0,0);var a=oz(s),l=new Date(0);l.setUTCFullYear(t,0,4),l.setUTCHours(0,0,0,0);var u=oz(l);return e.getTime()>=a.getTime()?t+1:e.getTime()>=u.getTime()?t:t-1}function A_e(o){Sc(1,arguments);var e=Rpe(o),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var s=oz(t);return s}var D_e=6048e5;function P_e(o){Sc(1,arguments);var e=cc(o),t=oz(e).getTime()-A_e(e).getTime();return Line truncated
Save`),Z(t,"class","spinner-border spinner-border-sm"),Z(t,"role","status"),Z(t,"aria-hidden","true"),e.disabled=a=!o[6],Z(e,"class","ms-2 btn btn-primary btn-spinner")},m(d,h){Te(d,e,h),X(e,t),X(e,s),l||(u=mn(e,"click",o[11]),l=!0)},p(d,h){h&64&&a!==(a=!d[6])&&(e.disabled=a)},d(d){d&&ke(e),l=!1,u()}}}function MCe(o){let e,t,s;return{c(){e=re("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Add`,Z(e,"class","ms-2 btn btn-primary btn-spinner")},m(a,l){Te(a,e,l),t||(s=mn(e,"click",o[11]),t=!0)},p:un,d(a){a&&ke(e),t=!1,s()}}}function RCe(o){let e,t,s,a,l,u,d,h,b,y=[],C=new Map,E,R,$,Q,F,U,K,L,te;t=new X6({props:{message:o[7]}});function ne(Xe){o[12](Xe)}let oe={schema:o[2],isCreateMode:o[3],record:o[0]};o[5]!==void 0&&(oe.active=o[5]),l=new Wpe({props:oe}),Ro.push(()=>er(l,"active",ne)),h=new Vpe({props:{record:o[0],schema:o[2]}});let G=o[8];const we=Xe=>Xe[23].name;for(let Xe=0;Xe<G.length;Xe+=1){let tt=Cce(o,G,Xe),ot=we(tt);C.set(ot,y[Xe]=xce(ot,tt))}let ve=o[2].hasDrafts&&Tce(o);function Re(Xe,tt){return Xe[3]?MCe:PCe}let Oe=Re(o),ce=Oe(o);return{c(){e=re("div"),en(t.$$.fragment),s=Ze(),a=re("div"),en(l.$$.fragment),d=Ze(),en(h.$$.fragment),b=Ze();for(let Xe=0;Xe<y.length;Xe+=1)y[Xe].c();E=Ze(),R=re("div"),$=re("div"),ve&&ve.c(),Q=Ze(),ce.c(),F=Ze(),U=re("button"),U.textContent="cancel",Z(a,"class","mt-1"),Z(U,"class","ms-2 btn btn-link"),Z($,"class","d-flex mt-3 align-items-center justify-content-center"),Z(e,"class","inline-edit my-4 svelte-sl11hx")},m(Xe,tt){Te(Xe,e,tt),Kt(t,e,null),X(e,s),X(e,a),Kt(l,a,null),X(a,d),Kt(h,a,null),X(a,b);for(let ot=0;ot<y.length;ot+=1)y[ot]&&y[ot].m(a,null);X(e,E),X(e,R),X(R,$),ve&&ve.m($,null),X($,Q),ce.m($,null),X($,F),X($,U),K=!0,L||(te=[mn(window,"beforeunload",o[9]),mn(U,"click",o[10])],L=!0)},p(Xe,[tt]){const ot={};tt&128&&(ot.message=Xe[7]),t.$set(ot);const V={};tt&4&&(V.schema=Xe[2]),tt&8&&(V.isCreateMode=Xe[3]),tt&1&&(V.record=Xe[0]),!u&&tt&32&&(u=!0,V.active=Xe[5],lr(()=>u=!1)),l.$set(V);const ut={};tt&1&&(ut.record=Xe[0]),tt&4&&(ut.schema=Xe[2]),h.$set(ut),tt&319&&(G=Xe[8],mo(),y=Jd(y,tt,we,1,Xe,G,C,a,xv,xce,null,Cce),go()),Xe[2].hasDrafts?ve?(ve.p(Xe,tt),tt&4&&xe(ve,1)):(ve=Tce(Xe),ve.c(),xe(ve,1),ve.m($,Q)):ve&&(mo(),Be(ve,1,1,()=>{ve=null}),go()),Oe===(Oe=Re(Xe))&&ce?ce.p(Xe,tt):(ce.d(1),ce=Oe(Xe),ce&&(ce.c(),ce.m($,F)))},i(Xe){if(!K){xe(t.$$.fragment,Xe),xe(l.$$.fragment,Xe),xe(h.$$.fragment,Xe);for(let tt=0;tt<G.length;tt+=1)xe(y[tt]);xe(ve),K=!0}},o(Xe){Be(t.$$.fragment,Xe),Be(l.$$.fragment,Xe),Be(h.$$.fragment,Xe);for(let tt=0;tt<y.length;tt+=1)Be(y[tt]);Be(ve),K=!1},d(Xe){Xe&&ke(e),Jt(t),Jt(l),Jt(h);for(let tt=0;tt<y.length;tt+=1)y[tt].d();ve&&ve.d(),ce.d(),L=!1,vi(te)}}}function $Ce(o,e,t){let s,a;const l=Ur("channel"),u=Fg();let{schema:d}=e,{record:h}=e,{graph:b={records:[],edges:[]}}=e,{isCreateMode:y}=e,C,E="",R=!1,$=d.fields.filter(ve=>ve.name!=="id"),Q="_default";d.fields.reduce((ve,Re)=>{var Oe;return Re.ui==="tab"?(Q=Re.name,ve):(ve[Q]=[...(Oe=ve[Q])!=null?Oe:[],Re.name],ve)},[]),W1(()=>{F()});function F(){C={data:JSON.parse(JSON.stringify(h.data)),schema:h.schema,status:h.status,_sys:JSON.parse(JSON.stringify(h._sys)),_file:JSON.parse(JSON.stringify(h._file)),edges:JSON.parse(JSON.stringify(b.edges))}}Epe(()=>{t(6,R=K())});function U(ve){return R?ve.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete ve.returnValue,"...")}function K(){return y?!1:!Lc.exports.isEqual(C,{data:h.data,schema:h.schema,status:h.status,_sys:h._sys,_file:h._file,edges:b.edges})}function L(ve){ve.preventDefault(),u("cancel")}function te(ve){return ve.preventDefault(),console.log("SAVE: Attempt"),t(4,s=null),t(7,a=""),new Promise(function(Re,Oe){var ce,Xe;if(!R&&!y){Re(null);return}if(!h){Re(null);return}t(1,b.edges=(Xe=(ce=b.edges)==null?void 0:ce.filter(tt=>!tt._isTrashed&&tt.source===h.id))!=null?Xe:[],b),axios.post(l.lucentUrl+"/records",{record:h,edges:b.edges,isCreateMode:y}).then(function(tt){console.log("SAVE: SAVED INLINE"),t(0,h=tt.data.records[0]),t(1,b=tt.data),y||F(),u("inlinesaved",{records:[h]}),Re(null)}).catch(function(tt){tt.response&&(typeof tt.response.data.error=="string"?t(7,a=tt.response.data.error):t(4,s=tt.response.data.error)),Re(null)})})}function ne(ve){E=ve,t(5,E)}function oe(ve){o.$$.not_equal(h.data,ve)&&(h.data=ve,t(0,h))}function G(ve){b=ve,t(1,b)}function we(ve){o.$$.not_equal(h.status,ve)&&(h.status=ve,t(0,h))}return o.$$set=ve=>{"schema"in ve&&t(2,d=ve.schema),"record"in ve&&t(0,h=ve.record),"graph"in ve&&t(1,b=ve.graph),"isCreateMode"in ve&&t(3,y=ve.isCreateMode)},o.$$.update=()=>{o.$$.dirty&16&&t(7,a=s?`Record submission failed. ${Object.entries(s).length} error(s)`:null)},t(4,s=null),[h,b,d,y,s,E,R,a,$,U,L,te,ne,oe,G,we]}class Xpe extends uo{constructor(e){super(),co(this,e,$Ce,RCe,lo,{schema:2,record:0,graph:1,isCreateMode:3})}}function Ece(o,e,t){const s=o.slice();return s[11]=e[t],s}function Ace(o){let e=[],t=new Map,s,a=o[2];const l=d=>d[11].id;for(let d=0;d<a.length;d+=1){let h=Ece(o,a,d),b=l(h);t.set(b,e[d]=Pce(b,h))}let u=null;return a.length||(u=Dce()),{c(){for(let d=0;d<e.length;d+=1)e[d].c();s=Rs(),u&&u.c()},m(d,h){for(let b=0;b<e.length;b+=1)e[b]&&e[b].m(d,h);Te(d,s,h),u&&u.m(d,h)},p(d,h){h&44&&(a=d[2],e=Jd(e,h,l,1,d,a,t,s.parentNode,XD,Pce,s,Ece),a.length?u&&(u.d(1),u=null):u||(u=Dce(),u.c(),u.m(s.parentNode,s)))},d(d){for(let h=0;h<e.length;h+=1)e[h].d(d);d&&k Line truncated
`),a=re("span"),a.innerHTML='<span class="visually-hidden">Loading...</span>',l=Ze(),u=re("input"),Z(a,"class","spinner-border spinner-border-sm"),Z(a,"role","status"),Z(a,"aria-hidden","true"),Z(u,"class","form-control"),Z(u,"type","file"),Z(u,"id","formFile"),u.multiple=!0,Z(u,"accept",GCe),u.disabled=o[0],u.hidden=!0,Z(t,"class","btn btn-primary btn-sm btn-spinner "),e.disabled=o[0]},m(b,y){Te(b,e,y),X(e,t),X(t,s),X(t,a),X(t,l),X(t,u),d||(h=mn(u,"input",o[1]),d=!0)},p(b,[y]){y&1&&(u.disabled=b[0]),y&1&&(e.disabled=b[0])},i:un,o:un,d(b){b&&ke(e),d=!1,h()}}}let GCe="";function KCe(o,e,t){const s=Fg(),a=Ur("channel");let{schema:l}=e,u=[],d=!1;function h(b){t(0,d=!0),u=b.target.files?[...b.target.files]:[];let y=new FormData;y.append("schema",l.name),Array.from(u).forEach(function(C){y.append("files[]",C)}),s("beforeUpload",u),axios.post(a.lucentUrl+"/files/upload",y,{headers:{"Content-Type":"multipart/form-data"}}).then(C=>{C.data.error?s("uploadError",C.data.error):s("uploadComplete",C.data),t(0,d=!1)}).catch(C=>{t(0,d=!1),console.log(C.response.data)})}return o.$$set=b=>{"schema"in b&&t(2,l=b.schema)},[d,h,l]}class JCe extends uo{constructor(e){super(),co(this,e,KCe,qCe,lo,{schema:2})}}function Bce(o,e,t){const s=o.slice();return s[18]=e[t],s}function Lce(o,e,t){const s=o.slice();return s[18]=e[t],s}function eke(o){let e,t;return e=new Fa({props:{icon:"arrow-up-short-wide"}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function tke(o){let e,t;return e=new Fa({props:{icon:"arrow-down-wide-short"}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Fce(o){let e,t,s,a,l,u,d,h,b,y,C,E=o[18].label+"",R,$,Q,F,U;a=new Fa({props:{icon:"arrow-up-short-wide"}});function K(...ne){return o[10](o[18],...ne)}h=new Fa({props:{icon:"arrow-down-wide-short"}});function L(...ne){return o[11](o[18],...ne)}function te(...ne){return o[12](o[18],...ne)}return{c(){e=re("div"),t=re("div"),s=re("button"),en(a.$$.fragment),u=Ze(),d=re("button"),en(h.$$.fragment),y=Ze(),C=re("button"),R=Ht(E),$=Ze(),Z(s,"title","Sort Ascending"),Z(s,"class",l="btn btn-sm "+(o[18].name==o[1].name&&!o[0].startsWith("-")?"btn-primary":"btn-outline-primary")),Z(d,"title","Sort Descending"),Z(d,"class",b="btn btn-sm "+(o[18].name==o[1].name&&o[0].startsWith("-")?"btn-primary":"btn-outline-primary")),Z(C,"title","Sort Ascending"),Z(C,"class","btn btn-sm btn-outline-primary w-100 text-nowrap"),rs(C,"overflow","hidden"),Z(t,"class","btn-group w-100"),Z(e,"class","col-4 px-3 py-1 d-flex align-items-center")},m(ne,oe){Te(ne,e,oe),X(e,t),X(t,s),Kt(a,s,null),X(t,u),X(t,d),Kt(h,d,null),X(t,y),X(t,C),X(C,R),X(e,$),Q=!0,F||(U=[mn(s,"click",K),mn(d,"click",L),mn(C,"click",te)],F=!0)},p(ne,oe){o=ne,(!Q||oe&11&&l!==(l="btn btn-sm "+(o[18].name==o[1].name&&!o[0].startsWith("-")?"btn-primary":"btn-outline-primary")))&&Z(s,"class",l),(!Q||oe&11&&b!==(b="btn btn-sm "+(o[18].name==o[1].name&&o[0].startsWith("-")?"btn-primary":"btn-outline-primary")))&&Z(d,"class",b),(!Q||oe&8)&&E!==(E=o[18].label+"")&&Fn(R,E)},i(ne){Q||(xe(a.$$.fragment,ne),xe(h.$$.fragment,ne),Q=!0)},o(ne){Be(a.$$.fragment,ne),Be(h.$$.fragment,ne),Q=!1},d(ne){ne&&ke(e),Jt(a),Jt(h),F=!1,vi(U)}}}function Qce(o){let e,t,s,a,l,u,d,h,b,y,C,E=o[18].label+"",R,$,Q,F,U;a=new Fa({props:{icon:"arrow-up-short-wide"}});function K(...ne){return o[13](o[18],...ne)}h=new Fa({props:{icon:"arrow-down-wide-short"}});function L(...ne){return o[14](o[18],...ne)}function te(...ne){return o[15](o[18],...ne)}return{c(){e=re("div"),t=re("div"),s=re("button"),en(a.$$.fragment),u=Ze(),d=re("button"),en(h.$$.fragment),y=Ze(),C=re("button"),R=Ht(E),$=Ze(),Z(s,"title","Sort Ascending"),Z(s,"class",l="btn btn-sm "+(o[18].name==o[0]?"btn-primary":"btn-outline-primary")),Z(d,"title","Sort Descending"),Z(d,"class",b="btn btn-sm "+("-"+o[18].name==o[0]?"btn-primary":"btn-outline-primary")),Z(C,"title","Sort Ascending"),Z(C,"class","btn btn-sm btn-outline-primary w-100 text-nowrap"),rs(C,"overflow","hidden"),Z(t,"class","btn-group w-100"),Z(e,"class","col-4 px-3 py-1 d-flex align-items-center")},m(ne,oe){Te(ne,e,oe),X(e,t),X(t,s),Kt(a,s,null),X(t,u),X(t,d),Kt(h,d,null),X(t,y),X(t,C),X(C,R),X(e,$),Q=!0,F||(U=[mn(s,"click",K),mn(d,"click",L),mn(C,"click",te)],F=!0)},p(ne,oe){o=ne,(!Q||oe&5&&l!==(l="btn btn-sm "+(o[18].name==o[0]?"btn-primary":"btn-outline-primary")))&&Z(s,"class",l),(!Q||oe&5&&b!==(b="btn btn-sm "+("-"+o[18].name==o[0]?"btn-primary":"btn-outline-primary")))&&Z(d,"class",b),(!Q||oe&4)&&E!==(E=o[18].label+"")&&Fn(R,E)},i(ne){Q||(xe(a.$$.fragment,ne),xe(h.$$.fragment,ne),Q=!0)},o(ne){Be(a.$$.fragment,ne),Be(h.$$.fragment,ne),Q=!1},d(ne){ne&&ke(e),Jt(a),Jt(h),F=!1,vi(U)}}}function nke(o){let e,t,s,a,l,u,d,h=o[1].label+"",b,y,C,E,R,$,Q,F,U;const K=[tke,eke],L=[];function te(Oe,ce){return ce&1&&(s=null),s==null&&(s=!!Oe[0].startsWith("-")),s?0:1}a=te( Line truncated
`),u=re("span"),h=Ht(d),b=Ht(`
to
`),y=re("span"),E=Ht(C),R=Ht(`
of
`),$=re("span"),Q=Ht(o[4]),F=Ht(`
total`),Z(t,"class","pagination justify-content-center"),Z(u,"class","font-medium"),Z(y,"class","font-medium"),Z($,"class","font-medium"),Z(a,"class","text-muted text-center")},m(L,te){Te(L,e,te),X(e,t),K&&K.m(t,null),Te(L,s,te),Te(L,a,te),X(a,l),X(a,u),X(u,h),X(a,b),X(a,y),X(y,E),X(a,R),X(a,$),X($,Q),X(a,F),U=!0},p(L,[te]){L[5]>1?K?(K.p(L,te),te&32&&xe(K,1)):(K=jce(L),K.c(),xe(K,1),K.m(t,null)):K&&(mo(),Be(K,1,1,()=>{K=null}),go()),(!U||te&8)&&d!==(d=+L[3]+1+"")&&Fn(h,d),(!U||te&28)&&C!==(C=(+L[3]+L[2]>L[4]?L[4]:+L[3]+L[2])+"")&&Fn(E,C),(!U||te&16)&&Fn(Q,L[4])},i(L){U||(xe(K),U=!0)},o(L){Be(K),U=!1},d(L){L&&ke(e),K&&K.d(),L&&ke(s),L&&ke(a)}}}function kke(o,e,t){let s,a,l;const u=Fg();let{inModal:d}=e,{modalUrl:h}=e,{limit:b}=e,{skip:y}=e,{total:C}=e;function E(F){F.preventDefault(),$(s)}function R(F){F.preventDefault(),$(1)}function $(F){const U=new URL(h!=null?h:window.location.href);let K=F*b-b;U.searchParams.set("skip",K),d?u("refresh",U):window.location=U}function Q(F){SH.call(this,o,F)}return o.$$set=F=>{"inModal"in F&&t(0,d=F.inModal),"modalUrl"in F&&t(1,h=F.modalUrl),"limit"in F&&t(2,b=F.limit),"skip"in F&&t(3,y=F.skip),"total"in F&&t(4,C=F.total)},o.$$.update=()=>{o.$$.dirty&20&&t(5,s=Math.ceil(C/b)),o.$$.dirty&12&&t(6,a=Math.ceil((y-1)/b)+1),o.$$.dirty&96&&t(7,l=Lc.exports.range(a-3,a+4).filter(F=>F>0&&F<=s))},[d,h,b,y,C,s,a,l,E,R,Q]}class xke extends uo{constructor(e){super(),co(this,e,kke,Cke,lo,{inModal:0,modalUrl:1,limit:2,skip:3,total:4})}}function Tke(o){let e,t,s;return{c(){e=re("button"),e.textContent="Move to trash",Z(e,"type","button"),Z(e,"class","btn btn-sm btn-outline-primary")},m(a,l){Te(a,e,l),t||(s=mn(e,"click",ku(o[9])),t=!0)},p:un,d(a){a&&ke(e),t=!1,s()}}}function Eke(o){let e,t,s,a,l,u,d=o[1].hasDrafts&&qce(o);return{c(){e=re("button"),e.textContent="Publish",t=Ze(),d&&d.c(),s=Ze(),a=re("button"),a.textContent="Delete forever",Z(e,"type","button"),Z(e,"class","btn btn-sm btn-outline-primary"),Z(a,"type","button"),Z(a,"class","btn btn-sm btn-outline-primary")},m(h,b){Te(h,e,b),Te(h,t,b),d&&d.m(h,b),Te(h,s,b),Te(h,a,b),l||(u=[mn(e,"click",ku(o[7])),mn(a,"click",ku(o[3]))],l=!0)},p(h,b){h[1].hasDrafts?d?d.p(h,b):(d=qce(h),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null)},d(h){h&&ke(e),h&&ke(t),d&&d.d(h),h&&ke(s),h&&ke(a),l=!1,vi(u)}}}function qce(o){let e,t,s;return{c(){e=re("button"),e.textContent="Make Draft",Z(e,"type","button"),Z(e,"class","btn btn-sm btn-outline-primary")},m(a,l){Te(a,e,l),t||(s=mn(e,"click",ku(o[8])),t=!0)},p:un,d(a){a&&ke(e),t=!1,s()}}}function Ake(o){let e,t,s=o[0].length+"",a,l,u,d,h,b,y,C,E,R;function $(U,K){return U[2].status_in==="trashed"?Eke:Tke}let Q=$(o),F=Q(o);return{c(){e=re("div"),t=re("span"),a=Ht(s),l=Ht(" records selected"),u=Ze(),d=re("div"),h=re("button"),h.textContent="Publish",b=Ze(),y=re("button"),y.textContent="Make Draft",C=Ze(),F.c(),Z(t,"class","me-2"),Z(h,"type","button"),Z(h,"class","btn btn-sm btn-outline-primary"),Z(y,"type","button"),Z(y,"class","btn btn-sm btn-outline-primary"),Z(d,"class","btn-group "),Z(d,"role","group"),Z(d,"aria-label","Basic example"),Z(e,"class","d-flex align-items-center mb-3")},m(U,K){Te(U,e,K),X(e,t),X(t,a),X(t,l),X(e,u),X(e,d),X(d,h),X(d,b),X(d,y),X(d,C),F.m(d,null),E||(R=[mn(h,"click",ku(o[5])),mn(y,"click",ku(o[6]))],E=!0)},p(U,[K]){K&1&&s!==(s=U[0].length+"")&&Fn(a,s),Q===(Q=$(U))&&F?F.p(U,K):(F.d(1),F=Q(U),F&&(F.c(),F.m(d,null)))},i:un,o:un,d(U){U&&ke(e),F.d(),E=!1,vi(R)}}}function Dke(o,e,t){const s=Ur("channel");let{selected:a}=e,{schema:l}=e,{filter:u}=e;function d($){$.preventDefault(),axios.post(s.lucentUrl+"/records/delete",{ids:a.map(Q=>Q.id)}).then(Q=>{window.location.reload()}).catch(Q=>{console.log(Q)})}function h($,Q){axios.post(s.lucentUrl+"/records/status/"+Q,{schemaName:l.name,records:a}).then(F=>{window.location.reload()}).catch(F=>{console.log(F)})}const b=$=>h($,"published"),y=$=>h($,"draft"),C=$=>h($,"published"),E=$=>h($,"draft"),R=$=>h($,"trashed");return o.$$set=$=>{"selected"in $&&t(0,a=$.selected),"schema"in $&&t(1,l=$.schema),"filter"in $&&t(2,u=$.filter)},[a,l,u,d,h,b,y,C,E,R]}class Pke extends uo{constructor(e){super(),co(this,e,Dke,Ake,lo,{selected:0,schema:1,filter:2})}}function Mke(o){let e;return{c(){e=Ht(o[0])},m(t,s){Te(t,e,s)},p(t,[s]){s&1&&Fn(e,t[0])},i:un,o:un,d(t){t&&ke(e)}}}function Rke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class $ke extends uo{constructor(e){super(),co(this,e,Rke,Mke,lo,{value:0})}}function Gce(o){let e,t,s,a;return{c(){e=re("div"),t=re("span"),s=Ze(),a=Ht(o[0]),Z(t,"class","color border border-2 svelte-78o2k4"),rs(t,"background",o[0]),Z(e,"class","d-inline-flex")},m(l,u){Te(l,e,u),X(e,t),X(e,s),X(e,a)},p(l,u){u&1&&rs(t,"background",l[0]),u&1&&Fn(a,l[0])},d(l){l&&ke(e)}}}function Nke(o){let e,t=o[0]&&Gce(o);return{c(){t&&t.c(),e=Rs()},m(s,a){t&&t.m(s,a),Te(s,e,a)},p(s,[a]){s[0]?t?t.p(s,a):(t=Gce(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:un,o:un,d(s){t&&t.d(s),s&&ke(e)}}}function Ike(o,e,t){let{val Line truncated
* Sortable 1.15.0
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*/function xue(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(o);e&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(o,a).enumerable})),t.push.apply(t,s)}return t}function Oy(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xue(Object(t),!0).forEach(function(s){Mxe(o,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):xue(Object(t)).forEach(function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(t,s))})}return o}function xH(o){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xH=function(e){return typeof e}:xH=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xH(o)}function Mxe(o,e,t){return e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function zw(){return zw=Object.assign||function(o){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(o[s]=t[s])}return o},zw.apply(this,arguments)}function Rxe(o,e){if(o==null)return{};var t={},s=Object.keys(o),a,l;for(l=0;l<s.length;l++)a=s[l],!(e.indexOf(a)>=0)&&(t[a]=o[a]);return t}function $xe(o,e){if(o==null)return{};var t=Rxe(o,e),s,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(o);for(a=0;a<l.length;a++)s=l[a],!(e.indexOf(s)>=0)&&(!Object.prototype.propertyIsEnumerable.call(o,s)||(t[s]=o[s]))}return t}var Nxe="1.15.0";function Fw(o){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(o)}var jw=Fw(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),tI=Fw(/Edge/i),Tue=Fw(/firefox/i),i6=Fw(/safari/i)&&!Fw(/chrome/i)&&!Fw(/android/i),e1e=Fw(/iP(ad|od|hone)/i),t1e=Fw(/chrome/i)&&Fw(/android/i),n1e={capture:!1,passive:!1};function hl(o,e,t){o.addEventListener(e,t,!jw&&n1e)}function La(o,e,t){o.removeEventListener(e,t,!jw&&n1e)}function rz(o,e){if(!!e){if(e[0]===">"&&(e=e.substring(1)),o)try{if(o.matches)return o.matches(e);if(o.msMatchesSelector)return o.msMatchesSelector(e);if(o.webkitMatchesSelector)return o.webkitMatchesSelector(e)}catch{return!1}return!1}}function Ixe(o){return o.host&&o!==document&&o.host.nodeType?o.host:o.parentNode}function iy(o,e,t,s){if(o){t=t||document;do{if(e!=null&&(e[0]===">"?o.parentNode===t&&rz(o,e):rz(o,e))||s&&o===t)return o;if(o===t)break}while(o=Ixe(o))}return null}var Eue=/\s+/g;function $1(o,e,t){if(o&&e)if(o.classList)o.classList[t?"add":"remove"](e);else{var s=(" "+o.className+" ").replace(Eue," ").replace(" "+e+" "," ");o.className=(s+(t?" "+e:"")).replace(Eue," ")}}function Vr(o,e,t){var s=o&&o.style;if(s){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(o,""):o.currentStyle&&(t=o.currentStyle),e===void 0?t:t[e];!(e in s)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),s[e]=t+(typeof t=="string"?"":"px")}}function OD(o,e){var t="";if(typeof o=="string")t=o;else do{var s=Vr(o,"transform");s&&s!=="none"&&(t=s+" "+t)}while(!e&&(o=o.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(t)}function o1e(o,e,t){if(o){var s=o.getElementsByTagName(e),a=0,l=s.length;if(t)for(;a<l;a++)t(s[a],a);return s}return[]}function hy(){var o=document.scrollingElement;return o||document.documentElement}function yd(o,e,t,s,a){if(!(!o.getBoundingClientRect&&o!==window)){var l,u,d,h,b,y,C;if(o!==window&&o.parentNode&&o!==hy()?(l=o.getBoundingClientRect(),u=l.top,d=l.left,h=l.bottom,b=l.right,y=l.height,C=l.width):(u=0,d=0,h=window.innerHeight,b=window.innerWidth,y=window.innerHeight,C=window.innerWidth),(e||t)&&o!==window&&(a=a||o.parentNode,!jw))do if(a&&a.getBoundingClientRect&&(Vr(a,"transform")!=="none"||t&&Vr(a,"position")!=="static")){var E=a.getBoundingClientRect();u-=E.top+parseInt(Vr(a,"border-top-width")),d-=E.left+parseInt(Vr(a,"border-left-width")),h=u+l.height,b=d+l.width;break}while(a=a.parentNode);if(s&&o!==window){var R=OD(a||o),$=R&&R.a,Q=R&&R.d;R&&(u/=Q,d/=$,C/=$,y/=Q,h=u+y,b=d+C)}return{top:u,left:d,bottom:h,right:b,width:C,height:y}}}function Aue(o,e,t){for(var s=_C(o,!0),a=yd(o)[e];s;){var l=yd(s)[t],u=void 0;if(t==="top"||t==="left"?u=a>=l:u=a<=l,!u)return s;if(s===hy())break;s=_C(s,!1)}return!1}function PD(o,e,t,s){for(var a=0,l=0,u=o.children;l<u.length;){if(u[l].style.display!=="none"&&u[l]!==Wr.ghost&&(s||u[l]!==Wr.dragged)&&iy(u[l],t.draggable,o,!1)){if(a===e)return u[l];a++}l++}return null}function lre(o,e){for(var t=o.lastElementChild;t&&(t===Wr.ghost||Vr(t,"display")==="none"||e&&!rz(t,e));)t=t.previousElementSibling;return t||null}function Lb(o,e){var t=0;if(!o||!o.parentNode)return-1;for(;o=o.previousElementSibling;)o.nodeName.toUpperCase()!=="TEMPLATE"&&o!==Wr.clone&&(!e||rz(o,e))&&t++;return t}function Due(o){var e=0,t=0,s=hy();if(o)do{var a=OD(o),l=a.a,u=a.d;e+=o.scrollLeft*l,t+=o.scrollTop*u}whilLine truncated
`||n==="\r",Ra=(n,i)=>i<n.length&&i>=0?rm(n[i]):!1,mh=(n,i=4,c=!0,m=!0)=>{const p=Tu(" ",i),w=n.replace(/\t/g,p);return zn(w,(M,B)=>u0(B)||B===Kr?M.pcIsSpace||M.str===""&&c||M.str.length===w.length-1&&m||Ra(w,M.str.length+1)?{pcIsSpace:!1,str:M.str+Kr}:{pcIsSpace:!0,str:M.str+" "}:{pcIsSpace:rm(B),str:M.str+B},{pcIsSpace:!1,str:""}).str},$d=(n,i)=>{const c=Ke.fromDom(i),m=Ke.fromDom(n);return Ty(m,"pre,code",He(vt,c))},tg=(n,i)=>_n(n)&&eg(n.data)&&!$d(n,i),ng=n=>Jn(n)&&n.nodeName==="A"&&!n.hasAttribute("href")&&(n.hasAttribute("name")||n.hasAttribute("id")),im=(n,i)=>Tl(n)&&!tg(n,i)||ng(n)||af(n),af=Vc("data-mce-bookmark"),f0=Vc("data-mce-bogus"),tb=qg("data-mce-bogus","all"),e_=(n,i)=>{let c=0;if(im(n,n))return!1;{let m=n.firstChild;if(!m)return!0;const p=new _i(m,n);do{if(i){if(tb(m)){m=p.next(!0);continue}if(f0(m)){m=p.next();continue}}if(mi(m)){c++,m=p.next();continue}if(im(m,n))return!1;m=p.next()}while(m);return c<=1}},$a=(n,i=!0)=>e_(n.dom,i),ep="data-mce-block",og=n=>At(bs(n),i=>!/[A-Z]/.test(i)),du=n=>og(n).join(","),Bf=(n,i)=>Oe(i.querySelector(n))?(i.setAttribute(ep,"true"),i.getAttribute("data-mce-selected")==="inline-boundary"&&i.removeAttribute("data-mce-selected"),!0):(i.removeAttribute(ep),!1),sg=(n,i)=>{const c=du(n.getTransparentElements()),m=du(n.getBlockElements());return At(i.querySelectorAll(c),p=>Bf(m,p))},gh=(n,i)=>{var c;const m=i?"lastChild":"firstChild";for(let p=n[m];p;p=p[m])if($a(Ke.fromDom(p))){(c=p.parentNode)===null||c===void 0||c.removeChild(p);return}},Lu=(n,i)=>{const c=document.createRange(),m=n.parentNode;if(m){c.setStartBefore(n),c.setEndBefore(i);const p=c.extractContents();gh(p,!0),c.setStartAfter(i),c.setEndAfter(n);const w=c.extractContents();gh(w,!1),$a(Ke.fromDom(p))||m.insertBefore(p,n),$a(Ke.fromDom(i))||m.insertBefore(i,n),$a(Ke.fromDom(w))||m.insertBefore(w,n),m.removeChild(n)}},Nd=(n,i,c)=>{const m=n.getBlockElements(),p=Ke.fromDom(i),w=M=>ti(M)in m,x=M=>vt(M,p);Ne(lh(c),M=>{di(M,w,x).each(B=>{const q=r0(M,ae=>w(ae)&&!n.isValidChild(ti(B),ti(ae)));if(q.length>0){const ae=wi(B);Ne(q,fe=>{di(fe,w,x).each(be=>{Lu(be.dom,fe.dom)})}),ae.each(fe=>sg(n,fe.dom))}})})},rg=(n,i,c)=>{Ne([...c,...ig(n,i)?[i]:[]],m=>Ne(pl(Ke.fromDom(m),m.nodeName.toLowerCase()),p=>{Iv(n,p.dom)&&Kl(p)}))},d0=(n,i)=>{const c=sg(n,i);Nd(n,i,c),rg(n,i,c)},Rv=(n,i)=>{if(Nv(n,i)){const c=du(n.getBlockElements());Bf(c,i)}},$v=(n,i,c)=>{const m=w=>vt(w,Ke.fromDom(i)),p=oh(Ke.fromDom(c),m);qr(p,p.length-2).filter(kl).fold(()=>d0(n,i),w=>d0(n,w.dom))},ph=n=>n.hasAttribute(ep),tp=(n,i)=>fn(n.getTransparentElements(),i),Nv=(n,i)=>Jn(i)&&tp(n,i.nodeName),ig=(n,i)=>Nv(n,i)&&ph(i),Iv=(n,i)=>Nv(n,i)&&!ph(i),rr=(n,i)=>i.type===1&&tp(n,i.name)&&L(i.attr(ep)),Ao=ys().browser,bh=n=>oo(n,kl),nb=n=>Ao.isFirefox()&&ti(n)==="table"?bh(Da(n)).filter(i=>ti(i)==="caption").bind(i=>bh(il(i)).map(c=>{const m=c.dom.offsetTop,p=i.dom.offsetTop,w=i.dom.offsetHeight;return m<=p?-w:0})).getOr(0):0,np=(n,i)=>n.children&&kt(n.children,i),WC=(n,i,c)=>{let m=0,p=0;const w=n.ownerDocument;if(c=c||n,i){if(c===n&&i.getBoundingClientRect&&Bi(Ke.fromDom(n),"position")==="static"){const M=i.getBoundingClientRect();return m=M.left+(w.documentElement.scrollLeft||n.scrollLeft)-w.documentElement.clientLeft,p=M.top+(w.documentElement.scrollTop||n.scrollTop)-w.documentElement.clientTop,{x:m,y:p}}let x=i;for(;x&&x!==c&&x.nodeType&&!np(x,c);){const M=x;m+=M.offsetLeft||0,p+=M.offsetTop||0,x=M.offsetParent}for(x=i.parentNode;x&&x!==c&&x.nodeType&&!np(x,c);)m-=x.scrollLeft||0,p-=x.scrollTop||0,x=x.parentNode;p+=nb(Ke.fromDom(i))}return{x:m,y:p}},Bv=(n,i={})=>{let c=0;const m={},p=Ke.fromDom(n),w=Eo(p),x=Me=>{i.referrerPolicy=Me},M=Me=>{i.contentCssCors=Me},B=Me=>{na(em(p),Me)},q=Me=>{const Ve=em(p);Je(Ve,"#"+Me).each(wr)},ae=Me=>wo(m,Me).getOrThunk(()=>({id:"mce-u"+c++,passed:[],failed:[],count:0})),fe=Me=>new Promise((Ve,gt)=>{let Ot;const wt=gn._addCacheSuffix(Me),Pt=ae(wt);m[wt]=Pt,Pt.count++;const hn=(Zt,yn)=>{Ne(Zt,Cn),Pt.status=yn,Pt.passed=[],Pt.failed=[],Ot&&(Ot.onload=null,Ot.onerror=null,Ot=null)},Hn=()=>hn(Pt.passed,2),$n=()=>hn(Pt.failed,3);if(Ve&&Pt.passed.push(Ve),gt&&Pt.failed.push(gt),Pt.status===1)return;if(Pt.status===2){Hn();return}if(Pt.status===3){$n();return}Pt.status=1;const Lt=Ke.fromTag("link",w.dom);Ju(Lt,{rel:"stylesheet",type:"text/css",id:Pt.id}),i.contentCssCors&&Pr(Lt,"crossOrigin","anonymous"),i.referrerPolicy&&Pr(Lt,"referrerpolicy",i.referrerPolicy),Ot=Lt.dom,Ot.onload=Hn,Ot.onerror=$n,B(Lt),Pr(Lt,"href",wt)}),be=Me=>Promise.allSettled(pt(Me,gt=>fe(gt).then(Qe(gt)))).then(gt=>{const Ot=bn(gt,wt=>wt.status==="fulfilled");return Ot.fail.length>0?Promise.reject(pt(Ot.fail,wt=>wt.reason)):pt(Ot.pass,wt=>wt.value)}),Le=Me=>{const Ve=gn._addCacheSuffix(Me);wo(m,Ve).each(gt=>{--gt.count===0&&(delete m[Ve],q(gt.id))})};return{load:fe,loadAll:be,unload:Le,unloadAll:Me=>{Ne(Me,Ve=>{Le(Ve)})},_setReferrerPolicy:x,_setContentCssCors:M}},Lv=(()=>{const n=new WeakMap;return{forElement:(c,m)=>{const w=ql(c).dom;return he Line truncated
Actual: `+be.join(","));if(!tr(i,Ye=>kt(be,Ye)))throw new Error("Not all branches were specified when using match. Specified: "+be.join(", ")+`
Required: `+i.join(", "));return fe[x].apply(null,B)},log:fe=>{console.log(fe,{constructors:i,constructor:x,params:B})}}}}),c}};pg.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const ok=n=>{const i=[],c=[];return Ne(n,m=>{m.fold(p=>{i.push(p)},p=>{c.push(p)})}),{errors:i,values:c}},sk=n=>n.type==="inline-command"||n.type==="inline-format",r2=n=>n.type==="block-command"||n.type==="block-format",i2=n=>{const i=m=>bc.error({message:m,pattern:n}),c=(m,p,w)=>{if(n.format!==void 0){let x;if(oe(n.format)){if(!tr(n.format,L))return i(m+" pattern has non-string items in the `format` array");x=n.format}else if(L(n.format))x=[n.format];else return i(m+" pattern has non-string `format` parameter");return bc.value(p(x))}else return n.cmd!==void 0?L(n.cmd)?bc.value(w(n.cmd,n.value)):i(m+" pattern has non-string `cmd` parameter"):i(m+" pattern is missing both `format` and `cmd` parameters")};if(!te(n))return i("Raw pattern is not an object");if(!L(n.start))return i("Raw pattern is missing `start` parameter");if(n.end!==void 0){if(!L(n.end))return i("Inline pattern has non-string `end` parameter");if(n.start.length===0&&n.end.length===0)return i("Inline pattern has empty `start` and `end` parameters");let m=n.start,p=n.end;return p.length===0&&(p=m,m=""),c("Inline",w=>({type:"inline-format",start:m,end:p,format:w}),(w,x)=>({type:"inline-command",start:m,end:p,cmd:w,value:x}))}else return n.replacement!==void 0?L(n.replacement)?n.start.length===0?i("Replacement pattern has empty `start` parameter"):bc.value({type:"inline-command",start:"",end:n.start,cmd:"mceInsertContent",value:n.replacement}):i("Replacement pattern has non-string `replacement` parameter"):n.start.length===0?i("Block pattern has empty `start` parameter"):c("Block",m=>({type:"block-format",start:n.start,format:m[0]}),(m,p)=>({type:"block-command",start:n.start,cmd:m,value:p}))},hm=n=>At(n,r2),a2=n=>At(n,sk),r1=(n,i)=>({inlinePatterns:a2(n),blockPatterns:hm(n),dynamicPatternsLookup:i}),Ol=n=>{const i=ok(pt(n,i2));return Ne(i.errors,c=>console.error(c.message,c.pattern)),i.values},Pl=n=>i=>{const c=n(i);return Ol(c)},Tn=ys().deviceType,rk=Tn.isTouch(),nc=Qr.DOM,ik=n=>{const i=n.indexOf("=")>0?n.split(/[;,](?![^=;,]*(?:[;,]|$))/):n.split(",");return zn(i,(c,m)=>{const p=m.split("="),w=p[0],x=p.length>1?p[1]:w;return c[kc(w)]=kc(x),c},{})},l2=n=>K(n,RegExp),no=n=>i=>i.options.get(n),Pc=n=>L(n)||te(n),c2=(n,i="")=>c=>{const m=L(c);if(m)if(c.indexOf("=")!==-1){const p=ik(c);return{value:wo(p,n.id).getOr(i),valid:m}}else return{value:c,valid:m};else return{valid:!1,message:"Must be a string."}},fb=n=>{const i=n.options.register;i("id",{processor:"string",default:n.id}),i("selector",{processor:"string"}),i("target",{processor:"object"}),i("suffix",{processor:"string"}),i("cache_suffix",{processor:"string"}),i("base_url",{processor:"string"}),i("referrer_policy",{processor:"string",default:""}),i("language_load",{processor:"boolean",default:!0}),i("inline",{processor:"boolean",default:!1}),i("iframe_attrs",{processor:"object",default:{}}),i("doctype",{processor:"string",default:"<!DOCTYPE html>"}),i("document_base_url",{processor:"string",default:n.documentBaseUrl}),i("body_id",{processor:c2(n,"tinymce"),default:"tinymce"}),i("body_class",{processor:c2(n),default:""}),i("content_security_policy",{processor:"string",default:""}),i("br_in_pre",{processor:"boolean",default:!0}),i("forced_root_block",{processor:c=>{const m=L(c)&&yr(c);return m?{value:c,valid:m}:{valid:!1,message:"Must be a non-empty string."}},default:"p"}),i("forced_root_block_attrs",{processor:"object",default:{}}),i("newline_behavior",{processor:c=>{const m=kt(["block","linebreak","invert","default"],c);return m?{value:c,valid:m}:{valid:!1,message:"Must be one of: block, linebreak, invert or default."}},default:"default"}),i("br_newline_selector",{processor:"string",default:".mce-toc h2,figcaption,caption"}),i("no_newline_selector",{processor:"string",default:""}),i("keep_styles",{processor:"boolean",default:!0}),i("end_container_on_empty_block",{processor:c=>we(c)?{valid:!0,value:c}:L(c)?{valid:!0,value:c}:{valid:!1,message:"Must be boolean or a string"},default:"blockquote"}),i("font_size_style_values",{processor:"string",default:"xx-small,x-small,small,medium,large,x-large,xx-large"}),i("font_size_legacy_values",{processor:"string",default:"xx-small,small,medium,large,x-large,xx-large,300%"}),i("font_size_classes",{processor:"string",default:""}),i("automatic_uploads",{processor:"boolean",default:!0}),i("images_reuse_filename",{processor:"boolean",default:!1}),i("images_replace_blob_uris",{processor:"boolean",default:!0}),i("icons",{processor:"string",default:""}),i("icons_url",{processor:"string",default:""}),i("images_upload_url",{processor:"string",default:""}),i("images_upload_base_path",{processor:"string",default:""}),i("images_upload_credentials",{processor:"boolean",default:!1}),i("images_up Line truncated
\r \v`.indexOf(n)!==-1,kb=n=>!Dh(n)&&!Gs(n)&&!a0(n),Hk=n=>({value:IE(n)}),IE=n=>ga(n,"#").toUpperCase(),OO=n=>{const i=n.toString(16);return(i.length===1?"0"+i:i).toUpperCase()},cP=n=>{const i=OO(n.red)+OO(n.green)+OO(n.blue);return Hk(i)},zk=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,q_=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,E2=(n,i,c,m)=>({red:n,green:i,blue:c,alpha:m}),uP=(n,i,c,m)=>{const p=parseInt(n,10),w=parseInt(i,10),x=parseInt(c,10),M=parseFloat(m);return E2(p,w,x,M)},Vk=n=>{if(n==="transparent")return he.some(E2(0,0,0,0));const i=zk.exec(n);if(i!==null)return he.some(uP(i[1],i[2],i[3],"1"));const c=q_.exec(n);return c!==null?he.some(uP(c[1],c[2],c[3],c[4])):he.none()},G_=n=>Vk(n).map(cP).map(i=>"#"+i.value).getOr(n),Wk=n=>{const i=[];if(n)for(let c=0;c<n.rangeCount;c++)i.push(n.getRangeAt(c));return i},vI=n=>$s(n,i=>{const c=lb(i);return c?[Ke.fromDom(c)]:[]}),BE=n=>Wk(n).length>1,Uk=n=>At(vI(n),qm),yO=n=>pl(n,"td[data-mce-selected],th[data-mce-selected]"),A2=(n,i)=>{const c=yO(i);return c.length>0?c:Uk(n)},xb=n=>A2(Wk(n.selection.getSel()),Ke.fromDom(n.getBody())),vp=(n,i)=>Se(n,"table",i),LE=n=>{const i=n.startContainer,c=n.startOffset;return _n(i)?c===0?he.some(Ke.fromDom(i)):he.none():he.from(i.childNodes[c]).map(Ke.fromDom)},fP=n=>{const i=n.endContainer,c=n.endOffset;return _n(i)?c===i.data.length?he.some(Ke.fromDom(i)):he.none():he.from(i.childNodes[c-1]).map(Ke.fromDom)},FE=n=>ii(n).fold(Qe([n]),i=>[n].concat(FE(i))),Yk=n=>Mu(n).fold(Qe([n]),i=>ti(i)==="br"?Sa(i).map(c=>[n].concat(Yk(c))).getOr([]):[n].concat(Yk(i))),wO=(n,i)=>ri(LE(i),fP(i),(c,m)=>{const p=oo(FE(n),He(vt,c)),w=oo(Yk(n),He(vt,m));return p.isSome()&&w.isSome()}).getOr(!1),Xk=(n,i,c,m)=>{const p=c,w=new _i(c,p),x=Wt(n.schema.getMoveCaretBeforeOnEnterElements(),(B,q)=>!kt(["td","th","table"],q.toLowerCase()));let M=c;do{if(_n(M)&&gn.trim(M.data).length!==0){m?i.setStart(M,0):i.setEnd(M,M.data.length);return}if(x[M.nodeName]){m?i.setStartBefore(M):M.nodeName==="BR"?i.setEndBefore(M):i.setEndAfter(M);return}}while(M=m?w.next():w.prev());p.nodeName==="BODY"&&(m?i.setStart(p,0):i.setEnd(p,p.childNodes.length))},K_=n=>{const i=n.selection.getSel();return Oe(i)&&i.rangeCount>0},jk=(n,i)=>{const c=xb(n);c.length>0?Ne(c,m=>{const p=m.dom,w=n.dom.createRng();w.setStartBefore(p),w.setEndAfter(p),i(w,!0)}):i(n.selection.getRng(),!1)},QE=(n,i,c)=>{const m=Sr(n,i);c(m),n.moveToBookmark(m)},D2=n=>Xe(n==null?void 0:n.nodeType),qk=n=>Jn(n)&&!Wd(n)&&!qc(n)&&!Pd(n),dP=(n,i)=>{if(qk(i)&&!/^(TD|TH)$/.test(i.nodeName)){const c=n.getAttrib(i,"data-mce-selected"),m=parseInt(c,10);return!isNaN(m)&&m>0}else return!1},vm=n=>n.isContentEditable===!0,ZE=(n,i,c)=>{const{selection:m,dom:p}=n,w=m.getNode(),x=Es(w);QE(m,!0,()=>{i()}),x&&Es(w)&&p.isChildOf(w,n.getBody())?n.selection.select(w):c(m.getStart())&&hP(p,m)},hP=(n,i)=>{var c,m;const p=i.getRng(),{startContainer:w,startOffset:x}=p,M=i.getNode();if(!dP(n,M)&&Jn(w)){const B=w.childNodes,q=n.getRoot();let ae;if(x<B.length){const fe=B[x];ae=new _i(fe,(c=n.getParent(fe,n.isBlock))!==null&&c!==void 0?c:q)}else{const fe=B[B.length-1];ae=new _i(fe,(m=n.getParent(fe,n.isBlock))!==null&&m!==void 0?m:q),ae.next(!0)}for(let fe=ae.current();fe;fe=ae.next()){if(n.getContentEditable(fe)==="false")return;if(_n(fe)&&!sc(fe)){p.setStart(fe,0),i.setRng(p);return}}}},Gn=(n,i,c)=>{if(n){const m=i?"nextSibling":"previousSibling";for(n=c?n:n[m];n;n=n[m])if(Jn(n)||!sc(n))return n}},Wl=(n,i)=>!!n.getTextBlockElements()[i.nodeName.toLowerCase()]||ig(n,i),Om=(n,i,c)=>n.schema.isValidChild(i,c),sc=(n,i=!1)=>{if(Oe(n)&&_n(n)){const c=i?n.data.replace(/ /g,"\xA0"):n.data;return eg(c)}else return!1},ym=n=>Oe(n)&&_n(n)&&n.length===0,HE=(n,i)=>{const c="[data-mce-cef-wrappable]",m=M0(n),p=ol(m)?c:`${c},${m}`;return Pu(Ke.fromDom(i),p)},P2=(n,i)=>{const c=n.dom;return qk(i)&&c.getContentEditable(i)==="false"&&HE(n,i)&&c.select('[contenteditable="true"]',i).length===0},Ph=(n,i)=>ce(n)?n(i):(Oe(i)&&(n=n.replace(/%(\w+)/g,(c,m)=>i[m]||c)),n),J_=(n,i)=>(n=n||"",i=i||"",n=""+(n.nodeName||n),i=""+(i.nodeName||i),n.toLowerCase()===i.toLowerCase()),M2=(n,i)=>{if(Re(n))return null;{let c=String(n);return(i==="color"||i==="backgroundColor")&&(c=G_(c)),i==="fontWeight"&&n===700&&(c="bold"),i==="fontFamily"&&(c=c.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),c}},R2=(n,i,c)=>{const m=n.getStyle(i,c);return M2(m,c)},Gk=(n,i)=>{let c;return n.getParent(i,m=>Jn(m)?(c=n.getStyle(m,"text-decoration"),!!c&&c!=="none"):!1),c},$2=(n,i,c)=>n.getParents(i,c,n.getRoot()),eS=(n,i,c)=>{const m=n.formatter.get(i);return Oe(m)&&jt(m,c)},Kk=(n,i)=>eS(n,i,m=>{const p=w=>ce(w)||w.length>1&&w.charAt(0)==="%";return jt(["styles","attributes"],w=>wo(m,w).exists(x=>{const M=oe(x)?x:po(x);return jt(M,p)}))}),mP=(n,i,c)=>{const m=["inline","block","selector","attributes","styles","classes"],p=w=>Wt(w,(x,M)=>jt(m,B=>B===M));return eS(n,i,w=>{const x=p(w);return eS(n,c,M=>{const B=p(M);return xo(x,B)})})},wm=n=>os(n, Line truncated
]*|<br \\/>[\r
]*)$`);return i.replace(m,"")},tW=(n,i)=>{const c=n.getDoc(),m=ql(Ke.fromDom(n.getBody())),p=Ke.fromTag("div",c);Pr(p,"data-mce-bogus","all"),ua(p,{position:"fixed",left:"-9999999px",top:"0"}),Mf(p,i.innerHTML),p3(p),HI(p);const w=X1(m);na(w,p);const x=In(p.dom.innerText);return wr(p),x},nW=(n,i,c)=>{let m;return i.format==="raw"?m=gn.trim(JV(n.serializer,c.innerHTML)):i.format==="text"?m=tW(n,c):i.format==="tree"?m=n.serializer.serialize(c,i):m=eW(n,n.serializer.serialize(c,i)),i.format!=="text"&&!lu(Ke.fromDom(c))&&L(m)?gn.trim(m):m},oW=(n,i)=>he.from(n.getBody()).fold(Qe(i.format==="tree"?new Xd("body",11):""),c=>nW(n,i,c)),bx=gn.makeMap,jP=n=>{const i=[];n=n||{};const c=n.indent,m=bx(n.indent_before||""),p=bx(n.indent_after||""),w=sp.getEncodeFunc(n.entity_encoding||"raw",n.entities),x=n.element_format!=="xhtml";return{start:(M,B,q)=>{if(c&&m[M]&&i.length>0){const ae=i[i.length-1];ae.length>0&&ae!==`
`&&i.push(`
`)}if(i.push("<",M),B)for(let ae=0,fe=B.length;ae<fe;ae++){const be=B[ae];i.push(" ",be.name,'="',w(be.value,!0),'"')}if(!q||x?i[i.length]=">":i[i.length]=" />",q&&c&&p[M]&&i.length>0){const ae=i[i.length-1];ae.length>0&&ae!==`
`&&i.push(`
`)}},end:M=>{let B;i.push("</",M,">"),c&&p[M]&&i.length>0&&(B=i[i.length-1],B.length>0&&B!==`
`&&i.push(`
`))},text:(M,B)=>{M.length>0&&(i[i.length]=B?M:w(M))},cdata:M=>{i.push("<![CDATA[",M,"]]>")},comment:M=>{i.push("<!--",M,"-->")},pi:(M,B)=>{B?i.push("<?",M," ",w(B),"?>"):i.push("<?",M,"?>"),c&&i.push(`
`)},doctype:M=>{i.push("<!DOCTYPE",M,">",c?`
`:"")},reset:()=>{i.length=0},getContent:()=>i.join("").replace(/\n$/,"")}},Y2=(n={},i=wh())=>{const c=jP(n);return n.validate="validate"in n?n.validate:!0,{serialize:p=>{const w=n.validate,x={3:B=>{var q;c.text((q=B.value)!==null&&q!==void 0?q:"",B.raw)},8:B=>{var q;c.comment((q=B.value)!==null&&q!==void 0?q:"")},7:B=>{c.pi(B.name,B.value)},10:B=>{var q;c.doctype((q=B.value)!==null&&q!==void 0?q:"")},4:B=>{var q;c.cdata((q=B.value)!==null&&q!==void 0?q:"")},11:B=>{let q=B;if(q=q.firstChild)do M(q);while(q=q.next)}};c.reset();const M=B=>{var q;const ae=x[B.type];if(ae)ae(B);else{const fe=B.name,be=fe in i.getVoidElements();let Le=B.attributes;if(w&&Le&&Le.length>1){const Ye=[];Ye.map={};const Me=i.getElementRule(B.name);if(Me){for(let Ve=0,gt=Me.attributesOrder.length;Ve<gt;Ve++){const Ot=Me.attributesOrder[Ve];if(Ot in Le.map){const wt=Le.map[Ot];Ye.map[Ot]=wt,Ye.push({name:Ot,value:wt})}}for(let Ve=0,gt=Le.length;Ve<gt;Ve++){const Ot=Le[Ve].name;if(!(Ot in Ye.map)){const wt=Le.map[Ot];Ye.map[Ot]=wt,Ye.push({name:Ot,value:wt})}}Le=Ye}}if(c.start(fe,Le,be),!be){let Ye=B.firstChild;if(Ye){(fe==="pre"||fe==="textarea")&&Ye.type===3&&((q=Ye.value)===null||q===void 0?void 0:q[0])===`
`&&c.text(`
`,!0);do M(Ye);while(Ye=Ye.next)}c.end(fe)}}};return p.type===1&&!n.inner?M(p):p.type===3?x[3](p):x[11](p),c.getContent()}}},zI=new Set;Ne(["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"],i=>{zI.add(i)});const gs=["font","text-decoration","text-emphasis"],qP=(n,i)=>bs(n.parseStyle(n.getAttrib(i,"style"))),xs=n=>zI.has(n),VI=(n,i)=>tr(qP(n,i),c=>!xs(c)),yie=n=>At(n,i=>jt(gs,c=>Ar(i,c))),wie=(n,i,c)=>{const m=qP(n,i),p=qP(n,c),w=x=>{var M,B;const q=(M=n.getStyle(i,x))!==null&&M!==void 0?M:"",ae=(B=n.getStyle(c,x))!==null&&B!==void 0?B:"";return yr(q)&&yr(ae)&&q!==ae};return jt(m,x=>{const M=B=>jt(B,q=>q===x);if(!M(p)&&M(gs)){const B=yie(p);return jt(B,w)}else return w(x)})},WI=(n,i,c)=>he.from(c.container()).filter(_n).exists(m=>{const p=n?0:-1;return i(m.data.charAt(c.offset()+p))}),UI=He(WI,!0,Dh),YI=He(WI,!1,Dh),sW=n=>{const i=n.container();return _n(i)&&(i.data.length===0||Sn(i.data)&&_O.isBookmarkNode(i.parentNode))},EO=(n,i)=>c=>wb(n?0:-1,c).filter(i).isSome(),ns=n=>Ui(n)&&Bi(Ke.fromDom(n),"display")==="block",XI=n=>Es(n)&&!bl(n),rW=EO(!0,ns),iW=EO(!1,ns),j0=EO(!0,sf),vS=EO(!1,sf),jI=EO(!0,Iu),qI=EO(!1,Iu),AO=EO(!0,XI),q0=EO(!1,XI),aW=n=>n.slice(0,-1),_ie=(n,i,c)=>cn(i,n)?aW(oh(n,m=>c(m)||vt(m,i))):[],lW=(n,i)=>_ie(n,i,je),G0=(n,i)=>[n].concat(lW(n,i)),GP=(n,i,c)=>Nk(n,i,c,sW),GI=(n,i)=>oo(G0(Ke.fromDom(i.container()),n),hc),KI=(n,i,c)=>GP(n,i.dom,c).forall(m=>GI(i,c).fold(()=>!Hd(m,c,i.dom),p=>!Hd(m,c,i.dom)&&cn(p,Ke.fromDom(m.container())))),KP=(n,i,c)=>GI(i,c).fold(()=>GP(n,i.dom,c).forall(m=>!Hd(m,c,i.dom)),m=>GP(n,m.dom,c).isNone()),JP=He(KP,!1),Ms=He(KP,!0),JI=He(KI,!1),b3=He(KI,!0),eB=n=>We(n).exists(au),vx=(n,i,c)=>{const m=At(G0(Ke.fromDom(c.container()),i),hc),p=$o(m).getOr(i);return zd(n,p.dom,c).filter(eB)},v3=(n,i)=>We(i).exists(au)||vx(!0,n,i).isSome(),O3=(n,i)=>ht(i).exists(au)||vx(!1,n,i).isSome(),tB=He(vx,!1),cW=He(vx,!0),e5=n=>Vt.isTextPosition(n)&&!n.isAtStart()&&!n.isAtEnd(),nB=(n,i)=>{const c=At(G0(Ke.fromDom(i.container()),n),hc);return $o(c).getOr(n)},oB=(n,i)=>e5(i)?YI(i):YI(i)||Hu(nB(n,i).dom,i).exists(YI),sB=(n,i)=>e5(i)?UI(i):UI(i)||Hf(nB(n,i).dom,i).exists(UI),uW=n=>kt(["pre","pre-wrap"],n),t5=n=>We(n).bind(i=>Zl(i,kl)).exists(i=>uW(Bi(i,"white-space"))),fW=(n,i)=>Hu(n.dom,i).isNone(),dW=(n,i)=>Hf(n.dom,i).isNone(),hW=(n,i)=>fW(n,i)||dW(n,i)||JP(n,i)||Ms(n,i)||O3(n,i)||v3(n,i),n5=n=>Oe(n)&&Es(n)&&Y_(n),y3=(n,i)=>c=>n5(new _i(c,n)[i]()),mW=(n,i)=>{const c=Hf(n.dom,i).getOr(i),m=y3(n.dom,"next");return i.isAtEnd()&&(m(i.container())||m(c.container()))},gW=(n,i)=>{const c=Hu(n.dom,i).getOr(i),m=y3(n.dom,"prev");return i.isAtStart()&&(m(i.container())||m(c.container()))},rB=(n,i)=>t5(i)?!1:hW(n,i)||oB(n,i)||sB(n,i),Ox=(n,i)=>t5(i)?!1:JP(n,i)||JI(n,i)||O3(n,i)||oB(n,i)||gW(n,i),pW=n=>{const i=n.container(),c=n.offset();return _n(i)&&c<i.data.length?Vt(i,c+1):n},yx=(n,i)=>t5(i)?!1:Ms(n,i)||b3(n,i)||v3(n,i)||sB(n,i)||mW(n,i),o5=(n,i)=>Ox(n,i)||yx(n,pW(i)),iB=(n,i)=>Gs(n.charAt(i)),s5=(n,i)=>Dh(n.charAt(i)),bW=n=>{const i=n.container();return _n(i)&&nr(i.data,Kr)},vW=n=>{const i=n.split("");return pt(i,(c,m)=>Gs(c)&&m>0&&m<i.length-1&&kb(i[m-1])&&kb(i[m+1])?" ":c).join("")},DO=(n,i,c)=>{const m=i.data,p=Vt(i,0);return!c&&iB(m,0)&&!o5(n,p)?(i.data=" "+m.slice(1),!0):c&&s5(m,0)&&Ox(n,p)?(i.data=Kr+m.slice(1),!0):!1},OW=n=>{const i=n.data,c=vW(i);return c!==i?(n.data=c,!0):!1},r5=(n,i,c)=>{const m=i.data,p=Vt(i,m.length-1);return!c&&iB(m,m.length-1)&&!o5(n,p)?(i.data=m.slice(0,-1)+" ",!0):c&&s5(m,m.length-1)&&yx(n,p)?(i.data=m.slice(0,-1)+Kr,!0):!1},yW=(n,i)=>{const c=i.container();if(!_n(c))return he.none();if(bW(i)){const m=DO(n,c,!1)||OW(c)||r5(n,c,!1);return ks(m,i)}else if(o5(n,i)){const m=DO(n,c,!0)||r5(n,c,!0);return ks(m,i)}else return he.none()},wW=n=>{const i=Ke.fromDom(n.getBody());n.selection.isCollapsed()&&yW(i,Vt.fromRangeStart(n.selection.getRng())).each(c=>{n.selection.setRng(c.toRange())})},i5=(n,i,c)=>{if(c===0)return;const m=Ke.fromDom(n),p=di(m,hc).getOr(m),w=n.data.slice(i,i+c),x=i+c>=n.data.length&&yx(p,Vt(n,n.data.length)),M=i===0&&Ox(p,Vt(n,0));n.replaceData(i,c,mh(w,4,M,x))},wx=(n,i)=>{const c=n.data.slice(i),m=c.length-nu(c).length;i5(n,i,m)},w3=(n,i)=>{const c=n.data.slice(0,i),m=c.length-xu(c).length;i5(n,i-m,m)},_3=(n,i,c,m=!0)=>{const p=xu(n.data).length,w=m?n:i,x=m?i:n;return m?w.appendData(x.data):w.insertData(0,x.data),wr(K Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var E8=Object.hasOwnProperty,Zx=Object.setPrototypeOf,$U=Object.isFrozen,NU=Object.getPrototypeOf,NO=Object.getOwnPropertyDescriptor,gd=Object.freeze,p1=Object.seal,Hx=Object.create,rM=typeof Reflect<"u"&&Reflect,RS=rM.apply,X3=rM.construct;RS||(RS=function(i,c,m){return i.apply(c,m)}),gd||(gd=function(i){return i}),p1||(p1=function(i){return i}),X3||(X3=function(i,c){return Qx(i,g1(c))});var A8=Tg(Array.prototype.forEach),IU=Tg(Array.prototype.pop),zx=Tg(Array.prototype.push),j3=Tg(String.prototype.toLowerCase),iM=Tg(String.prototype.match),IO=Tg(String.prototype.replace),D8=Tg(String.prototype.indexOf),BU=Tg(String.prototype.trim),Nh=Tg(RegExp.prototype.test),aM=zf(TypeError);function Tg(n){return function(i){for(var c=arguments.length,m=new Array(c>1?c-1:0),p=1;p<c;p++)m[p-1]=arguments[p];return RS(n,i,m)}}function zf(n){return function(){for(var i=arguments.length,c=new Array(i),m=0;m<i;m++)c[m]=arguments[m];return X3(n,c)}}function Fi(n,i){Zx&&Zx(n,null);for(var c=i.length;c--;){var m=i[c];if(typeof m=="string"){var p=j3(m);p!==m&&($U(i)||(i[c]=p),m=p)}n[m]=!0}return n}function Ab(n){var i=Hx(null),c;for(c in n)RS(E8,n,[c])&&(i[c]=n[c]);return i}function Db(n,i){for(;n!==null;){var c=NO(n,i);if(c){if(c.get)return Tg(c.get);if(typeof c.value=="function")return Tg(c.value)}n=NU(n)}function m(p){return console.warn("fallback value for",p),null}return m}var lM=gd(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),pd=gd(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),sv=gd(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),P8=gd(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),cM=gd(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),M8=gd(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),R8=gd(["#text"]),uM=gd(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),iw=gd(["accent-height","accumulate","additive","alignment-baseline","as Line truncated
`+vd),Us&&(vd=IO(vd,Ws," "),vd=IO(vd,Ir," ")),Pt&&qd?Pt.createHTML(vd):vd},i.setConfig=function(Hs){UT(Hs),Ja=!0},i.clearConfig=function(){Ov=null,Ja=!1},i.isValidAttribute=function(Hs,Xt,So){Ov||UT({});var ws=Ib(Hs),Sl=Ib(Xt);return YT(ws,Sl,So)},i.addHook=function(Hs,Xt){typeof Xt=="function"&&(Cs[Hs]=Cs[Hs]||[],zx(Cs[Hs],Xt))},i.removeHook=function(Hs){if(Cs[Hs])return IU(Cs[Hs])},i.removeHooks=function(Hs){Cs[Hs]&&(Cs[Hs]=[])},i.removeAllHooks=function(){Cs={}},i}var N8=K3();const gM=gn.each,I8=gn.trim,HU=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],zU={ftp:21,http:80,https:443,mailto:25},VU=["img","video"],WU=(n,i)=>Oe(n)?!n:Oe(i)?!kt(VU,i):!0,UU=n=>{try{return decodeURIComponent(n)}catch{return unescape(n)}},pM=(n,i,c)=>{const m=UU(i).replace(/\s/g,"");return n.allow_script_urls?!1:/((java|vb)script|mhtml):/i.test(m)?!0:n.allow_html_data_urls?!1:/^data:image\//i.test(m)?WU(n.allow_svg_data_urls,c)&&/^data:image\/svg\+xml/i.test(m):/^data:/i.test(m)};class b1{static parseDataUri(i){let c;const m=decodeURIComponent(i).split(","),p=/data:([^;]+)/.exec(m[0]);return p&&(c=p[1]),{type:c,data:m[1]}}static isDomSafe(i,c,m={}){if(m.allow_script_urls)return!0;{const p=sp.decode(i).replace(/[\s\u0000-\u001F]+/g,"");return!pM(m,p,c)}}static getDocumentBaseUrl(i){var c;let m;return i.protocol.indexOf("http")!==0&&i.protocol!=="file:"?m=(c=i.href)!==null&&c!==void 0?c:"":m=i.protocol+"//"+i.host+i.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(m)&&(m=m.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(m)||(m+="/")),m}constructor(i,c={}){this.path="",this.directory="",i=I8(i),this.settings=c;const m=c.base_uri,p=this;if(/^([\w\-]+):([^\/]{2})/i.test(i)||/^\s*#/.test(i)){p.source=i;return}const w=i.indexOf("//")===0;if(i.indexOf("/")===0&&!w&&(i=(m&&m.protocol||"http")+"://mce_host"+i),!/^[\w\-]*:?\/\//.test(i)){const M=m?m.path:new b1(document.location.href).directory;if((m==null?void 0:m.protocol)==="")i="//mce_host"+p.toAbsPath(M,i);else{const B=/([^#?]*)([#?]?.*)/.exec(i);B&&(i=(m&&m.protocol||"http")+"://mce_host"+p.toAbsPath(M,B[1])+B[2])}}i=i.replace(/@@/g,"(mce_at)");const x=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(i);x&&gM(HU,(M,B)=>{let q=x[B];q&&(q=q.replace(/\(mce_at\)/g,"@@")),p[M]=q}),m&&(p.protocol||(p.protocol=m.protocol),p.userInfo||(p.userInfo=m.userInfo),!p.port&&p.host==="mce_host"&&(p.port=m.port),(!p.host||p.host==="mce_host")&&(p.host=m.host),p.source=""),w&&(p.protocol="")}setPath(i){const c=/^(.*?)\/?(\w+)?$/.exec(i);c&&(this.path=c[0],this.directory=c[1],this.file=c[2]),this.source="",this.getURI()}toRelative(i){if(i==="./")return i;const c=new b1(i,{base_uri:this});if(c.host!=="mce_host"&&this.host!==c.host&&c.host||this.port!==c.port||this.protocol!==c.protocol&&c.protocol!=="")return c.getURI();const m=this.getURI(),p=c.getURI();if(m===p||m.charAt(m.length-1)==="/"&&m.substr(0,m.length-1)===p)return m;let w=this.toRelPath(this.path,c.path);return c.query&&(w+="?"+c.query),c.anchor&&(w+="#"+c.anchor),w}toAbsolute(i,c){const m=new b1(i,{base_uri:this});return m.getURI(c&&this.isSameOrigin(m))}isSameOrigin(i){if(this.host==i.host&&this.protocol==i.protocol){if(this.port==i.port)return!0;const c=this.protocol?zU[this.protocol]:null;if(c&&(this.port||c)==(i.port||c))return!0}return!1}toRelPath(i,c){let m=0,p="",w,x;const M=i.substring(0,i.lastIndexOf("/")).split("/"),B=c.split("/");if(M.length>=B.length){for(w=0,x=M.length;w<x;w++)if(w>=B.length||M[w]!==B[w]){m=w+1;break}}if(M.length<B.length){for(w=0,x=B.length;w<x;w++)if(w>=M.length||M[w]!==B[w]){m=w+1;break}}if(m===1)return c;for(w=0,x=M.length-(m-1);w<x;w++)p+="../";for(w=m-1,x=B.length;w<x;w++)w!==m-1?p+="/"+B[w]:p+=B[w];return p}toAbsPath(i,c){let m=0;const p=/\/$/.test(c)?"/":"",w=i.split("/"),x=c.split("/"),M=[];gM(w,fe=>{fe&&M.push(fe)});const B=[];for(let fe=x.length-1;fe>=0;fe--)if(!(x[fe].length===0||x[fe]===".")){if(x[fe]===".."){m++;continue}if(m>0){m--;continue}B.push(x[fe])}const q=M.length-m;let ae;return q<=0?ae=Xs(B).join("/"):ae=M.slice(0,q).join("/")+"/"+Xs(B).join("/"),ae.indexOf("/")!==0&&(ae="/"+ae),p&&ae.lastIndexOf("/")!==ae.length-1&&(ae+=p),ae}getURI(i=!1){let c;return(!this.source||i)&&(c="",i||(this.protocol?c+=this.protocol+"://":c+="//",this.userInfo&&(c+=this.userInfo+"@"),this.host&&(c+=this.host),this.port&&(c+=":"+this.port)),this.path&&(c+=this.path),this.query&&(c+="?"+this.query),this.anchor&&(c+="#"+this.anchor),this.source=c),this.source}}const YU=gn.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),bM="data-mce-type";let vM=0;const J3=(n,i,c,m)=>{var p,w,x,M;const B=i.validate,q=c.getSpecialElements();n.nodeType===Gu&&!i.allow_conditional_comments&&/^\[if/i.test((p=n.nodeValue)!==null&&p!==void 0?p:"")&&(n.nodeV Line truncated
`).replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"");let M=m.length;for(;M--;){const B=m[M],q=B.firstChild,ae=(w=q==null?void 0:q.value)!==null&&w!==void 0?w:"";if(p==="script"){const fe=B.attr("type");fe&&B.attr("type",fe==="mce-no/type"?null:fe.replace(/^mce\-/,"")),i.element_format==="xhtml"&&q&&ae.length>0&&(q.value=`// <![CDATA[
`+x(ae)+`
// ]]>`)}else i.element_format==="xhtml"&&q&&ae.length>0&&(q.value=`<!--
`+x(ae)+`
-->`)}}),n.addNodeFilter("#comment",m=>{let p=m.length;for(;p--;){const w=m[p],x=w.value;i.preserve_cdata&&(x==null?void 0:x.indexOf("[CDATA["))===0?(w.name="#cdata",w.type=4,w.value=c.decode(x.replace(/^\[CDATA\[|\]\]$/g,""))):(x==null?void 0:x.indexOf("mce:protected "))===0&&(w.name="#text",w.type=3,w.raw=!0,w.value=unescape(x).substr(14))}}),n.addNodeFilter("xml:namespace,input",(m,p)=>{let w=m.length;for(;w--;){const x=m[w];x.type===7?x.remove():x.type===1&&p==="input"&&!x.attr("type")&&x.attr("type","text")}}),n.addAttributeFilter("data-mce-type",m=>{Ne(m,p=>{p.attr("data-mce-type")==="format-caret"&&(p.isEmpty(n.schema.getNonEmptyElements())?p.remove():p.unwrap())})}),n.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-block,data-mce-type,data-mce-resize,data-mce-placeholder",(m,p)=>{let w=m.length;for(;w--;)m[w].attr(p,null)}),i.remove_trailing_brs&&tM(i,n,n.schema)},ZY=n=>{const i=m=>(m==null?void 0:m.name)==="br",c=n.lastChild;if(i(c)){const m=c.prev;i(m)&&(c.remove(),m.remove())}},SL=(n,i,c)=>{let m;const p=n.dom;let w=i.cloneNode(!0);const x=document.implementation;if(x.createHTMLDocument){const M=x.createHTMLDocument("");gn.each(w.nodeName==="BODY"?w.childNodes:[w],B=>{M.body.appendChild(M.importNode(B,!0))}),w.nodeName!=="BODY"?w=M.body.firstChild:w=M.body,m=p.doc,p.doc=M}return XE(n,{...c,node:w}),m&&(p.doc=m),w},CL=(n,i)=>Oe(n)&&n.hasEventListeners("PreProcess")&&!i.no_events,kL=(n,i,c)=>CL(n,c)?SL(n,i,c):i,xL=(n,i,c)=>{gn.inArray(i,c)===-1&&(n.addAttributeFilter(c,(m,p)=>{let w=m.length;for(;w--;)m[w].attr(p,null)}),i.push(c))},QM=(n,i,c)=>!i.no_events&&n?rx(n,{...i,content:c}).content:c,Bie=(n,i,c)=>{const m=In(c.getInner?i.innerHTML:n.getOuterHTML(i));return c.selection||lu(Ke.fromDom(i))?m:gn.trim(m)},HY=(n,i,c)=>{const m=c.selection?{forced_root_block:!1,...c}:c,p=n.parse(i,m);return ZY(p),p},Lie=(n,i,c)=>Y2(n,i).serialize(c),zY=(n,i,c,m,p)=>{const w=Lie(i,c,m);return QM(n,p,w)},VY=(n,i)=>{const c=["data-mce-selected"],m={entity_encoding:"named",remove_trailing_brs:!0,pad_empty_with_br:!1,...n},p=i&&i.dom?i.dom:Qr.DOM,w=i&&i.schema?i.schema:wh(m),x=$S(m,w);QY(x,m,p);const M=(B,q={})=>{const ae={format:"html",...q},fe=kL(i,B,ae),be=Bie(p,fe,ae),Le=HY(x,be,ae);return ae.format==="tree"?Le:zY(i,m,w,Le,ae)};return{schema:w,addNodeFilter:x.addNodeFilter,addAttributeFilter:x.addAttributeFilter,serialize:M,addRules:w.addValidElements,setRules:w.setValidElements,addTempAttr:He(xL,x,c),getTempAttrs:Qe(c),getNodeFilters:x.getNodeFilters,getAttributeFilters:x.getAttributeFilters,removeNodeFilter:x.removeNodeFilter,removeAttributeFilter:x.removeAttributeFilter}},O1=(n,i)=>{const c=VY(n,i);return{schema:c.schema,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,serialize:c.serialize,addRules:c.addRules,setRules:c.setRules,addTempAttr:c.addTempAttr,getTempAttrs:c.getTempAttrs,getNodeFilters:c.getNodeFilters,getAttributeFilters:c.getAttributeFilters,removeNodeFilter:c.removeNodeFilter,removeAttributeFilter:c.removeAttributeFilter}},Fie="html",Qie=(n,i)=>({...n,format:i,get:!0,getInner:!0}),WY=(n,i={})=>{const c=i.format?i.format:Fie,m=Qie(i,c);return V8(n,m).fold(Bt,p=>{const w=$Y(n,p);return W8(n,w,p)})},Xx="html",UY=(n,i)=>({format:Xx,...n,set:!0,content:i}),rA=(n,i,c={})=>{const m=UY(c,i);return _M(n,m).map(p=>{const w=NY(n,p.content,p);return SM(n,w.html,p),w.content}).getOr(i)},TL="autoresize_on_init,content_editable_state,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,tabfocus_elements,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_enable_default_filters,paste_filter_drop,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists".split(","),EL="template_cdate_classes,template_mdate_classes,template_selected_content_classes,template_preview_replace_values,template_replace_values,templates,template_cdate_format,template_mdate_format".split(","),YY="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),AL=[{name:"template",replacedWith:"Advanced Template"},{name:"rtc"}],av=(n,i)=>{const c=At(i,m=>fn(n,m));return Ns(c)},XY=n=>{const i=av(n,TL),c=n.forced_root_block;return(c===!1||c==="")&&i.push("forced_root_block (false only)"),Ns(i)},jY=n=>av(n,EL),DL=(n,i)=>{const c=gn.makeMap(n.plugins," "),p=At(i,w=>fn(c,w));return Ns(p)},qY=n=>DL(n,YY),GY=n=>DL(n,AL.map(i=>i.name)),KY=(n,i)=>{const c=XY(n),m=qY(i),p=m.length>0,w=c.length>0,x=i.theme==="mobile";if(p||w||x){const M=`
- `,B=x?`
Themes:${M}mobile`:"",q=p?`
Plugins:${M}${m.join(M)}`:"",ae=w?`
Options:${M}${c.join(M)}`:"";console.warn("The following deprecated features are currently enabled and have been removed in TinyMCE 6.0. These features will no longer work and should be removed from the TinyMCE configuration. See https://www.tiny.cloud/docs/tinymce/6/migration-from-5x/ for more information."+B+q+ae)}},JY=n=>oo(AL,i=>i.name===n).fold(()=>n,i=>i.replacedWith?`${n}, replaced by ${i.replacedWith}`:n),eX=(n,i)=>{const c=jY(n),m=GY(i),p=m.length>0,w=c.length>0;if(p||w){const x=`
- `,M=p?`
Plugins:${x}${m.map(JY).join(x)}`:"",B=w?`
Options:${x}${c.join(x)}`:"";console.warn("The following deprecated features are currently enabled but will be removed soon."+M+B)}},tX=(n,i)=>{KY(n,i),eX(n,i)},iA=Qr.DOM,nX=n=>{iA.setStyle(n.id,"display",n.orgDisplay)},ZM=n=>he.from(n).each(i=>i.destroy()),jx=n=>{const i=n;i.contentAreaContainer=i.formElement=i.container=i.editorContainer=null,i.bodyElement=i.contentDocument=i.contentWindow=null,i.iframeElement=i.targetElm=null;const c=n.selection;if(c){const m=c.dom;i.selection=c.win=c.dom=m.doc=null}},oX=n=>{const i=n.formElement;i&&(i._mceOldSubmit&&(i.submit=i._mceOldSubmit,delete i._mceOldSubmit),iA.unbind(i,"submit reset",n.formEventDelegate))},HM=n=>{if(!n.removed){const{_selectionOverrides:i,editorUpload:c}=n,m=n.getBody(),p=n.getElement();m&&n.save({is_removing:!0}),n.removed=!0,n.unbindAllNativeEvents(),n.hasHiddenInput&&Oe(p==null?void 0:p.nextSibling)&&iA.remove(p.nextSibling),jE(n),n.editorManager.remove(n),!n.inline&&m&&nX(n),sS(n),iA.remove(n.getContainer()),ZM(i),ZM(c),n.destroy()}},sX=(n,i)=>{const{selection:c,dom:m}=n;if(!n.destroyed){if(!i&&!n.removed){n.remove();return}i||(n.editorManager.off("beforeunload",n._beforeUnload),n.theme&&n.theme.destroy&&n.theme.destroy(),ZM(c),ZM(m)),oX(n),jx(n),n.destroyed=!0}},aA=(()=>{const n={};return{add:(p,w)=>{n[p]=w},get:p=>n[p]?n[p]:{icons:{}},has:p=>fn(n,p)}})(),LS=Ia.ModelManager,LO=(n,i)=>i.dom[n],FO=(n,i)=>parseInt(Bi(i,n),10),lA=He(LO,"clientWidth"),cA=He(LO,"clientHeight"),cw=He(FO,"margin-top"),uw=He(FO,"margin-left"),uA=n=>n.dom.getBoundingClientRect(),fA=(n,i,c)=>{const m=lA(n),p=cA(n);return i>=0&&c>=0&&i<=m&&c<=p},PL=(n,i,c,m)=>{const p=uA(i),w=n?p.left+i.dom.clientLeft+uw(i):0,x=n?p.top+i.dom.clientTop+cw(i):0,M=c-w,B=m-x;return{x:M,y:B}},zM=(n,i,c)=>{const m=Ke.fromDom(n.getBody()),p=n.inline?m:or(m),w=PL(n.inline,p,i,c);return fA(p,w.x,w.y)},VM=n=>he.from(n).map(Ke.fromDom),ML=n=>{const i=n.inline?n.getBody():n.getContentAreaContainer();return VM(i).map(Ed).getOr(!1)};var RL=()=>{const n=()=>{throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:n,close:n,getArgs:n}};const fw=n=>{const i=[],c=()=>{const be=n.theme;return be&&be.getNotificationManagerImpl?be.getNotificationManagerImpl():RL()},m=()=>he.from(i[0]),p=(be,Le)=>be.type===Le.type&&be.text===Le.text&&!be.progressBar&&!be.timeout&&!Le.progressBar&&!Le.timeout,w=()=>{Ne(i,be=>{be.reposition()})},x=be=>{i.push(be)},M=be=>{Ss(i,Le=>Le===be).each(Le=>{i.splice(Le,1)})},B=(be,Le=!0)=>n.removed||!ML(n)?{}:(Le&&n.dispatch("BeforeOpenNotification",{notification:be}),oo(i,Ye=>p(c().getArgs(Ye),be)).getOrThunk(()=>{n.editorManager.setActive(n);const Ye=c().open(be,()=>{M(Ye),w(),m().fold(()=>n.focus(),Me=>X0(Ke.fromDom(Me.getEl())))});return x(Ye),w(),n.dispatch("OpenNotification",{notification:{...Ye}}),Ye})),q=()=>{m().each(be=>{c().close(be),M(be),w()})},ae=Qe(i);return(be=>{be.on("SkinLoaded",()=>{const Le=A_(be);Le&&B({text:Le,type:"warning",timeout:0},!1),w()}),be.on("show ResizeEditor ResizeWindow NodeChange",()=>{requestAnimationFrame(w)}),be.on("remove",()=>{Ne(i.slice(),Le=>{c().close(Le)})})})(n),{open:B,close:q,getNotifications:ae}},dw=Ia.PluginManager,QO=Ia.ThemeManager;var $L=()=>{const n=()=>{throw new Error("Theme did not provide a WindowManager implementation.")};return{open:n,openUrl:n,alert:n,confirm:n,close:n}};const qx=n=>{let i=[];const c=()=>{const Me=n.theme;return Me&&Me.getWindowManagerImpl?Me.getWindowManagerImpl():$L()},m=(Me,Ve)=>(...gt)=>Ve?Ve.apply(Me,gt):void 0,p=Me=>{n.dispatch("OpenWindow",{dialog:Me})},w=Me=>{n.dispatch("CloseWindow",{dialog:Me})},x=Me=>{i.push(Me),p(Me)},M=Me=>{w(Me),i=At(i,Ve=>Ve!==Me),i.length===0&&n.focus()},B=()=>he.from(i[i.length-1]),q=Me=>{n.editorManager.setActive(n),zP(n),n.ui.show();const Ve=Me();return x(Ve),Ve},ae=(Me,Ve)=>q(()=>c().open(Me,Ve,M)),fe=Me=>q(()=>c().openUrl(Me,M)),be=(Me,Ve,gt)=>{const Ot=c();Ot.alert(Me,m(gt||Ot,Ve))},Le=(Me,Ve,gt)=>{const Ot=c();Ot.confirm(Me,m(gt||Ot,Ve))},Ye=()=>{B().each(Me=>{c().close(Me),M(Me)})};return n.on("remove",()=>{Ne(i,Me=>{c().close(Me)})}),{open:ae,openUrl:fe,alert:be,confirm:Le,close:Ye}},WM=(n,i)=>{n.notificationManager.open({type:"error",text:i})},Gx=(n,i)=>{n._skinLoaded?WM(n,i):n.on("SkinLoaded",()=>{WM(n,i)})},NL=(n,i)=>{Gx(n,id.translate(["Failed to upload image: {0}",i]))},FS=(n,i,c)=>{rS(n,i,{message:c}),console.error(c)},Ag=(n,i,c)=>c?`Failed to load ${n}: ${c} from url ${i}`:`Failed to load ${n} url: ${i}`,ZO=(n,i,c)=>{FS(n,"PluginLoadError",Ag("plugin",i,c))},xp=(n,i,c)=>{FS(n,"IconsLoadError",Ag("icons",i,c))},rX=(n,i,c)=>{FS(n,"LanguageLoadError",Ag("language",i,c))},iX=(n,i,c)=>{FS(n,"ThemeLoadError",Ag("theme",i,c))},aX=(n,i,c)=>{FS(n,"ModelLoadError",Ag("model",i,c))},lX=(n,i,c)=>{const m=id.translate(["Failed to initialize plugin: {0}",i]);rS(n,"PluginLoadError",{message:m}),dA(m,c),Gx(n,m)},dA=(n,...i)=>{const c=window.console;c&&(c.error?c.error(n,...i):c.log(n,...i))},cX=n=>/^[a-z0-9\-]+$/i.test(n),uX=n=>IL(n,E_(n)) Line truncated
\r \v`.indexOf(n)!==-1,qR=(n,i)=>n.substring(i.length),vq=(n,i,c)=>{let m;const p=c.charAt(0);for(m=i-1;m>=0;m--){const w=n.charAt(m);if(wF(w))return he.none();if(p===w&&nr(n,c,m,i))break}return he.some(m)},_F=(n,i,c,m=0)=>{if(!bq(i))return he.none();const p={text:"",offset:0},w=(M,B,q)=>(p.text=q+p.text,p.offset+=B,vq(p.text,p.offset,c).getOr(B)),x=n.getParent(i.startContainer,n.isBlock)||n.getRoot();return XR(n,i.startContainer,i.startOffset,w,x).bind(M=>{const B=i.cloneRange();if(B.setStart(M.container,M.offset),B.setEnd(i.endContainer,i.endOffset),B.collapsed)return he.none();const q=jR(B);return q.lastIndexOf(c)!==0||qR(q,c).length<m?he.none():he.some({text:qR(q,c),range:B,trigger:c})})},GR=(n,i,c,m=0)=>XV(Ke.fromDom(i.startContainer)).fold(()=>_F(n,i,c,m),p=>{const w=n.createRng();w.selectNode(p.dom);const x=jR(w);return he.some({range:w,text:qR(x,c),trigger:c})}),Oq=n=>n.nodeType===eh,yq=n=>n.nodeType===qf,SF=n=>{if(Oq(n))return Dp(n,n.data.length);{const i=n.childNodes;return i.length>0?SF(i[i.length-1]):Dp(n,i.length)}},CF=(n,i)=>{const c=n.childNodes;return c.length>0&&i<c.length?CF(c[i],0):c.length>0&&yq(n)&&c.length===i?SF(c[c.length-1]):Dp(n,i)},wq=(n,i)=>{var c;const m=(c=n.getParent(i.container,n.isBlock))!==null&&c!==void 0?c:n.getRoot();return XR(n,i.container,i.offset,(p,w)=>w===0?-1:w,m).filter(p=>{const w=p.container.data.charAt(p.offset-1);return!wF(w)}).isSome()},_q=n=>i=>{const c=CF(i.startContainer,i.startOffset);return!wq(n,c)},Sq=(n,i,c)=>Ls(c.triggers,m=>GR(n,i,m)),Cq=(n,i)=>{const c=i(),m=n.selection.getRng();return Sq(n.dom,m,c).bind(p=>kq(n,i,p))},kq=(n,i,c,m={})=>{var p;const w=i(),M=(p=n.selection.getRng().startContainer.nodeValue)!==null&&p!==void 0?p:"",B=At(w.lookupByTrigger(c.trigger),ae=>c.text.length>=ae.minChars&&ae.matches.getOrThunk(()=>_q(n.dom))(c.range,M,c.text));if(B.length===0)return he.none();const q=Promise.all(pt(B,ae=>ae.fetch(c.text,ae.maxResults,m).then(be=>({matchText:c.text,items:be,columns:ae.columns,onAction:ae.onAction,highlightOn:ae.highlightOn}))));return he.some({lookupData:q,context:c})};var _1;(function(n){n[n.Error=0]="Error",n[n.Value=1]="Value"})(_1||(_1={}));const YS=(n,i,c)=>n.stype===_1.Error?i(n.serror):c(n.svalue),kF=n=>{const i=[],c=[];return Ne(n,m=>{YS(m,p=>c.push(p),p=>i.push(p))}),{values:i,errors:c}},xF=(n,i)=>n.stype===_1.Error?{stype:_1.Error,serror:i(n.serror)}:n,xq=(n,i)=>n.stype===_1.Value?{stype:_1.Value,svalue:i(n.svalue)}:n,TF=(n,i)=>n.stype===_1.Value?i(n.svalue):n,EF=(n,i)=>n.stype===_1.Error?i(n.serror):n,AF=n=>({stype:_1.Value,svalue:n}),DF=n=>({stype:_1.Error,serror:n}),Xu={fromResult:n=>n.fold(DF,AF),toResult:n=>YS(n,bc.error,bc.value),svalue:AF,partition:kF,serror:DF,bind:TF,bindError:EF,map:xq,mapError:xF,fold:YS},pT=n=>te(n)&&bs(n).length>100?" removed due to size":JSON.stringify(n,null,2),Eq=n=>{const i=n.length>10?n.slice(0,10).concat([{path:[],getErrorInfo:Qe("... (only showing first ten failures)")}]):n;return pt(i,c=>"Failed path: ("+c.path.join(" > ")+`)
`+c.getErrorInfo())},GA=(n,i)=>Xu.serror([{path:n,getErrorInfo:i}]),Aq=(n,i,c)=>GA(n,()=>'Could not find valid *required* value for "'+i+'" in '+pT(c)),PF=(n,i)=>GA(n,()=>'Choice schema did not contain choice key: "'+i+'"'),Dq=(n,i,c)=>GA(n,()=>'The chosen schema: "'+c+'" did not exist in branches: '+pT(i)),Pq=(n,i)=>GA(n,Qe(i)),Mq=(n,i,c,m)=>wo(c,m).fold(()=>Dq(n,c,m),w=>w.extract(n.concat(["branch: "+m]),i)),Rq=(n,i)=>({extract:(p,w)=>wo(w,n).fold(()=>PF(p,n),M=>Mq(p,w,i,M)),toString:()=>"chooseOn("+n+"). Possible values: "+bs(i)}),$q=(n,i)=>i,Rc=(n,i)=>ne(n)&&ne(i)?KA(n,i):i,S1=n=>(...i)=>{if(i.length===0)throw new Error("Can't merge zero objects");const c={};for(let m=0;m<i.length;m++){const p=i[m];for(const w in p)fn(p,w)&&(c[w]=n(c[w],p[w]))}return c},KA=S1(Rc),tae=S1($q),MF=()=>({tag:"required",process:{}}),Nq=n=>({tag:"defaultedThunk",process:n}),RF=n=>Nq(Qe(n)),Iq=()=>({tag:"option",process:{}}),$F=(n,i)=>n.length>0?Xu.svalue(KA(i,tae.apply(void 0,n))):Xu.svalue(i),gw=n=>V(Xu.serror,Mr)(n),Bq={consolidateObj:(n,i)=>{const c=Xu.partition(n);return c.errors.length>0?gw(c.errors):$F(c.values,i)},consolidateArr:n=>{const i=Xu.partition(n);return i.errors.length>0?gw(i.errors):Xu.svalue(i.values)}},C1=(n,i,c,m)=>({tag:"field",key:n,newKey:i,presence:c,prop:m}),Lq=(n,i)=>({tag:"custom",newKey:n,instantiator:i}),NF=(n,i,c)=>{switch(n.tag){case"field":return i(n.key,n.newKey,n.presence,n.prop);case"custom":return c(n.newKey,n.instantiator)}},JA=n=>{const i=(m,p)=>Xu.bindError(n(p),w=>Pq(m,w)),c=Qe("val");return{extract:i,toString:c}},Fq=JA(Xu.svalue),KR=(n,i,c,m)=>wo(i,c).fold(()=>Aq(n,c,i),m),JR=(n,i,c,m)=>{const p=wo(n,i).getOrThunk(()=>c(n));return m(p)},Qq=(n,i,c)=>c(wo(n,i)),Zq=(n,i,c,m)=>{const p=wo(n,i).map(w=>w===!0?c(n):w);return m(p)},Hq=(n,i,c,m,p)=>{const w=M=>p.extract(i.concat([m]),M),x=M=>M.fold(()=>Xu.svalue(he.none()),B=>{const q=p.extract(i.concat([m]),B);return Xu.map(q,he.some)});switch(n.tag){case"required":return KR(i,c,m,w);case"defaultedThunk":return JR(c,m,n.process,w);case"option":return Qq(c,m,x);case"defaultedOptionThunk":return Zq(c,m,n.process,x);case"mergeWithThunk":return JR(c,m,Qe({}),M=>{const B=KA(n.process(c),M);return w(B)})}},IF=(n,i,c)=>{const m={},p=[];for(const w of c)NF(w,(x,M,B,q)=>{const ae=Hq(B,n,i,x,q);Xu.fold(ae,fe=>{p.push(...fe)},fe=>{m[M]=fe})},(x,M)=>{m[x]=M(i)});return p.length>0?Xu.serror(p):Xu.svalue(m)},e4=n=>({extract:(m,p)=>IF(m,p,n),toString:()=>`obj{
`+pt(n,p=>NF(p,(w,x,M,B)=>w+" -> "+B.toString(),(w,x)=>"state("+w+")")).join(`
`)+"}"}),t4=n=>({extract:(m,p)=>{const w=pt(p,(x,M)=>n.extract(m.concat(["["+M+"]"]),x));return Bq.consolidateArr(w)},toString:()=>"array("+n.toString()+")"}),e$=n=>JA(i=>n(i).fold(Xu.serror,Xu.svalue)),t$=(n,i,c)=>{const m=i.extract([n],c);return Xu.mapError(m,p=>({input:c,errors:p}))},zq=(n,i,c)=>Xu.toResult(t$(n,i,c)),Vq=n=>`Errors:
`+Eq(n.errors).join(`
`)+`
Input object: `+pT(n.input),BF=(n,i)=>Rq(n,vs(i,e4)),Wq=Qe(Fq),XS=(n,i)=>JA(c=>{const m=typeof c;return n(c)?Xu.svalue(c):Xu.serror(`Expected type: ${i} but got: ${m}`)}),LF=XS(Xe,"number"),n4=XS(L,"string"),FF=XS(we,"boolean"),n$=XS(ce,"function"),pw=C1,QF=Lq,Uq=n=>e$(i=>kt(n,i)?bc.value(i):bc.error(`Unsupported value: "${i}", choose one of "${n.join(", ")}".`)),ZF=(n,i)=>pw(n,n,MF(),i),HF=n=>ZF(n,n4),zF=n=>ZF(n,n$),VF=(n,i)=>pw(n,n,MF(),t4(i)),bT=(n,i)=>pw(n,n,Iq(),i),vT=n=>bT(n,n4),WF=n=>bT(n,n$),Yq=(n,i)=>pw(n,n,RF(i),Wq()),jS=(n,i,c)=>pw(n,n,RF(i),c),UF=(n,i)=>jS(n,i,LF),o4=(n,i)=>jS(n,i,n4),o$=(n,i,c)=>jS(n,i,Uq(c)),s4=(n,i)=>jS(n,i,FF),s$=(n,i)=>jS(n,i,n$),Xq=(n,i,c)=>jS(n,i,t4(c)),oae=HF("type"),sae=zF("fetch"),YF=zF("onAction"),jq=s$("onSetup",()=>ot),rae=vT("text"),qq=vT("icon"),Gq=vT("tooltip"),iae=vT("label"),Kq=s4("active",!1),_l=s4("enabled",!0),r4=s4("primary",!1),$b=n=>Yq("columns",n),qS=n=>o4("type",n),XF=e4([oae,HF("trigger"),UF("minChars",1),$b(1),UF("maxResults",10),WF("matches"),sae,YF,Xq("highlightOn",[],n4)]),Jq=n=>zq("Autocompleter",XF,{trigger:n.ch,...n}),GS=[_l,Gq,qq,rae,jq],i4=[Kq].concat(GS),jF=[s$("predicate",je),o$("scope","node",["node","editor"]),o$("position","selection",["node","selection","line"])],qF=GS.concat([qS("contextformbutton"),r4,YF,QF("original",Bt)]),eG=i4.concat([qS("contextformbutton"),r4,YF,QF("original",Bt)]),tG=GS.concat([qS("contextformbutton")]),nG=i4.concat([qS("contextformtogglebutton")]),oG=BF("type",{contextformbutton:qF,contextformtogglebutton:eG});e4([qS("contextform"),s$("initValue",Qe("")),iae,VF("commands",oG),bT("launch",BF("type",{contextformbutton:tG,contextformtogglebutton:nG}))].concat(jF));const sG=n=>{const i=n.ui.registry.getAll().popups,c=vs(i,x=>Jq(x).fold(M=>{throw new Error(Vq(M))},Bt)),m=fs(Yn(c,x=>x.trigger)),p=po(c);return{dataset:c,triggers:m,lookupByTrigger:x=>At(p,M=>M.trigger===x)}},GF=(n,i)=>{const c=zv(i.load,50);n.on("keypress compositionend",m=>{m.which!==27&&c.throttle()}),n.on("keydown",m=>{const p=m.which;p===8?c.throttle():p===27&&i.cancelIfNecessary()}),n.on("remove",c.cancel)},rG=n=>{const i=Sh(),c=Ga(!1),m=i.isSet,p=()=>{m()&&(BY(n),cr(n),c.set(!1),i.clear())},w=q=>{m()||(Ka(n,q.range),i.set({trigger:q.trigger,matchLength:q.text.length}))},x=Ut(()=>sG(n)),M=q=>i.get().map(ae=>GR(n.dom,n.selection.getRng(),ae.trigger).bind(fe=>kq(n,x,fe,q))).getOrThunk(()=>Cq(n,x)),B=q=>{M(q).fold(p,ae=>{w(ae.context),ae.lookupData.then(fe=>{i.get().map(be=>{const Le=ae.context;be.trigger===Le.trigger&&(Le.text.length-be.matchLength>=10?p():(i.set({...be,matchLength:Le.text.length}),c.get()?CP(n,{lookupData:fe}):(c.set(!0),SP(n,{lookupData:fe}))))})})})};n.addCommand("mceAutocompleterReload",(q,ae)=>{const fe=te(ae)?ae.fetchOptions:{};B(fe)}),n.addCommand("mceAutocompleterClose",p),GF(n,{cancelIfNecessary:p,load:B})},iG=ys().browser.isSafari(),KF=n=>Pe(Ke.fromDom(n)),JF=(n,i)=>{var c;return n.startOffset===0&&n.endOffset===((c=i.textContent)===null||c===void 0?void 0:c.length)},OT=(n,i)=>he.from(n.getParent(i.container(),"details")),r$=(n,i)=>OT(n,i).isSome(),aG=(n,i)=>{const c=he.from(n.getParent(i.startContainer,"details")),m=he.from(n.getParent(i.endContainer,"details"));if(c.isSome()||m.isSome()){const p=c.bind(w=>he.from(n.select("summary",w)[0]));return he.some({startSummary:p,startDetails:c,endDetails:m})}else return he.none()},lG=(n,i)=>cl(i).exists(c=>c.isEqual(n)),lae=(n,i)=>Vd(i).exists(c=>mi(c.getNode())&&Hu(i,c).exists(m=>m.isEqual(n))||c.isEqual(n)),i$=(n,i)=>i.startSummary.exists(c=>lG(n,c)),cG=(n,i)=>i.startSummary.exists(c=>lae(n,c)),uG=(n,i)=>i.startDetails.exists(c=>Hu(c,n).forall(m=>i.startSummary.exists(p=>!p.contains(n.container())&&p.contains(m.container())))),fG=(n,i,c)=>c.startDetails.exists(m=>Hf(n,i).forall(p=>!m.contains(p.container()))),a$=(n,i)=>{const c=i.getNode();ve(c)||n.selection.setCursorLocation(c,i.offset())},e9=(n,i,c)=>{const m=n.dom.getParent(i.container(),"details");if(m&&!m.open){const p=n.dom.select("summary",m)[0];p&&(c?cl(p):Vd(p)).each(x=>a$(n,x))}else a$(n,i)},t9=(n,i)=>{const c=B=>B.contains(n.startContainer),m=B=>B.contains(n.endContainer),p=i.startSummary.exists(c),w=i.startSummary.exists(m),x=i.startDetails.forall(B=>i.endDetails.forall(q=>B!==q));return(p||w)&&!(p&&w)||x},n9=(n,i,c)=>{const{dom:m,selection:p}=n,w=n.getBody();if(c==="character"){const x=Vt.fromRangeStart(p.getRng()),M=m.getParent(x.container(),m.isBlock),B=OT(m,x),q=M&&m.isEmpty(M),ae=G(M==null?void 0:M.previousSibling),fe=G(M==null?void 0:M.nextSibling);return q&&(i?fe:ae)&&Sb(!i,w,x).exists(Ye=>r$(m,Ye)&&!Ll(B,OT(m,Ye)))?!0:Sb(i,w,x).fold(je,be=>{const Le=OT(m,be);if(r$(m,be)&&!Ll(B,Le)){if(i||e9(n,be,!1),M&&q){if(i&&ae)return!0;if(!i&&fe)return!0;e9(n,be,i),n.dom.remove(M)}return!0}else return!1})}else return!1},dG=(n,i,c,m)=>{const w=n.selection.getRng(),x=Vt.fromRangeStart(w),M=n.getBody();return m==="selection"?t9(w,i):c?cG(x,i)||fG(M,x,i):i$(x,i)||uG(x,i)},cae=(n,i,c)=>aG(n.dom,n.selection.getRng()).fold(()=> Line truncated
`;return}if(q!=="wbr"){if(p[q]&&(m+=" "),w[q]){m+=" ";return}if(B.type===3&&(m+=B.value),!(B.name in i.getVoidElements())){let fe=B.firstChild;if(fe)do M(fe);while(fe=fe.next)}x[q]&&ae.next&&(m+=`
`,q==="p"&&(m+=`
`))}};return n=kT(n,[/<!\[[^\]]+\]>/g]),M(c.parse(n)),m},E$=n=>(n=kT(n,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/ig,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,(c,m,p)=>!m&&!p?" ":Kr],/<br class="Apple-interchange-newline">/g,/<br>$/i]),n),wK=n=>{let i=0;return()=>n+i++},_K=n=>{const i=n.toLowerCase(),c={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"};return gn.hasOwn(c,i)?"image/"+c[i]:"image/"+i},SK=(n,i)=>{const c=$S({sanitize:cO(n)},n.schema);c.addNodeFilter("meta",p=>{gn.each(p,w=>{w.remove()})});const m=c.parse(i,{forced_root_block:!1,isRootContent:!0});return Y2({validate:!0},n.schema).serialize(m)},Y9=(n,i)=>({content:n,cancelled:i}),CK=(n,i,c)=>{const m=n.dom.create("div",{style:"display:none"},i),p=KE(n,m,c);return Y9(p.node.innerHTML,p.isDefaultPrevented())},kK=(n,i,c)=>{const m=kP(n,i,c),p=SK(n,m.content);return n.hasEventListeners("PastePostProcess")&&!m.isDefaultPrevented()?CK(n,p,c):Y9(p,m.isDefaultPrevented())},X9=(n,i,c)=>kK(n,i,c),A$=(n,i)=>(n.insertContent(i,{merge:Q_(n),paste:!0}),!0),D$=n=>/^https?:\/\/[\w\-\/+=.,!;:&%@^~(){}?#]+$/i.test(n),xK=(n,i)=>D$(i)&&jt(v2(n),c=>Ki(i.toLowerCase(),`.${c.toLowerCase()}`)),TK=(n,i,c)=>(n.undoManager.extra(()=>{c(n,i)},()=>{n.insertContent('<img src="'+i+'">')}),!0),EK=(n,i,c)=>(n.undoManager.extra(()=>{c(n,i)},()=>{n.execCommand("mceInsertLink",!1,i)}),!0),AK=(n,i,c)=>!n.selection.isCollapsed()&&D$(i)?EK(n,i,c):!1,DK=(n,i,c)=>xK(n,i)?TK(n,i,c):!1,j9=(n,i)=>{gn.each([AK,DK,A$],c=>!c(n,i,A$))},PK=(n,i,c)=>{c||!Z_(n)?A$(n,i):j9(n,i)},MK=wK("mceclip"),RK=n=>{const i=S$();return O4(i,n),_$(i),i},q9=(n,i,c,m,p)=>{const w=X9(n,i,c);if(!w.cancelled){const x=w.content,M=()=>PK(n,x,m);p?a4(n,"insertFromPaste",{dataTransfer:RK(x)}).isDefaultPrevented()||(M(),yT(n,"insertFromPaste")):M()}},w4=(n,i,c,m)=>{const p=c||k$(i);q9(n,V9(i),p,!1,m)},P$=(n,i,c)=>{const m=n.dom.encode(i).replace(/\r\n/g,`
`),p=mh(m,wk(n)),w=gK(p,jc(n),db(n));q9(n,w,!1,!0,c)},G9=n=>{const i={};if(n&&n.types)for(let c=0;c<n.types.length;c++){const m=n.types[c];try{i[m]=n.getData(m)}catch{i[m]=""}}return i},k1=(n,i)=>i in n&&n[i].length>0,M$=n=>k1(n,"text/html")||k1(n,"text/plain"),$K=(n,i)=>{const c=i.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return Oe(c)?n.dom.encode(c[1]):void 0},K9=(n,i,c,m)=>{const p=MK(),w=ud(n)&&Oe(c.name),x=w?$K(n,c.name):p,M=w?c.name:void 0,B=i.create(p,c,m,x,M);return i.add(B),B},J9=(n,i)=>{nM(i.uri).each(({data:c,type:m,base64Encoded:p})=>{const w=p?c:btoa(c),x=i.file,M=n.editorUpload.blobCache,B=M.getByData(w,m),q=B!=null?B:K9(n,M,x,w);w4(n,`<img src="${q.blobUri()}">`,!1,!0)})},R$=n=>n.type==="paste",NK=n=>Promise.all(pt(n,i=>O8(i).then(c=>({file:i,uri:c})))),eQ=n=>{const i=v2(n);return c=>Ar(c.type,"image/")&&jt(i,m=>_K(m)===c.type)},IK=(n,i)=>{const c=i.items?$s(Rr(i.items),p=>p.kind==="file"?[p.getAsFile()]:[]):[],m=i.files?Rr(i.files):[];return At(c.length>0?c:m,eQ(n))},$$=(n,i,c)=>{const m=R$(i)?i.clipboardData:i.dataTransfer;if(aO(n)&&m){const p=IK(n,m);if(p.length>0)return i.preventDefault(),NK(p).then(w=>{c&&n.selection.setRng(c),Ne(w,x=>{J9(n,x)})}),!0}return!1},BK=n=>{var i,c;return qn.os.isAndroid()&&((c=(i=n.clipboardData)===null||i===void 0?void 0:i.items)===null||c===void 0?void 0:c.length)===0},tQ=n=>to.metaKeyPressed(n)&&n.keyCode===86||n.shiftKey&&n.keyCode===45,N$=(n,i,c,m,p)=>{let w=E$(c);const x=k1(i,CT())||k$(c),M=!x&&hK(w),B=D$(w);(U9(w)||!w.length||M&&!B)&&(m=!0),(m||B)&&(k1(i,"text/plain")&&M?w=i["text/plain"]:w=yK(w)),!U9(w)&&(m?P$(n,w,p):w4(n,w,x,p))},LK=(n,i,c)=>{let m;const p=()=>i.getLastRng()||n.selection.getRng();n.on("keydown",w=>{tQ(w)&&!w.isDefaultPrevented()&&(m=w.shiftKey&&w.keyCode===86)}),n.on("paste",w=>{if(w.isDefaultPrevented()||BK(w))return;const x=c.get()==="text"||m;m=!1;const M=G9(w.clipboardData);!M$(M)&&$$(n,w,p())||(k1(M,"text/html")?(w.preventDefault(),N$(n,M,M["text/html"],x,!0)):k1(M,"text/plain")&&k1(M,"text/uri-list")?(w.preventDefault(),N$(n,M,M["text/plain"],x,!0)):(i.create(),_g.setEditorTimeout(n,()=>{const B=i.getHtml();i.remove(),N$(n,M,B,x,!1)},0)))})},FK=n=>{const i=p=>Ar(p,"webkit-fake-url"),c=p=>Ar(p,"data:"),m=p=>{var w;return((w=p.data)===null||w===void 0?void 0:w.paste)===!0};n.parser.addNodeFilter("img",(p,w,x)=>{if(!aO(n)&&m(x))for(const M of p){const B=M.attr("src");L(B)&&!M.attr("data-mce-object")&&B!==qn.transparentSrc&&(i(B)||!_k(n)&&c(B))&&M.remove()}})},xT=(n,i,c)=>{LK(n,i,c),FK(n)},QK=(n,i)=>{i.get()==="text"?(i.set("html"),iS(n,!1)):(i.set("text"),iS(n,!0)),n.focus()},ZK=(n,i)=>{n.addCommand("mceTogglePlainTextPaste",()=>{QK(n,i)}),n.addCommand("mceInsertClipboardContent",(c,m)=>{m.html&&w4(n,m.html,m.internal,!1),m.text&&P$(n,m.text,!1)})},nQ=(n,i,c)=>{if(n)try{return n.clearData(),n.setData("text/html",i),n.setData("text/plain",c),n.setData(CT(),i),!0}catch{return!1}else return!1},oQ=(n,i,c,m)=>{nQ(n.clipboardData,i.html,i.text)?(n.preventDefault(),m()):c(i.html,m)},sQ=n=>(i,c)=>{const{dom:m,selection:p}=n,w=m.create("div",{contenteditable:"false","data-mce-bogus":"all"}),x=m.create("div",{contenteditable:"true"},i);m.setStyles(w,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),w.appendChild(x),m.add(n.getBody(),w);const M=p.getRng();x.focus();const B=m.createRng();B.selectNodeContents(x),p.setRng(B),_g.setEditorTimeout(n,()=>{p.setRng(M),m.remove(w),c()},0)},rQ=n=>({html:dK(n.selection.getContent({contextual:!0})),text:n.selection.getContent({format:"text"})}),HK=n=>!!n.dom.getParent(n.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",n.getBody()),iQ=n=>!n.selection.isCollapsed()||HK(n),_4=n=>i=>{!i.isDefaultPrevented()&&iQ(n)&&oQ(i,rQ(n),sQ(n),()=>{if(qn.browser.isChromium()||qn.browser.isFirefox()){const c=n.selection.getRng();_g.setEditorTimeout(n,()=>{n.selection.setRng(c),n.execCommand("Delete")},0)}else n.execCommand("Delete")})},aQ=n=>i=>{!i.isDefaultPrevented()&&iQ(n)&&oQ(i,rQ(n),sQ(n),ot)},lQ=n=>{n.on("cut",_4(n)),n.on("copy",aQ(n))},cQ=(n,i)=>{var c,m;return O.getCaretRangeFromPoint((c=i.clientX)!==null&&c!==void 0?c:0,(m=i.clientY)!==null&&m!==void 0?m:0,n.getDoc())},zK=n=>{const i=n["text/plain"];return i?i.indexOf("file://")===0:!1},uQ=(n,i)=>{n.focus(),i&&n.selection.setRng(i)},hae=n=>jt(n.files,i=>/^image\//.test(i.type)),VK=(n,i,c,m)=>{const p=n.getParent(c,x=>ig(i,x));if(!G(n.getParent(c,"summary")))return!0;if(p&&fn(m,"text/html")){const x=new DOMParser().parseFromString(m["text/html"],"text/html").body;return!G(x.querySelector(p.nodeName.toLowerCase()))}else return!1},I$=n=>{n.on("input",i=>{const c=m=>G(m.querySelector("summary"));if(i.inputType==="deleteByDrag"){const m=At(n.dom.select("details"),c);Ne(m,p=>{mi(p.firstChild)&&p.firstChild.remove();const w=n.dom.create("summary");w.appendChild(ye().dom),p.prepend(w)})}})},B$=(n,i)=>{B_(n)&&n.on("dragend dragover draggesture dragdrop drop drag",c=>{c.preventDefault(),c.stopPropagation()}),aO(n)||n.on("drop",c=>{ Line truncated
`}),n.dom.addStyle(B)}const x=Promise.all(YJ(n,m,c)).then(w).catch(w),M=nO(n);return M&&VJ(n,M),x},XJ=n=>{const i=n.getDoc(),c=n.getBody();wP(n),pp(n)||(i.body.spellcheck=!1,iN.setAttrib(c,"spellcheck","false")),n.quirks=HQ(n),ix(n);const m=mb(n);m!==void 0&&(c.dir=m);const p=m2(n);p&&n.on("BeforeSetContent",w=>{gn.each(p,x=>{w.content=w.content.replace(x,M=>"<!--mce:protected "+escape(M)+"-->")})}),n.on("SetContent",()=>{n.addVisual(n.getBody())}),n.on("compositionstart compositionend",w=>{n.composing=w.type==="compositionstart"})},YQ=n=>{Mb(n)||n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"})},lN=n=>{n.removed!==!0&&(YQ(n),UJ(n))},jJ=n=>{let i=!1;const c=setTimeout(()=>{i||n.setProgressState(!0)},500);return()=>{clearTimeout(c),i=!0,n.setProgressState(!1)}},XQ=n=>{const i=n.getElement();let c=n.getDoc();n.inline&&(iN.addClass(i,"mce-content-body"),n.contentDocument=c=document,n.contentWindow=window,n.bodyElement=i,n.contentAreaContainer=i);const m=n.getBody();m.disabled=!0,n.readonly=bg(n),n._editableRoot=R_(n),!n.readonly&&n.hasEditableRoot()&&(n.inline&&iN.getStyle(m,"position",!0)==="static"&&(m.style.position="relative"),m.contentEditable="true"),m.disabled=!1,n.editorUpload=bX(n),n.schema=wh(RT(n)),n.dom=Qr(c,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,update_styles:!0,root_element:n.inline?n.getBody():null,collect:n.inline,schema:n.schema,contentCssCors:lk(n),referrerPolicy:hb(n),onSetAttrib:x=>{n.dispatch("SetAttrib",x)}}),n.parser=_w(n),n.serializer=O1(XO(n),n),n.selection=FM(n.dom,n.getWin(),n.serializer,n),n.annotator=u1(n),n.formatter=VL(n),n.undoManager=GM(n),n._nodeChangeDispatcher=new nK(n),n._selectionOverrides=PJ(n),MR(n),dQ(n),Bj(n),Mb(n)||(nJ(n),sC(n));const p=tK(n);LA(n,p),Gie(n),kX(n),fQ(n);const w=wY(n);XJ(n),w.fold(()=>{const x=jJ(n);UQ(n).then(()=>{lN(n),x()})},x=>{n.setProgressState(!0),UQ(n).then(()=>{x().then(M=>{n.setProgressState(!1),lN(n),OL(n)},M=>{n.notificationManager.open({type:"error",text:String(M)}),lN(n),OL(n)})})})},gae=mt,qJ=(n,i,c)=>t0(n,i,gae,c),$T=Qr.DOM,GJ=(n,i,c,m)=>{const p=Ke.fromTag("iframe");return m.each(w=>Pr(p,"tabindex",w)),Ju(p,c),Ju(p,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:i}),ef(p,"tox-edit-area__iframe"),p},KJ=n=>{let i=Kv(n)+"<html><head>";i1(n)!==n.documentBaseUrl&&(i+='<base href="'+n.documentBaseURI.getURI()+'" />'),i+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';const c=Qf(n),m=al(n),p=n.translate(N_(n));return Qd(n)&&(i+='<meta http-equiv="Content-Security-Policy" content="'+Qd(n)+'" />'),i+=`</head><body id="${c}" class="mce-content-body ${m}" data-id="${n.id}" aria-label="${p}"><br></body></html>`,i},jQ=(n,i)=>{const c=n.translate("Rich Text Area"),m=Va(Ke.fromDom(n.getElement()),"tabindex").bind(ou),p=GJ(n.id,c,gf(n),m).dom;p.onload=()=>{p.onload=null,n.dispatch("load")},n.contentAreaContainer=i.iframeContainer,n.iframeElement=p,n.iframeHTML=KJ(n),$T.add(i.iframeContainer,p)},JJ=n=>{const i=n.iframeElement,c=()=>{n.contentDocument=i.contentDocument,XQ(n)};if(N0(n)||qn.browser.isFirefox()){const m=n.getDoc();m.open(),m.write(n.iframeHTML),m.close(),c()}else{const m=qJ(Ke.fromDom(i),"load",()=>{m.unbind(),c()});i.srcdoc=n.iframeHTML}},qQ=(n,i)=>{jQ(n,i),i.editorContainer&&(i.editorContainer.style.display=n.orgDisplay,n.hidden=$T.isHidden(i.editorContainer)),n.getElement().style.display="none",$T.setAttrib(n.id,"aria-hidden","true"),n.getElement().style.visibility=n.orgVisibility,JJ(n)},GQ=Qr.DOM,cN=(n,i,c)=>{const m=dw.get(c),p=dw.urls[c]||n.documentBaseUrl.replace(/\/$/,"");if(c=gn.trim(c),m&&gn.inArray(i,c)===-1){if(n.plugins[c])return;try{const w=m(n,p)||{};n.plugins[c]=w,ce(w.init)&&(w.init(n,p),i.push(c))}catch(w){lX(n,c,w)}}},eee=n=>n.replace(/^\-/,""),tee=n=>{const i=[];Ne(sO(n),c=>{cN(n,i,eee(c))})},nee=n=>{const i=gn.trim(C_(n)),c=n.ui.registry.getAll().icons,m={...aA.get("default").icons,...aA.get(i).icons};ln(m,(p,w)=>{fn(c,w)||n.ui.registry.addIcon(w,p)})},oee=n=>{const i=mm(n);if(L(i)){const c=QO.get(i);n.theme=c(n,QO.urls[i])||{},ce(n.theme.init)&&n.theme.init(n,QO.urls[i]||n.documentBaseUrl.replace(/\/$/,""))}else n.theme={}},KQ=n=>{const i=oc(n),c=LS.get(i);n.model=c(n,LS.urls[i])},uN=n=>{const i=n.theme.renderUI;return i?i():ree(n)},JQ=n=>{const i=n.getElement(),m=mm(n)(n,i);return m.editorContainer.nodeType&&(m.editorContainer.id=m.editorContainer.id||n.id+"_parent"),m.iframeContainer&&m.iframeContainer.nodeType&&(m.iframeContainer.id=m.iframeContainer.id||n.id+"_iframecontainer"),m.height=m.iframeHeight?m.iframeHeight:i.offsetHeight,m},P4=(n,i)=>({editorContainer:n,iframeContainer:i,api:{}}),see=n=>{const i=GQ.create("div");return GQ.insertAfter(i,n),P4(i,i)},ree=n=>{const i=n.getElement();return n.inline?P4(null):see(i)},pae=n=>{const i=n.getElement();return n.orgDisplay=i.style.display,L(mm(n))?uN(n):ce(mm(n))?JQ(n):ree(n)},iee=(n,i)=>{const c={show:he.from(i.show).getOr(ot),hide:he.from(i.hide).getOr(ot),isEnabled:he.from(iLine truncated
Actual: `+Xn.join(","));if(!Yo(k,sn=>ut(Xn,sn)))throw new Error("Not all branches were specified when using match. Specified: "+Xn.join(", ")+`
Required: `+k.join(", "));return dn[pe].apply(null,Fe)},log:dn=>{console.log(dn,{constructors:k,constructor:pe,params:Fe})}}}}),D}},hf={...dg.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])},cb=(O,k)=>O.length===0?hf.none():O.length===1?hf.only(0):k===0?hf.left(0,1):k===O.length-1?hf.right(k-1,k):k>0&&k<O.length-1?hf.middle(k-1,k,k+1):hf.none(),qs=(O,k,D,N,Y)=>{const se=O.slice(0),pe=cb(O,k),Ee=L(Ct(se,L(0))),Fe=Xn=>N.singleColumnWidth(se[Xn],D),rt=(Xn,Wn)=>Y.calcLeftEdgeDeltas(se,Xn,Wn,D,N.minCellWidth(),N.isRelative),_t=(Xn,Wn,sn)=>Y.calcMiddleDeltas(se,Xn,Wn,sn,D,N.minCellWidth(),N.isRelative),dn=(Xn,Wn)=>Y.calcRightEdgeDeltas(se,Xn,Wn,D,N.minCellWidth(),N.isRelative);return pe.fold(Ee,Fe,rt,_t,dn)},pu=(O,k,D)=>{let N=0;for(let Y=O;Y<k;Y++)N+=D[Y]!==void 0?D[Y]:0;return N},hg=(O,k)=>{const D=Ae.justCells(O);return Ct(D,N=>{const Y=pu(N.column,N.column+N.colspan,k);return{element:N.element,width:Y,colspan:N.colspan}})},Gy=(O,k)=>{const D=Ae.justColumns(O);return Ct(D,(N,Y)=>({element:N.element,width:k[Y],colspan:N.colspan}))},Yi=(O,k)=>{const D=Ae.justCells(O);return Ct(D,N=>{const Y=pu(N.row,N.row+N.rowspan,k);return{element:N.element,height:Y,rowspan:N.rowspan}})},Ky=(O,k)=>Ct(O.all,(D,N)=>({element:D.element,height:k[N]})),mg=O=>Cn(O,(k,D)=>k+D,0),Oa=(O,k)=>Ae.hasColumns(O)?Gy(O,k):hg(O,k),fm=(O,k,D)=>{const N=Oa(O,k);He(N,Y=>{D.setElementWidth(Y.element,Y.width)})},Vt=(O,k,D,N,Y)=>{const se=Ae.fromTable(O),pe=Y.getCellDelta(k),Ee=Y.getWidths(se,Y),Fe=D===se.grid.columns-1,rt=N.clampTableDelta(Ee,D,pe,Y.minCellWidth(),Fe),_t=qs(Ee,D,rt,Y,N),dn=Ct(_t,(Xn,Wn)=>Xn+Ee[Wn]);fm(se,dn,Y),N.resizeTable(Y.adjustTableWidth,rt,Fe)},T0=(O,k,D,N)=>{const Y=Ae.fromTable(O),se=xt(Y,O,N),pe=Ct(se,(_t,dn)=>D===dn?Math.max(k+_t,fc()):_t),Ee=Yi(Y,pe),Fe=Ky(Y,pe);He(Fe,_t=>{of(_t.element,_t.height)}),He(Ee,_t=>{of(_t.element,_t.height)});const rt=mg(pe);of(O,rt)},Jy=(O,k,D,N,Y)=>{const se=Ae.generate(k),pe=N.getWidths(se,N),Ee=N.pixelWidth(),{newSizes:Fe,delta:rt}=Y.calcRedestributedWidths(pe,Ee,D.pixelDelta,N.isRelative);fm(se,Fe,N),N.adjustTableWidth(rt)},E0=(O,k,D,N)=>{const Y=Ae.generate(k),se=N.getWidths(Y,N);fm(Y,se,N)},Ch=O=>je(O,(D,N)=>Qe(D,se=>se.column===N.column)?D:D.concat([N]),[]).sort((D,N)=>D.column-N.column),mf=Lr("col"),ub=Lr("colgroup"),Xv=O=>Wt(O)==="tr"||ub(O),e2=O=>{const k=Pr(O,"colspan",1),D=Pr(O,"rowspan",1);return{element:O,colspan:k,rowspan:D}},jv=(O,k=e2)=>{const D=Ee=>mf(Ee.element)?O.col(Ee):O.cell(Ee),N=Ee=>ub(Ee.element)?O.colgroup(Ee):O.row(Ee),Y=Ee=>{if(Xv(Ee))return N({element:Ee});{const Fe=Ee,rt=D(k(Fe));return se=ce.some({item:Fe,replacement:rt}),rt}};let se=ce.none();return{getOrInit:(Ee,Fe)=>se.fold(()=>Y(Ee),rt=>Fe(Ee,rt.item)?rt.replacement:Y(Ee))}},A0=O=>k=>{const D=[],N=(pe,Ee)=>he(D,Fe=>Ee(Fe.item,pe)),Y=pe=>{const Ee=O==="td"?{scope:null}:{},Fe=k.replace(pe,O,Ee);return D.push({item:pe,sub:Fe}),Fe};return{replaceOrInit:(pe,Ee)=>{if(Xv(pe)||mf(pe))return pe;{const Fe=pe;return N(Fe,Ee).fold(()=>Y(Fe),rt=>Ee(pe,rt.item)?rt.sub:Y(Fe))}}}},kh=O=>Ge(O,"scope").map(k=>k.substr(0,3)),Fu={modification:jv,transform:A0,merging:O=>({unmerge:N=>{const Y=kh(N);return Y.each(se=>Yr(N,"scope",se)),()=>{const se=O.cell({element:N,colspan:1,rowspan:1});return Ec(se,"width"),Ec(N,"width"),Y.each(pe=>Yr(se,"scope",pe)),se}},merge:N=>{const Y=()=>{const se=Ii(Ct(N,kh));if(se.length===0)return ce.none();{const pe=se[0],Ee=["row","col"];return Qe(se,rt=>rt!==pe&&ut(Ee,rt))?ce.none():ce.from(pe)}};return Ec(N[0],"width"),Y().fold(()=>qe(N[0],"scope"),se=>Yr(N[0],"scope",se+"group")),L(N[0])}})},zl=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],t2=(O,k)=>{const D=O.property().name(k);return ut(["ol","ul"],D)},hp=(O,k)=>{const D=O.property().name(k);return ut(zl,D)},O_=(O,k)=>ut(["br","img","hr","input"],O.property().name(k)),D0=on(),s1=O=>hp(D0,O),n2=O=>t2(D0,O),qv=O=>O_(D0,O),y_=O=>{const k=Lr("br"),D=Fe=>Yo(Fe,rt=>k(rt)||xo(rt)&&Uo(rt).trim().length===0),N=Fe=>Wt(Fe)==="li"||Gr(Fe,n2).isSome(),Y=Fe=>xu(Fe).map(rt=>s1(rt)?!0:qv(rt)?Wt(rt)!=="img":!1).getOr(!1),se=Fe=>dh(Fe).bind(rt=>{const _t=Y(rt);return Ki(rt).map(dn=>_t===!0||N(dn)||k(rt)||s1(dn)&&!gr(Fe,dn)?[]:[lt.fromTag("br")])}).getOr([]),Ee=(()=>{const Fe=so(O,rt=>{const _t=yr(rt);return D(_t)?[]:_t.concat(se(rt))});return Fe.length===0?[lt.fromTag("br")]:Fe})();ca(O[0]),Za(O[0],Ee)},Gv=O=>og(O,!0),o2=O=>{Ql(O).length===0&&Ji(O)},vl=(O,k)=>({grid:O,cursor:k}),ec=O=>bn(O,k=>bn(k.cells,D=>{const N=D.element;return pa(Gv(N),N)})),Qu=(O,k,D)=>{var N,Y;const se=Pa(O).rows;return ce.from((Y=(N=se[k])===null||N===void 0?void 0:N.cells[D])===null||Y===void 0?void 0:Y.element).filter(Gv).orThunk(()=>ec(se))},Zr=(O,k,D)=>{const N=Qu(O,k,D);return vl(O,N)},tc=O=>je(O,(D,N)=>Qe(D,se=>se.row===N.row)?D:D.concat([N Line truncated
`+g.getErrorInfo())},Ym=(r,f)=>Wi.serror([{path:r,getErrorInfo:f}]),jg=(r,f,g)=>Ym(r,()=>'Could not find valid *required* value for "'+f+'" in '+t0(g)),Mv=(r,f)=>Ym(r,()=>'Choice schema did not contain choice key: "'+f+'"'),Rf=(r,f,g)=>Ym(r,()=>'The chosen schema: "'+g+'" did not exist in branches: '+t0(f)),xy=(r,f)=>Ym(r,()=>"There are unsupported fields: ["+f.join(", ")+"] specified"),Nu=(r,f)=>Ym(r,G(f)),nf=r=>{const f=(v,_)=>Wi.bindError(r(_),T=>Nu(v,T)),g=G("val");return{extract:f,toString:g}},n0=nf(Wi.svalue),o0=(r,f,g,v)=>ln(f,g).fold(()=>jg(r,g,f),v),s0=(r,f,g,v)=>{const _=ln(r,f).getOrThunk(()=>g(r));return v(_)},q1=(r,f,g)=>g(ln(r,f)),nd=(r,f,g,v)=>{const _=ln(r,f).map(T=>T===!0?g(r):T);return v(_)},r0=(r,f,g,v,_)=>{const T=I=>_.extract(f.concat([v]),I),P=I=>I.fold(()=>Wi.svalue(V.none()),W=>{const J=_.extract(f.concat([v]),W);return Wi.map(J,V.some)});switch(r.tag){case"required":return o0(f,g,v,T);case"defaultedThunk":return s0(g,v,r.process,T);case"option":return q1(g,v,P);case"defaultedOptionThunk":return nd(g,v,r.process,P);case"mergeWithThunk":return s0(g,v,G({}),I=>{const W=ni(r.process(g),I);return T(W)})}},i0=(r,f,g)=>{const v={},_=[];for(const T of g)ah(T,(P,I,W,J)=>{const ie=r0(W,r,f,P,J);Wi.fold(ie,de=>{_.push(...de)},de=>{v[I]=de})},(P,I)=>{v[P]=I(f)});return _.length>0?Wi.serror(_):Wi.svalue(v)},pl=r=>({extract:(v,_)=>r().extract(v,_),toString:()=>r().toString()}),Ty=r=>Xs(Ls(r,Q)),_i=r=>{const f=fo(r),g=so(r,(_,T)=>ah(T,P=>ni(_,{[P]:!0}),G(_)),{});return{extract:(_,T)=>{const P=E(T)?[]:Ty(T),I=Kn(P,W=>!Qi(g,W));return I.length===0?f.extract(_,T):xy(_,I)},toString:f.toString}},fo=r=>({extract:(v,_)=>i0(v,_,r),toString:()=>`obj{
`+je(r,_=>ah(_,(T,P,I,W)=>T+" -> "+W.toString(),(T,P)=>"state("+T+")")).join(`
`)+"}"}),Dd=r=>({extract:(v,_)=>{const T=je(_,(P,I)=>r.extract(v.concat(["["+I+"]"]),P));return j1.consolidateArr(T)},toString:()=>"array("+r.toString()+")"}),Jn=(r,f)=>{const g=f!==void 0?f:we;return{extract:(T,P)=>{const I=[];for(const W of r){const J=W.extract(T,P);if(J.stype===Ko.Value)return{stype:Ko.Value,svalue:g(J.svalue)};I.push(J)}return j1.consolidateArr(I)},toString:()=>"oneOf("+je(r,T=>T.toString()).join(", ")+")"}},Ac=(r,f)=>{const g=(T,P)=>Dd(nf(r)).extract(T,P);return{extract:(T,P)=>{const I=Xs(P),W=g(T,I);return Wi.bind(W,J=>{const ie=je(J,de=>Ca(de,de,wr(),f));return fo(ie).extract(T,P)})},toString:()=>"setOf("+f.toString()+")"}},$f=(r,f)=>{const g=Mi(f);return{extract:(T,P)=>g().extract(T,P),toString:()=>g().toString()}},ch=ne(Dd,fo),Vc=G(n0),qg=(r,f)=>nf(g=>{const v=typeof g;return r(g)?Wi.svalue(g):Wi.serror(`Expected type: ${f} but got: ${v}`)}),Pd=qg(U,"number"),bl=qg(d,"string"),Iu=qg(E,"boolean"),Wp=qg(F,"function"),G1=r=>{if(Object(r)!==r)return!0;switch({}.toString.call(r).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(r).every(f=>G1(r[f]));default:return!1}},_n=nf(r=>G1(r)?Wi.svalue(r):Wi.serror("Expected value to be acceptable for sending via postMessage")),Xm=(r,f,g,v)=>ln(g,v).fold(()=>Rf(r,g,v),T=>T.extract(r.concat(["branch: "+v]),f)),Md=(r,f)=>({extract:(_,T)=>ln(T,r).fold(()=>Mv(_,r),I=>Xm(_,T,f,I)),toString:()=>"chooseOn("+r+"). Possible values: "+Xs(f)}),uh=()=>Dd(n0),of=r=>nf(f=>r(f).fold(Wi.serror,Wi.svalue)),K1=(r,f)=>Ac(g=>Wi.fromResult(r(g)),f),mi=(r,f,g)=>{const v=f.extract([r],g);return Wi.mapError(v,_=>({input:g,errors:_}))},Ui=(r,f,g)=>Wi.toResult(mi(r,f,g)),ba=r=>r.fold(f=>{throw new Error(Rd(f))},we),Es=(r,f,g)=>ba(Ui(r,f,g)),Rd=r=>`Errors:
`+td(r.errors).join(`
`)+`
Input object: `+t0(r.input),xl=(r,f)=>Md(r,Ns(f,fo)),sf=(r,f)=>$f(r,f),Wa=Ca,ka=iu,Up=r=>of(f=>st(r,f)?wn.value(f):wn.error(`Unsupported value: "${f}", choose one of "${r.join(", ")}".`)),nn=r=>Wa(r,r,wr(),Vc()),Kr=(r,f)=>Wa(r,r,wr(),f),a0=r=>Kr(r,Pd),xa=r=>Kr(r,bl),Ua=(r,f)=>Wa(r,r,wr(),Up(f)),Gg=r=>Kr(r,Iu),Wc=r=>Kr(r,Wp),od=(r,f)=>Wa(r,r,lh(),nf(g=>Wi.serror("The field: "+r+" is forbidden. "+f))),sd=(r,f)=>Wa(r,r,wr(),fo(f)),Yp=(r,f)=>Wa(r,r,wr(),ch(f)),Hl=(r,f)=>Wa(r,r,wr(),Dd(f)),Er=r=>Wa(r,r,lh(),Vc()),Ya=(r,f)=>Wa(r,r,lh(),f),fh=r=>Ya(r,Pd),Jl=r=>Ya(r,bl),l0=(r,f)=>Ya(r,Up(f)),jm=r=>Ya(r,Wp),J1=(r,f)=>Ya(r,Dd(f)),Xa=(r,f)=>Ya(r,fo(f)),hc=(r,f)=>Ya(r,_i(f)),xt=(r,f)=>Wa(r,r,ed(f),Vc()),Dc=(r,f,g)=>Wa(r,r,ed(f),g),au=(r,f)=>Dc(r,f,Pd),mc=(r,f)=>Dc(r,f,bl),Bu=(r,f,g)=>Dc(r,f,Up(g)),ja=(r,f)=>Dc(r,f,Iu),qa=(r,f)=>Dc(r,f,Wp),qm=(r,f)=>Dc(r,f,_n),lu=(r,f,g)=>Dc(r,f,Dd(g)),c0=(r,f,g)=>Dc(r,f,fo(g)),Ho=r=>{let f=r;return{get:()=>f,set:_=>{f=_}}},j={generate:r=>{if(!y(r))throw new Error("cases must be an array");if(r.length===0)throw new Error("there must be at least one case");const f=[],g={};return mt(r,(v,_)=>{const T=Xs(v);if(T.length!==1)throw new Error("one and only one name per case");const P=T[0],I=v[P];if(g[P]!==void 0)throw new Error("duplicate key detected:"+P);if(P==="cata")throw new Error("cannot have a case named cata (sorry)");if(!y(I))throw new Error("case arguments must be an array");f.push(P),g[P]=(...W)=>{const J=W.length;if(J!==I.length)throw new Error("Wrong number of arguments to case "+P+". Expected "+I.length+" ("+I+"), got "+J);return{fold:(...de)=>{if(de.length!==r.length)throw new Error("Wrong number of arguments to fold. Expected "+r.length+", got "+de.length);return de[_].apply(null,W)},match:de=>{const ge=Xs(de);if(f.length!==ge.length)throw new Error("Wrong number of arguments to match. Expected: "+f.join(",")+`
Actual: `+ge.join(","));if(!Gt(f,Ie=>st(ge,Ie)))throw new Error("Not all branches were specified when using match. Specified: "+ge.join(", ")+`
Required: `+f.join(", "));return de[P].apply(null,W)},log:de=>{console.log(de,{constructors:f,constructor:P,params:W})}}}}),g}};j.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const ye=r=>{const f=[],g=[];return mt(r,v=>{v.fold(_=>{f.push(_)},_=>{g.push(_)})}),{errors:f,values:g}},Pe=(r,f)=>{const g={};return dr(r,(v,_)=>{st(f,_)||(g[_]=v)}),g},ct=(r,f)=>({[r]:f}),Ft=r=>{const f={};return mt(r,g=>{f[g.key]=g.value}),f},Sn=(r,f)=>Pe(r,f),In=(r,f)=>ct(r,f),Uo=r=>Ft(r),ts=(r,f)=>r.length===0?wn.value(f):wn.value(ni(f,Ad.apply(void 0,r))),Si=r=>wn.error(pt(r)),sr=(r,f)=>{const g=ye(r);return g.errors.length>0?Si(g.errors):ts(g.values,f)},_r=r=>F(r)?r:tt,Uc=(r,f,g)=>{let v=r.dom;const _=_r(g);for(;v.parentNode;){v=v.parentNode;const T=lt.fromDom(v),P=f(T);if(P.isSome())return P;if(_(T))break}return V.none()},cu=(r,f,g)=>{const v=f(r),_=_r(g);return v.orThunk(()=>_(r)?V.none():Uc(r,f,_))},rf=(r,f)=>xr(r.element,f.event.target),Nf={can:ot,abort:tt,run:L},dh=r=>{if(!Qi(r,"can")&&!Qi(r,"abort")&&!Qi(r,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(r,null,2)+" does not have can, abort, or run!");return{...Nf,...r}},hh=(r,f)=>(...g)=>Yo(r,(v,_)=>v&&f(_).apply(void 0,g),!0),hr=(r,f)=>(...g)=>Yo(r,(v,_)=>v||f(_).apply(void 0,g),!1),Gm=r=>F(r)?{can:ot,abort:tt,run:r}:r,Km=r=>{const f=hh(r,_=>_.can),g=hr(r,_=>_.abort);return{can:f,abort:g,run:(..._)=>{mt(r,T=>{T.run.apply(void 0,_)})}}},oa=G,uu=oa("touchstart"),Xp=oa("touchmove"),Jm=oa("touchend"),Ps=oa("touchcancel"),Fr=oa("mousedown"),Ma=oa("mousemove"),gc=oa("mouseout"),eb=oa("mouseup"),Tl=oa("mouseover"),Gi=oa("focusin"),fu=oa("focusout"),If=oa("keydown"),Jw=oa("keyup"),om=oa("input"),Kg=oa("change"),sm=oa("click"),eg=oa("transitioncancel"),Jg=oa("transitionend"),u0=oa("transitionstart"),rm=oa("selectstart"),Ra=r=>G("alloy."+r),mh={tap:Ra("tap")},$d=Ra("focus"),tg=Ra("blur.post"),ng=Ra("paste.post"),im=Ra("receive"),af=Ra("execute"),f0=Ra("focus.item"),tb=mh.tap,e_=Ra("longpress"),$a=Ra("sandbox.close"),ep=Ra("typeahead.cancel"),og=Ra("system.init"),du=Ra("system.touchmove"),Bf=Ra("system.touchend"),sg=Ra("system.scroll"),gh=Ra("system.resize"),Lu=Ra("system.attached"),Nd=Ra("system.detached"),rg=Ra("system.dismissRequested"),d0=Ra("system.repositionRequested"),Rv=Ra("focusmanager.shifted"),$v=Ra("slotcontainer.visibility"),ph=Ra("system.external.element.scroll"),tp=Ra("change.tab"),Nv=Ra("dismiss.tab"),ig=Ra("highlight"),Iv=Ra("dehighlight"),rr=(r,f)=>{np(r,r.element,f,{})},Ao=(r,f,g)=>{np(r,r.element,f,g)},bh=r=>{rr(r,af())},nb=(r,f,g)=>{np(r,f,g,{})},np=(r,f,g,v)=>{const _={target:f,...v};r.getSystem().triggerEvent(g,f,_)},WC=(r,f,g,v)=>{const _={...v,target:f};r.getSystem().triggerEvent(g,f,_)},Bv=(r,f,g,v)=>{r.getSystem().triggerEvent(g,f,v.event)},li=r=>Uo(r),Lv=(r,f)=>({key:r,value:dh({abort:f})}),ob=(r,f)=>({key:r,value:dh({can:f})}),Ey=r=>({key:r,value:dh({run:(f,g)=>{g.event.prevent()}})}),on=(r,f)=>({key:r,value:dh({run:f})}),Id=(r,f,g)=>({key:r,value:dh({run:(v,_)=>{f.apply(void 0,[v,_].concat(g))}})}),t_=r=>f=>on(r,f),h0=r=>f=>({key:r,value:dh({run:(g,v)=>{rf(g,v)&&f(g,v)}})}),UC=(r,f)=>on(r,(g,v)=>{g.getSystem().getByUid(f).each(_=>{Bv(_,_.element,r,v)})}),ag=(r,f,g)=>{const v=f.partUids[g];return UC(r,v)},Ay=(r,f)=>on(r,(g,v)=>{const _=v.event,T=g.getSystem().getByDom(_.target).getOrThunk(()=>cu(_.target,I=>g.getSystem().getByDom(I).toOptional(),tt).getOr(g));f(g,T,v)}),am=r=>on(r,(f,g)=>{g.cut()}),Bd=r=>on(r,(f,g)=>{g.stop()}),lg=(r,f)=>h0(r)(f),Ci=h0(Lu()),Ld=h0(Nd()),Fd=h0(og()),hu=t_(af()),Qs=(r,f)=>{const v=(f||document).createElement("div");return v.innerHTML=r,Xl(lt.fromDom(v))},jp=r=>r.dom.innerHTML,vh=(r,f)=>{const v=ca(r).dom,_=lt.fromDom(v.createDocumentFragment()),T=Qs(f,v);tf(_,T),ii(r),il(r,_)},op=r=>{const f=lt.fromTag("div"),g=lt.fromDom(r.dom.cloneNode(!0));return il(f,g),jp(f)},YC=(r,f)=>lt.fromDom(r.dom.cloneNode(f)),m0=r=>YC(r,!1),Fv=r=>{if(De(r))return"#shadow-root";{const f=m0(r);return op(f)}},El=r=>Fv(r),TE=(r,f,g)=>xr(f,r.element)&&!xr(f,g),sp=li([ob($d(),(r,f)=>{const g=f.event,v=g.originator,_=g.target;return TE(r,v,_)?(console.warn($d()+` did not get interpreted by the desired target.
Originator: `+El(v)+`
Target: `+El(_)+`
Check the `+$d()+" event handlers"),!1):!0})]);var Al=Object.freeze({__proto__:null,events:sp});let Dy=0;const io=r=>{const g=new Date().getTime(),v=Math.floor(Math.random()*1e9);return Dy++,r+"_"+v+Dy+String(g)},Py=G("alloy-id-"),XC=G("data-alloy-id"),My=Py(),lm=XC(),lf=(r,f)=>{const g=io(My+r);return Oh(f,g),g},Oh=(r,f)=>{Object.defineProperty(r.dom,lm,{value:f,writable:!0})},rp=r=>{const f=yr(r)?r.dom[lm]:null;return V.from(f)},yh=r=>io(r),g0=we,Lf=r=>{const f=_=>`The component must be in a context to execute: ${_}`+(r?`
`+El(r().element)+" is not in context.":""),g=_=>()=>{throw new Error(f(_))},v=_=>()=>{console.warn(f(_))};return{debugInfo:G("fake"),triggerEvent:v("triggerEvent"),triggerFocus:v("triggerFocus"),triggerEscape:v("triggerEscape"),broadcast:v("broadcast"),broadcastOn:v("broadcastOn"),broadcastEvent:v("broadcastEvent"),build:g("build"),buildOrPatch:g("buildOrPatch"),addToWorld:g("addToWorld"),removeFromWorld:g("removeFromWorld"),addToGui:g("addToGui"),removeFromGui:g("removeFromGui"),getByUid:g("getByUid"),getByDom:g("getByDom"),isConnected:tt}},ip=Lf(),Ry=(r,f,g)=>{const v=g.toString(),_=v.indexOf(")")+1,T=v.indexOf("("),P=v.substring(T+1,_-1).split(/,\s*/);return r.toFunctionAnnotation=()=>({name:f,parameters:qp(P.slice(0,1).concat(P.slice(3)))}),r},qp=r=>je(r,f=>Zi(f,"/*")?f.substring(0,f.length-2):f),rd=(r,f)=>{const g=r.toString(),v=g.indexOf(")")+1,_=g.indexOf("("),T=g.substring(_+1,v-1).split(/,\s*/);return r.toFunctionAnnotation=()=>({name:f,parameters:qp(T)}),r},$y=(r,f)=>{const g=f.toString(),v=g.indexOf(")")+1,_=g.indexOf("("),T=g.substring(_+1,v-1).split(/,\s*/);return r.toFunctionAnnotation=()=>({name:"OVERRIDE",parameters:qp(T.slice(1))}),r},wh=io("alloy-premade"),Qv=r=>(Object.defineProperty(r.element.dom,wh,{value:r.uid,writable:!0}),In(wh,r)),n_=r=>vs(r.dom,wh),Ny=r=>ln(r,wh),ap=r=>$y((f,...g)=>r(f.getApis(),f,...g),r),Ff={init:()=>mu({readState:G("No State required")})},mu=r=>r,lp=(r,f)=>{const g=je(f,_=>Xa(_.name(),[nn("config"),xt("state",Ff)])),v=Ui("component.behaviours",fo(g),r.behaviours).fold(_=>{throw new Error(Rd(_)+`
Complete spec:
`+JSON.stringify(r,null,2))},we);return{list:f,data:Ns(v,_=>{const T=_.map(P=>({config:P.config,state:P.state.init(P.config)}));return G(T)})}},Iy=r=>r.list,o_=r=>r.data,p0=(r,f)=>{const g={};return dr(r,(v,_)=>{dr(v,(T,P)=>{const I=ln(g,P).getOr([]);g[P]=I.concat([f(_,T)])})}),g},Yc=r=>({classes:R(r.classes)?[]:r.classes,attributes:R(r.attributes)?{}:r.attributes,styles:R(r.styles)?{}:r.styles}),b0=(r,f)=>({...r,attributes:{...r.attributes,...f.attributes},styles:{...r.styles,...f.styles},classes:r.classes.concat(f.classes)}),cf=(r,f,g,v)=>{const _={...f};mt(g,ie=>{_[ie.name()]=ie.exhibit(r,v)});const T=p0(_,(ie,de)=>({name:ie,modification:de})),P=ie=>so(ie,(de,ge)=>({...ge.modification,...de}),{}),I=so(T.classes,(ie,de)=>de.modification.concat(ie),[]),W=P(T.attributes),J=P(T.styles);return Yc({classes:I,attributes:W,styles:J})},cp=(r,f,g,v)=>{try{const _=ps(g,(T,P)=>{const I=T[f],W=P[f],J=v.indexOf(I),ie=v.indexOf(W);if(J===-1)throw new Error("The ordering for "+r+" does not have an entry for "+I+`.
Order specified: `+JSON.stringify(v,null,2));if(ie===-1)throw new Error("The ordering for "+r+" does not have an entry for "+W+`.
Order specified: `+JSON.stringify(v,null,2));return J<ie?-1:ie<J?1:0});return wn.value(_)}catch(_){return wn.error([_])}},cm=(r,f)=>({handler:r,purpose:f}),Zv=(r,f)=>({cHandler:r,purpose:f}),s_=(r,f)=>Zv(Re.apply(void 0,[r.handler].concat(f)),r.purpose),Gp=r=>r.cHandler,By=(r,f)=>({name:r,handler:f}),up=(r,f)=>{const g={};return mt(r,v=>{g[v.name()]=v.handlers(f)}),g},v0=(r,f,g)=>{const v={...g,...up(f,r)};return p0(v,By)},sb=(r,f,g,v)=>{const _=v0(r,g,v);return jC(_,f)},Ly=r=>{const f=Gm(r);return(g,v,..._)=>{const T=[g,v].concat(_);f.abort.apply(void 0,T)?v.stop():f.can.apply(void 0,T)&&f.run.apply(void 0,T)}},Fy=(r,f)=>wn.error(["The event ("+r+`) has more than one behaviour that listens to it.
When this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).
The behaviours that can trigger it are: `+JSON.stringify(je(f,g=>g.name),null,2)]),r_=(r,f,g)=>{const v=f[g];return v?cp("Event: "+g,"name",r,v).map(_=>{const T=je(_,P=>P.handler);return Km(T)}):Fy(g,r)},jC=(r,f)=>{const g=aa(r,(v,_)=>(v.length===1?wn.value(v[0].handler):r_(v,f,_)).map(P=>{const I=Ly(P),W=v.length>1?Kn(f[_],J=>rn(v,ie=>ie.name===J)).join(" > "):v[0].name;return In(_,cm(I,W))}));return sr(g,{})},Qr="alloy.base.behaviour",Hv=fo([Wa("dom","dom",wr(),fo([nn("tag"),xt("styles",{}),xt("classes",[]),xt("attributes",{}),Er("value"),Er("innerHtml")])),nn("components"),nn("uid"),xt("events",{}),xt("apis",{}),Wa("eventOrder","eventOrder",Mf({[af()]:["disabling",Qr,"toggling","typeaheadevents"],[$d()]:[Qr,"focusing","keying"],[og()]:[Qr,"disabling","toggling","representing"],[om()]:[Qr,"representing","streaming","invalidating"],[Nd()]:[Qr,"representing","item-events","tooltipping"],[Fr()]:["focusing",Qr,"item-type-events"],[uu()]:["focusing",Qr,"item-type-events"],[Tl()]:["item-type-events","tooltipping"],[im()]:["receiving","reflecting","tooltipping"]}),Vc()),Er("domModification")]),Qy=r=>Ui("custom.definition",Hv,r),Zy=r=>({...r.dom,uid:r.uid,domChildren:je(r.components,f=>f.element)}),O0=r=>r.domModification.fold(()=>Yc({}),Yc),qC=r=>r.events,um=(r,f)=>{const g=zi(r,f);return g===void 0||g===""?[]:g.split(" ")},Ga=(r,f,g)=>{const _=um(r,f).concat([g]);return qn(r,f,_.join(" ")),!0},y0=(r,f,g)=>{const v=Kn(um(r,f),_=>_!==g);return v.length>0?qn(r,f,v.join(" ")):Ue(r,f),!1},rb=r=>r.dom.classList!==void 0,i_=r=>um(r,"class"),w0=(r,f)=>Ga(r,"class",f),Hy=(r,f)=>y0(r,"class",f),Na=(r,f)=>{rb(r)?r.dom.classList.add(f):w0(r,f)},_h=r=>{(rb(r)?r.dom.classList:i_(r)).length===0&&Ue(r,"class")},va=(r,f)=>{rb(r)?r.dom.classList.remove(f):Hy(r,f),_h(r)},uf=(r,f)=>rb(r)&&r.dom.classList.contains(f),cg=(r,f)=>{mt(f,g=>{Na(r,g)})},Xc=(r,f)=>{mt(f,g=>{va(r,g)})},GC=(r,f)=>Gt(f,g=>uf(r,g)),zy=r=>{const f=r.dom.classList,g=new Array(f.length);for(let v=0;v<f.length;v++){const _=f.item(v);_!==null&&(g[v]=_)}return g},id=r=>rb(r)?zy(r):i_(r),Ia=r=>r.dom.value,Ta=(r,f)=>{if(f===void 0)throw new Error("Value.set was undefined");r.dom.value=f},KC=(r,f,g)=>Hc(r,f).map(_=>{if(g.exists(P=>!xr(P,_))){const P=g.map(gl).getOr("span"),I=lt.fromTag(P);return Sa(_,I),I}else return _}),Sh=(r,f,g)=>{g.fold(()=>il(r,f),v=>{xr(v,f)||(Sa(v,f),Mu(v))})},_0=(r,f,g)=>{const v=je(f,g),_=Xl(r);return mt(_.slice(v.length),Mu),v},zv=(r,f,g,v)=>{const _=Hc(r,f),T=v(g,_),P=KC(r,f,_);return Sh(r,T.element,P),T},ad=(r,f,g)=>_0(r,f,(v,_)=>zv(r,_,v,g)),ff=(r,f)=>_0(r,f,(g,v)=>{const _=Hc(r,v);return Sh(r,g,_),g}),Kp=(r,f)=>{const g=Xs(r),v=Xs(f),_=At(v,g),T=Rr(r,(P,I)=>!vs(f,I)||P!==f[I]).t;return{toRemove:_,toSet:T}},ib=(r,f)=>{const{class:g,style:v,..._}=It(f),{toSet:T,toRemove:P}=Kp(r.attributes,_),I=()=>{mt(P,Yt=>Ue(f,Yt)),Zm(f,T)},W=ri(f),{toSet:J,toRemove:ie}=Kp(r.styles,W),de=()=>{mt(ie,Yt=>ks(f,Yt)),yi(f,J)},ge=id(f),_e=At(ge,r.classes),Ie=At(r.classes,ge),it=()=>{cg(f,Ie),Xc(f,_e)},Qt=Yt=>{vh(f,Yt)},dt=()=>{const Yt=r.domChildren;ff(f,Yt)},ft=()=>{const Yt=f,Dt=r.value.getOrUndefined();Dt!==Ia(Yt)&&Ta(Yt,Dt!=null?Dt:"")};return I(),it(),de(),r.innerHtml.fold(dt,Qt),ft(),f},S0=r=>{const f=lt.fromTag(r.tag);Zm(f,r.attributes),cg(f,r.classes),yi(f,r.styles),r.innerHtml.each(v=>vh(f,v));const g=r.domChildren;return tf(f,g),r.value.each(v=>{Ta(f,v)}),f},C0=(r,f)=>{try{const g=ib(r,f);return V.some(g)}catch{return V.none()}},a_=r=>r.innerHtml.isSome()&&r.domChildren.length>0,Vy=(r,f)=>{const g=_=>gl(_)===r.tag&&!a_(r)&&!n_(_),v=f.filter(g).bind(_=>C0(r,_)).getOrThunk(()=>S0(r));return Oh(v,r.uid),v},JC=r=>{const f=ln(r,"behaviours").getOr({});return Ne(Xs(f),g=>{const v=f[g];return Q(v)?[v.me]:[]})},l_=(r,f)=>lp(r,f),c_=r=>{const f=JC(r);return l_(r,f)},Wy=(r,f,g)=>{const v=Zy(r),_=O0(r),T={"alloy.base.modification":_},P=f.length>0?cf(g,T,f,v):_;return b0(v,P)},u_=(r,f,g)=>{const v={"alloy.base.behaviour":qC(r)};return sb(g,r.eventOrder,f,v).getOrDie()},EE=(r,f)=>{const g=()=>Yt,v=Ho(ip),_=ba(Qy(r)),T=c_(r),P=Iy(T),I=o_(T),W=Wy(_,P,I),J=Vy(W,f),ie=u_(_,P,I),de=Ho(_.components),ge=Dt=>{v.set(Dt)},_e=()=>{v.set(Lf(g))},Ie=()=>{const Dt=Xl(J),kn=Ne(Dt,pn=>v.get().getByDom(pn).fold(()=>[],zn));de.set(kn)},it=Dt=>{const kn=I;return(F(kn[Dt.name()])?kn[Dt.name()]:()=>{throw new Error("Could not find "+Dt.name()+" in "+JSON.stringify(r,null,2))})()},Qt=Dt=>F(I[Dt.name()]),dt=()=>_.apis,ft=Dt=>I[Dt]().map(kn=>kn.state.readState()).getOr("not enabled"),Yt={uid:r.uid,getSystem:v.get,config:it,hasConfigured:Qt,spec:r,readState:ft,getApis:dt,connect:ge,disconnect:_e,element:J,syncComponents:Ie,components:de.get,events:ie};return Yt},Vv=(r,f)=>{const g=ln(r,"components").getOr([]);return f.fold(()=>je(g,pc),v=>je(g,(_,T)=>ug(_,Hc(v,T))))},f_=(r,f)=>{const{events:g,...v}=g0(r),_=Vv(v,f),T={...v,events:{...Al,...g},components:_};return wn.value(EE(T,f))},Li=r=>{const f=lt.fromText(r);return Wv({element:f})},Wv=r=>{const f=Es("external.component",_i([nn("elemen Line truncated
`);return kt(f,g=>g.indexOf("alloy")>0&&!rn(nk,v=>g.indexOf(v)>-1)).getOr(lb)}else return lb},k0={logEventCut:L,logEventStopped:L,logNoParent:L,logEventNoHandlers:L,logEventResponse:L,write:L},x0=(r,f,g)=>g_(r,f,g),b_=G(k0),qy=G([nn("menu"),nn("selectedMenu")]),n1=G([nn("item"),nn("selectedItem")]);G(fo(n1().concat(qy())));const v_=G(fo(n1())),o1=sd("initSize",[nn("numColumns"),nn("numRows")]),dg=()=>Kr("markers",v_()),Yv=()=>sd("markers",[nn("backgroundMenu")].concat(qy()).concat(n1())),hf=r=>sd("markers",je(r,nn)),cb=(r,f,g)=>(p_(),Wa(f,f,g,of(v=>wn.value((..._)=>v.apply(void 0,_))))),qs=r=>cb("onHandler",r,ed(L)),pu=r=>cb("onKeyboardHandler",r,ed(V.none)),hg=r=>cb("onHandler",r,wr()),Gy=r=>cb("onKeyboardHandler",r,wr()),Yi=(r,f)=>ka(r,G(f)),Ky=r=>ka(r,we),mg=G(o1),Oa=(r,f,g,v,_,T,P,I=!1)=>({x:r,y:f,bubble:g,direction:v,placement:_,restriction:T,label:`${P}-${_}`,alwaysFit:I}),fm=j.generate([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Vt=(r,f,g,v,_,T,P,I,W)=>r.fold(f,g,v,_,T,P,I,W),T0=(r,f,g,v)=>r.fold(f,f,v,v,f,v,g,g),Jy=(r,f,g,v)=>r.fold(f,v,f,v,g,g,f,v),E0=fm.southeast,Ch=fm.southwest,mf=fm.northeast,ub=fm.northwest,Xv=fm.south,e2=fm.north,jv=fm.east,A0=fm.west,kh=(r,f,g,v)=>{const _=r+f;return _>v?g:_<g?v:_},cd=(r,f,g)=>Math.min(Math.max(r,f),g),Fu=(r,f)=>{switch(f){case 1:return r.x;case 0:return r.x+r.width;case 2:return r.y;case 3:return r.y+r.height}},zl=(r,f)=>An(["left","right","top","bottom"],g=>ln(f,g).map(v=>Fu(r,v))),t2=(r,f,g)=>{const v=(W,J)=>f[W].map(ie=>{const de=W==="top"||W==="bottom",ge=de?g.top:g.left,Ie=(W==="left"||W==="top"?Math.max:Math.min)(ie,J)+ge;return de?cd(Ie,r.y,r.bottom):cd(Ie,r.x,r.right)}).getOr(J),_=v("left",r.x),T=v("top",r.y),P=v("right",r.right),I=v("bottom",r.bottom);return ai(_,T,P-_,I-T)},hp="layout",O_=r=>r.x,D0=(r,f)=>r.x+r.width/2-f.width/2,s1=(r,f)=>r.x+r.width-f.width,n2=(r,f)=>r.y-f.height,qv=r=>r.y+r.height,y_=(r,f)=>r.y+r.height/2-f.height/2,Gv=r=>r.x+r.width,o2=(r,f)=>r.x-f.width,vl=(r,f,g)=>Oa(O_(r),qv(r),g.southeast(),E0(),"southeast",zl(r,{left:1,top:3}),hp),ec=(r,f,g)=>Oa(s1(r,f),qv(r),g.southwest(),Ch(),"southwest",zl(r,{right:0,top:3}),hp),Qu=(r,f,g)=>Oa(O_(r),n2(r,f),g.northeast(),mf(),"northeast",zl(r,{left:1,bottom:2}),hp),Zr=(r,f,g)=>Oa(s1(r,f),n2(r,f),g.northwest(),ub(),"northwest",zl(r,{right:0,bottom:2}),hp),tc=(r,f,g)=>Oa(D0(r,f),n2(r,f),g.north(),e2(),"north",zl(r,{bottom:2}),hp),Vl=(r,f,g)=>Oa(D0(r,f),qv(r),g.south(),Xv(),"south",zl(r,{top:3}),hp),dm=(r,f,g)=>Oa(Gv(r),y_(r,f),g.east(),jv(),"east",zl(r,{left:0}),hp),Sr=(r,f,g)=>Oa(o2(r,f),y_(r,f),g.west(),A0(),"west",zl(r,{right:1}),hp),w_=()=>[vl,ec,Qu,Zr,Vl,tc,dm,Sr],bu=()=>[ec,vl,Zr,Qu,Vl,tc,dm,Sr],Dl=()=>[Qu,Zr,vl,ec,tc,Vl],s2=()=>[Zr,Qu,ec,vl,tc,Vl],gg=()=>[vl,ec,Qu,Zr,Vl,tc],bc=()=>[ec,vl,Zr,Qu,Vl,tc],AE=(r,f)=>f.universal?r:Kn(r,g=>st(f.channels,g));var ok=Object.freeze({__proto__:null,events:r=>li([on(im(),(f,g)=>{const v=r.channels,_=Xs(v),T=g,P=AE(_,T);mt(P,I=>{const W=v[I],J=W.schema,ie=Es("channel["+I+`] data
Receiver: `+El(f.element),J,T.data);W.onReceive(f,ie)})})])}),sk=[Kr("channels",K1(wn.value,_i([hg("onReceive"),xt("schema",Vc())])))];const r2=(r,f,g)=>hu(v=>{g(v,r,f)}),i2=(r,f,g)=>Fd((v,_)=>{g(v,r,f)}),hm=(r,f,g,v,_,T)=>{const P=_i(r),I=Xa(f,[hc("config",r)]);return Pl(P,I,f,g,v,_,T)},a2=(r,f,g,v,_,T)=>{const P=r,I=Xa(f,[Ya("config",r)]);return Pl(P,I,f,g,v,_,T)},r1=(r,f,g)=>Ry((_,...T)=>{const P=[_].concat(T);return _.config({name:G(r)}).fold(()=>{throw new Error("We could not find any behaviour configuration for: "+r+". Using API: "+g)},I=>{const W=Array.prototype.slice.call(P,1);return f.apply(void 0,[_,I.config,I.state].concat(W))})},g,f),Ol=r=>({key:r,value:void 0}),Pl=(r,f,g,v,_,T,P)=>{const I=de=>Qi(de,g)?de[g]():V.none(),W=Ns(_,(de,ge)=>r1(g,de,ge)),ie={...Ns(T,(de,ge)=>rd(de,ge)),...W,revoke:Re(Ol,g),config:de=>{const ge=Es(g+"-config",r,de);return{key:g,value:{config:ge,me:ie,configAsRaw:Mi(()=>Es(g+"-config",r,de)),initialConfig:de,state:P}}},schema:G(f),exhibit:(de,ge)=>Yn(I(de),ln(v,"exhibit"),(_e,Ie)=>Ie(ge,_e.config,_e.state)).getOrThunk(()=>Yc({})),name:G(g),handlers:de=>I(de).map(ge=>ln(v,"events").getOr(()=>({}))(ge.config,ge.state)).getOr({})};return ie},Tn=r=>Uo(r),rk=_i([nn("fields"),nn("name"),xt("active",{}),xt("apis",{}),xt("state",Ff),xt("extra",{})]),nc=r=>{const f=Es("Creating behaviour: "+r.name,rk,r);return hm(f.fields,f.name,f.active,f.apis,f.extra,f.state)},ik=_i([nn("branchKey"),nn("branches"),nn("name"),xt("active",{}),xt("apis",{}),xt("state",Ff),xt("extra",{})]),l2=r=>{const f=Es("Creating behaviour: "+r.name,ik,r);return a2(xl(f.branchKey,f.branches),f.name,f.active,f.apis,f.extra,f.state)},no=G(void 0),Pc=nc({fields:sk,name:"receiving",active:ok});var fb=Object.freeze({__proto__:null,exhibit:(r,f)=>Yc({classes:[],styles:f.useFixed()?{}:{position:"relative"}})});const gf=r=>r.dom.focus(),Kv=r=>r.dom.blur(),i1=r=>{const f=$t(r).dom;return r.dom===f.activeElement},Qf=(r=rh())=>V.from(r.dom.activeElement).map(lt.fromDom),al=r=>Qf($t(r)).filter(f=>r.dom.contains(f.dom)),Qd=(r,f)=>{const g=$t(f),v=Qf(g).bind(T=>{const P=I=>xr(T,I);return P(f)?V.some(f):Jp(f,P)}),_=r(f);return v.each(T=>{Qf(g).filter(P=>xr(P,T)).fold(()=>{gf(T)},L)}),_},Zd=(r,f,g,v,_)=>{const T=P=>P+"px";return{position:r,left:f.map(T),top:g.map(T),right:v.map(T),bottom:_.map(T)}},jc=r=>({...r,position:V.some(r.position)}),db=(r,f)=>{gn(r,jc(f))},u2=j.generate([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),__=(r,f,g,v,_,T)=>{const P=f.rect,I=P.x-g,W=P.y-v,J=P.width,ie=P.height,de=_-(I+J),ge=T-(W+ie),_e=V.some(I),Ie=V.some(W),it=V.some(de),Qt=V.some(ge),dt=V.none();return Vt(f.direction,()=>Zd(r,_e,Ie,dt,dt),()=>Zd(r,dt,Ie,it,dt),()=>Zd(r,_e,dt,dt,Qt),()=>Zd(r,dt,dt,it,Qt),()=>Zd(r,_e,Ie,dt,dt),()=>Zd(r,_e,dt,dt,Qt),()=>Zd(r,_e,Ie,dt,dt),()=>Zd(r,dt,Ie,it,dt))},f2=(r,f)=>r.fold(()=>{const g=f.rect;return Zd("absolute",V.some(g.x),V.some(g.y),V.none(),V.none())},(g,v,_,T)=>__("absolute",f,g,v,_,T),(g,v,_,T)=>__("fixed",f,g,v,_,T)),xh=(r,f)=>{const g=Re(tm,f),v=r.fold(g,g,()=>{const P=dc();return tm(f).translate(-P.left,-P.top)}),_=za(f),T=Xf(f);return ai(v.left,v.top,_,T)},jr=(r,f)=>f.fold(()=>r.fold(ue,ue,ai),g=>r.fold(G(g),G(g),()=>{const v=Jv(r,g.x,g.y);return ai(v.left,v.top,g.width,g.height)})),Jv=(r,f,g)=>{const v=pr(f,g),_=()=>{const T=dc();return v.translate(-T.left,-T.top)};return r.fold(G(v),G(v),_)},ud=(r,f,g,v)=>r.fold(f,g,v);u2.none;const S_=u2.relative,C_=u2.fixed,fa=(r,f)=>({anchorBox:r,origin:f}),ak=(r,f)=>fa(r,f),eO="data-alloy-placement",tO=(r,f)=>{qn(r,eO,f)},k_=r=>me(r,eO),lk=r=>Ue(r,eO),hb=j.generate([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),x_=(r,f)=>{const{x:g,y:v,right:_,bottom:T}=f,{x:P,y:I,right:W,bottom:J,width:ie,height:de}=r,ge=P>=g&&P<=_,_e=I>=v&&I<=T,Ie=ge&&_e,it=W<=_&&W>=g,Qt=J<=T&&J>=v,dt=it&&Qt,ft=Math.min(ie,P>=g?_-P:W-g),Yt=Math.min(de,I>=v?T-I:J-v);return{originInBounds:Ie,sizeInBounds:dt,visibleW:ft,visibleH:Yt}},ck=(r,f)=>{const{x:g,y:v,right:_,bottom:T}=f,{x:P,y:I,width:W,height:J}=r,ie=Math.max(g,_-W),de=Math.max(v,T-J),ge=cd(P,g,ie),_e=cd(I,v,de),Ie=Math.min(ge+W,_)-ge,it=Math.min(_e+J,T)-_e;return ai(ge,_e,Ie,it)},T_=(r,f,g)=>{const v=G(f.bottom-g.y),_=G(g.bottom-f.y),T=T0(r,_,_,v),P=G(f.right-g.x),I=G(g.right-f.x);return{maxWidth:Jy(r,I,I,P),maxHeight:T}},uk=(r,f,g,v)=>{const _=r.bubble,T=_.offset,P=t2(v,r.restriction,T),I=r.x+T.left,W=r.y+T.top,J=ai(I,W,f,g),{originInBounds:ie,sizeInBounds:de,visibleW:ge,visibleH:_e}=x_(J,P),Ie=ie&&de,it=Ie?J:ck(J,P),Qt=it.width>0&&it.height>0,{maxWidth:dt,maxHeight:ft}=T_(r.direction,it,v),Yt={rect:it,maxHeight:ft,maxWidth:dt,direction:r.direction,placement:r.placement,classes:{on:_.classesOn,off:_.classesOff},layout:r.label,testY:W};return Ie||r.alwaysFit?hb.fit(Yt):hb.nofit(Yt,ge,_e,Qt)},E_=(r,f,g,v,_,T)=>{const P=v.width,I=v.height,W=(ie,de,ge,_e,Ie)=>{const it=ie(g,v,_,r,T),Qt=uk(it,P,I,T);return Qt.fold(G(Qt),(dt,ft,Yt,Dt)=>(Ie===Dt?Yt>_e||ft>ge:!Ie Line truncated
Known: [`+Xs(v)+`]
Namespace: `+r.getOr("none")+`
Spec: `+JSON.stringify(g,null,2))},_=>_.replace()),M2=(r,f,g,v)=>Ph(g)&&g.uiType===HE?J_(r,f,g,v):P2.single(!1,G(g)),R2=(r,f,g,v)=>M2(r,f,g,v).fold((T,P)=>{const I=Ph(g)?P(f,g.config,g.validated):P(f),W=ln(I,"components").getOr([]),J=Ne(W,ie=>R2(r,f,ie,v));return[{...I,components:J}]},(T,P)=>{if(Ph(g)){const I=P(f,g.config,g.validated);return g.validated.preprocess.getOr(we)(I)}else return P(f)}),Gk=(r,f,g,v)=>Ne(g,_=>R2(r,f,_,v)),$2=(r,f)=>{let g=!1;const v=()=>g,_=()=>{if(g)throw new Error("Trying to use the same placeholder more than once: "+r);return g=!0,f},T=()=>f.fold((P,I)=>P,(P,I)=>P);return{name:G(r),required:T,used:v,replace:_}},eS=(r,f,g,v)=>{const _=Ns(v,(P,I)=>$2(I,P)),T=Gk(r,f,g,_);return dr(_,P=>{if(P.used()===!1&&P.required())throw new Error("Placeholder: "+P.name()+` was not found in components list
Namespace: `+r.getOr("none")+`
Components: `+JSON.stringify(f.components,null,2))}),T},Kk=P2.single,mP=P2.multiple,wm=G(HE),tS=j.generate([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),N2=xt("factory",{sketch:we}),dd=xt("schema",[]),Ml=nn("name"),Jk=Wa("pname","pname",Kl(r=>"<alloy."+io(r.name)+">"),Vc()),I2=ka("schema",()=>[Er("preprocess")]),Ud=xt("defaults",G({})),B2=xt("overrides",G({})),ex=fo([N2,dd,Ml,Jk,Ud,B2]),tx=fo([N2,dd,Ml,Ud,B2]),gP=fo([N2,dd,Ml,Jk,Ud,B2]),zE=fo([N2,I2,Ml,nn("unit"),Jk,Ud,B2]),L2=r=>r.fold(V.some,V.none,V.some,V.some),VE=r=>{const f=g=>g.name;return r.fold(f,f,f,f)},pP=r=>r.fold(we,we,we,we),Tb=(r,f)=>g=>{const v=Es("Converting part type",f,g);return r(v)},Gc=Tb(tS.required,ex),Mh=Tb(tS.external,tx),Yd=Tb(tS.optional,gP),hd=Tb(tS.group,zE),nS=G("entirety");var z0=Object.freeze({__proto__:null,required:Gc,external:Mh,optional:Yd,group:hd,asNamedPart:L2,name:VE,asCommon:pP,original:nS});const c1=(r,f,g,v)=>ni(f.defaults(r,g,v),g,{uid:r.partUids[f.name]},f.overrides(r,g,v)),bP=(r,f,g)=>{const v={},_={};return mt(g,T=>{T.fold(P=>{v[P.pname]=Kk(!0,(I,W,J)=>P.factory.sketch(c1(I,P,W,J)))},P=>{const I=f.parts[P.name];_[P.name]=G(P.factory.sketch(c1(f,P,I[nS()]),I))},P=>{v[P.pname]=Kk(!1,(I,W,J)=>P.factory.sketch(c1(I,P,W,J)))},P=>{v[P.pname]=mP(!0,(I,W,J)=>{const ie=I[P.name];return je(ie,de=>P.factory.sketch(ni(P.defaults(I,de,J),de,P.overrides(I,de))))})})}),{internals:G(v),externals:G(_)}},nx=(r,f)=>{const g={};return mt(f,v=>{L2(v).each(_=>{const T=vP(r,_.pname);g[_.name]=P=>{const I=Es("Part: "+_.name+" in "+r,fo(_.schema),P);return{...T,config:P,validated:I}}})}),g},vP=(r,f)=>({uiType:wm(),owner:r,name:f}),WE=(r,f,g)=>({uiType:wm(),owner:r,name:f,config:g,validated:{}}),UE=r=>Ne(r,f=>f.fold(V.none,V.some,V.none,V.none).map(g=>sd(g.name,g.schema.concat([Ky(nS())]))).toArray()),YE=r=>je(r,VE),oS=(r,f,g)=>bP(r,f,g),ox=(r,f,g)=>eS(V.some(r),f,f.components,g),Ri=(r,f,g)=>{const v=f.partUids[g];return r.getSystem().getByUid(v).toOptional()},u1=(r,f,g)=>Ri(r,f,g).getOrDie("Could not find part: "+g),_O=(r,f,g)=>{const v={},_=f.partUids,T=r.getSystem();return mt(g,P=>{v[P]=G(T.getByUid(_[P]))}),v},sx=(r,f)=>{const g=r.getSystem();return Ns(f.partUids,(v,_)=>G(g.getByUid(v)))},XE=r=>Xs(r.partUids),rx=(r,f,g)=>{const v={},_=f.partUids,T=r.getSystem();return mt(g,P=>{v[P]=G(T.getByUid(_[P]).getOrDie())}),v},jE=(r,f)=>{const g=YE(f);return Uo(je(g,v=>({key:v,value:r+"-"+v})))},sS=r=>Wa("partUids","partUids",Ae(f=>jE(f.uid,r)),Vc());var OP=Object.freeze({__proto__:null,generate:nx,generateOne:WE,schemas:UE,names:YE,substitutes:oS,components:ox,defaultUids:jE,defaultUidsSchema:sS,getAllParts:sx,getAllPartNames:XE,getPart:Ri,getPartOrDie:u1,getParts:_O,getPartsOrDie:rx});const yP=(r,f)=>(r.length>0?[sd("parts",r)]:[]).concat([nn("uid"),xt("dom",{}),xt("components",[]),Ky("originalSpec"),xt("debug.sketcher",{})]).concat(f),qE=(r,f,g,v,_)=>{const T=yP(v,_);return Es(r+" [SpecSchema]",_i(T.concat(f)),g)},wP=(r,f,g,v)=>{const _=CO(v),T=qE(r,f,_,[],[]);return g(T,_)},ix=(r,f,g,v,_)=>{const T=CO(_),P=UE(g),I=sS(g),W=qE(r,f,T,P,[I]),J=oS(r,W,g),ie=ox(r,W,J.internals());return v(W,ie,T,J.externals())},SO=r=>vs(r,"uid"),CO=r=>SO(r)?r:{...r,uid:yh("uid")},rS=r=>r.uid!==void 0,GE=_i([nn("name"),nn("factory"),nn("configFields"),xt("apis",{}),xt("extraApis",{})]),Rh=_i([nn("name"),nn("factory"),nn("configFields"),nn("partFields"),xt("apis",{}),xt("extraApis",{})]),Kc=r=>{const f=Es("Sketcher for "+r.name,GE,r),g=T=>wP(f.name,f.configFields,f.factory,T),v=Ns(f.apis,ap),_=Ns(f.extraApis,(T,P)=>rd(T,P));return{name:f.name,configFields:f.configFields,sketch:g,...v,..._}},wu=r=>{const f=Es("Sketcher for "+r.name,Rh,r),g=P=>ix(f.name,f.configFields,f.partFields,f.factory,P),v=nx(f.name,f.partFields),_=Ns(f.apis,ap),T=Ns(f.extraApis,(P,I)=>rd(P,I));return{name:f.name,partFields:f.partFields,configFields:f.configFields,sketch:g,parts:v,..._,...T}},Op=r=>Yl("input")(r)&&zi(r,"type")!=="radio"||Yl("textarea")(r);var SP=Object.freeze({__proto__:null,getCurrent:(r,f,g)=>f.find(r)});const CP=[nn("find")],cr=nc({fields:CP,name:"composing",apis:SP}),kP=["input","button","textarea","select"],KE=(r,f,g)=>{(f.disabled()?F2:ax)(r,f)},iS=(r,f)=>f.useNative===!0&&st(kP,gl(r.element)),xP=r=>$e(r.element,"disabled"),to=r=>{qn(r.element,"disabled","disabled")},V0=r=>{Ue(r.element,"disabled")},TP=r=>zi(r.element,"aria-disabled")==="true",JE=r=>{qn(r.element,"aria-disabled","true")},aS=r=>{qn(r.element,"aria-disabled","false")},F2=(r,f,g)=>{f.disableClass.each(_=>{Na(r.element,_)}),(iS(r,f)?to:JE)(r),f.onDisabled(r)},ax=(r,f,g)=>{f.disableClass.each(_=>{va(r.element,_)}),(iS(r,f)?V0:aS)(r),f.onEnabled(r)},lx=(r,f)=>iS(r,f)?xP(r):TP(r);var OI=Object.freeze({__proto__:null,enable:ax,disable:F2,isDisabled:lx,onLoad:KE,set:(r,f,g,v)=>{(v?F2:ax)(r,f)}}),lS=Object.freeze({__proto__:null,exhibit:(r,f)=>Yc({classes:f.disabled()?f.disableClass.toArray():[]}),events:(r,f)=>li([Lv(af(),(g,v)=>lx(g,r)),i2(r,f,KE)])}),AP=[qa("disabled",tt),xt( Line truncated
Cannot use it for: `+El(J.element)+`
The conflicting element is`+(js(de.element)?" ":" not ")+"already in the DOM")},_=J=>{const ie=g(J);Qi(f,ie)&&v(J,ie);const de=[J];r.registerId(de,ie,J.events),f[ie]=J},T=J=>{rp(J.element).each(ie=>{delete f[ie],r.unregisterId(ie)})};return{find:(J,ie,de)=>r.find(J,ie,de),filter:J=>r.filterByType(J),register:_,unregister:T,getById:J=>ln(f,J)}},v1=Kc({name:"Container",factory:r=>{const{attributes:f,...g}=r.dom;return{uid:r.uid,dom:{tag:"div",attributes:{role:"presentation",...f},...g},components:r.components,behaviours:Om(r.containerBehaviours),events:r.events,domModification:r.domModification,eventOrder:r.eventOrder}},configFields:[xt("components",[]),Wl("containerBehaviours",[]),xt("events",{}),xt("domModification",{}),xt("eventOrder",{})]}),BM=r=>{const f=dt=>Ha(r.element).fold(ot,ft=>xr(dt,ft)),g=PY(),v=(dt,ft)=>g.find(f,dt,ft),_=_Y(r.element,{triggerEvent:(dt,ft)=>x0(dt,ft.target,Yt=>TY(v,dt,ft,Yt))}),T={debugInfo:G("real"),triggerEvent:(dt,ft,Yt)=>{x0(dt,ft,Dt=>vL(v,dt,Yt,ft,Dt))},triggerFocus:(dt,ft)=>{rp(dt).fold(()=>{gf(dt)},Yt=>{x0($d(),dt,Dt=>(kY(v,$d(),{originator:ft,kill:L,prevent:L,target:dt},dt,Dt),!1))})},triggerEscape:(dt,ft)=>{T.triggerEvent("keydown",dt.element,ft.event)},getByUid:dt=>it(dt),getByDom:dt=>Qt(dt),build:pc,buildOrPatch:ug,addToGui:dt=>{W(dt)},removeFromGui:dt=>{J(dt)},addToWorld:dt=>{P(dt)},removeFromWorld:dt=>{I(dt)},broadcast:dt=>{ge(dt)},broadcastOn:(dt,ft)=>{_e(dt,ft)},broadcastEvent:(dt,ft)=>{Ie(dt,ft)},isConnected:ot},P=dt=>{dt.connect(T),ol(dt.element)||(g.register(dt),mt(dt.components(),P),T.triggerEvent(og(),dt.element,{target:dt.element}))},I=dt=>{ol(dt.element)||(mt(dt.components(),I),g.unregister(dt)),dt.disconnect()},W=dt=>{cl(r,dt)},J=dt=>{qc(dt)},ie=()=>{_.unbind(),Mu(r.element)},de=dt=>{const ft=g.filter(im());mt(ft,Yt=>{const Dt=Yt.descHandler;Gp(Dt)(dt)})},ge=dt=>{de({universal:!0,data:dt})},_e=(dt,ft)=>{de({universal:!1,channels:dt,data:ft})},Ie=(dt,ft)=>{const Yt=g.filter(dt);return xY(Yt,ft)},it=dt=>g.getById(dt).fold(()=>wn.error(new Error('Could not find component with uid: "'+dt+'" in system.')),wn.value),Qt=dt=>{const ft=rp(dt).getOr("not found");return it(ft)};return P(r),{root:r,element:r.element,destroy:ie,add:W,remove:J,getByUid:it,getByDom:Qt,addToWorld:P,removeFromWorld:I,broadcast:ge,broadcastOn:_e,broadcastEvent:Ie}},MY=(r,f)=>({dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:je(r.items,f.interpreter)}),RY=G([xt("prefix","form-field"),Wl("fieldBehaviours",[cr,Gn])]),$Y=G([Yd({schema:[nn("dom")],name:"label"}),Yd({factory:{sketch:r=>({uid:r.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:r.text}})},schema:[nn("text")],name:"aria-descriptor"}),Gc({factory:{sketch:r=>{const f=Sn(r,["factory"]);return r.factory.sketch(f)}},schema:[nn("factory")],name:"field"})]),NY=(r,f,g,v)=>{const _=sc(r.fieldBehaviours,[cr.config({find:I=>Ri(I,r,"field")}),Gn.config({store:{mode:"manual",getValue:I=>cr.getCurrent(I).bind(Gn.getValue),setValue:(I,W)=>{cr.getCurrent(I).each(J=>{Gn.setValue(J,W)})}}})]),T=li([Ci((I,W)=>{const J=_O(I,r,["label","field","aria-descriptor"]);J.field().each(ie=>{const de=io(r.prefix);J.label().each(ge=>{qn(ge.element,"for",de),qn(ie.element,"id",de)}),J["aria-descriptor"]().each(ge=>{const _e=io(r.prefix);qn(ge.element,"id",_e),qn(ie.element,"aria-describedby",_e)})})})]),P={getField:I=>Ri(I,r,"field"),getLabel:I=>Ri(I,r,"label")};return{uid:r.uid,dom:r.dom,components:f,behaviours:_,events:T,apis:P}},si=wu({name:"FormField",configFields:RY(),partFields:$Y(),factory:NY,apis:{getField:(r,f)=>r.getField(f),getLabel:(r,f)=>r.getLabel(f)}});var IY=Object.freeze({__proto__:null,exhibit:(r,f)=>Yc({attributes:Uo([{key:f.tabAttr,value:"true"}])})}),OL=[xt("tabAttr","data-alloy-tabstop")];const Ka=nc({fields:OL,name:"tabstopping",active:IY});var BY=tinymce.util.Tools.resolve("tinymce.html.Entities");const Ux=(r,f,g,v)=>{const _=LY(r,f,g,v);return si.sketch(_)},yL=(r,f)=>Ux(r,f,[],[]),LY=(r,f,g,v)=>({dom:wL(g),components:r.toArray().concat([f]),fieldBehaviours:Tn(v)}),FY=()=>wL([]),wL=r=>({tag:"div",classes:["tox-form__group"].concat(r)}),iv=(r,f)=>si.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Li(f.translate(r))]}),Ih=io("form-component-change"),Yx=io("form-close"),BO=io("form-cancel"),Rb=io("form-action"),BS=io("form-submit"),LM=io("form-block"),sA=io("form-unblock"),_L=io("form-tabchange"),FM=io("form-resize"),QY=(r,f,g)=>{const v=r.label.map(de=>iv(de,f)),_=de=>(ge,_e)=>{df(_e.event.target,"[data-collection-item-value]").each(Ie=>{de(ge,_e,Ie,zi(Ie,"data-collection-item-value"))})},T=(de,ge)=>{const _e=je(ge,Qt=>{const dt=Cm.translate(Qt.text),ft=r.columns===1?`<div class="tox-collection__item-label">${dt}</div>`:"",Yt=`<div class="tox-collection__item-icon">${Qt.icon}</div>`,Dt={_:" "," - ":" ","-":" "},kn=dt.replace(/\_| \- |\-/g,Nn=>Dt[Nn]);return`<div class="tox-collection__item${f.isDisabled()?" tox-collection__item--state-disabled":""}" tabindex="-Line truncated
`+JSON.stringify(r));sv.setItem(YS,JSON.stringify(r))},DF=r=>{const f=EF();return ln(f,r).getOr([])},eae=(r,f)=>{if(!xF(r))return;const g=EF(),v=ln(g,f).getOr([]),_=Kn(v,T=>T!==r);g[f]=[r].concat(_).slice(0,kF),AF(g)},Tq=r=>!!r,Xu=r=>Ns(fv.makeMap(r,/[, ]/),Tq),pT=r=>V.from(vB(r)),Eq=r=>{const f=V.from(y5(r)).filter(Tq).map(Xu);return pT(r).fold(tt,g=>f.fold(ot,v=>Xs(v).length>0?v:!1))},GA=(r,f)=>{const g=Eq(r);return E(g)?g?pT(r):V.none():g[f]?pT(r):V.none()},Aq=(r,f)=>GA(r,f).map(g=>v=>Yu.nu(_=>{const T=(I,W)=>{if(!d(I))throw new Error("Expected value to be string");if(W!==void 0&&!h(W))throw new Error("Expected meta to be a object");_({value:I,meta:W})},P={filetype:f,fieldname:v.fieldname,...V.from(v.meta).getOr({})};g.call(r,T,v.value,P)})),PF=r=>V.from(r).filter(d).getOrUndefined(),Dq=r=>wB(r)?V.some({targets:_1.find(r.getBody()),anchorTop:PF(_B(r)),anchorBottom:PF(T3(r))}):V.none(),Pq=r=>V.from(OB(r)),Mq=r=>({getHistory:DF,addToHistory:eae,getLinkInformation:()=>Dq(r),getValidationHandler:()=>Pq(r),getUrlPicker:f=>Aq(r,f)}),Rq=(r,f,g,v)=>{const _=Ho(!1),T=fq(f),P={icons:()=>f.ui.registry.getAll().icons,menuItems:()=>f.ui.registry.getAll().menuItems,translate:Cm.translate,isDisabled:()=>f.mode.isReadOnly()||!f.ui.isEnabled(),getOption:f.options.get},I=Mq(f),W=XA(f),J=cq(f),ie=pF(f),de=()=>_.get(),ge=Qt=>_.set(Qt),_e={shared:{providers:P,anchors:gF(f,g,v,T.isPositionedAtTop),header:T},urlinput:I,styles:W,colorinput:J,dialog:ie,isContextMenuOpen:de,setContextMenuState:ge},Ie={..._e,shared:{..._e.shared,interpreter:Qt=>US(Qt,{},Ie),getSink:r.popup}},it={..._e,shared:{..._e.shared,interpreter:Qt=>US(Qt,{},it),getSink:r.dialog}};return{popup:Ie,dialog:it}},$q=(r,f,g)=>{const v=(pn,Nn)=>{mt([f,...g],jn=>{jn.broadcastEvent(pn,Nn)})},_=(pn,Nn)=>{mt([f,...g],jn=>{jn.broadcastOn([pn],Nn)})},T=pn=>_(Dh(),{target:pn.target}),P=rh(),I=Mc(P,"touchstart",T),W=Mc(P,"touchmove",pn=>v(du(),pn)),J=Mc(P,"touchend",pn=>v(Bf(),pn)),ie=Mc(P,"mousedown",T),de=Mc(P,"mouseup",pn=>{pn.raw.button===0&&_(Hk(),{target:pn.target})}),ge=pn=>_(Dh(),{target:lt.fromDom(pn.target)}),_e=pn=>{pn.button===0&&_(Hk(),{target:lt.fromDom(pn.target)})},Ie=()=>{mt(r.editorManager.get(),pn=>{r!==pn&&pn.dispatch("DismissPopups",{relatedTarget:r})})},it=pn=>v(sg(),ll(pn)),Qt=pn=>{_(kb(),{}),v(gh(),ll(pn))},dt=$t(lt.fromDom(r.getElement())),ft=gb(dt,"scroll",pn=>{requestAnimationFrame(()=>{const Nn=r.getContainer();if(Nn!=null){const Ys=lw(r,f.element).map(ko=>[ko.element,...ko.others]).getOr([]);rn(Ys,ko=>xr(ko,pn.target))&&(r.dispatch("ElementScroll",{target:pn.target.dom}),v(ph(),pn))}})}),Yt=()=>_(kb(),{}),Dt=pn=>{pn.state&&_(Dh(),{target:lt.fromDom(r.getContainer())})},kn=pn=>{_(Dh(),{target:lt.fromDom(pn.relatedTarget.getContainer())})};r.on("PostRender",()=>{r.on("click",ge),r.on("tap",ge),r.on("mouseup",_e),r.on("mousedown",Ie),r.on("ScrollWindow",it),r.on("ResizeWindow",Qt),r.on("ResizeEditor",Yt),r.on("AfterProgressState",Dt),r.on("DismissPopups",kn)}),r.on("remove",()=>{r.off("click",ge),r.off("tap",ge),r.off("mouseup",_e),r.off("mousedown",Ie),r.off("ScrollWindow",it),r.off("ResizeWindow",Qt),r.off("ResizeEditor",Yt),r.off("AfterProgressState",Dt),r.off("DismissPopups",kn),ie.unbind(),I.unbind(),W.unbind(),J.unbind(),de.unbind(),ft.unbind()}),r.on("detach",()=>{mt([f,...g],Bk),mt([f,...g],pn=>pn.destroy())})},Rc=OP,S1=z0,KA=G([xt("shell",!1),nn("makeItem"),xt("setupItem",L),ym.field("listBehaviours",[gs])]),MF=Yd({name:"items",overrides:()=>({behaviours:Tn([gs.config({})])})}),Nq=G([MF]),RF=G("CustomList"),Iq=(r,f,g,v)=>{const _=(I,W)=>{P(I).fold(()=>{throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")},J=>{const ie=gs.contents(J),de=W.length,ge=de-ie.length,_e=ge>0?Et(ge,()=>r.makeItem()):[],Ie=ie.slice(de);mt(Ie,Qt=>gs.remove(J,Qt)),mt(_e,Qt=>gs.append(J,Qt));const it=gs.contents(J);mt(it,(Qt,dt)=>{r.setupItem(I,Qt,W[dt],dt)})})},T=r.shell?{behaviours:[gs.config({})],components:[]}:{behaviours:[],components:f},P=I=>r.shell?V.some(I):Ri(I,r,"items");return{uid:r.uid,dom:r.dom,components:T.components,behaviours:sc(r.listBehaviours,T.behaviours),apis:{setItems:_}}},$F=wu({name:RF(),configFields:KA(),partFields:Nq(),factory:Iq,apis:{setItems:(r,f,g)=>{r.setItems(f,g)}}}),gw=G([nn("dom"),xt("shell",!0),Wl("toolbarBehaviours",[gs])]),nae=G([Yd({name:"groups",overrides:()=>({behaviours:Tn([gs.config({})])})})]),Bq=(r,f,g,v)=>{const _=(I,W)=>{T(I).fold(()=>{throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},J=>{gs.set(J,W)})},T=I=>r.shell?V.some(I):Ri(I,r,"groups"),P=r.shell?{behaviours:[gs.config({})],components:[]}:{behaviours:[],components:f};return{uid:r.uid,dom:r.dom,components:P.components,behaviours:sc(r. Line truncated
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.143 0c2.608.015 5.186 2.178 5.186 5.331 0 0 .077 3.812-.084 4.87-.361 2.41-2.164 4.074-4.65 4.496-1.453.284-2.523.49-3.212.623-.373.071-.634.122-.785.152-.184.038-.997.145-1.35.145-2.732 0-5.21-2.04-5.248-5.33 0 0 0-3.514.03-4.442.093-2.4 1.758-4.342 4.926-4.963 0 0 3.875-.752 4.036-.782.368-.07.775-.1 1.15-.1Zm1.826 2.8L5.83 3.989v2.393l-2.455.475v5.968l6.137-1.189V9.243l2.456-.476V2.8ZM5.83 6.382l3.682-.713v3.574l-3.682.713V6.382Zm27.173-1.64-.084-1.066h-2.226v9.132h2.456V7.743c-.008-1.151.998-2.064 2.149-2.072 1.15-.008 1.987.92 1.995 2.072v5.065h2.455V7.359c-.015-2.18-1.657-3.929-3.837-3.913a3.993 3.993 0 0 0-2.908 1.296Zm-6.3-4.266L29.16 0v2.387l-2.456.475V.476Zm0 3.2v9.132h2.456V3.676h-2.456Zm18.179 11.787L49.11 3.676H46.58l-1.612 4.527-.46 1.382-.384-1.382-1.611-4.527H39.98l3.3 9.132L42.15 16l2.732-.537ZM22.867 9.738c0 .752.568 1.075.921 1.075.353 0 .668-.047.998-.154l.537 1.765c-.23.154-.92.537-2.225.537-1.305 0-2.655-.997-2.686-2.686a136.877 136.877 0 0 1 0-4.374H18.8V3.676h1.612v-1.98l2.455-.476v2.456h2.302V5.9h-2.302v3.837Z"/>
</svg>
`;const mee=r=>r.nodeName==="BR"||!!r.getAttribute("data-mce-bogus")||r.getAttribute("data-mce-type")==="bookmark",gee=(r,f,g)=>{var v;const _=(v=f.delimiter)!==null&&v!==void 0?v:"\u203A",T=(J,ie,de)=>Jc.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{"data-index":de,"aria-level":de+1}},components:[Li(J)],action:ge=>{r.focus(),r.selection.select(ie),r.nodeChanged()},buttonBehaviours:Tn([xg.button(g.isDisabled),rc()])}),P=()=>({dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0}},components:[Li(` ${_} `)]}),I=J=>Yo(J,(ie,de,ge)=>{const _e=T(de.name,de.element,ge);return ge===0?ie.concat([_e]):ie.concat([P(),_e])},[]),W=J=>{const ie=[];let de=J.length;for(;de-- >0;){const ge=J[de];if(ge.nodeType===1&&!mee(ge)){const _e=Nh(r,ge);if(_e.isDefaultPrevented()||ie.push({name:_e.name,element:ge}),_e.isPropagationStopped())break}}return ie};return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:Tn([No.config({mode:"flow",selector:"div[role=button]"}),Jo.config({disabled:g.isDisabled}),rc(),Ka.config({}),gs.config({}),xs("elementPathEvents",[Ci((J,ie)=>{r.shortcuts.add("alt+F11","focus statusbar elementpath",()=>No.focusIn(J)),r.on("NodeChange",de=>{const ge=W(de.parents),_e=ge.length>0?I(ge):[];gs.set(J,_e)})})])]),components:[]}};var jO;(function(r){r[r.None=0]="None",r[r.Both=1]="Both",r[r.Vertical=2]="Vertical"})(jO||(jO={}));const pee=(r,f,g,v,_)=>{const T={height:S4(v+f.top,h5(r),m5(r))};return g===jO.Both&&(T.width=S4(_+f.left,Cx(r),yS(r))),T},rZ=(r,f,g)=>{const v=lt.fromDom(r.getContainer()),_=pee(r,f,g,Ii(v),ta(v));dr(_,(T,P)=>{U(T)&&ro(v,P,B$(T))}),j3(r)},bee=r=>{const f=CB(r);return f===!1?jO.None:f==="both"?jO.Both:jO.Vertical},R4=(r,f,g,v)=>{const T=pr(g*20,v*20);return rZ(r,T,f),V.some(!0)},vee=(r,f)=>{const g=bee(r);if(g===jO.None)return V.none();const v=g===jO.Both?"Press the arrow keys to resize the editor.":"Press the Up and Down arrow keys to resize the editor.";return V.some(Sp("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:f.translate("Resize"),"aria-label":f.translate(v)},behaviours:[Cw.config({mode:"mouse",repositionTarget:!1,onDrag:(_,T,P)=>rZ(r,P,g),blockerClass:"tox-blocker"}),No.config({mode:"special",onLeft:()=>R4(r,g,-1,0),onRight:()=>R4(r,g,1,0),onUp:()=>R4(r,g,0,-1),onDown:()=>R4(r,g,0,1)}),Ka.config({}),ns.config({})]},f.icons))},Oee=(r,f)=>{const g=(v,_,T)=>gs.set(v,[Li(f.translate(["{0} "+T,_[T]]))]);return Jc.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:Tn([xg.button(f.isDisabled),rc(),Ka.config({}),gs.config({}),Gn.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),xs("wordcount-events",[hu(v=>{const _=Gn.getValue(v),T=_.mode==="words"?"characters":"words";Gn.setValue(v,{mode:T,count:_.count}),g(v,_.count,T)}),Ci(v=>{r.on("wordCountUpdate",_=>{const{mode:T}=Gn.getValue(v);Gn.setValue(v,{mode:T,count:_.wordCount}),g(v,_.wordCount,T)})})])]),eventOrder:{[af()]:["disabling","alloy.base.behaviour","wordcount-events"]}})},yee=(r,f)=>{const g=()=>({dom:{tag:"span",classes:["tox-statusbar__branding"]},components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/powered-by-tiny?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v6",rel:"noopener",target:"_blank","aria-label":Cm.translate(["Powered by {0}","Tiny"])},innerHtml:dN.trim()},behaviours:Tn([ns.config({})])}]}),v=()=>{const I=J5("Alt+0"),W="Press {0} for help";return{dom:{tag:"div",classes:["tox-statusbar__help-text"]},components:[Li(Cm.translate([W,I]))]}},_=()=>{const I=[];return r.hasPlugin("wordcount")&&I.push(Oee(r,f)),Tx(r)&&I.push(g()),{dom:{tag:"div",classes:["tox-statusbar__right-container"]},components:I}},T=()=>{const I=[],W=EB(r),J=SB(r),ie=Tx(r)||r.hasPlugin("wordcount"),de=()=>{const ge="tox-statusbar__text-container--flex-start",_e="tox-statusbar__text-container--flex-end",Ie="tox-statusbar__text-container--space-around";if(W){const it="tox-statusbar__text-container-3-cols";return!ie&&!J?[it,Ie]:ie&&!J?[it,_e]:[it,ge]}return[ie&&!J?_e:ge]};return J&&I.push(gee(r,{},f)),W&&I.push(v()),ie&&I.push(_()),I.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container",...de()]},components:I}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(()=>{const I=T(),W=vee(r,f);return I.concat(W.toArray())})()}},iZ=(r,f)=>f.get().getOrDie(`UI for ${r} has not been rendered`),wee=(r,f)=>{const g=r.inline,v=g?KK:VK,_=Dx(r)?rG:Fq,T=JK(),P=Xi(),I=Xi(),W=Xi(),ge=an().deviceType.isTouch()?["tox-platform-touch"]:[],_e=C5(r),Ie=_S(r),it=oi({dom:{tag:"div",classes:["tox-anchorbar"]}}),Qt=oi({dom:{tag:"div",classes:["tox-bottom-anchorbar"]}}),dt=()=>T.mainUi.get().map(Wo=>Wo.outerContainer).bind(ji.getHeader),ft=()=>wn.fromOption(T.dialogUi.get().map(Wo=>Wo.sink),"UI has not been rendered"),Yt=()=>wn.fromOption(T.popupUi.get().map(Wo=>Wo.sink),"(popup) UI has not Line truncated
`+JSON.stringify(f,null,2)).message),getBounds:r.getDragBounds})])})}),Gc({schema:[nn("dom")],name:"title"}),Gc({factory:hN,schema:[nn("dom")],name:"close"}),Gc({factory:hN,schema:[nn("dom")],name:"body"}),Yd({factory:hN,schema:[nn("dom")],name:"footer"}),Mh({factory:{sketch:(r,f)=>({...r,dom:f.dom,components:f.components})},schema:[xt("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),xt("components",[])],name:"blocker"})]),kee=(r,f,g,v)=>{const _=Xi(),T=_e=>{_.set(_e);const Ie=r.lazySink(_e).getOrDie(),it=v.blocker(),Qt=Ie.getSystem().build({...it,components:it.components.concat([gu(_e)]),behaviours:Tn([ns.config({}),xs("dialog-blocker-events",[lg(Gi(),()=>{Lh.isBlocked(_e)?L():No.focusIn(_e)})])])});cl(Ie,Qt),No.focusIn(_e)},P=_e=>{_.clear(),Ha(_e.element).each(Ie=>{_e.getSystem().getByDom(Ie).each(it=>{qc(it)})})},I=_e=>u1(_e,r,"body"),W=_e=>Ri(_e,r,"footer"),J=(_e,Ie)=>{Lh.block(_e,Ie)},ie=_e=>{Lh.unblock(_e)},de=io("modal-events"),ge={...r.eventOrder,[Lu()]:[de].concat(r.eventOrder["alloy.system.attached"]||[])};return{uid:r.uid,dom:r.dom,components:f,apis:{show:T,hide:P,getBody:I,getFooter:W,setIdle:ie,setBusy:J},eventOrder:ge,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:sc(r.modalBehaviours,[gs.config({}),No.config({mode:"cyclic",onEnter:r.onExecute,onEscape:r.onEscape,useTabstopAt:r.useTabstopAt,firstTabstop:r.firstTabstop}),Lh.config({getRoot:_.get}),xs(de,[Ci(_e=>{_ee(_e.element,u1(_e,r,"title").element)})])])}},Nl=wu({name:"ModalDialog",configFields:See(),partFields:Cee(),factory:kee,apis:{show:(r,f)=>{r.show(f)},hide:(r,f)=>{r.hide(f)},getBody:(r,f)=>r.getBody(f),getFooter:(r,f)=>r.getFooter(f),setBusy:(r,f,g)=>{r.setBusy(f,g)},setIdle:(r,f)=>{r.setIdle(f)}}}),xee=fo([$l,Q3].concat(tw)),Tee=Iu,mN=[Q5("button"),kg,Bu("align","end",["start","end"]),TS,kp,l0("buttonType",["primary","secondary"])],aZ=[...mN,m1],gN=[Ua("type",["submit","cancel","custom"]),...aZ],Eee=[Ua("type",["menu"]),MO,tv,kg,Hl("items",xee),...mN],lZ=[...mN,Ua("type",["togglebutton"]),xa("tooltip"),kg,MO,ja("active",!1)],Aee=xl("type",{submit:gN,cancel:gN,custom:gN,menu:Eee,togglebutton:lZ}),Dee=[$l,m1,Ua("level",["info","warn","error","success"]),N5,xt("url","")],Pee=fo(Dee),Mee=r=>[$l,r],Ree=[$l,m1,kp,Q5("button"),kg,L5,l0("buttonType",["primary","secondary","toolbar"]),TS],pN=fo(Ree),kw=[$l,Q3],x1=kw.concat([B5]),$ee=kw.concat([$5,kp]),Nee=fo($ee),Iee=Iu,Bee=x1.concat([z3("auto")]),Lee=fo(Bee),Fee=ch([J2,m1,N5]),Qee=x1.concat([mc("storageKey","default")]),Zee=fo(Qee),Hee=bl,zee=fo(x1),Vee=bl,Wee=kw.concat([mc("tag","textarea"),xa("scriptId"),xa("scriptUrl"),qm("settings",void 0)]),Uee=kw.concat([mc("tag","textarea"),Wc("init")]),Yee=of(r=>Ui("customeditor.old",_i(Uee),r).orThunk(()=>Ui("customeditor.new",_i(Wee),r))),Xee=bl,qee=fo(x1),Gee=uh(),Kee=r=>[$l,a0("columns"),r],Jee=[$l,xa("html"),Bu("presets","presentation",["presentation","document"])],ete=fo(Jee),tte=x1.concat([ja("border",!1),ja("sandboxed",!0),ja("streamContent",!1),ja("transparent",!0)]),nte=fo(tte),ote=bl,cZ=fo(kw.concat([Jl("height")])),uZ=fo([xa("url"),fh("zoom"),fh("cachedWidth"),fh("cachedHeight")]),xw=x1.concat([Jl("inputMode"),Jl("placeholder"),ja("maximized",!1),kp]),ste=fo(xw),bN=bl,$4=r=>[$l,$5,r,Bu("align","start",["start","center","end"])],rte=[m1,J2],ite=[m1,Hl("items",sf("items",()=>fZ))],fZ=Jn([fo(rte),fo(ite)]),ate=x1.concat([Hl("items",fZ),kp]),lte=fo(ate),Tw=bl,dZ=x1.concat([Yp("items",[m1,J2]),au("size",1),kp]),cte=fo(dZ),ute=bl,fte=x1.concat([ja("constrain",!0),kp]),dte=fo(fte),hZ=fo([xa("width"),xa("height")]),hte=kw.concat([$5,au("min",0),au("max",0)]),mte=fo(hte),gte=Pd,vN=[$l,Hl("header",bl),Hl("cells",Dd(bl))],IT=fo(vN),ON=x1.concat([Jl("placeholder"),ja("maximized",!1),kp]),N4=fo(ON),Ew=bl,BT=[Ua("type",["directory","leaf"]),Z3,xa("id"),Ya("menu",OT)],yN=fo(BT),mZ=BT.concat([Hl("children",sf("children",()=>Md("type",{directory:wN,leaf:yN})))]),wN=fo(mZ),pte=Md("type",{directory:wN,leaf:yN}),bte=[$l,Hl("items",pte),jm("onLeafAction"),jm("onToggleExpand"),lu("defaultExpandedIds",[],bl),Jl("defaultSelectedId")],vte=fo(bte),gZ=x1.concat([Bu("filetype","file",["image","media","file"]),kp]),pZ=fo(gZ),_N=fo([J2,F5]),SN=r=>Wa("items","items",wr(),Dd(of(f=>Ui(`Checking item of ${r}`,CN,f).fold(g=>wn.error(Rd(g)),g=>wn.value(g))))),CN=pl(()=>Md("type",{alertbanner:Pee,bar:fo(Mee(SN("bar"))),button:pN,checkbox:Nee,colorinput:Zee,colorpicker:zee,dropzone:qee,grid:fo(Kee(SN("grid"))),iframe:nte,input:ste,listbox:lte,selectbox:cte,sizeinput:dte,slider:mte,textarea:N4,urlinput:pZ,customeditor:Yee,htmlpanel:ete,imagepreview:cZ,collection:Lee,label:fo($4(SN("label"))),table:IT,tree:vte,panel:kN})),Ote=[$l,xt("classes",[]),Hl("items",CN)],kN=fo(Ote),yte=[Q5("tab"),Z3,Hl("items",CN)],wte=[$l,Yp("tabs",yte)],_te=fo(wte),xN=aZ,TN=Aee,Ste=fo([xa("title"),Kr("body",Md("type",{panel:kN,tabpanel:_te})),mc("size","normal"),lu("buttons",[],TN),xt("initialData",{}),qa("onAction",L),qa("onChan Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Ot=Object.hasOwnProperty,wt=Object.setPrototypeOf,Pt=Object.isFrozen,hn=Object.getPrototypeOf,Hn=Object.getOwnPropertyDescriptor,$n=Object.freeze,Lt=Object.seal,Zt=Object.create,yn=typeof Reflect<"u"&&Reflect,yo=yn.apply,Do=yn.construct;yo||(yo=function(f,g,v){return f.apply(g,v)}),$n||($n=function(f){return f}),Lt||(Lt=function(f){return f}),Do||(Do=function(f,g){return fe(f,be(g))});var Cs=Bs(Array.prototype.forEach),Ws=Bs(Array.prototype.pop),Ir=Bs(Array.prototype.push),pi=Bs(String.prototype.toLowerCase),fl=Bs(String.prototype.match),Il=Bs(String.prototype.replace),Oc=Bs(String.prototype.indexOf),Pn=Bs(String.prototype.trim),eo=Bs(RegExp.prototype.test),Cr=Co(TypeError);function Bs(r){return function(f){for(var g=arguments.length,v=new Array(g>1?g-1:0),_=1;_<g;_++)v[_-1]=arguments[_];return yo(r,f,v)}}function Co(r){return function(){for(var f=arguments.length,g=new Array(f),v=0;v<f;v++)g[v]=arguments[v];return Do(r,g)}}function Mn(r,f){wt&&wt(r,null);for(var g=f.length;g--;){var v=f[g];if(typeof v=="string"){var _=pi(v);_!==v&&(Pt(f)||(f[g]=_),v=_)}r[v]=!0}return r}function En(r){var f=Zt(null),g;for(g in r)yo(Ot,r,[g])&&(f[g]=r[g]);return f}function jo(r,f){for(;r!==null;){var g=Hn(r,f);if(g){if(g.get)return Bs(g.get);if(typeof g.value=="function")return Bs(g.value)}r=hn(r)}function v(_){return console.warn("fallback value for",_),null}return v}var Ks=$n(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Jr=$n(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ho=$n(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Us=$n(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ci=$n(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),Ja=$n(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ei=$n(["#text"]),$c=$n(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Qh=$n(["accent-height","accumulate","additive","alignment-baseline","as Line truncated
`+Hh),ty&&(Hh=Il(Hh,Qo," "),Hh=Il(Hh,fr," ")),Dt&&AZ?Dt.createHTML(Hh):Hh},f.setConfig=function(ir){Yte(ir),PN=!0},f.clearConfig=function(){j4=null,PN=!1},f.isValidAttribute=function(ir,qt,To){j4||Yte({});var Ts=jT(ir),Ul=jT(qt);return Hae(Ts,Ul,To)},f.addHook=function(ir,qt){typeof qt=="function"&&(vr[ir]=vr[ir]||[],Ir(vr[ir],qt))},f.removeHook=function(ir){if(vr[ir])return Ws(vr[ir])},f.removeHooks=function(ir){vr[ir]&&(vr[ir]=[])},f.removeAllHooks=function(){vr={}},f}var T1=cC();const uC=r=>T1().sanitize(r),Mw=OS.deviceType.isTouch(),vv=(r,f)=>({dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[r,f]}),HT=(r,f)=>Nl.parts.close(Jc.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":f.translate("Close")}},action:r,buttonBehaviours:Tn([Ka.config({})])})),zT=()=>Nl.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}}),Ib=(r,f)=>Nl.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:UO(`<p>${uC(f.translate(r))}</p>`)}]}]}),Ov=r=>Nl.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:r}),VT=(r,f)=>[v1.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:r}),v1.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:f})],WT=r=>{const f="tox-dialog",g=f+"-wrap",v=g+"__backdrop",_=f+"__disable-scroll";return Nl.sketch({lazySink:r.lazySink,onEscape:T=>(r.onEscape(T),V.some(!0)),useTabstopAt:T=>!nT(T),firstTabstop:r.firstTabstop,dom:{tag:"div",classes:[f].concat(r.extraClasses),styles:{position:"relative",...r.extraStyles}},components:[r.header,r.body,...r.footer.toArray()],parts:{blocker:{dom:UO(`<div class="${g}"></div>`),components:[{dom:{tag:"div",classes:Mw?[v,v+"--opaque"]:[v]}}]}},dragBlockClass:g,modalBehaviours:Tn([ns.config({}),xs("dialog-events",r.dialogEvents.concat([lg(Gi(),(T,P)=>{Lh.isBlocked(T)?L():No.focusIn(T)}),on(Rv(),(T,P)=>{T.getSystem().broadcastOn([ZS],{newFocus:P.event.newFocus})})])),xs("scroll-lock",[Ci(()=>{Na(Hi(),_)}),Ld(()=>{va(Hi(),_)})]),...r.extraBehaviours]),eventOrder:{[af()]:["dialog-events"],[Lu()]:["scroll-lock","dialog-events","alloy.base.behaviour"],[Nd()]:["alloy.base.behaviour","dialog-events","scroll-lock"],...r.eventOrder}})},UT=r=>Jc.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":r.translate("Close"),title:r.translate("Close")}},buttonBehaviours:Tn([Ka.config({})]),components:[Sp("close",{tag:"span",classes:["tox-icon"]},r.icons)],action:f=>{rr(f,BO)}}),V4=(r,f,g,v)=>{const _=T=>[Li(v.translate(T.title))];return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:{...g.map(T=>({id:T})).getOr({})}},components:[],behaviours:Tn([Am.config({channel:`${w1}-${f}`,initialData:r,renderComponents:_})])}},W4=()=>({dom:UO('<div class="tox-dialog__draghandle"></div>')}),kZ=(r,f,g,v)=>v1.sketch({dom:UO('<div class="tox-dialog__header"></div>'),components:[V4(r,f,V.some(g),v),W4(),UT(v)],containerBehaviours:Tn([Cw.config({mode:"mouse",blockerClass:"blocker",getTarget:_=>df(_,'[role="dialog"]').getOrDie(),snaps:{getSnapPoints:()=>[],leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}),E1=(r,f,g)=>{const v=Nl.parts.title(V4(r,f,V.none(),g)),_=Nl.parts.draghandle(W4()),T=Nl.parts.close(UT(g)),P=[v].concat(r.draggable?[_]:[]).concat([T]);return v1.sketch({dom:UO('<div class="tox-dialog__header"></div>'),components:P})},Rw=(r,f,g)=>E1({title:g.shared.providers.translate(r),draggable:g.dialog.isDraggableModal()},f,g.shared.providers),Mt=(r,f,g,v)=>({dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":g.translate(r)},styles:{left:"0px",right:"0px",bottom:"0px",top:`${v.getOr(0)}px`,position:"absolute"}},behaviours:f,components:[{dom:UO('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}),Rt=(r,f,g)=>({onClose:()=>g.closeWindow(),onBlock:v=>{const _=sa(r().element,".tox-dialog__header").map(T=>Ii(T));Nl.setBusy(r(),(T,P)=>Mt(v.message,P,f,_))},onUnblock:()=>{Nl.setIdle(r())}}),Rn=(r,f,g,v)=>{const _=(T,P)=>V.some(P);return pc(WT({...r,firstTabstop:1,lazySink:v.shared.getSink,extraBehaviours:[Am.config({channel:`${CA}-${r.id}`,updateState:_,initialData:f}),uv({}),...r.extraBehaviours],onEscape:T=>{rr(T,BO)},dialogEvents:g,eventOrder:{[im()]:[Am.name(),Pc.name()],[Lu()]:["scroll-lock",Am.name(),"messages","dialog-events","alloy.base.behaviour"],[Nd()]:["alloy.base.behaviour","dialog-events","messages",Am.name(),"scroll-lock"]}}))},xn=(r,f={})=>{const g=v=>{const _=je(v.items,T=>{const P=ln(f,T.name).getOr(Ho(!1));return{...T,storage:P}});return{...v,items:_}};return je(r,v=>v.type==="menu"?g(v):v)},Io=r=>Yo(r,(f,g)=>g.type==="menu"?Yo(g.items,(_,T)=>(_[T.name]=T.storage,_),f):f,{}),br=(r,f)=>[Ay(Gi(),ej),r(Yx,(g,v,_,T)=>{Qf($t(T.element)).fold(L,Kv),f.onClose(),v.onClose()}),rLine truncated
`;(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(De,nt,bt)=>{var $t;return bt(De,nt.prototype)?!0:(($t=De.constructor)===null||$t===void 0?void 0:$t.name)===nt.name},t=De=>{const nt=typeof De;return De===null?"null":nt==="object"&&Array.isArray(De)?"array":nt==="object"&&e(De,String,(bt,$t)=>$t.isPrototypeOf(bt))?"string":nt},s=De=>nt=>t(nt)===De,a=De=>nt=>typeof nt===De,l=De=>nt=>De===nt,u=s("string"),d=s("object"),h=s("array"),b=l(null),y=a("boolean"),C=De=>De==null,E=De=>!C(De),R=a("function"),$=(De,nt)=>{if(h(De)){for(let bt=0,$t=De.length;bt<$t;++bt)if(!nt(De[bt]))return!1;return!0}return!1},Q=()=>{},F=De=>()=>De,U=(De,nt)=>De===nt;class K{constructor(nt,bt){this.tag=nt,this.value=bt}static some(nt){return new K(!0,nt)}static none(){return K.singletonNone}fold(nt,bt){return this.tag?bt(this.value):nt()}isSome(){return this.tag}isNone(){return!this.tag}map(nt){return this.tag?K.some(nt(this.value)):K.none()}bind(nt){return this.tag?nt(this.value):K.none()}exists(nt){return this.tag&&nt(this.value)}forall(nt){return!this.tag||nt(this.value)}filter(nt){return!this.tag||nt(this.value)?this:K.none()}getOr(nt){return this.tag?this.value:nt}or(nt){return this.tag?this:nt}getOrThunk(nt){return this.tag?this.value:nt()}orThunk(nt){return this.tag?this:nt()}getOrDie(nt){if(this.tag)return this.value;throw new Error(nt!=null?nt:"Called getOrDie on None")}static from(nt){return E(nt)?K.some(nt):K.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(nt){this.tag&&nt(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}K.singletonNone=new K(!1);const L=Array.prototype.indexOf,te=Array.prototype.push,ne=(De,nt)=>L.call(De,nt),oe=(De,nt)=>ne(De,nt)>-1,G=(De,nt)=>{const bt=De.length,$t=new Array(bt);for(let On=0;On<bt;On++){const Mo=De[On];$t[On]=nt(Mo,On)}return $t},we=(De,nt)=>{for(let bt=0,$t=De.length;bt<$t;bt++){const On=De[bt];nt(On,bt)}},ve=(De,nt,bt)=>(we(De,($t,On)=>{bt=nt(bt,$t,On)}),bt),Re=De=>{const nt=[];for(let bt=0,$t=De.length;bt<$t;++bt){if(!h(De[bt]))throw new Error("Arr.flatten item "+bt+" was not an array, input: "+De);te.apply(nt,De[bt])}return nt},Oe=(De,nt)=>Re(G(De,nt)),ce=(De,nt)=>{for(let bt=0;bt<De.length;bt++){const $t=nt(De[bt],bt);if($t.isSome())return $t}return K.none()},Xe=(De,nt,bt=U)=>De.exists($t=>bt($t,nt)),tt=De=>{const nt=[],bt=$t=>{nt.push($t)};for(let $t=0;$t<De.length;$t++)De[$t].each(bt);return nt},ot=(De,nt)=>De?K.some(nt):K.none(),V=De=>nt=>nt.options.get(De),ut=De=>{const nt=De.options.register;nt("link_assume_external_targets",{processor:bt=>{const $t=u(bt)||y(bt);return $t?bt===!0?{value:1,valid:$t}:bt==="http"||bt==="https"?{value:bt,valid:$t}:{value:0,valid:$t}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),nt("link_context_toolbar",{processor:"boolean",default:!1}),nt("link_list",{processor:bt=>u(bt)||R(bt)||$(bt,d)}),nt("link_default_target",{processor:"string"}),nt("link_default_protocol",{processor:"string",default:"https"}),nt("link_target_list",{processor:bt=>y(bt)||$(bt,d),default:!0}),nt("link_rel_list",{processor:"object[]",default:[]}),nt("link_class_list",{processor:"object[]",default:[]}),nt("link_title",{processor:"boolean",default:!0}),nt("allow_unsafe_link_target",{processor:"boolean",default:!1}),nt("link_quicklink",{processor:"boolean",default:!1})},Qe=V("link_assume_external_targets"),Bt=V("link_context_toolbar"),Ct=V("link_list"),He=V("link_default_target"),st=V("link_default_protocol"),rn=V("link_target_list"),Et=V("link_rel_list"),Cn=V("link_class_list"),je=V("link_title"),mt=V("allow_unsafe_link_target"),he=V("link_quicklink");var Zo=tinymce.util.Tools.resolve("tinymce.util.Tools");const Kn=De=>u(De.value)?De.value:"",so=De=>u(De.text)?De.text:u(De.title)?De.title:"",Yo=(De,nt)=>{const bt=[];return Zo.each(De,$t=>{const On=so($t);if($t.menu!==void 0){const Mo=Yo($t.menu,nt);bt.push({text:On,items:Mo})}else{const Mo=nt($t);bt.push({text:On,value:Mo})}}),bt},as=(De=Kn)=>nt=>K.from(nt).map(bt=>Yo(bt,De)),pt={sanitize:De=>as(Kn)(De),sanitizeWith:as,createUi:(De,nt)=>bt=>({name:De,type:"listbox",label:nt,items:bt}),getValue:Kn},Ne=Object.keys,Gt=Object.hasOwnProperty,bn=(De,nt)=>{const bt=Ne(De);for(let $t=0,On=bt.length;$t<On;$t++){const Mo=bt[$t],$r=De[Mo];nt($r,Mo)}},At=De=>(nt,bt)=>{De[bt]=nt},An=(De,nt,bt,$t)=>{bn(De,(On,Mo)=>{(nt(On,Mo)?bt:$t)(On,Mo)})},zn=(De,nt)=>{const bt={};return An(De,nt,At(bt),Q),bt},ps=(De,nt)=>Gt.call(De,nt),oo=(De,nt)=>ps(De,nt)&&De[nt]!==void 0&&De[nt]!==null;var Ss=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Mr=tinymce.util.Tools.resolve("tinymce.util.URI");const $s=De=>E(De)&&De.nodeName.toLowerCase()==="a",tr=De=>$s(De)&&!!dr(De),Xs=(De,nt)=>{if(De.collapsed)return[];{const bt=De.cloneContents(),$t=bt.firstChild,On=new Ss($t,bt),Mo=[];let $r=$t;do nt($r)&&Mo.push($r);while($r=On.next());return Mo}},wa=De=>/^\w+:/i.test(De),dr=De=>{var nt,bt;return(bt=(nt=De.getA Line truncated
Actual: `+_r.join(","));if(!Gt(j,cu=>Et(_r,cu)))throw new Error("Not all branches were specified when using match. Specified: "+_r.join(", ")+`
Required: `+j.join(", "));return sr[Sn].apply(null,Uo)},log:sr=>{console.log(sr,{constructors:j,constructor:Sn,params:Uo})}}}}),ye}}.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])});const Jn=(z,j)=>{const ye=Gu.fromTable(z);return q1(ye,j).bind(ct=>{const Ft=ct[ct.length-1],Sn=ct[0].row,In=Ft.row+Ft.rowspan,Uo=ye.all.slice(Sn,In);return xy(Uo)}).getOr("")},Ac=z=>Zc(z,"rgb")?iu(z):z,$f=z=>{const j=$o.fromDom(z);return{borderwidth:$t(j,"border-width").getOr(""),borderstyle:$t(j,"border-style").getOr(""),bordercolor:$t(j,"border-color").map(Ac).getOr(""),backgroundcolor:$t(j,"background-color").map(Ac).getOr("")}},ch=z=>{const j=z[0],ye=z.slice(1);return he(ye,Pe=>{he(we(j),ct=>{Re(Pe,(Ft,Sn)=>{const In=j[ct];In!==""&&ct===Sn&&In!==Ft&&(j[ct]="")})})}),j},Vc=(z,j,ye,Pe)=>jt(z,ct=>!b(ye.formatter.matchNode(Pe,j+ct))).getOr(""),qg=L(Vc,["left","center","right"],"align"),Pd=L(Vc,["top","middle","bottom"],"valign"),bl=(z,j)=>{const ye=Jf(z),Pe=jl(z),ct=()=>({borderstyle:ut(ye,"border-style").getOr(""),bordercolor:Ac(ut(ye,"border-color").getOr("")),backgroundcolor:Ac(ut(ye,"background-color").getOr(""))}),Ft={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""},Sn=()=>{const Si=ye["border-width"];return Df(z)&&Si?{border:Si}:ut(Pe,"border").fold(()=>({}),sr=>({border:sr}))},In=j?ct():{},Uo=()=>{const Si=ut(ye,"border-spacing").or(ut(Pe,"cellspacing")).fold(()=>({}),_r=>({cellspacing:_r})),sr=ut(ye,"border-padding").or(ut(Pe,"cellpadding")).fold(()=>({}),_r=>({cellpadding:_r}));return{...Si,...sr}};return{...Ft,...ye,...Pe,...In,...Sn(),...Uo()}},Iu=z=>Bn($o.fromDom(z)).map(j=>{const ye={selection:Wm(z.cells)};return Jn(j,ye)}).getOr(""),Wp=(z,j,ye)=>{const Pe=(In,Uo)=>{const ts=$t($o.fromDom(Uo),"border-width");return Df(z)&&ts.isSome()?ts.getOr(""):In.getAttrib(Uo,"border")||Tc(z.dom,Uo,"border-width")||Tc(z.dom,Uo,"border")||""},ct=z.dom,Ft=Df(z)?ct.getStyle(j,"border-spacing")||ct.getAttrib(j,"cellspacing"):ct.getAttrib(j,"cellspacing")||ct.getStyle(j,"border-spacing"),Sn=Df(z)?Tc(ct,j,"padding")||ct.getAttrib(j,"cellpadding"):ct.getAttrib(j,"cellpadding")||Tc(ct,j,"padding");return{width:ct.getStyle(j,"width")||ct.getAttrib(j,"width"),height:ct.getStyle(j,"height")||ct.getAttrib(j,"height"),cellspacing:Ft!=null?Ft:"",cellpadding:Sn!=null?Sn:"",border:Pe(ct,j),caption:!!ct.select("caption",j)[0],class:ct.getAttrib(j,"class",""),align:qg(z,j),...ye?$f(j):{}}},G1=(z,j,ye)=>{const Pe=z.dom;return{height:Pe.getStyle(j,"height")||Pe.getAttrib(j,"height"),class:Pe.getAttrib(j,"class",""),type:Iu(j),align:qg(z,j),...ye?$f(j):{}}},_n=(z,j,ye,Pe)=>{const ct=z.dom,Ft=Pe.getOr(j),Sn=(In,Uo)=>ct.getStyle(In,Uo)||ct.getAttrib(In,Uo);return{width:Sn(Ft,"width"),height:Sn(j,"height"),scope:ct.getAttrib(j,"scope"),celltype:Fc(j),class:ct.getAttrib(j,"class",""),halign:qg(z,j),valign:Pd(z,j),...ye?$f(j):{}}},Xm=(z,j)=>{const ye=Gu.fromTable(z),Pe=Gu.justCells(ye),ct=so(Pe,Ft=>Cn(j,Sn=>bs(Ft.element,Sn)));return mt(ct,Ft=>({element:Ft.element.dom,column:Gu.getColumnAt(ye,Ft.column).map(Sn=>Sn.element.dom)}))},Md=(z,j,ye,Pe)=>{Pe("scope")&&z.setAttrib("scope",ye.scope),Pe("class")&&z.setAttrib("class",ye.class),Pe("height")&&z.setStyle("height",nr(ye.height)),Pe("width")&&j.setStyle("width",nr(ye.width))},uh=(z,j,ye)=>{ye("backgroundcolor")&&z.setFormat("tablecellbackgroundcolor",j.backgroundcolor),ye("bordercolor")&&z.setFormat("tablecellbordercolor",j.bordercolor),ye("borderstyle")&&z.setFormat("tablecellborderstyle",j.borderstyle),ye("borderwidth")&&z.setFormat("tablecellborderwidth",nr(j.borderwidth))},of=(z,j,ye,Pe)=>{const ct=j.length===1;he(j,Ft=>{const Sn=Ft.element,In=ct?oe:Pe,Uo=td.normal(z,Sn),ts=Ft.column.map(Si=>td.normal(z,Si)).getOr(Uo);Md(Uo,ts,ye,In),Hg(z)&&uh(Uo,ye,In),Pe("halign")&&qf(z,Sn,ye.halign),Pe("valign")&&eh(z,Sn,ye.valign)})},K1=(z,j)=>{z.execCommand("mceTableCellType",!1,{type:j.celltype,no_events:!0})},mi=(z,j,ye,Pe)=>{const ct=Xe(Pe,(Ft,Sn)=>ye[Sn]!==Ft);V(ct)>0&&j.length>=1&&Bn(j[0]).each(Ft=>{const Sn=Xm(Ft,j),In=V(Xe(ct,(ts,Si)=>Si!=="scope"&&Si!=="celltype"))>0,Uo=Qe(ct,"celltype");(In||Qe(ct,"scope"))&&of(z,Sn,Pe,L(Qe,ct)),Uo&&K1(z,Pe),ti(z,Ft.dom,{structure:Uo,style:In})})},Ui=(z,j,ye,Pe)=>{const ct=Pe.getData();Pe.close(),z.undoManager.transact(()=>{mi(z,j,ye,ct),z.focus()})},ba=(z,j)=>{const ye=Bn(j[0]).map(Pe=>mt(Xm(Pe,j),ct=>_n(z,ct.element,Hg(z),ct.column)));return ch(ye.getOrDie())},Es=z=>{const j=Je(z);if(j.length===0)return;const ye=ba(z,j),Pe={type:"tabpanel",tabs:[{title:"General",name:"general",items:Pv(z)},j1(z,"cell")]},ct={type:"panel",items:[{type:"grid",columns:2,items:Pv(z)}]};z.windowManager.open({title:"Cell Properties",size:"normal",body:Hg(z)?Pe:ct,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:ye,onSubmit:L(Ui,z,j,ye)})},Rd=z=>{const j=Ad(ef(z));return j.length>0?G.some({name:"class",type: Line truncated
`),He)}),Bt.innerHTML=ut.encode((Ct=Bt.textContent)!==null&&Ct!==void 0?Ct:""),Q(V).highlightElement(Bt),ut.setAttrib(Bt,"data-mce-highlighted",!0),Bt.className=ve(Bt.className)})})}),V.on("PreInit",()=>{V.parser.addNodeFilter("pre",ut=>{var Qe;for(let Bt=0,Ct=ut.length;Bt<Ct;Bt++){const He=ut[Bt];((Qe=He.attr("class"))!==null&&Qe!==void 0?Qe:"").indexOf("language-")!==-1&&(He.attr("contenteditable","false"),He.attr("data-mce-highlighted","false"))}})})},ce=(V,ut=s)=>Qe=>{const Bt=()=>{Qe.setEnabled(V.selection.isEditable()),ut(Qe)};return V.on("NodeChange",Bt),Bt(),()=>{V.off("NodeChange",Bt)}},Xe=V=>{const ut=V.selection.getStart();return V.dom.is(ut,'pre[class*="language-"]')},tt=V=>{const ut=()=>V.execCommand("codesample");V.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:ut,onSetup:ce(V,Qe=>{Qe.setActive(Xe(V))})}),V.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:ut,onSetup:ce(V)})};var ot=()=>{o.add("codesample",V=>{E(V),Oe(V),tt(V),G(V),V.on("dblclick",ut=>{F(ut.target)&&oe(V)})})};ot()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(Ge,qe,Nt)=>{var Ut;return Nt(Ge,qe.prototype)?!0:((Ut=Ge.constructor)===null||Ut===void 0?void 0:Ut.name)===qe.name},t=Ge=>{const qe=typeof Ge;return Ge===null?"null":qe==="object"&&Array.isArray(Ge)?"array":qe==="object"&&e(Ge,String,(Nt,Ut)=>Ut.isPrototypeOf(Nt))?"string":qe},s=Ge=>qe=>t(qe)===Ge,a=s("string"),l=s("object"),u=s("array"),d=Ge=>Ge==null,h=Ge=>!d(Ge);class b{constructor(qe,Nt){this.tag=qe,this.value=Nt}static some(qe){return new b(!0,qe)}static none(){return b.singletonNone}fold(qe,Nt){return this.tag?Nt(this.value):qe()}isSome(){return this.tag}isNone(){return!this.tag}map(qe){return this.tag?b.some(qe(this.value)):b.none()}bind(qe){return this.tag?qe(this.value):b.none()}exists(qe){return this.tag&&qe(this.value)}forall(qe){return!this.tag||qe(this.value)}filter(qe){return!this.tag||qe(this.value)?this:b.none()}getOr(qe){return this.tag?this.value:qe}or(qe){return this.tag?this:qe}getOrThunk(qe){return this.tag?this.value:qe()}orThunk(qe){return this.tag?this:qe()}getOrDie(qe){if(this.tag)return this.value;throw new Error(qe!=null?qe:"Called getOrDie on None")}static from(qe){return h(qe)?b.some(qe):b.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(qe){this.tag&&qe(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}b.singletonNone=new b(!1);const y=Array.prototype.push,C=(Ge,qe)=>{for(let Nt=0,Ut=Ge.length;Nt<Ut;Nt++){const bo=Ge[Nt];qe(bo,Nt)}},E=Ge=>{const qe=[];for(let Nt=0,Ut=Ge.length;Nt<Ut;++Nt){if(!u(Ge[Nt]))throw new Error("Arr.flatten item "+Nt+" was not an array, input: "+Ge);y.apply(qe,Ge[Nt])}return qe},R=Ge=>{let qe=Ge;return{get:()=>qe,set:bo=>{qe=bo}}},$=Object.keys,Q=Object.hasOwnProperty,F=(Ge,qe)=>{const Nt=$(Ge);for(let Ut=0,bo=Nt.length;Ut<bo;Ut++){const Lo=Nt[Ut],Go=Ge[Lo];qe(Go,Lo)}},U=(Ge,qe)=>K(Ge,qe)?b.from(Ge[qe]):b.none(),K=(Ge,qe)=>Q.call(Ge,qe),L=Ge=>qe=>qe.options.get(Ge),te=Ge=>{const qe=Ge.options.register;qe("audio_template_callback",{processor:"function"}),qe("video_template_callback",{processor:"function"}),qe("iframe_template_callback",{processor:"function"}),qe("media_live_embeds",{processor:"boolean",default:!0}),qe("media_filter_html",{processor:"boolean",default:!0}),qe("media_url_resolver",{processor:"function"}),qe("media_alt_source",{processor:"boolean",default:!0}),qe("media_poster",{processor:"boolean",default:!0}),qe("media_dimensions",{processor:"boolean",default:!0})},ne=L("audio_template_callback"),oe=L("video_template_callback"),G=L("iframe_template_callback"),we=L("media_live_embeds"),ve=L("media_filter_html"),Re=L("media_url_resolver"),Oe=L("media_alt_source"),ce=L("media_poster"),Xe=L("media_dimensions");var tt=tinymce.util.Tools.resolve("tinymce.util.Tools"),ot=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),V=tinymce.util.Tools.resolve("tinymce.html.DomParser");const ut=ot.DOM,Qe=Ge=>Ge.replace(/px$/,""),Bt=Ge=>{const qe=Ge.attr("style"),Nt=qe?ut.parseStyle(qe):{};return{type:"ephox-embed-iri",source:Ge.attr("data-ephox-embed-iri"),altsource:"",poster:"",width:U(Nt,"max-width").map(Qe).getOr(""),height:U(Nt,"max-height").map(Qe).getOr("")}},Ct=(Ge,qe)=>{let Nt={};const bo=V({validate:!1,forced_root_block:!1},qe).parse(Ge);for(let Lo=bo;Lo;Lo=Lo.walk())if(Lo.type===1){const Go=Lo.name;if(Lo.attr("data-ephox-embed-iri")){Nt=Bt(Lo);break}else!Nt.source&&Go==="param"&&(Nt.source=Lo.attr("movie")),(Go==="iframe"||Go==="object"||Go==="embed"||Go==="video"||Go==="audio")&&(Nt.type||(Nt.type=Go),Nt=tt.extend(Lo.attributes.map,Nt)),Go==="source"&&(Nt.source?Nt.altsource||(Nt.altsource=Lo.attr("src")):Nt.source=Lo.attr("src")),Go==="img"&&!Nt.poster&&(Nt.poster=Lo.attr("src"))}return Nt.source=Nt.source||Nt.src||"",Nt.altsource=Nt.altsource||"",Nt.poster=Nt.poster||"",Nt}, Line truncated
<source src="`+Ge.altsource+'"'+(Ge.altsourcemime?' type="'+Ge.altsourcemime+'"':"")+` />
`:"")+"</audio>",Ne=(Ge,qe)=>qe?qe(Ge):'<video width="'+Ge.width+'" height="'+Ge.height+'"'+(Ge.poster?' poster="'+Ge.poster+'"':"")+` controls="controls">
<source src="`+Ge.source+'"'+(Ge.sourcemime?' type="'+Ge.sourcemime+'"':"")+` />
`+(Ge.altsource?'<source src="'+Ge.altsource+'"'+(Ge.altsourcemime?' type="'+Ge.altsourcemime+'"':"")+` />
`:"")+"</video>",Gt=(Ge,qe)=>{var Nt;const Ut=tt.extend({},qe);if(!Ut.source&&(tt.extend(Ut,Ct((Nt=Ut.embed)!==null&&Nt!==void 0?Nt:"",Ge.schema)),!Ut.source))return"";Ut.altsource||(Ut.altsource=""),Ut.poster||(Ut.poster=""),Ut.source=Ge.convertURL(Ut.source,"source"),Ut.altsource=Ge.convertURL(Ut.altsource,"source"),Ut.sourcemime=He(Ut.source),Ut.altsourcemime=He(Ut.altsource),Ut.poster=Ge.convertURL(Ut.poster,"poster");const bo=as(Ut.source);if(bo&&(Ut.source=bo.url,Ut.type=bo.type,Ut.allowfullscreen=bo.allowFullscreen,Ut.width=Ut.width||String(bo.w),Ut.height=Ut.height||String(bo.h)),Ut.embed)return Zo(Ut.embed,Ut,!0,Ge.schema);{const Lo=ne(Ge),Go=oe(Ge),ei=G(Ge);return Ut.width=Ut.width||"300",Ut.height=Ut.height||"150",tt.each(Ut,(lt,Xo)=>{Ut[Xo]=Ge.dom.encode(""+lt)}),Ut.type==="iframe"?kt(Ut,ei):Ut.sourcemime==="application/x-shockwave-flash"?jt(Ut):Ut.sourcemime.indexOf("audio")!==-1?pt(Ut,Lo):Ne(Ut,Go)}},bn=Ge=>Ge.hasAttribute("data-mce-object")||Ge.hasAttribute("data-ephox-embed-iri"),At=Ge=>{Ge.on("click keyup touchend",()=>{const qe=Ge.selection.getNode();qe&&Ge.dom.hasClass(qe,"mce-preview-object")&&Ge.dom.getAttrib(qe,"data-mce-selected")&&qe.setAttribute("data-mce-selected","2")}),Ge.on("ObjectResized",qe=>{const Nt=qe.target;if(Nt.getAttribute("data-mce-object")){let Ut=Nt.getAttribute("data-mce-html");Ut&&(Ut=unescape(Ut),Nt.setAttribute("data-mce-html",escape(Zo(Ut,{width:String(qe.width),height:String(qe.height)},!1,Ge.schema))))}})},An={},zn=(Ge,qe,Nt)=>new Promise((Ut,bo)=>{const Lo=Go=>(Go.html&&(An[Ge.source]=Go),Ut({url:Ge.source,html:Go.html?Go.html:qe(Ge)}));An[Ge.source]?Lo(An[Ge.source]):Nt({url:Ge.source},Lo,bo)}),ps=(Ge,qe)=>Promise.resolve({html:qe(Ge),url:Ge.source}),oo=Ge=>qe=>Gt(Ge,qe),Ss=(Ge,qe)=>{const Nt=Re(Ge);return Nt?zn(qe,oo(Ge),Nt):ps(qe,oo(Ge))},Mr=Ge=>K(An,Ge),$s=(Ge,qe)=>U(qe,Ge).bind(Nt=>U(Nt,"meta")),tr=(Ge,qe,Nt)=>Ut=>{const bo=()=>U(Ge,Ut),Lo=()=>U(qe,Ut),Go=Xo=>U(Xo,"value").bind(Ni=>Ni.length>0?b.some(Ni):b.none()),ei=()=>bo().bind(Xo=>l(Xo)?Go(Xo).orThunk(Lo):Lo().orThunk(()=>b.from(Xo))),lt=()=>Lo().orThunk(()=>bo().bind(Xo=>l(Xo)?Go(Xo):b.from(Xo)));return{[Ut]:(Ut===Nt?ei():lt()).getOr("")}},Xs=(Ge,qe)=>{const Nt={};return U(Ge,"dimensions").each(Ut=>{C(["width","height"],bo=>{U(qe,bo).orThunk(()=>U(Ut,bo)).each(Lo=>Nt[bo]=Lo)})}),Nt},wa=(Ge,qe)=>{const Nt=qe&&qe!=="dimensions"?$s(qe,Ge).getOr({}):{},Ut=tr(Ge,Nt,qe);return{...Ut("source"),...Ut("altsource"),...Ut("poster"),...Ut("embed"),...Xs(Ge,Nt)}},dr=Ge=>{const qe={...Ge,source:{value:U(Ge,"source").getOr("")},altsource:{value:U(Ge,"altsource").getOr("")},poster:{value:U(Ge,"poster").getOr("")}};return C(["width","height"],Nt=>{U(Ge,Nt).each(Ut=>{const bo=qe.dimensions||{};bo[Nt]=Ut,qe.dimensions=bo})}),qe},Ns=Ge=>qe=>{const Nt=qe&&qe.msg?"Media embed handler error: "+qe.msg:"Media embed handler threw unknown error.";Ge.notificationManager.open({type:"error",text:Nt})},qr=Ge=>{const qe=Ge.selection.getNode(),Nt=bn(qe)?Ge.serializer.serialize(qe,{selection:!0}):"",Ut=Ct(Nt,Ge.schema),Lo=(()=>{if(Ls(Ut.source,Ut.type)){const Go=Ge.dom.getRect(qe);return{width:Go.w.toString().replace(/px$/,""),height:Go.h.toString().replace(/px$/,"")}}else return{}})();return{embed:Nt,...Ut,...Lo}},$o=(Ge,qe)=>Nt=>{if(a(Nt.url)&&Nt.url.trim().length>0){const Ut=Nt.html,Lo={...Ct(Ut,qe.schema),source:Nt.url,embed:Ut};Ge.setData(dr(Lo))}},Po=(Ge,qe)=>{const Nt=Ge.dom.select("*[data-mce-object]");for(let Ut=0;Ut<qe.length;Ut++)for(let bo=Nt.length-1;bo>=0;bo--)qe[Ut]===Nt[bo]&&Nt.splice(bo,1);Ge.selection.select(Nt[0])},Rr=(Ge,qe)=>{const Nt=Ge.dom.select("*[data-mce-object]");Ge.insertContent(qe),Po(Ge,Nt),Ge.nodeChanged()},Ls=(Ge,qe)=>h(qe)&&qe==="ephox-embed-iri"&&h(as(Ge)),aa=(Ge,qe)=>((Ut,bo)=>Ut.width!==bo.width||Ut.height!==bo.height)(Ge,qe)&&Ls(qe.source,Ge.type),bs=(Ge,qe,Nt)=>{var Ut;qe.embed=aa(Ge,qe)&&Xe(Nt)?Gt(Nt,{...qe,embed:""}):Zo((Ut=qe.embed)!==null&&Ut!==void 0?Ut:"",qe,!1,Nt.schema),qe.embed&&(Ge.source===qe.source||Mr(qe.source))?Rr(Nt,qe.embed):Ss(Nt,qe).then(bo=>{Rr(Nt,bo.html)}).catch(Ns(Nt))},_a=Ge=>{const qe=qr(Ge),Nt=R(qe),Ut=dr(qe),bo=(ga,nr)=>{const Ar=wa(nr.getData(),"source");ga.source!==Ar.source&&($o(nl,Ge)({url:Ar.source,html:""}),Ss(Ge,Ar).then($o(nl,Ge)).catch(Ns(Ge)))},Lo=ga=>{var nr;const Ar=wa(ga.getData()),Ki=Ct((nr=Ar.embed)!==null&&nr!==void 0?nr:"",Ge.schema);ga.setData(dr(Ki))},Go=(ga,nr,Ar)=>{const Ki=wa(ga.getData(),nr),gl=aa(Ar,Ki)&&Xe(Ge)?{...Ki,embed:""}:Ki,kc=Gt(Ge,gl);ga.setData(dr({...gl,embed:kc}))},ei=[{name:"source",type:"urlinput",filetype:"media",label:"Source"}],lt=Xe(Ge)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],Xo={title:"General",name:"general",items:E([ei,lt])},la={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},ma=[];Oe(Ge)&&ma.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),ce(Ge)&&ma.push({name:"poster",type:"urlinput",filetype:" Line truncated
`));return ce(pt.split(""),s).length},Bt=(kt,jt)=>{const pt=ot(kt,jt).join("");return ut(pt)},Ct=(kt,jt)=>{const pt=ot(kt,jt).join("").replace(/\s/g,"");return ut(pt)},He=(kt,jt)=>()=>jt(kt.getBody(),kt.schema),st=(kt,jt)=>()=>jt(kt.selection.getRng().cloneContents(),kt.schema),rn=kt=>He(kt,Qe),Et=kt=>({body:{getWordCount:rn(kt),getCharacterCount:He(kt,Bt),getCharacterCountWithoutSpaces:He(kt,Ct)},selection:{getWordCount:st(kt,Qe),getCharacterCount:st(kt,Bt),getCharacterCountWithoutSpaces:st(kt,Ct)},getCount:rn(kt)}),Cn=(kt,jt)=>{kt.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(jt.body.getWordCount()),String(jt.selection.getWordCount())],["Characters (no spaces)",String(jt.body.getCharacterCountWithoutSpaces()),String(jt.selection.getCharacterCountWithoutSpaces())],["Characters",String(jt.body.getCharacterCount()),String(jt.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})},je=(kt,jt)=>{kt.addCommand("mceWordCount",()=>Cn(kt,jt))},mt=(kt,jt)=>{let pt=null;return{cancel:()=>{t(pt)||(clearTimeout(pt),pt=null)},throttle:(...bn)=>{t(pt)&&(pt=setTimeout(()=>{pt=null,kt.apply(null,bn)},jt))}}};var he=tinymce.util.Tools.resolve("tinymce.util.Delay");const Zo=(kt,jt)=>{kt.dispatch("wordCountUpdate",{wordCount:{words:jt.body.getWordCount(),characters:jt.body.getCharacterCount(),charactersWithoutSpaces:jt.body.getCharacterCountWithoutSpaces()}})},Kn=(kt,jt)=>{Zo(kt,jt)},so=(kt,jt,pt)=>{const Ne=mt(()=>Kn(kt,jt),pt);kt.on("init",()=>{Kn(kt,jt),he.setEditorTimeout(kt,()=>{kt.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",Ne.throttle)},0),kt.on("remove",Ne.cancel)})},Yo=kt=>{const jt=()=>kt.execCommand("mceWordCount");kt.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:jt}),kt.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:jt})};var as=(kt=300)=>{o.add("wordcount",jt=>{const pt=Et(jt);return je(jt,pt),Yo(jt),so(jt,pt,kt),pt})};as()})();function LTe(o){let e,t;return{c(){e=re("div"),t=re("div"),Z(t,"class","form-control"),Z(e,"class","tox-wrapper")},m(s,a){Te(s,e,a),X(e,t),t.innerHTML=o[0],o[4](t),o[5](e)},p(s,[a]){a&1&&(t.innerHTML=s[0])},i:un,o:un,d(s){s&&ke(e),o[4](null),o[5](null)}}}const FTe="bold italic underline strikethrough removeformat | link | subscript superscript bullist numlist media image codesample table code wordcount blockquote indent outdent blocks";function QTe(o,e,t){let{value:s=""}=e,{additionalConfig:a={}}=e,l="",u,d,h;const b=["autoresize","code","image","table","codesample","link","lists","media","wordcount"];ore(()=>{d&&d.destroy()}),W1(()=>{const E={target:u,toolbar_mode:"sliding",toolbar_sticky:!0,skin:!1,content_css:!1,content_style:BTe.toString(),branding:!1,inline:!1,plugins:b,contextmenu:!1,menubar:!1,statusbar:!1,entity_encoding:"raw",convert_urls:!1,toolbar:FTe,image_caption:!0,relative_urls:!1,browser_spellcheck:!0,max_height:600,content_style:"img {max-width: 100%;height: auto;",setup(R){d=R,R.on("init",function($){R.setContent(s!=null?s:"")}),R.on("change input undo redo",function($){l=R.getContent(),l!==s&&t(0,s=l)})}};ITe.init({...E,...a})});function y(E){Ro[E?"unshift":"push"](()=>{u=E,t(1,u)})}function C(E){Ro[E?"unshift":"push"](()=>{h=E,t(2,h)})}return o.$$set=E=>{"value"in E&&t(0,s=E.value),"additionalConfig"in E&&t(3,a=E.additionalConfig)},[s,u,h,a,y,C]}class b1e extends uo{constructor(e){super(),co(this,e,QTe,LTe,lo,{value:0,additionalConfig:3})}}function ZTe(o){let e,t,s,a;function l(d){o[2](d)}let u={additionalConfig:o[1]};return o[0].value!==void 0&&(u.value=o[0].value),t=new b1e({props:u}),Ro.push(()=>er(t,"value",l)),{c(){e=re("div"),en(t.$$.fragment),Z(e,"class","mb-0")},m(d,h){Te(d,e,h),Kt(t,e,null),a=!0},p(d,[h]){const b={};!s&&h&1&&(s=!0,b.value=d[0].value,lr(()=>s=!1)),t.$set(b)},i(d){a||(xe(t.$$.fragment,d),a=!0)},o(d){Be(t.$$.fragment,d),a=!1},d(d){d&&ke(e),Jt(t)}}}function HTe(o,e,t){let{block:s}=e,a={};function l(u){o.$$.not_equal(s.value,u)&&(s.value=u,t(0,s))}return o.$$set=u=>{"block"in u&&t(0,s=u.block)},[s,a,l]}class zTe extends uo{constructor(e){super(),co(this,e,HTe,ZTe,lo,{block:0})}}class el{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,s){let a=[];return this.decompose(0,e,a,2),s.length&&s.decompose(0,s.length,a,3),this.decompose(t,this.length,a,1),ay.from(a,this.length-(t-e)+s.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let s=[];return this.decompose(e,t,s,0),ay.from(s,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),s=this.length-this.scanIdentical(e,-1),a= Line truncated
`){let a="";for(let l=0,u=0;l<=t&&u<this.text.length;u++){let d=this.text[u],h=l+d.length;l>e&&u&&(a+=s),e<h&&t>l&&(a+=d.slice(Math.max(0,e-l),t-l)),l=h+1}return a}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let s=[],a=-1;for(let l of e)s.push(l),a+=l.length+1,s.length==32&&(t.push(new Sf(s,a)),s=[],a=-1);return a>-1&&t.push(new Sf(s,a)),t}}class ay extends el{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let s of e)this.lines+=s.lines}lineInner(e,t,s,a){for(let l=0;;l++){let u=this.children[l],d=a+u.length,h=s+u.lines-1;if((t?h:d)>=e)return u.lineInner(e,t,s,a);a=d+1,s=h+1}}decompose(e,t,s,a){for(let l=0,u=0;u<=t&&l<this.children.length;l++){let d=this.children[l],h=u+d.length;if(e<=h&&t>=u){let b=a&((u<=e?1:0)|(h>=t?2:0));u>=e&&h<=t&&!b?s.push(d):d.decompose(e-u,t-u,s,b)}u=h+1}}replace(e,t,s){if(s.lines<this.lines)for(let a=0,l=0;a<this.children.length;a++){let u=this.children[a],d=l+u.length;if(e>=l&&t<=d){let h=u.replace(e-l,t-l,s),b=this.lines-u.lines+h.lines;if(h.lines<b>>5-1&&h.lines>b>>5+1){let y=this.children.slice();return y[a]=h,new ay(y,this.length-(t-e)+s.length)}return super.replace(l,d,h)}l=d+1}return super.replace(e,t,s)}sliceString(e,t=this.length,s=`
`){let a="";for(let l=0,u=0;l<this.children.length&&u<=t;l++){let d=this.children[l],h=u+d.length;u>e&&l&&(a+=s),e<h&&t>u&&(a+=d.sliceString(e-u,t-u,s)),u=h+1}return a}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof ay))return 0;let s=0,[a,l,u,d]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;a+=t,l+=t){if(a==u||l==d)return s;let h=this.children[a],b=e.children[l];if(h!=b)return s+h.scanIdentical(b,t);s+=h.length+1}}static from(e,t=e.reduce((s,a)=>s+a.length+1,-1)){let s=0;for(let R of e)s+=R.lines;if(s<32){let R=[];for(let $ of e)$.flatten(R);return new Sf(R,t)}let a=Math.max(32,s>>5),l=a<<1,u=a>>1,d=[],h=0,b=-1,y=[];function C(R){let $;if(R.lines>l&&R instanceof ay)for(let Q of R.children)C(Q);else R.lines>u&&(h>u||!h)?(E(),d.push(R)):R instanceof Sf&&h&&($=y[y.length-1])instanceof Sf&&R.lines+$.lines<=32?(h+=R.lines,b+=R.length+1,y[y.length-1]=new Sf($.text.concat(R.text),$.length+1+R.length)):(h+R.lines>a&&E(),h+=R.lines,b+=R.length+1,y.push(R))}function E(){h!=0&&(d.push(y.length==1?y[0]:ay.from(y,b)),b=-1,h=y.length=0)}for(let R of e)C(R);return E(),d.length==1?d[0]:new ay(d,t)}}el.empty=new Sf([""],0);function VTe(o){let e=-1;for(let t of o)e+=t.length+1;return e}function PH(o,e,t=0,s=1e9){for(let a=0,l=0,u=!0;l<o.length&&a<=s;l++){let d=o[l],h=a+d.length;h>=t&&(h>s&&(d=d.slice(0,s-a)),a<t&&(d=d.slice(t-a)),u?(e[e.length-1]+=d,u=!1):e.push(d)),a=h+1}return e}function Gue(o,e,t){return PH(o,[""],e,t)}class f6{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Sf?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let s=this.nodes.length-1,a=this.nodes[s],l=this.offsets[s],u=l>>1,d=a instanceof Sf?a.text.length:a.children.length;if(u==(t>0?d:0)){if(s==0)return this.done=!0,this.value="",this;t>0&&this.offsets[s-1]++,this.nodes.pop(),this.offsets.pop()}else if((l&1)==(t>0?0:1)){if(this.offsets[s]+=t,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(a instanceof Sf){let h=a.text[u+(t<0?-1:0)];if(this.offsets[s]+=t,h.length>Math.max(0,e))return this.value=e==0?h:t>0?h.slice(e):h.slice(0,h.length-e),this;e-=h.length}else{let h=a.children[u+(t<0?-1:0)];e>h.length?(e-=h.length,this.offsets[s]+=t):(t<0&&this.offsets[s]--,this.nodes.push(h),this.offsets.push(t>0?1:(h instanceof Sf?h.text.length:h.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class v1e{constructor(e,t,s){this.value="",this.done=!1,this.cursor=new f6(e,t>s?-1:1),this.pos=t>s?e.length:0,this.from=Math.min(t,s),this.to=Math.max(t,s)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let s=t<0?this.pos-this.from:this.to-this.pos;e>s&&(e=s),s-=e;let{value:a}=this.cursor.next(e);return this.pos+=(a.length+e)*t,this.value=a.length<=s?a:t<0?a.slice(a.length-s):a.slice(0,s),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class O1e{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:s,value:a}=this.inner.next(e);return t?(this.done=!0,this.value=""):s?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=a,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(el.prototype[Symbol.iterator]=function(){return this.iter()},f6.prototype[Symbol.iterator]=v1e.prototype[Symbol.iterator]=O1e.prototype[Symbol.iterator]=function(){return this});class WTe{constructor(e,t,s,a){this.from=e,this.to=t,this.number=s,this.text=a}get length(){return this.to-this.from}}let yD="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(o=>o?parseInt(o,36):1);for(let o=1;o<yD.length;o++)yD[o]+=yD[o-1];function UTe(o){for(let e=1;e<yD.length;e+=2)if(yD[e]>o)return yD[e-1]<=o;return!1}function Kue(o){return o>=127462&&o<=127487}const Jue=8205;function Bm(o,e,t=!0,s=!0){return(t?y1e:YTe)(o,e,s)}function y1e(o,e,t){if(e==o.length)return e;e&&w1e(o.charCodeAt(e))&&_1e(o.charCodeAt(e-1))&&e--;let s=Uh(o,e);for(e+=Fb(s);e<o.length;){let a=Uh(o,e);if(s==Jue||a==Jue||t&&UTe(a))e+=Fb(a),s=a;else if(Kue(a)){let l=0,u=e-2;for(;u>=0&&Kue(Uh(o,u));)l++,u-=2;if(l%2==0)break;e+=2}else break}return e}function YTe(o,e,t){for(;e>0;){let s=y1e(o,e-2,t);if(s<e)return s;e--}return 0}function w1e(o){return o>=56320&&o<57344}function _1e(o){return o>=55296&&o<56320}function Uh(o,e){let t=o.charCodeAt(e);if(!_1e(t)||e+1==o.length)return t;let s=o.charCodeAt(e+1);return w1e(s)?(t-55296<<10)+(s-56320)+65536:t}function fre(o){return o<=65535?String.fromCharCode(o):(o-=65536,String.fromCharCode((o>>10)+55296,(o&1023)+56320))}function Fb(o){return o<65536?1:2}const Zoe=/\r\n?|\n/;var Xh=function(o){return o[o.Simple=0]="Simple",o[o.TrackDel=1]="TrackDel",o[o.TrackBefore=2]="TrackBefore",o[o.TrackAfter=3]="TrackAfter",o}(Xh||(Xh={}));class my{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let s=this.sections[t+1];e+=s<0?this.sections[t]:s}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,s=0,a=0;t<this.sections.length;){let l=this.sections[t++],u=this.sections[t++];u<0?(e(s,a,l),a+=l):a+=u,s+=l}}iterChangedRanges(e,t=!1){Hoe(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let s=this.sections[t++],a=this.sections Line truncated
`}get readOnly(){return this.facet(M1e)}phrase(e,...t){for(let s of this.facet(ra.phrases))if(Object.prototype.hasOwnProperty.call(s,e)){e=s[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(s,a)=>{if(a=="$")return"$";let l=+(a||1);return!l||l>t.length?s:t[l-1]})),e}languageDataAt(e,t,s=-1){let a=[];for(let l of this.facet(x1e))for(let u of l(this,t,s))Object.prototype.hasOwnProperty.call(u,e)&&a.push(u[e]);return a}charCategorizer(e){return sEe(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:s,length:a}=this.doc.lineAt(e),l=this.charCategorizer(e),u=e-s,d=e-s;for(;u>0;){let h=Bm(t,u,!1);if(l(t.slice(h,u))!=tu.Word)break;u=h}for(;d<a;){let h=Bm(t,d);if(l(t.slice(d,h))!=tu.Word)break;d=h}return u==d?null:Ln.range(u+s,d+s)}}ra.allowMultipleSelections=T1e;ra.tabSize=As.define({combine:o=>o.length?o[0]:4});ra.lineSeparator=E1e;ra.readOnly=M1e;ra.phrases=As.define({compare(o,e){let t=Object.keys(o),s=Object.keys(e);return t.length==s.length&&t.every(a=>o[a]==e[a])}});ra.languageData=x1e;ra.changeFilter=A1e;ra.transactionFilter=D1e;ra.transactionExtender=P1e;DC.reconfigure=bi.define();function Tv(o,e,t={}){let s={};for(let a of o)for(let l of Object.keys(a)){let u=a[l],d=s[l];if(d===void 0)s[l]=u;else if(!(d===u||u===void 0))if(Object.hasOwnProperty.call(t,l))s[l]=t[l](d,u);else throw new Error("Config merge conflict for field "+l)}for(let a in e)s[a]===void 0&&(s[a]=e[a]);return s}class mE{eq(e){return this==e}range(e,t=e){return S6.create(e,t,this)}}mE.prototype.startSide=mE.prototype.endSide=0;mE.prototype.point=!1;mE.prototype.mapMode=Xh.TrackDel;class S6{constructor(e,t,s){this.from=e,this.to=t,this.value=s}static create(e,t,s){return new S6(e,t,s)}}function Xoe(o,e){return o.from-e.from||o.value.startSide-e.value.startSide}class mre{constructor(e,t,s,a){this.from=e,this.to=t,this.value=s,this.maxPoint=a}get length(){return this.to[this.to.length-1]}findIndex(e,t,s,a=0){let l=s?this.to:this.from;for(let u=a,d=l.length;;){if(u==d)return u;let h=u+d>>1,b=l[h]-e||(s?this.value[h].endSide:this.value[h].startSide)-t;if(h==u)return b>=0?u:d;b>=0?d=h:u=h+1}}between(e,t,s,a){for(let l=this.findIndex(t,-1e9,!0),u=this.findIndex(s,1e9,!1,l);l<u;l++)if(a(this.from[l]+e,this.to[l]+e,this.value[l])===!1)return!1}map(e,t){let s=[],a=[],l=[],u=-1,d=-1;for(let h=0;h<this.value.length;h++){let b=this.value[h],y=this.from[h]+e,C=this.to[h]+e,E,R;if(y==C){let $=t.mapPos(y,b.startSide,b.mapMode);if($==null||(E=R=$,b.startSide!=b.endSide&&(R=t.mapPos(y,b.endSide),R<E)))continue}else if(E=t.mapPos(y,b.startSide),R=t.mapPos(C,b.endSide),E>R||E==R&&b.startSide>0&&b.endSide<=0)continue;(R-E||b.endSide-b.startSide)<0||(u<0&&(u=E),b.point&&(d=Math.max(d,R-E)),s.push(b),a.push(E-u),l.push(R-u))}return{mapped:s.length?new mre(a,l,s,d):null,pos:u}}}class tl{constructor(e,t,s,a){this.chunkPos=e,this.chunk=t,this.nextLayer=s,this.maxPoint=a}static create(e,t,s,a){return new tl(e,t,s,a)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:s=!1,filterFrom:a=0,filterTo:l=this.length}=e,u=e.filter;if(t.length==0&&!u)return this;if(s&&(t=t.slice().sort(Xoe)),this.isEmpty)return t.length?tl.of(t):this;let d=new N1e(this,null,-1).goto(0),h=0,b=[],y=new PC;for(;d.value||h<t.length;)if(h<t.length&&(d.from-t[h].from||d.startSide-t[h].value.startSide)>=0){let C=t[h++];y.addInner(C.from,C.to,C.value)||b.push(C)}else d.rangeIndex==1&&d.chunkIndex<this.chunk.length&&(h==t.length||this.chunkEnd(d.chunkIndex)<t[h].from)&&(!u||a>this.chunkEnd(d.chunkIndex)||l<this.chunkPos[d.chunkIndex])&&y.addChunk(this.chunkPos[d.chunkIndex],this.chunk[d.chunkIndex])?d.nextChunk():((!u||a>d.to||l<d.from||u(d.from,d.to,d.value))&&(y.addInner(d.from,d.to,d.value)||b.push(S6.create(d.from,d.to,d.value))),d.next());return y.finishInner(this.nextLayer.isEmpty&&!b.length?tl.empty:this.nextLayer.update({add:b,filter:u,filterFrom:a,filterTo:l}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],s=[],a=-1;for(let u=0;u<this.chunk.length;u++){let d=this.chunkPos[u],h=this.chunk[u],b=e.touchesRange(d,d+h.length);if(b===!1)a=Math.max(a,h.maxPoint),t.push(h),s.push(e.mapPos(d));else if(b===!0){let{mapped:y,pos:C}=h.map(d,e);y&&(a=Math.max(a,y.maxPoint),t.push(y),s.push(C))}}let l=this.nextLayer.map(e);return t.length==0?l:new tl(s,t,l||tl.empty,a)}between(e,t,s){if(!this.isEmpty){for(let a=0;a<this.chunk.length;a++){let l=this.chunkPos[a],u=this.chunk[a];if(t>=l&&e<=l+u.length&&u.between(l,e-l,t-l,s)===!1)return}this.nextLayer.between(e,t,s)}}iter(e=0){return C6.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return C6.from(e).goto(t)}static compare(e,t,s,a,l=-1){let u=e.filter(C=>C.maxPoint>0||!C.isEmpty&&C.maxPoint>=l),d=t.filter(C=>C.maxPoint>0||!C.isEmpty&&C.maxPoint>=l),h=n Line truncated
`)}static newName(){let e=ife[rfe]||1;return ife[rfe]=e+1,Goe+e.toString(36)}static mount(e,t,s){let a=e[Koe],l=s&&s.nonce;a?l&&a.setNonce(l):a=new iEe(e,l),a.mount(Array.isArray(t)?t:[t])}}let afe=new Map;class iEe{constructor(e,t){let s=e.ownerDocument||e,a=s.defaultView;if(!e.head&&e.adoptedStyleSheets&&a.CSSStyleSheet){let l=afe.get(s);if(l)return e.adoptedStyleSheets=[l.sheet,...e.adoptedStyleSheets],e[Koe]=l;this.sheet=new a.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],afe.set(s,this)}else{this.styleTag=s.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let l=e.head||e;l.insertBefore(this.styleTag,l.firstChild)}this.modules=[],e[Koe]=this}mount(e){let t=this.sheet,s=0,a=0;for(let l=0;l<e.length;l++){let u=e[l],d=this.modules.indexOf(u);if(d<a&&d>-1&&(this.modules.splice(d,1),a--,d=-1),d==-1){if(this.modules.splice(a++,0,u),t)for(let h=0;h<u.rules.length;h++)t.insertRule(u.rules[h],s++)}else{for(;a<d;)s+=this.modules[a++].rules.length;s+=u.rules.length,a++}}if(!t){let l="";for(let u=0;u<this.modules.length;u++)l+=this.modules[u].getRules()+`
`;this.styleTag.textContent=l}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var RC={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},k6={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},aEe=typeof navigator<"u"&&/Mac/.test(navigator.platform),lEe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Yh=0;Yh<10;Yh++)RC[48+Yh]=RC[96+Yh]=String(Yh);for(var Yh=1;Yh<=24;Yh++)RC[Yh+111]="F"+Yh;for(var Yh=65;Yh<=90;Yh++)RC[Yh]=String.fromCharCode(Yh+32),k6[Yh]=String.fromCharCode(Yh);for(var Ane in RC)k6.hasOwnProperty(Ane)||(k6[Ane]=RC[Ane]);function cEe(o){var e=aEe&&o.metaKey&&o.shiftKey&&!o.ctrlKey&&!o.altKey||lEe&&o.shiftKey&&o.key&&o.key.length==1||o.key=="Unidentified",t=!e&&o.key||(o.shiftKey?k6:RC)[o.keyCode]||o.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function dz(o){let e;return o.nodeType==11?e=o.getSelection?o:o.ownerDocument:e=o,e.getSelection()}function Joe(o,e){return e?o==e||o.contains(e.nodeType!=1?e.parentNode:e):!1}function uEe(o){let e=o.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function RH(o,e){if(!e.anchorNode)return!1;try{return Joe(o,e.anchorNode)}catch{return!1}}function x6(o){return o.nodeType==3?gE(o,0,o.nodeValue.length).getClientRects():o.nodeType==1?o.getClientRects():[]}function hz(o,e,t,s){return t?lfe(o,e,t,s,-1)||lfe(o,e,t,s,1):!1}function T6(o){for(var e=0;;e++)if(o=o.previousSibling,!o)return e}function lfe(o,e,t,s,a){for(;;){if(o==t&&e==s)return!0;if(e==(a<0?0:Vw(o))){if(o.nodeName=="DIV")return!1;let l=o.parentNode;if(!l||l.nodeType!=1)return!1;e=T6(o)+(a<0?0:1),o=l}else if(o.nodeType==1){if(o=o.childNodes[e+(a<0?-1:0)],o.nodeType==1&&o.contentEditable=="false")return!1;e=a<0?Vw(o):0}else return!1}}function Vw(o){return o.nodeType==3?o.nodeValue.length:o.childNodes.length}function gre(o,e){let t=e?o.left:o.right;return{left:t,right:t,top:o.top,bottom:o.bottom}}function fEe(o){return{left:0,right:o.innerWidth,top:0,bottom:o.innerHeight}}function dEe(o,e,t,s,a,l,u,d){let h=o.ownerDocument,b=h.defaultView||window;for(let y=o,C=!1;y&&!C;)if(y.nodeType==1){let E,R=y==h.body,$=1,Q=1;if(R)E=fEe(b);else{if(/^(fixed|sticky)$/.test(getComputedStyle(y).position)&&(C=!0),y.scrollHeight<=y.clientHeight&&y.scrollWidth<=y.clientWidth){y=y.assignedSlot||y.parentNode;continue}let K=y.getBoundingClientRect();$=K.width/y.offsetWidth,Q=K.height/y.offsetHeight,E={left:K.left,right:K.left+y.clientWidth*$,top:K.top,bottom:K.top+y.clientHeight*Q}}let F=0,U=0;if(a=="nearest")e.top<E.top?(U=-(E.top-e.top+u),t>0&&e.bottom>E.bottom+U&&(U=e.bottom-E.bottom+U+u)):e.bottom>E.bottom&&(U=e.bottom-E.bottom+u,t<0&&e.top-U<E.top&&(U=-(E.top+U-e.top+u)));else{let K=e.bottom-e.top,L=E.bottom-E.top;U=(a=="center"&&K<=L?e.top+K/2-L/2:a=="start"||a=="center"&&t<0?e.top-u:e.bottom-L+u)-E.top}if(s=="nearest"?e.left<E.left?(F=-(E.left-e.left+l),t>0&&e.right>E.right+F&&(F=e.right-E.right+F+l)):e.right>E.right&&(F=e.right-E.right+l,t<0&&e.left<E.left+F&&(F=-(E.left+F-e.left+l))):F=(s=="center"?e.left+(e.right-e.left)/2-(E.right-E.left)/2:s=="start"==d?e.left-l:e.right-(E.right-E.left)+l)-E.left,F||U)if(R)b.scrollBy(F,U);else{let K=0,L=0;if(U){let te=y.scrollTop;y.scrollTop+=U/Q,L=(y.scrollTop-te)*Q}if(F){let te=y.scrollLeft;y.scrollLeft+=F/$,K=(y.scrollLeft-te)*$}e={left:e.left-K,top:e.top-L,right:e.right-K,bottom:e.bottom-L},K&&Math.abs(K-F)<1&&(s="nearest"),L&&Math.abs(L-U)<1&&(a="nearest")}if(R)break;y=y.assignedSlot||y.parentNode}else if(y.nodeType==11)y=y.host;else break}function hEe(o){let e=o.ownerDocument;for(let t=o.parentNode;t&&t!=e.body;)if(t.nodeType==1){if(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class mEe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:s}=e;this.set(t,Math.min(e.anchorOffset,t?Vw(t):0),s,Math.min(e.focusOffset,s?Vw(s):0))}set(e,t,s,a){this.anchorNode=e,this.aLine truncated
`,a=o.state.doc.line(a.number+(t?1:-1)),l=o.bidiSpans(a),b=Ln.cursor(t?a.from:a.to)}if(h){if(!h(y))return d}else{if(!s)return b;h=s(y)}d=b}}function WEe(o,e,t){let s=o.state.charCategorizer(e),a=s(t);return l=>{let u=s(l);return a==tu.Space&&(a=u),a==u}}function UEe(o,e,t,s){let a=e.head,l=t?1:-1;if(a==(t?o.state.doc.length:0))return Ln.cursor(a,e.assoc);let u=e.goalColumn,d,h=o.contentDOM.getBoundingClientRect(),b=o.coordsAtPos(a,e.assoc||-1),y=o.documentTop;if(b)u==null&&(u=b.left-h.left),d=l<0?b.top:b.bottom;else{let R=o.viewState.lineBlockAt(a);u==null&&(u=Math.min(h.right-h.left,o.defaultCharacterWidth*(a-R.from))),d=(l<0?R.top:R.bottom)+y}let C=h.left+u,E=s!=null?s:o.viewState.heightOracle.textHeight>>1;for(let R=0;;R+=10){let $=d+(E+R)*l,Q=hbe(o,{x:C,y:$},!1,l);if($<h.top||$>h.bottom||(l<0?Q<a:Q>a)){let F=o.docView.coordsForChar(Q),U=!F||$<F.top?-1:1;return Ln.cursor(Q,U,void 0,u)}}}function $H(o,e,t){for(;;){let s=0;for(let a of o)a.between(e-1,e+1,(l,u,d)=>{if(e>l&&e<u){let h=s||t||(e-l<u-e?-1:1);e=h<0?l:u,s=h}});if(!s)return e}}function Rne(o,e,t){let s=$H(o.state.facet(Ore).map(a=>a(o)),t.from,e.head>t.from?-1:1);return s==t.from?t:Ln.cursor(s,s<t.from?1:-1)}class YEe{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=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.handleEvent=this.handleEvent.bind(this),e.scrollDOM.addEventListener("mousedown",t=>{if(t.target==e.scrollDOM&&t.clientY>e.contentDOM.getBoundingClientRect().bottom&&(this.runHandlers("mousedown",t),!t.defaultPrevented&&t.button==2)){let s=e.contentDOM.style.minHeight;e.contentDOM.style.minHeight="100%",setTimeout(()=>e.contentDOM.style.minHeight=s,200)}}),e.scrollDOM.addEventListener("drop",t=>{t.target==e.scrollDOM&&t.clientY>e.contentDOM.getBoundingClientRect().bottom&&this.runHandlers("drop",t)}),this.notifiedFocused=e.hasFocus,Fs.safari&&e.contentDOM.addEventListener("input",()=>null),Fs.gecko&&c3e(e.contentDOM.ownerDocument)}handleEvent(e){!t3e(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let s=this.handlers[e];if(s){for(let a of s.observers)a(this.view,t);for(let a of s.handlers){if(t.defaultPrevented)break;if(a(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=XEe(e),s=this.handlers,a=this.view.contentDOM;for(let l in t)if(l!="scroll"){let u=!t[l].handlers.length,d=s[l];d&&u!=!d.handlers.length&&(a.removeEventListener(l,this.handleEvent),d=null),d||a.addEventListener(l,this.handleEvent,{passive:u})}for(let l in s)l!="scroll"&&!t[l]&&a.removeEventListener(l,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()<this.lastEscPress+2e3)return!0;if(e.keyCode!=27&&gbe.indexOf(e.keyCode)<0&&(this.view.inputState.lastEscPress=0),Fs.android&&Fs.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Fs.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=mbe.find(s=>s.keyCode==e.keyCode))&&!e.ctrlKey||jEe.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(){let e=this.pendingIOSKey;return e?(this.pendingIOSKey=void 0,_D(this.view.contentDOM,e.key,e.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:Fs.safari&&!Fs.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function kfe(o,e){return(t,s)=>{try{return e.call(o,s,t)}catch(a){zb(t.state,a)}}}function XEe(o){let e=Object.create(null);function t(s){return e[s]||(e[s]={observers:[],handlers:[]})}for(let s of o){let a=s.spec;if(a&&a.domEventHandlers)for(let l in a.domEventHandlers){let u=a.domEventHandlers[l];u&&t(l).handlers.push(kfe(s.value,u))}if(a&&a.domEventObservers)for(let l in a.domEventObservers){let u=a.domEventObservers[l];u&&t(l).observers.push(kfe(s.value,u))}}for(let s in yy)t(s).handlers.push(yy[s]);for(let s in kv)t(s).observers.push(kv[s]);return e}const mbe=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagr Line truncated
`&&o.lineWrapping&&(s&&(s=Ln.single(s.main.anchor-1,s.main.head-1)),t={from:a.from,to:a.to,insert:el.of([" "])}),t){if(Fs.ios&&o.inputState.flushIOSKey()||Fs.android&&(t.from==a.from&&t.to==a.to&&t.insert.length==1&&t.insert.lines==2&&_D(o.contentDOM,"Enter",13)||(t.from==a.from-1&&t.to==a.to&&t.insert.length==0||l==8&&t.insert.length<t.to-t.from&&t.to>a.head)&&_D(o.contentDOM,"Backspace",8)||t.from==a.from&&t.to==a.to+1&&t.insert.length==0&&_D(o.contentDOM,"Delete",46)))return!0;let u=t.insert.toString();o.inputState.composing>=0&&o.inputState.composing++;let d,h=()=>d||(d=x3e(o,t,s));return o.state.facet(K1e).some(b=>b(o,t.from,t.to,u,h))||o.dispatch(h()),!0}else if(s&&!s.main.eq(a)){let u=!1,d="select";return o.inputState.lastSelectionTime>Date.now()-50&&(o.inputState.lastSelectionOrigin=="select"&&(u=!0),d=o.inputState.lastSelectionOrigin),o.dispatch({selection:s,scrollIntoView:u,userEvent:d}),!0}else return!1}function x3e(o,e,t){let s,a=o.state,l=a.selection.main;if(e.from>=l.from&&e.to<=l.to&&e.to-e.from>=(l.to-l.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&o.inputState.composing<0){let d=l.from<e.from?a.sliceDoc(l.from,e.from):"",h=l.to>e.to?a.sliceDoc(e.to,l.to):"";s=a.replaceSelection(o.state.toText(d+e.insert.sliceString(0,void 0,o.state.lineBreak)+h))}else{let d=a.changes(e),h=t&&t.main.to<=d.newLength?t.main:void 0;if(a.selection.ranges.length>1&&o.inputState.composing>=0&&e.to<=l.to&&e.to>=l.to-10){let b=o.state.sliceDoc(e.from,e.to),y,C=t&&fbe(o,t.main.head);if(C){let $=e.insert.length-(e.to-e.from);y={from:C.from,to:C.to-$}}else y=o.state.doc.lineAt(l.head);let E=l.to-e.to,R=l.to-l.from;s=a.changeByRange($=>{if($.from==l.from&&$.to==l.to)return{changes:d,range:h||$.map(d)};let Q=$.to-E,F=Q-b.length;if($.to-$.from!=R||o.state.sliceDoc(F,Q)!=b||$.to>=y.from&&$.from<=y.to)return{range:$};let U=a.changes({from:F,to:Q,insert:e.insert}),K=$.to-l.to;return{changes:U,range:h?Ln.range(Math.max(0,h.anchor+K),Math.max(0,h.head+K)):$.map(U)}})}else s={changes:d,selection:h&&a.selection.replaceRange(h)}}let u="input.type";return(o.composing||o.inputState.compositionPendingChange&&o.inputState.compositionEndedAt>Date.now()-50)&&(o.inputState.compositionPendingChange=!1,u+=".compose",o.inputState.compositionFirstChange&&(u+=".start",o.inputState.compositionFirstChange=!1)),a.update(s,{userEvent:u,scrollIntoView:!0})}function T3e(o,e,t,s){let a=Math.min(o.length,e.length),l=0;for(;l<a&&o.charCodeAt(l)==e.charCodeAt(l);)l++;if(l==a&&o.length==e.length)return null;let u=o.length,d=e.length;for(;u>0&&d>0&&o.charCodeAt(u-1)==e.charCodeAt(d-1);)u--,d--;if(s=="end"){let h=Math.max(0,l-Math.min(u,d));t-=u+h-l}if(u<l&&o.length<e.length){let h=t<=l&&t>=u?l-t:0;l-=h,d=l+(d-u),u=l}else if(d<l){let h=t<=l&&t>=d?l-t:0;l-=h,u=l+(u-d),d=l}return{from:l,toA:u,toB:d}}function E3e(o){let e=[];if(o.root.activeElement!=o.contentDOM)return e;let{anchorNode:t,anchorOffset:s,focusNode:a,focusOffset:l}=o.observer.selectionRange;return t&&(e.push(new Ffe(t,s)),(a!=t||l!=s)&&e.push(new Ffe(a,l))),e}function A3e(o,e){if(o.length==0)return null;let t=o[0].pos,s=o.length==2?o[1].pos:t;return t>-1&&s>-1?Ln.single(t+e,s+e):null}const D3e={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Nne=Fs.ie&&Fs.ie_version<=11;class P3e{constructor(e){this.view=e,this.active=!1,this.selectionRange=new mEe,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.resizeContent=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let s of t)this.queue.push(s);(Fs.ie&&Fs.ie_version<=11||Fs.ios&&e.composing)&&t.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():this.flush()}),Nne&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM),this.resizeContent=new ResizeObserver(()=>this.view.requestMeasure()),this.resizeContent.observe(e.contentDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&& Line truncated
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,pse),K3e={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 Ine=null;function J3e(){var o;if(Ine==null&&typeof document<"u"&&document.body){let e=document.body.style;Ine=((o=e.tabSize)!==null&&o!==void 0?o:e.MozTabSize)!=null}return Ine||!1}const BH=As.define({combine(o){let e=Tv(o,{render:null,specialChars:G3e,addSpecialChars:null});return(e.replaceTabs=!J3e())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,pse)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,pse)),e}});function eAe(o={}){return[BH.of(o),tAe()]}let Yfe=null;function tAe(){return Yfe||(Yfe=kf.fromClass(class{constructor(o){this.view=o,this.decorations=Br.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(o.state.facet(BH)),this.decorations=this.decorator.createDeco(o)}makeDecorator(o){return new q3e({regexp:o.specialChars,decoration:(e,t,s)=>{let{doc:a}=t.state,l=Uh(e[0],0);if(l==9){let u=a.lineAt(s),d=t.state.tabSize,h=Cv(u.text,d,s-u.from);return Br.replace({widget:new rAe((d-h%d)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[l]||(this.decorationCache[l]=Br.replace({widget:new sAe(o,l)}))},boundary:o.replaceTabs?void 0:/[^]/})}update(o){let e=o.state.facet(BH);o.startState.facet(BH)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(o.view)):this.decorations=this.decorator.updateDeco(o,this.decorations)}},{decorations:o=>o.decorations}))}const nAe="\u2022";function oAe(o){return o>=32?nAe:o==10?"\u2424":String.fromCharCode(9216+o)}class sAe extends Gw{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=oAe(this.code),s=e.state.phrase("Control character")+" "+(K3e[this.code]||"0x"+this.code.toString(16)),a=this.options.render&&this.options.render(this.code,s,t);if(a)return a;let l=document.createElement("span");return l.textContent=t,l.title=s,l.setAttribute("aria-label",s),l.className="cm-specialChar",l}ignoreEvent(){return!1}}class rAe extends Gw{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function iAe(){return lAe}const aAe=Br.line({class:"cm-activeLine"}),lAe=kf.fromClass(class{constructor(o){this.decorations=this.getDeco(o)}update(o){(o.docChanged||o.selectionSet)&&(this.decorations=this.getDeco(o.view))}getDeco(o){let e=-1,t=[];for(let s of o.state.selection.ranges){let a=o.lineBlockAt(s.head);a.from>e&&(t.push(aAe.range(a.from)),e=a.from)}return Br.set(t)}},{decorations:o=>o.decorations}),bse=2e3;function cAe(o,e,t){let s=Math.min(e.line,t.line),a=Math.max(e.line,t.line),l=[];if(e.off>bse||t.off>bse||e.col<0||t.col<0){let u=Math.min(e.off,t.off),d=Math.max(e.off,t.off);for(let h=s;h<=a;h++){let b=o.doc.line(h);b.length<=d&&l.push(Ln.range(b.from+u,b.to+d))}}else{let u=Math.min(e.col,t.col),d=Math.max(e.col,t.col);for(let h=s;h<=a;h++){let b=o.doc.line(h),y=qoe(b.text,u,o.tabSize,!0);if(y<0)l.push(Ln.cursor(b.to));else{let C=qoe(b.text,d,o.tabSize);l.push(Ln.range(b.from+y,b.from+C))}}}return l}function uAe(o,e){let t=o.coordsAtPos(o.viewport.from);return t?Math.round(Math.abs((t.left-e)/o.defaultCharacterWidth)):-1}function Xfe(o,e){let t=o.posAtCoords({x:e.clientX,y:e.clientY},!1),s=o.state.doc.lineAt(t),a=t-s.from,l=a>bse?-1:a==s.length?uAe(o,e.clientX):Cv(s.text,o.state.tabSize,t-s.from);return{line:s.number,col:l,off:a}}function fAe(o,e){let t=Xfe(o,e),s=o.state.selection;return t?{update(a){if(a.docChanged){let l=a.changes.mapPos(a.startState.doc.line(t.line).from),u=a.state.doc.lineAt(l);t={line:u.number,col:t.col,off:Math.min(t.off,u.length)},s=s.map(a.changes)}},get(a,l,u){let d=Xfe(o,a);if(!d)return s;let h=cAe(o.state,t,d);return h.length?u?Ln.create(h.concat(s.ranges)):Ln.create(h):s}}:null}function dAe(o){let e=(o==null?void 0:o.eventFilter)||(t=>t.altKey&&t.button==0);return is.mouseSelectionStyle.of((t,s)=>e(s)?fAe(t,s):null)}const hAe={Alt:[18,o=>!!o.altKey],Control:[17,o=>!!o.ctrlKey],Shift:[16,o=>!!o.shiftKey],Meta:[91,o=>!!o.metaKey]},mAe={style:"cursor: crosshair"};function gAe(o={}){let[e,t]=hAe[o.key||"Alt"],s=kf.fromClass(class{constructor(a){this.view=a,this.isDown=!1}set(a){this.isDown!=a&&(this.isDown=a,this.view.update([]))}},{eventObservers:{keydown(a){this.set(a.keyCode==e||t(a))},keyup(a){(a.keyCode==e||!t Line truncated
`:s=="r"?"\r":s=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new mPe(this):new dPe(this)}getCursor(e,t=0,s){let a=e.doc?e:ra.create({doc:e});return s==null&&(s=a.doc.length),this.regexp?lD(this,a,t,s):aD(this,a,t,s)}}class K0e{constructor(e){this.spec=e}}function aD(o,e,t,s){return new ND(e.doc,o.unquoted,t,s,o.caseSensitive?void 0:a=>a.toLowerCase(),o.wholeWord?fPe(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function fPe(o,e){return(t,s,a,l)=>((l>t||l+a.length<s)&&(l=Math.max(0,t-2),a=o.sliceString(l,Math.min(o.length,s+2))),(e(Ez(a,t-l))!=tu.Word||e(Az(a,t-l))!=tu.Word)&&(e(Az(a,s-l))!=tu.Word||e(Ez(a,s-l))!=tu.Word))}class dPe extends K0e{constructor(e){super(e)}nextMatch(e,t,s){let a=aD(this.spec,e,s,e.doc.length).nextOverlapping();return a.done&&(a=aD(this.spec,e,0,t).nextOverlapping()),a.done?null:a.value}prevMatchInRange(e,t,s){for(let a=s;;){let l=Math.max(t,a-1e4-this.spec.unquoted.length),u=aD(this.spec,e,l,a),d=null;for(;!u.nextOverlapping().done;)d=u.value;if(d)return d;if(l==t)return null;a-=1e4}}prevMatch(e,t,s){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,s,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let s=aD(this.spec,e,0,e.doc.length),a=[];for(;!s.next().done;){if(a.length>=t)return null;a.push(s.value)}return a}highlight(e,t,s,a){let l=aD(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(s+this.spec.unquoted.length,e.doc.length));for(;!l.next().done;)a(l.value.from,l.value.to)}}function lD(o,e,t,s){return new X0e(e.doc,o.search,{ignoreCase:!o.caseSensitive,test:o.wholeWord?hPe(e.charCategorizer(e.selection.main.head)):void 0},t,s)}function Ez(o,e){return o.slice(Bm(o,e,!1),e)}function Az(o,e){return o.slice(e,Bm(o,e))}function hPe(o){return(e,t,s)=>!s[0].length||(o(Ez(s.input,s.index))!=tu.Word||o(Az(s.input,s.index))!=tu.Word)&&(o(Az(s.input,s.index+s[0].length))!=tu.Word||o(Ez(s.input,s.index+s[0].length))!=tu.Word)}class mPe extends K0e{nextMatch(e,t,s){let a=lD(this.spec,e,s,e.doc.length).next();return a.done&&(a=lD(this.spec,e,0,t).next()),a.done?null:a.value}prevMatchInRange(e,t,s){for(let a=1;;a++){let l=Math.max(t,s-a*1e4),u=lD(this.spec,e,l,s),d=null;for(;!u.next().done;)d=u.value;if(d&&(l==t||d.from>l+10))return d;if(l==t)return null}}prevMatch(e,t,s){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,s,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,s)=>s=="$"?"$":s=="&"?e.match[0]:s!="0"&&+s<e.match.length?e.match[s]:t))}matchAll(e,t){let s=lD(this.spec,e,0,e.doc.length),a=[];for(;!s.next().done;){if(a.length>=t)return null;a.push(s.value)}return a}highlight(e,t,s,a){let l=lD(this.spec,e,Math.max(0,t-250),Math.min(s+250,e.doc.length));for(;!l.next().done;)a(l.value.from,l.value.to)}}const B6=bi.define(),Ire=bi.define(),xC=Uf.define({create(o){return new Xne(Pse(o).create(),null)},update(o,e){for(let t of e.effects)t.is(B6)?o=new Xne(t.value.create(),o.panel):t.is(Ire)&&(o=new Xne(o.query,t.value?Bre:null));return o},provide:o=>M6.from(o,e=>e.panel)});class Xne{constructor(e,t){this.query=e,this.panel=t}}const gPe=Br.mark({class:"cm-searchMatch"}),pPe=Br.mark({class:"cm-searchMatch cm-searchMatch-selected"}),bPe=kf.fromClass(class{constructor(o){this.view=o,this.decorations=this.highlight(o.state.field(xC))}update(o){let e=o.state.field(xC);(e!=o.startState.field(xC)||o.docChanged||o.selectionSet||o.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:o,panel:e}){if(!e||!o.spec.valid)return Br.none;let{view:t}=this,s=new PC;for(let a=0,l=t.visibleRanges,u=l.length;a<u;a++){let{from:d,to:h}=l[a];for(;a<u-1&&h>l[a+1].from-2*250;)h=l[++a].to;o.highlight(t.state,d,h,(b,y)=>{let C=t.state.selection.ranges.some(E=>E.from==b&&E.to==y);s.add(b,y,C?pPe:gPe)})}return s.finish()}},{decorations:o=>o.decorations});function uI(o){return e=>{let t=e.state.field(xC,!1);return t&&t.query.spec.valid?o(e,t):tve(e)}}const Dz=uI((o,{query:e})=>{let{to:t}=o.state.selection.main,s=e.nextMatch(o.state,t,t);if(!s)return!1;let a=Ln.single(s.from,s.to),l=o.state.facet(eP);return o.dispatch({selection:a,effects:[Lre(o,s),l.scrollToMatch(a.main,o)],userEvent:"select.search"}),eve(o),!0}),Pz=uI((o,{query:e})=>{let{state:t}=o,{from:s}=t.selection.main,a=e.prevMatch(t,s,s);if(!a)return!1;let l=Ln.single(a.from,a.to),u=o.state.facet(eP);return o.dispatch({selection:l,effects:[Lre(o,a),u.scrollToMatch(l.main,o)],userEvent:"select.search"}),eve(o),!0}),vPe=uI((o,{query:e})=>{let t=e.matchAll(o.state,1e3);return!t||!t.length?!1:(o.dispatch({selection:Ln.create(t.map(s=>Ln.range(s.from,s.to))),userEvent:"select.search.matches"}),!0)}),OPe=({state:o,dispatch:e})=>{let t=o.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:s,to:a}=t.main,l=[],u=0;for(let d=new ND(o.doc,o.sliceDoc(s,a));!d.next(). Line truncated
`+t.scrub(),l=this.advance(a);return l>-1&&l<a.length?this.complete(e,s,l):!1}finish(e,t){return(this.stage==2||this.stage==3)&&g6(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,s){return e.addLeafElement(t,ml(Bo.LinkReference,this.start,this.start+s,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(zve(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(ml(Bo.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(Zve(e,g6(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=g6(e,this.pos),s=0;if(t>this.pos){let a=Hve(e,t,this.start);if(a){let l=qne(e,a.to-this.start);l>0&&(this.nextStage(a),s=l)}}return s||(s=qne(e,this.pos)),s>0&&s<e.length?s:-1}else return qne(e,this.pos)}}}function qne(o,e){for(;e<o.length;e++){let t=o.charCodeAt(e);if(t==10)break;if(!qb(t))return-1}return e}class I5e{nextLine(e,t,s){let a=t.depth<e.stack.length?-1:Pve(t),l=t.next;if(a<0)return!1;let u=ml(Bo.HeaderMark,e.lineStart+t.pos,e.lineStart+a);return e.nextLine(),e.addLeafElement(s,ml(l==61?Bo.SetextHeading1:Bo.SetextHeading2,s.start,e.prevLineEnd(),[...e.parser.parseInline(s.content,s.start),u])),!0}finish(){return!1}}const B5e={LinkReference(o,e){return e.content.charCodeAt(0)==91?new N5e(e):null},SetextHeading(){return new I5e}},L5e=[(o,e)=>Dve(e)>=0,(o,e)=>Tve(e)>=0,(o,e)=>Eve(e)>=0,(o,e)=>jre(e,o,!0)>=0,(o,e)=>qre(e,o,!0)>=0,(o,e)=>Xre(e,o,!0)>=0,(o,e)=>$ve(e,o,!0)>=0],F5e={text:"",end:0};class Q5e{constructor(e,t,s,a){this.parser=e,this.input=t,this.ranges=a,this.line=new $5e,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=a[a.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=a[0].from,this.block=$z.create(Bo.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=s.length?new V5e(s,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(;e.depth<this.stack.length;)this.finishContext();for(let s of e.markers)this.addNode(s.type,s.from,s.to);if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let s of this.parser.blockParsers)if(s){let a=s(this,e);if(a!=!1){if(a==!0)return null;e.forward();continue e}}break}let t=new R5e(this.lineStart+e.pos,e.text.slice(e.pos));for(let s of this.parser.leafBlockParsers)if(s){let a=s(this,t);a&&t.parsers.push(a)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let s of this.parser.endLeafBlock)if(s(this,e,t))break e}for(let s of t.parsers)if(s.nextLine(this,e,t))return null;t.content+=`
`+e.scrub();for(let s of e.markers)t.marks.push(s)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=Vve(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=F5e;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let s=this.absoluteLineStart,a=this.rangeI;for(;this.ranges[a].to<t.end;){a++;let l=this.ranges[a].from,u=this.lineChunkAt(l);t.end=l+u.length,t.text=t.text.slice(0,this.ranges[a-1].to-s)+u,s=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:s}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=s,e.reset(t);e.depth<this.stack.length;e.depth++){let a=this.stack[e.depth],l=this.parser.skipContextMarkup[a.type];if(!l)throw new Error("Unhandled block context "+Bo[a.type]);if(!l(a,this,e))break;e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),s;if(this.input.lineChunks)s=t==`
`?"":t;else{let a=t.indexOf(`
`);s=a<0?t:t.slice(0,a)}return e+s.length>this.to?s.slice(0,this.to-e):s}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,s=0){this.block=$z.create(e,s,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,s=0){this.startContext(this.parser.getNodeType(e),t,s)}addNode(e,t,s){typeof e=="number"&&(e=new Cl(this.parser.nodeSet.types[e],BD,BD,(s!=null?s:this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(Ise(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?Nve(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let s of e.parsers)if(s.finish(this,e))return;let t=Ise(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(Bo.Paragraph,e.content.length),e.start)}elt(e,t,s,a){return typeof e=="string"?ml(this.parser.getNodeType(e),t,s,a):new Lve(e,t)}get buffer(){return new Bve(this.parser.nodeSet)}}function Nve(o,e,t,s,a){let l=o[e].to,u=[],d=[],h=t.from+s;function b(y,C){for(;C?y>=l:y>l;){let E=o[e+1].from-l;s+=E,y+=E,e++,l=o[e].to}}for(let y=t.firstChild;y;y=y.nextSibling){b(y.from+s,!0);let C=y.from+s,E,R=a.get(y.tree);R?E=R:y.to+s>l?(E=Nve(o,e,y,s,a),b(y.to+s,!1)):E=y.toTree(),u.push(E),d.push(C-h)}return b(t.to+s,!1),new Cl(t.type,u,d,t.to+s-h,t.tree?t.tree.propValues:void 0)}class bV extends kre{constructor(e,t,s,a,l,u,d,h,b){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=s,this.blockNames=a,this.endLeafBlock=l,this.skipContextMarkup=u,this.inlineParsers=d,this.inlineNames=h,this.wrappers=b,this.nodeTypes=Object.create(null);for(let y of e.types)this.nodeTypes[y.name]=y.id}createParse(e,t,s){let a=new Q5e(this,e,t,s);for(let l of this.wrappers)a=l(a,e,t,s);return a}configure(e){let t=Nse(e);if(!t)return this;let{nodeSet:s,skipContextMarkup:a}=this,l=this.blockParsers.slice(),u=this.leafBlockParsers.slice(),d=this.blockNames.slice(),h=this.inlineParsers.slice(),b=this.inlineNames.slice(),y=this.endLeafBlock.slice(),C=this.wrappers;if(VN(t.defineNodes)){a=Object.assign({},a);let E=s.types.slice(),R;for(let $ of t.defineNodes){let{name:Q,block:F,composite:U,style:K}=typeof $=="string"?{name:$}:$;if(E.some(ne=>ne.name==Q))continue;U&&(a[E.length]=(ne,oe,G)=>U(oe,G,ne.value));let L=E.length,te=U?["Block","BlockContext"]:F?L>=Bo.ATXHeading1&&L<=Bo.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;E.push(Sd.define({id:L,name:Q,props:te&&[[ui.group,te]]})),K&&(R||(R={}),Array.isArray(K)||K instanceof _v?R[Q]=K:Object.assign(R,K))}s=new aI(E),R&&(s=s.extend(SE(R)))}if(VN(t.props)&&(s=s.extend(...t.props)),VN(t.remove))for(let E of t.remove){let R=this.blockNames.indexOf(E),$=this.inlineNames.indexOf(E);R>-1&&(l[R]=u[R]=void 0),$>-1&&(h[$]=void 0)}if(VN(t.parseBlock))for(let E of t.parseBlock){let R=d.indexOf(E.name);if(R>-1)l[R]=E.parse,u[R]=E.leaf;else{let $=E.before?lH(d,E.before):E.after?lH(d,E.after)+1:d.length-1;l.splice($,0,E.parse),u.splice($,0,E.leaf),d.splice($,0,E.name)}E.endLeaf&&y.push(E.endLeaf)}if(VN(t.parseInline))for(let E of t.parseInline){let R=b.indexOf(E.name);if(R>-1)h[R]=E.parse;else{let $=E.before?lH(b,E.before):E.after?lH(b,E.after)+1:b.length-1;h.splice($,0,E.parse),b.splice($,0,E.name)}}return t.wrap&&(C=C.concat(t.wrap)),new bV(s,l,u,d,y,a,h,b,C)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let s=new H5e(this,e,t);e:for(let a=t;a<s.end;){let l=s.char(a);for(let u of this.inlineParsers)if(u){let d=u(s,l,a);if(d>=0){a=d;continue e}}a++}return s.resolveMarkers(0)}}function VN(o){return o!=null&&o.length>0}function Nse(o){if(!Array.isArray(o))return o;if(o.length==0)return null;let e=Nse(o[0]);if(o.length==1)return e;let t=Nse(o.slice(1));if(!t||!e)return e||t;let s=(u,d)=>(u||BD).concat(d||BD),a=e.wrap,l=t.wrap;return{props:s(e.props,t.props),defineNodes:s(e.defineNodes,t.defineNodes),parseBlock:s(e.parseBlock,t.parseBlock),parseInline:s(e.parseInline,t.parseInline),remove:s(e.remove,t.remove),wrap:a?l?(u,d,h,b)=>a(l(u,d,h,b),d,h,b):a:l}}function lH(o,e){let t=o.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}let Ive=[Sd.none];for(let o=1,e;e=Bo[o];o++)Ive[o]=Sd.define({id:o,name:e,props:o>=Bo.Escape?[]:[[ui.group,o in xve?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const BD=[];class Bve{constructor(e){this.nodeSet=e,this.content=[] Line truncated
`;)l--;this.fragmentEnd=l?l-1:0}let s=this.cursor;s||(s=this.cursor=this.fragment.tree.cursor(),s.firstChild());let a=e+this.fragment.offset;for(;s.to<=a;)if(!s.parent())return!1;for(;;){if(s.from>=a)return this.fragment.from<=t;if(!s.childAfter(a))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(ui.contextHash)==e}takeNodes(e){let t=this.cursor,s=this.fragment.offset,a=this.fragmentEnd-(this.fragment.openEnd?1:0),l=e.absoluteLineStart,u=l,d=e.block.children.length,h=u,b=d;for(;;){if(t.to-s>a){if(t.type.isAnonymous&&t.firstChild())continue;break}let y=Vve(t.from-s,e.ranges);if(t.to-s<=e.ranges[e.rangeI].to)e.addNode(t.tree,y);else{let C=new Cl(e.parser.nodeSet.types[Bo.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(C,t.tree),e.addNode(C,y)}if(t.type.is("Block")&&(z5e.indexOf(t.type.id)<0?(u=t.to-s,d=e.block.children.length):(u=h,d=b,h=t.to-s,b=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>d;)e.block.children.pop(),e.block.positions.pop();return u-l}}function Vve(o,e){let t=o;for(let s=1;s<e.length;s++){let a=e[s-1].to,l=e[s].from;a<o&&(t-=l-a)}return t}const W5e=SE({"Blockquote/...":yt.quote,HorizontalRule:yt.contentSeparator,"ATXHeading1/... SetextHeading1/...":yt.heading1,"ATXHeading2/... SetextHeading2/...":yt.heading2,"ATXHeading3/...":yt.heading3,"ATXHeading4/...":yt.heading4,"ATXHeading5/...":yt.heading5,"ATXHeading6/...":yt.heading6,"Comment CommentBlock":yt.comment,Escape:yt.escape,Entity:yt.character,"Emphasis/...":yt.emphasis,"StrongEmphasis/...":yt.strong,"Link/... Image/...":yt.link,"OrderedList/... BulletList/...":yt.list,"BlockQuote/...":yt.quote,"InlineCode CodeText":yt.monospace,URL:yt.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":yt.processingInstruction,"CodeInfo LinkLabel":yt.labelName,LinkTitle:yt.string,Paragraph:yt.content}),U5e=new bV(new aI(Ive).extend(W5e),Object.keys(aH).map(o=>aH[o]),Object.keys(aH).map(o=>B5e[o]),Object.keys(aH),L5e,xve,Object.keys(Gne).map(o=>Gne[o]),Object.keys(Gne),[]);function Y5e(o,e,t){let s=[];for(let a=o.firstChild,l=e;;a=a.nextSibling){let u=a?a.from:t;if(u>l&&s.push({from:l,to:u}),!a)break;l=a.to}return s}function X5e(o){let{codeParser:e,htmlParser:t}=o;return{wrap:Xbe((a,l)=>{let u=a.type.id;if(e&&(u==Bo.CodeBlock||u==Bo.FencedCode)){let d="";if(u==Bo.FencedCode){let b=a.node.getChild(Bo.CodeInfo);b&&(d=l.read(b.from,b.to))}let h=e(d);if(h)return{parser:h,overlay:b=>b.type.id==Bo.CodeText}}else if(t&&(u==Bo.HTMLBlock||u==Bo.HTMLTag))return{parser:t,overlay:Y5e(a.node,a.from,a.to)};return null})}}const j5e={resolve:"Strikethrough",mark:"StrikethroughMark"},q5e={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":yt.strikethrough}},{name:"StrikethroughMark",style:yt.processingInstruction}],parseInline:[{name:"Strikethrough",parse(o,e,t){if(e!=126||o.char(t+1)!=126||o.char(t+2)==126)return-1;let s=o.slice(t-1,t),a=o.slice(t+2,t+3),l=/\s|^$/.test(s),u=/\s|^$/.test(a),d=H6.test(s),h=H6.test(a);return o.addDelimiter(j5e,t,t+2,!u&&(!h||l||d),!l&&(!d||u||h))},after:"Emphasis"}]};function p6(o,e,t=0,s,a=0){let l=0,u=!0,d=-1,h=-1,b=!1,y=()=>{s.push(o.elt("TableCell",a+d,a+h,o.parser.parseInline(e.slice(d,h),a+d)))};for(let C=t;C<e.length;C++){let E=e.charCodeAt(C);E==124&&!b?((!u||d>-1)&&l++,u=!1,s&&(d>-1&&y(),s.push(o.elt("TableDelimiter",C+a,C+a+1))),d=h=-1):(b||E!=32&&E!=9)&&(d<0&&(d=C),h=C+1),b=!b&&E==92}return d>-1&&(l++,s&&y()),l}function Yde(o,e){for(let t=e;t<o.length;t++){let s=o.charCodeAt(t);if(s==124)return!0;s==92&&t++}return!1}const Wve=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class Xde{constructor(){this.rows=null}nextLine(e,t,s){if(this.rows==null){this.rows=!1;let a;if((t.next==45||t.next==58||t.next==124)&&Wve.test(a=t.text.slice(t.pos))){let l=[];p6(e,s.content,0,l,s.start)==p6(e,a,t.pos)&&(this.rows=[e.elt("TableHeader",s.start,s.start+s.content.length,l),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let a=[];p6(e,t.text,t.pos,a,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,a))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows)),!0):!1}}const G5e={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":yt.heading}},"TableRow",{name:"TableCell",style:yt.content},{name:"TableDelimiter",style:yt.processingInstruction}],parseBlock:[{name:"Table",leaf(o,e){return Yde(e.content,0)?new Xde:null},endLeaf(o,e,t){if(t.parsers.some(a=>a instanceof Xde)||!Yde(e.text,e.basePos))return!1;let s=o.scanLine(o.absoluteLineEnd+1).text;return Wve.test(s)&&p6(o,e.text,e.basePos)==p6(o,s,e.basePos)},before:"SetextHeading"}]};class K5e{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const J5e={defineNodes:[{name:"Task",block:!0,style:yt.lis Line truncated
\${}
} catch (\${error}) {
\${}
}`,{label:"try",detail:"/ catch block",type:"keyword"}),$p("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),$p(`if (\${}) {
\${}
} else {
\${}
}`,{label:"if",detail:"/ else block",type:"keyword"}),$p(`class \${name} {
constructor(\${params}) {
\${}
}
}`,{label:"class",detail:"definition",type:"keyword"}),$p('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),$p('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],VRe=uOe.concat([$p("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),$p("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),$p("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),_he=new Ybe,fOe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function UN(o){return(e,t)=>{let s=e.node.getChild("VariableDefinition");return s&&t(s,o),!0}}const WRe=["FunctionDeclaration"],URe={FunctionDeclaration:UN("function"),ClassDeclaration:UN("class"),ClassExpression:()=>!0,EnumDeclaration:UN("constant"),TypeAliasDeclaration:UN("type"),NamespaceDeclaration:UN("namespace"),VariableDefinition(o,e){o.matchContext(WRe)||e(o,"variable")},TypeDefinition(o,e){e(o,"type")},__proto__:null};function dOe(o,e){let t=_he.get(e);if(t)return t;let s=[],a=!0;function l(u,d){let h=o.sliceString(u.from,u.to);s.push({label:h,type:d})}return e.cursor(wc.IncludeAnonymous).iterate(u=>{if(a)a=!1;else if(u.name){let d=URe[u.name];if(d&&d(u,l)||fOe.has(u.name))return!1}else if(u.to-u.from>8192){for(let d of dOe(o,u.node))s.push(d);return!1}}),_he.set(e,s),s}const She=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,hOe=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function YRe(o){let e=_c(o.state).resolveInner(o.pos,-1);if(hOe.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&She.test(o.state.sliceDoc(e.from,e.to));if(!t&&!o.explicit)return null;let s=[];for(let a=e;a;a=a.parent)fOe.has(a.name)&&(s=s.concat(dOe(o.state.doc,a)));return{options:s,from:t?e.from:o.pos,validFor:She}}const gy=pE.define({name:"javascript",parser:zRe.configure({props:[GD.add({IfStatement:SD({except:/^\s*({|else\b)/}),TryStatement:SD({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:f4e,SwitchBody:o=>{let e=o.textAfter,t=/^\s*\}/.test(e),s=/^\s*(case|default)\b/.test(e);return o.baseIndent+(t?0:s?1:2)*o.unit},Block:u4e({closing:"}"}),ArrowFunction:o=>o.baseIndent+o.unit,"TemplateString BlockComment":()=>null,"Statement Property":SD({except:/^{/}),JSXElement(o){let e=/^\s*<\//.test(o.textAfter);return o.lineIndent(o.node.from)+(e?0:o.unit)},JSXEscape(o){let e=/\s*\}/.test(o.textAfter);return o.lineIndent(o.node.from)+(e?0:o.unit)},"JSXOpenTag JSXSelfClosingTag"(o){return o.column(o.node.from)+o.unit}}),KD.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Dre,BlockComment(o){return{from:o.from+2,to:o.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),mOe={test:o=>/^JSX/.test(o.name),facet:xre({commentTokens:{block:{open:"{/*",close:"*/}"}}})},gOe=gy.configure({dialect:"ts"},"typescript"),pOe=gy.configure({dialect:"jsx",props:[Tre.add(o=>o.isTop?[mOe]:void 0)]}),bOe=gy.configure({dialect:"jsx ts",props:[Tre.add(o=>o.isTop?[mOe]:void 0)]},"typescript");let vOe=o=>({label:o,type:"keyword"});const OOe="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(vOe),XRe=OOe.concat(["declare","implements","private","protected","public"].map(vOe));function jRe(o={}){let e=o.jsx?o.typescript?bOe:pOe:o.typescript?gOe:gy,t=o.typescript?VRe.concat(XRe):uOe.concat(OOe);return new $D(e,[gy.data.of({autocomplete:xPe(hOe,ove(t))}),gy.data.of({autocomplete:YRe}),o.jsx?KRe:[]])}function qRe(o){for(;;){if(o.name=="JSXOpenTag"||o.name=="JSXSelfClosingTag"||o.name=="JSXFragmentTag")return o;if(o.name=="JSXEscape"||!o.parent)return null;o=o.parent}}function Che(o,e,t=o.length){for(let s=e==null?void 0:e.firstChild;s;s=s.nextSibling)if(s.name=="JSXIdentifier"||s.name=="JSXBuiltin"||s.name=="JSXNamespacedName"||s.name=="JSXMemberExpression")return o.sliceString(s.from,Math.min(s.to,t));return""}const GRe=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),KRe=is.inputHandler.of((o,e,t,s,a)=>{if((GRe?o.composing:o.compositionStarted)||o.state.readOnly||e!=t||s!=">"&&s!="/"||!gy.isActiveAt(o.state,e,-1))return!1;let l=a(),{state:u}=l,d=u.changeByRange(h=>{var b;let{head:y}=h,C=_c(u).resolveInner(y-1,-1),E;if(C.name=="JSXStartTag"&&(C=C.parent),!(u.doc.sliceString(y-1,y)!=s||C.name=="JSXAttributeValue"&&C.to>y)){if(s==">"&&C.name=="JSXFragmentTag")return{range:h,changes:{from:y,insert:"</>"}};if(s=="/"&&C.name=="JSXStartCloseTag"){let R=C.parent,$=R.parent;if($&&R.from==y-2&&((E=Che(u.doc,$.firstChild,y))||((b=$.firstChil Line truncated
Block name: `),U=re("input"),L=Ze(),te=re("div"),te.innerHTML='<hr class="dropdown-divider"/>',ne=Ze(),oe=re("h6"),oe.textContent="Actions",G=Ze(),we=re("button"),we.textContent="Move up",ve=Ze(),Re=re("button"),Re.textContent="Move down",Oe=Ze(),ce=re("button"),ce.textContent="Delete",Xe=Ze(),tt=re("h6"),tt.textContent="Insert after",ot=Ze();for(let mt=0;mt<rn.length;mt+=1)rn[mt].c();V=Ze(),Qe&&Qe.c(),Z(s,"class","text-muted d-block fs-6 mb-1"),Z(h,"class","btn btn-link btn-sm"),Z(h,"type","button"),Z(h,"data-bs-toggle","dropdown"),Z(h,"aria-expanded","false"),Z($,"class","form-control-plaintext"),$.readOnly=!0,$.value=Q=o[1].id,Z(U,"class","form-control-plaintext"),U.readOnly=!0,U.value=K=o[1].meta.name,Z(E,"class","dropdown-header"),Z(oe,"class","dropdown-header"),Z(we,"class","dropdown-item"),Vo(we,"d-none",o[9](o[1].id)),Z(Re,"class","dropdown-item"),Vo(Re,"d-none",o[10](o[1].id)),Z(ce,"class","dropdown-item text-danger"),Z(tt,"class","dropdown-header"),Z(C,"class","dropdown-menu"),Z(d,"class","dropdown d-inline-block"),Z(t,"class","d-flex justify-content-between"),Z(e,"class","card block-editor-field d-flex svelte-1tnln3c")},m(mt,he){Te(mt,e,he),X(e,t),X(t,s),X(s,l),X(t,u),X(t,d),X(d,h),Kt(b,h,null),X(d,y),X(d,C),X(C,E),X(E,R),X(E,$),X(E,F),X(E,U),X(C,L),X(C,te),X(C,ne),X(C,oe),X(C,G),X(C,we),X(C,ve),X(C,Re),X(C,Oe),X(C,ce),X(C,Xe),X(C,tt),X(C,ot);for(let Zo=0;Zo<rn.length;Zo+=1)rn[Zo]&&rn[Zo].m(C,null);X(e,V),~ut&&Cn[ut].m(e,null),Bt=!0,Ct||(He=[mn(we,"click",o[12]),mn(Re,"click",o[13]),mn(ce,"click",o[14])],Ct=!0)},p(mt,[he]){if((!Bt||he&2)&&a!==(a=mt[1].meta.label+"")&&Fn(l,a),(!Bt||he&2&&Q!==(Q=mt[1].id)&&$.value!==Q)&&($.value=Q),(!Bt||he&2&&K!==(K=mt[1].meta.name)&&U.value!==K)&&(U.value=K),(!Bt||he&514)&&Vo(we,"d-none",mt[9](mt[1].id)),(!Bt||he&1026)&&Vo(Re,"d-none",mt[10](mt[1].id)),he&50){st=mt[4].fields;let Kn;for(Kn=0;Kn<st.length;Kn+=1){const so=Lhe(mt,st,Kn);rn[Kn]?rn[Kn].p(so,he):(rn[Kn]=Fhe(so),rn[Kn].c(),rn[Kn].m(C,null))}for(;Kn<rn.length;Kn+=1)rn[Kn].d(1);rn.length=st.length}let Zo=ut;ut=je(mt),ut===Zo?~ut&&Cn[ut].p(mt,he):(Qe&&(mo(),Be(Cn[Zo],1,1,()=>{Cn[Zo]=null}),go()),~ut?(Qe=Cn[ut],Qe?Qe.p(mt,he):(Qe=Cn[ut]=Et[ut](mt),Qe.c()),xe(Qe,1),Qe.m(e,null)):Qe=null)},i(mt){Bt||(xe(b.$$.fragment,mt),xe(Qe),Bt=!0)},o(mt){Be(b.$$.fragment,mt),Be(Qe),Bt=!1},d(mt){mt&&ke(e),Jt(b),ia(rn,mt),~ut&&Cn[ut].d(),Ct=!1,vi(He)}}}function Z$e(o,e,t){const s=Ur("channel");let{record:a}=e,{blockData:l}=e,{field:u}=e,{graph:d}=e,{block:h}=e,b=s.schemas.find(ce=>ce.name===u.schema);function y(ce,Xe,tt){ce.preventDefault(),t(11,l=m1e(l,Xe,tt))}function C(ce,Xe){ce.preventDefault(),t(11,l=l.filter(tt=>tt.id!==Xe))}function E(ce,Xe){ce.preventDefault();let tt=Lc.exports.findIndex(l,V=>V.id===Xe),ot=l[tt];t(11,l[tt]=l[tt-1],l),t(11,l[tt-1]=ot,l)}function R(ce,Xe){ce.preventDefault();let tt=Lc.exports.findIndex(l,V=>V.id===Xe),ot=l[tt];t(11,l[tt]=l[tt+1],l),t(11,l[tt+1]=ot,l)}function $(ce){return Lc.exports.findIndex(l,Xe=>Xe.id===ce)===0}function Q(ce){return Lc.exports.findIndex(l,Xe=>Xe.id===ce)===l.length-1}const F=ce=>E(ce,h.id),U=ce=>R(ce,h.id),K=ce=>C(ce,h.id),L=(ce,Xe)=>y(Xe,ce,h.id);function te(ce){h=ce,t(1,h)}function ne(ce){h=ce,t(1,h)}function oe(ce){h=ce,t(1,h)}function G(ce){h=ce,t(1,h)}function we(ce){d=ce,t(0,d)}function ve(ce){h=ce,t(1,h)}function Re(ce){d=ce,t(0,d)}function Oe(ce){h=ce,t(1,h)}return o.$$set=ce=>{"record"in ce&&t(2,a=ce.record),"blockData"in ce&&t(11,l=ce.blockData),"field"in ce&&t(3,u=ce.field),"graph"in ce&&t(0,d=ce.graph),"block"in ce&&t(1,h=ce.block)},[d,h,a,u,b,y,C,E,R,$,Q,l,F,U,K,L,te,ne,oe,G,we,ve,Re,Oe]}class H$e extends uo{constructor(e){super(),co(this,e,Z$e,Q$e,lo,{record:2,blockData:11,field:3,graph:0,block:1})}}function Qhe(o,e,t){const s=o.slice();return s[10]=e[t],s[11]=e,s[12]=t,s}function Zhe(o,e){let t,s,a,l,u,d,h,b=un,y;function C(Q){e[6](Q,e[10],e[11],e[12])}function E(Q){e[7](Q)}function R(Q){e[8](Q)}let $={record:e[2],field:e[3]};return e[10]!==void 0&&($.block=e[10]),e[0]!==void 0&&($.blockData=e[0]),e[1]!==void 0&&($.graph=e[1]),s=new H$e({props:$}),Ro.push(()=>er(s,"block",C)),Ro.push(()=>er(s,"blockData",E)),Ro.push(()=>er(s,"graph",R)),{key:o,first:null,c(){t=re("div"),en(s.$$.fragment),d=Ze(),Z(t,"class","block-field-wrapper"),this.first=t},m(Q,F){Te(Q,t,F),Kt(s,t,null),X(t,d),y=!0},p(Q,F){e=Q;const U={};F&4&&(U.record=e[2]),F&8&&(U.field=e[3]),!a&&F&1&&(a=!0,U.block=e[10],lr(()=>a=!1)),!l&&F&1&&(l=!0,U.blockData=e[0],lr(()=>l=!1)),!u&&F&2&&(u=!0,U.graph=e[1],lr(()=>u=!1)),s.$set(U)},r(){h=t.getBoundingClientRect()},f(){Tpe(t),b()},a(){b(),b=xpe(t,h,h1e,{delay:250,duration:250,easing:Mpe})},i(Q){y||(xe(s.$$.fragment,Q),y=!0)},o(Q){Be(s.$$.fragment,Q),y=!1},d(Q){Q&&ke(t),Jt(s)}}}function z$e(o){let e,t,s,a,l,u=[],d=new Map,h;function b(R){o[5](R)}let y={blockSchema:o[4]};o[0]!==void 0&&(y.blockData=o[0]),s=new ATe({props:y}),Ro.push(()=>er(s,"blockData",b));let C=o[0];const E=R=>R[10].id;for(let R=0;R<C.length;R+=1){let $=Qhe(o,C Line truncated
<span class='flatpickr-weekday'>
`+et.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function Ct(){t.calendarContainer.classList.add("hasWeeks");var ze=dl("div","flatpickr-weekwrapper");ze.appendChild(dl("span","flatpickr-weekday",t.l10n.weekAbbreviation));var et=dl("div","flatpickr-weeks");return ze.appendChild(et),{weekWrapper:ze,weekNumbers:et}}function He(ze,et){et===void 0&&(et=!0);var Tt=et?ze:ze-t.currentMonth;Tt<0&&t._hidePrevMonthArrow===!0||Tt>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=Tt,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Po("onYearChange"),Xe()),ce(),Po("onMonthChange"),bs())}function st(ze,et){if(ze===void 0&&(ze=!0),et===void 0&&(et=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,et===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var Tt=hoe(t.config),Wt=Tt.hours,Yn=Tt.minutes,po=Tt.seconds;R(Wt,Yn,po)}t.redraw(),ze&&Po("onChange")}function rn(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Po("onClose")}function Et(){t.config!==void 0&&Po("onDestroy");for(var ze=t._handlers.length;ze--;)t._handlers[ze].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 et=t.calendarContainer.parentNode;if(et.lastChild&&et.removeChild(et.lastChild),et.parentNode){for(;et.firstChild;)et.parentNode.insertBefore(et.firstChild,et);et.parentNode.removeChild(et)}}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(Tt){try{delete t[Tt]}catch{}})}function Cn(ze){return t.calendarContainer.contains(ze)}function je(ze){if(t.isOpen&&!t.config.inline){var et=R1(ze),Tt=Cn(et),Wt=et===t.input||et===t.altInput||t.element.contains(et)||ze.path&&ze.path.indexOf&&(~ze.path.indexOf(t.input)||~ze.path.indexOf(t.altInput)),Yn=!Wt&&!Tt&&!Cn(ze.relatedTarget),po=!t.config.ignoredFocusElements.some(function(wo){return wo.contains(et)});Yn&&po&&(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&&h(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function mt(ze){if(!(!ze||t.config.minDate&&ze<t.config.minDate.getFullYear()||t.config.maxDate&&ze>t.config.maxDate.getFullYear())){var et=ze,Tt=t.currentYear!==et;t.currentYear=et||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)),Tt&&(t.redraw(),Po("onYearChange"),Xe())}}function he(ze,et){var Tt;et===void 0&&(et=!0);var Wt=t.parseDate(ze,void 0,et);if(t.config.minDate&&Wt&&N1(Wt,t.config.minDate,et!==void 0?et:!t.minDateHasTime)<0||t.config.maxDate&&Wt&&N1(Wt,t.config.maxDate,et!==void 0?et:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(Wt===void 0)return!1;for(var Yn=!!t.config.enable,po=(Tt=t.config.enable)!==null&&Tt!==void 0?Tt:t.config.disable,wo=0,fn=void 0;wo<po.length;wo++){if(fn=po[wo],typeof fn=="function"&&fn(Wt))return Yn;if(fn instanceof Date&&Wt!==void 0&&fn.getTime()===Wt.getTime())return Yn;if(typeof fn=="string"){var os=t.parseDate(fn,void 0,!0);return os&&os.getTime()===Wt.getTime()?Yn:!Yn}else if(typeof fn=="object"&&Wt!==void 0&&fn.from&&fn.to&&Wt.getTime()>=fn.from.getTime()&&Wt.getTime()<=fn.to.getTime())return Yn}return!Yn}function Zo(ze){return t.daysContainer!==void 0?ze.className.indexOf("hidden")===-1&&ze.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(ze):!1}function Kn(ze){var et=ze.target===t._input,Tt=t._input.value.trimEnd()!==_a();et&&Tt&&!(ze.relatedTarget&&Cn(ze.relatedTarget))&&t.setDa Line truncated
versions`),Cn=Ze(),je=re("div"),he.c(),Zo=Ze(),Kn=re("div"),jt&&jt.c(),Z(l,"class","label text-end text-muted svelte-4o2asb"),Z(E,"class","label text-end text-muted svelte-4o2asb"),Z(K,"class","label text-end text-muted svelte-4o2asb"),Z(Re,"class","label text-end text-muted svelte-4o2asb"),Z(s,"class","col-8"),Z(Qe,"class","label d-block text-muted svelte-4o2asb"),Z(ut,"class","col-4"),Z(t,"class","row"),Z(e,"class","lx-card "),Z(je,"class","lx-card mt-4")},m(pt,Ne){Te(pt,e,Ne),X(e,t),X(t,s),X(s,a),X(a,l),X(a,u),X(a,d),X(d,b),X(s,y),X(s,C),X(C,E),X(C,R),X(C,Q),X(s,F),X(s,U),X(U,K),X(U,L),Kt(te,U,null),X(U,ne),X(U,G),X(s,we),X(s,ve),X(ve,Re),X(ve,Oe),Kt(ce,ve,null),X(ve,Xe),X(ve,ot),X(t,V),X(t,ut),X(ut,Qe),X(ut,Bt),X(ut,Ct),X(Ct,He),X(Ct,rn),X(Ct,Et),Te(pt,Cn,Ne),Te(pt,je,Ne),as[mt].m(je,null),Te(pt,Zo,Ne),Te(pt,Kn,Ne),jt&&jt.m(Kn,null),o[13](Kn),so=!0},p(pt,[Ne]){(!so||Ne&1)&&h!==(h=pt[0].id+"")&&Fn(b,h),(!so||Ne&1)&&$!==($=pt[0]._sys.version+"")&&Fn(Q,$);const Gt={};Ne&3&&(Gt.name=Lp(pt[1],pt[0]._sys.createdBy)),te.$set(Gt),(!so||Ne&1)&&oe!==(oe=cy(pt[0]._sys.createdAt)+"")&&Fn(G,oe);const bn={};Ne&3&&(bn.name=Lp(pt[1],pt[0]._sys.updatedBy)),ce.$set(bn),(!so||Ne&1)&&tt!==(tt=cy(pt[0]._sys.updatedAt)+"")&&Fn(ot,tt),(!so||Ne&4)&&st!==(st=pt[2].revisions+"")&&Fn(rn,st);let At=mt;mt=kt(pt),mt===At?as[mt].p(pt,Ne):(mo(),Be(as[At],1,1,()=>{as[At]=null}),go(),he=as[mt],he?he.p(pt,Ne):(he=as[mt]=Yo[mt](pt),he.c()),xe(he,1),he.m(je,null)),pt[5]?jt?(jt.p(pt,Ne),Ne&32&&xe(jt,1)):(jt=Jme(pt),jt.c(),xe(jt,1),jt.m(Kn,null)):jt&&(mo(),Be(jt,1,1,()=>{jt=null}),go())},i(pt){so||(xe(te.$$.fragment,pt),xe(ce.$$.fragment,pt),xe(he),xe(jt),so=!0)},o(pt){Be(te.$$.fragment,pt),Be(ce.$$.fragment,pt),Be(he),Be(jt),so=!1},d(pt){pt&&ke(e),Jt(te),Jt(ce),pt&&ke(Cn),pt&&ke(je),as[mt].d(),pt&&ke(Zo),pt&&ke(Kn),jt&&jt.d(),o[13](null)}}}function j6e(o,e,t){let s,a,l,u;const d=Ur("channel");let{record:h}=e,{graph:b}=e,{users:y}=e,{schema:C}=e,E,R="";axios.get(`${d.lucentUrl}/records/${h.id}/revisions`).then(L=>{t(8,s=L.data)}).catch(L=>{console.log(L)});function $(L,te){t(7,u=b.edges.filter(ne=>ne.depth===1).reduce((ne,oe)=>(ne[oe.field]||(ne[oe.field]={record:[],revision:[]}),ne[oe.field].record.push(oe),ne),{})),t(7,u=te._edges.reduce((ne,oe)=>(ne[oe.field]||(ne[oe.field]={record:[],revision:[]}),ne[oe.field].revision.push(oe),ne),u))}function Q(L,te){L.preventDefault(),t(5,l=te),t(6,a=C.fields.filter(ne=>!Lc.exports.isEqual(l.data[ne.name],h.data[ne.name]))),$(a,te),E.scrollIntoView()}function F(L){L.preventDefault(),t(4,R=""),axios.post(`${d.lucentUrl}/records/${h.id}/rollback/${l._sys.version}`).then(te=>{window.location.reload()}).catch(te=>{const ne=te.response.data.error;t(4,R=ne.fieldLabel+": "+ne.message)})}const U=(L,te)=>Q(te,L);function K(L){Ro[L?"unshift":"push"](()=>{E=L,t(3,E)})}return o.$$set=L=>{"record"in L&&t(0,h=L.record),"graph"in L&&t(11,b=L.graph),"users"in L&&t(1,y=L.users),"schema"in L&&t(2,C=L.schema)},t(8,s=[]),t(6,a=[]),t(5,l=null),t(7,u={}),[h,y,C,E,R,l,a,u,s,Q,F,b,U,K]}class q6e extends uo{constructor(e){super(),co(this,e,j6e,X6e,lo,{record:0,graph:11,users:1,schema:2})}}const{window:G6e}=q2e;function age(o,e,t){const s=o.slice();return s[23]=e[t],s}function lge(o){let e,t,s,a,l,u;function d(E){o[15](E)}let h={record:o[0],schema:o[2]};o[0].status!==void 0&&(h.status=o[0].status),s=new zpe({props:h}),Ro.push(()=>er(s,"status",d));function b(E,R){if(E[4])return J6e;if(E[10])return K6e}let y=b(o),C=y&&y(o);return{c(){e=re("div"),t=re("div"),en(s.$$.fragment),l=Ze(),C&&C.c(),Z(t,"class","d-flex mt-3 mb-3 align-items-center justify-content-center"),Z(e,"class","shadow-lg "),rs(e,"position","fixed"),rs(e,"bottom","0"),rs(e,"left","0px"),rs(e,"width","100%"),rs(e,"background","rgb(206, 223, 210)"),rs(e,"z-index","1050")},m(E,R){Te(E,e,R),X(e,t),Kt(s,t,null),X(t,l),C&&C.m(t,null),u=!0},p(E,R){const $={};R&1&&($.record=E[0]),R&4&&($.schema=E[2]),!a&&R&1&&(a=!0,$.status=E[0].status,lr(()=>a=!1)),s.$set($),y===(y=b(E))&&C?C.p(E,R):(C&&C.d(1),C=y&&y(E),C&&(C.c(),C.m(t,null)))},i(E){u||(xe(s.$$.fragment,E),u=!0)},o(E){Be(s.$$.fragment,E),u=!1},d(E){E&&ke(e),Jt(s),C&&C.d()}}}function K6e(o){let e,t,s;return{c(){e=re("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Save`,Z(e,"type","button"),Z(e,"class","ms-2 btn btn-primary btn-spinner")},m(a,l){Te(a,e,l),t||(s=mn(e,"click",o[13]),t=!0)},p:un,d(a){a&&ke(e),t=!1,s()}}}function J6e(o){let e,t,s;return{c(){e=re("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Create`,Z(e,"class","ms-2 btn btn-primary btn-spinner")},m(a,l){Te(a,e,l),t||(s=mn(e,"click",o[13]),t=!0)},p:un,d(a){a&&ke(e),t=!1,s()}}}function eIe(o){let e,t;return e=new q6e({props:{record:o[0],graph:o[1],users:o[6],schema:o[2]}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&1&&(l.record=s[0]),a&2&&(l.graph=s[1]),a&64&&(l.users=s[6]),a&4&&(l.schema=s[2]),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function tIe(o){let e,t;return e=new R6e({props:{graph:o[1],record:o[0]}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&2&&(l.graph=s[1]),a&1&&(l.record=s[0]),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function nIe(o){let e,t,s=[],a=new Map,l,u;e=new Vpe({props:{record:o[0],schema:o[2]}});let d=o[11];const h=b=>b[23].name;for(let b=0;b<d.length;b+=1){let y=age(o,d,b),C=h(y);a.set(C,s[b]=uge(C,y))}return{c(){en(e.$$.fragment),t=Ze();for(let b=0;b<s.length;b+=1)s[b].c();l=Rs()},m(b,y){Kt(e,b,y),Te(b,t,y);for(let C=0;C<s.length;C+=1)s[C]&&s[C].m(b,y);Te(b,l,y),u=!0},p(b,y){const C={};y&1&&(C.record=b[0]),y&4&&(C.schema=b[2]),e.$set(C),y&2455&&(d=b[11],mo(),s=Jd(s,y,h,1,b,d,a,l.parentNode,xv,uge,l,age),go())},i(b){if(!u){xe(e.$$.fragment,b);for(let y=0;y<d.length;y+=1)xe(s[y]);u=!0}},o(b){Be(e.$$.fragment,b);for(let y=0;y<s.length;y+=1)Be(s[y]);u=!1},d(b){Jt(e,b),b&&ke(t);for(let y=0;y<s.length;y+=1)s[y].d(b);b&&ke(l)}}}function cge(o){let e,t,s,a;function l(h){o[17](h)}function u(h){o[18](h)}let d={field:o[23],schema:o[2],record:o[0],validationErrors:o[7],isCreateMode:o[4]};return o[0].data!==void 0&&(d.data=o[0].data),o[1]!==void 0&&(d.graph=o[1]),e=new LOe({props:d}),Ro.push(()=>er(e,"data",l)),Ro.push(()=>er(e,"graph",u)),{c(){en(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const y={};b&4&&(y.schema=h[2]),b&1&&(y.record=h[0]),b&128&&(y.validationErrors=h[7]),b&16&&(y.isCreateMode=h[4]),!t&&b&1&&(t=!0,y.data=h[0].data,lr(()=>t=!1)),!s&&b&2&&(s=!0,y.graph=h[1],lr(()=>s=!1)),e.$set(y)},i(h){a||(xe(e.$$.fragment,h),a=!0)},o(h){Be(e.$$.fragment,h),a=!1},d(h){Jt(e,h)}}}function uge(o,e){let t,s,a,l=e[8]===e[23].group&&cge(e);return{key:o,first:null,c(){t=Rs(),l&&l.c(),s=Rs(),this.first=t},m(u,d){Te(u,t,d),l&&l.m(u,d),Te(u,s,d),a=!0},p(u,d){e=u,e[8]===e[23].group?l?(l.p(e,d),d&256&&xe(l,1)):(l=cge(e),l.c(),xe(l,1),l.m(s.parentNode,s)):l&&(mo(),Be(l,1,1,()=>{l=null}),go())},i(u){a||(xe(l),a=!0)},o(u){Be(l),a=!1},d(u){u&&ke(t),l&&l.d(u),u&&ke(s)}}}function oIe(o){let e,t,s,a,l,u,d=!["_graph","_info"].includes(o[8])&&o[5],h,b,y,C,E,R,$,Q,F,U,K,L,te;t=new VSe({props:{managerRecords:o[3],graph:o[1]}});function ne(Xe){o[14](Xe)}let oe={schema:o[2],record:o[0],isCreateMode:o[4],graph:o[1]};o[8]!==void 0&&(oe.activeContentTab=o[8]),a=new jSe({props:oe}),Ro.push(()=>er(a,"activeContentTab",ne));let G=d&&lge(o);b=new X6({props:{message:o[9]}});function we(Xe){o[16](Xe)}let ve={schema:o[2],isCreateMode:o[4]};o[8]!==void 0&&(ve.active=o[8]),E=new Wpe({props:ve}),Ro.push(()=>er(E,"active",we));const Re=[nIe,tIe,eIe],Oe=[];function ce(Xe,tt){return tt&256&&(Q=null),Q==null&&(Q=!["_graph","_info"].includes(Xe[8])),Q?0:Xe[8]==="_graph"?1:Xe[8]==="_info"?2:-1}return~(F=ce(o,-1))&&(U=Oe[F]=Re[F](o)),{c(){e=re("div"),en(t.$$.fragment),s=Ze(),en(a.$$.fragment),u=Ze(),G&&G.c(),h=Ze(),en(b.$$.fragment),y=Ze(),C=re("div"),en(E.$$.fragment),$=Ze(),U&&U.c(),Z(C,"class","mt-4"),rs(C,"margin-bottom","150px"),Z(e,"class","wrapper-normal transparent")},m(Xe,tt){Te(Xe,e,tt),Kt(t,e,null),X(e,s),Kt(a,e,null),X(e,u),G&&G.m(e,null),X(e,h),Kt(b,e,null),X(e,y),X(e,C),Kt(E,C,null),X(C,$),~F&&Oe[F].m(C,null),K=!0,L||(te=mn(G6e,"beforeunload",o[12]),L=!0)},p(Xe,[tt]){const ot={};tt&8&&(ot.managerRecords=Xe[3]),tt&2&&(ot.graph=Xe[1]),t.$set(ot);const V={};tt&4&&(V.schema=Xe[2]),tt&1&&(V.record=Xe[0]),tt&16&&(V.isCreateMode=Xe[4]),tt&2&&(V.graph=Xe[1]),!l&&tt&256&&(l=!0,V.activeContentTab=Xe[8],lr(()=>l=!1)),a.$set(V),tt&288&&(d=!["_graph","_info"].includes(Xe[8])&&Xe[5]),d?G?(G.p(Xe,tt),tt&288&&xe(G,1)):(G=lge(Xe),G.c(),xe(G,1),G.m(e,h)):G&&(mo(),Be(G,1,1,()=>{G=null}),go());const ut={};tt&512&&(ut.message=Xe[9]),b.$set(ut);const Qe={};tt&4&&(Qe.schema=Xe[2]),tt&16&&(Qe.isCreateMode=Xe[4]),!R&&tt&256&&(R=!0,Qe.active=Xe[8],lr(()=>R=!1)),E.$set(Qe);let Bt=F;F=ce(Xe,tt),F===Bt?~F&&Oe[F].p(Xe,tt):(U&&(mo(),Be(Oe[Bt],1,1,()=>{Oe[Bt]=null}),go()),~F?(U=Oe[F],U?U.p(Xe,tt):(U=Oe[F]=Re[F](Xe),U.c()),xe(U,1),U.m(C,null)):U=null)},i(Xe){K||(xe(t.$$.fragment,Xe),xe(a.$$.fragment,Xe),xe(G),xe(b.$$.fragment,Xe),xe(E.$$.fragment,Xe),xe(U),K=!0)},o(Xe){Be(t.$$.fragment,Xe),Be(a.$$.fragment,Xe),Be(G),Be(b.$$.fragment,Xe),Be(E.$$.fragment,Xe),Be(U),K=!1},d(Xe){Xe&&ke(e),Jt(t),Jt(a),G&&G.d(),Jt(b),Jt(E),~F&&Oe[F].d(),L=!1,te()}}}function sIe(o,e,t){let s,a,l;const u=Ur("channel");let{schema:d}=e,{record:h}=e,{graph:b={records:[],edges:[]}}=e,{recordHistory:y}=e,{isCreateMode:C}=e,{isWritable:E=!1}=e,{users:R Line truncated
* Bootstrap v5.3.2 (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/const pC=new Map,goe={set(o,e,t){pC.has(o)||pC.set(o,new Map);const s=pC.get(o);if(!s.has(e)&&s.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`);return}s.set(e,t)},get(o,e){return pC.has(o)&&pC.get(o).get(e)||null},remove(o,e){if(!pC.has(o))return;const t=pC.get(o);t.delete(e),t.size===0&&pC.delete(o)}},gBe=1e6,pBe=1e3,Yse="transitionend",fye=o=>(o&&window.CSS&&window.CSS.escape&&(o=o.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),o),bBe=o=>o==null?`${o}`:Object.prototype.toString.call(o).match(/\s([a-z]+)/i)[1].toLowerCase(),vBe=o=>{do o+=Math.floor(Math.random()*gBe);while(document.getElementById(o));return o},OBe=o=>{if(!o)return 0;let{transitionDuration:e,transitionDelay:t}=window.getComputedStyle(o);const s=Number.parseFloat(e),a=Number.parseFloat(t);return!s&&!a?0:(e=e.split(",")[0],t=t.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(t))*pBe)},dye=o=>{o.dispatchEvent(new Event(Yse))},Zw=o=>!o||typeof o!="object"?!1:(typeof o.jquery<"u"&&(o=o[0]),typeof o.nodeType<"u"),IC=o=>Zw(o)?o.jquery?o[0]:o:typeof o=="string"&&o.length>0?document.querySelector(fye(o)):null,oP=o=>{if(!Zw(o)||o.getClientRects().length===0)return!1;const e=getComputedStyle(o).getPropertyValue("visibility")==="visible",t=o.closest("details:not([open])");if(!t)return e;if(t!==o){const s=o.closest("summary");if(s&&s.parentNode!==t||s===null)return!1}return e},BC=o=>!o||o.nodeType!==Node.ELEMENT_NODE||o.classList.contains("disabled")?!0:typeof o.disabled<"u"?o.disabled:o.hasAttribute("disabled")&&o.getAttribute("disabled")!=="false",hye=o=>{if(!document.documentElement.attachShadow)return null;if(typeof o.getRootNode=="function"){const e=o.getRootNode();return e instanceof ShadowRoot?e:null}return o instanceof ShadowRoot?o:o.parentNode?hye(o.parentNode):null},Vz=()=>{},hI=o=>{o.offsetHeight},mye=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,poe=[],yBe=o=>{document.readyState==="loading"?(poe.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of poe)e()}),poe.push(o)):o()},Yb=()=>document.documentElement.dir==="rtl",Gb=o=>{yBe(()=>{const e=mye();if(e){const t=o.NAME,s=e.fn[t];e.fn[t]=o.jQueryInterface,e.fn[t].Constructor=o,e.fn[t].noConflict=()=>(e.fn[t]=s,o.jQueryInterface)}})},Bp=(o,e=[],t=o)=>typeof o=="function"?o(...e):t,gye=(o,e,t=!0)=>{if(!t){Bp(o);return}const s=5,a=OBe(e)+s;let l=!1;const u=({target:d})=>{d===e&&(l=!0,e.removeEventListener(Yse,u),Bp(o))};e.addEventListener(Yse,u),setTimeout(()=>{l||dye(e)},a)},gie=(o,e,t,s)=>{const a=o.length;let l=o.indexOf(e);return l===-1?!t&&s?o[a-1]:o[0]:(l+=t?1:-1,s&&(l=(l+a)%a),o[Math.max(0,Math.min(l,a-1))])},wBe=/[^.]*(?=\..*)\.|.*/,_Be=/\..*/,SBe=/::\d+$/,boe={};let xge=1;const pye={mouseenter:"mouseover",mouseleave:"mouseout"},CBe=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function bye(o,e){return e&&`${e}::${xge++}`||o.uidEvent||xge++}function vye(o){const e=bye(o);return o.uidEvent=e,boe[e]=boe[e]||{},boe[e]}function kBe(o,e){return function t(s){return pie(s,{delegateTarget:o}),t.oneOff&&ao.off(o,s.type,e),e.apply(o,[s])}}function xBe(o,e,t){return function s(a){const l=o.querySelectorAll(e);for(let{target:u}=a;u&&u!==this;u=u.parentNode)for(const d of l)if(d===u)return pie(a,{delegateTarget:u}),s.oneOff&&ao.off(o,a.type,e,t),t.apply(u,[a])}}function Oye(o,e,t=null){return Object.values(o).find(s=>s.callable===e&&s.delegationSelector===t)}function yye(o,e,t){const s=typeof e=="string",a=s?t:e||t;let l=wye(o);return CBe.has(l)||(l=o),[s,a,l]}function Tge(o,e,t,s,a){if(typeof e!="string"||!o)return;let[l,u,d]=yye(e,t,s);e in pye&&(u=($=>function(Q){if(!Q.relatedTarget||Q.relatedTarget!==Q.delegateTarget&&!Q.delegateTarget.contains(Q.relatedTarget))return $.call(this,Q)})(u));const h=vye(o),b=h[d]||(h[d]={}),y=Oye(b,u,l?t:null);if(y){y.oneOff=y.oneOff&&a;return}const C=bye(u,e.replace(wBe,"")),E=l?xBe(o,t,u):kBe(o,u);E.delegationSelector=l?t:null,E.callable=u,E.oneOff=a,E.uidEvent=C,b[C]=E,o.addEventListener(d,E,l)}function Xse(o,e,t,s,a){const l=Oye(e[t],s,a);!l||(o.removeEventListener(t,l,Boolean(a)),delete e[t][l.uidEvent])}function TBe(o,e,t,s){const a=e[t]||{};for(const[l,u]of Object.entries(a))l.includes(s)&&Xse(o,e,t,u.callable,u.delegationSelector)}function wye(o){return o=o.replace(_Be,""),pye[o]||o}const ao={on(o,e,t,s){Tge(o,e,t,s,!1)},one(o,e,t,s){Tge(o,e,t,s,!0)},off(o,e,t,s){if(typeof e!="string"||!o)return;const[a,Line truncated
+3 -6
View File
@@ -1,14 +1,11 @@
{ {
"main.js": { "main.js": {
"file": "assets/main.7c3e8b7b.js", "file": "assets/main-DH0OAeUr.js",
"name": "main",
"src": "main.js", "src": "main.js",
"isEntry": true, "isEntry": true,
"css": [ "css": [
"assets/main.587d6006.css" "assets/main-BVNnoznq.css"
] ]
},
"main.css": {
"file": "assets/main.587d6006.css",
"src": "main.css"
} }
} }
-48
View File
@@ -1,48 +0,0 @@
/**
* We'll load the axios HTTP library which allows us to easily issue requests
* to our Laravel back-end. This library automatically handles sending the
* CSRF token as a header based on the value of the "XSRF" token cookie.
*/
import axios from "axios";
window.axios = axios;
export const axiosInstance = axios;
window.axios.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest";
window.axios.interceptors.request.use(
function (config) {
let list;
list = document.querySelectorAll(".btn-spinner");
for (let i = 0; i < list.length; ++i) {
list[i].classList.add("spinner-on");
list[i].disabled = true;
}
return config;
},
function (error) {
return Promise.reject(error);
}
);
window.axios.interceptors.response.use(
function (response) {
let list;
list = document.querySelectorAll(".btn-spinner");
for (let i = 0; i < list.length; ++i) {
list[i].classList.remove("spinner-on");
list[i].disabled = false;
}
return response;
},
function (error) {
let list;
list = document.querySelectorAll(".btn-spinner");
for (let i = 0; i < list.length; ++i) {
list[i].classList.remove("spinner-on");
list[i].disabled = false;
}
return Promise.reject(error);
}
);
+127 -3
View File
@@ -19,14 +19,138 @@ export function readableDatetime(date) {
return format(parseJSON(date), "dd MMM yyyy HH:mm"); return format(parseJSON(date), "dd MMM yyyy HH:mm");
} }
export function stripHtml(html = "") { export function stripHtml(html = "") {
let tmp = document.createElement("div"); let tmp = document.createElement("div");
tmp.innerHTML = html; tmp.innerHTML = html;
return tmp.textContent || tmp.innerText || ""; return tmp.textContent || tmp.innerText || "";
} }
export function randomId(length = 10) { export function randomId(length = 10) {
return Math.random().toString(36).substring(2, length + 2); return Math.random()
.toString(36)
.substring(2, length + 2);
}
export function clickOutside(node) {
const handleClick = (event) => {
if (node && !node.contains(event.target) && !event.defaultPrevented) {
node.dispatchEvent(new CustomEvent("click_outside", node));
}
};
document.addEventListener("click", handleClick, true);
return {
destroy() {
document.removeEventListener("click", handleClick, true);
},
};
}
export function apiFetch(url, options = {}) {
return fetch(url, {
...options,
headers: {
"Content-Type": "application/json",
"X-CSRF-TOKEN": document.querySelector('meta[name="csrf-token"]').content,
...options.headers,
},
});
}
export function apiPost(url, body, options = {}) {
return fetch(url, {
...options,
method: "POST",
body: JSON.stringify(body),
headers: {
"Content-Type": "application/json",
"X-Requested-With": "XMLHttpRequest",
"X-CSRF-TOKEN": document.querySelector('meta[name="csrf-token"]').content,
...options.headers,
},
}).then((r) => r.json());
}
export function apiGet(url, options = {}) {
return fetch(url, {
...options,
method: "GET",
headers: {
"X-CSRF-TOKEN": document.querySelector('meta[name="csrf-token"]').content,
"X-Requested-With": "XMLHttpRequest",
...options.headers,
},
}).then((r) => r.json());
}
export function isEqual(db, ed) {
let isObject = (x) =>
typeof x === "object" && !Array.isArray(x) && x !== null;
let isArray = (x) => x?.constructor === Array;
let isEmpty = (x) => x === null || x === undefined || x == [];
const db_value = db ?? null;
const ed_value = ed ?? null;
if (isObject(db_value)) {
let keys = Object.keys(db_value);
return keys.reduce((acc, k) => {
if (acc === false) {
return false;
}
return isEqual(db_value?.[k], ed_value?.[k]);
}, true);
}
if (isArray(db_value)) {
return db_value.reduce((c, v, i) => {
if (c === false) {
return false;
}
return isEqual(v, ed_value?.[i]);
}, true);
}
if (isEmpty(db_value) && isEmpty(ed_value)) {
return true;
}
if (db_value == ed_value) {
return true;
}
return false;
// const ok = Object.keys,
// tx = typeof x,
// ty = typeof y;
// return x && y && tx === "object" && tx === ty
// ? ok(x).length === ok(y).length &&
// ok(x).every((key) => isEqual(x[key], y[key]))
// : x === y;
}
export function debounce(fn, delay) {
let timer;
return (...args) => {
clearTimeout(timer);
timer = setTimeout(() => fn(...args), delay);
};
}
export function arrayUnique(array) {
return array.filter((value, index) => array.indexOf(value) === index);
}
export function arrayUniqueBy(items, uniqueBy) {
const ids = new Set(items.map((item) => item[uniqueBy]));
return [...ids].map((id) => items.find((i) => i[uniqueBy] === id));
}
export function arrayUniqueCb(items, aFilter) {
const cache = new Set();
return items.filter((item) => {
const cacheValue = aFilter(item);
if (cache.has(cacheValue)) return false;
cache.add(cacheValue);
return true;
});
} }
+6 -22
View File
@@ -1,23 +1,11 @@
import {axiosInstance} from "./bootstrap";
import "../sass/app.scss"; import "../sass/app.scss";
import Account from "./svelte/Account.svelte"; import Account from "./svelte/Account.svelte";
import Channel from "./svelte/Channel.svelte"; import Channel from "./svelte/Channel.svelte";
import * as bootstrap from "bootstrap"; // import Mustache from "mustache";
import Mustache from "mustache";
Mustache.escape = function (value) { // Mustache.escape = function (value) {
return value; // return value;
}; // };
function enableTooltipsAnywhere() {
// Enable tooltips everywhere
let tooltipTriggerList = [].slice.call(
document.querySelectorAll('[data-bs-toggle="tooltip"]')
);
tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl);
});
}
// Define all components // Define all components
const entryComponents = { const entryComponents = {
@@ -38,17 +26,14 @@ let loadSvelte = function () {
const loadElement = function (element) { const loadElement = function (element) {
const componentId = element.attributes["data-layout"].value; const componentId = element.attributes["data-layout"].value;
const [_, component] = Object.entries(entryComponents).find( const [_, component] = Object.entries(entryComponents).find(
([key, _]) => componentId === key ([key, _]) => componentId === key,
); );
if (!component) { if (!component) {
return []; return [];
} }
const jsonData = document.getElementById( const jsonData = document.getElementById("json-" + componentId).innerHTML;
"json-" + componentId
).innerHTML;
const props = JSON.parse(jsonData); const props = JSON.parse(jsonData);
props.axios = axiosInstance;
const compOptions = { const compOptions = {
target: element, target: element,
props: props, props: props,
@@ -61,4 +46,3 @@ let loadSvelte = function () {
// document.addEventListener("turbo:load", loadSvelte); // document.addEventListener("turbo:load", loadSvelte);
document.addEventListener("DOMContentLoaded", loadSvelte); document.addEventListener("DOMContentLoaded", loadSvelte);
document.addEventListener("DOMContentLoaded", enableTooltipsAnywhere);
+3 -6
View File
@@ -21,10 +21,7 @@
setContext("channel", channel); setContext("channel", channel);
setContext("user", user); setContext("user", user);
</script> </script>
<div class="text-center">
<h1><a class="text-decoration-none" href="{channel.lucentUrl}">{channel.name}</a></h1>
</div>
<div>
<svelte:component this={components[view]} {title} {...data}/>
</div>
<div>
<svelte:component this={components[view]} {channel} {title} {...data} />
</div>
+13 -8
View File
@@ -4,9 +4,10 @@
import RecordEdit from "./records/Edit.svelte"; import RecordEdit from "./records/Edit.svelte";
import ContentIndex from "./content/Index.svelte"; import ContentIndex from "./content/Index.svelte";
import { setContext } from "svelte"; import { setContext } from "svelte";
import Navbar from "./Navbar.svelte"; import Navbar from "./layout/Navbar.svelte";
import HomeIndex from "./home/Index.svelte"; import HomeIndex from "./home/Index.svelte";
import BuildReport from "./build/Report.svelte"; import BuildReport from "./build/Report.svelte";
import Header from "./layout/Header.svelte";
const components = { const components = {
members: Members, members: Members,
@@ -24,18 +25,22 @@
// export let layout; // export let layout;
export let channel; export let channel;
export let axios;
export let readableSchemas; export let readableSchemas;
setContext("axios", axios);
setContext("channel", channel); setContext("channel", channel);
setContext("readableSchemas", channel.schemas.filter((s) => readableSchemas.includes(s.name))); setContext(
"readableSchemas",
channel.schemas.filter((s) => readableSchemas.includes(s.name)),
);
setContext("user", user); setContext("user", user);
</script> </script>
<div class="main-wrapper">
<div class="sidebar-content">
<Navbar schema={data.schema} /> <Navbar schema={data.schema} />
</div>
<div class="main-content">
<Header />
<svelte:component this={components[view]} {title} {...data} /> <svelte:component this={components[view]} {title} {...data} />
</div>
</div>
-126
View File
@@ -1,126 +0,0 @@
<script>
import Avatar from "./account/Avatar.svelte";
import NavbarMenu from "./NavbarMenu.svelte";
import {getContext} from "svelte";
export let schema;
const channel = getContext("channel");
const readableSchemas = getContext("readableSchemas");
const user = getContext("user");
let contentIsOpen = false;
const fileSchemas = readableSchemas.filter((sc) => sc.type === "files");
const otherSchemas = readableSchemas.filter((sc) => !sc.isEntry && sc.type === "collection");
let filesIsActive = false;
let otherIsActive = false;
if(schema){
filesIsActive = fileSchemas.filter(s => s.name === schema.name).length > 0;
otherIsActive = otherSchemas.filter(s => s.name === schema.name).length > 0;
}
</script>
<nav class="lx-nav">
<div>
<button on:click={(e) => contentIsOpen = true} class="btn btn-primary btn-sm d-xxl-none">« Content</button>
</div>
<div class="d-flex align-items-center ">
<a class="nav-item" href="{channel.lucentUrl}">{channel.name}</a>
<a class="nav-item" href="{channel.lucentUrl}/members">Members</a>
{#if channel.generateCommand}
<a href="{channel.lucentUrl}/build-report" class="btn btn-outline-primary btn-sm d-">Build website</a>
{/if}
<!-- <div>-->
<!-- <form method="GET">-->
<!-- <input type="search" name="filter[search_regex]" placeholder="Search"-->
<!-- class="form-control" required/>-->
<!-- </form>-->
<!-- </div>-->
</div>
<div>
<a class="nav-item" href="{channel.lucentUrl}/profile">
<Avatar side="28" name={user.name}/>
</a>
</div>
</nav>
<div class="offcanvas offcanvas-start d-xxl-block show border-0 bg-light-subtle" class:d-none={!contentIsOpen}
style="padding-top:36px " data-bs-scroll="true"
data-bs-backdrop="false"
tabindex="-1" aria-labelledby="offcanvasScrollingLabel">
<!-- <div class="offcanvas-header">-->
<!-- <h5 class="offcanvas-title" id="offcanvasScrollingLabel">Content</h5>-->
<!-- </div>-->
<div class="offcanvas-body">
<button on:click={(e) => contentIsOpen = false} class="btn btn-primary btn-sm d-xxl-none mb-4">« close</button>
<div class="accordion">
<div class="accordion-item">
<h2 class="accordion-header" id="panelsStayOpen-headingMain">
<button class="accordion-button" type="button" data-bs-toggle="collapse"
data-bs-target="#panelsStayOpen-collapseMain" aria-expanded="true"
aria-controls="panelsStayOpen-collapseMain">
Main
</button>
</h2>
<div id="panelsStayOpen-collapseMain" class="accordion-collapse collapse show"
aria-labelledby="panelsStayOpen-headingMain">
<div class="accordion-body">
<NavbarMenu
schemas={ readableSchemas.filter((sc) => sc.isEntry)}
schema={schema}
/>
</div>
</div>
</div>
{#if otherSchemas.length > 0}
<div class="accordion-item">
<h2 class="accordion-header" id="panelsStayOpen-headingOther">
<button class="accordion-button" class:collapsed={!otherIsActive} type="button" data-bs-toggle="collapse"
data-bs-target="#panelsStayOpen-collapseOther" aria-expanded={otherIsActive}
aria-controls="panelsStayOpen-collapseOther">
Other
</button>
</h2>
<div id="panelsStayOpen-collapseOther" class="accordion-collapse collapse"
class:show={otherIsActive}
aria-labelledby="panelsStayOpen-headingOther">
<div class="accordion-body">
<NavbarMenu
schemas={ otherSchemas}
schema={schema}
/>
</div>
</div>
</div>
{/if}
{#if fileSchemas.length > 0}
<div class="accordion-item">
<h2 class="accordion-header" id="panelsStayOpen-headingFS">
<button class="accordion-button " class:collapsed={!filesIsActive} type="button" data-bs-toggle="collapse"
data-bs-target="#panelsStayOpen-collapseFS" aria-expanded={filesIsActive}
aria-controls="panelsStayOpen-collapseFS">
Filesystem
</button>
</h2>
<div id="panelsStayOpen-collapseFS" class="accordion-collapse collapse" class:show={filesIsActive}
aria-labelledby="panelsStayOpen-headingFS">
<div class="accordion-body">
<NavbarMenu
schemas={ fileSchemas}
schema={schema}
/>
</div>
</div>
</div>
{/if}
</div>
</div>
</div>
-16
View File
@@ -1,16 +0,0 @@
<script>
import {getContext} from "svelte";
const channel = getContext("channel");
export let schemas;
export let schema;
</script>
<div class="list-group list-group-flush">
{#each schemas as aschema}
<a class="list-group-item list-group-item-action" class:active={aschema.name === schema?.name}
aria-current="page"
href="{channel.lucentUrl}/content/{aschema.name}">{aschema.label}</a>
{/each}
</div>
+38 -24
View File
@@ -1,39 +1,48 @@
<script> <script>
import { getContext } from "svelte"; import { getContext } from "svelte";
import SpinnerButton from "../common/SpinnerButton.svelte"; import { apiPost } from "../../helpers";
const channel = getContext("channel"); const channel = getContext("channel");
let email = ""; let email = "";
let message = ""; let submitted = false;
function login(e) { function login(e) {
e.preventDefault(); e.preventDefault();
axios apiPost(channel.lucentUrl + "/login", { email: email })
.post(channel.lucentUrl + "/login", { .then(() => {
email: email, submitted = true;
}) })
.then((response) => { .catch(() => {});
console.log(response)
message = "You will receive an email with a login link"
})
.catch((error) => {
});
} }
</script> </script>
<div class="wrapper-tiny"> <div class="scope-login">
{#if message} <div class="bg-image"></div>
<div class="login-form">
{#if submitted}
<div class="alert alert-info" role="alert"> <div class="alert alert-info" role="alert">
{message} <p>
You will receive an email with a login link at <b>{email}</b
>.
</p>
<p>Check your spam folder</p>
</div> </div>
{:else} {:else}
<div class="form">
<h2 class="mb-5">Enter Lucent</h2>
<form on:submit={login}> <form on:submit={login}>
<div class="mb-3"> <p>
<label for="emailaddress" class="form-label">Email address</label> Submit your email address and you will receive a <b
>login link</b
> to your email
</p>
<p>Don't forget to check your spam folder</p>
<div class="mt-5 mb-3">
<label for="emailaddress" class="form-label"
>Email address</label
>
<input <input
type="email" type="email"
bind:value={email} bind:value={email}
@@ -43,12 +52,17 @@
/> />
</div> </div>
<button class="bt bt-primary">
<div class="text-center mt-5 d-block"> Send email
<SpinnerButton label="Login"/> <img
</div> alt="indicator"
id="indicator"
class="htmx-indicator"
src="/img/spinner.svg"
/>
</button>
</form> </form>
</div>
{/if} {/if}
</div> </div>
</div>
+13 -13
View File
@@ -4,6 +4,7 @@
import Avatar from "./Avatar.svelte"; import Avatar from "./Avatar.svelte";
import { getContext } from "svelte"; import { getContext } from "svelte";
import SuccessAlert from "../common/SuccessAlert.svelte"; import SuccessAlert from "../common/SuccessAlert.svelte";
import { apiPost } from "../../helpers";
const user = getContext("user"); const user = getContext("user");
const channel = getContext("channel"); const channel = getContext("channel");
@@ -16,8 +17,7 @@
e.preventDefault(); e.preventDefault();
errorMessage = ""; errorMessage = "";
axios apiPost(channel.lucentUrl + "/account/update-name", {
.post(channel.lucentUrl + "/account/update-name", {
name: name, name: name,
}) })
.then((response) => { .then((response) => {
@@ -33,8 +33,7 @@
e.preventDefault(); e.preventDefault();
errorMessage = ""; errorMessage = "";
axios apiPost(channel.lucentUrl + "/account/update-email", {
.post(channel.lucentUrl + "/account/update-email", {
email: email, email: email,
}) })
.then((response) => { .then((response) => {
@@ -47,7 +46,6 @@
} }
</script> </script>
<div class="wrapper-tiny"> <div class="wrapper-tiny">
<ErrorAlert message={errorMessage} /> <ErrorAlert message={errorMessage} />
<SuccessAlert bind:this={successAlert} /> <SuccessAlert bind:this={successAlert} />
@@ -55,33 +53,35 @@
<Avatar name={user.name} /> <Avatar name={user.name} />
</h3> </h3>
<form on:submit={saveName}> <form on:submit={saveName}>
<div class="input-group mb-3"> <div class="input-group mb-5">
<input <input
type="text" type="text"
bind:value={name} bind:value={name}
class="form-control" class="form-control mb-3"
placeholder="Name" placeholder="Name"
required required
/> />
<SpinnerButton label="Update"/> <SpinnerButton label="Update Name" />
</div> </div>
</form> </form>
<form on:submit={saveEmail}> <form on:submit={saveEmail}>
<div class="input-group mb-3"> <div class="input-group mb-5">
<input <input
type="email" type="email"
bind:value={email} bind:value={email}
class="form-control" class="form-control mb-3"
placeholder="Email" placeholder="Email"
required required
/> />
<SpinnerButton label="Update"/> <SpinnerButton label="Update Email" />
</div> </div>
</form> </form>
<div class="list-group"> <div class="list-group">
<a class="list-group-item list-group-item-action" href="{ channel.lucentUrl }/logout">Logout from this <a
device</a> class="list-group-item list-group-item-action"
href="{channel.lucentUrl}/logout">Logout from this device</a
>
</div> </div>
</div> </div>
+2 -4
View File
@@ -1,4 +1,5 @@
<script> <script>
import { apiPost } from "../../helpers";
import ErrorAlert from "../common/ErrorAlert.svelte"; import ErrorAlert from "../common/ErrorAlert.svelte";
import SpinnerButton from "../common/SpinnerButton.svelte"; import SpinnerButton from "../common/SpinnerButton.svelte";
import { getContext } from "svelte"; import { getContext } from "svelte";
@@ -12,8 +13,7 @@
e.preventDefault(); e.preventDefault();
errorMessage = ""; errorMessage = "";
axios apiPost(channel.lucentUrl + "/register", {
.post(channel.lucentUrl + "/register", {
name: name, name: name,
email: email, email: email,
}) })
@@ -50,10 +50,8 @@
/> />
</div> </div>
<div class="text-center mt-5 d-block"> <div class="text-center mt-5 d-block">
<SpinnerButton label="Register" /> <SpinnerButton label="Register" />
</div> </div>
</form> </form>
</div> </div>
+20 -21
View File
@@ -1,43 +1,42 @@
<script> <script>
import { getContext } from "svelte"; import { getContext } from "svelte";
import SpinnerButton from "../common/SpinnerButton.svelte"; import { apiPost } from "../../helpers";
import SuccessAlert from "../common/SuccessAlert.svelte";
const channel = getContext("channel"); const channel = getContext("channel");
export let email; export let email;
export let token; export let token;
let successAlert;
function login(e) { function login(e) {
e.preventDefault(); e.preventDefault();
axios apiPost(channel.lucentUrl + "/verify", {
.post(channel.lucentUrl + "/verify", {
email: email, email: email,
token: token, token: token,
}) })
.then((response) => { .then((response) => {
window.location = channel.lucentUrl; window.location = channel.lucentUrl;
}) })
.catch((error) => { .catch((error) => {});
});
} }
</script> </script>
<SuccessAlert bind:this={successAlert}/> <div class="scope-login">
<div class="wrapper-tiny"> <div class="bg-image"></div>
<div class="login-form">
<div class="form">
<h2 class="mb-5">Welcome to Lucent</h2>
<form on:submit={login}> <form on:submit={login}>
<div class="mb-3 text-center"> <button class="bt bt-primary">
<h3>Login as {email}</h3> Enter as {email}
<img
</div> alt="indicator"
id="indicator"
class="htmx-indicator"
<div class="text-center mt-5 d-block"> src="/img/spinner.svg"
<SpinnerButton label="Enter"/> />
</div> </button>
</form> </form>
<div class="form-errors"></div>
</div>
</div>
</div> </div>
+139
View File
@@ -0,0 +1,139 @@
/* eslint-disable no-undefined,no-param-reassign,no-shadow */
/**
* Throttle execution of a function. Especially useful for rate limiting
* execution of handlers on events like resize and scroll.
*
* @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher)
* are most useful.
* @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through,
* as-is, to `callback` when the throttled-function is executed.
* @param {object} [options] - An object to configure options.
* @param {boolean} [options.noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds
* while the throttled-function is being called. If noTrailing is false or unspecified, callback will be executed
* one final time after the last throttled-function call. (After the throttled-function has not been called for
* `delay` milliseconds, the internal counter is reset).
* @param {boolean} [options.noLeading] - Optional, defaults to false. If noLeading is false, the first throttled-function call will execute callback
* immediately. If noLeading is true, the first the callback execution will be skipped. It should be noted that
* callback will never executed if both noLeading = true and noTrailing = true.
* @param {boolean} [options.debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is
* false (at end), schedule `callback` to execute after `delay` ms.
*
* @returns {Function} A new, throttled, function.
*/
export function throttle(delay, callback, options) {
const {
noTrailing = false,
noLeading = false,
debounceMode = undefined,
} = options || {};
/*
* After wrapper has stopped being called, this timeout ensures that
* `callback` is executed at the proper times in `throttle` and `end`
* debounce modes.
*/
let timeoutID;
let cancelled = false;
// Keep track of the last time `callback` was executed.
let lastExec = 0;
// Function to clear existing timeout
function clearExistingTimeout() {
if (timeoutID) {
clearTimeout(timeoutID);
}
}
// Function to cancel next exec
function cancel(options) {
const { upcomingOnly = false } = options || {};
clearExistingTimeout();
cancelled = !upcomingOnly;
}
/*
* The `wrapper` function encapsulates all of the throttling / debouncing
* functionality and when executed will limit the rate at which `callback`
* is executed.
*/
function wrapper(...arguments_) {
let self = this;
let elapsed = Date.now() - lastExec;
if (cancelled) {
return;
}
// Execute `callback` and update the `lastExec` timestamp.
function exec() {
lastExec = Date.now();
callback.apply(self, arguments_);
}
/*
* If `debounceMode` is true (at begin) this is used to clear the flag
* to allow future `callback` executions.
*/
function clear() {
timeoutID = undefined;
}
if (!noLeading && debounceMode && !timeoutID) {
/*
* Since `wrapper` is being called for the first time and
* `debounceMode` is true (at begin), execute `callback`
* and noLeading != true.
*/
exec();
}
clearExistingTimeout();
if (debounceMode === undefined && elapsed > delay) {
if (noLeading) {
/*
* In throttle mode with noLeading, if `delay` time has
* been exceeded, update `lastExec` and schedule `callback`
* to execute after `delay` ms.
*/
lastExec = Date.now();
if (!noTrailing) {
timeoutID = setTimeout(debounceMode ? clear : exec, delay);
}
} else {
/*
* In throttle mode without noLeading, if `delay` time has been exceeded, execute
* `callback`.
*/
exec();
}
} else if (noTrailing !== true) {
/*
* In trailing throttle mode, since `delay` time has not been
* exceeded, schedule `callback` to execute `delay` ms after most
* recent execution.
*
* If `debounceMode` is true (at begin), schedule `clear` to execute
* after `delay` ms.
*
* If `debounceMode` is false (at end), schedule `callback` to
* execute after `delay` ms.
*/
timeoutID = setTimeout(
debounceMode ? clear : exec,
debounceMode === undefined ? delay - elapsed : delay,
);
}
}
wrapper.cancel = cancel;
// Return the wrapper function.
return wrapper;
}
export function debounce(delay, callback, options) {
const { atBegin = false } = options || {};
return throttle(delay, callback, { debounceMode: atBegin !== false });
}
@@ -0,0 +1,52 @@
<script>
import Selectlist from "./Selectlist.svelte";
import Icon from "../common/Icon.svelte";
let searchEl;
let search;
export let value;
export let field;
function handleSelect(){
searchEl.focus();
searchEl.blur()
}
</script>
<div class="autocomplete">
<input
type="search"
bind:value={search}
bind:this={searchEl}
placeholder="Search for options"
autocomplete="off"
/>
<div class="autocomplete-results">
<Selectlist
{field}
bind:value
bind:search
on:selected={handleSelect}
/>
</div>
</div>
{#if value}
<div class="autocomplete-selected-value">
{#if Array.isArray(field.selectOptions)}
{value}
{:else}
{field.selectOptions[value]}
{/if}
<button
on:click|preventDefault={(e) => (value = "")}
type="button"
class="button-text"
aria-label="Close"
>
<Icon width={12} height={12} icon="close"></Icon>
</button>
</div>
{/if}
@@ -0,0 +1,58 @@
<script>
import Fuse from "fuse.js";
import {createEventDispatcher} from "svelte";
export let field;
export let value;
export let search = "";
const dispatch = createEventDispatcher();
function select(e, option) {
e.preventDefault();
value = option.value;
search = "";
dispatch("selected", {option: option})
}
function formatOptionsForSearch(listOptions) {
if (Array.isArray(listOptions)) {
return listOptions.map(value => {
return {
value: value,
label: value,
}
})
}
return Object.entries(listOptions).map(([k, v]) => {
return {
value: k,
label: v,
}
})
}
let formattedOptions = formatOptionsForSearch(field.selectOptions);
const fuse = new Fuse(formattedOptions, {
includeScore: false,
keys: ['value', 'label']
})
$: result = search === "" ? formattedOptions : fuse.search(search).map(resItem => resItem.item)
</script>
{#if result}
{#each result as suggestion (suggestion.value)}
<div
class="autocomplete-option"
role="button"
tabindex="0"
on:click={(e) => select(e, suggestion)}
on:keypress={(e) => select(e, suggestion)}
>
{suggestion.label}
</div>
{/each}
{/if}
+39 -29
View File
@@ -1,71 +1,81 @@
<script> <script>
import { getContext, onMount } from "svelte"; import { getContext, onMount } from "svelte";
import { apiPost } from "../../helpers";
const channel = getContext("channel"); const channel = getContext("channel");
export let title; export let title;
export let command;
$: date = ""; $: date = "";
$: logs = ""; $: logs = "";
let anchorEl;
let inProgress = false; let inProgress = false;
function connect() { function connect() {
const eventSource = new EventSource(channel.lucentUrl + "/build-report-source"); const eventSource = new EventSource(
channel.lucentUrl + "/command-report-source/" + command.signature,
);
eventSource.onmessage = function (event) { eventSource.onmessage = function (event) {
inProgress = true; inProgress = true;
const data = JSON.parse(event.data); const data = JSON.parse(event.data);
date = data.date; date = data.date;
logs = data.logs; logs = data.logs;
anchorEl.scrollIntoView();
} };
eventSource.onerror = (e) => { eventSource.onerror = (e) => {
console.log(e) console.log(e);
eventSource.close(); eventSource.close();
inProgress = false; inProgress = false;
} };
} }
function buildWebsite(e) { function buildWebsite(e) {
e.preventDefault(); e.preventDefault();
inProgress = true; inProgress = true;
apiPost(channel.lucentUrl + "/command/" + command.signature).then(
axios.post(channel.lucentUrl + "/build").then(response => { (response) => {
connect() connect();
}) },
);
} }
onMount(() => { onMount(() => {
connect() connect();
}) });
</script> </script>
<div class="wrapper-tiny transparent mb-5"> <div class="common-wrapper">
<div class="lx-card mt-5"> <div class="lx-card mt-5">
<h3 class="header-small mb-5">{title}</h3> <h3 class="header-small mb-5">{title}</h3>
<button on:click={buildWebsite} class="btn btn-outline-primary btn-sm mb-3" disabled={inProgress}>Start Build <button
on:click={buildWebsite}
class="button primary mb-3"
disabled={inProgress}
>Start
</button> </button>
<div class="mb-3"> <div class="mb-3">
{#if inProgress} {#if inProgress}
<span class="badge text-bg-warning"> <span class="badge text-bg-warning"> Action in progress </span>
Build in progress
</span>
{/if} {/if}
{#if !inProgress && logs} {#if !inProgress && logs}
<span class="badge text-bg-info"> <span class="badge text-bg-info"> Action completed </span>
Build completed
</span>
{/if} {/if}
</div> </div>
<pre>{logs}</pre> <pre class="logs">{logs}
<div bind:this={anchorEl}>&nbsp;</div>
</pre>
</div> </div>
</div> </div>
<style>
.logs {
max-height: 70vh;
overflow: scroll;
background: var(--p90);
color: var(--p10);
padding: 10px;
}
</style>
+14
View File
@@ -0,0 +1,14 @@
<script>
let checkboxEl = null;
export let indeterminate = false;
export let value;
export let checked = false;
</script>
<div class="checkbox-wrapper">
<input bind:this={checkboxEl} on:change id="c1-13" type="checkbox" {value} {indeterminate} checked={checked}/>
</div>
+19 -9
View File
@@ -1,23 +1,33 @@
<script> <script>
import {clickOutside} from "../../helpers.js";
export let width = "300";
let dropdownMenu; let dropdownMenu;
export function hide(){ export let orientation = "left";
dropdownMenu.classList.remove("show")
export function open() {
dropdownMenu.classList.remove("hide")
} }
export function close() {
dropdownMenu.classList.add("hide")
}
function handleClickOutside() {
dropdownMenu.classList.add("hide")
}
</script> </script>
<div class="dropdown">
<button <button
class="button dropdown-button"
class="btn btn-sm btn-outline-primary dropdown-toggle d-flex align-items-center"
type="button" type="button"
data-bs-toggle="dropdown" on:click={open}
data-bs-auto-close="outside"
aria-expanded="false" aria-expanded="false"
> >
<slot name="button">Dropdown</slot> <slot name="button">Dropdown</slot>
</button> </button>
<div bind:this={dropdownMenu} class="dropdown-menu" style="width:{width}px;"> <div bind:this={dropdownMenu} class="dropdown-menu hide orientation-{orientation}" use:clickOutside on:click_outside={handleClickOutside}>
<slot/> <slot/>
</div> </div>
</div>
+3 -2
View File
@@ -3,7 +3,8 @@
</script> </script>
{#if message} {#if message}
<div class="alert alert-danger" role="alert"> <div class="notice notice-error" role="alert">
{message} <div class="title">Submission Errors</div>
<div class="content"> {message}</div>
</div> </div>
{/if} {/if}
+24
View File
@@ -105,7 +105,29 @@
path: '<path d="M438.6 105.4C451.1 117.9 451.1 138.1 438.6 150.6L182.6 406.6C170.1 419.1 149.9 419.1 137.4 406.6L9.372 278.6C-3.124 266.1-3.124 245.9 9.372 233.4C21.87 220.9 42.13 220.9 54.63 233.4L159.1 338.7L393.4 105.4C405.9 92.88 426.1 92.88 438.6 105.4H438.6z"/>', path: '<path d="M438.6 105.4C451.1 117.9 451.1 138.1 438.6 150.6L182.6 406.6C170.1 419.1 149.9 419.1 137.4 406.6L9.372 278.6C-3.124 266.1-3.124 245.9 9.372 233.4C21.87 220.9 42.13 220.9 54.63 233.4L159.1 338.7L393.4 105.4C405.9 92.88 426.1 92.88 438.6 105.4H438.6z"/>',
viewBox: "0 0 448 512", viewBox: "0 0 448 512",
}, },
"close": {
path: '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18 17.94 6M18 18 6.06 6"/>',
viewBox: "0 0 24 24",
},
"arrow-left": {
path: '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14M5 12l4-4m-4 4 4 4"/>',
viewBox: "0 0 24 24",
},
"list": {
path: '<path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M9 8h10M9 12h10M9 16h10M4.99 8H5m-.02 4h.01m0 4H5"/>',
viewBox: "0 0 24 24",
},
"ordered-list": {
path: '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6h8m-8 6h8m-8 6h8M4 16a2 2 0 1 1 3.321 1.5L4 20h5M4 5l2-1v6m-2 0h4"/>',
viewBox: "0 0 24 24",
},
"italic": {
path: '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m8.874 19 6.143-14M6 19h6.33m-.66-14H18"/>',
viewBox: "0 0 24 24",
}
}; };
export let width = 16; export let width = 16;
export let height = 16; export let height = 16;
export let icon = ""; export let icon = "";
@@ -125,6 +147,7 @@
role="presentation" role="presentation"
{stroke} {stroke}
{fill} {fill}
> >
{@html selectedIcon.path} {@html selectedIcon.path}
</svg> </svg>
@@ -132,5 +155,6 @@
<style> <style>
svg { svg {
vertical-align: text-top; vertical-align: text-top;
} }
</style> </style>
+1 -1
View File
@@ -3,7 +3,7 @@
export let disabled = false; export let disabled = false;
</script> </script>
<button type="submit" class="btn btn-primary btn-spinner" {disabled}> <button type="submit" class="button secondary btn-spinner" {disabled}>
<span <span
class="spinner-border spinner-border-sm" class="spinner-border spinner-border-sm"
role="status" role="status"
+4 -15
View File
@@ -12,21 +12,10 @@
</script> </script>
{#if isVisible} {#if isVisible}
<div <div class="notice notice-success" transition:fly={{ duration: 500 }} role="alert">
transition:fly={{ duration: 500 }} <div class="title">Success</div>
class="lx-alert text-white bg-success border-1 border rounded px-3 py-0 text-center" <div class="content"> {message}</div>
role="alert"
>
{message}
</div> </div>
{/if} {/if}
<style>
.lx-alert {
position: fixed;
left: 50%;
transform: translateX(-50%);
top: 45px;
margin: 0 auto;
}
</style>
+9
View File
@@ -0,0 +1,9 @@
<script>
export let value;
export let checked = false;
</script>
<input type="checkbox" {value} on:change
class="switch" {checked}/>
@@ -1,5 +1,6 @@
<script> <script>
import { getContext } from "svelte"; import { getContext } from "svelte";
import { apiPost } from "../../helpers";
const channel = getContext("channel"); const channel = getContext("channel");
export let selected; export let selected;
@@ -8,8 +9,7 @@
function deleteRecords(e) { function deleteRecords(e) {
e.preventDefault(); e.preventDefault();
axios apiPost(channel.lucentUrl + "/records/delete", {
.post(channel.lucentUrl + "/records/delete", {
ids: selected.map((s) => s.id), ids: selected.map((s) => s.id),
}) })
.then((response) => { .then((response) => {
@@ -21,10 +21,9 @@
} }
function changeStatus(e, status) { function changeStatus(e, status) {
axios apiPost(channel.lucentUrl + "/records/status/" + status, {
.post(channel.lucentUrl + "/records/status/" + status, {
schemaName: schema.name, schemaName: schema.name,
records: selected records: selected,
}) })
.then((response) => { .then((response) => {
window.location.reload(); window.location.reload();
@@ -35,49 +34,47 @@
} }
</script> </script>
<div class="d-flex align-items-center mb-3"> <div style="display: flex;align-items: center; gap: 8px">
<span class="me-2">{selected.length} records selected</span> <span class="me-2">{selected.length} records selected</span>
<div class="btn-group " role="group" aria-label="Basic example">
<button <button
on:click|preventDefault={(e) => changeStatus(e, "published")} on:click|preventDefault={(e) => changeStatus(e, "published")}
type="button" type="button"
class="btn btn-sm btn-outline-primary">Publish class="button"
</button >Publish
> </button>
<button <button
on:click|preventDefault={(e) => changeStatus(e, "draft")} on:click|preventDefault={(e) => changeStatus(e, "draft")}
type="button" type="button"
class="btn btn-sm btn-outline-primary">Make Draft class="button"
</button >Make Draft
> </button>
{#if filter["status_in"] === "trashed"} {#if filter["status_in"] === "trashed"}
<button <button
on:click|preventDefault={(e) => changeStatus(e, "published")} on:click|preventDefault={(e) => changeStatus(e, "published")}
type="button" type="button"
class="btn btn-sm btn-outline-primary">Publish class="button"
</button >Publish
> </button>
{#if schema.hasDrafts} {#if schema.hasDrafts}
<button <button
on:click|preventDefault={(e) => changeStatus(e, "draft")} on:click|preventDefault={(e) => changeStatus(e, "draft")}
type="button" type="button"
class="btn btn-sm btn-outline-primary">Make Draft class="button"
</button >Make Draft
> </button>
{/if} {/if}
<button <button
on:click|preventDefault={deleteRecords} on:click|preventDefault={deleteRecords}
type="button" type="button"
class="btn btn-sm btn-outline-primary">Delete forever class="button"
</button >Delete forever
> </button>
{:else} {:else}
<button <button
type="button" type="button"
on:click|preventDefault={(e) => changeStatus(e, "trashed")} on:click|preventDefault={(e) => changeStatus(e, "trashed")}
class="btn btn-sm btn-outline-primary">Move to trash class="button"
</button >Move to trash
> </button>
{/if} {/if}
</div> </div>
</div>
-68
View File
@@ -1,68 +0,0 @@
<script>
import {getContext} from "svelte";
import Preview from "../files/Preview.svelte";
import {selectRecord} from "./functions/recordSelect.js";
const channel = getContext("channel");
export let schema;
export let records;
export let isWritable;
export let selected = [];
function select(record) {
selected = selectRecord(record, selected)
}
</script>
<div class="row" style="max-width:1000px">
{#each records as record (record.id)}
<div class="col-6 col-md-4">
<div
class="file-wrapper rounded p-2 mb-4 bg-light"
class:selected={selected.includes(record)}
>
{#if isWritable}
<div class="form-check">
<input
on:change={() => select(record)}
class="form-check-input "
type="checkbox"
checked={selected.find(
(r) => r.id === record.id
)}
value={record}
/>
</div>
{/if}
<div class="d-flex justify-content-center">
<Preview {record} size="medium"/>
</div>
<a
href="{channel.lucentUrl}/records/{record.id}"
title={record._file.path}
class="d-block text-center overflow-hidden text-nowrap my-2 "
style="
text-overflow: ellipsis;
font-size: 13px;
color: #333;
">{record._file.path}</a
>
<span
class="lx-small-text text-muted d-block text-center"
>{record._file.mime}</span
>
</div>
</div>
{/each}
</div>
<style>
.form-check {
display: inline-block;
margin-bottom: 0;
}
</style>
+14 -26
View File
@@ -4,9 +4,8 @@
import ActionsOnSelected from "./ActionsOnSelected.svelte"; import ActionsOnSelected from "./ActionsOnSelected.svelte";
import Table from "./Table.svelte"; import Table from "./Table.svelte";
import { getContext } from "svelte"; import { getContext } from "svelte";
import Grid from "./Grid.svelte"; import { apiGet } from "../../helpers";
const axios = getContext("axios");
export let schema; export let schema;
export let users; export let users;
export let records; export let records;
@@ -27,18 +26,18 @@
function refresh(e) { function refresh(e) {
const newUrl = e.detail; const newUrl = e.detail;
axios apiGet(newUrl)
.get(newUrl)
.then((response) => { .then((response) => {
records = response.data.records; records = response.records;
sortParam = response.data.sortParam; sortParam = response.sortParam;
sortField = response.data.sortField; sortField = response.sortField;
operators = response.data.operators; operators = response.operators;
filter = response.data.filter; filter = response.filter;
skip = response.data.skip; skip = response.skip;
limit = response.data.limit; limit = response.limit;
total = response.data.total; total = response.total;
modalUrl = response.data.modalUrl; modalUrl = response.modalUrl;
document.querySelector("dialog h3").scrollIntoView();
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
@@ -46,8 +45,8 @@
} }
</script> </script>
<div class="wrapper-large transparent "> <div class="">
<div class="lx-card mb-4 {inModal ? 'mt-0' : 'mt-5'}"> <div class={inModal ? "mt-0" : "mt-5"}>
<h3 class="header-normal mb-5"> <h3 class="header-normal mb-5">
{schema.label} {schema.label}
</h3> </h3>
@@ -70,7 +69,6 @@
/> />
{/if} {/if}
{#if schema.type === "collection"}
<Table <Table
{records} {records}
{graph} {graph}
@@ -83,15 +81,6 @@
{isWritable} {isWritable}
bind:selected bind:selected
/> />
{:else}
<Grid
{records}
{schema}
{isWritable}
bind:selected
/>
{/if}
</div> </div>
<Pagination <Pagination
@@ -103,4 +92,3 @@
{modalUrl} {modalUrl}
/> />
</div> </div>
+21 -14
View File
@@ -12,7 +12,6 @@
export let sortParam; export let sortParam;
export let sortField; export let sortField;
export let visibleColumns; export let visibleColumns;
</script> </script>
{#each visibleColumns as field, index} {#each visibleColumns as field, index}
@@ -23,7 +22,7 @@
<RenderField {record} {schema} {graph} {field} /> <RenderField {record} {schema} {graph} {field} />
</td> </td>
{/each} {/each}
{#if schema.visible.includes("status")} {#if schema.visible?.includes("_sys.status")}
<td <td
class="text-center" class="text-center"
class:is-sort={"-status" == sortParam || "status" == sortParam} class:is-sort={"-status" == sortParam || "status" == sortParam}
@@ -31,29 +30,37 @@
<Status status={record.status} /> <Status status={record.status} />
</td> </td>
{/if} {/if}
{#if schema.visible.includes("_sys.createdBy")} {#if schema.visible?.includes("_sys.createdBy")}
<td <td
class="text-center" class="text-center"
class:is-sort={"-_sys.createdBy" == sortParam || "_sys.createdBy" == sortParam} class:is-sort={"-_sys.createdBy" == sortParam ||
"_sys.createdBy" == sortParam}
> >
<Avatar name={usernameById(users, record._sys.createdBy)} side={24}/> <Avatar name={usernameById(users, record.createdBy)} side={24} />
</td> </td>
{/if} {/if}
{#if schema.visible.includes("_sys.updatedBy")} {#if schema.visible?.includes("_sys.updatedBy")}
<td <td
class="text-center" class="text-center"
class:is-sort={"-_sys.updatedBy" == sortParam || "_sys.updatedBy" == sortParam} class:is-sort={"-_sys.updatedBy" == sortParam ||
"_sys.updatedBy" == sortParam}
> >
<Avatar name={usernameById(users, record._sys.updatedBy)} side={24}/> <Avatar name={usernameById(users, record.updatedBy)} side={24} />
</td> </td>
{/if} {/if}
{#if schema.visible.includes("_sys.createdAt")} {#if schema.visible?.includes("_sys.createdAt")}
<td class:is-sort={"-_sys.createdAt" == sortParam || "_sys.createdAt" == sortParam}> <td
{friendlyDate(record._sys.createdAt)} class:is-sort={"-_sys.createdAt" == sortParam ||
"_sys.createdAt" == sortParam}
>
{friendlyDate(record.createdAt)}
</td> </td>
{/if} {/if}
{#if schema.visible.includes("_sys.updatedAt")} {#if schema.visible?.includes("_sys.updatedAt")}
<td class:is-sort={"-_sys.updatedAt" == sortParam || "_sys.updatedAt" == sortParam}> <td
{friendlyDate(record._sys.updatedAt)} class:is-sort={"-_sys.updatedAt" == sortParam ||
"_sys.updatedAt" == sortParam}
>
{friendlyDate(record.updatedAt)}
</td> </td>
{/if} {/if}
+38 -48
View File
@@ -1,10 +1,10 @@
<script> <script>
import RecordRow from "./RecordRow.svelte"; import RecordRow from "./RecordRow.svelte";
import {previewTitle} from "../records/Preview";
import { usernameById } from "../account/users"; import { usernameById } from "../account/users";
import { getContext } from "svelte"; import { getContext } from "svelte";
import Avatar from "../account/Avatar.svelte"; import Avatar from "../account/Avatar.svelte";
import { selectRecord, toggleAll } from "./functions/recordSelect.js"; import { selectRecord, toggleAll } from "./functions/recordSelect.js";
import Checkbox from "../common/Checkbox.svelte";
const channel = getContext("channel"); const channel = getContext("channel");
@@ -20,31 +20,31 @@
export let selected = []; export let selected = [];
function eventToggleAll(e) { function eventToggleAll(e) {
selected = toggleAll(e,records,selected) selected = toggleAll(e, records, selected);
} }
function select(record) { function select(record) {
selected = selectRecord(record, selected) selected = selectRecord(record, selected);
} }
console.log(schema);
$: visibleColumns = schema.fields.filter(c => schema.visible.includes(c.name)) $: visibleColumns = schema.fields.filter(
(c) => schema.visible?.includes(c.name) ?? [],
);
</script> </script>
<div class="lx-table rounded"> <div class="table mt-5">
<table class=""> <table>
<thead class="table-light"> <thead>
<tr> <tr>
{#if isWritable} {#if isWritable}
<th> <th>
<input <Checkbox
on:change|preventDefault={eventToggleAll} value=""
on:change={eventToggleAll}
indeterminate={selected.length > 0 && indeterminate={selected.length > 0 &&
selected.length < records.length} selected.length < records.length}
checked={selected.length == records.length} checked={selected.length === records.length}
class="form-check-input" ></Checkbox>
type="checkbox"
/>
</th> </th>
{/if} {/if}
@@ -53,60 +53,45 @@
class="field-ui-{field.info.name ?? field.ui}" class="field-ui-{field.info.name ?? field.ui}"
class:is-sort={field.name === sortField.name} class:is-sort={field.name === sortField.name}
scope="col" scope="col"
title={field.help} title={field.help}>{field.label}</th
data-bs-toggle="tooltip"
data-bs-placement="top">{field.label}</th
> >
{/each} {/each}
{#each systemFields.filter(c => schema.visible.includes(c.name)) as sysField} {#each systemFields.filter( (c) => schema.visible?.includes(c.name), ) as sysField}
<th>{sysField.label}</th> <th class:is-sort={sysField.name === sortField.name}
>{sysField.label}</th
>
{/each} {/each}
<th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{#each records as record (record.id)} {#each records as record (record.id)}
<tr> <tr>
<td class="title-td"> <td class="title-td">
<div <div class="title-td-contents">
class="title-td-contents d-inline-flex justify-content-between w-100 align-items-center"
>
<div class="d-flex align-items-center ">
{#if isWritable} {#if isWritable}
<div class="form-check"> <Checkbox
<input
on:change={() => select(record)} on:change={() => select(record)}
class="form-check-input "
type="checkbox"
checked={selected.find( checked={selected.find(
(r) => r.id === record.id (r) => r.id === record.id,
)} )}
value={record} value={record}
/> ></Checkbox>
</div>
{/if} {/if}
<a <a
class="me-2 text-decoration-none text-dark fs-6"
href="{channel.lucentUrl}/records/{record.id}" href="{channel.lucentUrl}/records/{record.id}"
target={inModal ? "_blank" : "_self"} target={inModal ? "_blank" : "_self"}
title={previewTitle(channel.schemas, record, graph)}
data-bs-toggle="tooltip" data-bs-placement="left"
> >
{previewTitle(channel.schemas, record, graph)} {#if record.status === "draft"}
<span
style="text-transform: uppercase;font-size:10px"
>{record.status}</span
>
{/if}
{record.data.name}
</a> </a>
</div> </div>
<div>
<Avatar
name={usernameById(
users,
record._sys.updatedBy
)}
side={24}
/>
</div>
</div>
</td> </td>
<RecordRow <RecordRow
{record} {record}
@@ -117,9 +102,14 @@
{sortField} {sortField}
{users} {users}
/> />
<td>
<Avatar
name={usernameById(users, record.updatedBy)}
side={24}
/>
</td>
</tr> </tr>
{/each} {/each}
</tbody> </tbody>
</table> </table>
</div> </div>
@@ -11,13 +11,8 @@
// if (edges[0]) { // if (edges[0]) {
// firstRecord = record._children.find((r) => r.data.id === edges[0].to); // firstRecord = record._children.find((r) => r.data.id === edges[0].to);
// } // }
console.log(filePreviews)
</script> </script>
<!-- {#if firstRecord}
<Preview record={firstRecord} size="tiny" />
{/if} -->
<div class="d-flex me-1"> <div class="d-flex me-1">
{#each filePreviews as file} {#each filePreviews as file}
<div class="me-1"> <div class="me-1">
@@ -18,7 +18,7 @@
<div class="references"> <div class="references">
{#each recordEdges as recordEdge} {#each recordEdges as recordEdge}
<span class="mr-3"> <span class="reference">
<PreviewCardSmall {schemas} {graph} record={recordEdge}/> <PreviewCardSmall {schemas} {graph} record={recordEdge}/>
</span> </span>
{/each} {/each}
@@ -28,8 +28,8 @@
</script> </script>
{#each pages as i} {#each pages as i}
<li class="page-item"> <li class="page-item" class:active={currentPage === i}>
{#if currentPage == i} {#if currentPage === i}
<span class="page-link active">{i}</span> <span class="page-link active">{i}</span>
{:else} {:else}
<a class="page-link" on:click={(e) => goto(e, i)} href={url(i)} <a class="page-link" on:click={(e) => goto(e, i)} href={url(i)}
@@ -1,7 +1,7 @@
<script> <script>
import { createEventDispatcher } from "svelte"; import { createEventDispatcher } from "svelte";
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
import { range } from "lodash";
import NavItem from "./NavItem.svelte"; import NavItem from "./NavItem.svelte";
export let inModal; export let inModal;
export let modalUrl; export let modalUrl;
@@ -11,7 +11,11 @@
$: totalPages = Math.ceil(total / limit); $: totalPages = Math.ceil(total / limit);
$: currentPage = Math.ceil((skip - 1) / limit) + 1; $: currentPage = Math.ceil((skip - 1) / limit) + 1;
const range = (start, end, step = 1) =>
Array.from(
{ length: Math.ceil((end - start) / step) },
(_, i) => start + i * step,
);
$: pageRange = range(currentPage - 3, currentPage + 4).filter((i) => { $: pageRange = range(currentPage - 3, currentPage + 4).filter((i) => {
return i > 0 && i <= totalPages; return i > 0 && i <= totalPages;
}); });
@@ -43,7 +47,7 @@
</script> </script>
<nav> <nav>
<ul class="pagination justify-content-center"> <ul class="pagination">
{#if totalPages > 1} {#if totalPages > 1}
<li class="page-item disabled" class:disabled={currentPage === 1}> <li class="page-item disabled" class:disabled={currentPage === 1}>
<a on:click={first} href="/" class="page-link"> First </a> <a on:click={first} href="/" class="page-link"> First </a>
@@ -69,7 +73,7 @@
{/if} {/if}
</ul> </ul>
</nav> </nav>
<p class="text-muted text-center"> <p style="display: flex;justify-content: center; gap: 4px">
Showing Showing
<span class="font-medium">{+skip + 1}</span> <span class="font-medium">{+skip + 1}</span>
to to
@@ -1,8 +1,7 @@
<script> <script>
import { createEventDispatcher, getContext } from "svelte"; import { createEventDispatcher, getContext } from "svelte";
import {previewTitle} from "../../records/Preview"; import Icon from "../../common/Icon.svelte";
const channel = getContext("channel");
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
export let schema; export let schema;
export let operators; export let operators;
@@ -11,7 +10,6 @@
export let inModal; export let inModal;
export let modalUrl; export let modalUrl;
export let graph; export let graph;
let filter = { let filter = {
label: "", label: "",
operator: "", operator: "",
@@ -19,10 +17,10 @@
isReference: key.startsWith("children"), isReference: key.startsWith("children"),
}; };
filter = [ filter = [extractOperator(key), extractLabel(schema, key)].reduce(
extractOperator(key), (mem, fn) => fn(mem),
extractLabel(schema, key), filter,
].reduce((mem, fn) => fn(mem), filter); );
function extractOperator(key) { function extractOperator(key) {
return (filter) => { return (filter) => {
@@ -47,8 +45,7 @@
const filterField = schema.fields.find((f) => f.name === fieldName); const filterField = schema.fields.find((f) => f.name === fieldName);
filter.label = filterField?.label ?? fieldName; filter.label = filterField?.label ?? fieldName;
return filter; return filter;
} };
} }
const filterRecord = extractFilterRecord(graph, value); const filterRecord = extractFilterRecord(graph, value);
@@ -57,7 +54,7 @@
if (!filter.isReference) { if (!filter.isReference) {
return null; return null;
} }
return graph.records.find(r => r.id === value); return graph.records.find((r) => r.id === value);
} }
function removeFilter(k) { function removeFilter(k) {
@@ -73,30 +70,22 @@
} }
</script> </script>
<span class="applied-filter d-inline-block border border-primary rounded lx-small-text me-1 px-2 py-1"> <span class="applied-filter">
<div class="d-flex align-items-center justify-content-center">
{#if filter.isReference && filterRecord} {#if filter.isReference && filterRecord}
{filter.label} is {previewTitle(channel.schemas, filterRecord)} {filter.label} is {filterRecord.data.name}
{:else} {:else}
{filter.label} {operators.find((o) => o.name === filter.operator)?.symbol ?? ""} {value} {filter.label}
{operators.find((o) => o.name === filter.operator)?.symbol ?? ""}
{operators.find((o) => o.name === filter.operator)?.hasValue
? value
: ""}
{/if} {/if}
<button <button
on:click|preventDefault={() => removeFilter(key)} on:click|preventDefault={() => removeFilter(key)}
type="button" type="button"
class="btn-close btn-close ms-1" class="button-text"
aria-label="Close" aria-label="Close"
/> ><Icon width={12} height={12} icon="close"></Icon></button
</div> >
</span> </span>
<style>
.applied-filter {
background-color: #fff;
line-height: 22px;
}
.applied-filter:hover {
opacity: .8;
background-color: #eee;
}
</style>
@@ -0,0 +1,35 @@
<script>
import {createEventDispatcher, getContext} from "svelte";
import Icon from "../../common/Icon.svelte";
const channel = getContext("channel");
const dispatch = createEventDispatcher();
export let inModal;
export let modalUrl;
const url = new URL(modalUrl ?? window.location.href);
function removeFilter(k) {
const url = new URL(modalUrl ?? window.location.href);
url.searchParams.set("skip", "0");
url.searchParams.delete("notlinked");
if (inModal) {
dispatch("refresh", url);
} else {
window.location.replace(url);
}
}
</script>
{#if url.searchParams.get("notlinked")}
<span class="applied-filter">
Not linked
<button
on:click|preventDefault={() => removeFilter()}
type="button"
class="button-text"
aria-label="Close"
><Icon width={12} height={12} icon="close"></Icon></button>
</span>
{/if}
+164 -72
View File
@@ -1,8 +1,8 @@
<script> <script>
import Icon from "../../common/Icon.svelte"; import Icon from "../../common/Icon.svelte";
import {createEventDispatcher} from "svelte"; import {createEventDispatcher} from "svelte";
import FilterReferenceInput from "./FilterReferenceInput.svelte";
import Dropdown from "../../common/Dropdown.svelte"; import Dropdown from "../../common/Dropdown.svelte";
import FilterReferenceInput from "./FilterReferenceInput.svelte";
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
export let schema; export let schema;
@@ -14,50 +14,10 @@
let dropdown; let dropdown;
let search = ""; let search = "";
let systemFieldsFiltered = systemFields; let systemFieldsFiltered = systemFields;
if (schema.type == "collection") { if (schema.type === "collection") {
systemFieldsFiltered = systemFields.filter((f) => f.files === false); systemFieldsFiltered = systemFields.filter((f) => f.files === false);
} }
let filterableFields = [...schema.fields, ...systemFieldsFiltered].filter(
(f) => !["file", "json"].includes(f.info?.name ?? f.ui)
);
let selectedField;
let selectedInput = "";
$: operatorsFiltered = operators.filter(
(o) => o.uis.includes(selectedField?.info?.name) || o.uis[0] == "*"
);
$: selectedOperator = operatorsFiltered[0];
function addFilter(e) {
e.preventDefault();
let filterPrefix = "";
let filterKey;
if (schema.fields.find(f => f.name === selectedField.name)) {
if (selectedField.info.name == "reference" && selectedOperator.name == "eq") {
filterPrefix = "children." + selectedField.name + ".id";
filterKey = `filter[${filterPrefix}]`;
} else {
filterPrefix = "data.";
filterKey = `filter[${filterPrefix + selectedField.name}_${selectedOperator.name}]`;
}
}
const url = new URL(modalUrl ?? window.location.href);
url.searchParams.set("skip", "0");
url.searchParams.set(filterKey, selectedInput);
if (inModal) {
dispatch("refresh", url);
dropdown.hide()
} else {
window.location = url;
}
}
function submitSearch(e) { function submitSearch(e) {
e.preventDefault(); e.preventDefault();
let filterKeyValue = search.split("=")[0] ?? ""; let filterKeyValue = search.split("=")[0] ?? "";
@@ -79,63 +39,195 @@
} else { } else {
window.location.replace(url); window.location.replace(url);
} }
resetFilters();
} }
// New Start
let selectedInput = null;
let activeField = null;
let activeReference = null;
let activeOperator = null;
let activeMenu = "main";
let activeOperators = null;
let dataFields = [...schema.fields, ...systemFieldsFiltered].filter(
(f) => !["file", "json", "reference"].includes(f.info?.name ?? f.ui)
);
let referenceFields = [...schema.fields].filter(
(f) => ["reference"].includes(f.info?.name ?? f.ui)
);
function selectField(e, field) {
activeField = field;
activeOperators = operators.filter(
(o) => o.uis.includes(activeField?.info?.name) || o.uis[0] === "*"
);
}
function selectReference(e, field) {
activeReference = field;
activeOperator = operators.find(o => o.name === "eq")
}
function selectOperator(e, operator) {
activeOperator = operator;
if (!operator.hasValue) {
applyFilter(e)
}
}
function applyFilter(e) {
e.preventDefault();
let filterPrefix = "";
let filterKey;
let selectedField = activeField ?? activeReference;
if (schema.fields.find(f => f.name === selectedField.name)) {
if (selectedField.info.name === "reference" && activeOperator.name === "eq") {
filterPrefix = "children." + selectedField.name + ".id";
filterKey = `filter[${filterPrefix}]`;
} else {
filterPrefix = "data.";
filterKey = `filter[${filterPrefix + selectedField.name}_${activeOperator.name}]`;
}
}
const url = new URL(modalUrl ?? window.location.href);
url.searchParams.set("skip", "0");
url.searchParams.set(filterKey, selectedInput);
if (inModal) {
dispatch("refresh", url);
dropdown.close()
} else {
window.location.href = url.toString();
}
resetFilters();
}
function resetFilters() {
activeField = null;
activeOperator = null;
activeMenu = "main";
activeReference = null;
}
</script> </script>
<div class="mx-2 d-flex align-items-center">
<Dropdown bind:this={dropdown} width="300"> <div>
<Dropdown bind:this={dropdown}>
<div slot="button"> <div slot="button">
<Icon icon="filter"/> <Icon icon="filter"/>
<span class="ms-1">Filter</span> <span class="ms-1">Filter</span>
</div> </div>
<div class:hide={activeMenu !== "main"}>
<button class="dropdown-item button" on:click={e => activeMenu = "byField" }>
Filter by field
</button>
<button class="dropdown-item button" on:click={e => activeMenu = "byReference" }>
Filter by Reference
</button>
<button class="dropdown-item button" on:click={e => activeMenu = "advanced" }>
Advanced filter
</button>
</div>
<div class:hide={activeMenu !== "byField"}>
{#if !activeField}
<button class="dropdown-item button" on:click={e => activeMenu = "main" }>
<Icon icon="arrow-left"></Icon>
Back
</button>
{#each dataFields as field}
<button class="dropdown-item button" on:click={e => selectField(e,field)}>
{field.label}
</button>
{/each}
{/if}
<div class="px-3 py-1 d-flex align-items-center"> {#if activeField && !activeOperator}
<select bind:value={selectedField} class="form-select"> <button class="dropdown-item button" on:click={e => activeField = null }>
{#each filterableFields as field} <Icon icon="arrow-left"></Icon>
<option value={field}>{field.label}</option> Back
</button>
<div class="selected-filter">field: {activeField.label}</div>
{#each activeOperators as operator}
<button class="dropdown-item button" on:click={e => selectOperator(e,operator)}>
{operator.label}
</button>
{/each} {/each}
</select> {/if}
</div> {#if activeField && activeOperator}
<div class="px-3 py-1 d-flex align-items-center"> <button class="dropdown-item button" on:click={e => activeOperator = null }>
<select class="form-select" bind:value={selectedOperator}> <Icon icon="arrow-left"></Icon>
{#each operatorsFiltered as operator} Back
<option value={operator}>{operator.label}</option> </button>
{/each} <div class="selected-filter">field: {activeField.label} operator: {activeOperator.label}</div>
</select> <div class="filter-input">
</div>
<div class="px-3 py-1 d-flex align-items-center">
{#if selectedField?.info?.name === "reference" && selectedOperator.name === "eq"}
<FilterReferenceInput field={selectedField} bind:value={selectedInput} on:addFilter={addFilter}/>
{:else}
<input <input
type="text" type="text"
class="form-control" class="form-control"
bind:value={selectedInput} bind:value={selectedInput}
/> />
{/if}
</div> </div>
<div class="px-3 py-1 d-flex align-items-center">
<button <button
on:click={addFilter} on:click={applyFilter}
class="btn btn-outline-primary" class="button applied-filter"
type="button" type="button"
> >
Add filter Add filter
</button> </button>
</div> {/if}
<hr/> </div>
<div><h6 class="dropdown-header">Advanced filters</h6></div> <div class:hide={activeMenu !== "byReference"}>
{#if !activeReference}
<button class="dropdown-item button" on:click={e => activeMenu = "main" }>
<Icon icon="arrow-left"></Icon>
Back
</button>
{#each referenceFields as field}
<button class="dropdown-item button" on:click={e => selectReference(e,field)}>
{field.label}
</button>
{/each}
{/if}
{#if activeReference}
<button class="dropdown-item button" on:click={e => activeReference = null }>
<Icon icon="arrow-left"></Icon>
Back
</button>
<div class="selected-filter">field: {activeReference.label}</div>
<div class="mt-2">
<FilterReferenceInput field={activeReference} bind:value={selectedInput}
on:addFilter={applyFilter}/>
</div>
{/if}
</div>
<div class:hide={activeMenu !== "advanced"}>
<button class="dropdown-item button" on:click={e => activeMenu = "main" }>
<Icon icon="arrow-left"></Icon>
Back
</button>
<form on:submit={submitSearch}> <form on:submit={submitSearch}>
<div class="px-3 py-1 d-flex align-items-center">
<input <input
bind:value={search} bind:value={search}
type="search" type="search"
class="form-control" class="mb-2 mt-2"
placeholder="Advanced filters" placeholder="Advanced filters"
required required
/> />
</div>
<button class="button applied-filter">
Submit
</button>
</form> </form>
</Dropdown>
</div>
</Dropdown>
</div> </div>
@@ -1,8 +1,6 @@
<script> <script>
import { createEventDispatcher, getContext } from "svelte"; import { createEventDispatcher, getContext } from "svelte";
import {debounce} from "lodash"; import { apiGet, debounce } from "../../../helpers";
import {previewTitle} from "../../records/Preview";
const channel = getContext("channel"); const channel = getContext("channel");
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
@@ -10,13 +8,11 @@
export let value = ""; export let value = "";
export let field; export let field;
let search = "" let search = "";
$: searchOptions = [] $: searchOptions = [];
const updateResults = debounce((e) => { const updateResults = debounce((e) => {
axios apiGet(channel.lucentUrl + "/records/suggestions", {
.get(channel.lucentUrl + "/records/suggestions", {
params: { params: {
schema: field.collections[0], schema: field.collections[0],
field: "search", field: "search",
@@ -25,7 +21,7 @@
}, },
}) })
.then((response) => { .then((response) => {
searchOptions = response.data; searchOptions = response;
}) })
.catch((error) => { .catch((error) => {
searchOptions = []; searchOptions = [];
@@ -35,44 +31,36 @@
function apply(e, newOption) { function apply(e, newOption) {
e.preventDefault(); e.preventDefault();
value = newOption.id value = newOption.id;
dispatch("addFilter"); dispatch("addFilter");
value = "" value = "";
} }
</script> </script>
<div class="reference-tags">
<input <input
type="search" type="search"
on:keyup={updateResults} on:keyup={updateResults}
class="form-control dropdown-toggle"
bind:value={search} bind:value={search}
placeholder={"Search for " + field.label} placeholder={"Search for " + field.label}
data-bs-toggle="dropdown"
autocomplete="off" autocomplete="off"
/> />
<div class="dropdown-menu w-100"> <div class="reference-tags-results">
{#if searchOptions} {#if searchOptions}
{#each searchOptions as option (option.id)} {#each searchOptions as option (option.id)}
<div <div
class="reference-tags-option"
role="button"
tabindex="0"
on:click={(e) => apply(e, option)} on:click={(e) => apply(e, option)}
on:keypress={(e) => apply(e, option)} on:keypress={(e) => apply(e, option)}
> >
<span class="dropdown-item"> {option.data.name}
{previewTitle(channel.schemas, option)}
</span>
</div> </div>
{:else} {:else}
<div class="start-typing">Start typing...</div>
Start typing...
{/each} {/each}
{/if} {/if}
</div> </div>
</div>
+29 -38
View File
@@ -1,6 +1,7 @@
<script> <script>
import Icon from "../../common/Icon.svelte"; import Icon from "../../common/Icon.svelte";
import {createEventDispatcher} from "svelte"; import {createEventDispatcher} from "svelte";
import Dropdown from "../../common/Dropdown.svelte";
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
export let schema; export let schema;
@@ -42,90 +43,80 @@
} }
</script> </script>
<div class=" ">
<button <Dropdown>
class="btn btn-sm btn-outline-primary dropdown-toggle d-flex align-items-center" <div slot="button">
type="button"
data-bs-toggle="dropdown"
data-bs-auto-close="outside"
aria-expanded="false"
>
{#if sortParam.startsWith("-")} {#if sortParam.startsWith("-")}
<Icon icon="arrow-down-wide-short"/> <Icon icon="arrow-down-wide-short"/>
{:else} {:else}
<Icon icon="arrow-up-short-wide"/> <Icon icon="arrow-up-short-wide"/>
{/if} {/if}
<span class="ms-1">{sortField.label}</span> <span class="ms-1">{sortField.label}</span>
</button> </div>
<div class="dropdown-menu" style="width:auto;max-width:800px;"> <div>
<div class="row">
{#each sortableFields as field} {#each sortableFields as field}
<div class="col-4 px-3 py-1 d-flex align-items-center"> <div class="dropdown-item">
<div class="btn-group w-100">
<button <button
on:click={(e) => sortAsc(e, field)} on:click={(e) => sortAsc(e, field)}
title="Sort Ascending" title="Sort Ascending"
class="btn btn-sm {field.name == sortField.name && !sortParam.startsWith("-") class="button button-icon {field.name == sortField.name && !sortParam.startsWith("-")
? 'btn-primary' ? 'active'
: 'btn-outline-primary'} " : ''} "
> >
<Icon icon="arrow-up-short-wide"/> <Icon icon="arrow-up-short-wide"/>
</button> </button>
<button <button
on:click={(e) => sortDesc(e, field)} on:click={(e) => sortDesc(e, field)}
title="Sort Descending" title="Sort Descending"
class="btn btn-sm {field.name == sortField.name && sortParam.startsWith("-") class="button button-icon {field.name == sortField.name && sortParam.startsWith("-")
? 'btn-primary' ? 'active'
: 'btn-outline-primary'} " : ''} "
> >
<Icon icon="arrow-down-wide-short"/> <Icon icon="arrow-down-wide-short"/>
</button> </button>
<button <button
title="Sort Ascending" title="Sort Ascending"
on:click={(e) => sortAsc(e, field)} on:click={(e) => sortAsc(e, field)}
class="btn btn-sm btn-outline-primary w-100 text-nowrap" class="button"
style="overflow: hidden;"
> >
{field.label} {field.label}
</button> </button>
</div> </div>
</div>
{/each} {/each}
</div> <h6 class="dropdown-header">System</h6>
<h6 class="dropdown-header px-0">System</h6>
<div class="row">
{#each systemFieldsFiltered as field} {#each systemFieldsFiltered as field}
<div class="col-4 px-3 py-1 d-flex align-items-center"> <div class="dropdown-item">
<div class="btn-group w-100">
<button <button
on:click={(e) => sortAsc(e, field)} on:click={(e) => sortAsc(e, field)}
title="Sort Ascending" title="Sort Ascending"
class="btn btn-sm {field.name == sortParam class="button button-icon {field.name == sortParam
? 'btn-primary' ? 'active'
: 'btn-outline-primary'} " : ''} "
> >
<Icon icon="arrow-up-short-wide"/> <Icon icon="arrow-up-short-wide"/>
</button> </button>
<button <button
on:click={(e) => sortDesc(e, field)} on:click={(e) => sortDesc(e, field)}
title="Sort Descending" title="Sort Descending"
class="btn btn-sm {'-' + field.name == sortParam class="button button-icon {'-' + field.name == sortParam
? 'btn-primary' ? 'active'
: 'btn-outline-primary'} " : ''} "
> >
<Icon icon="arrow-down-wide-short"/> <Icon icon="arrow-down-wide-short"/>
</button> </button>
<button <button
title="Sort Ascending" title="Sort Ascending"
on:click={(e) => sortAsc(e, field)} on:click={(e) => sortAsc(e, field)}
class="btn btn-sm btn-outline-primary w-100 text-nowrap" class="button"
style="overflow: hidden;"
> >
{field.label} {field.label}
</button> </button>
</div> </div>
</div>
{/each} {/each}
</div> </div>
</div> </Dropdown>
</div>
+30 -53
View File
@@ -1,10 +1,11 @@
<script> <script>
import FilterFields from "./FilterFields.svelte"; import FilterFields from "./FilterFields.svelte";
import Uploader from "../../files/Uploader.svelte";
import Icon from "../../common/Icon.svelte"; import Icon from "../../common/Icon.svelte";
import SortFields from "./SortFields.svelte"; import SortFields from "./SortFields.svelte";
import AppliedFilter from "./AppliedFilter.svelte"; import AppliedFilter from "./AppliedFilter.svelte";
import {getContext, createEventDispatcher} from "svelte"; import { createEventDispatcher, getContext } from "svelte";
import Dropdown from "../../common/Dropdown.svelte";
import AppliedFilterNotLinked from "./AppliedFilterNotLinked.svelte";
const channel = getContext("channel"); const channel = getContext("channel");
@@ -39,17 +40,11 @@
} else { } else {
window.location = url; window.location = url;
} }
}
function uploadComplete(e) {
records = e.detail;
} }
</script> </script>
<div class="mb-3 d-flex align-items-center justify-content-between"> <div class="toolbar">
<div class=" d-flex align-items-center"> <div class="toolbar-filters">
<SortFields <SortFields
{schema} {schema}
{sortParam} {sortParam}
@@ -60,7 +55,6 @@
on:refresh on:refresh
/> />
<FilterFields <FilterFields
bind:schema bind:schema
{systemFields} {systemFields}
@@ -72,78 +66,62 @@
/> />
<form method="GET" on:submit={search}> <form method="GET" on:submit={search}>
<input type="search" name="filter[search_regex]" placeholder="Search" <input
class="form-control" required> type="search"
name="filter[search_regex]"
placeholder="Search"
class="search"
required
/>
</form> </form>
</div> </div>
<div class="d-flex align-items-center "> <div style="display:flex;align-items: center;gap:4px">
{#if schema.type === "collection"}
{#if !inModal && isWritable} {#if !inModal && isWritable}
<a <a
href="{channel.lucentUrl}/records/new?schema={schema.name}" href="{channel.lucentUrl}/records/new?schema={schema.name}"
class="btn btn-sm btn-primary" class="button"
> >
New Record New Record
</a> </a>
{/if} {/if}
{:else }
<div class="d-inline-block ms-1">
<Uploader {schema} on:uploadComplete={uploadComplete}/>
</div>
{/if}
{#if !inModal}
<div class="dropdown d-inline-block">
<button
class="btn btn-link btn-sm"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
<Icon icon="ellipsis-vertical"/>
</button>
<ul class="dropdown-menu"> {#if !inModal}
<Dropdown orientation="right">
<div slot="button">
<Icon icon="ellipsis-vertical" />
</div>
{#if filter["status_in"] === "trashed"} {#if filter["status_in"] === "trashed"}
{#if isWritable} {#if isWritable}
<li>
<a <a
class="dropdown-item" class="dropdown-item"
href="{channel.lucentUrl}/content/{schema.name}/emptyTrash" href="{channel.lucentUrl}/content/{schema.name}/emptyTrash"
> >
Empty trash Empty trash
</a> </a>
</li>
{/if} {/if}
{:else} {:else}
<a class="dropdown-item" href={csvUrl}>Export to CSV</a>
<li>
<a
class="dropdown-item"
href={csvUrl}
>Export to CSV</a
>
</li>
<li>
<a <a
class="dropdown-item" class="dropdown-item"
href="{channel.lucentUrl}/content/{schema.name}?filter[status_in]=trashed" href="{channel.lucentUrl}/content/{schema.name}?filter[status_in]=trashed"
>View trashed records</a >View trashed records</a
> >
</li> <a
class="dropdown-item"
href="{channel.lucentUrl}/content/{schema.name}?notlinked=*"
>View unlinked records</a
>
{/if} {/if}
</Dropdown>
</ul>
</div>
{/if} {/if}
</div> </div>
</div> </div>
<div class="applied-filters">
<AppliedFilterNotLinked {inModal} {modalUrl} on:refresh
></AppliedFilterNotLinked>
{#if Object.entries(filter).length > 0} {#if Object.entries(filter).length > 0}
<div class=" d-flex mb-3">
{#each Object.entries(filter) as [k, v]} {#each Object.entries(filter) as [k, v]}
<AppliedFilter <AppliedFilter
{schema} {schema}
@@ -156,6 +134,5 @@
on:refresh on:refresh
/> />
{/each} {/each}
</div>
{/if} {/if}
</div>
+96
View File
@@ -0,0 +1,96 @@
<script>
import { createEventDispatcher, getContext } from "svelte";
import Icon from "../common/Icon.svelte";
import Index from "../content/Index.svelte";
import { apiGet } from "../../helpers";
let dialogEl;
const dispatch = createEventDispatcher();
const channel = getContext("channel");
$: data = {};
let selectedRecords = [];
// onMount(() => {
// load();
// });
export function close(e) {
if (e) {
e.preventDefault();
}
dialogEl.close();
selectedRecords = [];
}
function load(schema) {
apiGet(channel.lucentUrl + "/content/" + schema)
.then((response) => {
data = response;
})
.catch((error) => console.log(error));
}
function insert(e) {
e.preventDefault();
dispatch("insert", {
records: selectedRecords,
action: "insert",
schema: data.schema.name,
});
}
function replace(e) {
e.preventDefault();
dispatch("insert", {
records: selectedRecords,
action: "replace",
});
}
export function open(schema) {
dialogEl.showModal();
load(schema);
}
</script>
<dialog bind:this={dialogEl}>
{#if data.schema}
<div class="dialog-header">
<button
type="button"
class="button"
on:click={insert}
disabled={selectedRecords.length === 0}
>
Insert
</button>
<button
type="button"
class="button"
on:click={replace}
disabled={selectedRecords.length === 0}
>
Replace
</button>
{#if selectedRecords.length > 0}
<span class="">
{selectedRecords.length} records selected
</span>
{/if}
<button
on:click|preventDefault={close}
type="button"
class="button close"
aria-label="Close"
>
<Icon icon="close"></Icon>
</button>
</div>
<div class="dialog-body">
<Index {...data} bind:selected={selectedRecords}></Index>
</div>
{/if}
</dialog>
@@ -0,0 +1,38 @@
<script>
import Icon from "../common/Icon.svelte";
let dialogEl;
$: data = {};
export function close(e) {
if (e) {
e.preventDefault();
}
dialogEl.close()
}
export function open() {
dialogEl.showModal()
}
</script>
<dialog bind:this={dialogEl}>
<div class="dialog-header">
<button
on:click|preventDefault={close}
type="button"
class="button close"
aria-label="Close"
>
<Icon icon="close"></Icon>
</button>
</div>
<div class="dialog-body" style="min-width: 900px">
<slot/>
</div>
</dialog>
+87
View File
@@ -0,0 +1,87 @@
<script>
import { createEventDispatcher, getContext } from "svelte";
import Icon from "../common/Icon.svelte";
import FileIndex from "./FileIndex.svelte";
let dialogEl;
const dispatch = createEventDispatcher();
const channel = getContext("channel");
$: files = [];
$: selectedRecords = [];
// onMount(() => {
// load();
// });
export function close(e) {
if (e) {
e.preventDefault();
}
dialogEl.close();
selectedRecords = [];
}
function load(recordId) {
fetch(channel.lucentUrl + "/records/files/?recordId=" + recordId)
.then((response) => response.json())
.then((json) => {
files = json;
})
.catch((error) => console.log(error));
}
function insert(e) {
e.preventDefault();
dispatch("insert_files", selectedRecords);
}
function replace(e) {
e.preventDefault();
dispatch("replace_files", selectedRecords);
}
export function open(recordId) {
dialogEl.showModal();
load(recordId);
}
</script>
<dialog bind:this={dialogEl}>
<div class="dialog-header">
<button
type="button"
class="button"
on:click={insert}
disabled={selectedRecords.length === 0}
>
Insert
</button>
<button
type="button"
class="button"
on:click={replace}
disabled={selectedRecords.length === 0}
>
Replace
</button>
{#if selectedRecords.length > 0}
<span class="">
{selectedRecords.length} records selected
</span>
{/if}
<button
on:click|preventDefault={close}
type="button"
class="button close"
aria-label="Close"
>
<Icon icon="close"></Icon>
</button>
</div>
<div class="dialog-body">
<FileIndex {files} bind:selected={selectedRecords}></FileIndex>
</div>
</dialog>
+104
View File
@@ -0,0 +1,104 @@
<script>
import { getContext } from "svelte";
import Icon from "../common/Icon.svelte";
import Checkbox from "../common/Checkbox.svelte";
import Preview from "../files/Preview.svelte";
import { fileurl } from "../files/imageserver";
const channel = getContext("channel");
export let files = [];
export let selected = [];
export let isWritable = true;
function eventToggleAll(e) {
selected = toggleAll(e, files, selected);
}
function select(file) {
selected = selectFile(file, selected);
}
export const toggleAll = (e, files, selected) => {
if (selected.length === files.length) {
return [];
}
e.currentTarget.checked = selected.length > 0;
return files;
};
export const selectFile = (file, selected) => {
let fileExists = selected.find((r) => r.id === file.id);
if (fileExists) {
return selected.filter((r) => r.id !== file.id);
}
return [...selected, file];
};
</script>
<div class="table mt-5">
<table>
<thead>
<tr>
{#if isWritable}
<th>
<Checkbox
value=""
on:change={eventToggleAll}
indeterminate={selected.length > 0 &&
selected.length < files.length}
checked={selected.length === files.length}
></Checkbox>
</th>
{/if}
<th></th>
</tr>
</thead>
<tbody>
{#each files as file (file.id)}
<tr>
<td class="title-td">
<div class="title-td-contents">
{#if isWritable}
<Checkbox
on:change={() => select(file)}
checked={selected.find(
(s) => s.id === file.id,
)}
value={file}
></Checkbox>
{/if}
<div class="file-table-row">
<Preview
{file}
size={file.width > 0 ? "medium" : "small"}
/>
<div>
{file.filename}
<span
>{(file.size / 1024).toFixed(1)}kB</span
>
{#if file.width > 0}
<span
>{file.width +
"x" +
file.height}</span
>
{/if}
<a
href={fileurl(channel, file)}
target="_blank"
>
Download
</a>
</div>
</div>
</div>
</td>
</tr>
{/each}
</tbody>
</table>
</div>
+13 -5
View File
@@ -1,15 +1,23 @@
export function sortByField(from, to, edges, fieldName) { export function sortByField(from, to, edges, fieldName, references) {
if (from === to) { if (from === to) {
return edges; return edges;
} }
let edgesTosort = edges?.filter((ed) => ed.field === fieldName && ed.depth === 1 ) ?? []; let referenceIds = references.map((r) => r.id);
let remainingEdge = edges?.filter((ed) => !(ed.field === fieldName && ed.depth === 1)) ?? []; let edgesTosort =
edges?.filter(
(ed) =>
ed.field === fieldName &&
ed.depth === 1 &&
referenceIds.includes(ed.target),
) ?? [];
let remainingEdge =
edges?.filter((ed) => !(ed.field === fieldName && ed.depth === 1)) ?? [];
edgesTosort = array_move(edgesTosort, from, to); edgesTosort = array_move(edgesTosort, from, to);
return [...remainingEdge, ...edgesTosort]; return [...remainingEdge, ...edgesTosort];
} }
function array_move(arr, old_index, new_index) { export function array_move(arr, old_index, new_index) {
if (new_index >= arr.length) { if (new_index >= arr.length) {
var k = new_index - arr.length + 1; var k = new_index - arr.length + 1;
while (k--) { while (k--) {
@@ -18,4 +26,4 @@ function array_move(arr, old_index, new_index) {
} }
arr.splice(new_index, 0, arr.splice(old_index, 1)[0]); arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);
return arr; // for testing return arr; // for testing
}; }
+28 -18
View File
@@ -1,15 +1,17 @@
<script> <script>
import Icon from "../common/Icon.svelte"; import Icon from "../common/Icon.svelte";
import {imgurl} from "../files/imageserver"; import { imgurl } from "./imageserver.js";
import { getContext } from "svelte"; import { getContext } from "svelte";
export let record; export let file;
const channel = getContext("channel"); const channel = getContext("channel");
export let size = "small"; export let size = "small";
export let showFilename = false; export let showFilename = false;
let imageSide; let imageSide;
let fileSide; let fileSide;
let fontSize; let fontSize;
console.log({ channel });
if (size == "large") { if (size == "large") {
imageSide = 256; imageSide = 256;
fileSide = 32; fileSide = 32;
@@ -29,40 +31,48 @@
} }
</script> </script>
{#if record} <div style="display: flex;align-items: center;gap: 5px;">
{#if record._file.mime.startsWith("image")} {#if file}
{#if file.mime.startsWith("image")}
<!-- href={imgurl(record)} --> <!-- href={imgurl(record)} -->
<a <a
href="{channel.lucentUrl}/records/{record.id}" href="{channel.lucentUrl}/files/{file.id}"
title={record._file.path} title={file.filename}
class="d-flex align-items-center justify-content-center "
style="width:{imageSide}px;height:{imageSide}px" style="width:{imageSide}px;height:{imageSide}px"
> >
<img <img
class="rounded w-100" class="rounded w-100"
src={imgurl(record)} src={imgurl(channel, file)}
alt={record._file.path} alt={file.path}
/> />
</a> </a>
{:else} {:else}
<a <a
href="{channel.lucentUrl}/records/{record.id}" href="{channel.lucentUrl}/files/{file.id}"
title={record._file.path} title={file.path}
class="btn btn-outline-primary btn-sm d-flex align-items-center justify-content-center" class="file-preview-small"
style="width:{imageSide}px;height:{imageSide}px" style="width:{imageSide}px;height:{imageSide}px"
> >
<Icon icon="file" width={fileSide} height={fileSide} /> <Icon icon="file" width={fileSide} height={fileSide} />
<span class="ms-2" style="font-size:{fontSize}px" <span class="ms-2"
>.{record._file.path.split(".").pop()}</span >.{file.path.split(".").pop().toLowerCase()}</span
> >
</a> </a>
{/if} {/if}
{/if} {/if}
{#if showFilename} {#if showFilename}
<a <a
href="{channel.lucentUrl}/records/{record.id}" href="{channel.lucentUrl}/files/{file.id}"
title={record._file.path} title={file.path}
class="preview-file-filename lx-small-text text-decoration-none" class="preview-file-filename lx-small-text text-decoration-none"
>{record._file.path}</a >{file.path}
> </a>
{/if} {/if}
</div>
<style>
img {
border-radius: 12px;
padding: 4px;
}
</style>
+18 -19
View File
@@ -4,7 +4,7 @@
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
const channel = getContext("channel"); const channel = getContext("channel");
export let schema; export let recordId;
let mimeTypes = ""; let mimeTypes = "";
let files = []; let files = [];
let isLoading = false; let isLoading = false;
@@ -17,42 +17,41 @@
files = e.target.files ? [...e.target.files] : []; files = e.target.files ? [...e.target.files] : [];
let formData = new FormData(); let formData = new FormData();
formData.append("schema", schema.name); formData.append("recordId", recordId);
Array.from(files).forEach(function (file) { Array.from(files).forEach(function (file) {
formData.append("files[]", file); formData.append("files[]", file);
}); });
dispatch("beforeUpload", files); dispatch("beforeUpload", files);
axios fetch(channel.lucentUrl + "/files/upload", {
.post(channel.lucentUrl + "/files/upload", formData, { method: "POST",
body: formData,
headers: { headers: {
"Content-Type": "multipart/form-data", "X-CSRF-TOKEN": document.querySelector(
'meta[name="csrf-token"]',
).content,
}, },
}) })
.then((response) => { .then((response) => response.json())
if (response.data.error) { .then((data) => {
dispatch("uploadError", response.data.error); if (data.error) {
dispatch("uploadError", data.error);
} else { } else {
dispatch("uploadComplete", response.data); dispatch("uploadComplete", data);
} }
isLoading = false; isLoading = false;
})
.catch((error) => {
isLoading = false;
console.log(error.response.data);
}); });
} }
</script> </script>
<fieldset disabled={isLoading}> <fieldset class="upload-button" disabled={isLoading}>
<label class="btn btn-primary btn-sm btn-spinner "> <label class="button primary btn-spinner">
Upload file
<span <span
class="spinner-border spinner-border-sm" class="spinner-border spinner-border-sm"
role="status" role="status"
aria-hidden="true" aria-hidden="true"
> />
<span class="visually-hidden">Loading...</span> Upload file
</span>
<input <input
on:input={upload} on:input={upload}
class="form-control" class="form-control"
+25 -11
View File
@@ -1,15 +1,29 @@
import {getContext} from "svelte"; export function imgurl(channel, file) {
if (file.mime === "image/svg+xml") {
export function imgurl(record) { return fileurl(channel, file);
if(record._file.mime === "image/svg+xml"){
return fileurl(record);
} }
const channel = getContext("channel") return channel.filesUrl + `/thumbs/${file.path}`;
return channel.filesUrl + `/thumbs/${record._file.path}`;
} }
export function fileurl(record) { export function fileurl(channel, file) {
const channel = getContext("channel") return channel.filesUrl + `/${file.path}`;
return channel.filesUrl + `/${record._file.path}`; }
export function htmlurl(channel, file, preset) {
let html = "";
let url = fileurl(channel, file);
if (file.width > 0) {
let presetUrl = url;
if (preset) {
presetUrl = channel.filesUrl + `/templates/${preset}/${file.path}`;
}
html = `<img src="${presetUrl}" alt="${file.path}" />`;
} else if (file.mime === "image/svg+xml") {
html = `<img src="${url}" alt="${file.path}"/>`;
} else {
html = `<a href="${url}">${file.originalName}</a>`;
}
return html;
} }
-26
View File
@@ -1,26 +0,0 @@
<script>
import { uniqueId } from "lodash";
export let label;
export let name;
export let group;
export let value;
export let help;
let id = uniqueId();
</script>
<div class="form-check">
<input
class="form-check-input"
type="radio"
{value}
{name}
bind:group
{id}
/>
<label class="form-check-label" for={id}>
{label}
</label>
{#if help}
<span class="text-muted">{help}</span>
{/if}
</div>
+8 -17
View File
@@ -1,19 +1,17 @@
<script> <script>
import { getContext, onMount } from "svelte"; import { getContext, onMount } from "svelte";
import RecordRow from "./RecordRow.svelte" import RecordRow from "./RecordRow.svelte";
import { apiGet } from "../../helpers";
const channel = getContext("channel"); const channel = getContext("channel");
let records = []; let records = [];
let graph = null; let graph = null;
let users = []; let users = [];
onMount(() => { onMount(() => {
axios apiGet(channel.lucentUrl + "/home/records")
.get(channel.lucentUrl + "/home/records") .then((data) => {
.then((response) => { records = data.records;
records = response.data.records; users = data.users;
graph = response.data.graph;
users = response.data.users;
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
@@ -21,24 +19,17 @@
}); });
</script> </script>
<div class="wrapper-normal transparent">
<h3 class="header-small mb-4 mt-5">Latest Content changes</h3> <h3 class="header-small mb-4 mt-5">Latest Content changes</h3>
{#if records.length > 0} {#if records.length > 0}
<div class="lx-card mb-4"> <div class="table">
<div class="lx-table p-0">
<table class=""> <table class="">
<tbody> <tbody>
{#each records as record (record.id)} {#each records as record (record.id)}
<tr> <tr>
<RecordRow {graph} {record} {users}/> <RecordRow {record} {users} />
</tr> </tr>
{/each} {/each}
</tbody> </tbody>
</table> </table>
</div> </div>
</div>
{/if} {/if}
</div>
+15 -25
View File
@@ -1,48 +1,38 @@
<script> <script>
import { formatDistanceToNow, parseJSON } from "date-fns"; import { formatDistanceToNow, parseJSON } from "date-fns";
import Avatar from "../account/Avatar.svelte"; import Avatar from "../account/Avatar.svelte";
import Status from "../records/Status.svelte";
import {previewTitle} from "../records/Preview";
import Preview from "../files/Preview.svelte"; import Preview from "../files/Preview.svelte";
import { usernameById } from "../account/users"; import { usernameById } from "../account/users";
import { getContext } from "svelte"; import { getContext } from "svelte";
const channel = getContext("channel"); const channel = getContext("channel");
export let users; export let users;
export let graph;
export let record; export let record;
let schema = channel.schemas.find((s) => s.name === record.schema); let schema = channel.schemas.find((s) => s.name === record.schema);
let frieldlyUpdatedAt = formatDistanceToNow( let frieldlyUpdatedAt = formatDistanceToNow(parseJSON(record.updatedAt), {
parseJSON(record._sys.updatedAt), addSuffix: true,
{addSuffix: true} });
);
</script> </script>
<td> <td>
<div class="row-name">
{#if record.status === "draft"}
<span class="status">DRAFT</span>
{/if}
{#if schema.type === "files"} {#if schema.type === "files"}
<Preview {record} size="tiny"/> <Preview {record} size="tiny" showFilename={true} />
{:else} {:else}
<a <a href="{channel.lucentUrl}/records/{record.id}">
href="{channel.lucentUrl}/records/{record.id}" {record.data.name}
class="text-decoration-none text-dark d-block"
>
{previewTitle(channel.schemas, record, graph)}
</a> </a>
{/if} {/if}
</div>
</td>
<td><a href="{channel.lucentUrl}/content/{schema.name}">{schema.label}</a> </td>
</td>
<td><a
class="text-decoration-none lx-small-text"
href="{channel.lucentUrl}/content/{schema.name}">{schema.label}</a
>
</td>
<td class="text-center">
<Status status={record.status}/>
</td>
<td> <td>
<div class="d-flex"> <div style="display: flex;gap: 14px">
<Avatar name={usernameById(users, record._sys.updatedBy)} side={24}/> <Avatar name={usernameById(users, record.updatedBy)} side={24} />
<div class="ms-2"> <div class="ms-2">
{frieldlyUpdatedAt} {frieldlyUpdatedAt}
</div> </div>
+38
View File
@@ -0,0 +1,38 @@
<script>
import Avatar from "../account/Avatar.svelte";
import { getContext } from "svelte";
import Dropdown from "../common/Dropdown.svelte";
const channel = getContext("channel");
const user = getContext("user");
</script>
<div class="top-nav">
{#if channel.auth == "lucent"}
<a class="top-nav-item" href="{channel.lucentUrl}/members">Members</a>
{/if}
{#if channel.commands.length > 0}
<Dropdown>
<div slot="button">Actions</div>
{#each channel.commands as command}
<a
href="{channel.lucentUrl}/command-report/{command.signature}"
class="top-nav-item">{command.name}</a
>
{/each}
</Dropdown>
{/if}
<!-- <div>-->
<!-- <form method="GET">-->
<!-- <input type="search" name="filter[search_regex]" placeholder="Search"-->
<!-- class="form-control" required/>-->
<!-- </form>-->
<!-- </div>-->
{#if channel.auth == "lucent"}
<a href="{channel.lucentUrl}/profile">
<Avatar side="28" name={user.name} />
</a>
{:else}
<Avatar side="28" name={user.name} />
{/if}
</div>
+21
View File
@@ -0,0 +1,21 @@
<script>
import { getContext } from "svelte";
export let schema;
const channel = getContext("channel");
const readableSchemas = getContext("readableSchemas");
</script>
<div class="sidebar-top">
<a class="logo" href={channel.lucentUrl}>{channel.name}</a>
</div>
<div class="sidebar">
{#each readableSchemas as aschema}
<a
class="sidebar-item"
class:active={aschema.name === schema?.name}
aria-current="page"
href="{channel.lucentUrl}/content/{aschema.name}">{aschema.label}</a
>
{/each}
</div>
+27 -13
View File
@@ -1,10 +1,9 @@
<script> <script>
// https://codesandbox.io/s/codemirror-remark-editor-4m4z9?file=/src/CodeEditor.js:374-387 // https://codesandbox.io/s/codemirror-remark-editor-4m4z9?file=/src/CodeEditor.js:374-387
import {onMount, onDestroy} from "svelte"; import { onDestroy, onMount } from "svelte";
import { basicSetup, EditorView } from "codemirror"; import { basicSetup, EditorView } from "codemirror";
import { autocompletion, completionKeymap } from "@codemirror/autocomplete"; import { autocompletion, completionKeymap } from "@codemirror/autocomplete";
import {EditorState, Compartment} from "@codemirror/state"; import { Compartment, EditorState } from "@codemirror/state";
import { keymap } from "@codemirror/view"; import { keymap } from "@codemirror/view";
import { indentWithTab } from "@codemirror/commands"; import { indentWithTab } from "@codemirror/commands";
import { markdown } from "@codemirror/lang-markdown"; import { markdown } from "@codemirror/lang-markdown";
@@ -15,6 +14,29 @@
export let value; export let value;
export let editable = true; export let editable = true;
export function insertMedia(info) {
let insertText = "";
if (info.file.width > 0) {
insertText = `![${info.file.filename}](${info.url})`;
} else {
insertText = `[${info.file.filename}](${info.originalUrl})`;
}
const cursor = codeMirrorView.state.selection.main.head;
const transaction = codeMirrorView.state.update({
changes: {
from: cursor,
insert: insertText,
},
// the next 2 lines will set the appropriate cursor position after inserting the new text.
selection: { anchor: cursor + 1 },
scrollIntoView: true,
});
if (transaction) {
codeMirrorView.dispatch(transaction);
}
}
onMount(() => { onMount(() => {
let language = new Compartment(); let language = new Compartment();
let tabSize = new Compartment(); let tabSize = new Compartment();
@@ -23,11 +45,7 @@
doc: value, doc: value,
extensions: [ extensions: [
basicSetup, basicSetup,
keymap.of([ keymap.of([indentWithTab, ...lintKeymap, ...completionKeymap]),
indentWithTab,
...lintKeymap,
...completionKeymap
]),
language.of(markdown()), language.of(markdown()),
markdown(), markdown(),
autocompletion(), autocompletion(),
@@ -40,18 +58,14 @@
} }
}), }),
EditorView.lineWrapping, EditorView.lineWrapping,
EditorView.contentAttributes.of({spellcheck: "true"}) EditorView.contentAttributes.of({ spellcheck: "true" }),
], ],
}); });
codeMirrorView = new EditorView({ codeMirrorView = new EditorView({
state, state,
parent: parentElement, parent: parentElement,
}); });
}); });
onDestroy(() => { onDestroy(() => {
+4 -24
View File
@@ -1,6 +1,7 @@
<script> <script>
import Sortable from "sortablejs"; import Sortable from "sortablejs";
import { onMount, createEventDispatcher } from "svelte"; import {createEventDispatcher, onMount} from "svelte";
export let sortableClass = ""; export let sortableClass = "";
// export let handle; // export let handle;
export let isTable = false; export let isTable = false;
@@ -10,41 +11,20 @@
onMount(() => { onMount(() => {
let options = { let options = {
// handle: ".sortable-handle",
// draggable: ".quote-line-wrapper",
// filter: ".not-draggable", // Selectors that do not lead to dragging (String or Function)
// preventOnFilter: true,
animation: 150, // ms, animation speed moving items when sorting, `0` — without animation animation: 150, // ms, animation speed moving items when sorting, `0` — without animation
easing: "cubic-bezier(1, 0, 0, 1)", easing: "cubic-bezier(1, 0, 0, 1)",
direction: 'vertical',
onUpdate: function (/**Event*/ evt) { onUpdate: function (/**Event*/ evt) {
// reorder(evt.oldIndex,evt.newIndex);
console.log(evt)
dispatch("update", { dispatch("update", {
source: evt.oldIndex, source: evt.oldIndex,
target: evt.newIndex, target: evt.newIndex,
}); });
}, }
onMove(event) {
// if (event.related.className.indexOf("not-draggable") > -1) {
// return false;
// }
},
}; };
// if (handle) {
// options.handle = handle;
// }
sortableInstance = Sortable.create(sortableContainer, options); sortableInstance = Sortable.create(sortableContainer, options);
}); });
// function reorder(from, to) {
// let newList = JSON.parse(JSON.stringify(value));
// let fromElem = newList[from];
// newList.splice(from, 1);
// newList.splice(to, 0, fromElem);
// value = newList;
// dispatch("reordered", value);
// }
</script> </script>
{#if isTable} {#if isTable}
-126
View File
@@ -1,126 +0,0 @@
<script>
import {onDestroy, onMount} from "svelte";
import tinymce from "tinymce/tinymce";
import "tinymce/models/dom";
import "tinymce/icons/default";
import "tinymce/themes/silver";
import "tinymce/skins/ui/oxide/skin.css";
import contentUiSkinCss from "tinymce/skins/ui/oxide/content.css";
import "tinymce/plugins/link";
import "tinymce/plugins/code";
import "tinymce/plugins/image";
import "tinymce/plugins/table";
import "tinymce/plugins/codesample";
import "tinymce/plugins/media";
import "tinymce/plugins/lists";
import "tinymce/plugins/autoresize";
import "tinymce/plugins/wordcount";
export let value = "";
export let additionalConfig = {};
let lastVal = "";
let textareaEl;
let activeEditor;
let editorWrapper;
const plugins = [
"autoresize",
"code",
"image",
"table",
"codesample",
"link",
"lists",
"media",
"wordcount",
];
const toolbar =
"bold italic underline strikethrough removeformat | link | subscript superscript bullist numlist media image codesample table code wordcount blockquote indent outdent blocks";
onDestroy(() => {
if (activeEditor) {
activeEditor.destroy();
}
});
onMount(() => {
const config = {
target: textareaEl,
toolbar_mode: "sliding",
toolbar_sticky: true,
skin: false,
content_css: false,
content_style: contentUiSkinCss.toString(),
branding: false,
inline: false,
plugins: plugins,
contextmenu: false,
menubar: false,
statusbar: false,
entity_encoding: "raw",
convert_urls: false,
toolbar: toolbar,
image_caption: true,
relative_urls: false,
browser_spellcheck: true,
max_height: 600,
// media_poster: false,
content_style:
"img {max-width: 100%;height: auto;",
setup: function (editor) {
activeEditor = editor;
editor.on("init", function (e) {
editor.setContent(value ?? "");
});
// editor.on("blur", function (e) {
// let content = setImageDimensions(editor.getContent());
// dispatch("editorBlur", content);
// editorWrapper.classList.remove("editorFocus");
// // return false;
// });
// editor.on("focus", function (e) {
// editorWrapper.classList.add("editorFocus");
// // return false;
// });
editor.on("change input undo redo", function (e) {
lastVal = editor.getContent();
if (lastVal !== value) {
value = lastVal;
}
});
},
};
tinymce.init({...config, ...additionalConfig});
});
</script>
<div bind:this={editorWrapper} class="tox-wrapper">
<div class="form-control" bind:this={textareaEl}>
{@html value}
</div>
</div>
<style>
:global(.tox:not(.tox-tinymce-inline) .tox-editor-header) {
background-color: #fff;
border-bottom: 1px solid #ced4da;
box-shadow: none;
padding: 4px 0;
transition: box-shadow 0.5s;
}
:global(.tox-tinymce) {
border: 1px solid #ced4da;
}
</style>
+174
View File
@@ -0,0 +1,174 @@
<script>
import {onDestroy, onMount} from 'svelte';
import {Editor} from '@tiptap/core'
import Document from '@tiptap/extension-document'
import Paragraph from '@tiptap/extension-paragraph'
import Dropcursor from '@tiptap/extension-dropcursor'
import Text from '@tiptap/extension-text'
import Heading from '@tiptap/extension-heading'
import HardBreak from '@tiptap/extension-hard-break'
import Blockquote from '@tiptap/extension-blockquote';
import CodeBlock from '@tiptap/extension-code-block';
import Bold from '@tiptap/extension-bold';
import BulletList from '@tiptap/extension-bullet-list';
import Code from '@tiptap/extension-code';
import History from '@tiptap/extension-history';
import Italic from '@tiptap/extension-italic';
import ListItem from '@tiptap/extension-list-item';
import OrderedList from '@tiptap/extension-ordered-list';
import Strike from '@tiptap/extension-strike';
import Table from '@tiptap/extension-table';
import TableRow from '@tiptap/extension-table-row';
import TableCell from '@tiptap/extension-table-cell';
import TableHeader from '@tiptap/extension-table-header';
import Underline from '@tiptap/extension-underline';
import Image from '@tiptap/extension-image';
import Icon from "../common/Icon.svelte";
let element;
let editor;
export let value = "";
onMount(() => {
editor = new Editor({
element: element,
extensions: [
Document,
Paragraph,
Text,
Bold,
ListItem,
BulletList,
Code,
CodeBlock,
History,
Italic,
HardBreak,
OrderedList,
Strike,
Table,
TableRow,
TableCell,
TableHeader,
Underline,
Dropcursor,
Image,
Heading.configure({
levels: [1, 2, 3],
}),
Blockquote
],
content: value,
editable: true,
onTransaction: () => {
// force re-render so `editor.isActive` works as expected
editor = editor;
},
onUpdate: ({editor}) => {
value = editor.getHTML()
},
});
});
onDestroy(() => {
if (editor) {
editor.destroy();
}
});
export function insertMedia(info){
editor.chain().focus().setImage({ src: info.url }).run()
}
</script>
{#if editor}
<div class="editor-toolbar">
<button
class="button"
on:click={() => editor.chain().focus().toggleHeading({ level: 1 }).run()}
class:active={editor.isActive('heading', { level: 1 })}
>
H1
</button>
<button
class="button"
on:click={() => editor.chain().focus().toggleHeading({ level: 2 }).run()}
class:active={editor.isActive('heading', { level: 2 })}
>
H2
</button>
<button
class="button"
on:click={() => editor.chain().focus().toggleBold().run()}
class:active={editor.isActive('bold')}
>
B
</button>
<button
class="button"
on:click={() => editor.chain().focus().toggleItalic().run()}
class:active={editor.isActive('italic')}
>
<em>IT</em>
</button>
<button
class="button"
on:click={() => editor.chain().focus().toggleUnderline().run()}
class:active={editor.isActive('underline')}
>
<u>U</u>
</button>
<button
class="button"
on:click={() => editor.chain().focus().toggleStrike().run()}
class:active={editor.isActive('strike')}
>
<s>S</s>
</button>
<button
class="button"
on:click={() => editor.commands.unsetAllMarks()}
>
Clear
</button>
<button
class="button"
on:click={() => editor.chain().focus().toggleCode().run()}
class:active={editor.isActive('code')}
>
Code
</button>
<button
class="button"
on:click={() => editor.chain().focus().toggleBulletList().run()}
class:active={editor.isActive('bulletList')}
>
<Icon icon="list"></Icon>
</button>
<button
class="button"
on:click={() => editor.chain().focus().toggleOrderedList().run()}
class:active={editor.isActive('orderedList')}
>
<Icon icon="ordered-list"></Icon>
</button>
<button
class="button"
on:click={() => editor.chain().focus().toggleBlockquote().run()}
class:active={editor.isActive('blockquote')}
>
""
</button>
<button
class="button"
on:click={() => editor.chain().focus().toggleCodeBlock().run()}
class:active={editor.isActive('codeBlock')}
>
cb
</button>
</div>
{/if}
<div bind:this={element} class="content"/>
+66
View File
@@ -0,0 +1,66 @@
<script>
import { onDestroy, onMount } from "svelte";
import Trix from "trix";
import "trix/dist/trix.css";
export let value = "";
export let field;
let editor;
function updateValue(e) {
value = e.target.value;
}
export function insertMedia(info) {
if (info.file.width > 0) {
var attachment = new Trix.Attachment({ content: info.html });
editor.editor.insertAttachment(attachment);
} else {
editor.editor.insertHTML(
`<a href="${info.originalUrl}">${info.file.filename}</a>`,
);
}
}
onMount(() => {
editor.addEventListener("trix-file-accept", (e) => {
e.preventDefault();
});
editor.addEventListener("trix-before-initialize", (e) => {
Trix.config.blockAttributes.heading1.tagName = "h2";
const { toolbarElement } = e.target;
const h1Button = toolbarElement.querySelector(
"[data-trix-attribute=heading1]",
);
h1Button.insertAdjacentHTML(
"afterend",
`<button style="text-indent: initial;padding: 14px 10px !important;" type="button" class="trix-button trix-button--icon" data-trix-attribute="heading3" title="Heading 3" tabindex="-1" data-trix-active="">H3</button>`,
);
});
});
// onDestroy(() => {
// editor.removeEventListener("trix-before-initialize")
// })
Trix.config.blockAttributes.default.breakOnReturn = false;
Trix.config.blockAttributes.heading3 = {
tagName: "h3",
terminal: true,
breakOnReturn: true,
group: false,
};
// console.log(Trix.config)
</script>
<div class="tox-wrapper">
<input id="x-{field.name}" {value} type="hidden" />
<trix-editor
bind:this={editor}
class=" content"
input="x-{field.name}"
role="textbox"
tabindex="0"
on:trix-change={updateValue}
></trix-editor>
</div>
@@ -2,6 +2,7 @@
import Avatar from "../account/Avatar.svelte"; import Avatar from "../account/Avatar.svelte";
import {fly} from "svelte/transition"; import {fly} from "svelte/transition";
import {createEventDispatcher} from "svelte"; import {createEventDispatcher} from "svelte";
import Dropdown from "../common/Dropdown.svelte";
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
export let member; export let member;
@@ -35,50 +36,41 @@
<div <div
transition:fly={{ duration: 200 }} transition:fly={{ duration: 200 }}
class="d-flex justify-content-between align-items-center mb-3 " class="member-item"
> >
<div class="d-flex align-items-center status-{member.roles.includes('removed') ? 'removed' : 'active'}"> <div class="member-name status-{member.roles.includes('removed') ? 'removed' : 'active'}">
<Avatar name={member.name ?? "" } side={32}/> <Avatar name={member.name ?? "" } side={32}/>
<div class="ms-3 ">
<div> <div>
<span class="fs-5"> <div>
{member.name} {member.name}
</span>
</div> </div>
<div>
{member.email} {member.email}
</div> </div>
</div> </div>
<div> </div>
<div class="dropdown dropdown-center"> <Dropdown orientation="right">
<button <div slot="button">
class=" dropdown-toggle btn btn-light"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
Roles Roles
</button> </div>
<div class="dropdown-menu">
<h6 class="dropdown-header">Remove role</h6> <h6 class="dropdown-header">Remove role</h6>
{#each roles as role} {#each roles as role}
{#if member.roles.includes(role)} {#if member.roles.includes(role)}
<button <button
class="dropdown-item text-capitalize" class="dropdown-item button"
on:click={(e) => removeFrom(e,role)} on:click={(e) => removeFrom(e,role)}
> >
{role} {role}
</button> </button>
{/if} {/if}
{/each} {/each}
<div>
<hr class="dropdown-divider">
</div>
<h6 class="dropdown-header">Add role</h6> <h6 class="dropdown-header">Add role</h6>
{#each roles as role} {#each roles as role}
{#if !member.roles.includes(role)} {#if !member.roles.includes(role)}
<button <button
class="dropdown-item text-capitalize" class="dropdown-item button"
on:click={(e) => addTo(e,role)} on:click={(e) => addTo(e,role)}
> >
{role} {role}
@@ -86,11 +78,9 @@
{/if} {/if}
{/each} {/each}
</div> </Dropdown>
</div>
</div> </div>
</div>
<style> <style>
.status-removed { .status-removed {
opacity: .5; opacity: .5;
+12 -22
View File
@@ -2,10 +2,9 @@
import ErrorAlert from "../common/ErrorAlert.svelte"; import ErrorAlert from "../common/ErrorAlert.svelte";
import SuccessAlert from "../common/SuccessAlert.svelte"; import SuccessAlert from "../common/SuccessAlert.svelte";
import SpinnerButton from "../common/SpinnerButton.svelte"; import SpinnerButton from "../common/SpinnerButton.svelte";
import Radio from "../forms/Radio.svelte";
import MemberSettingsCard from "./MemberSettingsCard.svelte"; import MemberSettingsCard from "./MemberSettingsCard.svelte";
import { getContext } from "svelte"; import { getContext } from "svelte";
import { apiPost } from "../../helpers";
const channel = getContext("channel"); const channel = getContext("channel");
export let users; export let users;
@@ -23,15 +22,14 @@
function invite(newName, newEmail, newRole) { function invite(newName, newEmail, newRole) {
errorMessage = ""; errorMessage = "";
axios apiPost(channel.lucentUrl + "/members/invite", {
.post(channel.lucentUrl + "/members/invite", {
name: newName, name: newName,
email: newEmail, email: newEmail,
roles: [newRole], roles: [newRole],
}) })
.then((response) => { .then((response) => {
successAlert.show("User was invited"); successAlert.show("User was invited");
users = [...users, response.data.user]; users = [...users, response.user];
name = null; name = null;
email = null; email = null;
role = null; role = null;
@@ -45,14 +43,13 @@
e.preventDefault(); e.preventDefault();
errorMessage = ""; errorMessage = "";
axios apiPost(channel.lucentUrl + "/members/update", {
.post(channel.lucentUrl + "/members/update", {
id: e.detail.user, id: e.detail.user,
roles: e.detail.roles, roles: e.detail.roles,
}) })
.then((response) => { .then((response) => {
successAlert.show("Users updated"); successAlert.show("Users updated");
users = response.data.users; users = response.users;
}) })
.catch((error) => { .catch((error) => {
errorMessage = error.response?.data?.error ?? ""; errorMessage = error.response?.data?.error ?? "";
@@ -60,7 +57,7 @@
} }
</script> </script>
<div class="wrapper-tiny transparent mb-5"> <div class="common-wrapper">
<div class="lx-card mt-5"> <div class="lx-card mt-5">
<h3 class="header-small mb-5">Invite people</h3> <h3 class="header-small mb-5">Invite people</h3>
<ErrorAlert message={errorMessage} /> <ErrorAlert message={errorMessage} />
@@ -68,9 +65,7 @@
<form on:submit={submitInvite}> <form on:submit={submitInvite}>
<div class="mb-3"> <div class="mb-3">
<label for="inviteeName" class="form-label" <label for="inviteeName" class="form-label">Invitee Name</label>
>Invitee Name</label
>
<input <input
type="text" type="text"
bind:value={name} bind:value={name}
@@ -95,14 +90,11 @@
</div> </div>
<div class="me-3"> <div class="me-3">
<select bind:value={role}>
{#each channel.roles.filter((r) => r !== "removed") as arole} {#each channel.roles.filter((r) => r !== "removed") as arole}
<Radio <option value={arole}>{arole}</option>
bind:group={role}
value={arole}
name="role"
label={arole}
/>
{/each} {/each}
</select>
</div> </div>
<div class="mt-5 d-block text-center"> <div class="mt-5 d-block text-center">
@@ -111,8 +103,8 @@
</form> </form>
</div> </div>
<div class="lx-card mt-3"> <div class="member-list">
<h3 class="header-small mb-5">Members</h3> <h3 class="header-small mb-5 mt-5">Members</h3>
{#each users as user} {#each users as user}
<MemberSettingsCard <MemberSettingsCard
member={user} member={user}
@@ -121,7 +113,5 @@
on:reinvite={(e) => invite(e.detail.email, e.detail.role)} on:reinvite={(e) => invite(e.detail.email, e.detail.role)}
/> />
{/each} {/each}
</div> </div>
</div> </div>
+31 -59
View File
@@ -1,15 +1,13 @@
<script> <script>
import { afterUpdate, getContext, onMount } from "svelte"; import { afterUpdate, getContext, onMount } from "svelte";
import {isEqual} from "lodash"; import EditHeader from "./header/EditHeader.svelte";
import Manager from "./Manager.svelte"; import ContentTabs from "./header/ContentTabs.svelte";
import EditHeader from "./EditHeader.svelte" import FormField from "./FormField.svelte";
import StatusSelect from "./StatusSelect.svelte" import Graph from "./Graph.svelte";
import FilePreview from "./FilePreview.svelte" import Info from "./Info.svelte";
import ContentTabs from "./ContentTabs.svelte" import ErrorAlert from "../common/ErrorAlert.svelte";
import FormField from "./FormField.svelte" import Title from "./header/Title.svelte";
import Graph from "./Graph.svelte" import { apiPost, isEqual } from "../../helpers";
import Info from "./Info.svelte"
import ErrorAlert from "../common/ErrorAlert.svelte"
const channel = getContext("channel"); const channel = getContext("channel");
@@ -17,11 +15,11 @@
export let record; export let record;
export let graph = { export let graph = {
records: [], records: [],
edges: [] edges: [],
}; };
export let recordHistory; // export let recordHistory;
export let isCreateMode; export let isCreateMode;
export let isWritable = false; // export let isWritable = false;
export let users; export let users;
let originalContent; let originalContent;
let activeContentTab = ""; let activeContentTab = "";
@@ -33,10 +31,7 @@
} error(s)` } error(s)`
: null; : null;
let activeFields = schema.fields.filter( let activeFields = schema.fields.filter((f) => f.name !== "id");
(f) => f.name !== "id"
);
onMount(() => { onMount(() => {
setOriginalContent(); setOriginalContent();
@@ -45,10 +40,7 @@
function setOriginalContent() { function setOriginalContent() {
originalContent = { originalContent = {
data: JSON.parse(JSON.stringify(record.data)), data: JSON.parse(JSON.stringify(record.data)),
schema: record.schema,
status: record.status, status: record.status,
_sys: JSON.parse(JSON.stringify(record._sys)),
_file: JSON.parse(JSON.stringify(record._file)),
edges: JSON.parse(JSON.stringify(graph.edges)), edges: JSON.parse(JSON.stringify(graph.edges)),
}; };
} }
@@ -79,10 +71,7 @@
} }
return !isEqual(originalContent, { return !isEqual(originalContent, {
data: record.data, data: record.data,
schema: record.schema,
status: record.status, status: record.status,
_sys: record._sys,
_file: record._file,
edges: graph.edges, edges: graph.edges,
}); });
} }
@@ -104,9 +93,10 @@
} }
// remove trashed edges // remove trashed edges
graph.edges = graph.edges?.filter((edge) => !edge._isTrashed && edge.source === record.id); graph.edges = graph.edges?.filter(
axios (edge) => !edge._isTrashed && edge.source === record.id,
.post(channel.lucentUrl + "/records", { );
apiPost(channel.lucentUrl + "/records", {
record: record, record: record,
edges: graph.edges, edges: graph.edges,
isCreateMode: isCreateMode, isCreateMode: isCreateMode,
@@ -115,16 +105,17 @@
console.log("SAVE: SAVED"); console.log("SAVE: SAVED");
if (isCreateMode) { if (isCreateMode) {
window.location = channel.lucentUrl + "/records/" + record.id; window.location =
channel.lucentUrl + "/records/" + record.id;
} else { } else {
record = response.data.records[0] ?? null; record = response.records[0] ?? null;
if (!record) { if (!record) {
// means trashed // means trashed
hasUnsavedData = false; hasUnsavedData = false;
window.location = channel.lucentUrl; window.location = channel.lucentUrl;
return; return;
} }
graph = response.data; graph = response;
setOriginalContent(); setOriginalContent();
} }
@@ -137,7 +128,7 @@
errorMessage = error.response.data.error; errorMessage = error.response.data.error;
} else { } else {
validationErrors = error.response.data.error; validationErrors = error.response.data.error;
console.log(validationErrors) console.log(validationErrors);
} }
} }
resolve(null); resolve(null);
@@ -151,23 +142,12 @@
<svelte:window on:beforeunload={beforeUnload} /> <svelte:window on:beforeunload={beforeUnload} />
<div class="wrapper-normal transparent"> <div class="record-edit">
<Manager managerRecords={recordHistory} {graph}/> <div class="tools-header">
<EditHeader {schema} {record} {isCreateMode} {graph} bind:activeContentTab/> <!-- <Manager managerRecords={recordHistory} {graph}/>-->
<EditHeader {schema} bind:record {isCreateMode} bind:activeContentTab />
{#if !["_graph", "_info"].includes(activeContentTab) && isWritable}
<div class="shadow-lg "
style="position:fixed;bottom:0;left:0px;width:100%;background: rgb(206, 223, 210);z-index:1050"
>
<div
class="d-flex mt-3 mb-3 align-items-center justify-content-center"
>
<StatusSelect bind:status={record.status} {record} {schema}/>
{#if isCreateMode} {#if isCreateMode}
<button <button class="button primary btn-spinner" on:click={save}>
class="ms-2 btn btn-primary btn-spinner"
on:click={save}
>
<span <span
class="spinner-border spinner-border-sm" class="spinner-border spinner-border-sm"
role="status" role="status"
@@ -178,7 +158,7 @@
{:else if hasUnsavedData} {:else if hasUnsavedData}
<button <button
type="button" type="button"
class="ms-2 btn btn-primary btn-spinner" class="button primary ms-2 btn btn-primary btn-spinner"
on:click={save} on:click={save}
> >
<span <span
@@ -190,25 +170,18 @@
</button> </button>
{/if} {/if}
</div> </div>
</div> <Title {schema} {record} {isCreateMode} />
{/if}
<ErrorAlert message={errorMessage} /> <ErrorAlert message={errorMessage} />
<div class=" mt-4" style="margin-bottom:150px"> <div class=" mt-4" style="margin-bottom:150px;position:relative;">
<ContentTabs <ContentTabs {schema} {isCreateMode} bind:active={activeContentTab} />
{schema}
{isCreateMode}
bind:active={activeContentTab}
/>
{#if !["_graph", "_info"].includes(activeContentTab)} {#if !["_graph", "_info"].includes(activeContentTab)}
<FilePreview {record} {schema}/>
<!-- <fieldset disabled="disabled"> -->
{#each activeFields as field (field.name)} {#each activeFields as field (field.name)}
{#if activeContentTab === field.group} {#if activeContentTab === field.group}
<FormField <FormField
bind:data={record.data} bind:data={record.data}
bind:graph={graph} bind:graph
{field} {field}
{schema} {schema}
{record} {record}
@@ -217,7 +190,6 @@
/> />
{/if} {/if}
{/each} {/each}
<!-- </fieldset> -->
{:else if activeContentTab === "_graph"} {:else if activeContentTab === "_graph"}
<Graph {graph} {record} /> <Graph {graph} {record} />
{:else if activeContentTab === "_info"} {:else if activeContentTab === "_info"}
-73
View File
@@ -1,73 +0,0 @@
<script>
import {getContext} from "svelte";
import Icon from "../common/Icon.svelte";
import {previewTitle} from "./Preview";
const channel = getContext("channel");
export let schema;
export let graph;
export let record;
export let isCreateMode;
export let activeContentTab;
function clone(e) {
e.preventDefault();
axios.post(channel.lucentUrl + "/records/clone/" + record.id).then(response => {
window.location = channel.lucentUrl + "/records/" + response.data.id;
}).catch(error => {
});
}
</script>
<h3 class="header-normal mt-5 mb-0">
<a
class="text-muted d-block text-decoration-none fs-6 mb-1"
href="{channel.lucentUrl}/content/{schema.name}"
>{schema.label.toUpperCase()}</a
>
<span class="text-dark d-block">
{#if !isCreateMode}
{previewTitle(channel.schemas, record, graph)}
{:else}
New Record
{/if}
</span>
{#if !isCreateMode}
<div class="dropdown d-inline-block">
<button
class="btn btn-link btn-sm"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
<Icon icon="ellipsis"/>
</button>
<div class="dropdown-menu">
<h6 class="dropdown-header">Record Actions</h6>
<a
class="dropdown-item"
href="{channel.lucentUrl}/records/new?schema={schema.name}"
>Create new</a
>
{#if !isCreateMode}
<a
class="dropdown-item"
on:click={clone}
href={channel.lucentUrl}
>
Clone
</a>
{/if}
<a
on:click|preventDefault={(e) =>
(activeContentTab = "_info")}
class="dropdown-item"
href="{channel.lucentUrl}">Revisions</a
>
</div>
</div>
{/if}
</h3>
+26 -28
View File
@@ -1,55 +1,53 @@
<script> <script>
import Preview from "../files/Preview.svelte"; import Preview from "../files/Preview.svelte";
import {fileurl} from "../files/imageserver" import { fileurl } from "../files/imageserver";
import { getContext } from "svelte";
const channel = getContext("channel");
export let record; export let record;
export let schema; export let schema;
</script> </script>
{#if schema.type === "files"} {#if schema.type === "files"}
<div class="row mb-4"> <div class="record-edit-file-preview">
<div class="col" style="max-width:276px"> <div>
<Preview {record} size="large" /> <Preview {record} size="large" />
</div> </div>
<div class="col"> <div class="file-details">
<ul class="list-group "> <div class="file-details-item">
<li class="list-group-item border-primary">
<span class="text-muted">Filename</span> <span class="text-muted">Filename</span>
<span>{record._file.path}</span> <span>{record._file.path}</span>
</li> </div>
<li class="list-group-item border-primary"> <div class="file-details-item">
<span class="text-muted">Original name</span> <span class="text-muted">Original name</span>
<span>{record._file.originalName}</span> <span>{record._file.originalName}</span>
</li> </div>
<li class="list-group-item border-primary"> <div class="file-details-item">
<span class="text-muted">Mime type</span> <span class="text-muted">Mime type</span>
<span>{record._file.mime}</span> <span>{record._file.mime}</span>
</li> </div>
{#if record._file.width} {#if record._file.width}
<li class="list-group-item border-primary"> <div class="file-details-item">
<span class="text-muted">Dimensions</span> <span class="text-muted">Dimensions</span>
<span>{record._file.width}x{record._file.height}</span> <span>{record._file.width}x{record._file.height}</span>
</li> </div>
{/if} {/if}
<li class="list-group-item border-primary"> <div class="file-details-item">
<span class="text-muted">File size</span> <span class="text-muted">File size</span>
<span>{(record._file.size / 1024).toFixed(1)}kB</span> <span>{(record._file.size / 1024).toFixed(1)}kB</span>
</li> </div>
<li class="list-group-item border-primary"> <div class="file-details-item">
<span class="text-muted">Checksum</span> <span class="text-muted">Checksum</span>
<span>{record._file.checksum}</span> <span>{record._file.checksum}</span>
</li> </div>
<li class="list-group-item border-primary"> <div class="file-details-item">
<span class="text-muted">Download</span> <a
<a href="{fileurl(record)}">{record._file.path}</a> class="button primary"
</li> target="_blank"
</ul> style="display: inline-flex"
href={fileurl(channel, record)}>Download</a
>
</div>
</div> </div>
</div> </div>
{/if} {/if}
<style>
.list-group {
font-size: 14px;
}
</style>
+27 -39
View File
@@ -2,8 +2,6 @@
import Text from "./elements/Text.svelte"; import Text from "./elements/Text.svelte";
import Slug from "./elements/Slug.svelte"; import Slug from "./elements/Slug.svelte";
import Reference from "./elements/Reference.svelte"; import Reference from "./elements/Reference.svelte";
import ReferenceInline from "./elements/ReferenceInline.svelte";
import Block from "./block/Block.svelte";
import Color from "./elements/Color.svelte"; import Color from "./elements/Color.svelte";
import Checkbox from "./elements/Checkbox.svelte"; import Checkbox from "./elements/Checkbox.svelte";
import Number from "./elements/Number.svelte"; import Number from "./elements/Number.svelte";
@@ -17,7 +15,6 @@
import Json from "./elements/JSON.svelte"; import Json from "./elements/JSON.svelte";
import Markdown from "./elements/Markdown.svelte"; import Markdown from "./elements/Markdown.svelte";
import FieldHeader from "./elements/FieldHeader.svelte"; import FieldHeader from "./elements/FieldHeader.svelte";
import ReferenceTable from "./elements/ReferenceTable.svelte";
import ReferenceTags from "./elements/ReferenceTags.svelte"; import ReferenceTags from "./elements/ReferenceTags.svelte";
const formElements = { const formElements = {
@@ -47,44 +44,15 @@
const id = `field-${field.name}-${record.id}`; const id = `field-${field.name}-${record.id}`;
</script> </script>
<div class="card editor-field"> <div class="editor-field">
<FieldHeader {schema} {field} {id}/> <FieldHeader {field} {id} />
{#if field.info.name === "reference" && field.layout === "inline"} {#if field.info.name === "reference" && field.layout === "tags"}
<ReferenceInline <ReferenceTags bind:graph {id} {record} {field} {validationErrors} />
bind:graph
{record}
{field}
{validationErrors}
/>
{:else if field.info.name === "reference" && field.layout === "table"}
<ReferenceTable
bind:graph
{id}
{record}
{field}
{validationErrors}
/>
{:else if field.info.name === "reference" && field.layout === "tags"}
<ReferenceTags
bind:graph
{id}
{record}
{field}
{validationErrors}
/>
{:else if field.info.name === "reference"} {:else if field.info.name === "reference"}
<Reference <Reference bind:graph {id} {record} {field} {validationErrors} />
bind:graph
{id}
{record}
{field}
{validationErrors}
/>
{:else if field.info.name === "file"} {:else if field.info.name === "file"}
<File bind:graph {record} {field} {validationErrors}/> <!-- <File bind:graph {record} {field} {validationErrors} /> -->
{:else if field.info.name === "block"} <File
<Block
bind:graph
bind:value={data[field.name]} bind:value={data[field.name]}
{record} {record}
{id} {id}
@@ -115,6 +83,26 @@
{isCreateMode} {isCreateMode}
{id} {id}
/> />
{:else if field.info.name === "rich"}
<RichEditor
bind:value={data[field.name]}
{schema}
{field}
{validationErrors}
{isCreateMode}
bind:graph
{record}
/>
{:else if field.info.name === "markdown"}
<Markdown
bind:value={data[field.name]}
{schema}
{field}
{validationErrors}
{isCreateMode}
bind:graph
{record}
/>
{:else} {:else}
<svelte:component <svelte:component
this={formElement} this={formElement}
+22 -114
View File
@@ -1,15 +1,9 @@
<script> <script>
import PreviewCardSmall from "./PreviewCardSmall.svelte";
import PreviewCard from "./PreviewCard.svelte";
import Icon from "../common/Icon.svelte";
import Preview from "../files/Preview.svelte";
import {getContext} from "svelte"; import {getContext} from "svelte";
import {uniqBy} from "lodash"; import PreviewReference from "./previews/PreviewReference.svelte";
const channel = getContext("channel"); const channel = getContext("channel");
export let graph; export let graph;
export let record;
function findEdgeField(schema, edgeField){ function findEdgeField(schema, edgeField){
if(edgeField.includes(":")){ if(edgeField.includes(":")){
let edgeFieldAr = edgeField.split(":"); let edgeFieldAr = edgeField.split(":");
@@ -18,121 +12,35 @@
return schema.fields.find((f) => f.name === edgeField); return schema.fields.find((f) => f.name === edgeField);
} }
let parentEdgesByField = graph.parentEdges let backlinks = graph.parentEdges.map(edge => {
.filter((edge) => edge.source !== record.id && edge.depth === 1)
.reduce((carry, edge) => {
let schema = channel.schemas.find((s) => s.name === edge.sourceSchema); let schema = channel.schemas.find((s) => s.name === edge.sourceSchema);
let edgeField = findEdgeField(schema,edge.field); let edgeField = findEdgeField(schema,edge.field);
let schemaField = edge.sourceSchema + edgeField; if(!edgeField){
return null;
let arecord = graph.records.find((n) => {
return n.id === edge.source;
});
if (!carry[schemaField]) {
carry[schemaField] = {
field: edgeField,
schema: schema,
nodes: [],
};
} }
if (arecord) { return {
carry[schemaField].nodes.push(arecord); field: edgeField.label,
carry[schemaField].nodes = uniqBy(carry[schemaField].nodes,"id"); record: graph.records.find( record => record.id === edge.source)
} }
return carry; }).filter( edgeOrNull => !!edgeOrNull)
}, {});
let childrenEdgesByField = graph.edges
.filter((edge) => edge.source === record.id && edge.depth === 1)
.reduce((carry, edge) => {
let schema = channel.schemas.find((s) => s.name === record.schema);
let edgeField = findEdgeField(schema,edge.field);
// let schemaField = edge.targetSchema + edgeField;
let schemaField = edgeField.name + edge.targetSchema;
if (!carry[schemaField]) {
carry[schemaField] = {
field: edgeField,
nodes: [],
};
}
let arecord = graph.records.find((n) => {
return n.id === edge.target;
});
if (arecord) {
carry[schemaField].nodes.push(arecord);
carry[schemaField].nodes = uniqBy(carry[schemaField].nodes,"id");
}
return carry;
}, {});
</script> </script>
<div class="editor-field">
{#each backlinks as backlink}
<div style="margin: 0 0 15px;position: relative;">
<span style="
font-size: 14px;
margin-bottom: 5px;
display: block;
{#each Object.entries(parentEdgesByField) as [fieldName, fieldData]} "
<div class="lx-card mt-3"> >In <i>{backlink.field}</i> of</span>
<div class="text-center mb-3 d-flex justify-content-center align-items-center text-uppercase "> <PreviewReference
<span>{fieldData.schema.label}</span> record={backlink.record}
<Icon icon="angle-right" width="12" height="12"/> hasDelete={false}
<span>{fieldData.field.label}</span> {graph}
</div>
<div class="d-flex justify-content-center text-center flex-wrap">
{#each fieldData.nodes as node}
{#if node._file?.path}
<div class="ms-2 mb-2" style="max-height:64px;">
<Preview record={node} size="small"/>
</div>
{:else}
<div class="ms-2 mb-2">
<PreviewCardSmall {graph} record={node}/>
</div>
{/if}
{/each}
</div>
<!-- <div class="text-center mt-3 d-block">{fieldData.field.label}</div>-->
</div>
{/each}
{#if Object.entries(parentEdgesByField).length > 0}
<div class="text-center my-4">
<Icon icon="angles-down" width="32" height="32"/>
</div>
{/if}
<div style="max-width:400px;margin:0 auto;">
<PreviewCard {graph} record={record}/>
</div>
{#if Object.entries(childrenEdgesByField).length > 0}
<div class="text-center my-4">
<Icon icon="angles-down" width="32" height="32"/>
</div>
{/if}
{#each Object.entries(childrenEdgesByField) as [fieldName, fieldData]}
<div class="lx-card mt-3">
<div class="text-center mb-5 d-block">{fieldData.field.label}</div>
<div class="d-flex justify-content-center text-center flex-wrap">
{#each fieldData.nodes as node}
{#if fieldData.field.info.ui === "file"}
<div
class="ms-2 mb-2"
style="max-width:64px;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;"
>
<Preview
record={node}
size="small"
showFilename={true}
/> />
</div> </div>
{:else} {:else}
<div class="ms-2 mb-2"> Nothing links to this record
<PreviewCardSmall {graph} record={node}/>
</div>
{/if}
{/each} {/each}
</div> </div>
</div>
{/each}
<style>
</style>
+47 -79
View File
@@ -1,8 +1,8 @@
<script> <script>
import {friendlyDate} from "../../helpers"; import { friendlyDate, isEqual } from "../../helpers";
import Avatar from "../account/Avatar.svelte"; import Avatar from "../account/Avatar.svelte";
import { usernameById } from "../account/users"; import { usernameById } from "../account/users";
import {isEqual, sortBy} from "lodash";
import Icon from "../common/Icon.svelte"; import Icon from "../common/Icon.svelte";
import RevisionCell from "./revisions/RevisionCell.svelte"; import RevisionCell from "./revisions/RevisionCell.svelte";
import { getContext } from "svelte"; import { getContext } from "svelte";
@@ -30,27 +30,27 @@
}); });
function getEdgesByField(fieldsWithDiff, revision) { function getEdgesByField(fieldsWithDiff, revision) {
edgeFieldsDiff = graph.edges
edgeFieldsDiff = graph.edges.filter((e) => e.depth === 1).reduce((c, e) => { .filter((e) => e.depth === 1)
.reduce((c, e) => {
if (!c[e.field]) { if (!c[e.field]) {
c[e.field] = { c[e.field] = {
record: [], record: [],
revision: [], revision: [],
};
} }
} c[e.field]["record"].push(e);
c[e.field]["record"].push(e)
return c; return c;
}, {}); }, {});
edgeFieldsDiff = revision._edges.reduce((c, e) => { edgeFieldsDiff = revision._edges.reduce((c, e) => {
if (!c[e.field]) { if (!c[e.field]) {
c[e.field] = { c[e.field] = {
record: [], record: [],
revision: [], revision: [],
};
} }
} c[e.field]["revision"].push(e);
c[e.field]["revision"].push(e)
return c; return c;
}, edgeFieldsDiff); }, edgeFieldsDiff);
} }
@@ -62,7 +62,7 @@
fieldsWithDiff = schema.fields.filter((f) => { fieldsWithDiff = schema.fields.filter((f) => {
return !isEqual(selectedRevision.data[f.name], record.data[f.name]); return !isEqual(selectedRevision.data[f.name], record.data[f.name]);
}); });
getEdgesByField(fieldsWithDiff, revision) getEdgesByField(fieldsWithDiff, revision);
revisionSection.scrollIntoView(); revisionSection.scrollIntoView();
} }
@@ -71,7 +71,7 @@
rollbackError = ""; rollbackError = "";
axios axios
.post( .post(
`${channel.lucentUrl}/records/${record.id}/rollback/${selectedRevision._sys.version}` `${channel.lucentUrl}/records/${record.id}/rollback/${selectedRevision.version}`,
) )
.then((response) => { .then((response) => {
window.location.reload(); window.location.reload();
@@ -93,29 +93,27 @@
</div> </div>
<div> <div>
<span class="label text-end text-muted">current version </span> <span class="label text-end text-muted">current version </span>
{record._sys.version} {record.version}
</div> </div>
<div> <div>
<span class="label text-end text-muted"> created </span> <span class="label text-end text-muted"> created </span>
<Avatar <Avatar
name={usernameById(users, record._sys.createdBy)} name={usernameById(users, record.createdBy)}
side={24} side={24}
/> />
{friendlyDate(record._sys.createdAt)} {friendlyDate(record.createdAt)}
</div> </div>
<div> <div>
<span class="label text-end text-muted">updated </span> <span class="label text-end text-muted">updated </span>
<Avatar <Avatar
name={usernameById(users, record._sys.updatedBy)} name={usernameById(users, record.updatedBy)}
side={24} side={24}
/> />
{friendlyDate(record._sys.updatedAt)} {friendlyDate(record.updatedAt)}
</div> </div>
</div> </div>
<div class="col-4"> <div class="col-4">
<span class="label d-block text-muted " <span class="label d-block text-muted">Rules for this schema </span>
>Rules for this schema
</span>
<small> <small>
Each record maintains the last {schema.revisions} Each record maintains the last {schema.revisions}
versions versions
@@ -123,35 +121,33 @@
</div> </div>
</div> </div>
</div> </div>
<div class="lx-card mt-4"> <div class="revisions">
{#if schema.revisions > 0} {#if schema.revisions > 0}
<div class="header-small mb-3">Revisions</div> <div class="header-small mb-3">Revisions</div>
{#each revisions as revision} {#each revisions as revision}
{#if revision._sys.version != record._sys.version} {#if revision.version !== record.version}
<div <div
class="row p-2 rounded" class="revision"
class:active={revision._sys.version === class:active={revision.version ===
selectedRevision?._sys.version} selectedRevision?.version}
> >
<div class="version">
<div class="col-2">version {revision._sys.version}</div> <span>version {revision.version}</span>
<div class="col-5">
<Avatar <Avatar
name={usernameById(users, revision._sys.updatedBy)} name={usernameById(users, revision.updatedBy)}
side={24} side={24}
/> />
{friendlyDate(revision._sys.updatedAt)} {friendlyDate(revision.updatedAt)}
</div> </div>
<div class="col-3 text-center"> <div class="col-3 text-center">
<button <button
disabled={revision._sys.version === disabled={revision.version ===
selectedRevision?._sys.version} selectedRevision?.version}
class="btn btn-sm btn-outline-primary" class="button"
on:click={(e) => compare(e, revision)} on:click={(e) => compare(e, revision)}
>Compare >Compare
</button </button>
>
</div> </div>
</div> </div>
{/if} {/if}
@@ -164,20 +160,18 @@
</div> </div>
<div bind:this={revisionSection}> <div bind:this={revisionSection}>
{#if selectedRevision} {#if selectedRevision}
<div class="mt-4"> <div class="selected-revision">
{#if fieldsWithDiff.length > 0} {#if fieldsWithDiff.length > 0}
<p class="text-center fw-bold mb-3 mt-5"> <p class="text-center fw-bold mb-3 mt-5">
If you choose to rollback to this revision If you choose to rollback to this revision
</p> </p>
<button <button on:click={rollback} class="button">
on:click={rollback} Rollback to version {selectedRevision.version}
class="btn btn-primary mb-5 d-block mx-auto"
>
Rollback to version {selectedRevision._sys.version}
</button> </button>
{#if rollbackError} {#if rollbackError}
<span class="d-block text-danger mt-3">{rollbackError}</span> <span class="d-block text-danger mt-3">{rollbackError}</span
>
{/if} {/if}
<div class="mt-3"> <div class="mt-3">
{#each fieldsWithDiff as field} {#each fieldsWithDiff as field}
@@ -188,21 +182,15 @@
<!-- <div class="d-block" style="width:200px;"> <!-- <div class="d-block" style="width:200px;">
{field.label} {field.label}
</div> --> </div> -->
<div <div class="revision-field" style="overflow:hidden">
class="lx-card row p-4 mb-4 w-100" <div class="compare-left">
style="overflow:hidden"
>
<div class="col-5">
<RevisionCell <RevisionCell
{field} {field}
side={record.data[field.name]} side={record.data[field.name]}
colorClass="text-danger" colorClass="text-danger"
/> />
</div> </div>
<div class="col-2"> <div class="compare-center">
<div
class="h-100 d-flex align-items-center justify-content-center text-secondary"
>
<span class="me-1">{field.label}</span> <span class="me-1">{field.label}</span>
<Icon <Icon
icon="angle-right" icon="angle-right"
@@ -210,8 +198,7 @@
height="12" height="12"
/> />
</div> </div>
</div> <div class="compare-right">
<div class="col-5">
<RevisionCell <RevisionCell
edges={selectedRevision._edges} edges={selectedRevision._edges}
{field} {field}
@@ -230,25 +217,22 @@
{/if} {/if}
<div class="mt-3"> <div class="mt-3">
<p class="text-center fw-bold mb-3 mt-5"> <p class="text-center fw-bold mb-3 mt-5">Record References</p>
Record References
</p>
{#each Object.entries(edgeFieldsDiff) as [field, edges]} {#each Object.entries(edgeFieldsDiff) as [field, edges]}
<div <div class="revision-references" style="overflow:hidden">
class="lx-card row p-4 mb-4 w-100" <div class="reference-field">
style="overflow:hidden"
>
<div class="col-4">
{field}: {field}:
</div> </div>
<div class="col-8"> <div class="reference-compare">
<p class="mb-2 text-danger">Record</p> <p class="">Record</p>
{#each edges.record as edge} {#each edges.record as edge}
<RevisionEdgeRow {edge} /> <RevisionEdgeRow {edge} />
{:else} {:else}
<p>No references</p> <p>No references</p>
{/each} {/each}
<p class="mt-4 mb-2 text-success">Revision</p> </div>
<div class="reference-compare">
<p class="text-success">Revision</p>
{#each edges.revision as edge} {#each edges.revision as edge}
<RevisionEdgeRow {edge} /> <RevisionEdgeRow {edge} />
{:else} {:else}
@@ -259,21 +243,5 @@
{/each} {/each}
</div> </div>
</div> </div>
{/if} {/if}
</div> </div>
<style>
.label {
width: 180px;
margin-right: 10px;
margin-bottom: 4px;
display: inline-block;
}
.active {
background-color: #eee;
border: 1px solid #ccc;
}
</style>
+49 -74
View File
@@ -1,12 +1,18 @@
<script> <script>
import {afterUpdate, createEventDispatcher, onMount,getContext} from "svelte"; import {
afterUpdate,
createEventDispatcher,
getContext,
onMount,
} from "svelte";
import {isEqual} from "lodash";
import FormField from "./FormField.svelte"; import FormField from "./FormField.svelte";
import FilePreview from "./FilePreview.svelte"; import FilePreview from "./FilePreview.svelte";
import ContentTabs from "./ContentTabs.svelte"; import ContentTabs from "./header/ContentTabs.svelte";
import StatusSelect from "./StatusSelect.svelte";
import ErrorAlert from "../common/ErrorAlert.svelte"; import ErrorAlert from "../common/ErrorAlert.svelte";
import EditHeader from "./header/EditHeader.svelte";
import Title from "./header/Title.svelte";
import { apiPost, isEqual } from "../../helpers";
const channel = getContext("channel"); const channel = getContext("channel");
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
@@ -14,7 +20,7 @@
export let record; export let record;
export let graph = { export let graph = {
records: [], records: [],
edges: [] edges: [],
}; };
export let isCreateMode; export let isCreateMode;
let originalContent; let originalContent;
@@ -27,9 +33,7 @@
} error(s)` } error(s)`
: null; : null;
let activeFields = schema.fields.filter( let activeFields = schema.fields.filter((f) => f.name !== "id");
(f) => f.name !== "id"
);
let tabname = "_default"; let tabname = "_default";
let fieldToTabs = schema.fields.reduce((c, f) => { let fieldToTabs = schema.fields.reduce((c, f) => {
@@ -51,8 +55,6 @@
data: JSON.parse(JSON.stringify(record.data)), data: JSON.parse(JSON.stringify(record.data)),
schema: record.schema, schema: record.schema,
status: record.status, status: record.status,
_sys: JSON.parse(JSON.stringify(record._sys)),
_file: JSON.parse(JSON.stringify(record._file)),
edges: JSON.parse(JSON.stringify(graph.edges)), edges: JSON.parse(JSON.stringify(graph.edges)),
}; };
} }
@@ -85,8 +87,6 @@
data: record.data, data: record.data,
schema: record.schema, schema: record.schema,
status: record.status, status: record.status,
_sys: record._sys,
_file: record._file,
edges: graph.edges, edges: graph.edges,
}); });
} }
@@ -112,11 +112,12 @@
return; return;
} }
// remove trashed edges // remove trashed edges
graph.edges = graph.edges?.filter((edge) => !edge._isTrashed && edge.source === record.id) ?? []; graph.edges =
graph.edges?.filter(
(edge) => !edge._isTrashed && edge.source === record.id,
) ?? [];
apiPost(channel.lucentUrl + "/records", {
axios
.post(channel.lucentUrl + "/records", {
record: record, record: record,
edges: graph.edges, edges: graph.edges,
isCreateMode: isCreateMode, isCreateMode: isCreateMode,
@@ -124,8 +125,8 @@
.then(function (response) { .then(function (response) {
console.log("SAVE: SAVED INLINE"); console.log("SAVE: SAVED INLINE");
record = response.data.records[0]; record = response.records[0];
graph = response.data; graph = response;
if (!isCreateMode) { if (!isCreateMode) {
setOriginalContent(); setOriginalContent();
} }
@@ -135,7 +136,6 @@
resolve(null); resolve(null);
}) })
.catch(function (error) { .catch(function (error) {
// setOriginalContent();
if (error.response) { if (error.response) {
if (typeof error.response.data.error === "string") { if (typeof error.response.data.error === "string") {
errorMessage = error.response.data.error; errorMessage = error.response.data.error;
@@ -144,9 +144,6 @@
} }
} }
resolve(null); resolve(null);
// msgSuccess = null;
// msgError = error.response.data.error;
// submitted = false;
}); });
}); });
} }
@@ -154,54 +151,22 @@
<svelte:window on:beforeunload={beforeUnload} /> <svelte:window on:beforeunload={beforeUnload} />
<div class="inline-edit my-4"> <div class="inline-edit record-edit">
<ErrorAlert message={errorMessage}/> <div class="tools-header">
<EditHeader {schema} bind:record {isCreateMode} bind:activeContentTab />
<div class=" mt-1">
<ContentTabs
{schema}
{isCreateMode}
bind:active={activeContentTab}
{record}
/>
<FilePreview {record} {schema}/>
<!-- <fieldset disabled="disabled"> -->
{#each activeFields as field (field.name)}
{#if activeContentTab === field.group}
<FormField
bind:data={record.data}
bind:graph={graph}
{field}
{schema}
{record}
{validationErrors}
{isCreateMode}
/>
{/if}
{/each}
<!-- </fieldset> -->
</div>
<div>
<div class="d-flex mt-3 align-items-center justify-content-center">
{#if schema.hasDrafts}
<StatusSelect bind:status={record.status} {schema}/>
{/if}
{#if isCreateMode} {#if isCreateMode}
<button <button class="button primary btn-spinner" on:click={save}>
class="ms-2 btn btn-primary btn-spinner"
on:click={save}
>
<span <span
class="spinner-border spinner-border-sm" class="spinner-border spinner-border-sm"
role="status" role="status"
aria-hidden="true" aria-hidden="true"
/> />
Add Create
</button> </button>
{:else} {:else if hasUnsavedData}
<button <button
disabled={!hasUnsavedData} type="button"
class="ms-2 btn btn-primary btn-spinner" class="button primary ms-2 btn btn-primary btn-spinner"
on:click={save} on:click={save}
> >
<span <span
@@ -212,17 +177,27 @@
Save Save
</button> </button>
{/if} {/if}
<button class="ms-2 btn btn-link" on:click={cancel}>
cancel
</button>
</div>
</div>
</div> </div>
<Title {schema} {record} {isCreateMode} />
<ErrorAlert message={errorMessage} />
<style> <div class=" mt-4" style="margin-bottom:150px;position:relative;">
.inline-edit { <ContentTabs {schema} {isCreateMode} bind:active={activeContentTab} />
padding: 44px; <FilePreview {record} {schema} />
background-color: #eee; <!-- <fieldset disabled="disabled"> -->
border-radius: 32px; {#each activeFields as field (field.name)}
} {#if activeContentTab === field.group}
</style> <FormField
bind:data={record.data}
bind:graph
{field}
{schema}
{record}
{validationErrors}
{isCreateMode}
/>
{/if}
{/each}
<!-- </fieldset> -->
</div>
</div>
-34
View File
@@ -1,34 +0,0 @@
<script>
import Icon from "../common/Icon.svelte";
import PreviewCardSmall from "./PreviewCardSmall.svelte";
export let managerRecords;
export let graph;
</script>
{#if managerRecords.length > 0}
<div
class="record-history d-flex justify-content-center align-items-center w-100 mb-4 mt-4"
>
{#each managerRecords.reverse() as arecord, i}
{#if i !== 0}
<Icon icon="angle-right"/>
{/if}
<div class="mx-3 p-0 my-0">
<PreviewCardSmall record={arecord} {graph}/>
</div>
{/each}
</div>
{/if}
<style>
.record-history {
/* background-color: #fff; */
padding: 15px 10px;
border-radius: 32px;
line-height: 12px;
}
</style>
-51
View File
@@ -1,51 +0,0 @@
import Mustache from "mustache";
import {stripHtml} from "../../helpers";
export function previewTitle(schemas, record, graph) {
let schema = schemas.find((aSchema) => aSchema.name === record?.schema);
if (!schema?.titleTemplate) {
return noTemplate(schema, record);
}
let recordData = record.data;
let template = Mustache.parse(schema.titleTemplate);
let referencePreviews = template
.filter(segment => segment[0] === "name") // keep only template tags
.map((segment) => segment[1]) // map to fieldNames
.filter(fieldName => { // keep only references
let schemaField = schema.fields.find(f => f.name === fieldName)
return schemaField?.info.name === "reference";
}).reduce((carry, field) => { // map to records
let edge = graph.edges.find(edge => edge.source === record.id && edge.field === field)
let referenceRecord = graph.records.find(rec => rec.id === edge?.target)
carry[field] = previewTitle(schemas, referenceRecord, graph);
return carry;
}, {});
recordData = {...recordData, ...referencePreviews}
let render = Mustache.render(schema.titleTemplate, recordData);
if (!render || render === "") {
return noTemplate(schema, record);
}
return stripHtml(render.slice(0, 300));
}
function noTemplate(schema, record) {
if (schema?.type === "files") {
return record._file.path;
}
let title = stripHtml(
record?.data[schema.fields.filter((f) => f.info.name === "text")[0]?.name]
).slice(0, 300);
if(title == ""){
return "Untitled";
}
return title;
}
@@ -1,78 +0,0 @@
<script>
import Icon from "../common/Icon.svelte";
import { getContext, createEventDispatcher } from "svelte";
import Preview from "../files/Preview.svelte";
import { previewTitle } from "./Preview";
import Status from "./Status.svelte";
const dispatch = createEventDispatcher();
const channel = getContext("channel");
export let graph;
export let record;
export let classes = "";
export let hasDelete = false;
let schema = channel.schemas.find((aschema) => aschema.name === record.schema);
let cardTitle = previewTitle(channel.schemas, record, graph);
function remove(e) {
e.preventDefault();
dispatch("remove", record.id);
}
</script>
<div
class="card mb-2 bg-light {classes}"
style="border-color:{schema.color ?? '#ccc'}; border-width: 1px;"
>
<div class="card-body d-flex">
{#if schema.type === "files"}
<div style="max-width:94px;margin-right:15px">
<Preview {record} size="small" />
</div>
{/if}
<div class="overflow-hidden">
<a
class="title-link m-0 fs-5 text-decoration-none text-dark d-block"
href="{channel.lucentUrl}/records/{record.id}"
title={cardTitle}
>
{cardTitle}
</a>
<small class="text-muted">
{schema.label}
</small>
<small class="text-muted">
{#if record.status === "draft"}
<Status status={record.status} />
{/if}
</small>
</div>
</div>
{#if hasDelete}
<div class="position-absolute end-0" style="top:5px">
<button
class="trash-button text-dark btn btn-sm btn-link"
on:click={remove}
><Icon icon="trash-can" />
</button>
</div>
{/if}
</div>
<style>
.card .trash-button {
display: none;
}
.card:hover .trash-button {
display: block;
}
.title-link {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
@@ -1,230 +0,0 @@
<script>
import Icon from "../common/Icon.svelte";
import {createEventDispatcher, onMount, getContext} from "svelte";
import Preview from "../files/Preview.svelte";
import InlineEdit from "./InlineEdit.svelte";
import Reference from "../content/elements/Reference.svelte";
import File from "../content/elements/File.svelte";
const channel = getContext("channel");
const dispatch = createEventDispatcher();
export let isFirst;
export let isLast;
export let toDelete = false;
export let record;
let editRecord;
let editGraph;
let schema = channel.schemas.find((aschema) => aschema.name === record.schema);
$: editMode = false;
$: expanded = false;
function editInline(e) {
e.preventDefault();
axios
.get(channel.lucentUrl + "/records/editInline/" + record.id)
.then((response) => {
record = response.data;
editRecord = response.data.record;
editGraph = response.data.graph;
editMode = true;
})
.catch((error) => {
console.log(error);
});
}
function moveup(e) {
e.preventDefault();
dispatch("moveup");
}
function movedn(e) {
e.preventDefault();
dispatch("movedn");
}
function handleInlinesaved(e) {
e.preventDefault();
dispatch("inlinesaved", e.detail);
editMode = false;
}
function remove(e) {
e.preventDefault();
dispatch("remove", record.id);
}
function trash(e) {
e.preventDefault();
dispatch("trash", record.id);
}
function undo(e) {
e.preventDefault();
dispatch("undoremove", record.id);
}
function cancel(e) {
e.preventDefault();
editMode = false;
}
onMount(() => {
editMode = false;
});
function deleteFromChannel(e) {
e.preventDefault();
axios
.post(channel.lucentUrl +"/records/status/trashed", [record])
.then((response) => {
dispatch("remove", record.id);
})
.catch((error) => {
console.log(error);
});
}
</script>
<div>
{#if toDelete}
<div class="lx-card bg-danger bg-opacity-10 text-center">
<p>Item was removed from the current record.</p>
<p>
<button
class="btn btn-sm btn-outline border border-1 border-dark"
on:click={undo}>Undo
</button
>
<button
class="btn btn-sm btn-danger "
on:click={deleteFromChannel}
>Delete completely from channel
</button
>
</p>
<button class="btn btn-sm btn-link" on:click={remove}
>Dismiss Message
</button
>
</div>
{:else if editMode === true}
<InlineEdit
{schema}
record={editRecord}
graph={editGraph}
isCreateMode={false}
on:cancel={cancel}
on:inlinesaved={handleInlinesaved}
/>
{:else}
<div class="lx-card mt-4 bg-primary bg-opacity-10">
<div class="actions">
<small class="text-muted">{schema.label}</small>
<button
class="btn btn-sm btn-link"
on:click|preventDefault={editInline}
>
<Icon icon="pencil" width={12} height={12}/>
</button>
<button
class="btn btn-sm btn-link"
on:click={(e) => (expanded = !expanded)}
>
{#if expanded}
<Icon icon="compress" width={12} height={12}/>
{:else}
<Icon icon="expand" width={12} height={12}/>
{/if}
</button>
<div class="dropdown d-inline-block">
<button
class="btn btn-link btn-sm"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
<Icon icon="ellipsis"/>
</button>
<div class="dropdown-menu">
<a
class="dropdown-item"
href="/records/{record.id}"
target="_blank"
>Edit in new tab
</a>
<button class="dropdown-item" on:click={trash}>
Remove
</button>
<div class="text-center mt-3">
<!-- <a class="dropdown-item" href="#">Clone</a> -->
{#if !isFirst}
<button
class="btn btn-sm btn-outline-primary border-0"
on:click|preventDefault={moveup}
>
<Icon icon="circle-chevron-up"/>
</button>
{/if}
{#if !isLast}
<button
class="btn btn-sm btn-outline-primary border-0"
on:click|preventDefault={movedn}
>
<Icon icon="circle-chevron-down"/>
</button>
{/if}
</div>
</div>
</div>
</div>
<div class="inline-preview" class:expanded>
{#if schema.type === "files"}
<Preview {record} size="small"/>
{/if}
{#each schema.fields.filter((f) => !(f.trashed || ["tab"].includes(f.ui) || ["id"].includes(f.name))) as field}
<span class="text-muted d-block mt-2" style="font-size:13px"
>{field.label}</span
>
{#if field.ui === "reference"}
<Reference {record} {field}/>
{:else if field.ui === "file"}
<File {record} {field}/>
{:else}
{@html record.data[field.name]}
{/if}
{/each}
</div>
</div>
{/if}
</div>
<style>
.lx-card {
position: relative;
}
.lx-card .inline-preview {
max-height: 120px;
overflow: hidden;
}
.lx-card .inline-preview.expanded {
max-height: none;
}
.lx-card .actions {
top: 10px;
right: 44px;
position: absolute;
/* visibility: hidden; */
}
/* .lx-card:hover .actions {
visibility: visible;
} */
</style>
@@ -1,24 +1,13 @@
<script> <script>
import {previewTitle} from "./Preview";
import { getContext } from "svelte"; import { getContext } from "svelte";
const channel = getContext("channel"); const channel = getContext("channel");
export let record; export let record;
export let graph; $: title = record.data.name;
$: schema = channel.schemas.find((aschema) => aschema.name === record.schema);
$: title = previewTitle(channel.schemas, record, graph);
</script> </script>
{#if record?.data} {#if record?.data}
<a <a href="{channel.lucentUrl}/records/{record.id}" {title} class="reference">
href="{channel.lucentUrl}/records/{record.id}"
class="text-decoration-none rounded py-1 px-2 d-inline-block"
{title}
style="border:2px solid {!schema.color
? '#999'
: schema.color}!important;white-space: nowrap;"
>
{title} {title}
</a> </a>
{/if} {/if}
@@ -1,57 +0,0 @@
<script>
import {getContext} from "svelte";
import {getStatus, getStatusList} from "./StatusText";
const channel = getContext("channel");
export let status = "draft";
export let record;
export let schema;
let dropdown;
$: currentStatus = getStatus(status);
const statusList = Object.values(getStatusList());
function updateStatus(e, statusValue) {
// e.preventDefault();
status = statusValue;
dropdown.click();
}
</script>
<!-- Example split danger button -->
<div class="d-flex justify-content-between">
<div class="btn-group dropup">
<button type="button" class="btn btn-{currentStatus.bg}"
>{currentStatus.text}</button
>
<button
bind:this={dropdown}
type="button"
class="btn btn-{currentStatus.bg} dropdown-toggle dropdown-toggle-split"
data-bs-toggle="dropdown"
aria-expanded="false"
>
<span class="visually-hidden">Toggle Dropdown</span>
</button>
<div class="dropdown-menu">
<div class="dropdown-header">Change status to</div>
{#each statusList as astatus}
{#if astatus.value !== status}
<button
type="button"
class="dropdown-item my-2 rounded w-100 bg-{astatus.bg} text-{astatus.color}"
on:click={(e) => updateStatus(e, astatus.value)}
>
{astatus.text}
</button>
{/if}
{/each}
</div>
</div>
{#if channel.previewTarget}
<a href="{channel.previewTargetUrl}?schema={schema.name}&id={record.id}" target="_blank" class="btn btn-info ms-3">
Preview
</a>
{/if}
</div>
@@ -1,37 +0,0 @@
<script>
import BlockButtons from "./BlockButtons.svelte";
import BlockElements from "./BlockElements.svelte";
import {flip} from "svelte/animate";
import {quintOut} from 'svelte/easing';
import {getContext} from "svelte";
const channel = getContext("channel");
export let record;
export let field;
export let value = [];
export let graph;
let blockSchema = channel.schemas.find((s) => s.name === field.schema);
</script>
<div class=" ">
<div class="inline-card-wrapper">
<BlockButtons
bind:blockData={value}
{blockSchema}
/>
</div>
{#each value as blockItemData (blockItemData.id)}
<div class="block-field-wrapper" animate:flip="{{delay: 250, duration: 250, easing: quintOut}}">
<BlockElements
bind:block={blockItemData}
bind:blockData={value}
{record}
{field}
bind:graph
/>
</div>
{/each}
</div>
@@ -1,61 +0,0 @@
<script>
import Icon from "../../common/Icon.svelte";
import {insertBlock} from "./block";
export let blockId = "";
export let blockData;
export let blockSchema;
$: showOptions = false;
function createBlock(e, ui) {
e.preventDefault();
blockData = insertBlock(blockData,ui);
showOptions = false;
}
</script>
<div class="d-flex justify-content-left mb-2 ">
<button
type="button"
class:is-first={!blockId}
class=" btn btn-lg btn-link text-decoration-none block-buttons"
on:click|preventDefault={(e) => (showOptions = !showOptions)}
>
<Icon width={24} height={24} icon="circle-plus"/>
</button>
{#if showOptions}
<div class="d-flex ">
{#each blockSchema.fields as validUi}
<div class="ms-2">
<button
class="btn btn-sm btn-primary"
on:click={(e) => createBlock(e, validUi)}
>{validUi.label}
</button>
</div>
{/each}
</div>
{/if}
</div>
<style>
:global(.block-field-wrapper) {
display: flex;
flex-direction: column;
}
:global(.block-field-wrapper .block-buttons) {
visibility: hidden;
}
:global(.block-field-wrapper:hover .block-buttons) {
visibility: visible;
}
.block-buttons {
padding: 0px;
z-index: 1;
margin: 0px ;
}
</style>
@@ -1,158 +0,0 @@
<script>
import Heading from "./elements/Heading.svelte";
import Textarea from "./elements/Textarea.svelte";
import Rich from "./elements/Rich.svelte";
import Markdown from "./elements/Markdown.svelte";
import Reference from "./elements/Reference.svelte";
import Icon from "../../common/Icon.svelte";
import {insertBlock} from "./block";
import {getContext} from "svelte";
import {findIndex} from "lodash";
import File from "./elements/File.svelte";
const channel = getContext("channel");
export let record;
export let blockData;
export let field;
export let graph;
export let block;
let blockSchema = channel.schemas.find((s) => s.name === field.schema);
function createBlock(e, ui, blockId) {
e.preventDefault();
blockData = insertBlock(blockData, ui, blockId);
}
function deleteBlock(e, blockId) {
e.preventDefault();
blockData = blockData.filter(b => b.id !== blockId)
}
function upBlock(e, blockId) {
e.preventDefault();
let blockIndex = findIndex(blockData, (b) => b.id === blockId);
let tempBlock = blockData[blockIndex];
blockData[blockIndex] = blockData[blockIndex - 1];
blockData[blockIndex - 1] = tempBlock;
}
function downBlock(e, blockId) {
e.preventDefault();
let blockIndex = findIndex(blockData, (b) => b.id === blockId);
let tempBlock = blockData[blockIndex];
blockData[blockIndex] = blockData[blockIndex + 1];
blockData[blockIndex + 1] = tempBlock;
}
function blockIsFirst(blockId) {
return findIndex(blockData, (b) => b.id === blockId) === 0;
}
function blockIsLast(blockId) {
return findIndex(blockData, (b) => b.id === blockId) === blockData.length - 1;
}
</script>
<div class="card block-editor-field d-flex">
<div class="d-flex justify-content-between">
<span class="text-muted d-block fs-6 mb-1">{block.meta.label}</span>
<div class="dropdown d-inline-block">
<button
class="btn btn-link btn-sm"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
<Icon icon="ellipsis"/>
</button>
<div class="dropdown-menu">
<h6 class="dropdown-header">
Block id: <input class="form-control-plaintext" readonly value={block.id}/>
Block name: <input class="form-control-plaintext" readonly value={block.meta.name}/>
</h6>
<div>
<hr class="dropdown-divider">
</div>
<h6 class="dropdown-header">Actions</h6>
<button
class="dropdown-item"
class:d-none={blockIsFirst(block.id)}
on:click={(e) => upBlock(e, block.id)}
>Move up
</button>
<button
class="dropdown-item"
class:d-none={blockIsLast(block.id)}
on:click={(e) => downBlock(e, block.id)}
>Move down
</button>
<button
class="dropdown-item text-danger"
on:click={(e) => deleteBlock(e, block.id)}
>Delete
</button
>
<h6 class="dropdown-header">Insert after</h6>
{#each blockSchema.fields as blockField}
<button
class="dropdown-item"
on:click={(e) => createBlock(e, blockField, block.id)}
>{blockField.label}
</button
>
{/each}
</div>
</div>
</div>
{#if block.meta.info.name === "heading"}
<Heading
bind:block={block}
/>
{:else if block.meta.info.name === "textarea"}
<Textarea
bind:block={block}
/>
{:else if block.meta.info.name === "rich"}
<Rich
bind:block={block}
/>
{:else if block.meta.info.name === "markdown"}
<Markdown
bind:block={block}
/>
{:else if block.meta.info.name === "file"}
<File
{record}
{field}
bind:graph
bind:block={block}
/>
{:else if block.meta.info.name === "reference"}
<Reference
{record}
{field}
bind:graph
bind:block={block}
/>
{/if}
</div>
<style>
.block-editor-field{
margin: 10px 0;
border-color: transparent;
}
</style>
-25
View File
@@ -1,25 +0,0 @@
import {randomId} from "../../../helpers.js";
export function insertBlock(blockData, blockField, afterBlockId = null) {
if (!afterBlockId) {
return [{
meta: blockField,
id: randomId(),
value: null
}, ...blockData];
}
return blockData.reduce((carry, block) => {
carry.push(block)
if (block.id === afterBlockId) {
carry.push({
meta: blockField,
id: randomId(),
value: null
});
}
return carry;
}, []);
}
@@ -1,105 +0,0 @@
<script>
import {getContext} from "svelte";
import PreviewCard from "../../PreviewCard.svelte";
import {sortByField} from "../../../edges/sortEdges";
import ReferenceInlineButtons from "../../elements/ReferenceInlineButtons.svelte"
import Sortable from "../../../libs/Sortable.svelte";
import {insertEdges} from "../../elements/reference";
import BrowseModal from "../../elements/BrowseModal.svelte";
const channel = getContext("channel");
export let block;
export let record;
export let field;
export let graph;
let browseModal;
let blockFieldName = field.name + ":" + block.id;
$: references = graph.edges
.filter((edge) => edge.field === blockFieldName)
.map((edge) => {
return graph.records.find((increc) => increc.id === edge.target && record.id === edge.source);
}).filter((rec) => (rec?.id ? true : false)) ?? [];
let collections = channel.schemas.filter((aschema) =>
block.meta.collections.includes(aschema.name)
);
function removeReference(e) {
e.preventDefault();
graph.edges = graph.edges.filter(
(edge) => !(edge.target === e.detail && edge.field === blockFieldName)
);
block.value = graph.edges.filter(edge => edge.field === blockFieldName) ?? [];
}
function openBrowseModal(e, schema) {
e.preventDefault();
browseModal.open(schema);
}
function reorder(e) {
graph.edges = sortByField(e.detail.source, e.detail.target, graph.edges, blockFieldName);
}
function insert(e) {
e.preventDefault();
browseModal.close();
graph = insertEdges(graph,record,e.detail.records,blockFieldName,e.detail.action);
}
</script>
<div class="mb-0">
{#if block.meta.collections.length === 1}
<button
class="btn btn-outline-primary"
on:click={(e) => openBrowseModal(e, collections[0].name)}
>
Browse
</button>
{:else}
<div class="dropdown d-inline-block">
<button
class="btn btn-outline-primary btn-sm"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
Browse
</button>
<ul class="dropdown-menu">
{#each collections as collection}
<li>
<!-- {`${channelurl}/content/${collection.name}?parent=${record.id}&parentfield=${field.name}`} -->
<a
class="dropdown-item"
on:click={(e) =>
openBrowseModal(e, collection.name)}
href="/">{collection.label}</a
>
</li>
{/each}
</ul>
</div>
{/if}
</div>
{#if references.length > 0}
<Sortable sortableClass="row row-cols-3 mt-3" on:update={reorder}>
{#each references as reference (reference.id)}
<div class="col mb-3">
<PreviewCard
classes="h-100"
record={reference}
hasDelete={true}
on:remove={removeReference}
/>
</div>
{/each}
</Sortable>
{/if}
<BrowseModal bind:this={browseModal} on:insert={insert}/>
@@ -1,13 +0,0 @@
<script>
export let block;
</script>
<div class="mb-0">
<input
type="text"
id={block.id}
class="form-control"
bind:value={block.value}
autocomplete="off"
/>
</div>
@@ -1,15 +0,0 @@
<script>
import Codemirror from "../../../libs/CodemirrorMarkdown.svelte";
export let block;
// export let id;
</script>
<div class="mb-3">
<Codemirror bind:value={block.value} />
</div>
@@ -1,71 +0,0 @@
<script>
import {getContext} from "svelte";
import PreviewCard from "../../PreviewCard.svelte";
import {sortByField} from "../../../edges/sortEdges";
import ReferenceInlineButtons from "../../elements/ReferenceInlineButtons.svelte"
import Sortable from "../../../libs/Sortable.svelte";
import {insertEdges} from "../../elements/reference";
const channel = getContext("channel");
export let block;
export let record;
export let field;
export let graph;
let blockFieldName = field.name + ":" + block.id;
$: references = graph.edges
.filter((edge) => edge.field === blockFieldName)
.map((edge) => {
return graph.records.find((increc) => increc.id === edge.target && record.id === edge.source);
}).filter((rec) => (rec?.id ? true : false)) ?? [];
let collections = channel.schemas.filter((aschema) =>
block.meta.collections.includes(aschema.name)
);
function removeReference(e) {
e.preventDefault();
graph.edges = graph.edges.filter(
(edge) => !(edge.target === e.detail && edge.field === blockFieldName)
);
block.value = graph.edges.filter(edge => edge.field === blockFieldName) ?? [];
}
function reorder(e) {
graph.edges = sortByField(e.detail.source, e.detail.target, graph.edges, blockFieldName);
}
function insert(e) {
e.preventDefault();
graph = insertEdges(graph,record,e.detail.records,blockFieldName,e.detail.action);
}
</script>
<div class="inline-card-wrapper">
<ReferenceInlineButtons
buttonClass="mt-2"
recordId={null}
schemas={collections}
on:insert={insert}
on:save={insert}
/>
</div>
{#if references.length > 0}
<Sortable sortableClass="row row-cols-3 mt-3" on:update={reorder}>
{#each references as reference (reference.id)}
<div class="col mb-3">
<PreviewCard
classes="h-100"
record={reference}
hasDelete={true}
on:remove={removeReference}
/>
</div>
{/each}
</Sortable>
{/if}
@@ -1,10 +0,0 @@
<script>
import Tinymce from "../../../libs/Tinymce.svelte";
export let block;
let additionalConfig = {};
</script>
<div class="mb-0">
<Tinymce bind:value={block.value} {additionalConfig}/>
</div>
@@ -1,39 +0,0 @@
<script>
import {onMount} from "svelte";
export let block;
let thisEl;
function resize(e) {
let el;
if (e.target) {
el = e.target;
} else {
el = e;
}
el.style.overflow = "hidden";
el.style.height = "1px";
el.style.height = +el.scrollHeight + "px";
}
onMount(() => {
resize(thisEl);
});
</script>
<div class="mb-0">
<textarea
bind:value={block.value}
bind:this={thisEl}
on:input={resize}
id={block.id}
class="form-control"
autocomplete="off"></textarea>
</div>
<style>
textarea {
resize: none;
}
</style>
@@ -1,114 +0,0 @@
<script>
import {createEventDispatcher, getContext} from "svelte";
import Index from "../../content/Index.svelte";
const dispatch = createEventDispatcher();
const channel = getContext("channel");
$: data = {};
let isOpen = false;
let selectedRecords = [];
// onMount(() => {
// load();
// });
export function open(schema) {
isOpen = true;
load(schema);
}
export function close() {
isOpen = false;
selectedRecords = [];
}
function load(schema) {
axios
.get(channel.lucentUrl + "/content/" + schema)
.then((response) => {
data = response.data;
})
.catch((error) => console.log(error));
}
function insert(e) {
e.preventDefault();
dispatch("insert", {
records: selectedRecords,
action: "insert",
});
}
function replace(e) {
e.preventDefault();
dispatch("insert", {
records: selectedRecords,
action: "replace",
});
}
</script>
{#if data.schema}
<div
class="modal fade show"
tabindex="-1"
class:d-block={isOpen}
aria-modal="true"
role="dialog"
style="background: rgba(100,100,100,.6);"
>
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header">
<div class="d-flex align-items-center">
<button
type="button"
class="btn btn-primary me-1"
on:click={insert}
disabled={selectedRecords.length === 0}
>
Insert
</button>
<button
type="button"
class="btn btn-outline-primary me-3"
on:click={replace}
disabled={selectedRecords.length === 0}
>
Replace
</button>
{#if selectedRecords.length > 0}
<span class="">
{selectedRecords.length} records selected
</span>
{/if}
</div>
<button
on:click|preventDefault={(e) => (isOpen = false)}
type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"
/>
</div>
<div class="modal-body">
<Index {...data} bind:selected={selectedRecords}/>
</div>
</div>
</div>
</div>
{/if}
<style>
.modal-dialog {
width: auto;
max-width: 100%;
}
.modal-content {
margin: 40px auto;
width: auto;
height: 100%;
}
</style>
@@ -8,7 +8,7 @@
$: errorMessage = getErrorMessage(validationErrors, field.name); $: errorMessage = getErrorMessage(validationErrors, field.name);
</script> </script>
<div> <div class="field-checkbox">
<div class="form-check form-check-inline"> <div class="form-check form-check-inline">
<input <input
class="form-check-input" class="form-check-input"
@@ -1,5 +1,6 @@
<script> <script>
import {getErrorMessage} from "./errorMessage"; import {getErrorMessage} from "./errorMessage";
export let field; export let field;
export let value; export let value;
export let isCreateMode; export let isCreateMode;
@@ -9,16 +10,14 @@
</script> </script>
<div class="mb-0"> <div class="mb-0">
<div class="input-group "> <div style="display: flex; align-items: center;gap: 10px">
<div style="width:64px;">
<input <input
type="color" type="color"
{id} {id}
class="form-control form-control-color" style="border: none;background: transparent;padding: 0;width:64px;"
disabled={field.readonly && !isCreateMode} disabled={field.readonly && !isCreateMode}
bind:value bind:value
/> />
</div>
<input <input
type="text" type="text"
class:is-invalid={errorMessage} class:is-invalid={errorMessage}
@@ -1,70 +0,0 @@
<script>
import {getContext} from "svelte";
import {debounce} from "lodash";
import {previewTitle} from "../Preview";
const channel = getContext("channel");
export let field;
export let value;
export let search;
$: options = [];
export const update = debounce((e) => {
axios
.get("/records/suggestions", {
params: {
schema: field.optionsFrom,
field: field.optionsField,
value: search,
ui: field.ui,
},
})
.then((response) => {
options = response.data;
})
.catch((error) => {
console.log(error);
});
}, 500);
function select(e, option) {
e.preventDefault();
value = option.data[field.optionsField];
search = "";
}
</script>
{#if field.optionsFrom}
{#each options as option (option.id)}
<div
on:click={(e) => select(e, option)}
on:keypress={(e) => select(e, option)}
>
<span class="dropdown-item">
{previewTitle(channel.schemas, option)}
<small class="text-muted "
>{option.data[field.optionsField]}</small
>
</span>
</div>
{:else}
{#if search && field.optionsSuggest}
<div
on:click={(e) => {
value = search;
search = "";
}}
on:keypress={(e) => {
value = search;
search = "";
}}
>
<span class="dropdown-item">
Add "{search}"
</span>
</div>
{:else}
No results
{/if}
{/each}
{/if}
Loaded 100 of 333 files, more files were not shown because too many files have changed in this diff. Show more