Compare commits
17
Commits
dev-2
..
json-schema
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d2cafdf11 | ||
|
|
e9c2e82bc3 | ||
|
|
49c1d5efd0 | ||
|
|
0e19c38f23 | ||
|
|
b4521e92b8 | ||
|
|
2e95fca8ad | ||
|
|
02224eb580 | ||
|
|
e74e1e7956 | ||
|
|
d824e52dce | ||
|
|
322c48b78b | ||
|
|
c649077e37 | ||
|
|
b8efa5f586 | ||
|
|
8526fd471f | ||
|
|
bb77a37ff7 | ||
|
|
1f03eebd08 | ||
|
|
137c338719 | ||
|
|
842bd71a18 |
No files matched your search
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"$schema": "/phpactor.schema.json",
|
||||
"language_server_phpstan.enabled": false
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"project_name": "Lucent Package",
|
||||
"languages": {
|
||||
"PHP": {
|
||||
"language_servers": ["phpactor"],
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -9,8 +9,8 @@ include_toc: true
|
||||
|
||||
### Requirements
|
||||
|
||||
- PHP 8.3
|
||||
- Laravel 11
|
||||
- PHP 8.2
|
||||
- Laravel 10
|
||||
- Postgres or Sqlite database
|
||||
- ImageMagick
|
||||
|
||||
@@ -82,9 +82,7 @@ return [
|
||||
### Database
|
||||
|
||||
The recommended database for small website is sqlite. But you can also use postresql
|
||||
|
||||
> [!CAUTION]
|
||||
> Make sure to delete the existing migration scripts in your database/migrations folder.
|
||||
Make sure to delete the existing migration scripts in your database/migrations folder.
|
||||
|
||||
Then run:
|
||||
|
||||
@@ -92,26 +90,6 @@ Then run:
|
||||
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
|
||||
|
||||
To create your first user, head to your localhost:8000/lucent
|
||||
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
# 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,
|
||||
],
|
||||
```
|
||||
+7
-7
@@ -8,16 +8,15 @@
|
||||
"ext-zip": "*",
|
||||
"ext-sqlite3": "*",
|
||||
"ext-imagick": "*",
|
||||
"ext-pdo": "*",
|
||||
"php": "^8.3",
|
||||
"php": "^8.2",
|
||||
"guzzlehttp/guzzle": "^7.2",
|
||||
"intervention/image": "^2.7",
|
||||
"phpoption/phpoption": "^1.9",
|
||||
"spatie/image-optimizer": "^1.6",
|
||||
"staudenmeir/laravel-cte": "^1.0",
|
||||
"mustache/mustache": "^2.14",
|
||||
"yosymfony/toml": "^1.0"
|
||||
|
||||
"ext-pdo": "*",
|
||||
"opis/json-schema": "^2.3",
|
||||
"symfony/yaml": "^7.0",
|
||||
"spatie/laravel-data": "^4.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^1.8",
|
||||
@@ -29,7 +28,8 @@
|
||||
},
|
||||
"files": [
|
||||
"src/Response.php",
|
||||
"src/macros.php"
|
||||
"src/macros.php",
|
||||
"src/File/Uploader.php"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
|
||||
Generated
+2272
-524
File diff suppressed because it is too large.
Load diff
@@ -1,111 +0,0 @@
|
||||
CREATE TABLE "channels" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"locales" TEXT NOT NULL,
|
||||
PRIMARY KEY("id")
|
||||
)
|
||||
|
||||
CREATE TABLE "edges" (
|
||||
"id" TEXT,
|
||||
"from" TEXT NOT NULL,
|
||||
"to" TEXT NOT NULL,
|
||||
"field_id" TEXT NOT NULL,
|
||||
"rank" INTEGER NOT NULL,
|
||||
"locale" TEXT NOT NULL,
|
||||
"mode" TEXT NOT NULL,
|
||||
"" INTEGER,
|
||||
UNIQUE("from","to","field_id","locale","mode"),
|
||||
PRIMARY KEY("id")
|
||||
)
|
||||
|
||||
CREATE TABLE "fields" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"type" TEXT NOT NULL,
|
||||
"props" TEXT NOT NULL,
|
||||
"schema_id" TEXT NOT NULL,
|
||||
"alias" TEXT NOT NULL,
|
||||
"rank" INTEGER NOT NULL DEFAULT 0,
|
||||
"translatable" INTEGER NOT NULL DEFAULT 0,
|
||||
"help" TEXT NOT NULL DEFAULT "",
|
||||
"required" INTEGER NOT NULL DEFAULT 0,
|
||||
"readonly" INTEGER NOT NULL DEFAULT 0,
|
||||
"hidden" INTEGER NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY("id")
|
||||
)
|
||||
|
||||
CREATE TABLE "files" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"size" INTEGER NOT NULL,
|
||||
"width" INTEGER NOT NULL DEFAULT 0,
|
||||
"height" INTEGER NOT NULL DEFAULT 0,
|
||||
"mime" TEXT NOT NULL,
|
||||
"checksum" TEXT NOT NULL,
|
||||
"record_id" TEXT,
|
||||
"is_shared" INTEGER NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY("id")
|
||||
)
|
||||
|
||||
CREATE TABLE "records" (
|
||||
"id" TEXT NOT NULL,
|
||||
"schema_id" TEXT NOT NULL,
|
||||
"created_at" TEXT NOT NULL,
|
||||
"created_by" TEXT NOT NULL,
|
||||
"published_at" TEXT,
|
||||
"published_by" TEXT,
|
||||
"trashed_at" TEXT,
|
||||
"trashed_by" INTEGER,
|
||||
"scheduled_at" TEXT,
|
||||
"scheduled_by" TEXT,
|
||||
"title_field_id" TEXT NOT NULL DEFAULT 'as',
|
||||
PRIMARY KEY("id")
|
||||
)
|
||||
|
||||
CREATE TABLE "records_data" (
|
||||
"id" TEXT NOT NULL,
|
||||
"locale" TEXT NOT NULL,
|
||||
"value" TEXT NOT NULL,
|
||||
"updated_at" TEXT NOT NULL,
|
||||
"updated_by" TEXT NOT NULL,
|
||||
"mode" TEXT NOT NULL,
|
||||
"record_id" TEXT NOT NULL,
|
||||
"field_id" TEXT NOT NULL,
|
||||
PRIMARY KEY("id"),
|
||||
UNIQUE("locale","mode","record_id","field_id")
|
||||
)
|
||||
|
||||
CREATE TABLE "records_files" (
|
||||
"id" TEXT NOT NULL,
|
||||
"record_id" TEXT NOT NULL,
|
||||
"file_id" TEXT NOT NULL,
|
||||
"mode" TEXT NOT NULL,
|
||||
"locale" TEXT NOT NULL,
|
||||
"rank" INTEGER NOT NULL,
|
||||
"field_id" TEXT NOT NULL,
|
||||
PRIMARY KEY("id"),
|
||||
UNIQUE("record_id","file_id","mode","locale")
|
||||
)
|
||||
|
||||
CREATE TABLE "schemas" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"revisions" INTEGER NOT NULL,
|
||||
"alias" TEXT NOT NULL,
|
||||
"title_id" TEXT NOT NULL,
|
||||
PRIMARY KEY("id")
|
||||
)
|
||||
|
||||
CREATE TABLE "users" (
|
||||
"id" varchar NOT NULL,
|
||||
"name" varchar,
|
||||
"email" varchar NOT NULL,
|
||||
"password" varchar,
|
||||
"status" varchar NOT NULL,
|
||||
"roles" TEXT NOT NULL,
|
||||
"createdAt" varchar NOT NULL,
|
||||
"updatedAt" varchar NOT NULL,
|
||||
"loggedInAt" varchar,
|
||||
"mailToken" varchar,
|
||||
PRIMARY KEY("id")
|
||||
)
|
||||
+11
-5
@@ -24,8 +24,7 @@ There are 3 types of schemas
|
||||
- **fields**: The list of your fields. Look the field reference for more
|
||||
- **isEntry**: If this schema is important, it will show be visible on the main the sidebar. Default: false _optional_
|
||||
- **sortBy**: The default sorting in the content browser _optional_
|
||||
- **cardTitle**: Mustache code to customize the preview field _optional_
|
||||
- **cardImage**: Field name of image you want to use as a preview image _optional_
|
||||
- **titleTemplate**: Mustache code to customize the preview field _optional_
|
||||
- **revisions**: How many revisions are going to be kept for each record _optional_
|
||||
- **read**: Array of user groups that have read permissions _optional_
|
||||
- **write**: Array of user groups that have write permissions _optional_
|
||||
@@ -41,12 +40,20 @@ There are 3 types of schemas
|
||||
- **fields**: The list of your fields. Look the field reference for more
|
||||
- **isEntry**: If this schema is important, it will show be visible on the main the sidebar _optional_
|
||||
- **sortBy**: The default sorting in the content browser _optional_
|
||||
- **cardTitle**: Mustache code to customize the preview field _optional_
|
||||
- **titleTemplate**: Mustache code to customize the preview field _optional_
|
||||
- **revisions**: How many revisions are going to be kept for each record _optional_
|
||||
- **read**: Array of user groups that have read permissions _optional_
|
||||
- **write**: Array of user groups that have write permissions _optional_
|
||||
|
||||
|
||||
## Block Reference
|
||||
|
||||
- **name**: The ID of the collection. Camelcase and plural is the recommended format ex. blogPosts
|
||||
- **label**: The friendly name of the schema
|
||||
- **type**: The type of the collection. Should be "block"
|
||||
- **fields**: The list of your fields. Look the field reference for more
|
||||
|
||||
|
||||
A full Collection example without the fields:
|
||||
|
||||
```json
|
||||
@@ -67,8 +74,7 @@ A full Collection example without the fields:
|
||||
"SEO"
|
||||
],
|
||||
"sortBy": "-_sys.createdAt",
|
||||
"schemaTitle": "{{name}} {{slug}}",
|
||||
"schemaImage": "cover",
|
||||
"titleTemplate": "{{name}} {{slug}}",
|
||||
"revisions": 15,
|
||||
"read": [
|
||||
"admin",
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
@import "./pico.min.css";
|
||||
|
||||
main {
|
||||
display: flex;
|
||||
gap: 40px;
|
||||
aside {
|
||||
width: 250px;
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
button.danger {
|
||||
background-color: #d93526;
|
||||
border-color: #d93526;
|
||||
color: white;
|
||||
}
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
@charset "UTF-8";/*!
|
||||
* Pico CSS ✨ v2.1.1 (https://picocss.com)
|
||||
* Copyright 2019-2025 - Licensed under MIT
|
||||
*/:host,:root{--pico-font-family-emoji:"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--pico-font-family-sans-serif:system-ui,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,Helvetica,Arial,"Helvetica Neue",sans-serif,var(--pico-font-family-emoji);--pico-font-family-monospace:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace,var(--pico-font-family-emoji);--pico-font-family:var(--pico-font-family-sans-serif);--pico-line-height:1.5;--pico-font-weight:400;--pico-font-size:100%;--pico-text-underline-offset:0.1rem;--pico-border-radius:0.25rem;--pico-border-width:0.0625rem;--pico-outline-width:0.125rem;--pico-transition:0.2s ease-in-out;--pico-spacing:1rem;--pico-typography-spacing-vertical:1rem;--pico-block-spacing-vertical:var(--pico-spacing);--pico-block-spacing-horizontal:var(--pico-spacing);--pico-grid-column-gap:var(--pico-spacing);--pico-grid-row-gap:var(--pico-spacing);--pico-form-element-spacing-vertical:0.75rem;--pico-form-element-spacing-horizontal:1rem;--pico-group-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-group-box-shadow-focus-with-button:0 0 0 var(--pico-outline-width) var(--pico-primary-focus);--pico-group-box-shadow-focus-with-input:0 0 0 0.0625rem var(--pico-form-element-border-color);--pico-modal-overlay-backdrop-filter:blur(0.375rem);--pico-nav-element-spacing-vertical:1rem;--pico-nav-element-spacing-horizontal:0.5rem;--pico-nav-link-spacing-vertical:0.5rem;--pico-nav-link-spacing-horizontal:0.5rem;--pico-nav-breadcrumb-divider:">";--pico-icon-checkbox:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-minus:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");--pico-icon-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-date:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");--pico-icon-time:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-search:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");--pico-icon-close:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");--pico-icon-loading:url("data:image/svg+xml,%3Csvg fill='none' height='24' width='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' %3E%3Cstyle%3E g %7B animation: rotate 2s linear infinite; transform-origin: center center; %7D circle %7B stroke-dasharray: 75,100; stroke-dashoffset: -5; animation: dash 1.5s ease-in-out infinite; stroke-linecap: round; %7D @keyframes rotate %7B 0%25 %7B transform: rotate(0deg); %7D 100%25 %7B transform: rotate(360deg); %7D %7D @keyframes dash %7B 0%25 %7B stroke-dasharray: 1,100; stroke-dashoffset: 0; %7D 50%25 %7B stroke-dasharray: 44.5,100; stroke-dashoffset: -17.5; %7D 100%25 %7B stroke-dasharray: 44.5,100; stroke-dashoffset: -62; %7D %7D %3C/style%3E%3Cg%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='rgb(136, 145, 164)' stroke-width='4' /%3E%3C/g%3E%3C/svg%3E")}@media (min-width:576px){:host,:root{--pico-font-size:106.25%}}@media (min-width:768px){:host,:root{--pico-font-size:112.5%}}@media (min-width:1024px){:host,:root{--pico-font-size:118.75%}}@media (min-width:1280px){:host,:root{--picLine truncated
|
||||
Vendored
-342
@@ -1,342 +0,0 @@
|
||||
var AK=Object.defineProperty;var PK=(_n,Ce,ke)=>Ce in _n?AK(_n,Ce,{enumerable:!0,configurable:!0,writable:!0,value:ke}):_n[Ce]=ke;var LY=(_n,Ce,ke)=>(PK(_n,typeof Ce!="symbol"?Ce+"":Ce,ke),ke);function bind$1(_n,Ce){return function(){return _n.apply(Ce,arguments)}}const{toString:toString$1}=Object.prototype,{getPrototypeOf}=Object,kindOf=(_n=>Ce=>{const ke=toString$1.call(Ce);return _n[ke]||(_n[ke]=ke.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=_n=>(_n=_n.toLowerCase(),Ce=>kindOf(Ce)===_n),typeOfTest=_n=>Ce=>typeof Ce===_n,{isArray:isArray$2}=Array,isUndefined=typeOfTest("undefined");function isBuffer(_n){return _n!==null&&!isUndefined(_n)&&_n.constructor!==null&&!isUndefined(_n.constructor)&&isFunction$1(_n.constructor.isBuffer)&&_n.constructor.isBuffer(_n)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(_n){let Ce;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?Ce=ArrayBuffer.isView(_n):Ce=_n&&_n.buffer&&isArrayBuffer(_n.buffer),Ce}const isString$1=typeOfTest("string"),isFunction$1=typeOfTest("function"),isNumber$1=typeOfTest("number"),isObject$1=_n=>_n!==null&&typeof _n=="object",isBoolean$1=_n=>_n===!0||_n===!1,isPlainObject=_n=>{if(kindOf(_n)!=="object")return!1;const Ce=getPrototypeOf(_n);return(Ce===null||Ce===Object.prototype||Object.getPrototypeOf(Ce)===null)&&!(Symbol.toStringTag in _n)&&!(Symbol.iterator in _n)},isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=_n=>isObject$1(_n)&&isFunction$1(_n.pipe),isFormData=_n=>{let Ce;return _n&&(typeof FormData=="function"&&_n instanceof FormData||isFunction$1(_n.append)&&((Ce=kindOf(_n))==="formdata"||Ce==="object"&&isFunction$1(_n.toString)&&_n.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=_n=>_n.trim?_n.trim():_n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(_n,Ce,{allOwnKeys:ke=!1}={}){if(_n===null||typeof _n>"u")return;let $n,Hn;if(typeof _n!="object"&&(_n=[_n]),isArray$2(_n))for($n=0,Hn=_n.length;$n<Hn;$n++)Ce.call(null,_n[$n],$n,_n);else{const zn=ke?Object.getOwnPropertyNames(_n):Object.keys(_n),Un=zn.length;let qn;for($n=0;$n<Un;$n++)qn=zn[$n],Ce.call(null,_n[qn],qn,_n)}}function findKey$1(_n,Ce){Ce=Ce.toLowerCase();const ke=Object.keys(_n);let $n=ke.length,Hn;for(;$n-- >0;)if(Hn=ke[$n],Ce===Hn.toLowerCase())return Hn;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,isContextDefined=_n=>!isUndefined(_n)&&_n!==_global;function merge(){const{caseless:_n}=isContextDefined(this)&&this||{},Ce={},ke=($n,Hn)=>{const zn=_n&&findKey$1(Ce,Hn)||Hn;isPlainObject(Ce[zn])&&isPlainObject($n)?Ce[zn]=merge(Ce[zn],$n):isPlainObject($n)?Ce[zn]=merge({},$n):isArray$2($n)?Ce[zn]=$n.slice():Ce[zn]=$n};for(let $n=0,Hn=arguments.length;$n<Hn;$n++)arguments[$n]&&forEach(arguments[$n],ke);return Ce}const extend$2=(_n,Ce,ke,{allOwnKeys:$n}={})=>(forEach(Ce,(Hn,zn)=>{ke&&isFunction$1(Hn)?_n[zn]=bind$1(Hn,ke):_n[zn]=Hn},{allOwnKeys:$n}),_n),stripBOM=_n=>(_n.charCodeAt(0)===65279&&(_n=_n.slice(1)),_n),inherits=(_n,Ce,ke,$n)=>{_n.prototype=Object.create(Ce.prototype,$n),_n.prototype.constructor=_n,Object.defineProperty(_n,"super",{value:Ce.prototype}),ke&&Object.assign(_n.prototype,ke)},toFlatObject=(_n,Ce,ke,$n)=>{let Hn,zn,Un;const qn={};if(Ce=Ce||{},_n==null)return Ce;do{for(Hn=Object.getOwnPropertyNames(_n),zn=Hn.length;zn-- >0;)Un=Hn[zn],(!$n||$n(Un,_n,Ce))&&!qn[Un]&&(Ce[Un]=_n[Un],qn[Un]=!0);_n=ke!==!1&&getPrototypeOf(_n)}while(_n&&(!ke||ke(_n,Ce))&&_n!==Object.prototype);return Ce},endsWith=(_n,Ce,ke)=>{_n=String(_n),(ke===void 0||ke>_n.length)&&(ke=_n.length),ke-=Ce.length;const $n=_n.indexOf(Ce,ke);return $n!==-1&&$n===ke},toArray=_n=>{if(!_n)return null;if(isArray$2(_n))return _n;let Ce=_n.length;if(!isNumber$1(Ce))return null;const ke=new Array(Ce);for(;Ce-- >0;)ke[Ce]=_n[Ce];return ke},isTypedArray=(_n=>Ce=>_n&&Ce instanceof _n)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(_n,Ce)=>{const $n=(_n&&_n[Symbol.iterator]).call(_n);let Hn;for(;(Hn=$n.next())&&!Hn.done;){const zn=Hn.value;Ce.call(_n,zn[0],zn[1])}},matchAll=(_n,Ce)=>{let ke;const $n=[];for(;(ke=_n.exec(Ce))!==null;)$n.push(ke);return $n},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=_n=>_n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(ke,$n,Hn){return $n.toUpperCase()+Hn}),hasOwnProperty=(({hasOwnProperty:_n})=>(Ce,ke)=>_n.call(Ce,ke))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(_n,Ce)=>{const ke=Object.getOwnPropertyDescriptors(_n),$n={};forEach(ke,(Hn,zn)=>{let Un;(Un=Ce(Hn,zn,_n))!==!1&&($n[zn]=Un||Hn)}),Object.defineProperties(_n,$n)},freezeMethods=_n=>{reduceDescriptors(_n,(Ce,ke)=>{if(isFunction$1(_n)&&["arguments","caller","callee"].indexOf(ke)!==-1)return!1;const $n=_n[ke];if(isFunction$1(Line truncated
|
||||
`).forEach(function(Un){Hn=Un.indexOf(":"),ke=Un.substring(0,Hn).trim().toLowerCase(),$n=Un.substring(Hn+1).trim(),!(!ke||Ce[ke]&&ignoreDuplicateOf[ke])&&(ke==="set-cookie"?Ce[ke]?Ce[ke].push($n):Ce[ke]=[$n]:Ce[ke]=Ce[ke]?Ce[ke]+", "+$n:$n)}),Ce},$internals=Symbol("internals");function normalizeHeader(_n){return _n&&String(_n).trim().toLowerCase()}function normalizeValue(_n){return _n===!1||_n==null?_n:utils$1.isArray(_n)?_n.map(normalizeValue):String(_n)}function parseTokens(_n){const Ce=Object.create(null),ke=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let $n;for(;$n=ke.exec(_n);)Ce[$n[1]]=$n[2];return Ce}const isValidHeaderName=_n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(_n.trim());function matchHeaderValue(_n,Ce,ke,$n,Hn){if(utils$1.isFunction($n))return $n.call(this,Ce,ke);if(Hn&&(Ce=ke),!!utils$1.isString(Ce)){if(utils$1.isString($n))return Ce.indexOf($n)!==-1;if(utils$1.isRegExp($n))return $n.test(Ce)}}function formatHeader(_n){return _n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(Ce,ke,$n)=>ke.toUpperCase()+$n)}function buildAccessors(_n,Ce){const ke=utils$1.toCamelCase(" "+Ce);["get","set","has"].forEach($n=>{Object.defineProperty(_n,$n+ke,{value:function(Hn,zn,Un){return this[$n].call(this,Ce,Hn,zn,Un)},configurable:!0})})}class AxiosHeaders{constructor(Ce){Ce&&this.set(Ce)}set(Ce,ke,$n){const Hn=this;function zn(qn,Xn,Kn){const to=normalizeHeader(Xn);if(!to)throw new Error("header name must be a non-empty string");const io=utils$1.findKey(Hn,to);(!io||Hn[io]===void 0||Kn===!0||Kn===void 0&&Hn[io]!==!1)&&(Hn[io||Xn]=normalizeValue(qn))}const Un=(qn,Xn)=>utils$1.forEach(qn,(Kn,to)=>zn(Kn,to,Xn));if(utils$1.isPlainObject(Ce)||Ce instanceof this.constructor)Un(Ce,ke);else if(utils$1.isString(Ce)&&(Ce=Ce.trim())&&!isValidHeaderName(Ce))Un(parseHeaders(Ce),ke);else if(utils$1.isHeaders(Ce))for(const[qn,Xn]of Ce.entries())zn(Xn,qn,$n);else Ce!=null&&zn(ke,Ce,$n);return this}get(Ce,ke){if(Ce=normalizeHeader(Ce),Ce){const $n=utils$1.findKey(this,Ce);if($n){const Hn=this[$n];if(!ke)return Hn;if(ke===!0)return parseTokens(Hn);if(utils$1.isFunction(ke))return ke.call(this,Hn,$n);if(utils$1.isRegExp(ke))return ke.exec(Hn);throw new TypeError("parser must be boolean|regexp|function")}}}has(Ce,ke){if(Ce=normalizeHeader(Ce),Ce){const $n=utils$1.findKey(this,Ce);return!!($n&&this[$n]!==void 0&&(!ke||matchHeaderValue(this,this[$n],$n,ke)))}return!1}delete(Ce,ke){const $n=this;let Hn=!1;function zn(Un){if(Un=normalizeHeader(Un),Un){const qn=utils$1.findKey($n,Un);qn&&(!ke||matchHeaderValue($n,$n[qn],qn,ke))&&(delete $n[qn],Hn=!0)}}return utils$1.isArray(Ce)?Ce.forEach(zn):zn(Ce),Hn}clear(Ce){const ke=Object.keys(this);let $n=ke.length,Hn=!1;for(;$n--;){const zn=ke[$n];(!Ce||matchHeaderValue(this,this[zn],zn,Ce,!0))&&(delete this[zn],Hn=!0)}return Hn}normalize(Ce){const ke=this,$n={};return utils$1.forEach(this,(Hn,zn)=>{const Un=utils$1.findKey($n,zn);if(Un){ke[Un]=normalizeValue(Hn),delete ke[zn];return}const qn=Ce?formatHeader(zn):String(zn).trim();qn!==zn&&delete ke[zn],ke[qn]=normalizeValue(Hn),$n[qn]=!0}),this}concat(...Ce){return this.constructor.concat(this,...Ce)}toJSON(Ce){const ke=Object.create(null);return utils$1.forEach(this,($n,Hn)=>{$n!=null&&$n!==!1&&(ke[Hn]=Ce&&utils$1.isArray($n)?$n.join(", "):$n)}),ke}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([Ce,ke])=>Ce+": "+ke).join(`
|
||||
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(Ce){return Ce instanceof this?Ce:new this(Ce)}static concat(Ce,...ke){const $n=new this(Ce);return ke.forEach(Hn=>$n.set(Hn)),$n}static accessor(Ce){const $n=(this[$internals]=this[$internals]={accessors:{}}).accessors,Hn=this.prototype;function zn(Un){const qn=normalizeHeader(Un);$n[qn]||(buildAccessors(Hn,Un),$n[qn]=!0)}return utils$1.isArray(Ce)?Ce.forEach(zn):zn(Ce),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$1.reduceDescriptors(AxiosHeaders.prototype,({value:_n},Ce)=>{let ke=Ce[0].toUpperCase()+Ce.slice(1);return{get:()=>_n,set($n){this[ke]=$n}}});utils$1.freezeMethods(AxiosHeaders);function transformData(_n,Ce){const ke=this||defaults$4,$n=Ce||ke,Hn=AxiosHeaders.from($n.headers);let zn=$n.data;return utils$1.forEach(_n,function(qn){zn=qn.call(ke,zn,Hn.normalize(),Ce?Ce.status:void 0)}),Hn.normalize(),zn}function isCancel(_n){return!!(_n&&_n.__CANCEL__)}function CanceledError(_n,Ce,ke){AxiosError.call(this,_n??"canceled",AxiosError.ERR_CANCELED,Ce,ke),this.name="CanceledError"}utils$1.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(_n,Ce,ke){const $n=ke.config.validateStatus;!ke.status||!$n||$n(ke.status)?_n(ke):Ce(new AxiosError("Request failed with status code "+ke.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(ke.status/100)-4],ke.config,ke.request,ke))}function parseProtocol(_n){const Ce=/^([-+\w]{1,25})(:?\/\/|:)/.exec(_n);return Ce&&Ce[1]||""}function speedometer(_n,Ce){_n=_n||10;const ke=new Array(_n),$n=new Array(_n);let Hn=0,zn=0,Un;return Ce=Ce!==void 0?Ce:1e3,function(Xn){const Kn=Date.now(),to=$n[zn];Un||(Un=Kn),ke[Hn]=Xn,$n[Hn]=Kn;let io=zn,uo=0;for(;io!==Hn;)uo+=ke[io++],io=io%_n;if(Hn=(Hn+1)%_n,Hn===zn&&(zn=(zn+1)%_n),Kn-Un<Ce)return;const ho=to&&Kn-to;return ho?Math.round(uo*1e3/ho):void 0}}function throttle$1(_n,Ce){let ke=0,$n=1e3/Ce,Hn,zn;const Un=(Kn,to=Date.now())=>{ke=to,Hn=null,zn&&(clearTimeout(zn),zn=null),_n.apply(null,Kn)};return[(...Kn)=>{const to=Date.now(),io=to-ke;io>=$n?Un(Kn,to):(Hn=Kn,zn||(zn=setTimeout(()=>{zn=null,Un(Hn)},$n-io)))},()=>Hn&&Un(Hn)]}const progressEventReducer=(_n,Ce,ke=3)=>{let $n=0;const Hn=speedometer(50,250);return throttle$1(zn=>{const Un=zn.loaded,qn=zn.lengthComputable?zn.total:void 0,Xn=Un-$n,Kn=Hn(Xn),to=Un<=qn;$n=Un;const io={loaded:Un,total:qn,progress:qn?Un/qn:void 0,bytes:Xn,rate:Kn||void 0,estimated:Kn&&qn&&to?(qn-Un)/Kn:void 0,event:zn,lengthComputable:qn!=null,[Ce?"download":"upload"]:!0};_n(io)},ke)},progressEventDecorator=(_n,Ce)=>{const ke=_n!=null;return[$n=>Ce[0]({lengthComputable:ke,total:_n,loaded:$n}),Ce[1]]},asyncDecorator=_n=>(...Ce)=>utils$1.asap(()=>_n(...Ce)),isURLSameOrigin=platform.hasStandardBrowserEnv?function(){const Ce=/(msie|trident)/i.test(navigator.userAgent),ke=document.createElement("a");let $n;function Hn(zn){let Un=zn;return Ce&&(ke.setAttribute("href",Un),Un=ke.href),ke.setAttribute("href",Un),{href:ke.href,protocol:ke.protocol?ke.protocol.replace(/:$/,""):"",host:ke.host,search:ke.search?ke.search.replace(/^\?/,""):"",hash:ke.hash?ke.hash.replace(/^#/,""):"",hostname:ke.hostname,port:ke.port,pathname:ke.pathname.charAt(0)==="/"?ke.pathname:"/"+ke.pathname}}return $n=Hn(window.location.href),function(Un){const qn=utils$1.isString(Un)?Hn(Un):Un;return qn.protocol===$n.protocol&&qn.host===$n.host}}():function(){return function(){return!0}}(),cookies=platform.hasStandardBrowserEnv?{write(_n,Ce,ke,$n,Hn,zn){const Un=[_n+"="+encodeURIComponent(Ce)];utils$1.isNumber(ke)&&Un.push("expires="+new Date(ke).toGMTString()),utils$1.isString($n)&&Un.push("path="+$n),utils$1.isString(Hn)&&Un.push("domain="+Hn),zn===!0&&Un.push("secure"),document.cookie=Un.join("; ")},read(_n){const Ce=document.cookie.match(new RegExp("(^|;\\s*)("+_n+")=([^;]*)"));return Ce?decodeURIComponent(Ce[3]):null},remove(_n){this.write(_n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(_n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(_n)}function combineURLs(_n,Ce){return Ce?_n.replace(/\/?\/$/,"")+"/"+Ce.replace(/^\/+/,""):_n}function buildFullPath(_n,Ce){return _n&&!isAbsoluteURL(Ce)?combineURLs(_n,Ce):Ce}const headersToObject=_n=>_n instanceof AxiosHeaders?{..._n}:_n;function mergeConfig(_n,Ce){Ce=Ce||{};const ke={};function $n(Kn,to,io){return utils$1.isPlainObject(Kn)&&utils$1.isPlainObject(to)?utils$1.merge.call({caseless:io},Kn,to):utils$1.isPlainObject(to)?utils$1.merge({},to):utils$1.isArray(to)?to.slice():to}function Hn(Kn,to,io){if(utils$1.isUndefined(to)){if(!utils$1.isUndefined(Kn))return $n(void 0,Kn,io)}else return $n(Kn,to,io)}function zn(Kn,to){if(!utils$1.isUndefined(to))return $n(void 0,to)}function Un(Kn,to){if(utils$1.isUndefined(to)){if(!utils$1.isUndefined(Kn))return $n(void 0,Kn)}else return $n(void 0,to)}function qn(Kn,to,io){if(io in Ce)return $n(Kn,to);if(io in _n)return $n(void 0,Kn)}const Xn={url:zn,
Line truncated
|
||||
`+zn.map(renderReason).join(`
|
||||
`):" "+renderReason(zn[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+Un,"ERR_NOT_SUPPORT")}return $n},adapters:knownAdapters};function throwIfCancellationRequested(_n){if(_n.cancelToken&&_n.cancelToken.throwIfRequested(),_n.signal&&_n.signal.aborted)throw new CanceledError(null,_n)}function dispatchRequest(_n){return throwIfCancellationRequested(_n),_n.headers=AxiosHeaders.from(_n.headers),_n.data=transformData.call(_n,_n.transformRequest),["post","put","patch"].indexOf(_n.method)!==-1&&_n.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(_n.adapter||defaults$4.adapter)(_n).then(function($n){return throwIfCancellationRequested(_n),$n.data=transformData.call(_n,_n.transformResponse,$n),$n.headers=AxiosHeaders.from($n.headers),$n},function($n){return isCancel($n)||(throwIfCancellationRequested(_n),$n&&$n.response&&($n.response.data=transformData.call(_n,_n.transformResponse,$n.response),$n.response.headers=AxiosHeaders.from($n.response.headers))),Promise.reject($n)})}const VERSION="1.7.4",validators$1={};["object","boolean","number","function","string","symbol"].forEach((_n,Ce)=>{validators$1[_n]=function($n){return typeof $n===_n||"a"+(Ce<1?"n ":" ")+_n}});const deprecatedWarnings={};validators$1.transitional=function(Ce,ke,$n){function Hn(zn,Un){return"[Axios v"+VERSION+"] Transitional option '"+zn+"'"+Un+($n?". "+$n:"")}return(zn,Un,qn)=>{if(Ce===!1)throw new AxiosError(Hn(Un," has been removed"+(ke?" in "+ke:"")),AxiosError.ERR_DEPRECATED);return ke&&!deprecatedWarnings[Un]&&(deprecatedWarnings[Un]=!0,console.warn(Hn(Un," has been deprecated since v"+ke+" and will be removed in the near future"))),Ce?Ce(zn,Un,qn):!0}};function assertOptions(_n,Ce,ke){if(typeof _n!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const $n=Object.keys(_n);let Hn=$n.length;for(;Hn-- >0;){const zn=$n[Hn],Un=Ce[zn];if(Un){const qn=_n[zn],Xn=qn===void 0||Un(qn,zn,_n);if(Xn!==!0)throw new AxiosError("option "+zn+" must be "+Xn,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(ke!==!0)throw new AxiosError("Unknown option "+zn,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(Ce){this.defaults=Ce,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(Ce,ke){try{return await this._request(Ce,ke)}catch($n){if($n instanceof Error){let Hn;Error.captureStackTrace?Error.captureStackTrace(Hn={}):Hn=new Error;const zn=Hn.stack?Hn.stack.replace(/^.+\n/,""):"";try{$n.stack?zn&&!String($n.stack).endsWith(zn.replace(/^.+\n.+\n/,""))&&($n.stack+=`
|
||||
`+zn):$n.stack=zn}catch{}}throw $n}}_request(Ce,ke){typeof Ce=="string"?(ke=ke||{},ke.url=Ce):ke=Ce||{},ke=mergeConfig(this.defaults,ke);const{transitional:$n,paramsSerializer:Hn,headers:zn}=ke;$n!==void 0&&validator.assertOptions($n,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),Hn!=null&&(utils$1.isFunction(Hn)?ke.paramsSerializer={serialize:Hn}:validator.assertOptions(Hn,{encode:validators.function,serialize:validators.function},!0)),ke.method=(ke.method||this.defaults.method||"get").toLowerCase();let Un=zn&&utils$1.merge(zn.common,zn[ke.method]);zn&&utils$1.forEach(["delete","get","head","post","put","patch","common"],bo=>{delete zn[bo]}),ke.headers=AxiosHeaders.concat(Un,zn);const qn=[];let Xn=!0;this.interceptors.request.forEach(function(Oo){typeof Oo.runWhen=="function"&&Oo.runWhen(ke)===!1||(Xn=Xn&&Oo.synchronous,qn.unshift(Oo.fulfilled,Oo.rejected))});const Kn=[];this.interceptors.response.forEach(function(Oo){Kn.push(Oo.fulfilled,Oo.rejected)});let to,io=0,uo;if(!Xn){const bo=[dispatchRequest.bind(this),void 0];for(bo.unshift.apply(bo,qn),bo.push.apply(bo,Kn),uo=bo.length,to=Promise.resolve(ke);io<uo;)to=to.then(bo[io++],bo[io++]);return to}uo=qn.length;let ho=ke;for(io=0;io<uo;){const bo=qn[io++],Oo=qn[io++];try{ho=bo(ho)}catch(So){Oo.call(this,So);break}}try{to=dispatchRequest.call(this,ho)}catch(bo){return Promise.reject(bo)}for(io=0,uo=Kn.length;io<uo;)to=to.then(Kn[io++],Kn[io++]);return to}getUri(Ce){Ce=mergeConfig(this.defaults,Ce);const ke=buildFullPath(Ce.baseURL,Ce.url);return buildURL(ke,Ce.params,Ce.paramsSerializer)}}utils$1.forEach(["delete","get","head","options"],function(Ce){Axios.prototype[Ce]=function(ke,$n){return this.request(mergeConfig($n||{},{method:Ce,url:ke,data:($n||{}).data}))}});utils$1.forEach(["post","put","patch"],function(Ce){function ke($n){return function(zn,Un,qn){return this.request(mergeConfig(qn||{},{method:Ce,headers:$n?{"Content-Type":"multipart/form-data"}:{},url:zn,data:Un}))}}Axios.prototype[Ce]=ke(),Axios.prototype[Ce+"Form"]=ke(!0)});class CancelToken{constructor(Ce){if(typeof Ce!="function")throw new TypeError("executor must be a function.");let ke;this.promise=new Promise(function(zn){ke=zn});const $n=this;this.promise.then(Hn=>{if(!$n._listeners)return;let zn=$n._listeners.length;for(;zn-- >0;)$n._listeners[zn](Hn);$n._listeners=null}),this.promise.then=Hn=>{let zn;const Un=new Promise(qn=>{$n.subscribe(qn),zn=qn}).then(Hn);return Un.cancel=function(){$n.unsubscribe(zn)},Un},Ce(function(zn,Un,qn){$n.reason||($n.reason=new CanceledError(zn,Un,qn),ke($n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(Ce){if(this.reason){Ce(this.reason);return}this._listeners?this._listeners.push(Ce):this._listeners=[Ce]}unsubscribe(Ce){if(!this._listeners)return;const ke=this._listeners.indexOf(Ce);ke!==-1&&this._listeners.splice(ke,1)}static source(){let Ce;return{token:new CancelToken(function(Hn){Ce=Hn}),cancel:Ce}}}function spread(_n){return function(ke){return _n.apply(null,ke)}}function isAxiosError(_n){return utils$1.isObject(_n)&&_n.isAxiosError===!0}const HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode).forEach(([_n,Ce])=>{HttpStatusCode[Ce]=_n});function createInstance(_n){const Ce=new Axios(_n),ke=bind$1(Axios.prototype.request,Ce);return utils$1.extend(ke,Axios.prototype,Ce,{allOwnKeys:!0}),utils$1.extend(ke,Ce,null,{allOwnKeys:!0}),ke.create=function(Hn){return createInstance(mergeConfig(_n,Hn))},ke}const axios$1=createInstance(defaults$4);axios$1.Axios=Axios;axios$1.CanceledError=CanceledError;axios$1.CancelToken=CancelToken;axios$1.isCancel=isCancel;axios$1.VERSION=VERSION;axios$1.toFormData=toFormData;axios$1.Axio
Line truncated
|
||||
`;for(let So=0;So<=1;So+=Xn){const $o=Ce+(ke-Ce)*zn(So);Kn+=So*100+`%{${Un($o,1-$o)}}
|
||||
`}const to=Kn+`100% {${Un(ke,1-ke)}}
|
||||
}`,io=`__svelte_${hash$1(to)}_${qn}`,uo=get_root_for_style(_n),{stylesheet:ho,rules:bo}=managed_styles.get(uo)||create_style_information(uo,_n);bo[io]||(bo[io]=!0,ho.insertRule(`@keyframes ${io} ${to}`,ho.cssRules.length));const Oo=_n.style.animation||"";return _n.style.animation=`${Oo?`${Oo}, `:""}${io} ${$n}ms linear ${Hn}ms 1 both`,active+=1,io}function delete_rule(_n,Ce){const ke=(_n.style.animation||"").split(", "),$n=ke.filter(Ce?zn=>zn.indexOf(Ce)<0:zn=>zn.indexOf("__svelte")===-1),Hn=ke.length-$n.length;Hn&&(_n.style.animation=$n.join(", "),active-=Hn,active||clear_rules())}function clear_rules(){raf(()=>{active||(managed_styles.forEach(_n=>{const{ownerNode:Ce}=_n.stylesheet;Ce&&detach(Ce)}),managed_styles.clear())})}let current_component;function set_current_component(_n){current_component=_n}function get_current_component(){if(!current_component)throw new Error("Function called outside component initialization");return current_component}function onMount(_n){get_current_component().$$.on_mount.push(_n)}function afterUpdate(_n){get_current_component().$$.after_update.push(_n)}function onDestroy(_n){get_current_component().$$.on_destroy.push(_n)}function createEventDispatcher(){const _n=get_current_component();return(Ce,ke,{cancelable:$n=!1}={})=>{const Hn=_n.$$.callbacks[Ce];if(Hn){const zn=custom_event(Ce,ke,{cancelable:$n});return Hn.slice().forEach(Un=>{Un.call(_n,zn)}),!zn.defaultPrevented}return!0}}function setContext(_n,Ce){return get_current_component().$$.context.set(_n,Ce),Ce}function getContext$1(_n){return get_current_component().$$.context.get(_n)}function bubble(_n,Ce){const ke=_n.$$.callbacks[Ce.type];ke&&ke.slice().forEach($n=>$n.call(this,Ce))}const dirty_components=[],binding_callbacks=[];let render_callbacks=[];const flush_callbacks=[],resolved_promise=Promise.resolve();let update_scheduled=!1;function schedule_update(){update_scheduled||(update_scheduled=!0,resolved_promise.then(flush))}function add_render_callback(_n){render_callbacks.push(_n)}function add_flush_callback(_n){flush_callbacks.push(_n)}const seen_callbacks=new Set;let flushidx=0;function flush(){if(flushidx!==0)return;const _n=current_component;do{try{for(;flushidx<dirty_components.length;){const Ce=dirty_components[flushidx];flushidx++,set_current_component(Ce),update(Ce.$$)}}catch(Ce){throw dirty_components.length=0,flushidx=0,Ce}for(set_current_component(null),dirty_components.length=0,flushidx=0;binding_callbacks.length;)binding_callbacks.pop()();for(let Ce=0;Ce<render_callbacks.length;Ce+=1){const ke=render_callbacks[Ce];seen_callbacks.has(ke)||(seen_callbacks.add(ke),ke())}render_callbacks.length=0}while(dirty_components.length);for(;flush_callbacks.length;)flush_callbacks.pop()();update_scheduled=!1,seen_callbacks.clear(),set_current_component(_n)}function update(_n){if(_n.fragment!==null){_n.update(),run_all(_n.before_update);const Ce=_n.dirty;_n.dirty=[-1],_n.fragment&&_n.fragment.p(_n.ctx,Ce),_n.after_update.forEach(add_render_callback)}}function flush_render_callbacks(_n){const Ce=[],ke=[];render_callbacks.forEach($n=>_n.indexOf($n)===-1?Ce.push($n):ke.push($n)),ke.forEach($n=>$n()),render_callbacks=Ce}let promise;function wait(){return promise||(promise=Promise.resolve(),promise.then(()=>{promise=null})),promise}function dispatch(_n,Ce,ke){_n.dispatchEvent(custom_event(`${Ce?"intro":"outro"}${ke}`))}const outroing=new Set;let outros;function group_outros(){outros={r:0,c:[],p:outros}}function check_outros(){outros.r||run_all(outros.c),outros=outros.p}function transition_in(_n,Ce){_n&&_n.i&&(outroing.delete(_n),_n.i(Ce))}function transition_out(_n,Ce,ke,$n){if(_n&&_n.o){if(outroing.has(_n))return;outroing.add(_n),outros.c.push(()=>{outroing.delete(_n),$n&&(ke&&_n.d(1),$n())}),_n.o(Ce)}else $n&&$n()}const null_transition={duration:0};function create_bidirectional_transition(_n,Ce,ke,$n){let zn=Ce(_n,ke,{direction:"both"}),Un=$n?0:1,qn=null,Xn=null,Kn=null,to;function io(){Kn&&delete_rule(_n,Kn)}function uo(bo,Oo){const So=bo.b-Un;return Oo*=Math.abs(So),{a:Un,b:bo.b,d:So,duration:Oo,start:bo.start,end:bo.start+Oo,group:bo.group}}function ho(bo){const{delay:Oo=0,duration:So=300,easing:$o=identity,tick:Do=noop,css:xo}=zn||null_transition,Io={start:now()+Oo,b:bo};bo||(Io.group=outros,outros.r+=1),"inert"in _n&&(bo?to!==void 0&&(_n.inert=to):(to=_n.inert,_n.inert=!0)),qn||Xn?Xn=Io:(xo&&(io(),Kn=create_rule(_n,Un,bo,So,Oo,$o,xo)),bo&&Do(0,1),qn=uo(Io,So),add_render_callback(()=>dispatch(_n,bo,"start")),loop(Vo=>{if(Xn&&Vo>Xn.start&&(qn=uo(Xn,So),Xn=null,dispatch(_n,qn.b,"start"),xo&&(io(),Kn=create_rule(_n,Un,qn.b,qn.duration,0,$o,zn.css))),qn){if(Vo>=qn.end)Do(Un=qn.b,1-Un),dispatch(_n,qn.b,"end"),Xn||(qn.b?io():--qn.group.r||run_all(qn.group.c)),qn=null;else if(Vo>=qn.start){const Jo=Vo-qn.start;Un=qn.a+qn.d*$o(Jo/qn.duration),Do(Un,1-Un)}}return!!(qn||Xn)}))}return{run(bo){is_function(zn)?wait().then(()=>{zn=zn({direction:bo?"in":"out"}),ho(bo)}):ho(bo)},end(){io(),qn=Xn=null}}}function ensure_array_like(_n)
Line truncated
|
||||
transform: ${Kn} translate(${(1-Oo)*io}${uo}, ${(1-Oo)*ho}${bo});
|
||||
opacity: ${Xn-to*So}`}}function create_if_block$W(_n){let Ce,ke,$n,Hn,zn,Un,qn;return{c(){Ce=element("div"),ke=element("div"),ke.textContent="Success",$n=space$3(),Hn=element("div"),zn=text(_n[1]),attr(ke,"class","title"),attr(Hn,"class","content"),attr(Ce,"class","notice notice-success"),attr(Ce,"role","alert")},m(Xn,Kn){insert$1(Xn,Ce,Kn),append(Ce,ke),append(Ce,$n),append(Ce,Hn),append(Hn,zn),qn=!0},p(Xn,Kn){(!qn||Kn&2)&&set_data(zn,Xn[1])},i(Xn){qn||(Xn&&add_render_callback(()=>{qn&&(Un||(Un=create_bidirectional_transition(Ce,fly,{duration:500},!0)),Un.run(1))}),qn=!0)},o(Xn){Xn&&(Un||(Un=create_bidirectional_transition(Ce,fly,{duration:500},!1)),Un.run(0)),qn=!1},d(Xn){Xn&&detach(Ce),Xn&&Un&&Un.end()}}}function create_fragment$1p(_n){let Ce,ke=_n[0]&&create_if_block$W(_n);return{c(){ke&&ke.c(),Ce=empty$1()},m($n,Hn){ke&&ke.m($n,Hn),insert$1($n,Ce,Hn)},p($n,[Hn]){$n[0]?ke?(ke.p($n,Hn),Hn&1&&transition_in(ke,1)):(ke=create_if_block$W($n),ke.c(),transition_in(ke,1),ke.m(Ce.parentNode,Ce)):ke&&(group_outros(),transition_out(ke,1,1,()=>{ke=null}),check_outros())},i($n){transition_in(ke)},o($n){transition_out(ke)},d($n){$n&&detach(Ce),ke&&ke.d($n)}}}function instance$1p(_n,Ce,ke){let $n,Hn;function zn(Un="Saved"){ke(1,$n=Un),ke(0,Hn=!0),setTimeout(function(){ke(0,Hn=!1)},2e3)}return ke(1,$n="Saved"),ke(0,Hn=!1),[Hn,$n,zn]}class SuccessAlert extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1p,create_fragment$1p,safe_not_equal,{show:2})}get show(){return this.$$.ctx[2]}}function create_fragment$1o(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho,bo,Oo={};return Ce=new SuccessAlert({props:Oo}),_n[4](Ce),io=new SpinnerButton({props:{label:"Enter"}}),{c(){create_component(Ce.$$.fragment),ke=space$3(),$n=element("div"),Hn=element("form"),zn=element("div"),Un=element("h3"),qn=text("Login as "),Xn=text(_n[0]),Kn=space$3(),to=element("div"),create_component(io.$$.fragment),attr(zn,"class","mb-3 text-center"),attr(to,"class","text-center mt-5 d-block"),attr($n,"class","wrapper-tiny")},m(So,$o){mount_component(Ce,So,$o),insert$1(So,ke,$o),insert$1(So,$n,$o),append($n,Hn),append(Hn,zn),append(zn,Un),append(Un,qn),append(Un,Xn),append(Hn,Kn),append(Hn,to),mount_component(io,to,null),uo=!0,ho||(bo=listen(Hn,"submit",_n[2]),ho=!0)},p(So,[$o]){const Do={};Ce.$set(Do),(!uo||$o&1)&&set_data(Xn,So[0])},i(So){uo||(transition_in(Ce.$$.fragment,So),transition_in(io.$$.fragment,So),uo=!0)},o(So){transition_out(Ce.$$.fragment,So),transition_out(io.$$.fragment,So),uo=!1},d(So){So&&(detach(ke),detach($n)),_n[4](null),destroy_component(Ce,So),destroy_component(io),ho=!1,bo()}}}function instance$1o(_n,Ce,ke){const $n=getContext$1("channel");let{email:Hn}=Ce,{token:zn}=Ce,Un;function qn(Kn){Kn.preventDefault(),axios.post($n.lucentUrl+"/verify",{email:Hn,token:zn}).then(to=>{window.location=$n.lucentUrl}).catch(to=>{})}function Xn(Kn){binding_callbacks[Kn?"unshift":"push"](()=>{Un=Kn,ke(1,Un)})}return _n.$$set=Kn=>{"email"in Kn&&ke(0,Hn=Kn.email),"token"in Kn&&ke(3,zn=Kn.token)},[Hn,Un,qn,zn,Xn]}class Verify extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1o,create_fragment$1o,safe_not_equal,{email:0,token:3})}}function create_fragment$1n(_n){let Ce,ke,$n;return{c(){Ce=element("div"),ke=element("div"),$n=text(_n[2]),attr(ke,"class","avatar__letters"),attr(Ce,"class","avatar"),attr(Ce,"title",_n[0]),set_style(Ce,"background-color",_n[3][_n[4]]),set_style(Ce,"height",_n[1]+"px"),set_style(Ce,"width",_n[1]+"px"),set_style(Ce,"font-size",_n[1]/2+"px")},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,ke),append(ke,$n)},p(Hn,[zn]){zn&4&&set_data($n,Hn[2]),zn&1&&attr(Ce,"title",Hn[0]),zn&2&&set_style(Ce,"height",Hn[1]+"px"),zn&2&&set_style(Ce,"width",Hn[1]+"px"),zn&2&&set_style(Ce,"font-size",Hn[1]/2+"px")},i:noop,o:noop,d(Hn){Hn&&detach(Ce)}}}function instance$1n(_n,Ce,ke){let{name:$n}=Ce,{side:Hn=48}=Ce;const zn=["#00AA55","#009FD4","#B381B3","#939393","#E3BC00","#D47500","#DC2A2A","#3ede91","#377dd4","#0256b0","#053d82","#3d026e","#b378e3","#c4065c","#543208","#d97811","#0c6b40"];let Un="";$n.split(" ").length>1?Un=$n.split(" ")[0].charAt(0).toUpperCase()+$n.split(" ")[1].charAt(0).toUpperCase():Un=$n.split(" ")[0].charAt(0).toUpperCase()+$n.split(" ")[0].charAt(1).toUpperCase();let Xn=($n.charCodeAt(1)+$n.length)%19;return _n.$$set=Kn=>{"name"in Kn&&ke(0,$n=Kn.name),"side"in Kn&&ke(1,Hn=Kn.side)},[$n,Hn,Un,zn,Xn]}class Avatar extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1n,create_fragment$1n,safe_not_equal,{name:0,side:1})}}function create_fragment$1m(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho,bo,Oo,So,$o,Do,xo,Io,Vo,Jo,Mo,Go,os,ms;ke=new ErrorAlert({props:{message:_n[2]}});let is={};return Hn=new SuccessAlert({props:is}),_n[8](Hn),qn=new Avatar({props:{name:_n[4].name}}),ho=new SpinnerButton({props:{label:"Update Name"}}),xo=new SpinnerButton({props:{label:"Update Email"}}),{c(){Ce=element("div"),create_component(ke.$$.fragment),$n=space$3(),create_component(Hn.$$.fragment),zn
Line truncated
|
||||
device`),attr(Un,"class","header-small mb-5"),attr(io,"type","text"),attr(io,"class","form-control mb-3"),attr(io,"placeholder","Name"),io.required=!0,attr(to,"class","input-group mb-5"),attr($o,"type","email"),attr($o,"class","form-control mb-3"),attr($o,"placeholder","Email"),$o.required=!0,attr(So,"class","input-group mb-5"),attr(Jo,"class","list-group-item list-group-item-action"),attr(Jo,"href",_n[5].lucentUrl+"/logout"),attr(Vo,"class","list-group"),attr(Ce,"class","wrapper-tiny")},m(Yo,Ys){insert$1(Yo,Ce,Ys),mount_component(ke,Ce,null),append(Ce,$n),mount_component(Hn,Ce,null),append(Ce,zn),append(Ce,Un),mount_component(qn,Un,null),append(Ce,Xn),append(Ce,Kn),append(Kn,to),append(to,io),set_input_value(io,_n[0]),append(to,uo),mount_component(ho,to,null),append(Ce,bo),append(Ce,Oo),append(Oo,So),append(So,$o),set_input_value($o,_n[1]),append(So,Do),mount_component(xo,So,null),append(Ce,Io),append(Ce,Vo),append(Vo,Jo),append(Jo,Mo),Go=!0,os||(ms=[listen(io,"input",_n[9]),listen(Kn,"submit",_n[6]),listen($o,"input",_n[10]),listen(Oo,"submit",_n[7])],os=!0)},p(Yo,[Ys]){const sr={};Ys&4&&(sr.message=Yo[2]),ke.$set(sr);const Js={};Hn.$set(Js),Ys&1&&io.value!==Yo[0]&&set_input_value(io,Yo[0]),Ys&2&&$o.value!==Yo[1]&&set_input_value($o,Yo[1])},i(Yo){Go||(transition_in(ke.$$.fragment,Yo),transition_in(Hn.$$.fragment,Yo),transition_in(qn.$$.fragment,Yo),transition_in(ho.$$.fragment,Yo),transition_in(xo.$$.fragment,Yo),Go=!0)},o(Yo){transition_out(ke.$$.fragment,Yo),transition_out(Hn.$$.fragment,Yo),transition_out(qn.$$.fragment,Yo),transition_out(ho.$$.fragment,Yo),transition_out(xo.$$.fragment,Yo),Go=!1},d(Yo){Yo&&detach(Ce),destroy_component(ke),_n[8](null),destroy_component(Hn),destroy_component(qn),destroy_component(ho),destroy_component(xo),os=!1,run_all(ms)}}}function instance$1m(_n,Ce,ke){const $n=getContext$1("user"),Hn=getContext$1("channel");let zn=$n.name,Un=$n.email,qn="",Xn;function Kn(bo){bo.preventDefault(),ke(2,qn=""),axios.post(Hn.lucentUrl+"/account/update-name",{name:zn}).then(Oo=>{Xn.show()}).catch(Oo=>{var So;ke(2,qn=(So=Oo.response)==null?void 0:So.data.error),console.log({errorMessage:qn})})}function to(bo){bo.preventDefault(),ke(2,qn=""),axios.post(Hn.lucentUrl+"/account/update-email",{email:Un}).then(Oo=>{Xn.show()}).catch(Oo=>{var So;ke(2,qn=(So=Oo.response)==null?void 0:So.data.error),console.log({errorMessage:qn})})}function io(bo){binding_callbacks[bo?"unshift":"push"](()=>{Xn=bo,ke(3,Xn)})}function uo(){zn=this.value,ke(0,zn)}function ho(){Un=this.value,ke(1,Un)}return[zn,Un,qn,Xn,$n,Hn,Kn,to,io,uo,ho]}class Profile extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1m,create_fragment$1m,safe_not_equal,{})}}function create_fragment$1l(_n){let Ce,ke=_n[5].path+"";return{c(){Ce=svg_element("svg"),attr(Ce,"class","bi svelte-r4pd9j"),attr(Ce,"xmlns","http://www.w3.org/2000/svg"),attr(Ce,"width",_n[0]),attr(Ce,"height",_n[1]),attr(Ce,"viewBox",_n[5].viewBox),attr(Ce,"aria-labelledby",_n[2]),attr(Ce,"role","presentation"),attr(Ce,"stroke",_n[4]),attr(Ce,"fill",_n[3])},m($n,Hn){insert$1($n,Ce,Hn),Ce.innerHTML=ke},p($n,[Hn]){Hn&1&&attr(Ce,"width",$n[0]),Hn&2&&attr(Ce,"height",$n[1]),Hn&4&&attr(Ce,"aria-labelledby",$n[2]),Hn&16&&attr(Ce,"stroke",$n[4]),Hn&8&&attr(Ce,"fill",$n[3])},i:noop,o:noop,d($n){$n&&detach(Ce)}}}function instance$1l(_n,Ce,ke){const $n={"trash-can":{path:'<path d="M135.2 17.69C140.6 6.848 151.7 0 163.8 0H284.2C296.3 0 307.4 6.848 312.8 17.69L320 32H416C433.7 32 448 46.33 448 64C448 81.67 433.7 96 416 96H32C14.33 96 0 81.67 0 64C0 46.33 14.33 32 32 32H128L135.2 17.69zM31.1 128H416V448C416 483.3 387.3 512 352 512H95.1C60.65 512 31.1 483.3 31.1 448V128zM111.1 208V432C111.1 440.8 119.2 448 127.1 448C136.8 448 143.1 440.8 143.1 432V208C143.1 199.2 136.8 192 127.1 192C119.2 192 111.1 199.2 111.1 208zM207.1 208V432C207.1 440.8 215.2 448 223.1 448C232.8 448 240 440.8 240 432V208C240 199.2 232.8 192 223.1 192C215.2 192 207.1 199.2 207.1 208zM304 208V432C304 440.8 311.2 448 320 448C328.8 448 336 440.8 336 432V208C336 199.2 328.8 192 320 192C311.2 192 304 199.2 304 208z"/>',viewBox:"0 0 448 512"},"circle-chevron-down":{path:'<path d="M256 0C114.6 0 0 114.6 0 256c0 141.4 114.6 256 256 256s256-114.6 256-256C512 114.6 397.4 0 256 0zM390.6 246.6l-112 112C272.4 364.9 264.2 368 256 368s-16.38-3.125-22.62-9.375l-112-112c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L256 290.8l89.38-89.38c12.5-12.5 32.75-12.5 45.25 0S403.1 234.1 390.6 246.6z"/>',viewBox:"0 0 512 512"},"circle-chevron-up":{path:'<path d="M256 0C114.6 0 0 114.6 0 256c0 141.4 114.6 256 256 256s256-114.6 256-256C512 114.6 397.4 0 256 0zM390.6 310.6c-12.5 12.5-32.75 12.5-45.25 0L256 221.3L166.6 310.6c-12.5 12.5-32.75 12.5-45.25 0s-12.5-32.75 0-45.25l112-112C239.6 147.1 247.8 144 256 144s16.38 3.125 22.62 9.375l112 112C403.1 277.9 403.1 298.1 390.6 310.6z"/>',viewBox:"0 0 512 512"},ellipsis:{path:'<path d="M120 256C120 286.9 94.93 312 64 312C33.07 312 8 286.9 8 256C8 225.1 33.07 200 64 200C94.
Line truncated
|
||||
* @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
|
||||
*/lodash.exports;(function(_n,Ce){(function(){var ke,$n="4.17.21",Hn=200,zn="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",Un="Expected a function",qn="Invalid `variable` option passed into `_.template`",Xn="__lodash_hash_undefined__",Kn=500,to="__lodash_placeholder__",io=1,uo=2,ho=4,bo=1,Oo=2,So=1,$o=2,Do=4,xo=8,Io=16,Vo=32,Jo=64,Mo=128,Go=256,os=512,ms=30,is="...",Yo=800,Ys=16,sr=1,Js=2,ko=3,gs=1/0,xs=9007199254740991,Qr=17976931348623157e292,cr=NaN,ws=4294967295,Fs=ws-1,Br=ws>>>1,_r=[["ary",Mo],["bind",So],["bindKey",$o],["curry",xo],["curryRight",Io],["flip",os],["partial",Vo],["partialRight",Jo],["rearg",Go]],ha="[object Arguments]",hs="[object Array]",Qs="[object AsyncFunction]",zo="[object Boolean]",el="[object Date]",ga="[object DOMException]",Ca="[object Error]",za="[object Function]",Il="[object GeneratorFunction]",Zs="[object Map]",Sr="[object Number]",Us="[object Null]",fs="[object Object]",dr="[object Promise]",Vr="[object Proxy]",nr="[object RegExp]",Kr="[object Set]",ra="[object String]",Ml="[object Symbol]",xa="[object Undefined]",Nl="[object WeakMap]",Zc="[object WeakSet]",cc="[object ArrayBuffer]",gc="[object DataView]",nc="[object Float32Array]",Ed="[object Float64Array]",Zl="[object Int8Array]",Vl="[object Int16Array]",Fc="[object Int32Array]",qa="[object Uint8Array]",Ya="[object Uint8ClampedArray]",kc="[object Uint16Array]",Yl="[object Uint32Array]",rd=/\b__p \+= '';/g,Al=/\b(__p \+=) '' \+/g,gd=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Rr=/&(?:amp|lt|gt|quot|#39);/g,Pl=/[&<>"']/g,Su=RegExp(Rr.source),vs=RegExp(Pl.source),Es=/<%-([\s\S]+?)%>/g,Ks=/<%([\s\S]+?)%>/g,pr=/<%=([\s\S]+?)%>/g,ia=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ka=/^\w*$/,Ma=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Mr=/[\\^$.*+?()[\]{}|]/g,il=RegExp(Mr.source),Na=/^\s+/,vl=/\s/,Rc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Vc=/\{\n\/\* \[wrapped with (.+)\] \*/,xc=/,? & /,zc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ad=/[()=,{}\[\]\/\s]/,Bh=/\\(\\)?/g,Vu=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ts=/\w*$/,ks=/^[-+]0x[0-9a-f]+$/i,ir=/^0b[01]+$/i,br=/^\[object .+?Constructor\]$/,Aa=/^0o[0-7]+$/i,Ba=/^(?:0|[1-9]\d*)$/,_l=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Hc=/($^)/,Ds=/['\n\r\u2028\u2029\\]/g,tl="\\ud800-\\udfff",wu="\\u0300-\\u036f",qu="\\ufe20-\\ufe2f",Md="\\u20d0-\\u20ff",bc=wu+qu+Md,nm="\\u2700-\\u27bf",Ff="a-z\\xdf-\\xf6\\xf8-\\xff",Ud="\\xac\\xb1\\xd7\\xf7",ld="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",oc="\\u2000-\\u206f",Dc=" \\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",bd="A-Z\\xc0-\\xd6\\xd8-\\xde",Nd="\\ufe0e\\ufe0f",ih=Ud+ld+oc+Dc,om="['’]",sm="["+tl+"]",fc="["+ih+"]",Td="["+bc+"]",Jd="\\d+",Em="["+nm+"]",ef="["+Ff+"]",Cu="[^"+tl+ih+Jd+nm+Ff+bd+"]",Qc="\\ud83c[\\udffb-\\udfff]",Cf="(?:"+Td+"|"+Qc+")",qm="[^"+tl+"]",Oc="(?:\\ud83c[\\udde6-\\uddff]){2}",cd="[\\ud800-\\udbff][\\udc00-\\udfff]",vd="["+bd+"]",ju="\\u200d",Xf="(?:"+ef+"|"+Cu+")",Sh="(?:"+vd+"|"+Cu+")",Zd="(?:"+om+"(?:d|ll|m|re|s|t|ve))?",ah="(?:"+om+"(?:D|LL|M|RE|S|T|VE))?",lh=Cf+"?",Bp="["+Nd+"]?",ch="(?:"+ju+"(?:"+[qm,Oc,cd].join("|")+")"+Bp+lh+")*",bp="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",kf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Fh=Bp+lh+ch,jm="(?:"+[Em,Oc,cd].join("|")+")"+Fh,Fp="(?:"+[qm+Td+"?",Td,Oc,cd,sm].join("|")+")",Eg=RegExp(om,"g"),rs=RegExp(Td,"g"),As=RegExp(Qc+"(?="+Qc+")|"+Fp+Fh,"g"),Ws=RegExp([vd+"?"+ef+"+"+Zd+"(?="+[fc,vd,"$"].join("|")+")",Sh+"+"+ah+"(?="+[fc,vd+Xf,"$"].join("|")+")",vd+"?"+Xf+"+"+Zd,vd+"+"+ah,kf,bp,Jd,jm].join("|"),"g"),rr=RegExp("["+ju+tl+bc+Nd+"]"),Fr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wa=["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"],Nc=-1,xl={};xl[nc]=xl[Ed]=xl[Zl]=xl[Vl]=xl[Fc]=xl[qa]=xl[Ya]=xl[kc]=xl[Yl]=!0,xl[ha]=xl[hs]=xl[cc]=xl[zo]=xl[gc]=xl[el]=xl[Ca]=xl[za]=xl[Zs]=xl[Sr]=xl[fs]=xl[nr]=xl[Kr]=xl[ra]=xl[Nl]=!1;var ul={};ul[ha]=ul[hs]=ul[cc]=ul[gc]=ul[zo]=ul[el]=ul[nc]=ul[Ed]=ul[Zl]=ul[Vl]=ul[Fc]=ul[Zs]=ul[Sr]=ul[fs]=ul[nr]=ul[Kr]=ul[ra]=ul[Ml]=ul[qa]=ul[Ya]=ul[kc]=ul[Yl]=!0,ul[Ca]=ul[za]=ul[Nl]=!1;var lu={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:Line truncated
|
||||
/* [wrapped with `+co+`] */
|
||||
`)}function gS(so){return $l(so)||bf(so)||!!(Ag&&so&&so[Ag])}function K1(so,co){var wo=typeof so;return co=co??xs,!!co&&(wo=="number"||wo!="symbol"&&Ba.test(so))&&so>-1&&so%1==0&&so<co}function gm(so,co,wo){if(!Vd(wo))return!1;var Ho=typeof co;return(Ho=="number"?bu(wo)&&K1(co,wo.length):Ho=="string"&&co in wo)?Dd(wo[co],so):!1}function J1(so,co){if($l(so))return!1;var wo=typeof so;return wo=="number"||wo=="symbol"||wo=="boolean"||so==null||Cd(so)?!0:ka.test(so)||!ia.test(so)||co!=null&&so in Uc(co)}function Dv(so){var co=typeof so;return co=="string"||co=="number"||co=="symbol"||co=="boolean"?so!=="__proto__":so===null}function $0(so){var co=$v(so),wo=ss[co];if(typeof wo!="function"||!(co in Xc.prototype))return!1;if(so===wo)return!0;var Ho=ig(wo);return!!Ho&&so===Ho[0]}function Mv(so){return!!Af&&Af in so}var HO=Ku?f1:W0;function Ep(so){var co=so&&so.constructor,wo=typeof co=="function"&&co.prototype||Id;return so===wo}function ag(so){return so===so&&!Vd(so)}function Nv(so,co){return function(wo){return wo==null?!1:wo[so]===co&&(co!==ke||so in Uc(wo))}}function Tp(so){var co=Pp(so,function(Ho){return wo.size===Kn&&wo.clear(),Ho}),wo=co.cache;return co}function QO(so,co){var wo=so[1],Ho=co[1],ts=wo|Ho,Os=ts<(So|$o|Mo),Is=Ho==Mo&&wo==xo||Ho==Mo&&wo==Go&&so[7].length<=co[8]||Ho==(Mo|Go)&&co[7].length<=co[8]&&wo==xo;if(!(Os||Is))return so;Ho&So&&(so[2]=co[2],ts|=wo&So?0:Do);var qs=co[3];if(qs){var mr=so[3];so[3]=mr?Hy(mr,qs,co[4]):qs,so[4]=mr?Vf(so[3],to):co[4]}return qs=co[5],qs&&(mr=so[5],so[5]=mr?Z1(mr,qs,co[6]):qs,so[6]=mr?Vf(so[5],to):co[6]),qs=co[7],qs&&(so[7]=qs),Ho&Mo&&(so[8]=so[8]==null?co[8]:df(so[8],co[8])),so[9]==null&&(so[9]=co[9]),so[0]=co[0],so[1]=ts,so}function dC(so){var co=[];if(so!=null)for(var wo in Uc(so))co.push(wo);return co}function Lv(so){return e1.call(so)}function i1(so,co,wo){return co=Sd(co===ke?so.length-1:co,0),function(){for(var Ho=arguments,ts=-1,Os=Sd(Ho.length-co,0),Is=Tr(Os);++ts<Os;)Is[ts]=Ho[co+ts];ts=-1;for(var qs=Tr(co+1);++ts<co;)qs[ts]=Ho[ts];return qs[co]=wo(Is),jc(so,this,qs)}}function fC(so,co){return co.length<2?so:Pf(so,Fl(co,0,-1))}function Iv(so,co){for(var wo=so.length,Ho=df(co.length,wo),ts=Ah(so);Ho--;){var Os=co[Ho];so[Ho]=K1(Os,wo)?ts[Os]:ke}return so}function eb(so,co){if(!(co==="constructor"&&typeof so[co]=="function")&&co!="__proto__")return so[co]}var Ap=yS(mm),ph=tf||function(so,co){return Uo.setTimeout(so,co)},bS=yS(Nb);function vS(so,co,wo){var Ho=co+"";return bS(so,P2(Ho,VO(ET(Ho),wo)))}function yS(so){var co=0,wo=0;return function(){var Ho=vv(),ts=Ys-(Ho-wo);if(wo=Ho,ts>0){if(++co>=Yo)return arguments[0]}else co=0;return so.apply(ke,arguments)}}function Bv(so,co){var wo=-1,Ho=so.length,ts=Ho-1;for(co=co===ke?Ho:co;++wo<co;){var Os=Jp(wo,ts),Is=so[Os];so[Os]=so[wo],so[wo]=Is}return so.length=co,so}var bm=Tp(function(so){var co=[];return so.charCodeAt(0)===46&&co.push(""),so.replace(Ma,function(wo,Ho,ts,Os){co.push(ts?Os.replace(Bh,"$1"):Ho||wo)}),co});function Bm(so){if(typeof so=="string"||Cd(so))return so;var co=so+"";return co=="0"&&1/so==-gs?"-0":co}function a1(so){if(so!=null){try{return Rm.call(so)}catch{}try{return so+""}catch{}}return""}function VO(so,co){return El(_r,function(wo){var Ho="_."+wo[0];co&wo[1]&&!cu(so,Ho)&&so.push(Ho)}),so.sort()}function hC(so){if(so instanceof Xc)return so.clone();var co=new Ch(so.__wrapped__,so.__chain__);return co.__actions__=Ah(so.__actions__),co.__index__=so.__index__,co.__values__=so.__values__,co}function mC(so,co,wo){(wo?gm(so,co,wo):co===ke)?co=1:co=Sd(Ic(co),0);var Ho=so==null?0:so.length;if(!Ho||co<1)return[];for(var ts=0,Os=0,Is=Tr(lm(Ho/co));ts<Ho;)Is[Os++]=Fl(so,ts,ts+=co);return Is}function OS(so){for(var co=-1,wo=so==null?0:so.length,Ho=0,ts=[];++co<wo;){var Os=so[co];Os&&(ts[Ho++]=Os)}return ts}function Fv(){var so=arguments.length;if(!so)return[];for(var co=Tr(so-1),wo=arguments[0],Ho=so;Ho--;)co[Ho-1]=arguments[Ho];return vp($l(wo)?Ah(wo):[wo],hd(co,1))}var Hv=Sc(function(so,co){return vf(so)?Bd(so,hd(co,1,vf,!0)):[]}),zO=Sc(function(so,co){var wo=lg(co);return vf(wo)&&(wo=ke),vf(so)?Bd(so,hd(co,1,vf,!0),Ll(wo,2)):[]}),$2=Sc(function(so,co){var wo=lg(co);return vf(wo)&&(wo=ke),vf(so)?Bd(so,hd(co,1,vf,!0),ke,wo):[]});function WO(so,co,wo){var Ho=so==null?0:so.length;return Ho?(co=wo||co===ke?1:Ic(co),Fl(so,co<0?0:co,Ho)):[]}function Qv(so,co,wo){var Ho=so==null?0:so.length;return Ho?(co=wo||co===ke?1:Ic(co),co=Ho-co,Fl(so,0,co<0?0:co)):[]}function R2(so,co){return so&&so.length?o1(so,Ll(co,3),!0,!0):[]}function zy(so,co){return so&&so.length?o1(so,Ll(co,3),!0):[]}function _S(so,co,wo,Ho){var ts=so==null?0:so.length;return ts?(wo&&typeof wo!="number"&&gm(so,co,wo)&&(wo=0,Ho=ts),k0(so,co,wo,Ho)):[]}function vm(so,co,wo){var Ho=so==null?0:so.length;if(!Ho)return-1;var ts=wo==null?0:Ic(wo);return ts<0&&(ts=Sd(Ho+ts,0)),dd(so,Ll(co,3),ts)}function Wy(so,co,wo){var Ho=so==null?0:so.length;if(!Ho)return-1;var ts=Ho-1;return wo!==ke&&(ts=Ic(wo),ts=wo<0?Sd(Ho+ts,0):df(ts,Ho-1)),dd(so,Ll(co,3),ts,!0)
Line truncated
|
||||
`;so.replace(ja,function(Ul,nu,vu,nh,Mh,Rp){return vu||(vu=nh),ua+=so.slice(Xr,Rp).replace(Ds,Yf),nu&&(qs=!0,ua+=`' +
|
||||
__e(`+nu+`) +
|
||||
'`),Mh&&(mr=!0,ua+=`';
|
||||
`+Mh+`;
|
||||
__p += '`),vu&&(ua+=`' +
|
||||
((__t = (`+vu+`)) == null ? '' : __t) +
|
||||
'`),Xr=Rp+Ul.length,Ul}),ua+=`';
|
||||
`;var Kl=iu.call(co,"variable")&&co.variable;if(!Kl)ua=`with (obj) {
|
||||
`+ua+`
|
||||
}
|
||||
`;else if(ad.test(Kl))throw new zl(qn);ua=(mr?ua.replace(rd,""):ua).replace(Al,"$1").replace(gd,"$1;"),ua="function("+(Kl||"obj")+`) {
|
||||
`+(Kl?"":`obj || (obj = {});
|
||||
`)+"var __t, __p = ''"+(qs?", __e = _.escape":"")+(mr?`, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
`:`;
|
||||
`)+ua+`return __p
|
||||
}`;var Pc=zC(function(){return _c(Os,wl+"return "+ua).apply(ke,Is)});if(Pc.source=ua,NS(Pc))throw Pc;return Pc}function lx(so){return Zu(so).toLowerCase()}function f_(so){return Zu(so).toUpperCase()}function cx(so,co,wo){if(so=Zu(so),so&&(wo||co===ke))return Tf(so);if(!so||!(co=Wu(co)))return so;var Ho=zf(so),ts=zf(co),Os=Vh(Ho,ts),Is=zp(Ho,ts)+1;return Cp(Ho,Os,Is).join("")}function VC(so,co,wo){if(so=Zu(so),so&&(wo||co===ke))return so.slice(0,b0(so)+1);if(!so||!(co=Wu(co)))return so;var Ho=zf(so),ts=zp(Ho,zf(co))+1;return Cp(Ho,0,ts).join("")}function sy(so,co,wo){if(so=Zu(so),so&&(wo||co===ke))return so.replace(Na,"");if(!so||!(co=Wu(co)))return so;var Ho=zf(so),ts=Vh(Ho,zf(co));return Cp(Ho,ts).join("")}function jS(so,co){var wo=ms,Ho=is;if(Vd(co)){var ts="separator"in co?co.separator:ts;wo="length"in co?Ic(co.length):wo,Ho="omission"in co?Wu(co.omission):Ho}so=Zu(so);var Os=so.length;if(jd(so)){var Is=zf(so);Os=Is.length}if(wo>=Os)return so;var qs=wo-Wp(Ho);if(qs<1)return Ho;var mr=Is?Cp(Is,0,qs).join(""):so.slice(0,qs);if(ts===ke)return mr+Ho;if(Is&&(qs+=mr.length-qs),Jy(ts)){if(so.slice(qs).search(ts)){var Xr,jr=mr;for(ts.global||(ts=D1(ts.source,Zu(Ts.exec(ts))+"g")),ts.lastIndex=0;Xr=ts.exec(jr);)var ua=Xr.index;mr=mr.slice(0,ua===ke?qs:ua)}}else if(so.indexOf(Wu(ts),qs)!=qs){var ja=mr.lastIndexOf(ts);ja>-1&&(mr=mr.slice(0,ja))}return mr+Ho}function XS(so){return so=Zu(so),so&&Su.test(so)?so.replace(Rr,Cs):so}var YS=j1(function(so,co,wo){return so+(wo?" ":"")+co.toUpperCase()}),h_=kv("toUpperCase");function m_(so,co,wo){return so=Zu(so),co=wo?ke:co,co===ke?$m(so)?Kg(so):A1(so):so.match(co)||[]}var zC=Sc(function(so,co){try{return jc(so,ke,co)}catch(wo){return NS(wo)?wo:new zl(wo)}}),p_=Y1(function(so,co){return El(co,function(wo){wo=Bm(wo),Nm(so,wo,Yd(so[wo],so))}),so});function g_(so){var co=so==null?0:so.length,wo=Ll();return so=co?ud(so,function(Ho){if(typeof Ho[1]!="function")throw new _d(Un);return[wo(Ho[0]),Ho[1]]}):[],Sc(function(Ho){for(var ts=-1;++ts<co;){var Os=so[ts];if(jc(Os[0],this,Ho))return jc(Os[1],this,Ho)}})}function ux(so){return Gf(td(so,io))}function rO(so){return function(){return so}}function WC(so,co){return so==null||so!==so?co:so}var dx=Tv(),GS=Tv(!0);function lp(so){return so}function jb(so){return _o(typeof so=="function"?so:td(so,io))}function fx(so){return vr(td(so,io))}function KS(so,co){return zr(so,td(co,io))}var hx=Sc(function(so,co){return function(wo){return np(wo,so,co)}}),mx=Sc(function(so,co){return function(wo){return np(so,wo,co)}});function JS(so,co,wo){var Ho=th(co),ts=Mb(co,Ho);wo==null&&!(Vd(co)&&(ts.length||!Ho.length))&&(wo=co,co=so,so=this,ts=Mb(co,th(co)));var Os=!(Vd(wo)&&"chain"in wo)||!!wo.chain,Is=f1(so);return El(ts,function(qs){var mr=co[qs];so[qs]=mr,Is&&(so.prototype[qs]=function(){var Xr=this.__chain__;if(Os||Xr){var jr=so(this.__wrapped__),ua=jr.__actions__=Ah(this.__actions__);return ua.push({func:mr,args:arguments,thisArg:so}),jr.__chain__=Xr,jr}return mr.apply(so,vp([this.value()],arguments))})}),so}function UC(){return Uo._===this&&(Uo._=M1),this}function ew(){}function Zf(so){return so=Ic(so),Sc(function(co){return Ol(co,so)})}var DT=Av(ud),ry=Av(hu),b_=Av(Pm);function tw(so){return J1(so)?qd(Bm(so)):Uh(so)}function nw(so){return function(co){return so==null?ke:Pf(so,co)}}var ZC=LO(),qC=LO(!0);function cb(){return[]}function W0(){return!1}function px(){return{}}function gx(){return""}function iO(){return!0}function ow(so,co){if(so=Ic(so),so<1||so>xs)return[];var wo=ws,Ho=df(so,ws);co=Ll(co),so-=ws;for(var ts=Gc(Ho,co);++wo<so;)co(wo);return ts}function jC(so){return $l(so)?ud(so,Bm):Cd(so)?[so]:Ah(bm(Zu(so)))}function _f(so){var co=++am;return Zu(so)+co}var XC=og(function(so,co){return so+co},0),sw=Qy("ceil"),MT=og(function(so,co){return so/co},1),iy=Qy("floor");function bx(so){return so&&so.length?Kf(so,lp,Mg):ke}function YC(so,co){return so&&so.length?Kf(so,Ll(co,2),Mg):ke}function rw(so){return lf(so,lp)}function aO(so,co){return lf(so,Ll(co,2))}function v_(so){return so&&so.length?Kf(so,lp,as):ke}function ay(so,co){return so&&so.length?Kf(so,Ll(co,2),as):ke}var vx=og(function(so,co){return so*co},1),Xb=Qy("round"),GC=og(function(so,co){return so-co},0);function Yb(so){return so&&so.length?Xg(so,lp):0}function Gb(so,co){return so&&so.length?Xg(so,Ll(co,2)):0}return ss.after=tu,ss.ary=Gv,ss.assign=U2,ss.assignIn=bh,ss.assignInWith=Zb,ss.assignWith=Z2,ss.at=q2,ss.before=e_,ss.bind=Yd,ss.bindAll=p_,ss.bindKey=Hg,ss.castArray=s_,ss.chain=Fm,ss.chunk=mC,ss.compact=OS,ss.concat=Fv,ss.cond=g_,ss.conforms=ux,ss.constant=rO,ss.countBy=qv,ss.create=HS,ss.curry=sb,ss.curryRight=t_,ss.debounce=jy,ss.defaults=j2,ss.defaultsDeep=AC,ss.defer=Xy,ss.delay=TS,ss.difference=Hv,ss.differenceBy=zO,ss.differenceWith=$2,ss.drop=WO,ss.dropRight=Qv,ss.dropRightWhile=R2,ss.dropWhile=zy,ss.fill=_S,ss.filter=I0,ss.flatMap=wC,ss.flatMapDeep=F0,ss.flatMapDepth=Vb,ss.flatten=SS,ss.flattenDeep=UO,ss.flattenDepth=TT,ss.flip=n_,ss.flow=dx,ss.flowRight=GS,ss.fromPai
Line truncated
|
||||
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
||||
* http://github.com/janl/mustache.js
|
||||
*/var objectToString=Object.prototype.toString,isArray=Array.isArray||function(Ce){return objectToString.call(Ce)==="[object Array]"};function isFunction(_n){return typeof _n=="function"}function typeStr(_n){return isArray(_n)?"array":typeof _n}function escapeRegExp(_n){return _n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function hasProperty(_n,Ce){return _n!=null&&typeof _n=="object"&&Ce in _n}function primitiveHasOwnProperty(_n,Ce){return _n!=null&&typeof _n!="object"&&_n.hasOwnProperty&&_n.hasOwnProperty(Ce)}var regExpTest=RegExp.prototype.test;function testRegExp(_n,Ce){return regExpTest.call(_n,Ce)}var nonSpaceRe=/\S/;function isWhitespace(_n){return!testRegExp(nonSpaceRe,_n)}var entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function escapeHtml(_n){return String(_n).replace(/[&<>"'`=\/]/g,function(ke){return entityMap[ke]})}var whiteRe=/\s*/,spaceRe=/\s+/,equalsRe=/\s*=/,curlyRe=/\s*\}/,tagRe=/#|\^|\/|>|\{|&|=|!/;function parseTemplate(_n,Ce){if(!_n)return[];var ke=!1,$n=[],Hn=[],zn=[],Un=!1,qn=!1,Xn="",Kn=0;function to(){if(Un&&!qn)for(;zn.length;)delete Hn[zn.pop()];else zn=[];Un=!1,qn=!1}var io,uo,ho;function bo(Go){if(typeof Go=="string"&&(Go=Go.split(spaceRe,2)),!isArray(Go)||Go.length!==2)throw new Error("Invalid tags: "+Go);io=new RegExp(escapeRegExp(Go[0])+"\\s*"),uo=new RegExp("\\s*"+escapeRegExp(Go[1])),ho=new RegExp("\\s*"+escapeRegExp("}"+Go[1]))}bo(Ce||mustache.tags);for(var Oo=new Scanner(_n),So,$o,Do,xo,Io,Vo;!Oo.eos();){if(So=Oo.pos,Do=Oo.scanUntil(io),Do)for(var Jo=0,Mo=Do.length;Jo<Mo;++Jo)xo=Do.charAt(Jo),isWhitespace(xo)?(zn.push(Hn.length),Xn+=xo):(qn=!0,ke=!0,Xn+=" "),Hn.push(["text",xo,So,So+1]),So+=1,xo===`
|
||||
`&&(to(),Xn="",Kn=0,ke=!1);if(!Oo.scan(io))break;if(Un=!0,$o=Oo.scan(tagRe)||"name",Oo.scan(whiteRe),$o==="="?(Do=Oo.scanUntil(equalsRe),Oo.scan(equalsRe),Oo.scanUntil(uo)):$o==="{"?(Do=Oo.scanUntil(ho),Oo.scan(curlyRe),Oo.scanUntil(uo),$o="&"):Do=Oo.scanUntil(uo),!Oo.scan(uo))throw new Error("Unclosed tag at "+Oo.pos);if($o==">"?Io=[$o,Do,So,Oo.pos,Xn,Kn,ke]:Io=[$o,Do,So,Oo.pos],Kn++,Hn.push(Io),$o==="#"||$o==="^")$n.push(Io);else if($o==="/"){if(Vo=$n.pop(),!Vo)throw new Error('Unopened section "'+Do+'" at '+So);if(Vo[1]!==Do)throw new Error('Unclosed section "'+Vo[1]+'" at '+So)}else $o==="name"||$o==="{"||$o==="&"?qn=!0:$o==="="&&bo(Do)}if(to(),Vo=$n.pop(),Vo)throw new Error('Unclosed section "'+Vo[1]+'" at '+Oo.pos);return nestTokens(squashTokens(Hn))}function squashTokens(_n){for(var Ce=[],ke,$n,Hn=0,zn=_n.length;Hn<zn;++Hn)ke=_n[Hn],ke&&(ke[0]==="text"&&$n&&$n[0]==="text"?($n[1]+=ke[1],$n[3]=ke[3]):(Ce.push(ke),$n=ke));return Ce}function nestTokens(_n){for(var Ce=[],ke=Ce,$n=[],Hn,zn,Un=0,qn=_n.length;Un<qn;++Un)switch(Hn=_n[Un],Hn[0]){case"#":case"^":ke.push(Hn),$n.push(Hn),ke=Hn[4]=[];break;case"/":zn=$n.pop(),zn[5]=Hn[2],ke=$n.length>0?$n[$n.length-1][4]:Ce;break;default:ke.push(Hn)}return Ce}function Scanner(_n){this.string=_n,this.tail=_n,this.pos=0}Scanner.prototype.eos=function(){return this.tail===""};Scanner.prototype.scan=function(Ce){var ke=this.tail.match(Ce);if(!ke||ke.index!==0)return"";var $n=ke[0];return this.tail=this.tail.substring($n.length),this.pos+=$n.length,$n};Scanner.prototype.scanUntil=function(Ce){var ke=this.tail.search(Ce),$n;switch(ke){case-1:$n=this.tail,this.tail="";break;case 0:$n="";break;default:$n=this.tail.substring(0,ke),this.tail=this.tail.substring(ke)}return this.pos+=$n.length,$n};function Context$1(_n,Ce){this.view=_n,this.cache={".":this.view},this.parent=Ce}Context$1.prototype.push=function(Ce){return new Context$1(Ce,this)};Context$1.prototype.lookup=function(Ce){var ke=this.cache,$n;if(ke.hasOwnProperty(Ce))$n=ke[Ce];else{for(var Hn=this,zn,Un,qn,Xn=!1;Hn;){if(Ce.indexOf(".")>0)for(zn=Hn.view,Un=Ce.split("."),qn=0;zn!=null&&qn<Un.length;)qn===Un.length-1&&(Xn=hasProperty(zn,Un[qn])||primitiveHasOwnProperty(zn,Un[qn])),zn=zn[Un[qn++]];else zn=Hn.view[Ce],Xn=hasProperty(Hn.view,Ce);if(Xn){$n=zn;break}Hn=Hn.parent}ke[Ce]=$n}return isFunction($n)&&($n=$n.call(this.view)),$n};function Writer(){this.templateCache={_cache:{},set:function(Ce,ke){this._cache[Ce]=ke},get:function(Ce){return this._cache[Ce]},clear:function(){this._cache={}}}}Writer.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};Writer.prototype.parse=function(Ce,ke){var $n=this.templateCache,Hn=Ce+":"+(ke||mustache.tags).join(":"),zn=typeof $n<"u",Un=zn?$n.get(Hn):void 0;return Un==null&&(Un=parseTemplate(Ce,ke),zn&&$n.set(Hn,Un)),Un};Writer.prototype.render=function(Ce,ke,$n,Hn){var zn=this.getConfigTags(Hn),Un=this.parse(Ce,zn),qn=ke instanceof Context$1?ke:new Context$1(ke,void 0);return this.renderTokens(Un,qn,$n,Ce,Hn)};Writer.prototype.renderTokens=function(Ce,ke,$n,Hn,zn){for(var Un="",qn,Xn,Kn,to=0,io=Ce.length;to<io;++to)Kn=void 0,qn=Ce[to],Xn=qn[0],Xn==="#"?Kn=this.renderSection(qn,ke,$n,Hn,zn):Xn==="^"?Kn=this.renderInverted(qn,ke,$n,Hn,zn):Xn===">"?Kn=this.renderPartial(qn,ke,$n,zn):Xn==="&"?Kn=this.unescapedValue(qn,ke):Xn==="name"?Kn=this.escapedValue(qn,ke,zn):Xn==="text"&&(Kn=this.rawValue(qn)),Kn!==void 0&&(Un+=Kn);return Un};Writer.prototype.renderSection=function(Ce,ke,$n,Hn,zn){var Un=this,qn="",Xn=ke.lookup(Ce[1]);function Kn(uo){return Un.render(uo,ke,$n,zn)}if(Xn){if(isArray(Xn))for(var to=0,io=Xn.length;to<io;++to)qn+=this.renderTokens(Ce[4],ke.push(Xn[to]),$n,Hn,zn);else if(typeof Xn=="object"||typeof Xn=="string"||typeof Xn=="number")qn+=this.renderTokens(Ce[4],ke.push(Xn),$n,Hn,zn);else if(isFunction(Xn)){if(typeof Hn!="string")throw new Error("Cannot use higher-order sections without the original template");Xn=Xn.call(ke.view,Hn.slice(Ce[3],Ce[5]),Kn),Xn!=null&&(qn+=Xn)}else qn+=this.renderTokens(Ce[4],ke,$n,Hn,zn);return qn}};Writer.prototype.renderInverted=function(Ce,ke,$n,Hn,zn){var Un=ke.lookup(Ce[1]);if(!Un||isArray(Un)&&Un.length===0)return this.renderTokens(Ce[4],ke,$n,Hn,zn)};Writer.prototype.indentPartial=function(Ce,ke,$n){for(var Hn=ke.replace(/[^ \t]/g,""),zn=Ce.split(`
|
||||
`),Un=0;Un<zn.length;Un++)zn[Un].length&&(Un>0||!$n)&&(zn[Un]=Hn+zn[Un]);return zn.join(`
|
||||
`)};Writer.prototype.renderPartial=function(Ce,ke,$n,Hn){if($n){var zn=this.getConfigTags(Hn),Un=isFunction($n)?$n(Ce[1]):$n[Ce[1]];if(Un!=null){var qn=Ce[6],Xn=Ce[5],Kn=Ce[4],to=Un;Xn==0&&Kn&&(to=this.indentPartial(Un,Kn,qn));var io=this.parse(to,zn);return this.renderTokens(io,ke,$n,to,Hn)}}};Writer.prototype.unescapedValue=function(Ce,ke){var $n=ke.lookup(Ce[1]);if($n!=null)return $n};Writer.prototype.escapedValue=function(Ce,ke,$n){var Hn=this.getConfigEscape($n)||mustache.escape,zn=ke.lookup(Ce[1]);if(zn!=null)return typeof zn=="number"&&Hn===mustache.escape?String(zn):Hn(zn)};Writer.prototype.rawValue=function(Ce){return Ce[1]};Writer.prototype.getConfigTags=function(Ce){return isArray(Ce)?Ce:Ce&&typeof Ce=="object"?Ce.tags:void 0};Writer.prototype.getConfigEscape=function(Ce){if(Ce&&typeof Ce=="object"&&!isArray(Ce))return Ce.escape};var mustache={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(_n){defaultWriter.templateCache=_n},get templateCache(){return defaultWriter.templateCache}},defaultWriter=new Writer;mustache.clearCache=function(){return defaultWriter.clearCache()};mustache.parse=function(Ce,ke){return defaultWriter.parse(Ce,ke)};mustache.render=function(Ce,ke,$n,Hn){if(typeof Ce!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+typeStr(Ce)+'" was given as the first argument for mustache#render(template, view, partials)');return defaultWriter.render(Ce,ke,$n,Hn)};mustache.escape=escapeHtml;mustache.Scanner=Scanner;mustache.Context=Context$1;mustache.Writer=Writer;function previewTitle(_n,Ce,ke){let $n=_n.find(Un=>Un.name===(Ce==null?void 0:Ce.schema));if(!($n!=null&&$n.cardTitle))return noTemplate($n,Ce);let Hn=Ce.data,zn=mustache.render($n.cardTitle,Hn);return!zn||zn===""?noTemplate($n,Ce):stripHtml(zn.slice(0,300))}function noTemplate(_n,Ce){var $n;if((_n==null?void 0:_n.type)==="files")return Ce._file.path;let ke=stripHtml(Ce==null?void 0:Ce.data[($n=_n.fields.filter(Hn=>Hn.info.name==="text")[0])==null?void 0:$n.name]).slice(0,300);return ke.trim()===""?"~Untitled~":ke}function create_else_block$j(_n){let Ce;return{c(){Ce=text("New Record")},m(ke,$n){insert$1(ke,Ce,$n)},p:noop,d(ke){ke&&detach(Ce)}}}function create_if_block$J(_n){let Ce=previewTitle(_n[3].schemas,_n[1])+"",ke;return{c(){ke=text(Ce)},m($n,Hn){insert$1($n,ke,Hn)},p($n,Hn){Hn&2&&Ce!==(Ce=previewTitle($n[3].schemas,$n[1])+"")&&set_data(ke,Ce)},d($n){$n&&detach(ke)}}}function create_fragment$13(_n){let Ce,ke,$n=_n[0].label.toUpperCase()+"",Hn,zn,Un,qn;function Xn(io,uo){return io[2]?create_else_block$j:create_if_block$J}let Kn=Xn(_n),to=Kn(_n);return{c(){Ce=element("div"),ke=element("a"),Hn=text($n),Un=space$3(),qn=element("span"),to.c(),attr(ke,"class","schema-name"),attr(ke,"href",zn=_n[3].lucentUrl+"/content/"+_n[0].name),attr(qn,"class","record-title"),attr(Ce,"class","record-header")},m(io,uo){insert$1(io,Ce,uo),append(Ce,ke),append(ke,Hn),append(Ce,Un),append(Ce,qn),to.m(qn,null)},p(io,[uo]){uo&1&&$n!==($n=io[0].label.toUpperCase()+"")&&set_data(Hn,$n),uo&1&&zn!==(zn=io[3].lucentUrl+"/content/"+io[0].name)&&attr(ke,"href",zn),Kn===(Kn=Xn(io))&&to?to.p(io,uo):(to.d(1),to=Kn(io),to&&(to.c(),to.m(qn,null)))},i:noop,o:noop,d(io){io&&detach(Ce),to.d()}}}function instance$13(_n,Ce,ke){const $n=getContext$1("channel");let{schema:Hn}=Ce,{record:zn}=Ce,{isCreateMode:Un}=Ce;return _n.$$set=qn=>{"schema"in qn&&ke(0,Hn=qn.schema),"record"in qn&&ke(1,zn=qn.record),"isCreateMode"in qn&&ke(2,Un=qn.isCreateMode)},[Hn,zn,Un,$n]}class Title extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$13,create_fragment$13,safe_not_equal,{schema:0,record:1,isCreateMode:2})}}function get_each_context$m(_n,Ce,ke){const $n=_n.slice();return $n[24]=Ce[ke],$n}function create_if_block_2$b(_n){let Ce,ke,$n;return{c(){Ce=element("button"),Ce.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
||||
Save`,attr(Ce,"type","button"),attr(Ce,"class","button primary ms-2 btn btn-primary btn-spinner")},m(Hn,zn){insert$1(Hn,Ce,zn),ke||($n=listen(Ce,"click",_n[10]),ke=!0)},p:noop,d(Hn){Hn&&detach(Ce),ke=!1,$n()}}}function create_if_block_1$o(_n){let Ce,ke,$n;return{c(){Ce=element("button"),Ce.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
||||
Create`,attr(Ce,"class","button primary btn-spinner")},m(Hn,zn){insert$1(Hn,Ce,zn),ke||($n=listen(Ce,"click",_n[10]),ke=!0)},p:noop,d(Hn){Hn&&detach(Ce),ke=!1,$n()}}}function create_if_block$I(_n){let Ce,ke,$n,Hn;function zn(Xn){_n[14](Xn)}function Un(Xn){_n[15](Xn)}let qn={field:_n[24],schema:_n[2],record:_n[0],validationErrors:_n[4],isCreateMode:_n[3]};return _n[0].data!==void 0&&(qn.data=_n[0].data),_n[1]!==void 0&&(qn.graph=_n[1]),Ce=new FormField({props:qn}),binding_callbacks.push(()=>bind(Ce,"data",zn)),binding_callbacks.push(()=>bind(Ce,"graph",Un)),{c(){create_component(Ce.$$.fragment)},m(Xn,Kn){mount_component(Ce,Xn,Kn),Hn=!0},p(Xn,Kn){const to={};Kn&4&&(to.schema=Xn[2]),Kn&1&&(to.record=Xn[0]),Kn&16&&(to.validationErrors=Xn[4]),Kn&8&&(to.isCreateMode=Xn[3]),!ke&&Kn&1&&(ke=!0,to.data=Xn[0].data,add_flush_callback(()=>ke=!1)),!$n&&Kn&2&&($n=!0,to.graph=Xn[1],add_flush_callback(()=>$n=!1)),Ce.$set(to)},i(Xn){Hn||(transition_in(Ce.$$.fragment,Xn),Hn=!0)},o(Xn){transition_out(Ce.$$.fragment,Xn),Hn=!1},d(Xn){destroy_component(Ce,Xn)}}}function create_each_block$m(_n,Ce){let ke,$n,Hn,zn=Ce[5]===Ce[24].group&&create_if_block$I(Ce);return{key:_n,first:null,c(){ke=empty$1(),zn&&zn.c(),$n=empty$1(),this.first=ke},m(Un,qn){insert$1(Un,ke,qn),zn&&zn.m(Un,qn),insert$1(Un,$n,qn),Hn=!0},p(Un,qn){Ce=Un,Ce[5]===Ce[24].group?zn?(zn.p(Ce,qn),qn&32&&transition_in(zn,1)):(zn=create_if_block$I(Ce),zn.c(),transition_in(zn,1),zn.m($n.parentNode,$n)):zn&&(group_outros(),transition_out(zn,1,1,()=>{zn=null}),check_outros())},i(Un){Hn||(transition_in(zn),Hn=!0)},o(Un){transition_out(zn),Hn=!1},d(Un){Un&&(detach(ke),detach($n)),zn&&zn.d(Un)}}}function create_fragment$12(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho,bo,Oo,So,$o,Do=[],xo=new Map,Io,Vo,Jo;function Mo(gs){_n[11](gs)}function Go(gs){_n[12](gs)}let os={schema:_n[2],isCreateMode:_n[3]};_n[0]!==void 0&&(os.record=_n[0]),_n[5]!==void 0&&(os.activeContentTab=_n[5]),$n=new EditHeader({props:os}),binding_callbacks.push(()=>bind($n,"record",Mo)),binding_callbacks.push(()=>bind($n,"activeContentTab",Go));function ms(gs,xs){if(gs[3])return create_if_block_1$o;if(gs[6])return create_if_block_2$b}let is=ms(_n),Yo=is&&is(_n);Xn=new Title({props:{schema:_n[2],record:_n[0],isCreateMode:_n[3]}}),to=new ErrorAlert({props:{message:_n[7]}});function Ys(gs){_n[13](gs)}let sr={schema:_n[2],isCreateMode:_n[3]};_n[5]!==void 0&&(sr.active=_n[5]),ho=new ContentTabs({props:sr}),binding_callbacks.push(()=>bind(ho,"active",Ys)),So=new FilePreview({props:{record:_n[0],schema:_n[2]}});let Js=ensure_array_like(_n[8]);const ko=gs=>gs[24].name;for(let gs=0;gs<Js.length;gs+=1){let xs=get_each_context$m(_n,Js,gs),Qr=ko(xs);xo.set(Qr,Do[gs]=create_each_block$m(Qr,xs))}return{c(){Ce=element("div"),ke=element("div"),create_component($n.$$.fragment),Un=space$3(),Yo&&Yo.c(),qn=space$3(),create_component(Xn.$$.fragment),Kn=space$3(),create_component(to.$$.fragment),io=space$3(),uo=element("div"),create_component(ho.$$.fragment),Oo=space$3(),create_component(So.$$.fragment),$o=space$3();for(let gs=0;gs<Do.length;gs+=1)Do[gs].c();attr(ke,"class","tools-header"),attr(uo,"class","mt-4"),set_style(uo,"margin-bottom","150px"),set_style(uo,"position","relative"),attr(Ce,"class","inline-edit record-edit")},m(gs,xs){insert$1(gs,Ce,xs),append(Ce,ke),mount_component($n,ke,null),append(ke,Un),Yo&&Yo.m(ke,null),append(Ce,qn),mount_component(Xn,Ce,null),append(Ce,Kn),mount_component(to,Ce,null),append(Ce,io),append(Ce,uo),mount_component(ho,uo,null),append(uo,Oo),mount_component(So,uo,null),append(uo,$o);for(let Qr=0;Qr<Do.length;Qr+=1)Do[Qr]&&Do[Qr].m(uo,null);Io=!0,Vo||(Jo=listen(window,"beforeunload",_n[9]),Vo=!0)},p(gs,[xs]){const Qr={};xs&4&&(Qr.schema=gs[2]),xs&8&&(Qr.isCreateMode=gs[3]),!Hn&&xs&1&&(Hn=!0,Qr.record=gs[0],add_flush_callback(()=>Hn=!1)),!zn&&xs&32&&(zn=!0,Qr.activeContentTab=gs[5],add_flush_callback(()=>zn=!1)),$n.$set(Qr),is===(is=ms(gs))&&Yo?Yo.p(gs,xs):(Yo&&Yo.d(1),Yo=is&&is(gs),Yo&&(Yo.c(),Yo.m(ke,null)));const cr={};xs&4&&(cr.schema=gs[2]),xs&1&&(cr.record=gs[0]),xs&8&&(cr.isCreateMode=gs[3]),Xn.$set(cr);const ws={};xs&128&&(ws.message=gs[7]),to.$set(ws);const Fs={};xs&4&&(Fs.schema=gs[2]),xs&8&&(Fs.isCreateMode=gs[3]),!bo&&xs&32&&(bo=!0,Fs.active=gs[5],add_flush_callback(()=>bo=!1)),ho.$set(Fs);const Br={};xs&1&&(Br.record=gs[0]),xs&4&&(Br.schema=gs[2]),So.$set(Br),xs&319&&(Js=ensure_array_like(gs[8]),group_outros(),Do=update_keyed_each(Do,xs,ko,1,gs,Js,xo,uo,outro_and_destroy_block,create_each_block$m,null,get_each_context$m),check_outros())},i(gs){if(!Io){transition_in($n.$$.fragment,gs),transition_in(Xn.$$.fragment,gs),transition_in(to.$$.fragment,gs),transition_in(ho.$$.fragment,gs),transition_in(So.$$.fragment,gs);for(let xs=0;xs<Js.length;xs+=1)transition_in(Do[xs]);Io=!0}},o(gs){transition_out($n.$$.fragment,gs),transition_out(Xn.$$.fragment,gs),transition_out(to.$$.fragment,gs),transition_out(ho.$$.fragment,gs),transition_out(So.$$.fragment,gs);for(let xs=0;xs<Do.len
Line truncated
|
||||
`,attr(Ce,"class","start-typing")},m(ke,$n){insert$1(ke,Ce,$n)},p:noop,d(ke){ke&&detach(Ce)}}}function create_each_block$l(_n,Ce){let ke,$n=previewTitle(Ce[3].schemas,Ce[11])+"",Hn,zn,Un,qn;function Xn(...to){return Ce[8](Ce[11],...to)}function Kn(...to){return Ce[9](Ce[11],...to)}return{key:_n,first:null,c(){ke=element("div"),Hn=text($n),zn=space$3(),attr(ke,"class","reference-tags-option"),attr(ke,"role","button"),attr(ke,"tabindex","0"),this.first=ke},m(to,io){insert$1(to,ke,io),append(ke,Hn),append(ke,zn),Un||(qn=[listen(ke,"click",Xn),listen(ke,"keypress",Kn)],Un=!0)},p(to,io){Ce=to,io&4&&$n!==($n=previewTitle(Ce[3].schemas,Ce[11])+"")&&set_data(Hn,$n)},d(to){to&&detach(ke),Un=!1,run_all(qn)}}}function create_fragment$11(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn=_n[2]&&create_if_block$H(_n);return{c(){Ce=element("div"),ke=element("input"),Hn=space$3(),zn=element("div"),Xn&&Xn.c(),attr(ke,"type","search"),attr(ke,"placeholder",$n="Search for "+_n[0].label),attr(ke,"autocomplete","off"),attr(zn,"class","reference-tags-results"),attr(Ce,"class","reference-tags")},m(Kn,to){insert$1(Kn,Ce,to),append(Ce,ke),set_input_value(ke,_n[1]),append(Ce,Hn),append(Ce,zn),Xn&&Xn.m(zn,null),Un||(qn=[listen(ke,"keyup",_n[4]),listen(ke,"input",_n[7])],Un=!0)},p(Kn,[to]){to&1&&$n!==($n="Search for "+Kn[0].label)&&attr(ke,"placeholder",$n),to&2&&ke.value!==Kn[1]&&set_input_value(ke,Kn[1]),Kn[2]?Xn?Xn.p(Kn,to):(Xn=create_if_block$H(Kn),Xn.c(),Xn.m(zn,null)):Xn&&(Xn.d(1),Xn=null)},i:noop,o:noop,d(Kn){Kn&&detach(Ce),Xn&&Xn.d(),Un=!1,run_all(qn)}}}function instance$11(_n,Ce,ke){let $n;const Hn=getContext$1("channel"),zn=createEventDispatcher();let{value:Un=""}=Ce,{field:qn}=Ce,Xn="";const Kn=lodashExports.debounce(bo=>{axios.get(Hn.lucentUrl+"/records/suggestions",{params:{schema:qn.collections[0],field:"search",value:Xn,ui:"search"}}).then(Oo=>{ke(2,$n=Oo.data)}).catch(Oo=>{ke(2,$n=[]),console.log(Oo)})},500);function to(bo,Oo){bo.preventDefault(),ke(6,Un=Oo.id),zn("addFilter"),ke(6,Un="")}function io(){Xn=this.value,ke(1,Xn)}const uo=(bo,Oo)=>to(Oo,bo),ho=(bo,Oo)=>to(Oo,bo);return _n.$$set=bo=>{"value"in bo&&ke(6,Un=bo.value),"field"in bo&&ke(0,qn=bo.field)},ke(2,$n=[]),[qn,Xn,$n,Hn,Kn,to,Un,io,uo,ho]}class FilterReferenceInput extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$11,create_fragment$11,safe_not_equal,{value:6,field:0})}}function get_each_context$k(_n,Ce,ke){const $n=_n.slice();return $n[39]=Ce[ke],$n}function get_each_context_1$7(_n,Ce,ke){const $n=_n.slice();return $n[42]=Ce[ke],$n}function get_each_context_2$2(_n,Ce,ke){const $n=_n.slice();return $n[39]=Ce[ke],$n}function create_if_block_4$6(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn;ke=new Icon({props:{icon:"arrow-left"}});let Kn=ensure_array_like(_n[9]),to=[];for(let io=0;io<Kn.length;io+=1)to[io]=create_each_block_2$2(get_each_context_2$2(_n,Kn,io));return{c(){Ce=element("button"),create_component(ke.$$.fragment),$n=text(`
|
||||
Back`),Hn=space$3();for(let io=0;io<to.length;io+=1)to[io].c();zn=empty$1(),attr(Ce,"class","dropdown-item button")},m(io,uo){insert$1(io,Ce,uo),mount_component(ke,Ce,null),append(Ce,$n),insert$1(io,Hn,uo);for(let ho=0;ho<to.length;ho+=1)to[ho]&&to[ho].m(io,uo);insert$1(io,zn,uo),Un=!0,qn||(Xn=listen(Ce,"click",_n[23]),qn=!0)},p(io,uo){if(uo[0]&2560){Kn=ensure_array_like(io[9]);let ho;for(ho=0;ho<Kn.length;ho+=1){const bo=get_each_context_2$2(io,Kn,ho);to[ho]?to[ho].p(bo,uo):(to[ho]=create_each_block_2$2(bo),to[ho].c(),to[ho].m(zn.parentNode,zn))}for(;ho<to.length;ho+=1)to[ho].d(1);to.length=Kn.length}},i(io){Un||(transition_in(ke.$$.fragment,io),Un=!0)},o(io){transition_out(ke.$$.fragment,io),Un=!1},d(io){io&&(detach(Ce),detach(Hn),detach(zn)),destroy_component(ke),destroy_each(to,io),qn=!1,Xn()}}}function create_each_block_2$2(_n){let Ce,ke,$n;function Hn(...zn){return _n[24](_n[39],...zn)}return{c(){Ce=element("button"),Ce.textContent=`${_n[39].label} `,attr(Ce,"class","dropdown-item button")},m(zn,Un){insert$1(zn,Ce,Un),ke||($n=listen(Ce,"click",Hn),ke=!0)},p(zn,Un){_n=zn},d(zn){zn&&detach(Ce),ke=!1,$n()}}}function create_if_block_3$8(_n){let Ce,ke,$n,Hn,zn,Un,qn=_n[3].label+"",Xn,Kn,to,io,uo,ho;ke=new Icon({props:{icon:"arrow-left"}});let bo=ensure_array_like(_n[7]),Oo=[];for(let So=0;So<bo.length;So+=1)Oo[So]=create_each_block_1$7(get_each_context_1$7(_n,bo,So));return{c(){Ce=element("button"),create_component(ke.$$.fragment),$n=text(`
|
||||
Back`),Hn=space$3(),zn=element("div"),Un=text("field: "),Xn=text(qn),Kn=space$3();for(let So=0;So<Oo.length;So+=1)Oo[So].c();to=empty$1(),attr(Ce,"class","dropdown-item button"),attr(zn,"class","selected-filter")},m(So,$o){insert$1(So,Ce,$o),mount_component(ke,Ce,null),append(Ce,$n),insert$1(So,Hn,$o),insert$1(So,zn,$o),append(zn,Un),append(zn,Xn),insert$1(So,Kn,$o);for(let Do=0;Do<Oo.length;Do+=1)Oo[Do]&&Oo[Do].m(So,$o);insert$1(So,to,$o),io=!0,uo||(ho=listen(Ce,"click",_n[25]),uo=!0)},p(So,$o){if((!io||$o[0]&8)&&qn!==(qn=So[3].label+"")&&set_data(Xn,qn),$o[0]&8320){bo=ensure_array_like(So[7]);let Do;for(Do=0;Do<bo.length;Do+=1){const xo=get_each_context_1$7(So,bo,Do);Oo[Do]?Oo[Do].p(xo,$o):(Oo[Do]=create_each_block_1$7(xo),Oo[Do].c(),Oo[Do].m(to.parentNode,to))}for(;Do<Oo.length;Do+=1)Oo[Do].d(1);Oo.length=bo.length}},i(So){io||(transition_in(ke.$$.fragment,So),io=!0)},o(So){transition_out(ke.$$.fragment,So),io=!1},d(So){So&&(detach(Ce),detach(Hn),detach(zn),detach(Kn),detach(to)),destroy_component(ke),destroy_each(Oo,So),uo=!1,ho()}}}function create_each_block_1$7(_n){let Ce,ke=_n[42].label+"",$n,Hn,zn,Un;function qn(...Xn){return _n[26](_n[42],...Xn)}return{c(){Ce=element("button"),$n=text(ke),Hn=space$3(),attr(Ce,"class","dropdown-item button")},m(Xn,Kn){insert$1(Xn,Ce,Kn),append(Ce,$n),append(Ce,Hn),zn||(Un=listen(Ce,"click",qn),zn=!0)},p(Xn,Kn){_n=Xn,Kn[0]&128&&ke!==(ke=_n[42].label+"")&&set_data($n,ke)},d(Xn){Xn&&detach(Ce),zn=!1,Un()}}}function create_if_block_2$a(_n){let Ce,ke,$n,Hn,zn,Un,qn=_n[3].label+"",Xn,Kn,to=_n[5].label+"",io,uo,ho,bo,Oo,So,$o,Do,xo;return ke=new Icon({props:{icon:"arrow-left"}}),{c(){Ce=element("button"),create_component(ke.$$.fragment),$n=text(`
|
||||
Back`),Hn=space$3(),zn=element("div"),Un=text("field: "),Xn=text(qn),Kn=text(" operator: "),io=text(to),uo=space$3(),ho=element("div"),bo=element("input"),Oo=space$3(),So=element("button"),So.textContent="Add filter",attr(Ce,"class","dropdown-item button"),attr(zn,"class","selected-filter"),attr(bo,"type","text"),attr(bo,"class","form-control"),attr(ho,"class","filter-input"),attr(So,"class","button applied-filter"),attr(So,"type","button")},m(Io,Vo){insert$1(Io,Ce,Vo),mount_component(ke,Ce,null),append(Ce,$n),insert$1(Io,Hn,Vo),insert$1(Io,zn,Vo),append(zn,Un),append(zn,Xn),append(zn,Kn),append(zn,io),insert$1(Io,uo,Vo),insert$1(Io,ho,Vo),append(ho,bo),set_input_value(bo,_n[2]),insert$1(Io,Oo,Vo),insert$1(Io,So,Vo),$o=!0,Do||(xo=[listen(Ce,"click",_n[27]),listen(bo,"input",_n[28]),listen(So,"click",_n[14])],Do=!0)},p(Io,Vo){(!$o||Vo[0]&8)&&qn!==(qn=Io[3].label+"")&&set_data(Xn,qn),(!$o||Vo[0]&32)&&to!==(to=Io[5].label+"")&&set_data(io,to),Vo[0]&4&&bo.value!==Io[2]&&set_input_value(bo,Io[2])},i(Io){$o||(transition_in(ke.$$.fragment,Io),$o=!0)},o(Io){transition_out(ke.$$.fragment,Io),$o=!1},d(Io){Io&&(detach(Ce),detach(Hn),detach(zn),detach(uo),detach(ho),detach(Oo),detach(So)),destroy_component(ke),Do=!1,run_all(xo)}}}function create_if_block_1$n(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn;ke=new Icon({props:{icon:"arrow-left"}});let Kn=ensure_array_like(_n[10]),to=[];for(let io=0;io<Kn.length;io+=1)to[io]=create_each_block$k(get_each_context$k(_n,Kn,io));return{c(){Ce=element("button"),create_component(ke.$$.fragment),$n=text(`
|
||||
Back`),Hn=space$3();for(let io=0;io<to.length;io+=1)to[io].c();zn=empty$1(),attr(Ce,"class","dropdown-item button")},m(io,uo){insert$1(io,Ce,uo),mount_component(ke,Ce,null),append(Ce,$n),insert$1(io,Hn,uo);for(let ho=0;ho<to.length;ho+=1)to[ho]&&to[ho].m(io,uo);insert$1(io,zn,uo),Un=!0,qn||(Xn=listen(Ce,"click",_n[29]),qn=!0)},p(io,uo){if(uo[0]&5120){Kn=ensure_array_like(io[10]);let ho;for(ho=0;ho<Kn.length;ho+=1){const bo=get_each_context$k(io,Kn,ho);to[ho]?to[ho].p(bo,uo):(to[ho]=create_each_block$k(bo),to[ho].c(),to[ho].m(zn.parentNode,zn))}for(;ho<to.length;ho+=1)to[ho].d(1);to.length=Kn.length}},i(io){Un||(transition_in(ke.$$.fragment,io),Un=!0)},o(io){transition_out(ke.$$.fragment,io),Un=!1},d(io){io&&(detach(Ce),detach(Hn),detach(zn)),destroy_component(ke),destroy_each(to,io),qn=!1,Xn()}}}function create_each_block$k(_n){let Ce,ke,$n;function Hn(...zn){return _n[30](_n[39],...zn)}return{c(){Ce=element("button"),Ce.textContent=`${_n[39].label} `,attr(Ce,"class","dropdown-item button")},m(zn,Un){insert$1(zn,Ce,Un),ke||($n=listen(Ce,"click",Hn),ke=!0)},p(zn,Un){_n=zn},d(zn){zn&&detach(Ce),ke=!1,$n()}}}function create_if_block$G(_n){let Ce,ke,$n,Hn,zn,Un,qn=_n[4].label+"",Xn,Kn,to,io,uo,ho,bo,Oo;ke=new Icon({props:{icon:"arrow-left"}});function So(Do){_n[32](Do)}let $o={field:_n[4]};return _n[2]!==void 0&&($o.value=_n[2]),io=new FilterReferenceInput({props:$o}),binding_callbacks.push(()=>bind(io,"value",So)),io.$on("addFilter",_n[14]),{c(){Ce=element("button"),create_component(ke.$$.fragment),$n=text(`
|
||||
Back`),Hn=space$3(),zn=element("div"),Un=text("field: "),Xn=text(qn),Kn=space$3(),to=element("div"),create_component(io.$$.fragment),attr(Ce,"class","dropdown-item button"),attr(zn,"class","selected-filter"),attr(to,"class","mt-2")},m(Do,xo){insert$1(Do,Ce,xo),mount_component(ke,Ce,null),append(Ce,$n),insert$1(Do,Hn,xo),insert$1(Do,zn,xo),append(zn,Un),append(zn,Xn),insert$1(Do,Kn,xo),insert$1(Do,to,xo),mount_component(io,to,null),ho=!0,bo||(Oo=listen(Ce,"click",_n[31]),bo=!0)},p(Do,xo){(!ho||xo[0]&16)&&qn!==(qn=Do[4].label+"")&&set_data(Xn,qn);const Io={};xo[0]&16&&(Io.field=Do[4]),!uo&&xo[0]&4&&(uo=!0,Io.value=Do[2],add_flush_callback(()=>uo=!1)),io.$set(Io)},i(Do){ho||(transition_in(ke.$$.fragment,Do),transition_in(io.$$.fragment,Do),ho=!0)},o(Do){transition_out(ke.$$.fragment,Do),transition_out(io.$$.fragment,Do),ho=!1},d(Do){Do&&(detach(Ce),detach(Hn),detach(zn),detach(Kn),detach(to)),destroy_component(ke),destroy_component(io),bo=!1,Oo()}}}function create_default_slot$8(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho,bo,Oo,So,$o,Do,xo,Io,Vo,Jo,Mo,Go,os,ms,is=!_n[3]&&create_if_block_4$6(_n),Yo=_n[3]&&!_n[5]&&create_if_block_3$8(_n),Ys=_n[3]&&_n[5]&&create_if_block_2$a(_n),sr=!_n[4]&&create_if_block_1$n(_n),Js=_n[4]&&create_if_block$G(_n);return $o=new Icon({props:{icon:"arrow-left"}}),{c(){Ce=element("div"),ke=element("button"),ke.textContent="Filter by field",$n=space$3(),Hn=element("button"),Hn.textContent="Filter by Reference",zn=space$3(),Un=element("button"),Un.textContent="Advanced filter",qn=space$3(),Xn=element("div"),is&&is.c(),Kn=space$3(),Yo&&Yo.c(),to=space$3(),Ys&&Ys.c(),io=space$3(),uo=element("div"),sr&&sr.c(),ho=space$3(),Js&&Js.c(),bo=space$3(),Oo=element("div"),So=element("button"),create_component($o.$$.fragment),Do=text(`
|
||||
Back`),xo=space$3(),Io=element("form"),Vo=element("input"),Jo=space$3(),Mo=element("button"),Mo.textContent="Submit",attr(ke,"class","dropdown-item button"),attr(Hn,"class","dropdown-item button"),attr(Un,"class","dropdown-item button"),toggle_class(Ce,"hide",_n[6]!=="main"),toggle_class(Xn,"hide",_n[6]!=="byField"),toggle_class(uo,"hide",_n[6]!=="byReference"),attr(So,"class","dropdown-item button"),attr(Vo,"type","search"),attr(Vo,"class","mb-2 mt-2"),attr(Vo,"placeholder","Advanced filters"),Vo.required=!0,attr(Mo,"class","button applied-filter"),toggle_class(Oo,"hide",_n[6]!=="advanced")},m(ko,gs){insert$1(ko,Ce,gs),append(Ce,ke),append(Ce,$n),append(Ce,Hn),append(Ce,zn),append(Ce,Un),insert$1(ko,qn,gs),insert$1(ko,Xn,gs),is&&is.m(Xn,null),append(Xn,Kn),Yo&&Yo.m(Xn,null),append(Xn,to),Ys&&Ys.m(Xn,null),insert$1(ko,io,gs),insert$1(ko,uo,gs),sr&&sr.m(uo,null),append(uo,ho),Js&&Js.m(uo,null),insert$1(ko,bo,gs),insert$1(ko,Oo,gs),append(Oo,So),mount_component($o,So,null),append(So,Do),append(Oo,xo),append(Oo,Io),append(Io,Vo),set_input_value(Vo,_n[1]),append(Io,Jo),append(Io,Mo),Go=!0,os||(ms=[listen(ke,"click",_n[20]),listen(Hn,"click",_n[21]),listen(Un,"click",_n[22]),listen(So,"click",_n[33]),listen(Vo,"input",_n[34]),listen(Io,"submit",_n[8])],os=!0)},p(ko,gs){(!Go||gs[0]&64)&&toggle_class(Ce,"hide",ko[6]!=="main"),ko[3]?is&&(group_outros(),transition_out(is,1,1,()=>{is=null}),check_outros()):is?(is.p(ko,gs),gs[0]&8&&transition_in(is,1)):(is=create_if_block_4$6(ko),is.c(),transition_in(is,1),is.m(Xn,Kn)),ko[3]&&!ko[5]?Yo?(Yo.p(ko,gs),gs[0]&40&&transition_in(Yo,1)):(Yo=create_if_block_3$8(ko),Yo.c(),transition_in(Yo,1),Yo.m(Xn,to)):Yo&&(group_outros(),transition_out(Yo,1,1,()=>{Yo=null}),check_outros()),ko[3]&&ko[5]?Ys?(Ys.p(ko,gs),gs[0]&40&&transition_in(Ys,1)):(Ys=create_if_block_2$a(ko),Ys.c(),transition_in(Ys,1),Ys.m(Xn,null)):Ys&&(group_outros(),transition_out(Ys,1,1,()=>{Ys=null}),check_outros()),(!Go||gs[0]&64)&&toggle_class(Xn,"hide",ko[6]!=="byField"),ko[4]?sr&&(group_outros(),transition_out(sr,1,1,()=>{sr=null}),check_outros()):sr?(sr.p(ko,gs),gs[0]&16&&transition_in(sr,1)):(sr=create_if_block_1$n(ko),sr.c(),transition_in(sr,1),sr.m(uo,ho)),ko[4]?Js?(Js.p(ko,gs),gs[0]&16&&transition_in(Js,1)):(Js=create_if_block$G(ko),Js.c(),transition_in(Js,1),Js.m(uo,null)):Js&&(group_outros(),transition_out(Js,1,1,()=>{Js=null}),check_outros()),(!Go||gs[0]&64)&&toggle_class(uo,"hide",ko[6]!=="byReference"),gs[0]&2&&Vo.value!==ko[1]&&set_input_value(Vo,ko[1]),(!Go||gs[0]&64)&&toggle_class(Oo,"hide",ko[6]!=="advanced")},i(ko){Go||(transition_in(is),transition_in(Yo),transition_in(Ys),transition_in(sr),transition_in(Js),transition_in($o.$$.fragment,ko),Go=!0)},o(ko){transition_out(is),transition_out(Yo),transition_out(Ys),transition_out(sr),transition_out(Js),transition_out($o.$$.fragment,ko),Go=!1},d(ko){ko&&(detach(Ce),detach(qn),detach(Xn),detach(io),detach(uo),detach(bo),detach(Oo)),is&&is.d(),Yo&&Yo.d(),Ys&&Ys.d(),sr&&sr.d(),Js&&Js.d(),destroy_component($o),os=!1,run_all(ms)}}}function create_button_slot$7(_n){let Ce,ke,$n,Hn,zn;return ke=new Icon({props:{icon:"filter"}}),{c(){Ce=element("div"),create_component(ke.$$.fragment),$n=space$3(),Hn=element("span"),Hn.textContent="Filter",attr(Hn,"class","ms-1"),attr(Ce,"slot","button")},m(Un,qn){insert$1(Un,Ce,qn),mount_component(ke,Ce,null),append(Ce,$n),append(Ce,Hn),zn=!0},p:noop,i(Un){zn||(transition_in(ke.$$.fragment,Un),zn=!0)},o(Un){transition_out(ke.$$.fragment,Un),zn=!1},d(Un){Un&&detach(Ce),destroy_component(ke)}}}function create_fragment$10(_n){let Ce,ke,$n,Hn={$$slots:{button:[create_button_slot$7],default:[create_default_slot$8]},$$scope:{ctx:_n}};return ke=new Dropdown({props:Hn}),_n[35](ke),{c(){Ce=element("div"),create_component(ke.$$.fragment)},m(zn,Un){insert$1(zn,Ce,Un),mount_component(ke,Ce,null),$n=!0},p(zn,Un){const qn={};Un[0]&254|Un[1]&65536&&(qn.$$scope={dirty:Un,ctx:zn}),ke.$set(qn)},i(zn){$n||(transition_in(ke.$$.fragment,zn),$n=!0)},o(zn){transition_out(ke.$$.fragment,zn),$n=!1},d(zn){zn&&detach(Ce),_n[35](null),destroy_component(ke)}}}function instance$10(_n,Ce,ke){const $n=createEventDispatcher();let{schema:Hn}=Ce,{systemFields:zn=[]}=Ce,{operators:Un}=Ce,{inModal:qn}=Ce,{modalUrl:Xn}=Ce,Kn,to="",io=zn;Hn.type==="collection"&&(io=zn.filter(hs=>hs.files===!1));function uo(hs){hs.preventDefault();let Qs=to.split("=")[0]??"";if(!Qs)return;let zo=`filter[${Qs}]`,el=to.split("=")[1]??"";if(!el)return;const ga=new URL(Xn??window.location.href);ga.searchParams.set("skip","0"),ga.searchParams.set(zo,el),qn?$n("refresh",ga):window.location.replace(ga),os()}let ho=null,bo=null,Oo=null,So=null,$o="main",Do=null,xo=[...Hn.fields,...io].filter(hs=>{var Qs;return!["file","json","reference"].includes(((Qs=hs.info)==null?void 0:Qs.name)??hs.ui)}),Io=[...Hn.fields].filter(hs=>{var Qs;return["reference"].includes(((Qs=hs.info)==null?void 0:Qs.name)??hs.ui)});function Vo(hs,Qs){ke(3,bo=Qs),ke(7,Do=Un.filter(zo=>{var el;return zo.uis.i
Line truncated
|
||||
Upload file
|
||||
|
||||
`),zn=element("input"),attr($n,"class","spinner-border spinner-border-sm"),attr($n,"role","status"),attr($n,"aria-hidden","true"),attr(zn,"class","form-control"),attr(zn,"type","file"),attr(zn,"id","formFile"),zn.multiple=!0,attr(zn,"accept",mimeTypes),zn.disabled=_n[0],zn.hidden=!0,attr(ke,"class","button primary btn-spinner "),attr(Ce,"class","upload-button"),Ce.disabled=_n[0]},m(Xn,Kn){insert$1(Xn,Ce,Kn),append(Ce,ke),append(ke,$n),append(ke,Hn),append(ke,zn),Un||(qn=listen(zn,"input",_n[1]),Un=!0)},p(Xn,[Kn]){Kn&1&&(zn.disabled=Xn[0]),Kn&1&&(Ce.disabled=Xn[0])},i:noop,o:noop,d(Xn){Xn&&detach(Ce),Un=!1,qn()}}}let mimeTypes="";function instance$$(_n,Ce,ke){const $n=createEventDispatcher(),Hn=getContext$1("channel");let{schema:zn}=Ce,Un=[],qn=!1;function Xn(Kn){ke(0,qn=!0),Un=Kn.target.files?[...Kn.target.files]:[];let to=new FormData;to.append("schema",zn.name),Array.from(Un).forEach(function(io){to.append("files[]",io)}),$n("beforeUpload",Un),axios.post(Hn.lucentUrl+"/files/upload",to,{headers:{"Content-Type":"multipart/form-data"}}).then(io=>{io.data.error?$n("uploadError",io.data.error):$n("uploadComplete",io.data),ke(0,qn=!1)}).catch(io=>{ke(0,qn=!1),console.log(io.response.data)})}return _n.$$set=Kn=>{"schema"in Kn&&ke(2,zn=Kn.schema)},[qn,Xn,zn]}class Uploader extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$$,create_fragment$$,safe_not_equal,{schema:2})}}function get_each_context$j(_n,Ce,ke){const $n=_n.slice();return $n[18]=Ce[ke],$n}function get_each_context_1$6(_n,Ce,ke){const $n=_n.slice();return $n[18]=Ce[ke],$n}function create_each_block_1$6(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io=_n[18].label+"",uo,ho,bo,Oo;$n=new Icon({props:{icon:"arrow-up-short-wide"}});function So(...xo){return _n[10](_n[18],...xo)}qn=new Icon({props:{icon:"arrow-down-wide-short"}});function $o(...xo){return _n[11](_n[18],...xo)}function Do(...xo){return _n[12](_n[18],...xo)}return{c(){Ce=element("div"),ke=element("button"),create_component($n.$$.fragment),zn=space$3(),Un=element("button"),create_component(qn.$$.fragment),Kn=space$3(),to=element("button"),uo=text(io),attr(ke,"title","Sort Ascending"),attr(ke,"class",Hn="button button-icon "+(_n[18].name==_n[1].name&&!_n[0].startsWith("-")?"active":"")),attr(Un,"title","Sort Descending"),attr(Un,"class",Xn="button button-icon "+(_n[18].name==_n[1].name&&_n[0].startsWith("-")?"active":"")),attr(to,"title","Sort Ascending"),attr(to,"class","button"),attr(Ce,"class","dropdown-item")},m(xo,Io){insert$1(xo,Ce,Io),append(Ce,ke),mount_component($n,ke,null),append(Ce,zn),append(Ce,Un),mount_component(qn,Un,null),append(Ce,Kn),append(Ce,to),append(to,uo),ho=!0,bo||(Oo=[listen(ke,"click",So),listen(Un,"click",$o),listen(to,"click",Do)],bo=!0)},p(xo,Io){_n=xo,(!ho||Io&11&&Hn!==(Hn="button button-icon "+(_n[18].name==_n[1].name&&!_n[0].startsWith("-")?"active":"")))&&attr(ke,"class",Hn),(!ho||Io&11&&Xn!==(Xn="button button-icon "+(_n[18].name==_n[1].name&&_n[0].startsWith("-")?"active":"")))&&attr(Un,"class",Xn),(!ho||Io&8)&&io!==(io=_n[18].label+"")&&set_data(uo,io)},i(xo){ho||(transition_in($n.$$.fragment,xo),transition_in(qn.$$.fragment,xo),ho=!0)},o(xo){transition_out($n.$$.fragment,xo),transition_out(qn.$$.fragment,xo),ho=!1},d(xo){xo&&detach(Ce),destroy_component($n),destroy_component(qn),bo=!1,run_all(Oo)}}}function create_each_block$j(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io=_n[18].label+"",uo,ho,bo,Oo,So;$n=new Icon({props:{icon:"arrow-up-short-wide"}});function $o(...Io){return _n[13](_n[18],...Io)}qn=new Icon({props:{icon:"arrow-down-wide-short"}});function Do(...Io){return _n[14](_n[18],...Io)}function xo(...Io){return _n[15](_n[18],...Io)}return{c(){Ce=element("div"),ke=element("button"),create_component($n.$$.fragment),zn=space$3(),Un=element("button"),create_component(qn.$$.fragment),Kn=space$3(),to=element("button"),uo=text(io),ho=space$3(),attr(ke,"title","Sort Ascending"),attr(ke,"class",Hn="button button-icon "+(_n[18].name==_n[0]?"active":"")),attr(Un,"title","Sort Descending"),attr(Un,"class",Xn="button button-icon "+("-"+_n[18].name==_n[0]?"active":"")),attr(to,"title","Sort Ascending"),attr(to,"class","button"),attr(Ce,"class","dropdown-item")},m(Io,Vo){insert$1(Io,Ce,Vo),append(Ce,ke),mount_component($n,ke,null),append(Ce,zn),append(Ce,Un),mount_component(qn,Un,null),append(Ce,Kn),append(Ce,to),append(to,uo),append(Ce,ho),bo=!0,Oo||(So=[listen(ke,"click",$o),listen(Un,"click",Do),listen(to,"click",xo)],Oo=!0)},p(Io,Vo){_n=Io,(!bo||Vo&5&&Hn!==(Hn="button button-icon "+(_n[18].name==_n[0]?"active":"")))&&attr(ke,"class",Hn),(!bo||Vo&5&&Xn!==(Xn="button button-icon "+("-"+_n[18].name==_n[0]?"active":"")))&&attr(Un,"class",Xn),(!bo||Vo&4)&&io!==(io=_n[18].label+"")&&set_data(uo,io)},i(Io){bo||(transition_in($n.$$.fragment,Io),transition_in(qn.$$.fragment,Io),bo=!0)},o(Io){transition_out($n.$$.fragment,Io),transition_out(qn.$$.fragment,Io),bo=!1},d(Io){Io&&detach(Ce),destroy_component($n),destroy_component(qn),Oo=!1,run_all(So)}}}func
Line truncated
|
||||
|
||||
`),$n=element("button"),create_component(Hn.$$.fragment),attr($n,"type","button"),attr($n,"class","button-text"),attr($n,"aria-label","Close"),attr(Ce,"class","applied-filter")},m(Xn,Kn){insert$1(Xn,Ce,Kn),append(Ce,ke),append(Ce,$n),mount_component(Hn,$n,null),zn=!0,Un||(qn=listen($n,"click",prevent_default(_n[4])),Un=!0)},p:noop,i(Xn){zn||(transition_in(Hn.$$.fragment,Xn),zn=!0)},o(Xn){transition_out(Hn.$$.fragment,Xn),zn=!1},d(Xn){Xn&&detach(Ce),destroy_component(Hn),Un=!1,qn()}}}function create_fragment$Y(_n){let Ce=_n[0].searchParams.get("notlinked"),ke,$n,Hn=Ce&&create_if_block$D(_n);return{c(){Hn&&Hn.c(),ke=empty$1()},m(zn,Un){Hn&&Hn.m(zn,Un),insert$1(zn,ke,Un),$n=!0},p(zn,[Un]){Ce&&Hn.p(zn,Un)},i(zn){$n||(transition_in(Hn),$n=!0)},o(zn){transition_out(Hn),$n=!1},d(zn){zn&&detach(ke),Hn&&Hn.d(zn)}}}function instance$Y(_n,Ce,ke){getContext$1("channel");const $n=createEventDispatcher();let{inModal:Hn}=Ce,{modalUrl:zn}=Ce;const Un=new URL(zn??window.location.href);function qn(Kn){const to=new URL(zn??window.location.href);to.searchParams.set("skip","0"),to.searchParams.delete("notlinked"),Hn?$n("refresh",to):window.location.replace(to)}const Xn=()=>qn();return _n.$$set=Kn=>{"inModal"in Kn&&ke(2,Hn=Kn.inModal),"modalUrl"in Kn&&ke(3,zn=Kn.modalUrl)},[Un,qn,Hn,zn,Xn]}class AppliedFilterNotLinked extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$Y,create_fragment$Y,safe_not_equal,{inModal:2,modalUrl:3})}}function get_each_context$i(_n,Ce,ke){const $n=_n.slice();return $n[22]=Ce[ke][0],$n[23]=Ce[ke][1],$n}function create_else_block_1$2(_n){let Ce,ke,$n;return ke=new Uploader({props:{schema:_n[0]}}),ke.$on("uploadComplete",_n[13]),{c(){Ce=element("div"),create_component(ke.$$.fragment)},m(Hn,zn){insert$1(Hn,Ce,zn),mount_component(ke,Ce,null),$n=!0},p(Hn,zn){const Un={};zn&1&&(Un.schema=Hn[0]),ke.$set(Un)},i(Hn){$n||(transition_in(ke.$$.fragment,Hn),$n=!0)},o(Hn){transition_out(ke.$$.fragment,Hn),$n=!1},d(Hn){Hn&&detach(Ce),destroy_component(ke)}}}function create_if_block_4$5(_n){let Ce,ke=!_n[5]&&_n[7]&&create_if_block_5$3(_n);return{c(){ke&&ke.c(),Ce=empty$1()},m($n,Hn){ke&&ke.m($n,Hn),insert$1($n,Ce,Hn)},p($n,Hn){!$n[5]&&$n[7]?ke?ke.p($n,Hn):(ke=create_if_block_5$3($n),ke.c(),ke.m(Ce.parentNode,Ce)):ke&&(ke.d(1),ke=null)},i:noop,o:noop,d($n){$n&&detach(Ce),ke&&ke.d($n)}}}function create_if_block_5$3(_n){let Ce,ke,$n;return{c(){Ce=element("a"),ke=text("New Record"),attr(Ce,"href",$n=_n[10].lucentUrl+"/records/new?schema="+_n[0].name),attr(Ce,"class","button")},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,ke)},p(Hn,zn){zn&1&&$n!==($n=Hn[10].lucentUrl+"/records/new?schema="+Hn[0].name)&&attr(Ce,"href",$n)},d(Hn){Hn&&detach(Ce)}}}function create_if_block_1$m(_n){let Ce,ke;return Ce=new Dropdown({props:{orientation:"right",$$slots:{button:[create_button_slot$5],default:[create_default_slot$6]},$$scope:{ctx:_n}}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&67109009&&(zn.$$scope={dirty:Hn,ctx:$n}),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_else_block$f(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to;return{c(){Ce=element("a"),ke=text("Export to CSV"),$n=space$3(),Hn=element("a"),zn=text("View trashed records"),qn=space$3(),Xn=element("a"),Kn=text("View unlinked records"),attr(Ce,"class","dropdown-item"),attr(Ce,"href",_n[11]),attr(Hn,"class","dropdown-item"),attr(Hn,"href",Un=_n[10].lucentUrl+"/content/"+_n[0].name+"?filter[status_in]=trashed"),attr(Xn,"class","dropdown-item"),attr(Xn,"href",to=_n[10].lucentUrl+"/content/"+_n[0].name+"?notlinked=*")},m(io,uo){insert$1(io,Ce,uo),append(Ce,ke),insert$1(io,$n,uo),insert$1(io,Hn,uo),append(Hn,zn),insert$1(io,qn,uo),insert$1(io,Xn,uo),append(Xn,Kn)},p(io,uo){uo&1&&Un!==(Un=io[10].lucentUrl+"/content/"+io[0].name+"?filter[status_in]=trashed")&&attr(Hn,"href",Un),uo&1&&to!==(to=io[10].lucentUrl+"/content/"+io[0].name+"?notlinked=*")&&attr(Xn,"href",to)},d(io){io&&(detach(Ce),detach($n),detach(Hn),detach(qn),detach(Xn))}}}function create_if_block_2$9(_n){let Ce,ke=_n[7]&&create_if_block_3$7(_n);return{c(){ke&&ke.c(),Ce=empty$1()},m($n,Hn){ke&&ke.m($n,Hn),insert$1($n,Ce,Hn)},p($n,Hn){$n[7]?ke?ke.p($n,Hn):(ke=create_if_block_3$7($n),ke.c(),ke.m(Ce.parentNode,Ce)):ke&&(ke.d(1),ke=null)},d($n){$n&&detach(Ce),ke&&ke.d($n)}}}function create_if_block_3$7(_n){let Ce,ke,$n;return{c(){Ce=element("a"),ke=text("Empty trash"),attr(Ce,"class","dropdown-item"),attr(Ce,"href",$n=_n[10].lucentUrl+"/content/"+_n[0].name+"/emptyTrash")},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,ke)},p(Hn,zn){zn&1&&$n!==($n=Hn[10].lucentUrl+"/content/"+Hn[0].name+"/emptyTrash")&&attr(Ce,"href",$n)},d(Hn){Hn&&detach(Ce)}}}function create_default_slot$6(_n){let Ce;function ke(zn,Un){return zn[4].status_in==="trashed"?create_if_block_2$9:create_else_block$f}let $n=ke(_n),Hn=$n(_n);return{c(){Hn.c(),Ce=empty$1()},m(zn,Un){Hn.m(
Line truncated
|
||||
`),Un=element("span"),Xn=text(qn),Kn=text(`
|
||||
to
|
||||
`),to=element("span"),uo=text(io),ho=text(`
|
||||
of
|
||||
`),bo=element("span"),Oo=text(_n[4]),So=text(`
|
||||
total`),attr(ke,"class","pagination"),attr(Un,"class","font-medium"),attr(to,"class","font-medium"),attr(bo,"class","font-medium"),set_style(Hn,"display","flex"),set_style(Hn,"justify-content","center"),set_style(Hn,"gap","4px")},m(xo,Io){insert$1(xo,Ce,Io),append(Ce,ke),Do&&Do.m(ke,null),insert$1(xo,$n,Io),insert$1(xo,Hn,Io),append(Hn,zn),append(Hn,Un),append(Un,Xn),append(Hn,Kn),append(Hn,to),append(to,uo),append(Hn,ho),append(Hn,bo),append(bo,Oo),append(Hn,So),$o=!0},p(xo,[Io]){xo[5]>1?Do?(Do.p(xo,Io),Io&32&&transition_in(Do,1)):(Do=create_if_block$A(xo),Do.c(),transition_in(Do,1),Do.m(ke,null)):Do&&(group_outros(),transition_out(Do,1,1,()=>{Do=null}),check_outros()),(!$o||Io&8)&&qn!==(qn=+xo[3]+1+"")&&set_data(Xn,qn),(!$o||Io&28)&&io!==(io=(+xo[3]+xo[2]>xo[4]?xo[4]:+xo[3]+xo[2])+"")&&set_data(uo,io),(!$o||Io&16)&&set_data(Oo,xo[4])},i(xo){$o||(transition_in(Do),$o=!0)},o(xo){transition_out(Do),$o=!1},d(xo){xo&&(detach(Ce),detach($n),detach(Hn)),Do&&Do.d()}}}function instance$V(_n,Ce,ke){let $n,Hn,zn;const Un=createEventDispatcher();let{inModal:qn}=Ce,{modalUrl:Xn}=Ce,{limit:Kn}=Ce,{skip:to}=Ce,{total:io}=Ce;function uo(So){So.preventDefault(),bo($n)}function ho(So){So.preventDefault(),bo(1)}function bo(So){const $o=new URL(Xn??window.location.href);let Do=So*Kn-Kn;$o.searchParams.set("skip",Do),qn?Un("refresh",$o):window.location=$o}function Oo(So){bubble.call(this,_n,So)}return _n.$$set=So=>{"inModal"in So&&ke(0,qn=So.inModal),"modalUrl"in So&&ke(1,Xn=So.modalUrl),"limit"in So&&ke(2,Kn=So.limit),"skip"in So&&ke(3,to=So.skip),"total"in So&&ke(4,io=So.total)},_n.$$.update=()=>{_n.$$.dirty&20&&ke(5,$n=Math.ceil(io/Kn)),_n.$$.dirty&12&&ke(6,Hn=Math.ceil((to-1)/Kn)+1),_n.$$.dirty&96&&ke(7,zn=lodashExports.range(Hn-3,Hn+4).filter(So=>So>0&&So<=$n))},[qn,Xn,Kn,to,io,$n,Hn,zn,uo,ho,Oo]}class Pagination extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$V,create_fragment$V,safe_not_equal,{inModal:0,modalUrl:1,limit:2,skip:3,total:4})}}function create_else_block$d(_n){let Ce,ke,$n;return{c(){Ce=element("button"),Ce.textContent="Move to trash",attr(Ce,"type","button"),attr(Ce,"class","button")},m(Hn,zn){insert$1(Hn,Ce,zn),ke||($n=listen(Ce,"click",prevent_default(_n[9])),ke=!0)},p:noop,d(Hn){Hn&&detach(Ce),ke=!1,$n()}}}function create_if_block$z(_n){let Ce,ke,$n,Hn,zn,Un,qn=_n[1].hasDrafts&&create_if_block_1$l(_n);return{c(){Ce=element("button"),Ce.textContent="Publish",ke=space$3(),qn&&qn.c(),$n=space$3(),Hn=element("button"),Hn.textContent="Delete forever",attr(Ce,"type","button"),attr(Ce,"class","button"),attr(Hn,"type","button"),attr(Hn,"class","button")},m(Xn,Kn){insert$1(Xn,Ce,Kn),insert$1(Xn,ke,Kn),qn&&qn.m(Xn,Kn),insert$1(Xn,$n,Kn),insert$1(Xn,Hn,Kn),zn||(Un=[listen(Ce,"click",prevent_default(_n[7])),listen(Hn,"click",prevent_default(_n[3]))],zn=!0)},p(Xn,Kn){Xn[1].hasDrafts?qn?qn.p(Xn,Kn):(qn=create_if_block_1$l(Xn),qn.c(),qn.m($n.parentNode,$n)):qn&&(qn.d(1),qn=null)},d(Xn){Xn&&(detach(Ce),detach(ke),detach($n),detach(Hn)),qn&&qn.d(Xn),zn=!1,run_all(Un)}}}function create_if_block_1$l(_n){let Ce,ke,$n;return{c(){Ce=element("button"),Ce.textContent="Make Draft",attr(Ce,"type","button"),attr(Ce,"class","button")},m(Hn,zn){insert$1(Hn,Ce,zn),ke||($n=listen(Ce,"click",prevent_default(_n[8])),ke=!0)},p:noop,d(Hn){Hn&&detach(Ce),ke=!1,$n()}}}function create_fragment$U(_n){let Ce,ke,$n=_n[0].length+"",Hn,zn,Un,qn,Xn,Kn,to,io,uo;function ho(So,$o){return So[2].status_in==="trashed"?create_if_block$z:create_else_block$d}let bo=ho(_n),Oo=bo(_n);return{c(){Ce=element("div"),ke=element("span"),Hn=text($n),zn=text(" records selected"),Un=space$3(),qn=element("button"),qn.textContent="Publish",Xn=space$3(),Kn=element("button"),Kn.textContent="Make Draft",to=space$3(),Oo.c(),attr(ke,"class","me-2"),attr(qn,"type","button"),attr(qn,"class","button"),attr(Kn,"type","button"),attr(Kn,"class","button"),set_style(Ce,"display","flex"),set_style(Ce,"align-items","center"),set_style(Ce,"gap","8px")},m(So,$o){insert$1(So,Ce,$o),append(Ce,ke),append(ke,Hn),append(ke,zn),append(Ce,Un),append(Ce,qn),append(Ce,Xn),append(Ce,Kn),append(Ce,to),Oo.m(Ce,null),io||(uo=[listen(qn,"click",prevent_default(_n[5])),listen(Kn,"click",prevent_default(_n[6]))],io=!0)},p(So,[$o]){$o&1&&$n!==($n=So[0].length+"")&&set_data(Hn,$n),bo===(bo=ho(So))&&Oo?Oo.p(So,$o):(Oo.d(1),Oo=bo(So),Oo&&(Oo.c(),Oo.m(Ce,null)))},i:noop,o:noop,d(So){So&&detach(Ce),Oo.d(),io=!1,run_all(uo)}}}function instance$U(_n,Ce,ke){const $n=getContext$1("channel");let{selected:Hn}=Ce,{schema:zn}=Ce,{filter:Un}=Ce;function qn(bo){bo.preventDefault(),axios.post($n.lucentUrl+"/records/delete",{ids:Hn.map(Oo=>Oo.id)}).then(Oo=>{window.location.reload()}).catch(Oo=>{console.log(Oo)})}function Xn(bo,Oo){axios.post($n.lucentUrl+"/records/status/"+Oo,{schemaName:zn.name,records:Hn}).then(So=>{window.location.reload()}).catch(So=>{console.log(So)})}const Kn=bo=>Xn(bo,"published"),to=bo=>Xn(bo,"draft"),io=bo=>Xn(bo,"published"),uo=bo=>Xn(bo,"draft"),ho=bo=>Xn(bo,"tr
Line truncated
|
||||
* Sortable 1.15.2
|
||||
* @author RubaXa <trash@rubaxa.org>
|
||||
* @author owenm <owen23355@gmail.com>
|
||||
* @license MIT
|
||||
*/function ownKeys(_n,Ce){var ke=Object.keys(_n);if(Object.getOwnPropertySymbols){var $n=Object.getOwnPropertySymbols(_n);Ce&&($n=$n.filter(function(Hn){return Object.getOwnPropertyDescriptor(_n,Hn).enumerable})),ke.push.apply(ke,$n)}return ke}function _objectSpread2(_n){for(var Ce=1;Ce<arguments.length;Ce++){var ke=arguments[Ce]!=null?arguments[Ce]:{};Ce%2?ownKeys(Object(ke),!0).forEach(function($n){_defineProperty(_n,$n,ke[$n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_n,Object.getOwnPropertyDescriptors(ke)):ownKeys(Object(ke)).forEach(function($n){Object.defineProperty(_n,$n,Object.getOwnPropertyDescriptor(ke,$n))})}return _n}function _typeof(_n){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof=function(Ce){return typeof Ce}:_typeof=function(Ce){return Ce&&typeof Symbol=="function"&&Ce.constructor===Symbol&&Ce!==Symbol.prototype?"symbol":typeof Ce},_typeof(_n)}function _defineProperty(_n,Ce,ke){return Ce in _n?Object.defineProperty(_n,Ce,{value:ke,enumerable:!0,configurable:!0,writable:!0}):_n[Ce]=ke,_n}function _extends(){return _extends=Object.assign||function(_n){for(var Ce=1;Ce<arguments.length;Ce++){var ke=arguments[Ce];for(var $n in ke)Object.prototype.hasOwnProperty.call(ke,$n)&&(_n[$n]=ke[$n])}return _n},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(_n,Ce){if(_n==null)return{};var ke={},$n=Object.keys(_n),Hn,zn;for(zn=0;zn<$n.length;zn++)Hn=$n[zn],!(Ce.indexOf(Hn)>=0)&&(ke[Hn]=_n[Hn]);return ke}function _objectWithoutProperties(_n,Ce){if(_n==null)return{};var ke=_objectWithoutPropertiesLoose(_n,Ce),$n,Hn;if(Object.getOwnPropertySymbols){var zn=Object.getOwnPropertySymbols(_n);for(Hn=0;Hn<zn.length;Hn++)$n=zn[Hn],!(Ce.indexOf($n)>=0)&&Object.prototype.propertyIsEnumerable.call(_n,$n)&&(ke[$n]=_n[$n])}return ke}var version="1.15.2";function userAgent(_n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(_n)}var IE11OrLess=userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Edge=userAgent(/Edge/i),FireFox=userAgent(/firefox/i),Safari=userAgent(/safari/i)&&!userAgent(/chrome/i)&&!userAgent(/android/i),IOS=userAgent(/iP(ad|od|hone)/i),ChromeForAndroid=userAgent(/chrome/i)&&userAgent(/android/i),captureMode={capture:!1,passive:!1};function on$1(_n,Ce,ke){_n.addEventListener(Ce,ke,!IE11OrLess&&captureMode)}function off(_n,Ce,ke){_n.removeEventListener(Ce,ke,!IE11OrLess&&captureMode)}function matches(_n,Ce){if(Ce){if(Ce[0]===">"&&(Ce=Ce.substring(1)),_n)try{if(_n.matches)return _n.matches(Ce);if(_n.msMatchesSelector)return _n.msMatchesSelector(Ce);if(_n.webkitMatchesSelector)return _n.webkitMatchesSelector(Ce)}catch{return!1}return!1}}function getParentOrHost(_n){return _n.host&&_n!==document&&_n.host.nodeType?_n.host:_n.parentNode}function closest(_n,Ce,ke,$n){if(_n){ke=ke||document;do{if(Ce!=null&&(Ce[0]===">"?_n.parentNode===ke&&matches(_n,Ce):matches(_n,Ce))||$n&&_n===ke)return _n;if(_n===ke)break}while(_n=getParentOrHost(_n))}return null}var R_SPACE=/\s+/g;function toggleClass$1(_n,Ce,ke){if(_n&&Ce)if(_n.classList)_n.classList[ke?"add":"remove"](Ce);else{var $n=(" "+_n.className+" ").replace(R_SPACE," ").replace(" "+Ce+" "," ");_n.className=($n+(ke?" "+Ce:"")).replace(R_SPACE," ")}}function css$1(_n,Ce,ke){var $n=_n&&_n.style;if($n){if(ke===void 0)return document.defaultView&&document.defaultView.getComputedStyle?ke=document.defaultView.getComputedStyle(_n,""):_n.currentStyle&&(ke=_n.currentStyle),Ce===void 0?ke:ke[Ce];!(Ce in $n)&&Ce.indexOf("webkit")===-1&&(Ce="-webkit-"+Ce),$n[Ce]=ke+(typeof ke=="string"?"":"px")}}function matrix(_n,Ce){var ke="";if(typeof _n=="string")ke=_n;else do{var $n=css$1(_n,"transform");$n&&$n!=="none"&&(ke=$n+" "+ke)}while(!Ce&&(_n=_n.parentNode));var Hn=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return Hn&&new Hn(ke)}function find$1(_n,Ce,ke){if(_n){var $n=_n.getElementsByTagName(Ce),Hn=0,zn=$n.length;if(ke)for(;Hn<zn;Hn++)ke($n[Hn],Hn);return $n}return[]}function getWindowScrollingElement(){var _n=document.scrollingElement;return _n||document.documentElement}function getRect(_n,Ce,ke,$n,Hn){if(!(!_n.getBoundingClientRect&&_n!==window)){var zn,Un,qn,Xn,Kn,to,io;if(_n!==window&&_n.parentNode&&_n!==getWindowScrollingElement()?(zn=_n.getBoundingClientRect(),Un=zn.top,qn=zn.left,Xn=zn.bottom,Kn=zn.right,to=zn.height,io=zn.width):(Un=0,qn=0,Xn=window.innerHeight,Kn=window.innerWidth,to=window.innerHeight,io=window.innerWidth),(Ce||ke)&&_n!==window&&(Hn=Hn||_n.parentNode,!IE11OrLess))do if(Hn&&Hn.getBoundingClientRect&&(css$1(Hn,"transform")!=="none"||ke&&css$1(Hn,"position")!=="static")){var uo=Hn.getBoundingClientRect();Un-=uo.top+parseInt(css$1(Hn,"border-top-width")),qn-=uo.left+parseInt(css$1(Hn,"border-left-width")),Xn=Un+zn.height,Kn=qn+zn.width;break}while(Hn=Hn.parentNode);if($n&&_n!==window){var ho=matrix(Hn||_n),bo=ho&&ho.a,Oo=ho&&ho.d;ho&&(Un/=Oo,qn/=bo,io/=bo,to/=Oo,Xn=Un+to,Kn=qn+io)}return{top:Line truncated
|
||||
<span class='flatpickr-weekday'>
|
||||
`+Es.join("</span><span class='flatpickr-weekday'>")+`
|
||||
</span>
|
||||
`}}function cr(){ke.calendarContainer.classList.add("hasWeeks");var vs=createElement("div","flatpickr-weekwrapper");vs.appendChild(createElement("span","flatpickr-weekday",ke.l10n.weekAbbreviation));var Es=createElement("div","flatpickr-weeks");return vs.appendChild(Es),{weekWrapper:vs,weekNumbers:Es}}function ws(vs,Es){Es===void 0&&(Es=!0);var Ks=Es?vs:vs-ke.currentMonth;Ks<0&&ke._hidePrevMonthArrow===!0||Ks>0&&ke._hideNextMonthArrow===!0||(ke.currentMonth+=Ks,(ke.currentMonth<0||ke.currentMonth>11)&&(ke.currentYear+=ke.currentMonth>11?1:-1,ke.currentMonth=(ke.currentMonth+12)%12,Ya("onYearChange"),Ys()),Yo(),Ya("onMonthChange"),Al())}function Fs(vs,Es){if(vs===void 0&&(vs=!0),Es===void 0&&(Es=!0),ke.input.value="",ke.altInput!==void 0&&(ke.altInput.value=""),ke.mobileInput!==void 0&&(ke.mobileInput.value=""),ke.selectedDates=[],ke.latestSelectedDateObj=void 0,Es===!0&&(ke.currentYear=ke._initialDate.getFullYear(),ke.currentMonth=ke._initialDate.getMonth()),ke.config.enableTime===!0){var Ks=getDefaultHours(ke.config),pr=Ks.hours,ia=Ks.minutes,ka=Ks.seconds;ho(pr,ia,ka)}ke.redraw(),vs&&Ya("onChange")}function Br(){ke.isOpen=!1,ke.isMobile||(ke.calendarContainer!==void 0&&ke.calendarContainer.classList.remove("open"),ke._input!==void 0&&ke._input.classList.remove("active")),Ya("onClose")}function _r(){ke.config!==void 0&&Ya("onDestroy");for(var vs=ke._handlers.length;vs--;)ke._handlers[vs].remove();if(ke._handlers=[],ke.mobileInput)ke.mobileInput.parentNode&&ke.mobileInput.parentNode.removeChild(ke.mobileInput),ke.mobileInput=void 0;else if(ke.calendarContainer&&ke.calendarContainer.parentNode)if(ke.config.static&&ke.calendarContainer.parentNode){var Es=ke.calendarContainer.parentNode;if(Es.lastChild&&Es.removeChild(Es.lastChild),Es.parentNode){for(;Es.firstChild;)Es.parentNode.insertBefore(Es.firstChild,Es);Es.parentNode.removeChild(Es)}}else ke.calendarContainer.parentNode.removeChild(ke.calendarContainer);ke.altInput&&(ke.input.type="text",ke.altInput.parentNode&&ke.altInput.parentNode.removeChild(ke.altInput),delete ke.altInput),ke.input&&(ke.input.type=ke.input._type,ke.input.classList.remove("flatpickr-input"),ke.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(Ks){try{delete ke[Ks]}catch{}})}function ha(vs){return ke.calendarContainer.contains(vs)}function hs(vs){if(ke.isOpen&&!ke.config.inline){var Es=getEventTarget(vs),Ks=ha(Es),pr=Es===ke.input||Es===ke.altInput||ke.element.contains(Es)||vs.path&&vs.path.indexOf&&(~vs.path.indexOf(ke.input)||~vs.path.indexOf(ke.altInput)),ia=!pr&&!Ks&&!ha(vs.relatedTarget),ka=!ke.config.ignoredFocusElements.some(function(Ma){return Ma.contains(Es)});ia&&ka&&(ke.config.allowInput&&ke.setDate(ke._input.value,!1,ke.config.altInput?ke.config.altFormat:ke.config.dateFormat),ke.timeContainer!==void 0&&ke.minuteElement!==void 0&&ke.hourElement!==void 0&&ke.input.value!==""&&ke.input.value!==void 0&&Xn(),ke.close(),ke.config&&ke.config.mode==="range"&&ke.selectedDates.length===1&&ke.clear(!1))}}function Qs(vs){if(!(!vs||ke.config.minDate&&vs<ke.config.minDate.getFullYear()||ke.config.maxDate&&vs>ke.config.maxDate.getFullYear())){var Es=vs,Ks=ke.currentYear!==Es;ke.currentYear=Es||ke.currentYear,ke.config.maxDate&&ke.currentYear===ke.config.maxDate.getFullYear()?ke.currentMonth=Math.min(ke.config.maxDate.getMonth(),ke.currentMonth):ke.config.minDate&&ke.currentYear===ke.config.minDate.getFullYear()&&(ke.currentMonth=Math.max(ke.config.minDate.getMonth(),ke.currentMonth)),Ks&&(ke.redraw(),Ya("onYearChange"),Ys())}}function zo(vs,Es){var Ks;Es===void 0&&(Es=!0);var pr=ke.parseDate(vs,void 0,Es);if(ke.config.minDate&&pr&&compareDates(pr,ke.config.minDate,Es!==void 0?Es:!ke.minDateHasTime)<0||ke.config.maxDate&&pr&&compareDates(pr,ke.config.maxDate,Es!==void 0?Es:!ke.maxDateHasTime)>0)return!1;if(!ke.config.enable&&ke.config.disable.length===0)return!0;if(pr===void 0)return!1;for(var ia=!!ke.config.enable,ka=(Ks=ke.config.enable)!==null&&Ks!==void 0?Ks:ke.config.disable,Ma=0,Mr=void 0;Ma<ka.length;Ma++){if(Mr=ka[Ma],typeof Mr=="function"&&Mr(pr))return ia;if(Mr instanceof Date&&pr!==void 0&&Mr.getTime()===pr.getTime())return ia;if(typeof Mr=="string"){var il=ke.parseDate(Mr,void 0,!0);return il&&il.getTime()===pr.getTime()?ia:!ia}else if(typeof Mr=="object"&&pr!==void 0&&Mr.from&&Mr.to&&pr.getTime()>=Mr.from.getTime()&&pr.getTime()<=Mr.to.getTime())return ia}return!ia}function el(vs){return ke.daysContainer!==void 0?vs.className.indexOf("hidden")===-1&&vs.className.indexOf
Line truncated
|
||||
`||Mn==="\r",lC=(Mn,Vn)=>Vn<Mn.length&&Vn>=0?Lg(Mn[Vn]):!1,V1=(Mn,Vn=4,Wn=!0,jn=!0)=>{const Gn=Jd(" ",Vn),no=Mn.replace(/\t/g,Gn);return ra(no,(po,vo)=>E0(vo)||vo===hc?po.pcIsSpace||po.str===""&&Wn||po.str.length===no.length-1&&jn||lC(no,po.str.length+1)?{pcIsSpace:!1,str:po.str+hc}:{pcIsSpace:!0,str:po.str+" "}:{pcIsSpace:Lg(vo),str:po.str+vo},{pcIsSpace:!1,str:""}).str},By=(Mn,Vn)=>{const Wn=Cs.fromDom(Vn),jn=Cs.fromDom(Mn);return fS(jn,"pre,code",ws(Vs,Wn))},z1=(Mn,Vn)=>Ir(Mn)&&Q1(Mn.data)&&!By(Mn,Vn),Pd=Mn=>Oa(Mn)&&Mn.nodeName==="A"&&!Mn.hasAttribute("href")&&(Mn.hasAttribute("name")||Mn.hasAttribute("id")),Cp=(Mn,Vn)=>Xl(Mn)&&!z1(Mn,Vn)||Pd(Mn)||tg(Mn),tg=w0("data-mce-bookmark"),W1=w0("data-mce-bogus"),U1=nf("data-mce-bogus","all"),T0=Mn=>Uc(Cs.fromDom(Mn)).exists(Vn=>!yl(Vn)),Im=(Mn,Vn)=>{let Wn=0;if(Cp(Mn,Mn))return!1;{let jn=Mn.firstChild;if(!jn)return!0;const Gn=new mu(jn,Mn);do{if(Vn){if(U1(jn)){jn=Gn.next(!0);continue}if(W1(jn)){jn=Gn.next();continue}}if(Gf(jn)&&T0(jn))return!1;if(Ec(jn)){Wn++,jn=Gn.next();continue}if(Cp(jn,Mn))return!1;jn=Gn.next()}while(jn);return Wn<=1}},md=(Mn,Vn=!0)=>Im(Mn.dom,Vn),ng=Mn=>Mn.toLowerCase()==="svg",DO=Mn=>ng(Mn.nodeName),Fy=Mn=>(Mn==null?void 0:Mn.nodeName)==="svg"?"svg":"html",Hy=["svg"],Z1=()=>{let Mn=[];const Vn=()=>Mn[Mn.length-1];return{track:no=>{DO(no)&&Mn.push(no);let ao=Vn();return ao&&!ao.contains(no)&&(Mn.pop(),ao=Vn()),Fy(ao)},current:()=>Fy(Vn()),reset:()=>{Mn=[]}}},Ah="data-mce-block",kp=Mn=>nr(Al(Mn),Vn=>!/[A-Z]/.test(Vn)),s1=Mn=>Us(kp(Mn),Vn=>`${Vn}:`+Us(Hy,Wn=>`not(${Wn} ${Vn})`).join(":")).join(","),Ig=(Mn,Vn)=>is(Vn.querySelector(Mn))?(Vn.setAttribute(Ah,"true"),Vn.getAttribute("data-mce-selected")==="inline-boundary"&&Vn.removeAttribute("data-mce-selected"),!0):(Vn.removeAttribute(Ah),!1),Zh=(Mn,Vn)=>{const Wn=s1(Mn.getTransparentElements()),jn=s1(Mn.getBlockElements());return nr(Vn.querySelectorAll(Wn),Gn=>Ig(jn,Gn))},xp=(Mn,Vn)=>{var Wn;const jn=Vn?"lastChild":"firstChild";for(let Gn=Mn[jn];Gn;Gn=Gn[jn])if(md(Cs.fromDom(Gn))){(Wn=Gn.parentNode)===null||Wn===void 0||Wn.removeChild(Gn);return}},q1=(Mn,Vn)=>{const Wn=document.createRange(),jn=Mn.parentNode;if(jn){Wn.setStartBefore(Mn),Wn.setEndBefore(Vn);const Gn=Wn.extractContents();xp(Gn,!0),Wn.setStartAfter(Vn),Wn.setEndAfter(Mn);const no=Wn.extractContents();xp(no,!1),md(Cs.fromDom(Gn))||jn.insertBefore(Gn,Mn),md(Cs.fromDom(Vn))||jn.insertBefore(Vn,Mn),md(Cs.fromDom(no))||jn.insertBefore(no,Mn),jn.removeChild(Mn)}},hS=(Mn,Vn,Wn)=>{const jn=Mn.getBlockElements(),Gn=Cs.fromDom(Vn),no=po=>ql(po)in jn,ao=po=>Vs(po,Gn);fs(Km(Wn),po=>{au(po,no,ao).each(vo=>{const Ao=kh(po,Fo=>no(Fo)&&!Mn.isValidChild(ql(vo),ql(Fo)));if(Ao.length>0){const Fo=Uc(vo);fs(Ao,Qo=>{au(Qo,no,ao).each(qo=>{q1(qo.dom,Qo.dom)})}),Fo.each(Qo=>Zh(Mn,Qo.dom))}})})},MO=(Mn,Vn,Wn)=>{fs([...Wn,...Wl(Mn,Vn)?[Vn]:[]],jn=>fs(mf(Cs.fromDom(jn),jn.nodeName.toLowerCase()),Gn=>{Qa(Mn,Gn.dom)&&hf(Gn)}))},kv=(Mn,Vn)=>{const Wn=Zh(Mn,Vn);hS(Mn,Vn,Wn),MO(Mn,Vn,Wn)},j1=(Mn,Vn)=>{if(Tv(Mn,Vn)){const Wn=s1(Mn.getBlockElements());Ig(Wn,Vn)}},xv=(Mn,Vn,Wn)=>{const jn=no=>Vs(no,Cs.fromDom(Vn)),Gn=D1(Cs.fromDom(Wn),jn);Fc(Gn,Gn.length-2).filter(lf).fold(()=>kv(Mn,Vn),no=>kv(Mn,no.dom))},NO=Mn=>Mn.hasAttribute(Ah),Ev=(Mn,Vn)=>Mr(Mn.getTransparentElements(),Vn),Tv=(Mn,Vn)=>Oa(Vn)&&Ev(Mn,Vn.nodeName),Wl=(Mn,Vn)=>Tv(Mn,Vn)&&NO(Vn),Qa=(Mn,Vn)=>Tv(Mn,Vn)&&!NO(Vn),og=(Mn,Vn)=>Vn.type===1&&Ev(Mn,Vn.name)&&xo(Vn.attr(Ah)),Av=xl().browser,Lb=Mn=>xa(Mn,lf),T2=Mn=>Av.isFirefox()&&ql(Mn)==="table"?Lb(Ku(Mn)).filter(Vn=>ql(Vn)==="caption").bind(Vn=>Lb(Id(Vn)).map(Wn=>{const jn=Wn.dom.offsetTop,Gn=Vn.dom.offsetTop,no=Vn.dom.offsetHeight;return jn<=Gn?-no:0})).getOr(0):0,LO=(Mn,Vn)=>Mn.children&&Zs(Mn.children,Vn),Jc=(Mn,Vn,Wn)=>{let jn=0,Gn=0;const no=Mn.ownerDocument;if(Wn=Wn||Mn,Vn){if(Wn===Mn&&Vn.getBoundingClientRect&&Ju(Cs.fromDom(Mn),"position")==="static"){const po=Vn.getBoundingClientRect();return jn=po.left+(no.documentElement.scrollLeft||Mn.scrollLeft)-no.documentElement.clientLeft,Gn=po.top+(no.documentElement.scrollTop||Mn.scrollTop)-no.documentElement.clientTop,{x:jn,y:Gn}}let ao=Vn;for(;ao&&ao!==Wn&&ao.nodeType&&!LO(ao,Wn);){const po=ao;jn+=po.offsetLeft||0,Gn+=po.offsetTop||0,ao=po.offsetParent}for(ao=Vn.parentNode;ao&&ao!==Wn&&ao.nodeType&&!LO(ao,Wn);)jn-=ao.scrollLeft||0,Gn-=ao.scrollTop||0,ao=ao.parentNode;Gn+=T2(Cs.fromDom(Vn))}return{x:jn,y:Gn}},IO=(Mn,Vn={})=>{let Wn=0;const jn={},Gn=Cs.fromDom(Mn),no=Fa(Gn),ao=Ls=>{Vn.referrerPolicy=Ls},po=Ls=>{Vn.contentCssCors=Ls},vo=Ls=>{Fu(N1(Gn),Ls)},Ao=Ls=>{const zs=N1(Gn);uf(zs,"#"+Ls).each(sc)},Fo=Ls=>Ma(jn,Ls).getOrThunk(()=>({id:"mce-u"+Wn++,passed:[],failed:[],count:0})),Qo=Ls=>new Promise((zs,Hs)=>{let tr;const Pr=Lr._addCacheSuffix(Ls),Ur=Fo(Pr);jn[Pr]=Ur,Ur.count++;const fa=(wa,Va)=>{fs(wa,ha),Ur.status=Va,Ur.passed=[],Ur.failed=[],tr&&(tr.onload=null,tr.onerror=null,tr=null)},yr=()=>fa(Ur.passed,2),fr=()=>fa(Ur.failed,3);if(zs&&Ur.passed.push(zs),Hs&&Ur.failed.push(Hs),Ur.status===1)return
Line truncated
|
||||
Actual: `+qo.join(","));if(!gc(Vn,bs=>Zs(qo,bs)))throw new Error("Not all branches were specified when using match. Specified: "+qo.join(", ")+`
|
||||
Required: `+Vn.join(", "));return Qo[ao].apply(null,vo)},log:Qo=>{console.log(Qo,{constructors:Vn,constructor:ao,params:vo})}}}}),Wn}};Qg.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const Zr=Mn=>{const Vn=[],Wn=[];return fs(Mn,jn=>{jn.fold(Gn=>{Vn.push(Gn)},Gn=>{Wn.push(Gn)})}),{errors:Vn,values:Wn}},LS=Mn=>Mn.type==="inline-command"||Mn.type==="inline-format",Of=Mn=>Mn.type==="block-command"||Mn.type==="block-format",IS=Mn=>{const Vn=jn=>ym.error({message:jn,pattern:Mn}),Wn=(jn,Gn,no)=>{if(Mn.format!==void 0){let ao;if(Jo(Mn.format)){if(!gc(Mn.format,xo))return Vn(jn+" pattern has non-string items in the `format` array");ao=Mn.format}else if(xo(Mn.format))ao=[Mn.format];else return Vn(jn+" pattern has non-string `format` parameter");return ym.value(Gn(ao))}else return Mn.cmd!==void 0?xo(Mn.cmd)?ym.value(no(Mn.cmd,Mn.value)):Vn(jn+" pattern has non-string `cmd` parameter"):Vn(jn+" pattern is missing both `format` and `cmd` parameters")};if(!Io(Mn))return Vn("Raw pattern is not an object");if(!xo(Mn.start))return Vn("Raw pattern is missing `start` parameter");if(Mn.end!==void 0){if(!xo(Mn.end))return Vn("Inline pattern has non-string `end` parameter");if(Mn.start.length===0&&Mn.end.length===0)return Vn("Inline pattern has empty `start` and `end` parameters");let jn=Mn.start,Gn=Mn.end;return Gn.length===0&&(Gn=jn,jn=""),Wn("Inline",no=>({type:"inline-format",start:jn,end:Gn,format:no}),(no,ao)=>({type:"inline-command",start:jn,end:Gn,cmd:no,value:ao}))}else return Mn.replacement!==void 0?xo(Mn.replacement)?Mn.start.length===0?Vn("Replacement pattern has empty `start` parameter"):ym.value({type:"inline-command",start:"",end:Mn.start,cmd:"mceInsertContent",value:Mn.replacement}):Vn("Replacement pattern has non-string `replacement` parameter"):Mn.start.length===0?Vn("Block pattern has empty `start` parameter"):Wn("Block",jn=>({type:"block-format",start:Mn.start,format:jn[0]}),(jn,Gn)=>({type:"block-command",start:Mn.start,cmd:jn,value:Gn}))},Ub=Mn=>nr(Mn,Of),Jy=Mn=>nr(Mn,LS),Om=(Mn,Vn)=>({inlinePatterns:Jy(Mn),blockPatterns:Ub(Mn),dynamicPatternsLookup:Vn}),TC=Mn=>{const Vn=Zr(Us(Mn,IS));return fs(Vn.errors,Wn=>console.error(Wn.message,Wn.pattern)),Vn.values},eO=Mn=>Vn=>{const Wn=Mn(Vn);return TC(Wn)},Cd=xl().deviceType,Vg=Cd.isTouch(),tO=Eu.DOM,h1=Mn=>{const Vn=Mn.indexOf("=")>0?Mn.split(/[;,](?![^=;,]*(?:[;,]|$))/):Mn.split(",");return ra(Vn,(Wn,jn)=>{const Gn=jn.split("="),no=Gn[0],ao=Gn.length>1?Gn[1]:no;return Wn[ih(no)]=ih(ao),Wn},{})},dg=Mn=>Do(Mn,RegExp),ma=Mn=>Vn=>Vn.options.get(Mn),ip=Mn=>xo(Mn)||Io(Mn),BS=(Mn,Vn="")=>Wn=>{const jn=xo(Wn);if(jn)if(Wn.indexOf("=")!==-1){const Gn=h1(Wn);return{value:Ma(Gn,Mn.id).getOr(Vn),valid:jn}}else return{value:Wn,valid:jn};else return{valid:!1,message:"Must be a string."}},m1=Mn=>{const Vn=Mn.options.register;Vn("id",{processor:"string",default:Mn.id}),Vn("selector",{processor:"string"}),Vn("target",{processor:"object"}),Vn("suffix",{processor:"string"}),Vn("cache_suffix",{processor:"string"}),Vn("base_url",{processor:"string"}),Vn("referrer_policy",{processor:"string",default:""}),Vn("language_load",{processor:"boolean",default:!0}),Vn("inline",{processor:"boolean",default:!1}),Vn("iframe_attrs",{processor:"object",default:{}}),Vn("doctype",{processor:"string",default:"<!DOCTYPE html>"}),Vn("document_base_url",{processor:"string",default:Mn.documentBaseUrl}),Vn("body_id",{processor:BS(Mn,"tinymce"),default:"tinymce"}),Vn("body_class",{processor:BS(Mn),default:""}),Vn("content_security_policy",{processor:"string",default:""}),Vn("br_in_pre",{processor:"boolean",default:!0}),Vn("forced_root_block",{processor:Wn=>{const jn=xo(Wn)&&fc(Wn);return jn?{value:Wn,valid:jn}:{valid:!1,message:"Must be a non-empty string."}},default:"p"}),Vn("forced_root_block_attrs",{processor:"object",default:{}}),Vn("newline_behavior",{processor:Wn=>{const jn=Zs(["block","linebreak","invert","default"],Wn);return jn?{value:Wn,valid:jn}:{valid:!1,message:"Must be one of: block, linebreak, invert or default."}},default:"default"}),Vn("br_newline_selector",{processor:"string",default:".mce-toc h2,figcaption,caption"}),Vn("no_newline_selector",{processor:"string",default:""}),Vn("keep_styles",{processor:"boolean",default:!0}),Vn("end_container_on_empty_block",{processor:Wn=>Go(Wn)?{valid:!0,value:Wn}:xo(Wn)?{valid:!0,value:Wn}:{valid:!1,message:"Must be boolean or a string"},default:"blockquote"}),Vn("font_size_style_values",{processor:"string",default:"xx-small,x-small,small,medium,large,x-large,xx-large"}),Vn("font_size_legacy_values",{processor:"string",default:"xx-small,small,medium,large,x-large,xx-large,300%"}),Vn("font_size_classes",{processor:"string",default:""}),Vn("automatic_uploads",{processor:"boolean",default:!0}),Vn("images_reuse_filename",{processor:"boolean",default:!1}),Vn("images_replace_blob_uris",{processor:"boolean",default:!0}),Vn("icons",{processor:"string",default:""})
Line truncated
|
||||
\r \v`.indexOf(Mn)!==-1,uy=Mn=>!k_(Mn)&&!ok(Mn)&&!hd(Mn),sk=Mn=>{const Vn=[];if(Mn)for(let Wn=0;Wn<Mn.rangeCount;Wn++)Vn.push(Mn.getRangeAt(Wn));return Vn},rk=Mn=>cc(Mn,Vn=>{const Wn=jv(Vn);return Wn?[Cs.fromDom(Wn)]:[]}),dO=Mn=>sk(Mn).length>1,y3=Mn=>nr(rk(Mn),Eh),QT=Mn=>mf(Mn,"td[data-mce-selected],th[data-mce-selected]"),O3=(Mn,Vn)=>{const Wn=QT(Vn);return Wn.length>0?Wn:y3(Mn)},x_=Mn=>O3(sk(Mn.selection.getSel()),Cs.fromDom(Mn.getBody())),q0=(Mn,Vn)=>lm(Mn,"table",Vn),_3=Mn=>{const Vn=Mn.startContainer,Wn=Mn.startOffset;return Ir(Vn)?Wn===0?zo.some(Cs.fromDom(Vn)):zo.none():zo.from(Vn.childNodes[Wn]).map(Cs.fromDom)},S3=Mn=>{const Vn=Mn.endContainer,Wn=Mn.endOffset;return Ir(Vn)?Wn===Vn.data.length?zo.some(Cs.fromDom(Vn)):zo.none():zo.from(Vn.childNodes[Wn-1]).map(Cs.fromDom)},VT=Mn=>iu(Mn).fold(xs([Mn]),Vn=>[Mn].concat(VT(Vn))),Cx=Mn=>am(Mn).fold(xs([Mn]),Vn=>ql(Vn)==="br"?_d(Vn).map(Wn=>[Mn].concat(Cx(Wn))).getOr([]):[Mn].concat(Cx(Vn))),kx=(Mn,Vn)=>jc(_3(Vn),S3(Vn),(Wn,jn)=>{const Gn=xa(VT(Mn),ws(Vs,Wn)),no=xa(Cx(Mn),ws(Vs,jn));return Gn.isSome()&&no.isSome()}).getOr(!1),xx=(Mn,Vn,Wn,jn)=>{const Gn=Wn,no=new mu(Wn,Gn),ao=pr(Mn.schema.getMoveCaretBeforeOnEnterElements(),(vo,Ao)=>!Zs(["td","th","table"],Ao.toLowerCase()));let po=Wn;do{if(Ir(po)&&Lr.trim(po.data).length!==0){jn?Vn.setStart(po,0):Vn.setEnd(po,po.data.length);return}if(ao[po.nodeName]){jn?Vn.setStartBefore(po):po.nodeName==="BR"?Vn.setEndBefore(po):Vn.setEndAfter(po);return}}while(po=jn?no.next():no.prev());Gn.nodeName==="BODY"&&(jn?Vn.setStart(Gn,0):Vn.setEnd(Gn,Gn.childNodes.length))},ik=Mn=>{const Vn=Mn.selection.getSel();return is(Vn)&&Vn.rangeCount>0},dy=(Mn,Vn)=>{const Wn=x_(Mn);Wn.length>0?fs(Wn,jn=>{const Gn=jn.dom,no=Mn.dom.createRng();no.setStartBefore(Gn),no.setEndAfter(Gn),Vn(no,!0)}):Vn(Mn.selection.getRng(),!1)},zT=(Mn,Vn,Wn)=>{const jn=f1(Mn,Vn);Wn(jn),Mn.moveToBookmark(jn)},uw=Mn=>Ys(Mn==null?void 0:Mn.nodeType),Ex=Mn=>Oa(Mn)&&!hg(Mn)&&!fg(Mn)&&!Jm(Mn),w3=(Mn,Vn)=>{if(Ex(Vn)&&!/^(TD|TH)$/.test(Vn.nodeName)){const Wn=Mn.getAttrib(Vn,"data-mce-selected"),jn=parseInt(Wn,10);return!isNaN(jn)&&jn>0}else return!1},dw=(Mn,Vn,Wn)=>{const{selection:jn,dom:Gn}=Mn,no=jn.getNode(),ao=jl(no);zT(jn,!0,()=>{Vn()}),ao&&jl(no)&&Gn.isChildOf(no,Mn.getBody())?Mn.selection.select(no):Wn(jn.getStart())&&C3(Gn,jn)},C3=(Mn,Vn)=>{var Wn,jn;const Gn=Vn.getRng(),{startContainer:no,startOffset:ao}=Gn,po=Vn.getNode();if(!w3(Mn,po)&&Oa(no)){const vo=no.childNodes,Ao=Mn.getRoot();let Fo;if(ao<vo.length){const Qo=vo[ao];Fo=new mu(Qo,(Wn=Mn.getParent(Qo,Mn.isBlock))!==null&&Wn!==void 0?Wn:Ao)}else{const Qo=vo[vo.length-1];Fo=new mu(Qo,(jn=Mn.getParent(Qo,Mn.isBlock))!==null&&jn!==void 0?jn:Ao),Fo.next(!0)}for(let Qo=Fo.current();Qo;Qo=Fo.next()){if(Mn.getContentEditable(Qo)==="false")return;if(Ir(Qo)&&!sf(Qo)){Gn.setStart(Qo,0),Vn.setRng(Gn);return}}}},da=(Mn,Vn,Wn)=>{if(Mn){const jn=Vn?"nextSibling":"previousSibling";for(Mn=Mn[jn];Mn;Mn=Mn[jn])if(Oa(Mn)||!sf(Mn))return Mn}},Nf=(Mn,Vn)=>!!Mn.getTextBlockElements()[Vn.nodeName.toLowerCase()]||Wl(Mn,Vn),j0=(Mn,Vn,Wn)=>Mn.schema.isValidChild(Vn,Wn),sf=(Mn,Vn=!1)=>{if(is(Mn)&&Ir(Mn)){const Wn=Vn?Mn.data.replace(/ /g," "):Mn.data;return Q1(Wn)}else return!1},Wg=Mn=>is(Mn)&&Ir(Mn)&&Mn.length===0,ak=(Mn,Vn)=>{const Wn="[data-mce-cef-wrappable]",jn=zg(Mn),Gn=Td(jn)?Wn:`${Wn},${jn}`;return zh(Cs.fromDom(Vn),Gn)},fw=(Mn,Vn)=>{const Wn=Mn.dom;return Ex(Vn)&&Wn.getContentEditable(Vn)==="false"&&ak(Mn,Vn)&&Wn.select('[contenteditable="true"]',Vn).length===0},fb=(Mn,Vn)=>Yo(Mn)?Mn(Vn):(is(Vn)&&(Mn=Mn.replace(/%(\w+)/g,(Wn,jn)=>Vn[jn]||Wn)),Mn),lk=(Mn,Vn)=>(Mn=Mn||"",Vn=Vn||"",Mn=""+(Mn.nodeName||Mn),Vn=""+(Vn.nodeName||Vn),Mn.toLowerCase()===Vn.toLowerCase()),ck=(Mn,Vn)=>{if(ms(Mn))return null;{let Wn=String(Mn);return(Vn==="color"||Vn==="backgroundColor")&&(Wn=Bm(Wn)),Vn==="fontWeight"&&Mn===700&&(Wn="bold"),Vn==="fontFamily"&&(Wn=Wn.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),Wn}},E_=(Mn,Vn,Wn)=>{const jn=Mn.getStyle(Vn,Wn);return ck(jn,Wn)},WT=(Mn,Vn)=>{let Wn;return Mn.getParent(Vn,jn=>Oa(jn)?(Wn=Mn.getStyle(jn,"text-decoration"),!!Wn&&Wn!=="none"):!1),Wn},hw=(Mn,Vn,Wn)=>Mn.getParents(Vn,Wn,Mn.getRoot()),Tx=(Mn,Vn,Wn)=>{const jn=Mn.formatter.get(Vn);return is(jn)&&Sr(jn,Wn)},Ax=(Mn,Vn)=>Tx(Mn,Vn,jn=>{const Gn=no=>Yo(no)||no.length>1&&no.charAt(0)==="%";return Sr(["styles","attributes"],no=>Ma(jn,no).exists(ao=>{const po=Jo(ao)?ao:ka(ao);return Sr(po,Gn)}))}),k3=(Mn,Vn,Wn)=>{const jn=["inline","block","selector","attributes","styles","classes"],Gn=no=>pr(no,(ao,po)=>Sr(jn,vo=>vo===po));return Tx(Mn,Vn,no=>{const ao=Gn(no);return Tx(Mn,Wn,po=>{const vo=Gn(po);return Na(ao,vo)})})},hb=Mn=>il(Mn,"block"),uk=Mn=>hb(Mn)&&Mn.wrapper===!0,T_=Mn=>hb(Mn)&&Mn.wrapper!==!0,Nh=Mn=>il(Mn,"selector"),Sf=Mn=>il(Mn,"inline"),dk=Mn=>Nh(Mn)&&Sf(Mn)&&qc(Ma(Mn,"mixed"),!0),mw=Mn=>Nh(Mn)&&Mn.expand!==!1&&!Sf(Mn),fk=Mn=>{const Vn=[];let Wn=Mn;for(;Wn;){if(Ir(Wn)&&Wn.data!==_o||Wn.childNodes.length>1)return[];Oa(Wn)&&Vn.push(Wn),Wn=Wn.
Line truncated
|
||||
]*|<br \\/>[\r
|
||||
]*)$`);return Vn.replace(jn,"")},BY=(Mn,Vn)=>{const Wn=Mn.getDoc(),jn=Wf(Cs.fromDom(Mn.getBody())),Gn=Cs.fromTag("div",Wn);Gc(Gn,"data-mce-bogus","all"),ff(Gn,{position:"fixed",left:"-9999999px",top:"0"}),dm(Gn,Vn.innerHTML),Rl(Gn),eR(Gn);const no=Ny(jn);Fu(no,Gn);const ao=Xo(Gn.dom.innerText);return sc(Gn),ao},XH=(Mn,Vn,Wn)=>{let jn;return Vn.format==="raw"?jn=Lr.trim(Xo(s5(Wn,Mn.serializer.getTempAttrs()).innerHTML)):Vn.format==="text"?jn=BY(Mn,Wn):Vn.format==="tree"?jn=Mn.serializer.serialize(Wn,Vn):jn=IY(Mn,Mn.serializer.serialize(Wn,Vn)),Vn.format!=="text"&&!Xd(Cs.fromDom(Wn))&&xo(jn)?Lr.trim(jn):jn},FY=(Mn,Vn)=>zo.from(Mn.getBody()).fold(xs(Vn.format==="tree"?new fp("body",11):""),Wn=>XH(Mn,Vn,Wn)),YH=Lr.makeMap,r5=Mn=>{const Vn=[];Mn=Mn||{};const Wn=Mn.indent,jn=YH(Mn.indent_before||""),Gn=YH(Mn.indent_after||""),no=P0.getEncodeFunc(Mn.entity_encoding||"raw",Mn.entities),ao=Mn.element_format!=="xhtml";return{start:(po,vo,Ao)=>{if(Wn&&jn[po]&&Vn.length>0){const Fo=Vn[Vn.length-1];Fo.length>0&&Fo!==`
|
||||
`&&Vn.push(`
|
||||
`)}if(Vn.push("<",po),vo)for(let Fo=0,Qo=vo.length;Fo<Qo;Fo++){const qo=vo[Fo];Vn.push(" ",qo.name,'="',no(qo.value,!0),'"')}if(!Ao||ao?Vn[Vn.length]=">":Vn[Vn.length]=" />",Ao&&Wn&&Gn[po]&&Vn.length>0){const Fo=Vn[Vn.length-1];Fo.length>0&&Fo!==`
|
||||
`&&Vn.push(`
|
||||
`)}},end:po=>{let vo;Vn.push("</",po,">"),Wn&&Gn[po]&&Vn.length>0&&(vo=Vn[Vn.length-1],vo.length>0&&vo!==`
|
||||
`&&Vn.push(`
|
||||
`))},text:(po,vo)=>{po.length>0&&(Vn[Vn.length]=vo?po:no(po))},cdata:po=>{Vn.push("<![CDATA[",po,"]]>")},comment:po=>{Vn.push("<!--",po,"-->")},pi:(po,vo)=>{vo?Vn.push("<?",po," ",no(vo),"?>"):Vn.push("<?",po,"?>"),Wn&&Vn.push(`
|
||||
`)},doctype:po=>{Vn.push("<!DOCTYPE",po,">",Wn?`
|
||||
`:"")},reset:()=>{Vn.length=0},getContent:()=>Vn.join("").replace(/\n$/,"")}},I_=(Mn={},Vn=i1())=>{const Wn=r5(Mn);return Mn.validate="validate"in Mn?Mn.validate:!0,{serialize:Gn=>{const no=Mn.validate,ao={3:vo=>{var Ao;Wn.text((Ao=vo.value)!==null&&Ao!==void 0?Ao:"",vo.raw)},8:vo=>{var Ao;Wn.comment((Ao=vo.value)!==null&&Ao!==void 0?Ao:"")},7:vo=>{Wn.pi(vo.name,vo.value)},10:vo=>{var Ao;Wn.doctype((Ao=vo.value)!==null&&Ao!==void 0?Ao:"")},4:vo=>{var Ao;Wn.cdata((Ao=vo.value)!==null&&Ao!==void 0?Ao:"")},11:vo=>{let Ao=vo;if(Ao=Ao.firstChild)do po(Ao);while(Ao=Ao.next)}};Wn.reset();const po=vo=>{var Ao;const Fo=ao[vo.type];if(Fo)Fo(vo);else{const Qo=vo.name,qo=Qo in Vn.getVoidElements();let ds=vo.attributes;if(no&&ds&&ds.length>1){const bs=[];bs.map={};const ls=Vn.getElementRule(vo.name);if(ls){for(let ys=0,Ls=ls.attributesOrder.length;ys<Ls;ys++){const zs=ls.attributesOrder[ys];if(zs in ds.map){const Hs=ds.map[zs];bs.map[zs]=Hs,bs.push({name:zs,value:Hs})}}for(let ys=0,Ls=ds.length;ys<Ls;ys++){const zs=ds[ys].name;if(!(zs in bs.map)){const Hs=ds.map[zs];bs.map[zs]=Hs,bs.push({name:zs,value:Hs})}}ds=bs}}if(Wn.start(Qo,ds,qo),ng(Qo))xo(vo.value)&&Wn.text(vo.value,!0),Wn.end(Qo);else if(!qo){let bs=vo.firstChild;if(bs){(Qo==="pre"||Qo==="textarea")&&bs.type===3&&((Ao=bs.value)===null||Ao===void 0?void 0:Ao[0])===`
|
||||
`&&Wn.text(`
|
||||
`,!0);do po(bs);while(bs=bs.next)}Wn.end(Qo)}}};return Gn.type===1&&!Mn.inner?po(Gn):Gn.type===3?ao[3](Gn):ao[11](Gn),Wn.getContent()}}},ol=new Set;fs(["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"],Vn=>{ol.add(Vn)});const i5=["font","text-decoration","text-emphasis"],tR=(Mn,Vn)=>Al(Mn.parseStyle(Mn.getAttrib(Vn,"style"))),GH=Mn=>ol.has(Mn),qx=(Mn,Vn)=>gc(tR(Mn,Vn),Wn=>!GH(Wn)),a5=Mn=>nr(Mn,Vn=>Sr(i5,Wn=>Dc(Vn,Wn))),KH=(Mn,Vn,Wn)=>{const jn=tR(Mn,Vn),Gn=tR(Mn,Wn),no=ao=>{var po,vo;const Ao=(po=Mn.getStyle(Vn,ao))!==null&&po!==void 0?po:"",Fo=(vo=Mn.getStyle(Wn,ao))!==null&&vo!==void 0?vo:"";return fc(Ao)&&fc(Fo)&&Ao!==Fo};return Sr(jn,ao=>{const po=vo=>Sr(vo,Ao=>Ao===ao);if(!po(Gn)&&po(i5)){const vo=a5(Gn);return Sr(vo,no)}else return no(ao)})},l5=(Mn,Vn,Wn)=>zo.from(Wn.container()).filter(Ir).exists(jn=>{const Gn=Mn?0:-1;return Vn(jn.data.charAt(Wn.offset()+Gn))}),nR=ws(l5,!0,k_),OA=ws(l5,!1,k_),JH=Mn=>{const Vn=Mn.container();return Ir(Vn)&&(Vn.data.length===0||Po(Vn.data)&&fO.isBookmarkNode(Vn.parentNode))},Aw=(Mn,Vn)=>Wn=>ua(Mn?0:-1,Wn).filter(Vn).isSome(),e9=Mn=>td(Mn)&&Ju(Cs.fromDom(Mn),"display")==="block",c5=Mn=>jl(Mn)&&!_v(Mn),t9=Aw(!0,e9),n9=Aw(!1,e9),jx=Aw(!0,pu),wk=Aw(!1,pu),u5=Aw(!0,Gp),Ql=Aw(!1,Gp),bO=Aw(!0,c5),tv=Aw(!1,c5),d5=Mn=>Mn.slice(0,-1),f5=(Mn,Vn,Wn)=>Dr(Vn,Mn)?d5(D1(Mn,jn=>Wn(jn)||Vs(jn,Vn))):[],oR=(Mn,Vn)=>f5(Mn,Vn,hs),py=(Mn,Vn)=>[Mn].concat(oR(Mn,Vn)),_A=(Mn,Vn,Wn)=>g1(Mn,Vn,Wn,JH),o9=Mn=>Vn=>Mn.isBlock(ql(Vn)),sR=(Mn,Vn,Wn)=>xa(py(Cs.fromDom(Vn.container()),Mn),o9(Wn)),h5=(Mn,Vn,Wn,jn)=>_A(Mn,Vn.dom,Wn).forall(Gn=>sR(Vn,Wn,jn).fold(()=>!jr(Gn,Wn,Vn.dom),no=>!jr(Gn,Wn,Vn.dom)&&Dr(no,Cs.fromDom(Gn.container())))),m5=(Mn,Vn,Wn,jn)=>sR(Vn,Wn,jn).fold(()=>_A(Mn,Vn.dom,Wn).forall(Gn=>!jr(Gn,Wn,Vn.dom)),Gn=>_A(Mn,Gn.dom,Wn).isNone()),rR=ws(m5,!1),p5=ws(m5,!0),s9=ws(h5,!1),r9=ws(h5,!0),i9=Mn=>Mh(Mn).exists(np),SA=(Mn,Vn,Wn,jn)=>{const Gn=nr(py(Cs.fromDom(Wn.container()),Vn),ao=>jn.isBlock(ql(ao))),no=qa(Gn).getOr(Vn);return vh(Mn,no.dom,Wn).filter(i9)},Xx=(Mn,Vn,Wn)=>Mh(Vn).exists(np)||SA(!0,Mn,Vn,Wn).isSome(),Yx=(Mn,Vn,Wn)=>Rp(Vn).exists(np)||SA(!1,Mn,Vn,Wn).isSome(),a9=ws(SA,!1),l9=ws(SA,!0),g5=Mn=>lr.isTextPosition(Mn)&&!Mn.isAtStart()&&!Mn.isAtEnd(),b5=(Mn,Vn,Wn)=>{const jn=nr(py(Cs.fromDom(Vn.container()),Mn),Gn=>Wn.isBlock(ql(Gn)));return qa(jn).getOr(Mn)},v5=(Mn,Vn,Wn)=>g5(Vn)?OA(Vn):OA(Vn)||cp(b5(Mn,Vn,Wn).dom,Vn).exists(OA),y5=(Mn,Vn,Wn)=>g5(Vn)?nR(Vn):nR(Vn)||Sm(b5(Mn,Vn,Wn).dom,Vn).exists(nR),c9=Mn=>Zs(["pre","pre-wrap"],Mn),iR=Mn=>Mh(Mn).bind(Vn=>cf(Vn,lf)).exists(Vn=>c9(Ju(Vn,"white-space"))),O5=(Mn,Vn)=>cp(Mn.dom,Vn).isNone(),u9=(Mn,Vn)=>Sm(Mn.dom,Vn).isNone(),d9=(Mn,Vn,Wn)=>O5(Mn,Vn)||u9(Mn,Vn)||rR(Mn,Vn,Wn)||p5(Mn,Vn,Wn)||Yx(Mn,Vn,Wn)||Xx(Mn,Vn,Wn),Pw=Mn=>is(Mn)&&jl(Mn)&&Yb(Mn),_5=(Mn,Vn)=>Wn=>Pw(new mu(Wn,Mn)[Vn]()),S5=(Mn,Vn)=>{const Wn=Sm(Mn.dom,Vn).getOr(Vn),jn=_5(Mn.dom,"next");return Vn.isAtEnd()&&(jn(Vn.container())||jn(Wn.container()))},f9=(Mn,Vn)=>{const Wn=cp(Mn.dom,Vn).getOr(Vn),jn=_5(Mn.dom,"prev");return Vn.isAtStart()&&(jn(Vn.container())||jn(Wn.container()))},w5=(Mn,Vn,Wn)=>iR(Vn)?!1:d9(Mn,Vn,Wn)||v5(Mn,Vn,Wn)||y5(Mn,Vn,Wn),Ck=(Mn,Vn,Wn)=>iR(Vn)?!1:rR(Mn,Vn,Wn)||s9(Mn,Vn,Wn)||Yx(Mn,Vn,Wn)||v5(Mn,Vn,Wn)||f9(Mn,Vn),C5=Mn=>{const Vn=Mn.container(),Wn=Mn.offset();return Ir(Vn)&&Wn<Vn.data.length?lr(Vn,Wn+1):Mn},kk=(Mn,Vn,Wn)=>iR(Vn)?!1:p5(Mn,Vn,Wn)||r9(Mn,Vn,Wn)||Xx(Mn,Vn,Wn)||y5(Mn,Vn,Wn)||S5(Mn,Vn),wA=(Mn,Vn,Wn)=>Ck(Mn,Vn,Wn)||kk(Mn,C5(Vn),Wn),hp=(Mn,Vn)=>ok(Mn.charAt(Vn)),k5=(Mn,Vn)=>k_(Mn.charAt(Vn)),h9=Mn=>{const Vn=Mn.container();return Ir(Vn)&&oc(Vn.data,hc)},m9=Mn=>{const Vn=Mn.split("");return Us(Vn,(Wn,jn)=>ok(Wn)&&jn>0&&jn<Vn.length-1&&uy(Vn[jn-1])&&uy(Vn[jn+1])?" ":Wn).join("")},x5=(Mn,Vn,Wn,jn)=>{const Gn=Vn.data,no=lr(Vn,0);return!Wn&&hp(Gn,0)&&!wA(Mn,no,jn)?(Vn.data=" "+Gn.slice(1),!0):Wn&&k5(Gn,0)&&Ck(Mn,no,jn)?(Vn.data=hc+Gn.slice(1),!0):!1},p9=Mn=>{const Vn=Mn.data,Wn=m9(Vn);return Wn!==Vn?(Mn.data=Wn,!0):!1},B_=(Mn,Vn,Wn,jn)=>{const Gn=Vn.data,no=lr(Vn,Gn.length-1);return!Wn&&hp(Gn,Gn.length-1)&&!wA(Mn,no,jn)?(Vn.data=Gn.slice(0,-1)+" ",!0):Wn&&k5(Gn,Gn.length-1)&&kk(Mn,no,jn)?(Vn.data=Gn.slice(0,-1)+hc,!0):!1},g9=(Mn,Vn,Wn)=>{const jn=Vn.container();if(!Ir(jn))return zo.none();if(h9(Vn)){const Gn=x5(Mn,jn,!1,Wn)||p9(jn)||B_(Mn,jn,!1,Wn);return El(Gn,Vn)}else if(wA(Mn,Vn,Wn)){const Gn=x5(Mn,jn,!0,Wn)||B_(Mn,jn,
Line truncated
|
||||
`+_h),du&&(_h=r0(_h,wa," "),_h=r0(_h,Va," "),_h=r0(_h,Tl," ")),Hs&&Sl?Hs.createHTML(_h):_h},Vn.setConfig=function(ec){ST(ec),h0=!0},Vn.clearConfig=function(){cS=null,h0=!1},Vn.isValidAttribute=function(ec,hr,Da){cS||ST({});const sl=xm(ec),af=xm(hr);return kN(sl,af,Da)},Vn.addHook=function(ec,hr){typeof hr=="function"&&(Ar[ec]=Ar[ec]||[],Sy(Ar[ec],hr))},Vn.removeHook=function(ec){if(Ar[ec])return Hk(Ar[ec])},Vn.removeHooks=function(ec){Ar[ec]&&(Ar[ec]=[])},Vn.removeAllHooks=function(){Ar={}},Vn}var oI=OE();const sI=Lr.each,Q_=Lr.trim,bD=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],rI={ftp:21,http:80,https:443,mailto:25},_E=["img","video"],iI=(Mn,Vn)=>is(Mn)?!Mn:is(Vn)?!Zs(_E,Vn):!0,vD=Mn=>{try{return decodeURIComponent(Mn)}catch{return unescape(Mn)}},yD=(Mn,Vn,Wn)=>{const jn=vD(Vn).replace(/\s/g,"");return Mn.allow_script_urls?!1:/((java|vb)script|mhtml):/i.test(jn)?!0:Mn.allow_html_data_urls?!1:/^data:image\//i.test(jn)?iI(Mn.allow_svg_data_urls,Wn)&&/^data:image\/svg\+xml/i.test(jn):/^data:/i.test(jn)};class bb{static parseDataUri(Vn){let Wn;const jn=decodeURIComponent(Vn).split(","),Gn=/data:([^;]+)/.exec(jn[0]);return Gn&&(Wn=Gn[1]),{type:Wn,data:jn[1]}}static isDomSafe(Vn,Wn,jn={}){if(jn.allow_script_urls)return!0;{const Gn=P0.decode(Vn).replace(/[\s\u0000-\u001F]+/g,"");return!yD(jn,Gn,Wn)}}static getDocumentBaseUrl(Vn){var Wn;let jn;return Vn.protocol.indexOf("http")!==0&&Vn.protocol!=="file:"?jn=(Wn=Vn.href)!==null&&Wn!==void 0?Wn:"":jn=Vn.protocol+"//"+Vn.host+Vn.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(jn)&&(jn=jn.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(jn)||(jn+="/")),jn}constructor(Vn,Wn={}){this.path="",this.directory="",Vn=Q_(Vn),this.settings=Wn;const jn=Wn.base_uri,Gn=this;if(/^([\w\-]+):([^\/]{2})/i.test(Vn)||/^\s*#/.test(Vn)){Gn.source=Vn;return}const no=Vn.indexOf("//")===0;if(Vn.indexOf("/")===0&&!no&&(Vn=(jn&&jn.protocol||"http")+"://mce_host"+Vn),!/^[\w\-]*:?\/\//.test(Vn)){const po=jn?jn.path:new bb(document.location.href).directory;if((jn==null?void 0:jn.protocol)==="")Vn="//mce_host"+Gn.toAbsPath(po,Vn);else{const vo=/([^#?]*)([#?]?.*)/.exec(Vn);vo&&(Vn=(jn&&jn.protocol||"http")+"://mce_host"+Gn.toAbsPath(po,vo[1])+vo[2])}}Vn=Vn.replace(/@@/g,"(mce_at)");const ao=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(Vn);ao&&sI(bD,(po,vo)=>{let Ao=ao[vo];Ao&&(Ao=Ao.replace(/\(mce_at\)/g,"@@")),Gn[po]=Ao}),jn&&(Gn.protocol||(Gn.protocol=jn.protocol),Gn.userInfo||(Gn.userInfo=jn.userInfo),!Gn.port&&Gn.host==="mce_host"&&(Gn.port=jn.port),(!Gn.host||Gn.host==="mce_host")&&(Gn.host=jn.host),Gn.source=""),no&&(Gn.protocol="")}setPath(Vn){const Wn=/^(.*?)\/?(\w+)?$/.exec(Vn);Wn&&(this.path=Wn[0],this.directory=Wn[1],this.file=Wn[2]),this.source="",this.getURI()}toRelative(Vn){if(Vn==="./")return Vn;const Wn=new bb(Vn,{base_uri:this});if(Wn.host!=="mce_host"&&this.host!==Wn.host&&Wn.host||this.port!==Wn.port||this.protocol!==Wn.protocol&&Wn.protocol!=="")return Wn.getURI();const jn=this.getURI(),Gn=Wn.getURI();if(jn===Gn||jn.charAt(jn.length-1)==="/"&&jn.substr(0,jn.length-1)===Gn)return jn;let no=this.toRelPath(this.path,Wn.path);return Wn.query&&(no+="?"+Wn.query),Wn.anchor&&(no+="#"+Wn.anchor),no}toAbsolute(Vn,Wn){const jn=new bb(Vn,{base_uri:this});return jn.getURI(Wn&&this.isSameOrigin(jn))}isSameOrigin(Vn){if(this.host==Vn.host&&this.protocol==Vn.protocol){if(this.port==Vn.port)return!0;const Wn=this.protocol?rI[this.protocol]:null;if(Wn&&(this.port||Wn)==(Vn.port||Wn))return!0}return!1}toRelPath(Vn,Wn){let jn=0,Gn="",no,ao;const po=Vn.substring(0,Vn.lastIndexOf("/")).split("/"),vo=Wn.split("/");if(po.length>=vo.length){for(no=0,ao=po.length;no<ao;no++)if(no>=vo.length||po[no]!==vo[no]){jn=no+1;break}}if(po.length<vo.length){for(no=0,ao=vo.length;no<ao;no++)if(no>=po.length||po[no]!==vo[no]){jn=no+1;break}}if(jn===1)return Wn;for(no=0,ao=po.length-(jn-1);no<ao;no++)Gn+="../";for(no=jn-1,ao=vo.length;no<ao;no++)no!==jn-1?Gn+="/"+vo[no]:Gn+=vo[no];return Gn}toAbsPath(Vn,Wn){let jn=0;const Gn=/\/$/.test(Wn)?"/":"",no=Vn.split("/"),ao=Wn.split("/"),po=[];sI(no,Qo=>{Qo&&po.push(Qo)});const vo=[];for(let Qo=ao.length-1;Qo>=0;Qo--)if(!(ao[Qo].length===0||ao[Qo]===".")){if(ao[Qo]===".."){jn++;continue}if(jn>0){jn--;continue}vo.push(ao[Qo])}const Ao=po.length-jn;let Fo;return Ao<=0?Fo=nc(vo).join("/"):Fo=po.slice(0,Ao).join("/")+"/"+nc(vo).join("/"),Fo.indexOf("/")!==0&&(Fo="/"+Fo),Gn&&Fo.lastIndexOf("/")!==Fo.length-1&&(Fo+=Gn),Fo}getURI(Vn=!1){let Wn;return(!this.source||Vn)&&(Wn="",Vn||(this.protocol?Wn+=this.protocol+"://":Wn+="//",this.userInfo&&(Wn+=this.userInfo+"@"),this.host&&(Wn+=this.host),this.port&&(Wn+=":"+this.port)),this.path&&(Wn+=this.path),this.query&&(Wn+="?"+this.query),this.anchor&&(Wn+="#"+this.ancho
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 po=jn.length;for(;po--;){const vo=jn[po],Ao=vo.firstChild,Fo=(no=Ao==null?void 0:Ao.value)!==null&&no!==void 0?no:"";if(Gn==="script"){const Qo=vo.attr("type");Qo&&vo.attr("type",Qo==="mce-no/type"?null:Qo.replace(/^mce\-/,"")),Vn.element_format==="xhtml"&&Ao&&Fo.length>0&&(Ao.value=`// <![CDATA[
|
||||
`+ao(Fo)+`
|
||||
// ]]>`)}else Vn.element_format==="xhtml"&&Ao&&Fo.length>0&&(Ao.value=`<!--
|
||||
`+ao(Fo)+`
|
||||
-->`)}}),Mn.addNodeFilter("#comment",jn=>{let Gn=jn.length;for(;Gn--;){const no=jn[Gn],ao=no.value;Vn.preserve_cdata&&(ao==null?void 0:ao.indexOf("[CDATA["))===0?(no.name="#cdata",no.type=4,no.value=Wn.decode(ao.replace(/^\[CDATA\[|\]\]$/g,""))):(ao==null?void 0:ao.indexOf("mce:protected "))===0&&(no.name="#text",no.type=3,no.raw=!0,no.value=unescape(ao).substr(14))}}),Mn.addNodeFilter("xml:namespace,input",(jn,Gn)=>{let no=jn.length;for(;no--;){const ao=jn[no];ao.type===7?ao.remove():ao.type===1&&Gn==="input"&&!ao.attr("type")&&ao.attr("type","text")}}),Mn.addAttributeFilter("data-mce-type",jn=>{fs(jn,Gn=>{Gn.attr("data-mce-type")==="format-caret"&&(Gn.isEmpty(Mn.schema.getNonEmptyElements())?Gn.remove():Gn.unwrap())})}),Mn.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",(jn,Gn)=>{let no=jn.length;for(;no--;)jn[no].attr(Gn,null)}),Vn.remove_trailing_brs&&lD(Vn,Mn,Mn.schema)},xE=Mn=>{const Vn=jn=>(jn==null?void 0:jn.name)==="br",Wn=Mn.lastChild;if(Vn(Wn)){const jn=Wn.prev;Vn(jn)&&(Wn.remove(),jn.remove())}},FI=(Mn,Vn,Wn)=>{let jn;const Gn=Mn.dom;let no=Vn.cloneNode(!0);const ao=document.implementation;if(ao.createHTMLDocument){const po=ao.createHTMLDocument("");Lr.each(no.nodeName==="BODY"?no.childNodes:[no],vo=>{po.body.appendChild(po.importNode(vo,!0))}),no.nodeName!=="BODY"?no=po.body.firstChild:no=po.body,jn=Gn.doc,Gn.doc=po}return Nx(Mn,{...Wn,node:no}),jn&&(Gn.doc=jn),no},HI=(Mn,Vn)=>is(Mn)&&Mn.hasEventListeners("PreProcess")&&!Vn.no_events,NV=(Mn,Vn,Wn)=>HI(Mn,Wn)?FI(Mn,Vn,Wn):Vn,QI=(Mn,Vn,Wn)=>{Lr.inArray(Vn,Wn)===-1&&(Mn.addAttributeFilter(Wn,(jn,Gn)=>{let no=jn.length;for(;no--;)jn[no].attr(Gn,null)}),Vn.push(Wn))},LV=(Mn,Vn,Wn)=>!Vn.no_events&&Mn?E3(Mn,{...Vn,content:Wn}).content:Wn,IV=(Mn,Vn,Wn)=>{const jn=Xo(Wn.getInner?Vn.innerHTML:Mn.getOuterHTML(Vn));return Wn.selection||Xd(Cs.fromDom(Vn))?jn:Lr.trim(jn)},BV=(Mn,Vn,Wn)=>{const jn=Wn.selection?{forced_root_block:!1,...Wn}:Wn,Gn=Mn.parse(Vn,jn);return xE(Gn),Gn},FV=(Mn,Vn,Wn)=>I_(Mn,Vn).serialize(Wn),VI=(Mn,Vn,Wn,jn,Gn)=>{const no=FV(Vn,Wn,jn);return LV(Mn,Gn,no)},HV=(Mn,Vn)=>{const Wn=["data-mce-selected"],jn={entity_encoding:"named",remove_trailing_brs:!0,pad_empty_with_br:!1,...Mn},Gn=Vn&&Vn.dom?Vn.dom:Eu.DOM,no=Vn&&Vn.schema?Vn.schema:i1(jn),ao=a0(jn,no);Wk(ao,jn,Gn);const po=(vo,Ao={})=>{const Fo={format:"html",...Ao},Qo=NV(Vn,vo,Fo),qo=IV(Gn,Qo,Fo),ds=BV(ao,qo,Fo);return Fo.format==="tree"?ds:VI(Vn,jn,no,ds,Fo)};return{schema:no,addNodeFilter:ao.addNodeFilter,addAttributeFilter:ao.addAttributeFilter,serialize:po,addRules:no.addValidElements,setRules:no.setValidElements,addTempAttr:ws(QI,ao,Wn),getTempAttrs:xs(Wn),getNodeFilters:ao.getNodeFilters,getAttributeFilters:ao.getAttributeFilters,removeNodeFilter:ao.removeNodeFilter,removeAttributeFilter:ao.removeAttributeFilter}},zI=(Mn,Vn)=>{const Wn=HV(Mn,Vn);return{schema:Wn.schema,addNodeFilter:Wn.addNodeFilter,addAttributeFilter:Wn.addAttributeFilter,serialize:Wn.serialize,addRules:Wn.addRules,setRules:Wn.setRules,addTempAttr:Wn.addTempAttr,getTempAttrs:Wn.getTempAttrs,getNodeFilters:Wn.getNodeFilters,getAttributeFilters:Wn.getAttributeFilters,removeNodeFilter:Wn.removeNodeFilter,removeAttributeFilter:Wn.removeAttributeFilter}},EE="html",WI=(Mn,Vn)=>({...Mn,format:Vn,get:!0,getInner:!0}),UI=(Mn,Vn={})=>{const Wn=Vn.format?Vn.format:EE,jn=WI(Vn,Wn);return V_(Mn,jn).fold(Qr,Gn=>{const no=_V(Mn,Gn);return SD(Mn,no,Gn)})},QV="html",VV=(Mn,Vn)=>({format:QV,...Mn,set:!0,content:Vn}),ZD=(Mn,Vn,Wn={})=>{const jn=VV(Wn,Vn);return wD(Mn,jn).map(Gn=>{const no=SV(Mn,Gn.content,Gn);return iP(Mn,no.html,Gn),no.content}).getOr(Vn)},ZI="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(","),zV="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(","),WV="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),qI=[{name:"template",replacedWith:"Advanced Template"},{name:"rtc"}],jI=(Mn,Vn)=>{const Wn=nr(Vn,jn=>Mr(Mn,jn));return Vl(Wn)},JY=Mn=>{const Vn=jI(Mn,ZI),Wn=Mn.forced_root_block;return(Wn===!1||Wn==="")&&Vn.push("forced_root_block (false only
Line truncated
|
||||
- `,vo=ao?`
|
||||
|
||||
Themes:${po}mobile`:"",Ao=Gn?`
|
||||
|
||||
Plugins:${po}${jn.join(po)}`:"",Fo=no?`
|
||||
|
||||
Options:${po}${Wn.join(po)}`:"";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."+vo+Ao+Fo)}},jV=Mn=>xa(qI,Vn=>Vn.name===Mn).fold(()=>Mn,Vn=>Vn.replacedWith?`${Mn}, replaced by ${Vn.replacedWith}`:Mn),su=(Mn,Vn)=>{const Wn=rv(Mn),jn=ZV(Vn),Gn=jn.length>0,no=Wn.length>0;if(Gn||no){const ao=`
|
||||
- `,po=Gn?`
|
||||
|
||||
Plugins:${ao}${jn.map(jV).join(ao)}`:"",vo=no?`
|
||||
|
||||
Options:${ao}${Wn.join(ao)}`:"";console.warn("The following deprecated features are currently enabled but will be removed soon."+po+vo)}},eG=(Mn,Vn)=>{qV(Mn,Vn),su(Mn,Vn)},vP=Eu.DOM,XV=Mn=>{vP.setStyle(Mn.id,"display",Mn.orgDisplay)},sd=Mn=>zo.from(Mn).each(Vn=>Vn.destroy()),YV=Mn=>{const Vn=Mn;Vn.contentAreaContainer=Vn.formElement=Vn.container=Vn.editorContainer=null,Vn.bodyElement=Vn.contentDocument=Vn.contentWindow=null,Vn.iframeElement=Vn.targetElm=null;const Wn=Mn.selection;if(Wn){const jn=Wn.dom;Vn.selection=Wn.win=Wn.dom=jn.doc=null}},TE=Mn=>{const Vn=Mn.formElement;Vn&&(Vn._mceOldSubmit&&(Vn.submit=Vn._mceOldSubmit,delete Vn._mceOldSubmit),vP.unbind(Vn,"submit reset",Mn.formEventDelegate))},GV=Mn=>{if(!Mn.removed){const{_selectionOverrides:Vn,editorUpload:Wn}=Mn,jn=Mn.getBody(),Gn=Mn.getElement();jn&&Mn.save({is_removing:!0}),Mn.removed=!0,Mn.unbindAllNativeEvents(),Mn.hasHiddenInput&&is(Gn==null?void 0:Gn.nextSibling)&&vP.remove(Gn.nextSibling),P_(Mn),Mn.editorManager.remove(Mn),!Mn.inline&&jn&&XV(Mn),$_(Mn),vP.remove(Mn.getContainer()),sd(Vn),sd(Wn),Mn.destroy()}},KV=(Mn,Vn)=>{const{selection:Wn,dom:jn}=Mn;if(!Mn.destroyed){if(!Vn&&!Mn.removed){Mn.remove();return}Vn||(Mn.editorManager.off("beforeunload",Mn._beforeUnload),Mn.theme&&Mn.theme.destroy&&Mn.theme.destroy(),sd(Wn),sd(jn)),TE(Mn),YV(Mn),Mn.destroyed=!0}},AE=(()=>{const Mn={};return{add:(Gn,no)=>{Mn[Gn]=no},get:Gn=>Mn[Gn]?Mn[Gn]:{icons:{}},has:Gn=>Mr(Mn,Gn)}})(),yb=$h.ModelManager,vg=(Mn,Vn)=>Vn.dom[Mn],Uk=(Mn,Vn)=>parseInt(Ju(Vn,Mn),10),U_=ws(vg,"clientWidth"),Cy=ws(vg,"clientHeight"),PE=ws(Uk,"margin-top"),qD=ws(Uk,"margin-left"),jD=Mn=>Mn.dom.getBoundingClientRect(),XI=(Mn,Vn,Wn)=>{const jn=U_(Mn),Gn=Cy(Mn);return Vn>=0&&Wn>=0&&Vn<=jn&&Wn<=Gn},YI=(Mn,Vn,Wn,jn)=>{const Gn=jD(Vn),no=Mn?Gn.left+Vn.dom.clientLeft+qD(Vn):0,ao=Mn?Gn.top+Vn.dom.clientTop+PE(Vn):0,po=Wn-no,vo=jn-ao;return{x:po,y:vo}},JV=(Mn,Vn,Wn)=>{const jn=Cs.fromDom(Mn.getBody()),Gn=Mn.inline?jn:zl(jn),no=YI(Mn.inline,Gn,Vn,Wn);return XI(Gn,no.x,no.y)},ez=Mn=>zo.from(Mn).map(Cs.fromDom),GI=Mn=>{const Vn=Mn.inline?Mn.getBody():Mn.getContentAreaContainer();return ez(Vn).map(Ag).getOr(!1)};var KI=()=>{const Mn=()=>{throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:Mn,close:Mn,getArgs:Mn}};const XD=Mn=>{const Vn=[],Wn=()=>{const qo=Mn.theme;return qo&&qo.getNotificationManagerImpl?qo.getNotificationManagerImpl():KI()},jn=()=>zo.from(Vn[0]),Gn=(qo,ds)=>qo.type===ds.type&&qo.text===ds.text&&!qo.progressBar&&!qo.timeout&&!ds.progressBar&&!ds.timeout,no=()=>{fs(Vn,qo=>{qo.reposition()})},ao=qo=>{Vn.push(qo)},po=qo=>{Nl(Vn,ds=>ds===qo).each(ds=>{Vn.splice(ds,1)})},vo=(qo,ds=!0)=>Mn.removed||!GI(Mn)?{}:(ds&&Mn.dispatch("BeforeOpenNotification",{notification:qo}),xa(Vn,bs=>Gn(Wn().getArgs(bs),qo)).getOrThunk(()=>{Mn.editorManager.setActive(Mn);const bs=Wn().open(qo,()=>{po(bs),no(),UN(Mn)&&jn().fold(()=>Mn.focus(),ls=>lA(Cs.fromDom(ls.getEl())))});return ao(bs),no(),Mn.dispatch("OpenNotification",{notification:{...bs}}),bs})),Ao=()=>{jn().each(qo=>{Wn().close(qo),po(qo),no()})},Fo=xs(Vn);return(qo=>{qo.on("SkinLoaded",()=>{const ds=K2(qo);ds&&vo({text:ds,type:"warning",timeout:0},!1),no()}),qo.on("show ResizeEditor ResizeWindow NodeChange",()=>{requestAnimationFrame(no)}),qo.on("remove",()=>{fs(Vn.slice(),ds=>{Wn().close(ds)})})})(Mn),{open:vo,close:Ao,getNotifications:Fo}},Hw=$h.PluginManager,CO=$h.ThemeManager;var nG=()=>{const Mn=()=>{throw new Error("Theme did not provide a WindowManager implementation.")};return{open:Mn,openUrl:Mn,alert:Mn,confirm:Mn,close:Mn}};const JI=Mn=>{let Vn=[];const Wn=()=>{const ls=Mn.theme;return ls&&ls.getWindowManagerImpl?ls.getWindowManagerImpl():nG()},jn=(ls,ys)=>(...Ls)=>ys?ys.apply(ls,Ls):void 0,Gn=ls=>{Mn.dispatch("OpenWindow",{dialog:ls})},no=ls=>{Mn.dispatch("CloseWindow",{dialog:ls})},ao=ls=>{Vn.push(ls),Gn(ls)},po=ls=>{no(ls),Vn=nr(Vn,ys=>ys!==ls),Vn.length===0&&Mn.focus()},vo=()=>zo.from(Vn[Vn.length-1]),Ao=ls=>{Mn.editorManager.setActive(Mn),Sk(Mn),Mn.ui.show();const ys=ls();return ao(ys),ys},Fo=(ls,ys)=>Ao(()=>Wn().open(ls,ys,po)),Qo=ls=>Ao(()=>Wn().openUrl(ls,po)),qo=(ls,ys,Ls)=>{const zs=Wn();zs.alert(ls,jn(Ls||zs,ys))},ds=(ls,ys,Ls)=>{const zs=Wn();zs.confirm(ls,jn(Ls||zs,ys))},bs=()=>{vo().each(ls=>{Wn().close(ls),po(ls)})};return Mn.on("remove",()=>{fs(Vn,ls=>{Wn().close(ls)})}),{open:Fo,openUrl:Qo,alert:qo,confirm:ds,close:bs}},tz=(Mn,Vn)=>{Mn.notificationManager.open({type:"error",text:Vn})},yP=(Mn,Vn)=>{Mn._skinLoaded?tz(Mn,Vn):Mn.on("SkinLoaded",()=>{tz(Mn,Vn)})},nz=(Mn,Vn)=>{yP(Mn,cg.translate(["Failed to upload image: {0}",Vn]))},C1=(Mn,Vn,Wn)=>{Mp(Mn,Vn,{message:Wn}),console.error(Wn)},OP=(Mn,Vn,Wn)=>Wn?`Failed to load ${Mn}: ${Wn} from url ${Vn}`:`Failed to load ${Mn} url: ${Vn}`,oG=(Mn,Vn,Wn)=>{C1(Mn,"PluginLoadError",OP("plugin",Vn,Wn))},oz=(Mn,Vn,Wn)=>{C1(Mn,"IconsLoadError",OP("icons",Vn,Wn))},$E=(Mn,Vn,Wn)=>{C1(Mn,"LanguageLoadError",OP("language",Vn,Wn))},sz=(Mn,Vn,Wn)=>{C1(Mn,"
Line truncated
|
||||
\r \v`.indexOf(Mn)!==-1,Zw=(Mn,Vn)=>Mn.substring(Vn.length),GE=(Mn,Vn,Wn)=>{let jn;const Gn=Wn.charAt(0);for(jn=Vn-1;jn>=0;jn--){const no=Mn.charAt(jn);if(YE(no))return zo.none();if(Gn===no&&oc(Mn,Wn,jn,Vn))break}return zo.some(jn)},f0=(Mn,Vn,Wn,jn=0)=>{if(!FF(Vn))return zo.none();const Gn={text:"",offset:0},no=(po,vo,Ao)=>(Gn.text=Ao+Gn.text,Gn.offset+=vo,GE(Gn.text,Gn.offset,Wn).getOr(vo)),ao=Mn.getParent(Vn.startContainer,Mn.isBlock)||Mn.getRoot();return jE(Mn,Vn.startContainer,Vn.startOffset,no,ao).bind(po=>{const vo=Vn.cloneRange();if(vo.setStart(po.container,po.offset),vo.setEnd(Vn.endContainer,Vn.endOffset),vo.collapsed)return zo.none();const Ao=XE(vo);return Ao.lastIndexOf(Wn)!==0||Zw(Ao,Wn).length<jn?zo.none():zo.some({text:Zw(Ao,Wn),range:vo,trigger:Wn})})},s2=(Mn,Vn,Wn,jn=0)=>HH(Cs.fromDom(Vn.startContainer)).fold(()=>f0(Mn,Vn,Wn,jn),Gn=>{const no=Mn.createRng();no.selectNode(Gn.dom);const ao=XE(no);return zo.some({range:no,text:Zw(ao,Wn),trigger:Wn})}),HF=Mn=>Mn.nodeType===A1,QF=Mn=>Mn.nodeType===Hh,VF=Mn=>{if(HF(Mn))return d0(Mn,Mn.data.length);{const Vn=Mn.childNodes;return Vn.length>0?VF(Vn[Vn.length-1]):d0(Mn,Vn.length)}},GM=(Mn,Vn)=>{const Wn=Mn.childNodes;return Wn.length>0&&Vn<Wn.length?GM(Wn[Vn],0):Wn.length>0&&QF(Mn)&&Wn.length===Vn?VF(Wn[Wn.length-1]):d0(Mn,Vn)},SU=(Mn,Vn)=>{var Wn;const jn=(Wn=Mn.getParent(Vn.container,Mn.isBlock))!==null&&Wn!==void 0?Wn:Mn.getRoot();return jE(Mn,Vn.container,Vn.offset,(Gn,no)=>no===0?-1:no,jn).filter(Gn=>{const no=Gn.container.data.charAt(Gn.offset-1);return!YE(no)}).isSome()},wU=Mn=>Vn=>{const Wn=GM(Vn.startContainer,Vn.startOffset);return!SU(Mn,Wn)},KE=(Mn,Vn,Wn)=>Yl(Wn.triggers,jn=>s2(Mn,Vn,jn)),CU=(Mn,Vn)=>{const Wn=Vn(),jn=Mn.selection.getRng();return KE(Mn.dom,jn,Wn).bind(Gn=>zF(Mn,Vn,Gn))},zF=(Mn,Vn,Wn,jn={})=>{var Gn;const no=Vn(),po=(Gn=Mn.selection.getRng().startContainer.nodeValue)!==null&&Gn!==void 0?Gn:"",vo=nr(no.lookupByTrigger(Wn.trigger),Fo=>Wn.text.length>=Fo.minChars&&Fo.matches.getOrThunk(()=>wU(Mn.dom))(Wn.range,po,Wn.text));if(vo.length===0)return zo.none();const Ao=Promise.all(Us(vo,Fo=>Fo.fetch(Wn.text,Fo.maxResults,jn).then(qo=>({matchText:Wn.text,items:qo,columns:Fo.columns,onAction:Fo.onAction,highlightOn:Fo.highlightOn}))));return zo.some({lookupData:Ao,context:Wn})};var lv;(function(Mn){Mn[Mn.Error=0]="Error",Mn[Mn.Value=1]="Value"})(lv||(lv={}));const KM=(Mn,Vn,Wn)=>Mn.stype===lv.Error?Vn(Mn.serror):Wn(Mn.svalue),kU=Mn=>{const Vn=[],Wn=[];return fs(Mn,jn=>{KM(jn,Gn=>Wn.push(Gn),Gn=>Vn.push(Gn))}),{values:Vn,errors:Wn}},xU=(Mn,Vn)=>Mn.stype===lv.Error?{stype:lv.Error,serror:Vn(Mn.serror)}:Mn,EU=(Mn,Vn)=>Mn.stype===lv.Value?{stype:lv.Value,svalue:Vn(Mn.svalue)}:Mn,TU=(Mn,Vn)=>Mn.stype===lv.Value?Vn(Mn.svalue):Mn,AU=(Mn,Vn)=>Mn.stype===lv.Error?Vn(Mn.serror):Mn,WF=Mn=>({stype:lv.Value,svalue:Mn}),UF=Mn=>({stype:lv.Error,serror:Mn}),km={fromResult:Mn=>Mn.fold(UF,WF),toResult:Mn=>KM(Mn,ym.error,ym.value),svalue:WF,partition:kU,serror:UF,bind:TU,bindError:AU,map:EU,mapError:xU,fold:KM},KP=Mn=>Io(Mn)&&Al(Mn).length>100?" removed due to size":JSON.stringify(Mn,null,2),ZF=Mn=>{const Vn=Mn.length>10?Mn.slice(0,10).concat([{path:[],getErrorInfo:xs("... (only showing first ten failures)")}]):Mn;return Us(Vn,Wn=>"Failed path: ("+Wn.path.join(" > ")+`)
|
||||
`+Wn.getErrorInfo())},JE=(Mn,Vn)=>km.serror([{path:Mn,getErrorInfo:Vn}]),PU=(Mn,Vn,Wn)=>JE(Mn,()=>'Could not find valid *required* value for "'+Vn+'" in '+KP(Wn)),$U=(Mn,Vn)=>JE(Mn,()=>'Choice schema did not contain choice key: "'+Vn+'"'),RU=(Mn,Vn,Wn)=>JE(Mn,()=>'The chosen schema: "'+Wn+'" did not exist in branches: '+KP(Vn)),DU=(Mn,Vn)=>JE(Mn,xs(Vn)),qF=(Mn,Vn,Wn,jn)=>Ma(Wn,jn).fold(()=>RU(Mn,Wn,jn),no=>no.extract(Mn.concat(["branch: "+jn]),Vn)),MU=(Mn,Vn)=>({extract:(Gn,no)=>Ma(no,Mn).fold(()=>$U(Gn,Mn),po=>qF(Gn,no,Vn,po)),toString:()=>"chooseOn("+Mn+"). Possible values: "+Al(Vn)}),jF=(Mn,Vn)=>Vn,NU=(Mn,Vn)=>Vo(Mn)&&Vo(Vn)?eT(Mn,Vn):Vn,JM=Mn=>(...Vn)=>{if(Vn.length===0)throw new Error("Can't merge zero objects");const Wn={};for(let jn=0;jn<Vn.length;jn++){const Gn=Vn[jn];for(const no in Gn)Mr(Gn,no)&&(Wn[no]=Mn(Wn[no],Gn[no]))}return Wn},eT=JM(NU),LU=JM(jF),XF=()=>({tag:"required",process:{}}),IU=Mn=>({tag:"defaultedThunk",process:Mn}),e4=Mn=>IU(xs(Mn)),BU=()=>({tag:"option",process:{}}),FU=(Mn,Vn)=>Mn.length>0?km.svalue(eT(Vn,LU.apply(void 0,Mn))):km.svalue(Vn),t4=Mn=>ko(km.serror,Zc)(Mn),YF={consolidateObj:(Mn,Vn)=>{const Wn=km.partition(Mn);return Wn.errors.length>0?t4(Wn.errors):FU(Wn.values,Vn)},consolidateArr:Mn=>{const Vn=km.partition(Mn);return Vn.errors.length>0?t4(Vn.errors):km.svalue(Vn.values)}},HU=(Mn,Vn,Wn,jn)=>({tag:"field",key:Mn,newKey:Vn,presence:Wn,prop:jn}),QU=(Mn,Vn)=>({tag:"custom",newKey:Mn,instantiator:Vn}),GF=(Mn,Vn,Wn)=>{switch(Mn.tag){case"field":return Vn(Mn.key,Mn.newKey,Mn.presence,Mn.prop);case"custom":return Wn(Mn.newKey,Mn.instantiator)}},JP=Mn=>{const Vn=(jn,Gn)=>km.bindError(Mn(Gn),no=>DU(jn,no)),Wn=xs("val");return{extract:Vn,toString:Wn}},KF=JP(km.svalue),VU=(Mn,Vn,Wn,jn)=>Ma(Vn,Wn).fold(()=>PU(Mn,Wn,Vn),jn),JF=(Mn,Vn,Wn,jn)=>{const Gn=Ma(Mn,Vn).getOrThunk(()=>Wn(Mn));return jn(Gn)},zU=(Mn,Vn,Wn)=>Wn(Ma(Mn,Vn)),WU=(Mn,Vn,Wn,jn)=>{const Gn=Ma(Mn,Vn).map(no=>no===!0?Wn(Mn):no);return jn(Gn)},UU=(Mn,Vn,Wn,jn,Gn)=>{const no=po=>Gn.extract(Vn.concat([jn]),po),ao=po=>po.fold(()=>km.svalue(zo.none()),vo=>{const Ao=Gn.extract(Vn.concat([jn]),vo);return km.map(Ao,zo.some)});switch(Mn.tag){case"required":return VU(Vn,Wn,jn,no);case"defaultedThunk":return JF(Wn,jn,Mn.process,no);case"option":return zU(Wn,jn,ao);case"defaultedOptionThunk":return WU(Wn,jn,Mn.process,ao);case"mergeWithThunk":return JF(Wn,jn,xs({}),po=>{const vo=eT(Mn.process(Wn),po);return no(vo)})}},ZU=(Mn,Vn,Wn)=>{const jn={},Gn=[];for(const no of Wn)GF(no,(ao,po,vo,Ao)=>{const Fo=UU(vo,Mn,Vn,ao,Ao);km.fold(Fo,Qo=>{Gn.push(...Qo)},Qo=>{jn[po]=Qo})},(ao,po)=>{jn[ao]=po(Vn)});return Gn.length>0?km.serror(Gn):km.svalue(jn)},n4=Mn=>({extract:(jn,Gn)=>ZU(jn,Gn,Mn),toString:()=>`obj{
|
||||
`+Us(Mn,Gn=>GF(Gn,(no,ao,po,vo)=>no+" -> "+vo.toString(),(no,ao)=>"state("+no+")")).join(`
|
||||
`)+"}"}),e6=Mn=>({extract:(jn,Gn)=>{const no=Us(Gn,(ao,po)=>Mn.extract(jn.concat(["["+po+"]"]),ao));return YF.consolidateArr(no)},toString:()=>"array("+Mn.toString()+")"}),bG=Mn=>JP(Vn=>Mn(Vn).fold(km.serror,km.svalue)),qU=(Mn,Vn,Wn)=>{const jn=Vn.extract([Mn],Wn);return km.mapError(jn,Gn=>({input:Wn,errors:Gn}))},e$=(Mn,Vn,Wn)=>km.toResult(qU(Mn,Vn,Wn)),t6=Mn=>`Errors:
|
||||
`+ZF(Mn.errors).join(`
|
||||
`)+`
|
||||
|
||||
Input object: `+KP(Mn.input),o4=(Mn,Vn)=>MU(Mn,Pl(Vn,n4)),jU=xs(KF),tT=(Mn,Vn)=>JP(Wn=>{const jn=typeof Wn;return Mn(Wn)?km.svalue(Wn):km.serror(`Expected type: ${Vn} but got: ${jn}`)}),n6=tT(Ys,"number"),t$=tT(xo,"string"),XU=tT(Go,"boolean"),s4=tT(Yo,"function"),r2=HU,o6=QU,r4=Mn=>bG(Vn=>Zs(Mn,Vn)?ym.value(Vn):ym.error(`Unsupported value: "${Vn}", choose one of "${Mn.join(", ")}".`)),s6=(Mn,Vn)=>r2(Mn,Mn,XF(),Vn),r6=Mn=>s6(Mn,t$),i6=Mn=>s6(Mn,s4),a6=(Mn,Vn)=>r2(Mn,Mn,XF(),e6(Vn)),i4=(Mn,Vn)=>r2(Mn,Mn,BU(),Vn),n$=Mn=>i4(Mn,t$),YU=Mn=>i4(Mn,s4),GU=(Mn,Vn)=>r2(Mn,Mn,e4(Vn),jU()),i2=(Mn,Vn,Wn)=>r2(Mn,Mn,e4(Vn),Wn),rh=(Mn,Vn)=>i2(Mn,Vn,n6),Ty=(Mn,Vn)=>i2(Mn,Vn,t$),l6=(Mn,Vn,Wn)=>i2(Mn,Vn,r4(Wn)),c6=(Mn,Vn)=>i2(Mn,Vn,XU),a4=(Mn,Vn)=>i2(Mn,Vn,s4),KU=(Mn,Vn,Wn)=>i2(Mn,Vn,e6(Wn)),JU=r6("type"),eZ=i6("fetch"),o$=i6("onAction"),a2=a4("onSetup",()=>Js),vG=n$("text"),tZ=n$("icon"),nZ=n$("tooltip"),cv=n$("label"),oZ=c6("active",!1),sZ=c6("enabled",!0),l4=c6("primary",!1),rZ=Mn=>GU("columns",Mn),qw=Mn=>Ty("type",Mn),u6=n4([JU,r6("trigger"),rh("minChars",1),rZ(1),rh("maxResults",10),YU("matches"),eZ,o$,KU("highlightOn",[],t$)]),iZ=Mn=>e$("Autocompleter",u6,{trigger:Mn.ch,...Mn}),c4=[sZ,nZ,tZ,vG,a2],d6=[oZ].concat(c4),f6=[a4("predicate",hs),l6("scope","node",["node","editor"]),l6("position","selection",["node","selection","line"])],h6=c4.concat([qw("contextformbutton"),l4,o$,o6("original",Qr)]),u4=d6.concat([qw("contextformbutton"),l4,o$,o6("original",Qr)]),d4=c4.concat([qw("contextformbutton")]),f4=d6.concat([qw("contextformtogglebutton")]),aZ=o4("type",{contextformbutton:h6,contextformtogglebutton:u4});n4([qw("contextform"),a4("initValue",xs("")),cv,a6("commands",aZ),i4("launch",o4("type",{contextformbutton:d4,contextformtogglebutton:f4}))].concat(f6));const lZ=Mn=>{const Vn=Mn.ui.registry.getAll().popups,Wn=Pl(Vn,ao=>iZ(ao).fold(po=>{throw new Error(t6(po))},Qr)),jn=vl(ia(Wn,ao=>ao.trigger)),Gn=ka(Wn);return{dataset:Wn,triggers:jn,lookupByTrigger:ao=>nr(Gn,po=>po.trigger===ao)}},cZ=(Mn,Vn)=>{const Wn=jO(Vn.load,50);Mn.on("keypress compositionend",jn=>{jn.which!==27&&Wn.throttle()}),Mn.on("keydown",jn=>{const Gn=jn.which;Gn===8?Wn.throttle():Gn===27&&Vn.cancelIfNecessary()}),Mn.on("remove",Wn.cancel)},uZ=Mn=>{const Vn=Fb(),Wn=od(!1),jn=Vn.isSet,Gn=()=>{jn()&&(EV(Mn),Fx(Mn),Wn.set(!1),Vn.clear())},no=Ao=>{jn()||(xV(Mn,Ao.range),Vn.set({trigger:Ao.trigger,matchLength:Ao.text.length}))},ao=br(()=>lZ(Mn)),po=Ao=>Vn.get().map(Fo=>s2(Mn.dom,Mn.selection.getRng(),Fo.trigger).bind(Qo=>zF(Mn,ao,Qo,Ao))).getOrThunk(()=>CU(Mn,ao)),vo=Ao=>{po(Ao).fold(Gn,Fo=>{no(Fo.context),Fo.lookupData.then(Qo=>{Vn.get().map(qo=>{const ds=Fo.context;qo.trigger===ds.trigger&&(ds.text.length-qo.matchLength>=10?Gn():(Vn.set({...qo,matchLength:ds.text.length}),Wn.get()?eA(Mn,{lookupData:Qo}):(Wn.set(!0),Bx(Mn,{lookupData:Qo}))))})})})};Mn.addCommand("mceAutocompleterReload",(Ao,Fo)=>{const Qo=Io(Fo)?Fo.fetchOptions:{};vo(Qo)}),Mn.addCommand("mceAutocompleterClose",Gn),cZ(Mn,{cancelIfNecessary:Gn,load:vo})},p6=xl().browser.isSafari(),g6=Mn=>Kp(Cs.fromDom(Mn)),h4=(Mn,Vn)=>{var Wn;return Mn.startOffset===0&&Mn.endOffset===((Wn=Vn.textContent)===null||Wn===void 0?void 0:Wn.length)},s$=(Mn,Vn)=>zo.from(Mn.getParent(Vn.container(),"details")),r$=(Mn,Vn)=>s$(Mn,Vn).isSome(),dZ=(Mn,Vn)=>{const Wn=zo.from(Mn.getParent(Vn.startContainer,"details")),jn=zo.from(Mn.getParent(Vn.endContainer,"details"));if(Wn.isSome()||jn.isSome()){const Gn=Wn.bind(no=>zo.from(Mn.select("summary",no)[0]));return zo.some({startSummary:Gn,startDetails:Wn,endDetails:jn})}else return zo.none()},fZ=(Mn,Vn)=>zm(Vn).exists(Wn=>Wn.isEqual(Mn)),hZ=(Mn,Vn)=>b1(Vn).exists(Wn=>Ec(Wn.getNode())&&cp(Vn,Wn).exists(jn=>jn.isEqual(Mn))||Wn.isEqual(Mn)),mZ=(Mn,Vn)=>Vn.startSummary.exists(Wn=>fZ(Mn,Wn)),pZ=(Mn,Vn)=>Vn.startSummary.exists(Wn=>hZ(Mn,Wn)),b6=(Mn,Vn)=>Vn.startDetails.exists(Wn=>cp(Wn,Mn).forall(jn=>Vn.startSummary.exists(Gn=>!Gn.contains(Mn.container())&&Gn.contains(jn.container())))),m4=(Mn,Vn,Wn)=>Wn.startDetails.exists(jn=>Sm(Mn,Vn).forall(Gn=>!jn.contains(Gn.container()))),p4=(Mn,Vn)=>{const Wn=Vn.getNode();os(Wn)||Mn.selection.setCursorLocation(Wn,Vn.offset())},g4=(Mn,Vn,Wn)=>{const jn=Mn.dom.getParent(Vn.container(),"details");if(jn&&!jn.open){const Gn=Mn.dom.select("summary",jn)[0];Gn&&(Wn?zm(Gn):b1(Gn)).each(ao=>p4(Mn,ao))}else p4(Mn,Vn)},gZ=(Mn,Vn)=>{const Wn=vo=>vo.contains(Mn.startContainer),jn=vo=>vo.contains(Mn.endContainer),Gn=Vn.startSummary.exists(Wn),no=Vn.startSummary.exists(jn),ao=Vn.startDetails.forall(vo=>Vn.endDetails.forall(Ao=>vo!==Ao));return(Gn||no)&&!(Gn&&no)||ao},v6=(Mn,Vn,Wn)=>{const{dom:jn,selection:Gn}=Mn,no=Mn.getBody();if(Wn==="character"){const ao=lr.fromRangeStart(Gn.getRng()),po=jn.getParent(ao.container(),jn.isBlock),vo=s$(jn,ao),Ao=po&&jn.isEmpty(po),Fo=Mo(po==null?void 0:po.previousSibling),Qo=Mo(po==null?void 0:po.nextSibling);return Ao&&(Vn?Qo:Fo)&&Z0(!Vn,no,ao).exists(bs=>r$(jn,bs)&&!Ef(vo,s$(jn,bs)))?!0:Z0(Vn,no,ao).fold(hs,qo=>{const ds=s$(jn
Line truncated
|
||||
`;return}if(Ao!=="wbr"){if(Gn[Ao]&&(jn+=" "),no[Ao]){jn+=" ";return}if(vo.type===3&&(jn+=vo.value),!(vo.name in Vn.getVoidElements())){let Qo=vo.firstChild;if(Qo)do po(Qo);while(Qo=Qo.next)}ao[Ao]&&Fo.next&&(jn+=`
|
||||
`,Ao==="p"&&(jn+=`
|
||||
`))}};return Mn=s7(Mn,[/<!\[[^\]]+\]>/g]),po(Wn.parse(Mn)),jn},r7=Mn=>(Mn=s7(Mn,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/ig,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,(Wn,jn,Gn)=>!jn&&!Gn?" ":hc],/<br class="Apple-interchange-newline">/g,/<br>$/i]),Mn),wq=Mn=>{let Vn=0;return()=>Mn+Vn++},Cq=Mn=>{const Vn=Mn.toLowerCase(),Wn={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"};return Lr.hasOwn(Wn,Vn)?"image/"+Wn[Vn]:"image/"+Vn},Hu=(Mn,Vn)=>{const Wn=a0({sanitize:jb(Mn),sandbox_iframes:b_(Mn)},Mn.schema);Wn.addNodeFilter("meta",Gn=>{Lr.each(Gn,no=>{no.remove()})});const jn=Wn.parse(Vn,{forced_root_block:!1,isRootContent:!0});return I_({validate:!0},Mn.schema).serialize(jn)},i7=(Mn,Vn)=>({content:Mn,cancelled:Vn}),a7=(Mn,Vn,Wn)=>{const jn=Mn.dom.create("div",{style:"display:none"},Vn),Gn=R3(Mn,jn,Wn);return i7(Gn.node.innerHTML,Gn.isDefaultPrevented())},kq=(Mn,Vn,Wn)=>{const jn=$3(Mn,Vn,Wn),Gn=Hu(Mn,jn.content);return Mn.hasEventListeners("PastePostProcess")&&!jn.isDefaultPrevented()?a7(Mn,Gn,Wn):i7(Gn,jn.isDefaultPrevented())},F4=(Mn,Vn,Wn)=>kq(Mn,Vn,Wn),k$=(Mn,Vn)=>(Mn.insertContent(Vn,{merge:YS(Mn),paste:!0}),!0),H4=Mn=>/^https?:\/\/[\w\-\/+=.,!;:&%@^~(){}?#]+$/i.test(Mn),xq=(Mn,Vn)=>H4(Vn)&&Sr(UC(Mn),Wn=>bd(Vn.toLowerCase(),`.${Wn.toLowerCase()}`)),l7=(Mn,Vn,Wn)=>(Mn.undoManager.extra(()=>{Wn(Mn,Vn)},()=>{Mn.insertContent('<img src="'+Vn+'">')}),!0),Q4=(Mn,Vn,Wn)=>(Mn.undoManager.extra(()=>{Wn(Mn,Vn)},()=>{Mn.execCommand("mceInsertLink",!1,Vn)}),!0),Eq=(Mn,Vn,Wn)=>!Mn.selection.isCollapsed()&&H4(Vn)?Q4(Mn,Vn,Wn):!1,Tq=(Mn,Vn,Wn)=>xq(Mn,Vn)?l7(Mn,Vn,Wn):!1,Aq=(Mn,Vn)=>{Lr.each([Eq,Tq,k$],Wn=>!Wn(Mn,Vn,k$))},c7=(Mn,Vn,Wn)=>{Wn||!h_(Mn)?k$(Mn,Vn):Aq(Mn,Vn)},Pq=wq("mceclip"),$q=Mn=>{const Vn=N4();return J6(Vn,Mn),M4(Vn),Vn},Xw=(Mn,Vn,Wn,jn,Gn)=>{const no=F4(Mn,Vn,Wn);if(!no.cancelled){const ao=no.content,po=()=>c7(Mn,ao,jn);Gn?b4(Mn,"insertFromPaste",{dataTransfer:$q(ao)}).isDefaultPrevented()||(po(),nT(Mn,"insertFromPaste")):po()}},x$=(Mn,Vn,Wn,jn)=>{const Gn=Wn||t7(Vn);Xw(Mn,e7(Vn),Gn,!1,jn)},nS=(Mn,Vn,Wn)=>{const jn=Mn.dom.encode(Vn).replace(/\r\n/g,`
|
||||
`),Gn=V1(jn,zC(Mn)),no=C$(Gn,bh(Mn),Zb(Mn));Xw(Mn,no,!1,!0,Wn)},d2=Mn=>{const Vn={};if(Mn&&Mn.types)for(let Wn=0;Wn<Mn.types.length;Wn++){const jn=Mn.types[Wn];try{Vn[jn]=Mn.getData(jn)}catch{Vn[jn]=""}}return Vn},oS=(Mn,Vn)=>Vn in Mn&&Mn[Vn].length>0,u7=Mn=>oS(Mn,"text/html")||oS(Mn,"text/plain"),f2=(Mn,Vn)=>{const Wn=Vn.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return is(Wn)?Mn.dom.encode(Wn[1]):void 0},Rq=(Mn,Vn,Wn,jn)=>{const Gn=Pq(),no=nO(Mn)&&is(Wn.name),ao=no?f2(Mn,Wn.name):Gn,po=no?Wn.name:void 0,vo=Vn.create(Gn,Wn,jn,ao,po);return Vn.add(vo),vo},V4=(Mn,Vn)=>{JA(Vn.uri).each(({data:Wn,type:jn,base64Encoded:Gn})=>{const no=Gn?Wn:btoa(Wn),ao=Vn.file,po=Mn.editorUpload.blobCache,vo=po.getByData(no,jn),Ao=vo??Rq(Mn,po,ao,no);x$(Mn,`<img src="${Ao.blobUri()}">`,!1,!0)})},Dq=Mn=>Mn.type==="paste",d7=Mn=>Promise.all(Us(Mn,Vn=>_Q(Vn).then(Wn=>({file:Vn,uri:Wn})))),f7=Mn=>{const Vn=UC(Mn);return Wn=>Dc(Wn.type,"image/")&&Sr(Vn,jn=>Cq(jn)===Wn.type)},z4=(Mn,Vn)=>{const Wn=Vn.items?cc(kc(Vn.items),Gn=>Gn.kind==="file"?[Gn.getAsFile()]:[]):[],jn=Vn.files?kc(Vn.files):[];return nr(Wn.length>0?Wn:jn,f7(Mn))},W4=(Mn,Vn,Wn)=>{const jn=Dq(Vn)?Vn.clipboardData:Vn.dataTransfer;if(f_(Mn)&&jn){const Gn=z4(Mn,jn);if(Gn.length>0)return Vn.preventDefault(),d7(Gn).then(no=>{Wn&&Mn.selection.setRng(Wn),fs(no,ao=>{V4(Mn,ao)})}),!0}return!1},Mq=Mn=>{var Vn,Wn;return aa.os.isAndroid()&&((Wn=(Vn=Mn.clipboardData)===null||Vn===void 0?void 0:Vn.items)===null||Wn===void 0?void 0:Wn.length)===0},Nq=Mn=>va.metaKeyPressed(Mn)&&Mn.keyCode===86||Mn.shiftKey&&Mn.keyCode===45,E$=(Mn,Vn,Wn,jn,Gn)=>{let no=r7(Wn);const ao=oS(Vn,w$())||t7(Wn),po=!ao&&gq(no),vo=H4(no);(o7(no)||!no.length||po&&!vo)&&(jn=!0),(jn||vo)&&(oS(Vn,"text/plain")&&po?no=Vn["text/plain"]:no=Sq(no)),!o7(no)&&(jn?nS(Mn,no,Gn):x$(Mn,no,ao,Gn))},Lq=(Mn,Vn,Wn)=>{let jn;const Gn=()=>Vn.getLastRng()||Mn.selection.getRng();Mn.on("keydown",no=>{Nq(no)&&!no.isDefaultPrevented()&&(jn=no.shiftKey&&no.keyCode===86)}),Mn.on("paste",no=>{if(no.isDefaultPrevented()||Mq(no))return;const ao=Wn.get()==="text"||jn;jn=!1;const po=d2(no.clipboardData);!u7(po)&&W4(Mn,no,Gn())||(oS(po,"text/html")?(no.preventDefault(),E$(Mn,po,po["text/html"],ao,!0)):oS(po,"text/plain")&&oS(po,"text/uri-list")?(no.preventDefault(),E$(Mn,po,po["text/plain"],ao,!0)):(Vn.create(),O1.setEditorTimeout(Mn,()=>{const vo=Vn.getHtml();Vn.remove(),E$(Mn,po,vo,ao,!1)},0)))})},h7=Mn=>{const Vn=Gn=>Dc(Gn,"webkit-fake-url"),Wn=Gn=>Dc(Gn,"data:"),jn=Gn=>{var no;return((no=Gn.data)===null||no===void 0?void 0:no.paste)===!0};Mn.parser.addNodeFilter("img",(Gn,no,ao)=>{if(!f_(Mn)&&jn(ao))for(const po of Gn){const vo=po.attr("src");xo(vo)&&!po.attr("data-mce-object")&&vo!==aa.transparentSrc&&(Vn(vo)||!p_(Mn)&&Wn(vo))&&po.remove()}})},U4=(Mn,Vn,Wn)=>{Lq(Mn,Vn,Wn),h7(Mn)},m7=(Mn,Vn)=>{Vn.get()==="text"?(Vn.set("html"),tA(Mn,!1)):(Vn.set("text"),tA(Mn,!0)),Mn.focus()},Iq=(Mn,Vn)=>{Mn.addCommand("mceTogglePlainTextPaste",()=>{m7(Mn,Vn)}),Mn.addCommand("mceInsertClipboardContent",(Wn,jn)=>{jn.html&&x$(Mn,jn.html,jn.internal,!1),jn.text&&nS(Mn,jn.text,!1)})},Bq=(Mn,Vn,Wn)=>{if(Mn)try{return Mn.clearData(),Mn.setData("text/html",Vn),Mn.setData("text/plain",Wn),Mn.setData(w$(),Vn),!0}catch{return!1}else return!1},p7=(Mn,Vn,Wn,jn)=>{Bq(Mn.clipboardData,Vn.html,Vn.text)?(Mn.preventDefault(),jn()):Wn(Vn.html,jn)},Z4=Mn=>(Vn,Wn)=>{const{dom:jn,selection:Gn}=Mn,no=jn.create("div",{contenteditable:"false","data-mce-bogus":"all"}),ao=jn.create("div",{contenteditable:"true"},Vn);jn.setStyles(no,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),no.appendChild(ao),jn.add(Mn.getBody(),no);const po=Gn.getRng();ao.focus();const vo=jn.createRng();vo.selectNodeContents(ao),Gn.setRng(vo),O1.setEditorTimeout(Mn,()=>{Gn.setRng(po),jn.remove(no),Wn()},0)},T$=Mn=>({html:pq(Mn.selection.getContent({contextual:!0})),text:Mn.selection.getContent({format:"text"})}),Fq=Mn=>!!Mn.dom.getParent(Mn.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",Mn.getBody()),q4=Mn=>!Mn.selection.isCollapsed()||Fq(Mn),g7=Mn=>Vn=>{!Vn.isDefaultPrevented()&&q4(Mn)&&Mn.selection.isEditable()&&p7(Vn,T$(Mn),Z4(Mn),()=>{if(aa.browser.isChromium()||aa.browser.isFirefox()){const Wn=Mn.selection.getRng();O1.setEditorTimeout(Mn,()=>{Mn.selection.setRng(Wn),Mn.execCommand("Delete")},0)}else Mn.execCommand("Delete")})},Hq=Mn=>Vn=>{!Vn.isDefaultPrevented()&&q4(Mn)&&p7(Vn,T$(Mn),Z4(Mn),Js)},b7=Mn=>{Mn.on("cut",g7(Mn)),Mn.on("copy",Hq(Mn))},v7=(Mn,Vn)=>{var Wn,jn;return ns.getCaretRangeFromPoint((Wn=Vn.clientX)!==null&&Wn!==void 0?Wn:0,(jn=Vn.clientY)!==null&&jn!==void 0?jn:0,Mn.getDoc())},Qq=Mn=>{const Vn=Mn["text/plain"];return Vn?Vn.indexOf("file://")===0:!1},y7=(Mn,Vn)=>{Mn.focus(),Vn&&Mn.selection.setRng(Vn)},Vq=Mn=>Sr(Mn.files,Vn=>/^image\//.test(Vn.type)),zq=(Mn,Vn,Wn,jn)=>{const Gn=Mn.getParent(Wn,ao=>Wl(Vn,ao));if(!Mo(Mn.getParent(Wn,"summary")))return!0;if(Gn&&Mr(jn,"text/html")){const ao=new DOMParser().parseFromString(jn["text/html"],"text/html
Line truncated
|
||||
`}),Mn.dom.addStyle(vo)}const ao=Promise.all(Zj(Mn,jn,Wn)).then(no).catch(no),po=l_(Mn);return po&&Qj(Mn,po),ao},qj=Mn=>{const Vn=Mn.getDoc(),Wn=Mn.getBody();fy(Mn),ax(Mn)||(Vn.body.spellcheck=!1,Q$.setAttrib(Wn,"spellcheck","false")),Mn.quirks=Hj(Mn),T3(Mn);const jn=G2(Mn);jn!==void 0&&(Wn.dir=jn);const Gn=QC(Mn);Gn&&Mn.on("BeforeSetContent",no=>{Lr.each(Gn,ao=>{no.content=no.content.replace(ao,po=>"<!--mce:protected "+escape(po)+"-->")})}),Mn.on("SetContent",()=>{Mn.addVisual(Mn.getBody())}),Mn.on("compositionstart compositionend",no=>{Mn.composing=no.type==="compositionstart"})},jj=Mn=>{wO(Mn)||Mn.load({initial:!0,format:"html"}),Mn.startContent=Mn.getContent({format:"raw"})},aN=Mn=>{Mn.removed!==!0&&(jj(Mn),Uj(Mn))},Xj=Mn=>{let Vn=!1;const Wn=setTimeout(()=>{Vn||Mn.setProgressState(!0)},500);return()=>{clearTimeout(Wn),Vn=!0,Mn.setProgressState(!1)}},p8=Mn=>{const Vn=Mn.getElement();let Wn=Mn.getDoc();Mn.inline&&(Q$.addClass(Vn,"mce-content-body"),Mn.contentDocument=Wn=document,Mn.contentWindow=window,Mn.bodyElement=Vn,Mn.contentAreaContainer=Vn);const jn=Mn.getBody();jn.disabled=!0,Mn.readonly=oO(Mn),Mn._editableRoot=$p(Mn),!Mn.readonly&&Mn.hasEditableRoot()&&(Mn.inline&&Q$.getStyle(jn,"position",!0)==="static"&&(jn.style.position="relative"),jn.contentEditable="true"),jn.disabled=!1,Mn.editorUpload=vz(Mn),Mn.schema=i1(h8(Mn)),Mn.dom=Eu(Wn,{keep_values:!0,url_converter:Mn.convertURL,url_converter_scope:Mn,update_styles:!0,root_element:Mn.inline?Mn.getBody():null,collect:Mn.inline,schema:Mn.schema,contentCssCors:ab(Mn),referrerPolicy:Hl(Mn),onSetAttrib:ao=>{Mn.dispatch("SetAttrib",ao)},force_hex_color:ry(Mn)}),Mn.parser=zj(Mn),Mn.serializer=zI(Vj(Mn),Mn),Mn.selection=W_(Mn.dom,Mn.getWin(),Mn.serializer,Mn),Mn.annotator=Dx(Mn),Mn.formatter=eM(Mn),Mn.undoManager=tM(Mn),Mn._nodeChangeDispatcher=new U6(Mn),Mn._selectionOverrides=xj(Mn),BW(Mn),Gq(Mn),iG(Mn),wO(Mn)||(T7(Mn),Fj(Mn));const Gn=sq(Mn);Uw(Mn,Gn),VW(Mn),c0(Mn),jq(Mn);const no=hV(Mn);qj(Mn),no.fold(()=>{const ao=Xj(Mn);m8(Mn).then(()=>{aN(Mn),ao()})},ao=>{Mn.setProgressState(!0),m8(Mn).then(()=>{ao().then(po=>{Mn.setProgressState(!1),aN(Mn),WD(Mn)},po=>{Mn.notificationManager.open({type:"error",text:String(po)}),aN(Mn),WD(Mn)})})})},g8=Qs,Yj=(Mn,Vn,Wn)=>S0(Mn,Vn,g8,Wn),z$=Eu.DOM,Gj=(Mn,Vn,Wn,jn)=>{const Gn=Cs.fromTag("iframe");return jn.each(no=>Gc(Gn,"tabindex",no)),im(Gn,Wn),im(Gn,{id:Mn+"_ifr",frameBorder:"0",allowTransparency:"true",title:Vn}),Xm(Gn,"tox-edit-area__iframe"),Gn},Kj=Mn=>{let Vn=FS(Mn)+"<html><head>";ap(Mn)!==Mn.documentBaseUrl&&(Vn+='<base href="'+Mn.documentBaseURI.getURI()+'" />'),Vn+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';const Wn=i_(Mn),jn=W2(Mn),Gn=Mn.translate(sx(Mn));return Zu(Mn)&&(Vn+='<meta http-equiv="Content-Security-Policy" content="'+Zu(Mn)+'" />'),Vn+=`</head><body id="${Wn}" class="mce-content-body ${jn}" data-id="${Mn.id}" aria-label="${Gn}"><br></body></html>`,Vn},b8=(Mn,Vn)=>{const Wn=Mn.translate("Rich Text Area"),jn=Ld(Cs.fromDom(Mn.getElement()),"tabindex").bind(Em),Gn=Gj(Mn.id,Wn,Ic(Mn),jn).dom;Gn.onload=()=>{Gn.onload=null,Mn.dispatch("load")},Mn.contentAreaContainer=Vn.iframeContainer,Mn.iframeElement=Gn,Mn.iframeHTML=Kj(Mn),z$.add(Vn.iframeContainer,Gn)},fT=Mn=>{const Vn=Mn.iframeElement,Wn=()=>{Mn.contentDocument=Vn.contentDocument,p8(Mn)};if(fx(Mn)||aa.browser.isFirefox()){const jn=Mn.getDoc();jn.open(),jn.write(Mn.iframeHTML),jn.close(),Wn()}else{const jn=Yj(Cs.fromDom(Vn),"load",()=>{jn.unbind(),Wn()});Vn.srcdoc=Mn.iframeHTML}},Jj=(Mn,Vn)=>{b8(Mn,Vn),Vn.editorContainer&&(Vn.editorContainer.style.display=Mn.orgDisplay,Mn.hidden=z$.isHidden(Vn.editorContainer)),Mn.getElement().style.display="none",z$.setAttrib(Mn.id,"aria-hidden","true"),Mn.getElement().style.visibility=Mn.orgVisibility,fT(Mn)},lN=Eu.DOM,eX=(Mn,Vn,Wn)=>{const jn=Hw.get(Wn),Gn=Hw.urls[Wn]||Mn.documentBaseUrl.replace(/\/$/,"");if(Wn=Lr.trim(Wn),jn&&Lr.inArray(Vn,Wn)===-1){if(Mn.plugins[Wn])return;try{const no=jn(Mn,Gn)||{};Mn.plugins[Wn]=no,Yo(no.init)&&(no.init(Mn,Gn),Vn.push(Wn))}catch(no){tB(Mn,Wn,no)}}},tX=Mn=>Mn.replace(/^\-/,""),nX=Mn=>{const Vn=[];fs(sO(Mn),Wn=>{eX(Mn,Vn,tX(Wn))})},oX=Mn=>{const Vn=Lr.trim(QS(Mn)),Wn=Mn.ui.registry.getAll().icons,jn={...AE.get("default").icons,...AE.get(Vn).icons};Rr(jn,(Gn,no)=>{Mr(Wn,no)||Mn.ui.registry.addIcon(no,Gn)})},v8=Mn=>{const Vn=ey(Mn);if(xo(Vn)){const Wn=CO.get(Vn);Mn.theme=Wn(Mn,CO.urls[Vn])||{},Yo(Mn.theme.init)&&Mn.theme.init(Mn,CO.urls[Vn]||Mn.documentBaseUrl.replace(/\/$/,""))}else Mn.theme={}},sX=Mn=>{const Vn=c_(Mn),Wn=yb.get(Vn);Mn.model=Wn(Mn,yb.urls[Vn])},y8=Mn=>{const Vn=Mn.theme.renderUI;return Vn?Vn():_8(Mn)},rX=Mn=>{const Vn=Mn.getElement(),jn=ey(Mn)(Mn,Vn);return jn.editorContainer.nodeType&&(jn.editorContainer.id=jn.editorContainer.id||Mn.id+"_parent"),jn.iframeContainer&&jn.iframeContainer.nodeType&&(jn.iframeContainer.id=jn.iframeContainer.id||Mn.id+"_iframecontainer"),jn.height=jn.iframeHeight?jn.iframeHeight:Vn.offsetHeight,jn},O8=(MLine truncated
|
||||
Actual: `+la.join(","));if(!za(ro,xr=>gs(la,xr)))throw new Error("Not all branches were specified when using match. Specified: "+la.join(", ")+`
|
||||
Required: `+ro.join(", "));return Nr[Zo].apply(null,ps)},log:Nr=>{console.log(Nr,{constructors:ro,constructor:Zo,params:ps})}}}}),fo}},Xv={...Qm.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])},kC=(eo,ro)=>eo.length===0?Xv.none():eo.length===1?Xv.only(0):ro===0?Xv.left(0,1):ro===eo.length-1?Xv.right(ro-1,ro):ro>0&&ro<eo.length-1?Xv.middle(ro-1,ro,ro+1):Xv.none(),F2=(eo,ro,fo,go,To)=>{const No=eo.slice(0),Zo=kC(eo,ro),ns=xo(cr(No,xo(0))),ps=la=>go.singleColumnWidth(No[la],fo),$s=(la,sa)=>To.calcLeftEdgeDeltas(No,la,sa,fo,go.minCellWidth(),go.isRelative),js=(la,sa,xr)=>To.calcMiddleDeltas(No,la,sa,xr,fo,go.minCellWidth(),go.isRelative),Nr=(la,sa)=>To.calcRightEdgeDeltas(No,la,sa,fo,go.minCellWidth(),go.isRelative);return Zo.fold(ns,ps,$s,js,Nr)},qy=(eo,ro,fo)=>{let go=0;for(let To=eo;To<ro;To++)go+=fo[To]!==void 0?fo[To]:0;return go},Wb=(eo,ro)=>{const fo=ss.justCells(eo);return cr(fo,go=>{const To=qy(go.column,go.column+go.colspan,ro);return{element:go.element,width:To,colspan:go.colspan}})},JO=(eo,ro)=>{const fo=ss.justColumns(eo);return cr(fo,(go,To)=>({element:go.element,width:ro[To],colspan:go.colspan}))},rc=(eo,ro)=>{const fo=ss.justCells(eo);return cr(fo,go=>{const To=qy(go.row,go.row+go.rowspan,ro);return{element:go.element,height:To,rowspan:go.rowspan}})},Vm=(eo,ro)=>cr(eo.all,(fo,go)=>({element:fo.element,height:ro[go]})),Fg=eo=>ha(eo,(ro,fo)=>ro+fo,0),Yv=(eo,ro)=>ss.hasColumns(eo)?JO(eo,ro):Wb(eo,ro),tu=(eo,ro,fo)=>{const go=Yv(eo,ro);ws(go,To=>{fo.setElementWidth(To.element,To.width)})},Gv=(eo,ro,fo,go,To)=>{const No=ss.fromTable(eo),Zo=To.getCellDelta(ro),ns=To.getWidths(No,To),ps=fo===No.grid.columns-1,$s=go.clampTableDelta(ns,fo,Zo,To.minCellWidth(),ps),js=F2(ns,fo,$s,To,go),Nr=cr(js,(la,sa)=>la+ns[sa]);tu(No,Nr,To),go.resizeTable(To.adjustTableWidth,$s,ps)},e_=(eo,ro,fo,go)=>{const To=ss.fromTable(eo),No=Gs(To,eo,go),Zo=cr(No,(js,Nr)=>fo===Nr?Math.max(ro+js,Vh()):js),ns=rc(To,Zo),ps=Vm(To,Zo);ws(ps,js=>{Rg(js.element,js.height)}),ws(ns,js=>{Rg(js.element,js.height)});const $s=Fg(Zo);Rg(eo,$s)},Yd=(eo,ro,fo,go,To)=>{const No=ss.generate(ro),Zo=go.getWidths(No,go),ns=go.pixelWidth(),{newSizes:ps,delta:$s}=To.calcRedestributedWidths(Zo,ns,fo.pixelDelta,go.isRelative);tu(No,ps,go),go.adjustTableWidth($s)},Hg=(eo,ro,fo,go)=>{const To=ss.generate(ro),No=go.getWidths(To,go);tu(To,No,go)},sb=eo=>hs(eo,(fo,go)=>xs(fo,No=>No.column===go.column)?fo:fo.concat([go]),[]).sort((fo,go)=>fo.column-go.column),t_=Vc("col"),jy=Vc("colgroup"),Xy=eo=>pr(eo)==="tr"||jy(eo),TS=eo=>{const ro=Gc(eo,"colspan",1),fo=Gc(eo,"rowspan",1);return{element:eo,colspan:ro,rowspan:fo}},n_=(eo,ro=TS)=>{const fo=ns=>t_(ns.element)?eo.col(ns):eo.cell(ns),go=ns=>jy(ns.element)?eo.colgroup(ns):eo.row(ns),To=ns=>{if(Xy(ns))return go({element:ns});{const ps=ns,$s=fo(ro(ps));return No=Yo.some({item:ps,replacement:$s}),$s}};let No=Yo.none();return{getOrInit:(ns,ps)=>No.fold(()=>To(ns),$s=>ps(ns,$s.item)?$s.replacement:To(ns))}},Pp=eo=>ro=>{const fo=[],go=(Zo,ns)=>zo(fo,ps=>ns(ps.item,Zo)),To=Zo=>{const ns=eo==="td"?{scope:null}:{},ps=ro.replace(Zo,eo,ns);return fo.push({item:Zo,sub:ps}),ps};return{replaceOrInit:(Zo,ns)=>{if(Xy(Zo)||t_(Zo))return Zo;{const ps=Zo;return go(ps,ns).fold(()=>To(ps),$s=>ns(Zo,$s.item)?$s.sub:To(ps))}}}},ug=eo=>Ts(eo,"scope").map(ro=>ro.substr(0,3)),lr={modification:n_,transform:Pp,merging:eo=>({unmerge:go=>{const To=ug(go);return To.each(No=>zc(go,"scope",No)),()=>{const No=eo.cell({element:go,colspan:1,rowspan:1});return Qh(No,"width"),Qh(go,"width"),To.each(Zo=>zc(No,"scope",Zo)),No}},merge:go=>{const To=()=>{const No=cu(cr(go,ug));if(No.length===0)return Yo.none();{const Zo=No[0],ns=["row","col"];return xs(No,$s=>$s!==Zo&&gs(ns,$s))?Yo.none():Yo.from(Zo)}};return Qh(go[0],"width"),To().fold(()=>ks(go[0],"scope"),No=>zc(go[0],"scope",No+"group")),xo(go[0])}})},H0=["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"],Q0=(eo,ro)=>{const fo=eo.property().name(ro);return gs(["ol","ul"],fo)},rp=(eo,ro)=>{const fo=eo.property().name(ro);return gs(H0,fo)},AS=(eo,ro)=>gs(["br","img","hr","input"],eo.property().name(ro)),Uu=wr(),o_=eo=>rp(Uu,eo),rb=eo=>Q0(Uu,eo),PS=eo=>AS(Uu,eo),s_=eo=>{const ro=Vc("br"),fo=ps=>za(ps,$s=>ro($s)||Na($s)&&La($s).trim().length===0),go=ps=>pr(ps)==="li"||qc(ps,rb).isSome(),To=ps=>sm(ps).map($s=>o_($s)?!0:PS($s)?pr($s)!=="img":!1).getOr(!1),No=ps=>wp(ps).bind($s=>{const js=To($s);return bd($s).map(Nr=>js===!0||go(Nr)||ro($s)||o_(Nr)&&!bc(ps,Nr)?[]:[Ds.fromTag("br")])}).getOr([]),ns=(()=>{const ps=Ca(eo,$s=>{const js=fc($s);return fo(js)?[]:js.concat(No($s))});return ps.length===0?[Ds.fromTag("br")]:ps})();vd(eo[0]),cd(eo[0],ns)},$S=eo=>Z1(eo,!0),Yy=eo=>{Yf(eo).length===0&&ju(eo)},Kv=(eo,ro)=>({grid:eo,cursor:ro}),RS=eo=>Vr(eo,ro=>Vr(ro.cells,fo=>{const go=
Line truncated
|
||||
`+Yn.getErrorInfo())},Eo=(Qn,Zn)=>xu.serror([{path:Qn,getErrorInfo:Zn}]),Bo=(Qn,Zn,Yn)=>Eo(Qn,()=>'Could not find valid *required* value for "'+Zn+'" in '+S0(Yn)),Ko=(Qn,Zn)=>Eo(Qn,()=>'Choice schema did not contain choice key: "'+Zn+'"'),Ss=(Qn,Zn,Yn)=>Eo(Qn,()=>'The chosen schema: "'+Yn+'" did not exist in branches: '+S0(Zn)),Rs=(Qn,Zn)=>Eo(Qn,()=>"There are unsupported fields: ["+Zn.join(", ")+"] specified"),$r=(Qn,Zn)=>Eo(Qn,Mo(Zn)),Ea=Qn=>{const Zn=(Jn,oo)=>xu.bindError(Qn(oo),lo=>$r(Jn,lo)),Yn=Mo("val");return{extract:Zn,toString:Yn}},ll=Ea(xu.svalue),nl=(Qn,Zn,Yn,Jn)=>Rr(Zn,Yn).fold(()=>Bo(Qn,Yn,Zn),Jn),Xa=(Qn,Zn,Yn,Jn)=>{const oo=Rr(Qn,Zn).getOrThunk(()=>Yn(Qn));return Jn(oo)},Nu=(Qn,Zn,Yn)=>Yn(Rr(Qn,Zn)),zu=(Qn,Zn,Yn,Jn)=>{const oo=Rr(Qn,Zn).map(lo=>lo===!0?Yn(Qn):lo);return Jn(oo)},kh=(Qn,Zn,Yn,Jn,oo)=>{const lo=yo=>oo.extract(Zn.concat([Jn]),yo),mo=yo=>yo.fold(()=>xu.svalue(ko.none()),Co=>{const Ro=oo.extract(Zn.concat([Jn]),Co);return xu.map(Ro,ko.some)});switch(Qn.tag){case"required":return nl(Zn,Yn,Jn,lo);case"defaultedThunk":return Xa(Yn,Jn,Qn.process,lo);case"option":return Nu(Yn,Jn,mo);case"defaultedOptionThunk":return zu(Yn,Jn,Qn.process,mo);case"mergeWithThunk":return Xa(Yn,Jn,Mo({}),yo=>{const Co=Lc(Qn.process(Yn),yo);return lo(Co)})}},Sp=(Qn,Zn,Yn)=>{const Jn={},oo=[];for(const lo of Yn)Gm(lo,(mo,yo,Co,Ro)=>{const Lo=kh(Co,Qn,Zn,mo,Ro);xu.fold(Lo,Wo=>{oo.push(...Wo)},Wo=>{Jn[yo]=Wo})},(mo,yo)=>{Jn[mo]=yo(Zn)});return oo.length>0?xu.serror(oo):xu.svalue(Jn)},mf=Qn=>({extract:(Jn,oo)=>Qn().extract(Jn,oo),toString:()=>Qn().toString()}),fS=Qn=>nc(Yl(Qn,Oo)),mu=Qn=>{const Zn=Ta(Qn),Yn=Ca(Qn,(oo,lo)=>Gm(lo,mo=>Lc(oo,{[mo]:!0}),Mo(oo)),{});return{extract:(oo,lo)=>{const mo=uo(lo)?[]:fS(lo),yo=ga(mo,Co=>!Su(Yn,Co));return yo.length===0?Zn.extract(oo,lo):Rs(oo,yo)},toString:Zn.toString}},Ta=Qn=>({extract:(Jn,oo)=>Sp(Jn,oo,Qn),toString:()=>`obj{
|
||||
`+hs(Qn,oo=>Gm(oo,(lo,mo,yo,Co)=>lo+" -> "+Co.toString(),(lo,mo)=>"state("+lo+")")).join(`
|
||||
`)+"}"}),Xp=Qn=>({extract:(Jn,oo)=>{const lo=hs(oo,(mo,yo)=>Qn.extract(Jn.concat(["["+yo+"]"]),mo));return Db.consolidateArr(lo)},toString:()=>"array("+Qn.toString()+")"}),Oa=(Qn,Zn)=>{const Yn=Zn!==void 0?Zn:Go;return{extract:(lo,mo)=>{const yo=[];for(const Co of Qn){const Ro=Co.extract(lo,mo);if(Ro.stype===dh.Value)return{stype:dh.Value,svalue:Yn(Ro.svalue)};yo.push(Ro)}return Db.consolidateArr(yo)},toString:()=>"oneOf("+hs(Qn,lo=>lo.toString()).join(", ")+")"}},pf=(Qn,Zn)=>{const Yn=(lo,mo)=>Xp(Ea(Qn)).extract(lo,mo);return{extract:(lo,mo)=>{const yo=nc(mo),Co=Yn(lo,yo);return xu.bind(Co,Ro=>{const Lo=hs(Ro,Wo=>ed(Wo,Wo,sc(),Zn));return Ta(Lo).extract(lo,mo)})},toString:()=>"setOf("+Zn.toString()+")"}},$O=(Qn,Zn)=>{const Yn=Du(Zn);return{extract:(lo,mo)=>Yn().extract(lo,mo),toString:()=>Yn().toString()}},Yp=Vo(Xp,Ta),Ad=Mo(ll),Pg=(Qn,Zn)=>Ea(Yn=>{const Jn=typeof Yn;return Qn(Yn)?xu.svalue(Yn):xu.serror(`Expected type: ${Zn} but got: ${Jn}`)}),w0=Pg($o,"number"),nf=Pg(qn,"string"),Jm=Pg(uo,"boolean"),_v=Pg(So,"function"),Gp=Qn=>{if(Object(Qn)!==Qn)return!0;switch({}.toString.call(Qn).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(Qn).every(Zn=>Gp(Qn[Zn]));default:return!1}},Sv=Ea(Qn=>Gp(Qn)?xu.svalue(Qn):xu.serror("Expected value to be acceptable for sending via postMessage")),$g=(Qn,Zn,Yn,Jn)=>Rr(Yn,Jn).fold(()=>Ss(Qn,Yn,Jn),lo=>lo.extract(Qn.concat(["branch: "+Jn]),Zn)),Ir=(Qn,Zn)=>({extract:(oo,lo)=>Rr(lo,Qn).fold(()=>Ko(oo,Qn),yo=>$g(oo,lo,Zn,yo)),toString:()=>"chooseOn("+Qn+"). Possible values: "+nc(Zn)}),RO=()=>Xp(ll),Rg=Qn=>Ea(Zn=>Qn(Zn).fold(xu.serror,xu.svalue)),Dg=(Qn,Zn)=>pf(Yn=>xu.fromResult(Qn(Yn)),Zn),Nm=(Qn,Zn,Yn)=>{const Jn=Zn.extract([Qn],Yn);return xu.mapError(Jn,oo=>({input:Yn,errors:oo}))},Lu=(Qn,Zn,Yn)=>xu.toResult(Nm(Qn,Zn,Yn)),Ec=Qn=>Qn.fold(Zn=>{throw new Error(Gf(Zn))},Go),td=(Qn,Zn,Yn)=>Ec(Lu(Qn,Zn,Yn)),Gf=Qn=>`Errors:
|
||||
`+Mm(Qn.errors).join(`
|
||||
`)+`
|
||||
|
||||
Input object: `+S0(Qn.input),jl=(Qn,Zn)=>Ir(Qn,Vl(Zn,Ta)),L1=(Qn,Zn)=>$O(Qn,Zn),Bd=ed,pu=fh,C0=Qn=>Rg(Zn=>Fs(Qn,Zn)?yl.value(Zn):yl.error(`Unsupported value: "${Zn}", choose one of "${Qn.join(", ")}".`)),Er=Qn=>Bd(Qn,Qn,sc(),Ad()),Kf=(Qn,Zn)=>Bd(Qn,Qn,sc(),Zn),k0=Qn=>Kf(Qn,w0),hc=Qn=>Kf(Qn,nf),hd=(Qn,Zn)=>Bd(Qn,Qn,sc(),C0(Zn)),wv=Qn=>Kf(Qn,Jm),ep=Qn=>Kf(Qn,_v),tp=(Qn,Zn)=>Bd(Qn,Qn,Km(),Ea(Yn=>xu.serror("The field: "+Qn+" is forbidden. "+Zn))),fm=(Qn,Zn)=>Bd(Qn,Qn,sc(),Ta(Zn)),Mb=(Qn,Zn)=>Bd(Qn,Qn,sc(),Yp(Zn)),Pf=(Qn,Zn)=>Bd(Qn,Qn,sc(),Xp(Zn)),Tc=Qn=>Bd(Qn,Qn,Km(),Ad()),Fd=(Qn,Zn)=>Bd(Qn,Qn,Km(),Zn),Mg=Qn=>Fd(Qn,w0),$f=Qn=>Fd(Qn,nf),Ly=(Qn,Zn)=>Fd(Qn,C0(Zn)),I1=Qn=>Fd(Qn,_v),Ng=(Qn,Zn)=>Fd(Qn,Xp(Zn)),hh=(Qn,Zn)=>Fd(Qn,Ta(Zn)),np=(Qn,Zn)=>Fd(Qn,mu(Zn)),Gs=(Qn,Zn)=>Bd(Qn,Qn,um(Zn),Ad()),xh=(Qn,Zn,Yn)=>Bd(Qn,Qn,um(Zn),Yn),Lm=(Qn,Zn)=>xh(Qn,Zn,w0),mh=(Qn,Zn)=>xh(Qn,Zn,nf),Eh=(Qn,Zn,Yn)=>xh(Qn,Zn,C0(Yn)),Xd=(Qn,Zn)=>xh(Qn,Zn,Jm),Hd=(Qn,Zn)=>xh(Qn,Zn,_v),Iy=(Qn,Zn)=>xh(Qn,Zn,Sv),Th=(Qn,Zn,Yn)=>xh(Qn,Zn,Xp(Yn)),Kp=(Qn,Zn,Yn)=>xh(Qn,Zn,Ta(Yn)),Ua=Qn=>{let Zn=Qn;return{get:()=>Zn,set:oo=>{Zn=oo}}},Po={generate:Qn=>{if(!to(Qn))throw new Error("cases must be an array");if(Qn.length===0)throw new Error("there must be at least one case");const Zn=[],Yn={};return Qs(Qn,(Jn,oo)=>{const lo=nc(Jn);if(lo.length!==1)throw new Error("one and only one name per case");const mo=lo[0],yo=Jn[mo];if(Yn[mo]!==void 0)throw new Error("duplicate key detected:"+mo);if(mo==="cata")throw new Error("cannot have a case named cata (sorry)");if(!to(yo))throw new Error("case arguments must be an array");Zn.push(mo),Yn[mo]=(...Co)=>{const Ro=Co.length;if(Ro!==yo.length)throw new Error("Wrong number of arguments to case "+mo+". Expected "+yo.length+" ("+yo+"), got "+Ro);return{fold:(...Wo)=>{if(Wo.length!==Qn.length)throw new Error("Wrong number of arguments to fold. Expected "+Qn.length+", got "+Wo.length);return Wo[oo].apply(null,Co)},match:Wo=>{const jo=nc(Wo);if(Zn.length!==jo.length)throw new Error("Wrong number of arguments to match. Expected: "+Zn.join(",")+`
|
||||
Actual: `+jo.join(","));if(!dr(Zn,us=>Fs(jo,us)))throw new Error("Not all branches were specified when using match. Specified: "+jo.join(", ")+`
|
||||
Required: `+Zn.join(", "));return Wo[mo].apply(null,Co)},log:Wo=>{console.log(Wo,{constructors:Zn,constructor:mo,params:Co})}}}}),Yn}};Po.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const Xo=Qn=>{const Zn=[],Yn=[];return Qs(Qn,Jn=>{Jn.fold(oo=>{Zn.push(oo)},oo=>{Yn.push(oo)})}),{errors:Zn,values:Yn}},as=(Qn,Zn)=>{const Yn={};return Zl(Qn,(Jn,oo)=>{Fs(Zn,oo)||(Yn[oo]=Jn)}),Yn},Ms=(Qn,Zn)=>({[Qn]:Zn}),vr=Qn=>{const Zn={};return Qs(Qn,Yn=>{Zn[Yn.key]=Yn.value}),Zn},zr=(Qn,Zn)=>as(Qn,Zn),Jr=(Qn,Zn)=>Ms(Qn,Zn),La=Qn=>vr(Qn),Ol=(Qn,Zn)=>Qn.length===0?yl.value(Zn):yl.value(Lc(Zn,Dm.apply(void 0,Qn))),Xu=Qn=>yl.error(Us(Qn)),Ac=(Qn,Zn)=>{const Yn=Xo(Qn);return Yn.errors.length>0?Xu(Yn.errors):Ol(Yn.values,Zn)},gu=Qn=>So(Qn)?Qn:sr,Uh=(Qn,Zn,Yn)=>{let Jn=Qn.dom;const oo=gu(Yn);for(;Jn.parentNode;){Jn=Jn.parentNode;const lo=Ds.fromDom(Jn),mo=Zn(lo);if(mo.isSome())return mo;if(oo(lo))break}return ko.none()},Jf=(Qn,Zn,Yn)=>{const Jn=Zn(Qn),oo=gu(Yn);return Jn.orThunk(()=>oo(Qn)?ko.none():Uh(Qn,Zn,oo))},hm=(Qn,Zn)=>Oc(Qn.element,Zn.event.target),Jp={can:Js,abort:sr,run:xo},wp=Qn=>{if(!Su(Qn,"can")&&!Su(Qn,"abort")&&!Su(Qn,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(Qn,null,2)+" does not have can, abort, or run!");return{...Jp,...Qn}},B1=(Qn,Zn)=>(...Yn)=>za(Qn,(Jn,oo)=>Jn&&Zn(oo).apply(void 0,Yn),!0),Sc=(Qn,Zn)=>(...Yn)=>za(Qn,(Jn,oo)=>Jn||Zn(oo).apply(void 0,Yn),!1),F1=Qn=>So(Qn)?{can:Js,abort:sr,run:Qn}:Qn,x0=Qn=>{const Zn=B1(Qn,oo=>oo.can),Yn=Sc(Qn,oo=>oo.abort);return{can:Zn,abort:Yn,run:(...oo)=>{Qs(Qn,lo=>{lo.run.apply(void 0,oo)})}}},nd=Mo,mm=nd("touchstart"),Nb=nd("touchmove"),H1=nd("touchend"),Fl=nd("touchcancel"),Xl=nd("mousedown"),Qd=nd("mousemove"),Rf=nd("mouseout"),Cv=nd("mouseup"),eg=nd("mouseover"),Wu=nd("focusin"),pm=nd("focusout"),op=nd("keydown"),Q1=nd("keyup"),o1=nd("input"),E0=nd("change"),Lg=nd("click"),lC=nd("transitioncancel"),V1=nd("transitionend"),By=nd("transitionstart"),z1=nd("selectstart"),Pd=Qn=>Mo("alloy."+Qn),Cp={tap:Pd("tap")},tg=Pd("focus"),W1=Pd("blur.post"),U1=Pd("paste.post"),T0=Pd("receive"),Im=Pd("execute"),md=Pd("focus.item"),ng=Cp.tap,DO=Pd("longpress"),Fy=Pd("sandbox.close"),Hy=Pd("typeahead.cancel"),Z1=Pd("system.init"),Ah=Pd("system.touchmove"),kp=Pd("system.touchend"),s1=Pd("system.scroll"),Ig=Pd("system.resize"),Zh=Pd("system.attached"),xp=Pd("system.detached"),q1=Pd("system.dismissRequested"),hS=Pd("system.repositionRequested"),MO=Pd("focusmanager.shifted"),kv=Pd("slotcontainer.visibility"),j1=Pd("system.external.element.scroll"),xv=Pd("change.tab"),NO=Pd("dismiss.tab"),Ev=Pd("highlight"),Tv=Pd("dehighlight"),Wl=(Qn,Zn)=>{Lb(Qn,Qn.element,Zn,{})},Qa=(Qn,Zn,Yn)=>{Lb(Qn,Qn.element,Zn,Yn)},og=Qn=>{Wl(Qn,Im())},Av=(Qn,Zn,Yn)=>{Lb(Qn,Zn,Yn,{})},Lb=(Qn,Zn,Yn,Jn)=>{const oo={target:Zn,...Jn};Qn.getSystem().triggerEvent(Yn,Zn,oo)},T2=(Qn,Zn,Yn,Jn)=>{const oo={...Jn,target:Zn};Qn.getSystem().triggerEvent(Yn,Zn,oo)},LO=(Qn,Zn,Yn,Jn)=>{Qn.getSystem().triggerEvent(Yn,Zn,Jn.event)},Jc=Qn=>La(Qn),IO=(Qn,Zn)=>({key:Qn,value:wp({abort:Zn})}),Qy=(Qn,Zn)=>({key:Qn,value:wp({can:Zn})}),mS=Qn=>({key:Qn,value:wp({run:(Zn,Yn)=>{Yn.event.prevent()}})}),wr=(Qn,Zn)=>({key:Qn,value:wp({run:Zn})}),sg=(Qn,Zn,Yn)=>({key:Qn,value:wp({run:(Jn,oo)=>{Zn.apply(void 0,[Jn,oo].concat(Yn))}})}),cC=Qn=>Zn=>wr(Qn,Zn),Pv=Qn=>Zn=>({key:Qn,value:wp({run:(Yn,Jn)=>{hm(Yn,Jn)&&Zn(Yn,Jn)}})}),A2=(Qn,Zn)=>wr(Qn,(Yn,Jn)=>{Yn.getSystem().getByUid(Zn).each(oo=>{LO(oo,oo.element,Qn,Jn)})}),A0=(Qn,Zn,Yn)=>{const Jn=Zn.partUids[Yn];return A2(Qn,Jn)},pS=(Qn,Zn)=>wr(Qn,(Yn,Jn)=>{const oo=Jn.event,lo=Yn.getSystem().getByDom(oo.target).getOrThunk(()=>Jf(oo.target,yo=>Yn.getSystem().getByDom(yo).toOptional(),sr).getOr(Yn));Zn(Yn,lo,Jn)}),X1=Qn=>wr(Qn,(Zn,Yn)=>{Yn.cut()}),Y1=Qn=>wr(Qn,(Zn,Yn)=>{Yn.stop()}),rg=(Qn,Zn)=>Pv(Qn)(Zn),eu=Pv(Zh()),ig=Pv(xp()),$v=Pv(Z1()),qh=cC(Im()),Ll=(Qn,Zn)=>{const Jn=(Zn||document).createElement("div");return Jn.innerHTML=Qn,kf(Ds.fromDom(Jn))},Rv=Qn=>Qn.dom.innerHTML,G1=(Qn,Zn)=>{const Jn=vd(Qn).dom,oo=Ds.fromDom(Jn.createDocumentFragment()),lo=Ll(Zn,Jn);Rm(oo,lo),iu(Qn),Id(Qn,oo)},Ib=Qn=>{const Zn=Ds.fromTag("div"),Yn=Ds.fromDom(Qn.dom.cloneNode(!0));return Id(Zn,Yn),Rv(Zn)},BO=(Qn,Zn)=>Ds.fromDom(Qn.dom.cloneNode(Zn)),Vy=Qn=>BO(Qn,!1),uC=Qn=>BO(Qn,!0),Ph=Qn=>{if(rs(Qn))return"#shadow-root";{const Zn=Vy(Qn);return Ib(Zn)}},r1=Qn=>Ph(Qn),ET=(Qn,Zn,Yn)=>Oc(Zn,Qn.element)&&!Oc(Zn,Yn),FO=Jc([Qy(tg(),(Qn,Zn)=>{const Yn=Zn.event,Jn=Yn.originator,oo=Yn.target;return ET(Qn,Jn,oo)?(console.warn(tg()+` did not get interpreted by the desired target.
|
||||
Originator: `+r1(Jn)+`
|
||||
Target: `+r1(oo)+`
|
||||
Check the `+tg()+" event handlers"),!1):!0})]);var P0=Object.freeze({__proto__:null,events:FO});let Uf=0;const ba=Qn=>{const Yn=new Date().getTime(),Jn=Math.floor(Math.random()*1e9);return Uf++,Qn+"_"+Jn+Uf+String(Yn)},P2=Mo("alloy-id-"),gS=Mo("data-alloy-id"),K1=P2(),gm=gS(),J1=(Qn,Zn)=>{const Yn=ba(K1+Qn);return Dv(Zn,Yn),Yn},Dv=(Qn,Zn)=>{Object.defineProperty(Qn.dom,gm,{value:Zn,writable:!0})},$0=Qn=>{const Zn=fc(Qn)?Qn.dom[gm]:null;return ko.from(Zn)},Mv=Qn=>ba(Qn),HO=Go,Ep=Qn=>{const Zn=oo=>`The component must be in a context to execute: ${oo}`+(Qn?`
|
||||
`+r1(Qn().element)+" is not in context.":""),Yn=oo=>()=>{throw new Error(Zn(oo))},Jn=oo=>()=>{console.warn(Zn(oo))};return{debugInfo:Mo("fake"),triggerEvent:Jn("triggerEvent"),triggerFocus:Jn("triggerFocus"),triggerEscape:Jn("triggerEscape"),broadcast:Jn("broadcast"),broadcastOn:Jn("broadcastOn"),broadcastEvent:Jn("broadcastEvent"),build:Yn("build"),buildOrPatch:Yn("buildOrPatch"),addToWorld:Yn("addToWorld"),removeFromWorld:Yn("removeFromWorld"),addToGui:Yn("addToGui"),removeFromGui:Yn("removeFromGui"),getByUid:Yn("getByUid"),getByDom:Yn("getByDom"),isConnected:sr}},ag=Ep(),Nv=(Qn,Zn,Yn)=>{const Jn=Yn.toString(),oo=Jn.indexOf(")")+1,lo=Jn.indexOf("("),mo=Jn.substring(lo+1,oo-1).split(/,\s*/);return Qn.toFunctionAnnotation=()=>({name:Zn,parameters:Tp(mo.slice(0,1).concat(mo.slice(3)))}),Qn},Tp=Qn=>hs(Qn,Zn=>ad(Zn,"/*")?Zn.substring(0,Zn.length-2):Zn),QO=(Qn,Zn)=>{const Yn=Qn.toString(),Jn=Yn.indexOf(")")+1,oo=Yn.indexOf("("),lo=Yn.substring(oo+1,Jn-1).split(/,\s*/);return Qn.toFunctionAnnotation=()=>({name:Zn,parameters:Tp(lo)}),Qn},dC=(Qn,Zn)=>{const Yn=Zn.toString(),Jn=Yn.indexOf(")")+1,oo=Yn.indexOf("("),lo=Yn.substring(oo+1,Jn-1).split(/,\s*/);return Qn.toFunctionAnnotation=()=>({name:"OVERRIDE",parameters:Tp(lo.slice(1))}),Qn},Lv=ba("alloy-premade"),i1=Qn=>(Object.defineProperty(Qn.element.dom,Lv,{value:Qn.uid,writable:!0}),Jr(Lv,Qn)),fC=Qn=>Pl(Qn.dom,Lv),Iv=Qn=>Rr(Qn,Lv),eb=Qn=>dC((Zn,...Yn)=>Qn(Zn.getApis(),Zn,...Yn),Qn),Ap={init:()=>ph({readState:Mo("No State required")})},ph=Qn=>Qn,bS=(Qn,Zn)=>{const Yn=hs(Zn,oo=>hh(oo.name(),[Er("config"),Gs("state",Ap)])),Jn=Lu("component.behaviours",Ta(Yn),Qn.behaviours).fold(oo=>{throw new Error(Gf(oo)+`
|
||||
Complete spec:
|
||||
`+JSON.stringify(Qn,null,2))},Go);return{list:Zn,data:Vl(Jn,oo=>{const lo=oo.map(mo=>({config:mo.config,state:mo.state.init(mo.config)}));return Mo(lo)})}},vS=Qn=>Qn.list,yS=Qn=>Qn.data,Bv=(Qn,Zn)=>{const Yn={};return Zl(Qn,(Jn,oo)=>{Zl(Jn,(lo,mo)=>{const yo=Rr(Yn,mo).getOr([]);Yn[mo]=yo.concat([Zn(oo,lo)])})}),Yn},bm=Qn=>({classes:ho(Qn.classes)?[]:Qn.classes,attributes:ho(Qn.attributes)?{}:Qn.attributes,styles:ho(Qn.styles)?{}:Qn.styles}),Bm=(Qn,Zn)=>({...Qn,attributes:{...Qn.attributes,...Zn.attributes},styles:{...Qn.styles,...Zn.styles},classes:Qn.classes.concat(Zn.classes)}),a1=(Qn,Zn,Yn,Jn)=>{const oo={...Zn};Qs(Yn,Lo=>{oo[Lo.name()]=Lo.exhibit(Qn,Jn)});const lo=Bv(oo,(Lo,Wo)=>({name:Lo,modification:Wo})),mo=Lo=>Ca(Lo,(Wo,jo)=>({...jo.modification,...Wo}),{}),yo=Ca(lo.classes,(Lo,Wo)=>Wo.modification.concat(Lo),[]),Co=mo(lo.attributes),Ro=mo(lo.styles);return bm({classes:yo,attributes:Co,styles:Ro})},VO=(Qn,Zn,Yn,Jn)=>{try{const oo=Ml(Yn,(lo,mo)=>{const yo=lo[Zn],Co=mo[Zn],Ro=Jn.indexOf(yo),Lo=Jn.indexOf(Co);if(Ro===-1)throw new Error("The ordering for "+Qn+" does not have an entry for "+yo+`.
|
||||
Order specified: `+JSON.stringify(Jn,null,2));if(Lo===-1)throw new Error("The ordering for "+Qn+" does not have an entry for "+Co+`.
|
||||
Order specified: `+JSON.stringify(Jn,null,2));return Ro<Lo?-1:Lo<Ro?1:0});return yl.value(oo)}catch(oo){return yl.error([oo])}},hC=(Qn,Zn)=>({handler:Qn,purpose:Zn}),mC=(Qn,Zn)=>({cHandler:Qn,purpose:Zn}),OS=(Qn,Zn)=>mC(ms.apply(void 0,[Qn.handler].concat(Zn)),Qn.purpose),Fv=Qn=>Qn.cHandler,Hv=(Qn,Zn)=>({name:Qn,handler:Zn}),zO=(Qn,Zn)=>{const Yn={};return Qs(Qn,Jn=>{Yn[Jn.name()]=Jn.handlers(Zn)}),Yn},$2=(Qn,Zn,Yn)=>{const Jn={...Yn,...zO(Zn,Qn)};return Bv(Jn,Hv)},WO=(Qn,Zn,Yn,Jn)=>{const oo=$2(Qn,Yn,Jn);return _S(oo,Zn)},Qv=Qn=>{const Zn=F1(Qn);return(Yn,Jn,...oo)=>{const lo=[Yn,Jn].concat(oo);Zn.abort.apply(void 0,lo)?Jn.stop():Zn.can.apply(void 0,lo)&&Zn.run.apply(void 0,lo)}},R2=(Qn,Zn)=>yl.error(["The event ("+Qn+`) 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(hs(Zn,Yn=>Yn.name),null,2)]),zy=(Qn,Zn,Yn)=>{const Jn=Zn[Yn];return Jn?VO("Event: "+Yn,"name",Qn,Jn).map(oo=>{const lo=hs(oo,mo=>mo.handler);return x0(lo)}):R2(Yn,Qn)},_S=(Qn,Zn)=>{const Yn=rd(Qn,(Jn,oo)=>(Jn.length===1?yl.value(Jn[0].handler):zy(Jn,Zn,oo)).map(mo=>{const yo=Qv(mo),Co=Jn.length>1?ga(Zn[oo],Ro=>Br(Jn,Lo=>Lo.name===Ro)).join(" > "):Jn[0].name;return Jr(oo,hC(yo,Co))}));return Ac(Yn,{})},vm="alloy.base.behaviour",Wy=Ta([Bd("dom","dom",sc(),Ta([Er("tag"),Gs("styles",{}),Gs("classes",[]),Gs("attributes",{}),Tc("value"),Tc("innerHtml")])),Er("components"),Er("uid"),Gs("events",{}),Gs("apis",{}),Bd("eventOrder","eventOrder",dm({[Im()]:["disabling",vm,"toggling","typeaheadevents"],[tg()]:[vm,"focusing","keying"],[Z1()]:[vm,"disabling","toggling","representing"],[o1()]:[vm,"representing","streaming","invalidating"],[xp()]:[vm,"representing","item-events","tooltipping"],[Xl()]:["focusing",vm,"item-type-events"],[mm()]:["focusing",vm,"item-type-events"],[eg()]:["item-type-events","tooltipping"],[T0()]:["receiving","reflecting","tooltipping"]}),Ad()),Tc("domModification")]),SS=Qn=>Lu("custom.definition",Wy,Qn),UO=Qn=>({...Qn.dom,uid:Qn.uid,domChildren:hs(Qn.components,Zn=>Zn.element)}),TT=Qn=>Qn.domModification.fold(()=>bm({}),bm),ZO=Qn=>Qn.events,tb=(Qn,Zn)=>{const Yn=Bu(Qn,Zn);return Yn===void 0||Yn===""?[]:Yn.split(" ")},l1=(Qn,Zn,Yn)=>{const oo=tb(Qn,Zn).concat([Yn]);return aa(Qn,Zn,oo.join(" ")),!0},wS=(Qn,Zn,Yn)=>{const Jn=ga(tb(Qn,Zn),oo=>oo!==Yn);return Jn.length>0?aa(Qn,Zn,Jn.join(" ")):_s(Qn,Zn),!1},Vv=Qn=>Qn.dom.classList!==void 0,qO=Qn=>tb(Qn,"class"),pC=(Qn,Zn)=>l1(Qn,"class",Zn),Eu=(Qn,Zn)=>wS(Qn,"class",Zn),lg=(Qn,Zn)=>Fs(qO(Qn),Zn)?Eu(Qn,Zn):pC(Qn,Zn),$d=(Qn,Zn)=>{Vv(Qn)?Qn.dom.classList.add(Zn):pC(Qn,Zn)},gC=Qn=>{(Vv(Qn)?Qn.dom.classList:qO(Qn)).length===0&&_s(Qn,"class")},Yu=(Qn,Zn)=>{Vv(Qn)?Qn.dom.classList.remove(Zn):Eu(Qn,Zn),gC(Qn)},R0=(Qn,Zn)=>{const Yn=Vv(Qn)?Qn.dom.classList.toggle(Zn):lg(Qn,Zn);return gC(Qn),Yn},of=(Qn,Zn)=>Vv(Qn)&&Qn.dom.classList.contains(Zn),od=(Qn,Zn)=>{Qs(Zn,Yn=>{$d(Qn,Yn)})},sp=(Qn,Zn)=>{Qs(Zn,Yn=>{Yu(Qn,Yn)})},CS=(Qn,Zn)=>{Qs(Zn,Yn=>{R0(Qn,Yn)})},Df=(Qn,Zn)=>dr(Zn,Yn=>of(Qn,Yn)),Uy=Qn=>{const Zn=Qn.dom.classList,Yn=new Array(Zn.length);for(let Jn=0;Jn<Zn.length;Jn++){const oo=Zn.item(Jn);oo!==null&&(Yn[Jn]=oo)}return Yn},zv=Qn=>Vv(Qn)?Uy(Qn):qO(Qn),c1=Qn=>Qn.dom.value,Wv=(Qn,Zn)=>{if(Zn===void 0)throw new Error("Value.set was undefined");Qn.dom.value=Zn},Bb=(Qn,Zn,Yn)=>Fh(Qn,Zn).map(oo=>{if(Yn.exists(mo=>!Oc(mo,oo))){const mo=Yn.map(Nd).getOr("span"),yo=Ds.fromTag(mo);return _d(oo,yo),yo}else return oo}),nb=(Qn,Zn,Yn)=>{Yn.fold(()=>Id(Qn,Zn),Jn=>{Oc(Jn,Zn)||(_d(Jn,Zn),am(Jn))})},D2=(Qn,Zn,Yn)=>{const Jn=hs(Zn,Yn),oo=kf(Qn);return Qs(oo.slice(Jn.length),am),Jn},bC=(Qn,Zn,Yn,Jn)=>{const oo=Fh(Qn,Zn),lo=Jn(Yn,oo),mo=Bb(Qn,Zn,oo);return nb(Qn,lo.element,mo),lo},AT=(Qn,Zn,Yn)=>D2(Qn,Zn,(Jn,oo)=>bC(Qn,oo,Jn,Yn)),PT=(Qn,Zn)=>D2(Qn,Zn,(Yn,Jn)=>{const oo=Fh(Qn,Jn);return nb(Qn,Yn,oo),Yn}),cg=(Qn,Zn)=>{const Yn=nc(Qn),Jn=nc(Zn),oo=nr(Jn,Yn),lo=kc(Qn,(mo,yo)=>!Pl(Zn,yo)||mo!==Zn[yo]).t;return{toRemove:oo,toSet:lo}},$h=(Qn,Zn)=>{const{class:Yn,style:Jn,...oo}=ar(Zn),{toSet:lo,toRemove:mo}=cg(Qn.attributes,oo),yo=()=>{Qs(mo,Xs=>_s(Zn,Xs)),Qp(Zn,lo)},Co=jc(Zn),{toSet:Ro,toRemove:Lo}=cg(Qn.styles,Co),Wo=()=>{Qs(Lo,Xs=>El(Zn,Xs)),fu(Zn,Ro)},jo=zv(Zn),es=nr(jo,Qn.classes),us=nr(Qn.classes,jo),Ps=()=>{od(Zn,us),sp(Zn,es)},er=Xs=>{G1(Zn,Xs)},Bs=()=>{const Xs=Qn.domChildren;PT(Zn,Xs)},Ns=()=>{const Xs=Zn,Hr=Qn.value.getOrUndefined();Hr!==c1(Xs)&&Wv(Xs,Hr??"")};return yo(),Ps(),Wo(),Qn.innerHtml.fold(Bs,er),Ns(),Zn},M2=Qn=>{const Zn=Ds.fromTag(Qn.tag);Qp(Zn,Qn.attributes),od(Zn,Qn.classes),fu(Zn,Qn.styles),Qn.innerHtml.each(Jn=>G1(Zn,Jn));const Yn=Qn.domChildren;return Rm(Zn,Yn),Qn.value.each(Jn=>{Wv(Zn,Jn)}),Zn},N2=(Qn,Zn)=>{try{const Yn=$h(Qn,Zn);return ko.some(Yn)}catch{return ko.none()}},Fb=Qn=>Qn.innerHtml.isSome()&&Qn.domChildren.length>0,Zy=(Qn,Zn)=>{const Yn=oo=>Nd(oo)===Qn.tag&&!Fb(Qn)&&!fC(oo),Jn=Zn.filter(Yn).bind(oo=>N2(Qn,oo)).getOrThunk(()=>M2(Qn));return Dv(Jn,Qn.uid),Jn},jO=Qn=>{const Zn=Rr(Qn,"behaviours").getOr({});return fs(nc(Zn),Yn=>{const Jn=Zn[Yn];return Oo(Jn)?[Jn.me]:[]})},XO=(Qn,Zn)=>bS(Qn,Zn),u1=Qn=>{const Zn=jO(Qn);return XO(Qn,Zn)},Uv=(Qn,Zn,Yn)=>{const Jn=UO(Qn),oo=TT(Qn),lo={"alloy.base.modification":oo},mo=Zn.length>0?a1(Yn,lo,Zn,Jn):oo;return Bm(Jn,mo)},Hb=(Qn,Zn,Yn)=>{const Jn={"alloy.base.behaviour":ZO(Qn)};return WO(Yn,Qn.eventOrder,Zn,Jn).getOrDie()},D0=(Qn,Zn)=>{const Yn=()=>Xs,Jn=Ua(ag),oo=Ec(SS(Qn)),lo=u1(Qn),mo=vS(lo),yo=yS(lo),Co=Uv(oo,mo,yo),Ro=Zy(Co,Zn),Lo=Hb(oo,mo,yo),Wo=Ua(oo.components),jo=Hr=>{Jn.set(Hr)},es=()=>{Jn.set(Ep(Yn))},us=()=>{const Hr=kf(Ro),kr=fs(Hr,Or=>Jn.get().getByDom(Or).fold(()=>[],ra));Wo.set(kr)},Ps=Hr=>{const kr=yo;return(So(kr[Hr.name()])?kr[Hr.name()]:()=>{throw new Error("Could not find "+Hr.name()+" in "+JSON.stringify(Qn,null,2))})()},er=Hr=>So(
Line truncated
|
||||
`);return Zs(Zn,Yn=>Yn.indexOf("alloy")>0&&!Br(I2,Jn=>Yn.indexOf(Jn)>-1)).getOr(wC)}else return wC},B2={logEventCut:xo,logEventStopped:xo,logNoParent:xo,logEventNoHandlers:xo,logEventResponse:xo,write:xo},KO=(Qn,Zn,Yn)=>xS(Qn,Zn,Yn),jv=Mo(B2),Qm=Mo([Er("menu"),Er("selectedMenu")]),CC=Mo([Er("item"),Er("selectedItem")]);Mo(Ta(CC().concat(Qm())));const Xv=Mo(Ta(CC())),kC=fm("initSize",[Er("numColumns"),Er("numRows")]),F2=()=>Kf("markers",Xv()),qy=()=>fm("markers",[Er("backgroundMenu")].concat(Qm()).concat(CC())),Wb=Qn=>fm("markers",hs(Qn,Er)),JO=(Qn,Zn,Yn)=>(ES(),Bd(Zn,Zn,Yn,Rg(Jn=>yl.value((...oo)=>Jn.apply(void 0,oo))))),rc=Qn=>JO("onHandler",Qn,um(xo)),Vm=Qn=>JO("onKeyboardHandler",Qn,um(ko.none)),Fg=Qn=>JO("onHandler",Qn,sc()),Yv=Qn=>JO("onKeyboardHandler",Qn,sc()),tu=(Qn,Zn)=>pu(Qn,Mo(Zn)),Gv=Qn=>pu(Qn,Go),e_=Mo(kC),Yd=(Qn,Zn,Yn,Jn,oo,lo,mo,yo=!1)=>({x:Qn,y:Zn,bubble:Yn,direction:Jn,placement:oo,restriction:lo,label:`${mo}-${oo}`,alwaysFit:yo}),Hg=Po.generate([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),sb=(Qn,Zn,Yn,Jn,oo,lo,mo,yo,Co)=>Qn.fold(Zn,Yn,Jn,oo,lo,mo,yo,Co),t_=(Qn,Zn,Yn,Jn)=>Qn.fold(Zn,Zn,Jn,Jn,Zn,Jn,Yn,Yn),jy=(Qn,Zn,Yn,Jn)=>Qn.fold(Zn,Jn,Zn,Jn,Yn,Yn,Zn,Jn),Xy=Hg.southeast,TS=Hg.southwest,n_=Hg.northeast,Pp=Hg.northwest,ug=Hg.south,H2=Hg.north,lr=Hg.east,H0=Hg.west,Q0=(Qn,Zn,Yn,Jn)=>{const oo=Qn+Zn;return oo>Jn?Yn:oo<Yn?Jn:oo},rp=(Qn,Zn,Yn)=>Math.min(Math.max(Qn,Zn),Yn),AS=(Qn,Zn)=>{switch(Zn){case 1:return Qn.x;case 0:return Qn.x+Qn.width;case 2:return Qn.y;case 3:return Qn.y+Qn.height}},Uu=(Qn,Zn)=>Kr(["left","right","top","bottom"],Yn=>Rr(Zn,Yn).map(Jn=>AS(Qn,Jn))),o_=(Qn,Zn,Yn)=>{const Jn=(Co,Ro)=>Zn[Co].map(Lo=>{const Wo=Co==="top"||Co==="bottom",jo=Wo?Yn.top:Yn.left,us=(Co==="left"||Co==="top"?Math.max:Math.min)(Lo,Ro)+jo;return Wo?rp(us,Qn.y,Qn.bottom):rp(us,Qn.x,Qn.right)}).getOr(Ro),oo=Jn("left",Qn.x),lo=Jn("top",Qn.y),mo=Jn("right",Qn.right),yo=Jn("bottom",Qn.bottom);return Kc(oo,lo,mo-oo,yo-lo)},rb="layout",PS=Qn=>Qn.x,s_=(Qn,Zn)=>Qn.x+Qn.width/2-Zn.width/2,$S=(Qn,Zn)=>Qn.x+Qn.width-Zn.width,Yy=(Qn,Zn)=>Qn.y-Zn.height,Kv=Qn=>Qn.y+Qn.height,RS=(Qn,Zn)=>Qn.y+Qn.height/2-Zn.height/2,Q2=Qn=>Qn.x+Qn.width,Dd=(Qn,Zn)=>Qn.x-Zn.width,gf=(Qn,Zn,Yn)=>Yd(PS(Qn),Kv(Qn),Yn.southeast(),Xy(),"southeast",Uu(Qn,{left:1,top:3}),rb),eh=(Qn,Zn,Yn)=>Yd($S(Qn,Zn),Kv(Qn),Yn.southwest(),TS(),"southwest",Uu(Qn,{right:0,top:3}),rb),bf=(Qn,Zn,Yn)=>Yd(PS(Qn),Yy(Qn,Zn),Yn.northeast(),n_(),"northeast",Uu(Qn,{left:1,bottom:2}),rb),$l=(Qn,Zn,Yn)=>Yd($S(Qn,Zn),Yy(Qn,Zn),Yn.northwest(),Pp(),"northwest",Uu(Qn,{right:0,bottom:2}),rb),Rh=(Qn,Zn,Yn)=>Yd(s_(Qn,Zn),Yy(Qn,Zn),Yn.north(),H2(),"north",Uu(Qn,{bottom:2}),rb),bu=(Qn,Zn,Yn)=>Yd(s_(Qn,Zn),Kv(Qn),Yn.south(),ug(),"south",Uu(Qn,{top:3}),rb),vf=(Qn,Zn,Yn)=>Yd(Q2(Qn),RS(Qn,Zn),Yn.east(),lr(),"east",Uu(Qn,{left:0}),rb),Gy=(Qn,Zn,Yn)=>Yd(Dd(Qn,Zn),RS(Qn,Zn),Yn.west(),H0(),"west",Uu(Qn,{right:1}),rb),d1=()=>[gf,eh,bf,$l,bu,Rh,vf,Gy],Ky=()=>[eh,gf,$l,bf,bu,Rh,vf,Gy],DS=()=>[bf,$l,gf,eh,Rh,bu],xC=()=>[$l,bf,eh,gf,Rh,bu],r_=()=>[gf,eh,bf,$l,bu,Rh],MS=()=>[eh,gf,$l,bf,bu,Rh],NS=(Qn,Zn)=>Zn.universal?Qn:ga(Qn,Yn=>Fs(Zn.channels,Yn));var f1=Object.freeze({__proto__:null,events:Qn=>Jc([wr(T0(),(Zn,Yn)=>{const Jn=Qn.channels,oo=nc(Jn),lo=Yn,mo=NS(oo,lo);Qs(mo,yo=>{const Co=Jn[yo],Ro=Co.schema,Lo=td("channel["+yo+`] data
|
||||
Receiver: `+r1(Zn.element),Ro,lo.data);Co.onReceive(Zn,Lo)})})])}),EC=[Kf("channels",Dg(yl.value,mu([Fg("onReceive"),Gs("schema",Ad())])))];const ib=(Qn,Zn,Yn)=>qh(Jn=>{Yn(Jn,Qn,Zn)}),Vd=(Qn,Zn,Yn)=>$v((Jn,oo)=>{Yn(Jn,Qn,Zn)}),yf=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=mu(Qn),yo=hh(Zn,[np("config",Qn)]);return Qg(mo,yo,Zn,Yn,Jn,oo,lo)},z2=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=Qn,yo=hh(Zn,[Fd("config",Qn)]);return Qg(mo,yo,Zn,Yn,Jn,oo,lo)},ym=(Qn,Zn,Yn)=>Nv((oo,...lo)=>{const mo=[oo].concat(lo);return oo.config({name:Mo(Qn)}).fold(()=>{throw new Error("We could not find any behaviour configuration for: "+Qn+". Using API: "+Yn)},yo=>{const Co=Array.prototype.slice.call(mo,1);return Zn.apply(void 0,[oo,yo.config,yo.state].concat(Co))})},Yn,Zn),$T=Qn=>({key:Qn,value:void 0}),Qg=(Qn,Zn,Yn,Jn,oo,lo,mo)=>{const yo=Wo=>Su(Wo,Yn)?Wo[Yn]():ko.none(),Co=Vl(oo,(Wo,jo)=>ym(Yn,Wo,jo)),Lo={...Vl(lo,(Wo,jo)=>QO(Wo,jo)),...Co,revoke:ms($T,Yn),config:Wo=>{const jo=td(Yn+"-config",Qn,Wo);return{key:Yn,value:{config:jo,me:Lo,configAsRaw:Du(()=>td(Yn+"-config",Qn,Wo)),initialConfig:Wo,state:mo}}},schema:Mo(Zn),exhibit:(Wo,jo)=>ia(yo(Wo),Rr(Jn,"exhibit"),(es,us)=>us(jo,es.config,es.state)).getOrThunk(()=>bm({})),name:Mo(Yn),handlers:Wo=>yo(Wo).map(jo=>Rr(Jn,"events").getOr(()=>({}))(jo.config,jo.state)).getOr({})};return Lo},Zr=Qn=>La(Qn),LS=mu([Er("fields"),Er("name"),Gs("active",{}),Gs("apis",{}),Gs("state",Ap),Gs("extra",{})]),Of=Qn=>{const Zn=td("Creating behaviour: "+Qn.name,LS,Qn);return yf(Zn.fields,Zn.name,Zn.active,Zn.apis,Zn.extra,Zn.state)},IS=mu([Er("branchKey"),Er("branches"),Er("name"),Gs("active",{}),Gs("apis",{}),Gs("state",Ap),Gs("extra",{})]),Ub=Qn=>{const Zn=td("Creating behaviour: "+Qn.name,IS,Qn);return z2(jl(Zn.branchKey,Zn.branches),Zn.name,Zn.active,Zn.apis,Zn.extra,Zn.state)},Jy=Mo(void 0),Om=Of({fields:EC,name:"receiving",active:f1});var eO=Object.freeze({__proto__:null,exhibit:(Qn,Zn)=>bm({classes:[],styles:Zn.useFixed()?{}:{position:"relative"}})});const Cd=(Qn,Zn=!1)=>Qn.dom.focus({preventScroll:Zn}),Vg=Qn=>Qn.dom.blur(),tO=Qn=>{const Zn=rr(Qn).dom;return Qn.dom===Zn.activeElement},h1=(Qn=Op())=>ko.from(Qn.dom.activeElement).map(Ds.fromDom),dg=Qn=>h1(rr(Qn)).filter(Zn=>Qn.dom.contains(Zn.dom)),ma=(Qn,Zn)=>{const Yn=rr(Zn),Jn=h1(Yn).bind(lo=>{const mo=yo=>Oc(lo,yo);return mo(Zn)?ko.some(Zn):SC(Zn,mo)}),oo=Qn(Zn);return Jn.each(lo=>{h1(Yn).filter(mo=>Oc(mo,lo)).fold(()=>{Cd(lo)},xo)}),oo},ip=(Qn,Zn,Yn,Jn,oo)=>{const lo=mo=>mo+"px";return{position:Qn,left:Zn.map(lo),top:Yn.map(lo),right:Jn.map(lo),bottom:oo.map(lo)}},BS=Qn=>({...Qn,position:ko.some(Qn.position)}),m1=(Qn,Zn)=>{Lr(Qn,BS(Zn))},Ic=Po.generate([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),FS=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=Zn.rect,yo=mo.x-Yn,Co=mo.y-Jn,Ro=mo.width,Lo=mo.height,Wo=oo-(yo+Ro),jo=lo-(Co+Lo),es=ko.some(yo),us=ko.some(Co),Ps=ko.some(Wo),er=ko.some(jo),Bs=ko.none();return sb(Zn.direction,()=>ip(Qn,es,us,Bs,Bs),()=>ip(Qn,Bs,us,Ps,Bs),()=>ip(Qn,es,Bs,Bs,er),()=>ip(Qn,Bs,Bs,Ps,er),()=>ip(Qn,es,us,Bs,Bs),()=>ip(Qn,es,Bs,Bs,er),()=>ip(Qn,es,us,Bs,Bs),()=>ip(Qn,Bs,us,Ps,Bs))},ap=(Qn,Zn)=>Qn.fold(()=>{const Yn=Zn.rect;return ip("absolute",ko.some(Yn.x),ko.some(Yn.y),ko.none(),ko.none())},(Yn,Jn,oo,lo)=>FS("absolute",Zn,Yn,Jn,oo,lo),(Yn,Jn,oo,lo)=>FS("fixed",Zn,Yn,Jn,oo,lo)),i_=(Qn,Zn)=>{const Yn=ms(Zp,Zn),Jn=Qn.fold(Yn,Yn,()=>{const mo=Af();return Zp(Zn).translate(-mo.left,-mo.top)}),oo=yd(Zn),lo=Vp(Zn);return Kc(Jn.left,Jn.top,oo,lo)},W2=(Qn,Zn)=>Zn.fold(()=>Qn.fold(tf,tf,Kc),Yn=>Qn.fold(Mo(Yn),Mo(Yn),()=>{const Jn=Zu(Qn,Yn.x,Yn.y);return Kc(Jn.left,Jn.top,Yn.width,Yn.height)})),Zu=(Qn,Zn,Yn)=>{const Jn=vc(Zn,Yn),oo=()=>{const lo=Af();return Jn.translate(-lo.left,-lo.top)};return Qn.fold(Mo(Jn),Mo(Jn),oo)},U2=(Qn,Zn,Yn,Jn)=>Qn.fold(Zn,Yn,Jn);Ic.none;const bh=Ic.relative,Zb=Ic.fixed,Z2=(Qn,Zn)=>({anchorBox:Qn,origin:Zn}),q2=(Qn,Zn)=>Z2(Qn,Zn),HS="data-alloy-placement",j2=(Qn,Zn)=>{aa(Qn,HS,Zn)},AC=Qn=>Uo(Qn,HS),PC=Qn=>_s(Qn,HS),nO=Po.generate([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),$C=(Qn,Zn)=>{const{x:Yn,y:Jn,right:oo,bottom:lo}=Zn,{x:mo,y:yo,right:Co,bottom:Ro,width:Lo,height:Wo}=Qn,jo=mo>=Yn&&mo<=oo,es=yo>=Jn&&yo<=lo,us=jo&&es,Ps=Co<=oo&&Co>=Yn,er=Ro<=lo&&Ro>=Jn,Bs=Ps&&er,Ns=Math.min(Lo,mo>=Yn?oo-mo:Co-Yn),Xs=Math.min(Wo,yo>=Jn?lo-yo:Ro-Jn);return{originInBounds:us,sizeInBounds:Bs,visibleW:Ns,visibleH:Xs}},QS=(Qn,Zn)=>{const{x:Yn,y:Jn,right:oo,bottom:lo}=Zn,{x:mo,y:yo,width:Co,height:Ro}=Qn,Lo=Math.max(Yn,oo-Co),Wo=Math.max(Jn,lo-Ro),jo=rp(mo,Yn,Lo),es=rp(yo,Jn,Wo),us=Math.min(jo+Co,oo)-jo,Ps=Math.min(es+Ro,lo)-es;return Kc(jo,es,us,Ps)},V0=(Qn,Zn,Yn)=>{const Jn=Mo(Zn.bottom-Yn.y),oo=Mo(Yn.bottom-Zn.y),lo=t_(Qn,oo,oo,Jn),mo=Mo(Zn.right-Yn.x),yo=Mo(Yn.right-Zn.x);return{maxWidth:jy(Qn,yo,yo,mo),maxHeight:lo}},X2=(Qn,Zn,Yn,Jn)=>{const oo=Qn.bubble,lo=oo.offset,mo=o_(Jn,Qn.restriction,lo),yo=Qn.x+lo.left,Co=Qn.y+lo.top,Ro=Kc(yo,Co,Zn,Yn),{originInBounds:Lo,sizeInBounds:Wo,v
Line truncated
|
||||
Known: [`+nc(Jn)+`]
|
||||
Namespace: `+Qn.getOr("none")+`
|
||||
Spec: `+JSON.stringify(Yn,null,2))},oo=>oo.replace()),ck=(Qn,Zn,Yn,Jn)=>fb(Yn)&&Yn.uiType===ak?lk(Qn,Zn,Yn,Jn):fw.single(!1,Mo(Yn)),E_=(Qn,Zn,Yn,Jn)=>ck(Qn,Zn,Yn,Jn).fold((lo,mo)=>{const yo=fb(Yn)?mo(Zn,Yn.config,Yn.validated):mo(Zn),Co=Rr(yo,"components").getOr([]),Ro=fs(Co,Lo=>E_(Qn,Zn,Lo,Jn));return[{...yo,components:Ro}]},(lo,mo)=>{if(fb(Yn)){const yo=mo(Zn,Yn.config,Yn.validated);return Yn.validated.preprocess.getOr(Go)(yo)}else return mo(Zn)}),WT=(Qn,Zn,Yn,Jn)=>fs(Yn,oo=>E_(Qn,Zn,oo,Jn)),hw=(Qn,Zn)=>{let Yn=!1;const Jn=()=>Yn,oo=()=>{if(Yn)throw new Error("Trying to use the same placeholder more than once: "+Qn);return Yn=!0,Zn},lo=()=>Zn.fold((mo,yo)=>mo,(mo,yo)=>mo);return{name:Mo(Qn),required:lo,used:Jn,replace:oo}},Tx=(Qn,Zn,Yn,Jn)=>{const oo=Vl(Jn,(mo,yo)=>hw(yo,mo)),lo=WT(Qn,Zn,Yn,oo);return Zl(oo,mo=>{if(mo.used()===!1&&mo.required())throw new Error("Placeholder: "+mo.name()+` was not found in components list
|
||||
Namespace: `+Qn.getOr("none")+`
|
||||
Components: `+JSON.stringify(Zn.components,null,2))}),lo},Ax=fw.single,k3=fw.multiple,hb=Mo(ak),uk=Po.generate([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),T_=Gs("factory",{sketch:Go}),Nh=Gs("schema",[]),Sf=Er("name"),dk=Bd("pname","pname",hf(Qn=>"<alloy."+ba(Qn.name)+">"),Ad()),mw=pu("schema",()=>[Tc("preprocess")]),fk=Gs("defaults",Mo({})),pw=Gs("overrides",Mo({})),gw=Ta([T_,Nh,Sf,dk,fk,pw]),A_=Ta([T_,Nh,Sf,fk,pw]),UT=Ta([T_,Nh,Sf,dk,fk,pw]),bw=Ta([T_,mw,Sf,Er("unit"),dk,fk,pw]),ZT=Qn=>Qn.fold(ko.some,ko.none,ko.some,ko.some),qT=Qn=>{const Zn=Yn=>Yn.name;return Qn.fold(Zn,Zn,Zn,Zn)},jT=Qn=>Qn.fold(Go,Go,Go,Go),Ug=(Qn,Zn)=>Yn=>{const Jn=td("Converting part type",Zn,Yn);return Qn(Jn)},Xh=Ug(uk.required,gw),v1=Ug(uk.external,A_),up=Ug(uk.optional,UT),vw=Ug(uk.group,bw),hk=Mo("entirety");var XT=Object.freeze({__proto__:null,required:Xh,external:v1,optional:up,group:vw,asNamedPart:ZT,name:qT,asCommon:jT,original:hk});const yw=(Qn,Zn,Yn,Jn)=>Lc(Zn.defaults(Qn,Yn,Jn),Yn,{uid:Qn.partUids[Zn.name]},Zn.overrides(Qn,Yn,Jn)),x3=(Qn,Zn,Yn)=>{const Jn={},oo={};return Qs(Yn,lo=>{lo.fold(mo=>{Jn[mo.pname]=Ax(!0,(yo,Co,Ro)=>mo.factory.sketch(yw(yo,mo,Co,Ro)))},mo=>{const yo=Zn.parts[mo.name];oo[mo.name]=Mo(mo.factory.sketch(yw(Zn,mo,yo[hk()]),yo))},mo=>{Jn[mo.pname]=Ax(!1,(yo,Co,Ro)=>mo.factory.sketch(yw(yo,mo,Co,Ro)))},mo=>{Jn[mo.pname]=k3(!0,(yo,Co,Ro)=>{const Lo=yo[mo.name];return hs(Lo,Wo=>mo.factory.sketch(Lc(mo.defaults(yo,Wo,Ro),Wo,mo.overrides(yo,Wo))))})})}),{internals:Mo(Jn),externals:Mo(oo)}},X0=(Qn,Zn)=>{const Yn={};return Qs(Zn,Jn=>{ZT(Jn).each(oo=>{const lo=Ow(Qn,oo.pname);Yn[oo.name]=mo=>{const yo=td("Part: "+oo.name+" in "+Qn,Ta(oo.schema),mo);return{...lo,config:mo,validated:yo}}})}),Yn},Ow=(Qn,Zn)=>({uiType:hb(),owner:Qn,name:Zn}),Px=(Qn,Zn,Yn)=>({uiType:hb(),owner:Qn,name:Zn,config:Yn,validated:{}}),YT=Qn=>fs(Qn,Zn=>Zn.fold(ko.none,ko.some,ko.none,ko.none).map(Yn=>fm(Yn.name,Yn.schema.concat([Gv(hk())]))).toArray()),GT=Qn=>hs(Qn,qT),$x=(Qn,Zn,Yn)=>x3(Qn,Zn,Yn),mk=(Qn,Zn,Yn)=>Tx(ko.some(Qn),Zn,Zn.components,Yn),Au=(Qn,Zn,Yn)=>{const Jn=Zn.partUids[Yn];return Qn.getSystem().getByUid(Jn).toOptional()},Y0=(Qn,Zn,Yn)=>Au(Qn,Zn,Yn).getOrDie("Could not find part: "+Yn),KT=(Qn,Zn,Yn)=>{const Jn={},oo=Zn.partUids,lo=Qn.getSystem();return Qs(Yn,mo=>{Jn[mo]=Mo(lo.getByUid(oo[mo]))}),Jn},Rx=(Qn,Zn)=>{const Yn=Qn.getSystem();return Vl(Zn.partUids,(Jn,oo)=>Mo(Yn.getByUid(Jn)))},Dx=Qn=>nc(Qn.partUids),fO=(Qn,Zn,Yn)=>{const Jn={},oo=Zn.partUids,lo=Qn.getSystem();return Qs(Yn,mo=>{Jn[mo]=Mo(lo.getByUid(oo[mo]).getOrDie())}),Jn},Mx=(Qn,Zn)=>{const Yn=GT(Zn);return La(hs(Yn,Jn=>({key:Jn,value:Qn+"-"+Jn})))},Nx=Qn=>Bd("partUids","partUids",ss(Zn=>Mx(Zn.uid,Qn)),Ad());var E3=Object.freeze({__proto__:null,generate:X0,generateOne:Px,schemas:YT,names:GT,substitutes:$x,components:mk,defaultUids:Mx,defaultUidsSchema:Nx,getAllParts:Rx,getAllPartNames:Dx,getPart:Au,getPartOrDie:Y0,getParts:KT,getPartsOrDie:fO});const P_=(Qn,Zn)=>(Qn.length>0?[fm("parts",Qn)]:[]).concat([Er("uid"),Gs("dom",{}),Gs("components",[]),Gv("originalSpec"),Gs("debug.sketcher",{})]).concat(Zn),$_=(Qn,Zn,Yn,Jn,oo)=>{const lo=P_(Jn,oo);return td(Qn+" [SpecSchema]",mu(lo.concat(Zn)),Yn)},Lx=(Qn,Zn,Yn,Jn)=>{const oo=fy(Jn),lo=$_(Qn,Zn,oo,[],[]);return Yn(lo,oo)},Ix=(Qn,Zn,Yn,Jn,oo)=>{const lo=fy(oo),mo=YT(Yn),yo=Nx(Yn),Co=$_(Qn,Zn,lo,mo,[yo]),Ro=$x(Qn,Co,Yn),Lo=mk(Qn,Co,Ro.internals());return Jn(Co,Lo,lo,Ro.externals())},y1=Qn=>Pl(Qn,"uid"),fy=Qn=>y1(Qn)?Qn:{...Qn,uid:Mv("uid")},T3=Qn=>Qn.uid!==void 0,_w=mu([Er("name"),Er("factory"),Er("configFields"),Gs("apis",{}),Gs("extraApis",{})]),A3=mu([Er("name"),Er("factory"),Er("configFields"),Er("partFields"),Gs("apis",{}),Gs("extraApis",{})]),Mp=Qn=>{const Zn=td("Sketcher for "+Qn.name,_w,Qn),Yn=lo=>Lx(Zn.name,Zn.configFields,Zn.factory,lo),Jn=Vl(Zn.apis,eb),oo=Vl(Zn.extraApis,(lo,mo)=>QO(lo,mo));return{name:Zn.name,configFields:Zn.configFields,sketch:Yn,...Jn,...oo}},Yh=Qn=>{const Zn=td("Sketcher for "+Qn.name,A3,Qn),Yn=mo=>Ix(Zn.name,Zn.configFields,Zn.partFields,Zn.factory,mo),Jn=X0(Zn.name,Zn.partFields),oo=Vl(Zn.apis,eb),lo=Vl(Zn.extraApis,(mo,yo)=>QO(mo,yo));return{name:Zn.name,partFields:Zn.partFields,configFields:Zn.configFields,sketch:Yn,parts:Jn,...oo,...lo}},hO=Qn=>ef("input")(Qn)&&Bu(Qn,"type")!=="radio"||ef("textarea")(Qn);var JT=Object.freeze({__proto__:null,getCurrent:(Qn,Zn,Yn)=>Zn.find(Qn)});const P3=[Er("find")],ic=Of({fields:P3,name:"composing",apis:JT}),Bx=["input","button","textarea","select"],eA=(Qn,Zn,Yn)=>{(Zn.disabled()?nA:Sw)(Qn,Zn)},Fx=(Qn,Zn)=>Zn.useNative===!0&&Fs(Bx,Nd(Qn.element)),$3=Qn=>cs(Qn.element,"disabled"),R3=Qn=>{aa(Qn.element,"disabled","disabled")},tA=Qn=>{_s(Qn.element,"disabled")},D3=Qn=>Bu(Qn.element,"aria-disabled")==="true",va=Qn=>{aa(Qn.element,"aria-disabled","true")},hy=Qn=>{aa(Qn.element,"aria-disabled","false")},nA=(Qn,Zn,Yn)=>{Zn.disableClass.each(oo=>{$d(Qn.element,oo)}),(Fx(Qn,Zn)?R3:va)(Qn),Zn.onDisabled(Qn)},Sw=(Qn,Zn,Yn)=>{Zn
Line truncated
|
||||
`+tm),hv&&(tm=ov(tm,fl," "),tm=ov(tm,rl," "),tm=ov(tm,Yc," ")),Xs&&sH?Xs.createHTML(tm):tm},Zn.setConfig=function(lc){DY(lc),CT=!0},Zn.clearConfig=function(){f3=null,CT=!1},Zn.isValidAttribute=function(lc,gr,Ia){f3||DY({});const bl=kg(lc),Bf=kg(gr);return tK(bl,Bf,Ia)},Zn.addHook=function(lc,gr){typeof gr=="function"&&(Sa[lc]=Sa[lc]||[],Gx(Sa[lc],gr))},Zn.removeHook=function(lc){if(Sa[lc])return k9(Sa[lc])},Zn.removeHooks=function(lc){Sa[lc]&&(Sa[lc]=[])},Zn.removeAllHooks=function(){Sa={}},Zn}var $5=oE();const gR=Qn=>$5().sanitize(Qn);var _1=tinymce.util.Tools.resolve("tinymce.util.I18n");const L9={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},R5="temporary-placeholder",bR=Qn=>()=>Rr(Qn,R5).getOr("!not found!"),sE=(Qn,Zn)=>{const Yn=Qn.toLowerCase();if(_1.isRtl()){const Jn=Vc(Yn,"-rtl");return Pl(Zn,Jn)?Jn:Yn}else return Yn},vR=(Qn,Zn)=>Rr(Zn,sE(Qn,Zn)),yR=(Qn,Zn)=>{const Yn=Zn();return vR(Qn,Yn).getOrThunk(bR(Yn))},OR=(Qn,Zn,Yn)=>{const Jn=Zn();return vR(Qn,Jn).or(Yn).getOrThunk(bR(Jn))},I9=Qn=>_1.isRtl()?Pl(L9,Qn):!1,AA=()=>Rl("add-focusable",[eu(Qn=>{GO(Qn.element,"svg").each(Zn=>aa(Zn,"focusable","false"))})]),D5=(Qn,Zn,Yn,Jn)=>{var oo,lo;const mo=I9(Zn)?["tox-icon--flip"]:[],yo=Rr(Yn,sE(Zn,Yn)).or(Jn).getOrThunk(bR(Yn));return{dom:{tag:Qn.tag,attributes:(oo=Qn.attributes)!==null&&oo!==void 0?oo:{},classes:Qn.classes.concat(mo),innerHtml:yo},behaviours:Zr([...(lo=Qn.behaviours)!==null&&lo!==void 0?lo:[],AA()])}},s0=(Qn,Zn,Yn,Jn=ko.none())=>D5(Zn,Qn,Yn(),Jn),B9=(Qn,Zn,Yn)=>{const Jn=Yn(),oo=Zs(Qn,lo=>Pl(Jn,sE(lo,Jn)));return D5(Zn,oo.getOr(R5),Jn,ko.none())},M5={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},_R=Mp({name:"Notification",factory:Qn=>{const Zn=ou({dom:vO(`<p>${gR(Qn.translationProvider(Qn.text))}</p>`),behaviours:Zr([Cl.config({})])}),Yn=es=>({dom:{tag:"div",classes:["tox-bar"],styles:{width:`${es}%`}}}),Jn=es=>({dom:{tag:"div",classes:["tox-text"],innerHtml:`${es}%`}}),oo=ou({dom:{tag:"div",classes:Qn.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[Yn(0)]},Jn(0)],behaviours:Zr([Cl.config({})])}),yo={updateProgress:(es,us)=>{es.getSystem().isConnected()&&oo.getOpt(es).each(Ps=>{Cl.set(Ps,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[Yn(us)]},Jn(us)])})},updateText:(es,us)=>{if(es.getSystem().isConnected()){const Ps=Zn.get(es);Cl.set(Ps,[wd(us)])}}},Co=Us([Qn.icon.toArray(),Qn.level.toArray(),Qn.level.bind(es=>ko.from(M5[es])).toArray()]),Ro=ou(yh.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[s0("close",{tag:"span",classes:["tox-icon"],attributes:{"aria-label":Qn.translationProvider("Close")}},Qn.iconProvider)],action:es=>{Qn.onAction(es)}})),Lo=B9(Co,{tag:"div",classes:["tox-notification__icon"]},Qn.iconProvider),Wo={dom:{tag:"div",classes:["tox-notification__body"]},components:[Zn.asSpec()],behaviours:Zr([Cl.config({})])},jo=[Lo,Wo];return{uid:Qn.uid,dom:{tag:"div",attributes:{role:"alert"},classes:Qn.level.map(es=>["tox-notification","tox-notification--in",`tox-notification--${es}`]).getOr(["tox-notification","tox-notification--in"])},behaviours:Zr([ol.config({}),Rl("notification-events",[wr(Wu(),es=>{Ro.getOpt(es).each(ol.focus)})])]),components:jo.concat(Qn.progress?[oo.asSpec()]:[]).concat(Qn.closeButton?[Ro.asSpec()]:[]),apis:yo}},configFields:[Tc("level"),Er("progress"),Tc("icon"),Er("onAction"),Er("text"),Er("iconProvider"),Er("translationProvider"),Xd("closeButton",!0)],apis:{updateProgress:(Qn,Zn,Yn)=>{Qn.updateProgress(Zn,Yn)},updateText:(Qn,Zn,Yn)=>{Qn.updateText(Zn,Yn)}}});var SR=(Qn,Zn,Yn)=>{const Jn=Zn.backstage.shared,oo=()=>{const Co=au(Ds.fromDom(Qn.getContentAreaContainer())),Ro=tf(),Lo=rp(Ro.x,Co.x,Co.right),Wo=rp(Ro.y,Co.y,Co.bottom),jo=Math.max(Co.right,Ro.right),es=Math.max(Co.bottom,Ro.bottom);return ko.some(Kc(Lo,Wo,jo-Lo,es-Wo))};return{open:(Co,Ro)=>{const Lo=()=>{Ro(),kd.hide(jo)},Wo=gh(_R.sketch({text:Co.text,level:Fs(["success","error","warning","warn","info"],Co.type)?Co.type:void 0,progress:Co.progressBar===!0,icon:Co.icon,closeButton:Co.closeButton,onAction:Lo,iconProvider:Jn.providers.icons,translationProvider:Jn.providers.translate})),jo=gh(kd.sketch({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:Jn.getSink,fireDismissalEventInstead:{},...Jn.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}}}));Yn.add(jo),$o(Co.timeout)&&Co.timeout>0&&$w.setEditorTimeout(Qn,()=>{Lo()},Co.timeout);const us={close:Lo,reposition:()=>{const Ps=Fm(Wo),er={maxHeightFunction:zg()},Bs=Qn.notificationManager.getNotifications();if(Bs[0]===us){const Ns={...Jn.anchors.banner(),overrides:er};kd.showWithinBounds(jo,Ps,{anchor:Ns},oo)}else ws(Bs,Line truncated
|
||||
Cannot use it for: `+r1(Ro.element)+`
|
||||
The conflicting element is`+(Gl(Wo.element)?" ":" not ")+"already in the DOM")},oo=Ro=>{const Lo=Yn(Ro);Su(Zn,Lo)&&Jn(Ro,Lo);const Wo=[Ro];Qn.registerId(Wo,Lo,Ro.events),Zn[Lo]=Ro},lo=Ro=>{$0(Ro.element).each(Lo=>{delete Zn[Lo],Qn.unregisterId(Lo)})};return{find:(Ro,Lo,Wo)=>Qn.find(Ro,Lo,Wo),filter:Ro=>Qn.filterByType(Ro),register:oo,unregister:lo,getById:Ro=>Rr(Zn,Ro)}},rv=Mp({name:"Container",factory:Qn=>{const{attributes:Zn,...Yn}=Qn.dom;return{uid:Qn.uid,dom:{tag:"div",attributes:{role:"presentation",...Zn},...Yn},components:Qn.components,behaviours:j0(Qn.containerBehaviours),events:Qn.events,domModification:Qn.domModification,eventOrder:Qn.eventOrder}},configFields:[Gs("components",[]),Nf("containerBehaviours",[]),Gs("events",{}),Gs("domModification",{}),Gs("eventOrder",{})]}),bP=Qn=>{const Zn=Bs=>Zd(Qn.element).fold(Js,Ns=>Oc(Bs,Ns)),Yn=jI(),Jn=(Bs,Ns)=>Yn.find(Zn,Bs,Ns),oo=FV(Qn.element,{triggerEvent:(Bs,Ns)=>KO(Bs,Ns.target,Xs=>ZD(Jn,Bs,Ns,Xs))}),lo={debugInfo:Mo("real"),triggerEvent:(Bs,Ns,Xs)=>{KO(Bs,Ns,Hr=>ZI(Jn,Bs,Xs,Ns,Hr))},triggerFocus:(Bs,Ns)=>{$0(Bs).fold(()=>{Cd(Bs)},Xs=>{KO(tg(),Bs,Hr=>(QV(Jn,tg(),{originator:Ns,kill:xo,prevent:xo,target:Bs},Bs,Hr),!1))})},triggerEscape:(Bs,Ns)=>{lo.triggerEvent("keydown",Bs.element,Ns.event)},getByUid:Bs=>Ps(Bs),getByDom:Bs=>er(Bs),build:gh,buildOrPatch:YO,addToGui:Bs=>{Co(Bs)},removeFromGui:Bs=>{Ro(Bs)},addToWorld:Bs=>{mo(Bs)},removeFromWorld:Bs=>{yo(Bs)},broadcast:Bs=>{jo(Bs)},broadcastOn:(Bs,Ns)=>{es(Bs,Ns)},broadcastEvent:(Bs,Ns)=>{us(Bs,Ns)},isConnected:Js},mo=Bs=>{Bs.connect(lo),Td(Bs.element)||(Yn.register(Bs),Qs(Bs.components(),mo),lo.triggerEvent(Z1(),Bs.element,{target:Bs.element}))},yo=Bs=>{Td(Bs.element)||(Qs(Bs.components(),yo),Yn.unregister(Bs)),Bs.disconnect()},Co=Bs=>{cy(Qn,Bs)},Ro=Bs=>{Kb(Bs)},Lo=()=>{oo.unbind(),am(Qn.element)},Wo=Bs=>{const Ns=Yn.filter(T0());Qs(Ns,Xs=>{const Hr=Xs.descHandler;Fv(Hr)(Bs)})},jo=Bs=>{Wo({universal:!0,data:Bs})},es=(Bs,Ns)=>{Wo({universal:!1,channels:Bs,data:Ns})},us=(Bs,Ns)=>{const Xs=Yn.filter(Bs);return VV(Xs,Ns)},Ps=Bs=>Yn.getById(Bs).fold(()=>yl.error(new Error('Could not find component with uid: "'+Bs+'" in system.')),yl.value),er=Bs=>{const Ns=$0(Bs).getOr("not found");return Ps(Ns)};return mo(Qn),{root:Qn,element:Qn.element,destroy:Lo,add:Co,remove:Ro,getByUid:Ps,getByDom:er,addToWorld:mo,removeFromWorld:yo,broadcast:jo,broadcastOn:es,broadcastEvent:us}},UV=(Qn,Zn)=>({dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:hs(Qn.items,Zn.interpreter)}),ZV=Mo([Gs("prefix","form-field"),Nf("fieldBehaviours",[ic,da])]),qV=Mo([up({schema:[Er("dom")],name:"label"}),up({factory:{sketch:Qn=>({uid:Qn.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:Qn.text}})},schema:[Er("text")],name:"aria-descriptor"}),Xh({factory:{sketch:Qn=>{const Zn=zr(Qn,["factory"]);return Qn.factory.sketch(Zn)}},schema:[Er("factory")],name:"field"})]),jV=(Qn,Zn,Yn,Jn)=>{const oo=sf(Qn.fieldBehaviours,[ic.config({find:yo=>Au(yo,Qn,"field")}),da.config({store:{mode:"manual",getValue:yo=>ic.getCurrent(yo).bind(da.getValue),setValue:(yo,Co)=>{ic.getCurrent(yo).each(Ro=>{da.setValue(Ro,Co)})}}})]),lo=Jc([eu((yo,Co)=>{const Ro=KT(yo,Qn,["label","field","aria-descriptor"]);Ro.field().each(Lo=>{const Wo=ba(Qn.prefix);Ro.label().each(jo=>{aa(jo.element,"for",Wo),aa(Lo.element,"id",Wo)}),Ro["aria-descriptor"]().each(jo=>{const es=ba(Qn.prefix);aa(jo.element,"id",es),aa(Lo.element,"aria-describedby",es)})})})]),mo={getField:yo=>Au(yo,Qn,"field"),getLabel:yo=>Au(yo,Qn,"label")};return{uid:Qn.uid,dom:Qn.dom,components:Zn,behaviours:oo,events:lo,apis:mo}},su=Yh({name:"FormField",configFields:ZV(),partFields:qV(),factory:jV,apis:{getField:(Qn,Zn)=>Qn.getField(Zn),getLabel:(Qn,Zn)=>Qn.getLabel(Zn)}});var vP=Object.freeze({__proto__:null,exhibit:(Qn,Zn)=>bm({attributes:La([{key:Zn.tabAttr,value:"true"}])})}),XV=[Gs("tabAttr","data-alloy-tabstop")];const sd=Of({fields:XV,name:"tabstopping",active:vP});var YV=tinymce.util.Tools.resolve("tinymce.html.Entities");const TE=(Qn,Zn,Yn,Jn)=>{const oo=KV(Qn,Zn,Yn,Jn);return su.sketch(oo)},GV=(Qn,Zn)=>TE(Qn,Zn,[],[]),KV=(Qn,Zn,Yn,Jn)=>({dom:AE(Yn),components:Qn.toArray().concat([Zn]),fieldBehaviours:Zr(Jn)}),tG=()=>AE([]),AE=Qn=>({tag:"div",classes:["tox-form__group"].concat(Qn)}),yb=(Qn,Zn)=>su.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[wd(Zn.translate(Qn))]}),vg=ba("form-component-change"),Uk=ba("form-close"),U_=ba("form-cancel"),Cy=ba("form-action"),PE=ba("form-submit"),qD=ba("form-block"),jD=ba("form-unblock"),XI=ba("form-tabchange"),YI=ba("form-resize"),JV=(Qn,Zn,Yn)=>{const Jn=Qn.label.map(es=>yb(es,Zn)),oo=Zn.icons(),lo=es=>{var us;return(us=oo[es])!==null&&us!==void 0?us:es},mo=es=>(us,Ps)=>{Bg(Ps.event.target,"[data-collection-item-value]").each(er=>{es(us,Ps,er,Bu(er,"data-collection-item-value"))})},yo=(es,us)=>{const Ps=hs(us,Ns=>{const Xs=_1.translate(Ns.text),Hr=Qn.columns===1?`<div class="tox-collection__item-labLine truncated
|
||||
`+JSON.stringify(Qn));V_.setItem(e$,JSON.stringify(Qn))},XU=Qn=>{const Zn=n6();return Rr(Zn,Qn).getOr([])},s4=(Qn,Zn)=>{if(!o4(Qn))return;const Yn=n6(),Jn=Rr(Yn,Zn).getOr([]),oo=ga(Jn,lo=>lo!==Qn);Yn[Zn]=[Qn].concat(oo).slice(0,t6),t$(Yn)},r2=Qn=>!!Qn,o6=Qn=>Vl(xO.makeMap(Qn,/[, ]/),r2),r4=Qn=>ko.from(W5(Qn)),s6=Qn=>{const Zn=ko.from(TR(Qn)).filter(r2).map(o6);return r4(Qn).fold(sr,Yn=>Zn.fold(Js,Jn=>nc(Jn).length>0?Jn:!1))},r6=(Qn,Zn)=>{const Yn=s6(Qn);return uo(Yn)?Yn?r4(Qn):ko.none():Yn[Zn]?r4(Qn):ko.none()},i6=(Qn,Zn)=>r6(Qn,Zn).map(Yn=>Jn=>Cm.nu(oo=>{const lo=(yo,Co)=>{if(!qn(yo))throw new Error("Expected value to be string");if(Co!==void 0&&!Xn(Co))throw new Error("Expected meta to be a object");oo({value:yo,meta:Co})},mo={filetype:Zn,fieldname:Jn.fieldname,...ko.from(Jn.meta).getOr({})};Yn.call(Qn,lo,Jn.value,mo)})),a6=Qn=>ko.from(Qn).filter(qn).getOrUndefined(),i4=Qn=>AR(Qn)?ko.some({targets:qU.find(Qn.getBody()),anchorTop:a6(MA(Qn)),anchorBottom:a6(Z5(Qn))}):ko.none(),n$=Qn=>ko.from(ER(Qn)),YU=Qn=>({getHistory:XU,addToHistory:s4,getLinkInformation:()=>i4(Qn),getValidationHandler:()=>n$(Qn),getUrlPicker:Zn=>i6(Qn,Zn)}),GU=(Qn,Zn,Yn,Jn)=>{const oo=Ua(!1),lo=km(Zn),mo={icons:()=>Zn.ui.registry.getAll().icons,menuItems:()=>Zn.ui.registry.getAll().menuItems,translate:_1.translate,isDisabled:()=>Zn.mode.isReadOnly()||!Zn.ui.isEnabled(),getOption:Zn.options.get},yo=YU(Zn),Co=LU(Zn),Ro=UF(Zn),Lo=mG(Zn),Wo=()=>oo.get(),jo=er=>oo.set(er),es={shared:{providers:mo,anchors:xU(Zn,Yn,Jn,lo.isPositionedAtTop),header:lo},urlinput:yo,styles:Co,colorinput:Ro,dialog:Lo,isContextMenuOpen:Wo,setContextMenuState:jo},us={...es,shared:{...es.shared,interpreter:er=>UE(er,{},us),getSink:Qn.popup}},Ps={...es,shared:{...es.shared,interpreter:er=>UE(er,{},Ps),getSink:Qn.dialog}};return{popup:us,dialog:Ps}},i2=(Qn,Zn,Yn)=>{const Jn=(Or,qr)=>{Qs([Zn,...Yn],na=>{na.broadcastEvent(Or,qr)})},oo=(Or,qr)=>{Qs([Zn,...Yn],na=>{na.broadcastOn([Or],qr)})},lo=Or=>oo(db(),{target:Or.target}),mo=Op(),yo=Dh(mo,"touchstart",lo),Co=Dh(mo,"touchmove",Or=>Jn(Ah(),Or)),Ro=Dh(mo,"touchend",Or=>Jn(kp(),Or)),Lo=Dh(mo,"mousedown",lo),Wo=Dh(mo,"mouseup",Or=>{Or.raw.button===0&&oo(wx(),{target:Or.target})}),jo=Or=>oo(db(),{target:Ds.fromDom(Or.target)}),es=Or=>{Or.button===0&&oo(wx(),{target:Ds.fromDom(Or.target)})},us=()=>{Qs(Qn.editorManager.get(),Or=>{Qn!==Or&&Or.dispatch("DismissPopups",{relatedTarget:Qn})})},Ps=Or=>Jn(s1(),th(Or)),er=Or=>{oo(uO(),{}),Jn(Ig(),th(Or))},Bs=rr(Ds.fromDom(Qn.getElement())),Ns=a_(Bs,"scroll",Or=>{requestAnimationFrame(()=>{const qr=Qn.getContainer();if(qr!=null){const Dl=W_(Qn,Zn.element).map(Sa=>[Sa.element,...Sa.others]).getOr([]);Br(Dl,Sa=>Oc(Sa,Or.target))&&(Qn.dispatch("ElementScroll",{target:Or.target.dom}),Jn(j1(),Or))}})}),Xs=()=>oo(uO(),{}),Hr=Or=>{Or.state&&oo(db(),{target:Ds.fromDom(Qn.getContainer())})},kr=Or=>{oo(db(),{target:Ds.fromDom(Or.relatedTarget.getContainer())})};Qn.on("PostRender",()=>{Qn.on("click",jo),Qn.on("tap",jo),Qn.on("mouseup",es),Qn.on("mousedown",us),Qn.on("ScrollWindow",Ps),Qn.on("ResizeWindow",er),Qn.on("ResizeEditor",Xs),Qn.on("AfterProgressState",Hr),Qn.on("DismissPopups",kr)}),Qn.on("remove",()=>{Qn.off("click",jo),Qn.off("tap",jo),Qn.off("mouseup",es),Qn.off("mousedown",us),Qn.off("ScrollWindow",Ps),Qn.off("ResizeWindow",er),Qn.off("ResizeEditor",Xs),Qn.off("AfterProgressState",Hr),Qn.off("DismissPopups",kr),Lo.unbind(),yo.unbind(),Co.unbind(),Ro.unbind(),Wo.unbind(),Ns.unbind()}),Qn.on("detach",()=>{Qs([Zn,...Yn],w_),Qs([Zn,...Yn],Or=>Or.destroy())})},rh=E3,Ty=XT,l6=Mo([Gs("shell",!1),Er("makeItem"),Gs("setupItem",xo),Wg.field("listBehaviours",[Cl])]),a4=up({name:"items",overrides:()=>({behaviours:Zr([Cl.config({})])})}),KU=Mo([a4]),JU=Mo("CustomList"),eZ=(Qn,Zn,Yn,Jn)=>{const oo=(yo,Co)=>{mo(yo).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")},Ro=>{const Lo=Cl.contents(Ro),Wo=Co.length,jo=Wo-Lo.length,es=jo>0?_r(jo,()=>Qn.makeItem()):[],us=Lo.slice(Wo);Qs(us,er=>Cl.remove(Ro,er)),Qs(es,er=>Cl.append(Ro,er));const Ps=Cl.contents(Ro);Qs(Ps,(er,Bs)=>{Qn.setupItem(yo,er,Co[Bs],Bs)})})},lo=Qn.shell?{behaviours:[Cl.config({})],components:[]}:{behaviours:[],components:Zn},mo=yo=>Qn.shell?ko.some(yo):Au(yo,Qn,"items");return{uid:Qn.uid,dom:Qn.dom,components:lo.components,behaviours:sf(Qn.listBehaviours,lo.behaviours),apis:{setItems:oo}}},o$=Yh({name:JU(),configFields:l6(),partFields:KU(),factory:eZ,apis:{setItems:(Qn,Zn,Yn)=>{Qn.setItems(Zn,Yn)}}}),a2=Mo([Er("dom"),Gs("shell",!0),Nf("toolbarBehaviours",[Cl])]),tZ=Mo([up({name:"groups",overrides:()=>({behaviours:Zr([Cl.config({})])})})]),nZ=(Qn,Zn,Yn,Jn)=>{const oo=(yo,Co)=>{lo(yo).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 n
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 vN=Qn=>Qn.nodeName==="BR"||!!Qn.getAttribute("data-mce-bogus")||Qn.getAttribute("data-mce-type")==="bookmark",X$=(Qn,Zn,Yn)=>{var Jn;const oo=(Jn=Zn.delimiter)!==null&&Jn!==void 0?Jn:"›",lo=(Ro,Lo,Wo)=>yh.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{"data-index":Wo,"aria-level":Wo+1}},components:[wd(Ro)],action:jo=>{Qn.focus(),Qn.selection.select(Lo),Qn.nodeChanged()},buttonBehaviours:Zr([Lf.button(Yn.isDisabled),jf()])}),mo=()=>({dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0}},components:[wd(` ${oo} `)]}),yo=Ro=>za(Ro,(Lo,Wo,jo)=>{const es=lo(Wo.name,Wo.element,jo);return jo===0?Lo.concat([es]):Lo.concat([mo(),es])},[]),Co=Ro=>{const Lo=[];let Wo=Ro.length;for(;Wo-- >0;){const jo=Ro[Wo];if(jo.nodeType===1&&!vN(jo)){const es=cI(Qn,jo);if(es.isDefaultPrevented()||Lo.push({name:es.name,element:jo}),es.isPropagationStopped())break}}return Lo};return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:Zr([Za.config({mode:"flow",selector:"div[role=button]"}),Ja.config({disabled:Yn.isDisabled}),jf(),sd.config({}),Cl.config({}),Rl("elementPathEvents",[eu((Ro,Lo)=>{Qn.shortcuts.add("alt+F11","focus statusbar elementpath",()=>Za.focusIn(Ro)),Qn.on("NodeChange",Wo=>{const jo=Co(Wo.parents),es=jo.length>0?yo(jo):[];Cl.set(Ro,es)})})])]),components:[]}};var rS;(function(Qn){Qn[Qn.None=0]="None",Qn[Qn.Both=1]="Both",Qn[Qn.Vertical=2]="Vertical"})(rS||(rS={}));const UX=(Qn,Zn,Yn,Jn,oo)=>{const lo={height:cT(Jn+Zn.top,Ek(Qn),CR(Qn))};return Yn===rS.Both&&(lo.width=cT(oo+Zn.left,wR(Qn),$A(Qn))),lo},H8=(Qn,Zn,Yn)=>{const Jn=Ds.fromDom(Qn.getContainer()),oo=UX(Qn,Zn,Yn,cu(Jn),dd(Jn));Zl(oo,(lo,mo)=>{$o(lo)&&ya(Jn,mo,Y4(lo))}),aI(Qn)},ZX=Qn=>{const Zn=j5(Qn);return Zn===!1?rS.None:Zn==="both"?rS.Both:rS.Vertical},Y$=(Qn,Zn,Yn,Jn)=>{const lo=vc(Yn*20,Jn*20);return H8(Qn,lo,Zn),ko.some(!0)},tC=(Qn,Zn)=>{const Yn=ZX(Qn);if(Yn===rS.None)return ko.none();const Jn=Yn===rS.Both?"Press the arrow keys to resize the editor.":"Press the Up and Down arrow keys to resize the editor.";return ko.some(s0("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:Zn.translate("Resize"),"aria-label":Zn.translate(Jn)},behaviours:[Jw.config({mode:"mouse",repositionTarget:!1,onDrag:(oo,lo,mo)=>H8(Qn,mo,Yn),blockerClass:"tox-blocker"}),Za.config({mode:"special",onLeft:()=>Y$(Qn,Yn,-1,0),onRight:()=>Y$(Qn,Yn,1,0),onUp:()=>Y$(Qn,Yn,0,-1),onDown:()=>Y$(Qn,Yn,0,1)}),sd.config({}),ol.config({})]},Zn.icons))},Q8=(Qn,Zn)=>{const Yn=(Jn,oo,lo)=>Cl.set(Jn,[wd(Zn.translate(["{0} "+lo,oo[lo]]))]);return yh.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:Zr([Lf.button(Zn.isDisabled),jf(),sd.config({}),Cl.config({}),da.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Rl("wordcount-events",[qh(Jn=>{const oo=da.getValue(Jn),lo=oo.mode==="words"?"characters":"words";da.setValue(Jn,{mode:lo,count:oo.count}),Yn(Jn,oo.count,lo)}),eu(Jn=>{Qn.on("wordCountUpdate",oo=>{const{mode:lo}=da.getValue(Jn);da.setValue(Jn,{mode:lo,count:oo.wordCount}),Yn(Jn,oo.wordCount,lo)})})])]),eventOrder:{[Im()]:["disabling","alloy.base.behaviour","wordcount-events"]}})},qX=(Qn,Zn)=>{const Yn=()=>({dom:{tag:"span",classes:["tox-statusbar__branding"]},components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/powered-by-tiny?utm_campaign=poweredby&utm_source=tiny&utm_medium=referral&utm_content=v6",rel:"noopener",target:"_blank","aria-label":_1.translate(["Powered by {0}","Tiny"])},innerHtml:WX.trim()},behaviours:Zr([ol.config({})])}]}),Jn=()=>{const yo=tP("Alt+0");return{dom:{tag:"div",classes:["tox-statusbar__help-text"]},components:[wd(_1.translate(["Press {0} for help",yo]))]}},oo=()=>{const yo=[];return Qn.hasPlugin("wordcount")&&yo.push(Q8(Qn,Zn)),$R(Qn)&&yo.push(Yn()),{dom:{tag:"div",classes:["tox-statusbar__right-container"]},components:yo}},lo=()=>{const yo=[],Co=IA(Qn),Ro=Ak(Qn),Lo=$R(Qn)||Qn.hasPlugin("wordcount"),Wo=()=>{const jo="tox-statusbar__text-container--flex-start",es="tox-statusbar__text-container--flex-end",us="tox-statusbar__text-container--space-around";if(Co){const Ps="tox-statusbar__text-container-3-cols";return!Lo&&!Ro?[Ps,us]:Lo&&!Ro?[Ps,es]:[Ps,jo]}return[Lo&&!Ro?es:jo]};return Ro&&yo.push(X$(Qn,{},Zn)),Co&&yo.push(Jn()),Lo&&yo.push(oo()),yo.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container",...Wo()]},components:yo}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(()=>{const yo=lo(),Co=tC(Qn,Zn);return yo.concat(Co.toArray())})()}},V8=(Qn,Zn)=>Zn.get().getOrDie(`UI for ${Qn} has not been rendered`),jX=(Qn,Zn)=>{const Yn=Qn.inline,Jn=Yn?U7:Q7,oo=uE(Qn)?C6:rZ,lo=wj(),mo=Hl(),yo=Hl(),Co=Hl(),jo=Tr().deviceType.isTouch()?["tox-platform-touch"]:[],es=MR(Qn),us=Tk(Qn),Ps=ou({dom:{tag:"div",classes:["tox-anchorbar"]}}),er=ou({dom:{tag:"div",classes:["tox-bottom-anchorbar"]}}),Bs=()=>lo.mainUi.get().map(K
Line truncated
|
||||
`+JSON.stringify(Zn,null,2)).message),getBounds:Qn.getDragBounds})])})}),Xh({schema:[Er("dom")],name:"title"}),Xh({factory:yN,schema:[Er("dom")],name:"close"}),Xh({factory:yN,schema:[Er("dom")],name:"body"}),up({factory:yN,schema:[Er("dom")],name:"footer"}),v1({factory:{sketch:(Qn,Zn)=>({...Qn,dom:Zn.dom,components:Zn.components})},schema:[Gs("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Gs("components",[])],name:"blocker"})]),KX=(Qn,Zn,Yn,Jn)=>{const oo=Hl(),lo=es=>{oo.set(es);const us=Qn.lazySink(es).getOrDie(),Ps=Jn.blocker(),er=us.getSystem().build({...Ps,components:Ps.components.concat([Fm(es)]),behaviours:Zr([ol.config({}),Rl("dialog-blocker-events",[rg(Wu(),()=>{uv.isBlocked(es)?xo():Za.focusIn(es)})])])});cy(us,er),Za.focusIn(es)},mo=es=>{oo.clear(),Zd(es.element).each(us=>{es.getSystem().getByDom(us).each(Ps=>{Kb(Ps)})})},yo=es=>Y0(es,Qn,"body"),Co=es=>Au(es,Qn,"footer"),Ro=(es,us)=>{uv.block(es,us)},Lo=es=>{uv.unblock(es)},Wo=ba("modal-events"),jo={...Qn.eventOrder,[Zh()]:[Wo].concat(Qn.eventOrder["alloy.system.attached"]||[])};return{uid:Qn.uid,dom:Qn.dom,components:Zn,apis:{show:lo,hide:mo,getBody:yo,getFooter:Co,setIdle:Lo,setBusy:Ro},eventOrder:jo,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:sf(Qn.modalBehaviours,[Cl.config({}),Za.config({mode:"cyclic",onEnter:Qn.onExecute,onEscape:Qn.onEscape,useTabstopAt:Qn.useTabstopAt,firstTabstop:Qn.firstTabstop}),uv.config({getRoot:oo.get}),Rl(Wo,[eu(es=>{XX(es.element,Y0(es,Qn,"title").element)})])])}},If=Yh({name:"ModalDialog",configFields:YX(),partFields:GX(),factory:KX,apis:{show:(Qn,Zn)=>{Qn.show(Zn)},hide:(Qn,Zn)=>{Qn.hide(Zn)},getBody:(Qn,Zn)=>Qn.getBody(Zn),getFooter:(Qn,Zn)=>Qn.getFooter(Zn),setBusy:(Qn,Zn,Yn)=>{Qn.setBusy(Zn,Yn)},setIdle:(Qn,Zn)=>{Qn.setIdle(Zn)}}}),gT=Ta([wf,KR].concat(Bw)),ON=Jm,v2=[GA("button"),S1,Eh("align","end",["start","end"]),Oy,pb,Ly("buttonType",["primary","secondary"])],iS=[...v2,_O],y2=[hd("type",["submit","cancel","custom"]),...iS],JX=[hd("type",["menu"]),yy,mE,S1,Pf("items",gT),...v2],z8=[...v2,hd("type",["togglebutton"]),hc("tooltip"),S1,yy,Xd("active",!1)],W8=jl("type",{submit:y2,cancel:y2,custom:y2,menu:JX,togglebutton:z8}),U8=[wf,_O,hd("level",["info","warn","error","success"]),JR,Gs("url","")],eY=Ta(U8),tY=Qn=>[wf,Qn],nY=[wf,_O,pb,GA("button"),S1,yL,Ly("buttonType",["primary","secondary","toolbar"]),Oy],Z8=Ta(nY),nC=[wf,KR],_b=nC.concat([XA]),oY=nC.concat([jA,pb]),sY=Ta(oY),rY=Jm,q8=_b.concat([OL("auto")]),iY=Ta(q8),aY=Yp([Nk,_O,JR]),lY=_b.concat([mh("storageKey","default")]),_N=Ta(lY),SN=nf,j8=Ta(_b),cY=nf,uY=nC.concat([mh("tag","textarea"),hc("scriptId"),hc("scriptUrl"),Iy("settings",void 0)]),X8=nC.concat([mh("tag","textarea"),ep("init")]),dY=Rg(Qn=>Lu("customeditor.old",mu(X8),Qn).orThunk(()=>Lu("customeditor.new",mu(uY),Qn))),fY=nf,Y8=Ta(_b),hY=RO(),G$=Qn=>[wf,k0("columns"),Qn],_2=[wf,hc("html"),Eh("presets","presentation",["presentation","document"])],K$=Ta(_2),G8=_b.concat([Xd("border",!1),Xd("sandboxed",!0),Xd("streamContent",!1),Xd("transparent",!0)]),J$=Ta(G8),Sg=nf,e3=Ta(nC.concat([$f("height")])),K8=Ta([hc("url"),Mg("zoom"),Mg("cachedWidth"),Mg("cachedHeight")]),J8=_b.concat([$f("inputMode"),$f("placeholder"),Xd("maximized",!1),pb]),mY=Ta(J8),pY=nf,aS=Qn=>[wf,jA,Qn,Eh("align","start",["start","center","end"])],LG=[_O,Nk],gY=[_O,Pf("items",L1("items",()=>wN))],wN=Oa([Ta(LG),Ta(gY)]),S2=_b.concat([Pf("items",wN),pb]),t3=Ta(S2),eH=nf,bY=_b.concat([Mb("items",[_O,Nk]),Lm("size",1),pb]),vY=Ta(bY),yY=nf,OY=_b.concat([Xd("constrain",!0),pb]),w2=Ta(OY),_Y=Ta([hc("width"),hc("height")]),SY=nC.concat([jA,Lm("min",0),Lm("max",0)]),wY=Ta(SY),IG=w0,CY=[wf,Pf("header",nf),Pf("cells",Xp(nf))],kY=Ta(CY),bT=_b.concat([$f("placeholder"),Xd("maximized",!1),pb]),xY=Ta(bT),EY=nf,CN=[hd("type",["directory","leaf"]),gL,hc("id"),Fd("menu",oT)],TY=Ta(CN),Mn=CN.concat([Pf("children",L1("children",()=>Ir("type",{directory:Vn,leaf:TY})))]),Vn=Ta(Mn),Wn=Ir("type",{directory:Vn,leaf:TY}),jn=[wf,Pf("items",Wn),I1("onLeafAction"),I1("onToggleExpand"),Th("defaultExpandedIds",[],nf),$f("defaultSelectedId")],Gn=Ta(jn),no=_b.concat([Eh("filetype","file",["image","media","file"]),pb,$f("picker_text")]),ao=Ta(no),po=Ta([Nk,pE]),vo=Qn=>Bd("items","items",sc(),Xp(Rg(Zn=>Lu(`Checking item of ${Qn}`,Ao,Zn).fold(Yn=>yl.error(Gf(Yn)),Yn=>yl.value(Yn))))),Ao=mf(()=>Ir("type",{alertbanner:eY,bar:Ta(tY(vo("bar"))),button:Z8,checkbox:sY,colorinput:_N,colorpicker:j8,dropzone:Y8,grid:Ta(G$(vo("grid"))),iframe:J$,input:mY,listbox:t3,selectbox:vY,sizeinput:w2,slider:wY,textarea:xY,urlinput:ao,customeditor:dY,htmlpanel:K$,imagepreview:e3,collection:iY,label:Ta(aS(vo("label"))),table:kY,tree:Gn,panel:Qo})),Fo=[wf,Gs("classes",[]),Pf("items",Ao)],Qo=Ta(Fo),qo=[GA("tab"),gL,Pf("items",Ao)],ds=[wf,Mb("tabs",qo)],bs=Ta(ds),ls=iS,ys=W8,Ls=Ta([hc("title"),Kf("body",Ir("type",{panel:Qo,tabpanel:bs})),mh("size","normal"),Th("buttons",[],ys),Gs("initialData",{}),Hd("onAction",xo),Hd(
Line truncated
|
||||
Actual: `+gu.join(","));if(!dr(Po,Jf=>_r(gu,Jf)))throw new Error("Not all branches were specified when using match. Specified: "+gu.join(", ")+`
|
||||
Required: `+Po.join(", "));return Ac[zr].apply(null,La)},log:Ac=>{console.log(Ac,{constructors:Po,constructor:zr,params:La})}}}}),Xo}}.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])});const Oa=(_o,Po)=>{const Xo=Am.fromTable(_o);return Nu(Xo,Po).bind(Ms=>{const vr=Ms[Ms.length-1],zr=Ms[0].row,Jr=vr.row+vr.rowspan,La=Xo.all.slice(zr,Jr);return Rs(La)}).getOr("")},pf=_o=>ah(_o,"rgb")?fh(_o):_o,$O=_o=>{const Po=qa.fromDom(_o);return{borderwidth:rr(Po,"border-width").getOr(""),borderstyle:rr(Po,"border-style").getOr(""),bordercolor:rr(Po,"border-color").map(pf).getOr(""),backgroundcolor:rr(Po,"background-color").map(pf).getOr("")}},Yp=_o=>{const Po=_o[0],Xo=_o.slice(1);return zo(Xo,as=>{zo(Go(Po),Ms=>{ms(as,(vr,zr)=>{const Jr=Po[Ms];Jr!==""&&Ms===zr&&Jr!==vr&&(Po[Ms]="")})})}),Po},Ad=(_o,Po,Xo,as)=>Sr(_o,Ms=>!Kn(Xo.formatter.matchNode(as,Po+Ms))).getOr(""),Pg=xo(Ad,["left","center","right"],"align"),w0=xo(Ad,["top","middle","bottom"],"valign"),nf=(_o,Po)=>{const Xo=Wp(_o),as=zf(_o),Ms=()=>({borderstyle:gs(Xo,"border-style").getOr(""),bordercolor:pf(gs(Xo,"border-color").getOr("")),backgroundcolor:pf(gs(Xo,"background-color").getOr(""))}),vr={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""},zr=()=>{const Xu=Xo["border-width"];return $m(_o)&&Xu?{border:Xu}:gs(as,"border").fold(()=>({}),Ac=>({border:Ac}))},Jr=Po?Ms():{},La=()=>{const Xu=gs(Xo,"border-spacing").or(gs(as,"cellspacing")).fold(()=>({}),gu=>({cellspacing:gu})),Ac=gs(Xo,"border-padding").or(gs(as,"cellpadding")).fold(()=>({}),gu=>({cellpadding:gu}));return{...Xu,...Ac}};return{...vr,...Xo,...as,...Jr,...zr(),...La()}},Jm=_o=>ta(qa.fromDom(_o)).map(Po=>{const Xo={selection:t1(_o.cells)};return Oa(Po,Xo)}).getOr(""),_v=(_o,Po,Xo)=>{const as=(Jr,La)=>{const Ol=rr(qa.fromDom(La),"border-width");return $m(_o)&&Ol.isSome()?Ol.getOr(""):Jr.getAttrib(La,"border")||uh(_o.dom,La,"border-width")||uh(_o.dom,La,"border")||""},Ms=_o.dom,vr=$m(_o)?Ms.getStyle(Po,"border-spacing")||Ms.getAttrib(Po,"cellspacing"):Ms.getAttrib(Po,"cellspacing")||Ms.getStyle(Po,"border-spacing"),zr=$m(_o)?uh(Ms,Po,"padding")||Ms.getAttrib(Po,"cellpadding"):Ms.getAttrib(Po,"cellpadding")||uh(Ms,Po,"padding");return{width:Ms.getStyle(Po,"width")||Ms.getAttrib(Po,"width"),height:Ms.getStyle(Po,"height")||Ms.getAttrib(Po,"height"),cellspacing:vr??"",cellpadding:zr??"",border:as(Ms,Po),caption:!!Ms.select("caption",Po)[0],class:Ms.getAttrib(Po,"class",""),align:Pg(_o,Po),...Xo?$O(Po):{}}},Gp=(_o,Po,Xo)=>{const as=_o.dom;return{height:as.getStyle(Po,"height")||as.getAttrib(Po,"height"),class:as.getAttrib(Po,"class",""),type:Jm(Po),align:Pg(_o,Po),...Xo?$O(Po):{}}},Sv=(_o,Po,Xo,as)=>{const Ms=_o.dom,vr=as.getOr(Po),zr=(Jr,La)=>Ms.getStyle(Jr,La)||Ms.getAttrib(Jr,La);return{width:zr(vr,"width"),height:zr(Po,"height"),scope:Ms.getAttrib(Po,"scope"),celltype:nm(Po),class:Ms.getAttrib(Po,"class",""),halign:Pg(_o,Po),valign:w0(_o,Po),...Xo?$O(Po):{}}},$g=(_o,Po)=>{const Xo=Am.fromTable(_o),as=Am.justCells(Xo),Ms=Ca(as,vr=>ha(Po,zr=>Al(vr.element,zr)));return Qs(Ms,vr=>({element:vr.element.dom,column:Am.getColumnAt(Xo,vr.column).map(zr=>zr.element.dom)}))},Ir=(_o,Po,Xo,as)=>{as("scope")&&_o.setAttrib("scope",Xo.scope),as("class")&&_o.setAttrib("class",Xo.class),as("height")&&_o.setStyle("height",oc(Xo.height)),as("width")&&Po.setStyle("width",oc(Xo.width))},RO=(_o,Po,Xo)=>{Xo("backgroundcolor")&&_o.setFormat("tablecellbackgroundcolor",Po.backgroundcolor),Xo("bordercolor")&&_o.setFormat("tablecellbordercolor",Po.bordercolor),Xo("borderstyle")&&_o.setFormat("tablecellborderstyle",Po.borderstyle),Xo("borderwidth")&&_o.setFormat("tablecellborderwidth",oc(Po.borderwidth))},Rg=(_o,Po,Xo,as)=>{const Ms=Po.length===1;zo(Po,vr=>{const zr=vr.element,Jr=Ms?Jo:as,La=Mm.normal(_o,zr),Ol=vr.column.map(Xu=>Mm.normal(_o,Xu)).getOr(La);Ir(La,Ol,Xo,Jr),Ab(_o)&&RO(La,Xo,Jr),as("halign")&&Hh(_o,zr,Xo.halign),as("valign")&&A1(_o,zr,Xo.valign)})},Dg=(_o,Po)=>{_o.execCommand("mceTableCellType",!1,{type:Po.celltype,no_events:!0})},Nm=(_o,Po,Xo,as)=>{const Ms=Ys(as,(vr,zr)=>Xo[zr]!==vr);ko(Ms)>0&&Po.length>=1&&ta(Po[0]).each(vr=>{const zr=$g(vr,Po),Jr=ko(Ys(Ms,(Ol,Xu)=>Xu!=="scope"&&Xu!=="celltype"))>0,La=xs(Ms,"celltype");(Jr||xs(Ms,"scope"))&&Rg(_o,zr,as,xo(xs,Ms)),La&&Dg(_o,as),ql(_o,vr.dom,{structure:La,style:Jr})})},Lu=(_o,Po,Xo,as)=>{const Ms=as.getData();as.close(),_o.undoManager.transact(()=>{Nm(_o,Po,Xo,Ms),_o.focus()})},Ec=(_o,Po)=>{const Xo=ta(Po[0]).map(as=>Qs($g(as,Po),Ms=>Sv(_o,Ms.element,Ab(_o),Ms.column)));return Yp(Xo.getOrDie())},td=_o=>{const Po=uf(_o);if(Po.length===0)return;const Xo=Ec(_o,Po),as={type:"tabpanel",tabs:[{title:"General",name:"general",items:Ov(_o)},Db(_o,"cell")]},Ms={type:"panel",items:[{type:"grid",columns:2,items:Ov(_o)}]};_o.windowManager.open({title:"Cell Properties",size:"normal",body:Ab(_o)?as:Ms,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",nam
Line truncated
|
||||
`),ws)}),Qr.innerHTML=gs.encode((cr=Qr.textContent)!==null&&cr!==void 0?cr:""),Oo(ko).highlightElement(Qr),gs.setAttrib(Qr,"data-mce-highlighted",!0),Qr.className=os(Qr.className)})})}),ko.on("PreInit",()=>{ko.parser.addNodeFilter("pre",gs=>{var xs;for(let Qr=0,cr=gs.length;Qr<cr;Qr++){const ws=gs[Qr];((xs=ws.attr("class"))!==null&&xs!==void 0?xs:"").indexOf("language-")!==-1&&(ws.attr("contenteditable","false"),ws.attr("data-mce-highlighted","false"))}})})},Yo=(ko,gs=$n)=>xs=>{const Qr=()=>{xs.setEnabled(ko.selection.isEditable()),gs(xs)};return ko.on("NodeChange",Qr),Qr(),()=>{ko.off("NodeChange",Qr)}},Ys=ko=>{const gs=ko.selection.getStart();return ko.dom.is(gs,'pre[class*="language-"]')},sr=ko=>{const gs=()=>ko.execCommand("codesample");ko.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:gs,onSetup:Yo(ko,xs=>{xs.setActive(Ys(ko))})}),ko.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:gs,onSetup:Yo(ko)})};var Js=()=>{_n.add("codesample",ko=>{uo(ko),is(ko),sr(ko),Mo(ko),ko.on("dblclick",gs=>{So(gs.target)&&Jo(ko)})})};Js()})();(function(){var _n=tinymce.util.Tools.resolve("tinymce.PluginManager");const Ce=(Ts,ks,ir)=>{var br;return ir(Ts,ks.prototype)?!0:((br=Ts.constructor)===null||br===void 0?void 0:br.name)===ks.name},ke=Ts=>{const ks=typeof Ts;return Ts===null?"null":ks==="object"&&Array.isArray(Ts)?"array":ks==="object"&&Ce(Ts,String,(ir,br)=>br.isPrototypeOf(ir))?"string":ks},$n=Ts=>ks=>ke(ks)===Ts,Hn=$n("string"),zn=$n("object"),Un=$n("array"),qn=Ts=>Ts==null,Xn=Ts=>!qn(Ts);class Kn{constructor(ks,ir){this.tag=ks,this.value=ir}static some(ks){return new Kn(!0,ks)}static none(){return Kn.singletonNone}fold(ks,ir){return this.tag?ir(this.value):ks()}isSome(){return this.tag}isNone(){return!this.tag}map(ks){return this.tag?Kn.some(ks(this.value)):Kn.none()}bind(ks){return this.tag?ks(this.value):Kn.none()}exists(ks){return this.tag&&ks(this.value)}forall(ks){return!this.tag||ks(this.value)}filter(ks){return!this.tag||ks(this.value)?this:Kn.none()}getOr(ks){return this.tag?this.value:ks}or(ks){return this.tag?this:ks}getOrThunk(ks){return this.tag?this.value:ks()}orThunk(ks){return this.tag?this:ks()}getOrDie(ks){if(this.tag)return this.value;throw new Error(ks??"Called getOrDie on None")}static from(ks){return Xn(ks)?Kn.some(ks):Kn.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(ks){this.tag&&ks(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Kn.singletonNone=new Kn(!1);const to=Array.prototype.push,io=(Ts,ks)=>{for(let ir=0,br=Ts.length;ir<br;ir++){const Aa=Ts[ir];ks(Aa,ir)}},uo=Ts=>{const ks=[];for(let ir=0,br=Ts.length;ir<br;++ir){if(!Un(Ts[ir]))throw new Error("Arr.flatten item "+ir+" was not an array, input: "+Ts);to.apply(ks,Ts[ir])}return ks},ho=Ts=>{let ks=Ts;return{get:()=>ks,set:Aa=>{ks=Aa}}},bo=Object.keys,Oo=Object.hasOwnProperty,So=(Ts,ks)=>{const ir=bo(Ts);for(let br=0,Aa=ir.length;br<Aa;br++){const Ba=ir[br],_l=Ts[Ba];ks(_l,Ba)}},$o=(Ts,ks)=>Do(Ts,ks)?Kn.from(Ts[ks]):Kn.none(),Do=(Ts,ks)=>Oo.call(Ts,ks),xo=Ts=>ks=>ks.options.get(Ts),Io=Ts=>{const ks=Ts.options.register;ks("audio_template_callback",{processor:"function"}),ks("video_template_callback",{processor:"function"}),ks("iframe_template_callback",{processor:"function"}),ks("media_live_embeds",{processor:"boolean",default:!0}),ks("media_filter_html",{processor:"boolean",default:!0}),ks("media_url_resolver",{processor:"function"}),ks("media_alt_source",{processor:"boolean",default:!0}),ks("media_poster",{processor:"boolean",default:!0}),ks("media_dimensions",{processor:"boolean",default:!0})},Vo=xo("audio_template_callback"),Jo=xo("video_template_callback"),Mo=xo("iframe_template_callback"),Go=xo("media_live_embeds"),os=xo("media_filter_html"),ms=xo("media_url_resolver"),is=xo("media_alt_source"),Yo=xo("media_poster"),Ys=xo("media_dimensions");var sr=tinymce.util.Tools.resolve("tinymce.util.Tools"),Js=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),ko=tinymce.util.Tools.resolve("tinymce.html.DomParser");const gs=Js.DOM,xs=Ts=>Ts.replace(/px$/,""),Qr=Ts=>{const ks=Ts.attr("style"),ir=ks?gs.parseStyle(ks):{};return{type:"ephox-embed-iri",source:Ts.attr("data-ephox-embed-iri"),altsource:"",poster:"",width:$o(ir,"max-width").map(xs).getOr(""),height:$o(ir,"max-height").map(xs).getOr("")}},cr=(Ts,ks)=>{let ir={};const Aa=ko({validate:!1,forced_root_block:!1},ks).parse(Ts);for(let Ba=Aa;Ba;Ba=Ba.walk())if(Ba.type===1){const _l=Ba.name;if(Ba.attr("data-ephox-embed-iri")){ir=Qr(Ba);break}else!ir.source&&_l==="param"&&(ir.source=Ba.attr("movie")),(_l==="iframe"||_l==="object"||_l==="embed"||_l==="video"||_l==="audio")&&(ir.type||(ir.type=_l),ir=sr.extend(Ba.attributes.map,ir)),_l==="source"&&(ir.source?ir.altsource||(ir.altsource=Ba.attr("src")):ir.source=Ba.attr("src")),_l==="img"&&!ir.poster&&(ir.poster=Ba.attr("src"))}return ir.source=
Line truncated
|
||||
<source src="`+Ts.altsource+'"'+(Ts.altsourcemime?' type="'+Ts.altsourcemime+'"':"")+` />
|
||||
`:"")+"</audio>",fs=(Ts,ks)=>ks?ks(Ts):'<video width="'+Ts.width+'" height="'+Ts.height+'"'+(Ts.poster?' poster="'+Ts.poster+'"':"")+` controls="controls">
|
||||
<source src="`+Ts.source+'"'+(Ts.sourcemime?' type="'+Ts.sourcemime+'"':"")+` />
|
||||
`+(Ts.altsource?'<source src="'+Ts.altsource+'"'+(Ts.altsourcemime?' type="'+Ts.altsourcemime+'"':"")+` />
|
||||
`:"")+"</video>",dr=(Ts,ks)=>{var ir;const br=sr.extend({},ks);if(!br.source&&(sr.extend(br,cr((ir=br.embed)!==null&&ir!==void 0?ir:"",Ts.schema)),!br.source))return"";br.altsource||(br.altsource=""),br.poster||(br.poster=""),br.source=Ts.convertURL(br.source,"source"),br.altsource=Ts.convertURL(br.altsource,"source"),br.sourcemime=ws(br.source),br.altsourcemime=ws(br.altsource),br.poster=Ts.convertURL(br.poster,"poster");const Aa=Il(br.source);if(Aa&&(br.source=Aa.url,br.type=Aa.type,br.allowfullscreen=Aa.allowFullscreen,br.width=br.width||String(Aa.w),br.height=br.height||String(Aa.h)),br.embed)return el(br.embed,br,!0,Ts.schema);{const Ba=Vo(Ts),_l=Jo(Ts),Hc=Mo(Ts);return br.width=br.width||"300",br.height=br.height||"150",sr.each(br,(Ds,tl)=>{br[tl]=Ts.dom.encode(""+Ds)}),br.type==="iframe"?Zs(br,Hc):br.sourcemime==="application/x-shockwave-flash"?Sr(br):br.sourcemime.indexOf("audio")!==-1?Us(br,Ba):fs(br,_l)}},Vr=Ts=>Ts.hasAttribute("data-mce-object")||Ts.hasAttribute("data-ephox-embed-iri"),nr=Ts=>{Ts.on("click keyup touchend",()=>{const ks=Ts.selection.getNode();ks&&Ts.dom.hasClass(ks,"mce-preview-object")&&Ts.dom.getAttrib(ks,"data-mce-selected")&&ks.setAttribute("data-mce-selected","2")}),Ts.on("ObjectResized",ks=>{const ir=ks.target;if(ir.getAttribute("data-mce-object")){let br=ir.getAttribute("data-mce-html");br&&(br=unescape(br),ir.setAttribute("data-mce-html",escape(el(br,{width:String(ks.width),height:String(ks.height)},!1,Ts.schema))))}})},Kr={},ra=(Ts,ks,ir)=>new Promise((br,Aa)=>{const Ba=_l=>(_l.html&&(Kr[Ts.source]=_l),br({url:Ts.source,html:_l.html?_l.html:ks(Ts)}));Kr[Ts.source]?Ba(Kr[Ts.source]):ir({url:Ts.source},Ba,Aa)}),Ml=(Ts,ks)=>Promise.resolve({html:ks(Ts),url:Ts.source}),xa=Ts=>ks=>dr(Ts,ks),Nl=(Ts,ks)=>{const ir=ms(Ts);return ir?ra(ks,xa(Ts),ir):Ml(ks,xa(Ts))},Zc=Ts=>Do(Kr,Ts),cc=(Ts,ks)=>$o(ks,Ts).bind(ir=>$o(ir,"meta")),gc=(Ts,ks,ir)=>br=>{const Aa=()=>$o(Ts,br),Ba=()=>$o(ks,br),_l=tl=>$o(tl,"value").bind(wu=>wu.length>0?Kn.some(wu):Kn.none()),Hc=()=>Aa().bind(tl=>zn(tl)?_l(tl).orThunk(Ba):Ba().orThunk(()=>Kn.from(tl))),Ds=()=>Ba().orThunk(()=>Aa().bind(tl=>zn(tl)?_l(tl):Kn.from(tl)));return{[br]:(br===ir?Hc():Ds()).getOr("")}},nc=(Ts,ks)=>{const ir={};return $o(Ts,"dimensions").each(br=>{io(["width","height"],Aa=>{$o(ks,Aa).orThunk(()=>$o(br,Aa)).each(Ba=>ir[Aa]=Ba)})}),ir},Ed=(Ts,ks)=>{const ir=ks&&ks!=="dimensions"?cc(ks,Ts).getOr({}):{},br=gc(Ts,ir,ks);return{...br("source"),...br("altsource"),...br("poster"),...br("embed"),...nc(Ts,ir)}},Zl=Ts=>{const ks={...Ts,source:{value:$o(Ts,"source").getOr("")},altsource:{value:$o(Ts,"altsource").getOr("")},poster:{value:$o(Ts,"poster").getOr("")}};return io(["width","height"],ir=>{$o(Ts,ir).each(br=>{const Aa=ks.dimensions||{};Aa[ir]=br,ks.dimensions=Aa})}),ks},Vl=Ts=>ks=>{const ir=ks&&ks.msg?"Media embed handler error: "+ks.msg:"Media embed handler threw unknown error.";Ts.notificationManager.open({type:"error",text:ir})},Fc=Ts=>{const ks=Ts.selection.getNode(),ir=Vr(ks)?Ts.serializer.serialize(ks,{selection:!0}):"",br=cr(ir,Ts.schema),Ba=(()=>{if(Yl(br.source,br.type)){const _l=Ts.dom.getRect(ks);return{width:_l.w.toString().replace(/px$/,""),height:_l.h.toString().replace(/px$/,"")}}else return{}})();return{embed:ir,...br,...Ba}},qa=(Ts,ks)=>ir=>{if(Hn(ir.url)&&ir.url.trim().length>0){const br=ir.html,Ba={...cr(br,ks.schema),source:ir.url,embed:br};Ts.setData(Zl(Ba))}},Ya=(Ts,ks)=>{const ir=Ts.dom.select("*[data-mce-object]");for(let br=0;br<ks.length;br++)for(let Aa=ir.length-1;Aa>=0;Aa--)ks[br]===ir[Aa]&&ir.splice(Aa,1);Ts.selection.select(ir[0])},kc=(Ts,ks)=>{const ir=Ts.dom.select("*[data-mce-object]");Ts.insertContent(ks),Ya(Ts,ir),Ts.nodeChanged()},Yl=(Ts,ks)=>Xn(ks)&&ks==="ephox-embed-iri"&&Xn(Il(Ts)),rd=(Ts,ks)=>((br,Aa)=>br.width!==Aa.width||br.height!==Aa.height)(Ts,ks)&&Yl(ks.source,Ts.type),Al=(Ts,ks,ir)=>{var br;ks.embed=rd(Ts,ks)&&Ys(ir)?dr(ir,{...ks,embed:""}):el((br=ks.embed)!==null&&br!==void 0?br:"",ks,!1,ir.schema),ks.embed&&(Ts.source===ks.source||Zc(ks.source))?kc(ir,ks.embed):Nl(ir,ks).then(Aa=>{kc(ir,Aa.html)}).catch(Vl(ir))},gd=Ts=>{const ks=Fc(Ts),ir=ho(ks),br=Zl(ks),Aa=(ld,oc)=>{const Dc=Ed(oc.getData(),"source");ld.source!==Dc.source&&(qa(Ud,Ts)({url:Dc.source,html:""}),Nl(Ts,Dc).then(qa(Ud,Ts)).catch(Vl(Ts)))},Ba=ld=>{var oc;const Dc=Ed(ld.getData()),bd=cr((oc=Dc.embed)!==null&&oc!==void 0?oc:"",Ts.schema);ld.setData(Zl(bd))},_l=(ld,oc,Dc)=>{const bd=Ed(ld.getData(),oc),Nd=rd(Dc,bd)&&Ys(Ts)?{...bd,embed:""}:bd,ih=dr(Ts,Nd);ld.setData(Zl({...Nd,embed:ih}))},Hc=[{name:"source",type:"urlinput",filetype:"media",label:"Source",picker_text:"Browse files"}],Ds=Ys(Ts)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],tl={title:"General",name:"general",items:uo([Hc,Ds])},qu={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},Md=[];is(Ts)&&Md.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),Yo(
Line truncated
|
||||
`));return Yo(Us.split(""),$n).length},Qr=(Zs,Sr)=>{const Us=Js(Zs,Sr).join("");return gs(Us)},cr=(Zs,Sr)=>{const Us=Js(Zs,Sr).join("").replace(/\s/g,"");return gs(Us)},ws=(Zs,Sr)=>()=>Sr(Zs.getBody(),Zs.schema),Fs=(Zs,Sr)=>()=>Sr(Zs.selection.getRng().cloneContents(),Zs.schema),Br=Zs=>ws(Zs,xs),_r=Zs=>({body:{getWordCount:Br(Zs),getCharacterCount:ws(Zs,Qr),getCharacterCountWithoutSpaces:ws(Zs,cr)},selection:{getWordCount:Fs(Zs,xs),getCharacterCount:Fs(Zs,Qr),getCharacterCountWithoutSpaces:Fs(Zs,cr)},getCount:Br(Zs)}),ha=(Zs,Sr)=>{Zs.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(Sr.body.getWordCount()),String(Sr.selection.getWordCount())],["Characters (no spaces)",String(Sr.body.getCharacterCountWithoutSpaces()),String(Sr.selection.getCharacterCountWithoutSpaces())],["Characters",String(Sr.body.getCharacterCount()),String(Sr.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})},hs=(Zs,Sr)=>{Zs.addCommand("mceWordCount",()=>ha(Zs,Sr))},Qs=(Zs,Sr)=>{let Us=null;return{cancel:()=>{ke(Us)||(clearTimeout(Us),Us=null)},throttle:(...Vr)=>{ke(Us)&&(Us=setTimeout(()=>{Us=null,Zs.apply(null,Vr)},Sr))}}};var zo=tinymce.util.Tools.resolve("tinymce.util.Delay");const el=(Zs,Sr)=>{Zs.dispatch("wordCountUpdate",{wordCount:{words:Sr.body.getWordCount(),characters:Sr.body.getCharacterCount(),charactersWithoutSpaces:Sr.body.getCharacterCountWithoutSpaces()}})},ga=(Zs,Sr)=>{el(Zs,Sr)},Ca=(Zs,Sr,Us)=>{const fs=Qs(()=>ga(Zs,Sr),Us);Zs.on("init",()=>{ga(Zs,Sr),zo.setEditorTimeout(Zs,()=>{Zs.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",fs.throttle)},0),Zs.on("remove",fs.cancel)})},za=Zs=>{const Sr=()=>Zs.execCommand("mceWordCount");Zs.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:Sr}),Zs.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:Sr})};var Il=(Zs=300)=>{_n.add("wordcount",Sr=>{const Us=_r(Sr);return hs(Sr,Us),za(Sr),Ca(Sr,Us,Zs),Us})};Il()})();function get_each_context$8(_n,Ce,ke){const $n=_n.slice();return $n[14]=Ce[ke],$n}function get_each_context_1$2(_n,Ce,ke){const $n=_n.slice();return $n[17]=Ce[ke],$n}function create_else_block$7(_n){let Ce,ke;return Ce=new Dropdown({props:{$$slots:{button:[create_button_slot$1],default:[create_default_slot$1]},$$scope:{ctx:_n}}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&1048576&&(zn.$$scope={dirty:Hn,ctx:$n}),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_if_block_1$a(_n){let Ce,ke,$n;return{c(){Ce=element("button"),Ce.textContent="Browse",attr(Ce,"class","button")},m(Hn,zn){insert$1(Hn,Ce,zn),ke||($n=listen(Ce,"click",_n[9]),ke=!0)},p:noop,i:noop,o:noop,d(Hn){Hn&&detach(Ce),ke=!1,$n()}}}function create_each_block_1$2(_n){let Ce,ke,$n;function Hn(...zn){return _n[10](_n[17],...zn)}return{c(){Ce=element("a"),Ce.textContent=`${_n[17].label}`,attr(Ce,"class","dropdown-item"),attr(Ce,"href","/")},m(zn,Un){insert$1(zn,Ce,Un),ke||($n=listen(Ce,"click",Hn),ke=!0)},p(zn,Un){_n=zn},d(zn){zn&&detach(Ce),ke=!1,$n()}}}function create_default_slot$1(_n){let Ce,ke=ensure_array_like(_n[3]),$n=[];for(let Hn=0;Hn<ke.length;Hn+=1)$n[Hn]=create_each_block_1$2(get_each_context_1$2(_n,ke,Hn));return{c(){for(let Hn=0;Hn<$n.length;Hn+=1)$n[Hn].c();Ce=empty$1()},m(Hn,zn){for(let Un=0;Un<$n.length;Un+=1)$n[Un]&&$n[Un].m(Hn,zn);insert$1(Hn,Ce,zn)},p(Hn,zn){if(zn&40){ke=ensure_array_like(Hn[3]);let Un;for(Un=0;Un<ke.length;Un+=1){const qn=get_each_context_1$2(Hn,ke,Un);$n[Un]?$n[Un].p(qn,zn):($n[Un]=create_each_block_1$2(qn),$n[Un].c(),$n[Un].m(Ce.parentNode,Ce))}for(;Un<$n.length;Un+=1)$n[Un].d(1);$n.length=ke.length}},d(Hn){Hn&&detach(Ce),destroy_each($n,Hn)}}}function create_button_slot$1(_n){let Ce;return{c(){Ce=element("div"),Ce.textContent="Browse",attr(Ce,"slot","button")},m(ke,$n){insert$1(ke,Ce,$n)},p:noop,d(ke){ke&&detach(Ce)}}}function create_if_block$e(_n){let Ce=[],ke=new Map,$n,Hn,zn=ensure_array_like(_n[2]);const Un=qn=>qn[14].id;for(let qn=0;qn<zn.length;qn+=1){let Xn=get_each_context$8(_n,zn,qn),Kn=Un(Xn);ke.set(Kn,Ce[qn]=create_each_block$8(Kn,Xn))}return{c(){for(let qn=0;qn<Ce.length;qn+=1)Ce[qn].c();$n=empty$1()},m(qn,Xn){for(let Kn=0;Kn<Ce.length;Kn+=1)Ce[Kn]&&Ce[Kn].m(qn,Xn);insert$1(qn,$n,Xn),Hn=!0},p(qn,Xn){Xn&20&&(zn=ensure_array_like(qn[2]),group_outros(),Ce=update_keyed_each(Ce,Xn,Un,1,qn,zn,ke,$n.parentNode,outro_and_destroy_block,create_each_block$8,$n,get_each_context$8),check_outros())},i(qn){if(!Hn){for(let Xn=0;Xn<zn.length;Xn+=1)transition_in(Ce[Xn]);Hn=!0}},o(qn){for(let Xn=0;Xn<Ce.length;Xn+=1)transition_out(Ce[Xn]);Hn=!1},d(qn){qn&&detach($n);for(let Xn=0;Xn<Ce.length;Xn+=1)Ce[Xn].d(qn)}}}function create_each_block$8(_n,Ce){let ke,$n,Hn,zn;return $n=new PreviewFile({p
Line truncated
|
||||
`},W={bold:{tagName:"strong",inheritable:!0,parser(_n){const Ce=window.getComputedStyle(_n);return Ce.fontWeight==="bold"||Ce.fontWeight>=600}},italic:{tagName:"em",inheritable:!0,parser:_n=>window.getComputedStyle(_n).fontStyle==="italic"},href:{groupTagName:"a",parser(_n){const Ce="a:not(".concat(e,")"),ke=_n.closest(Ce);if(ke)return ke.getAttribute("href")}},strike:{tagName:"del",inheritable:!0},frozen:{style:{backgroundColor:"highlight"}}},U={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(l.bold,'" tabindex="-1">').concat(l.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(l.italic,'" tabindex="-1">').concat(l.italic,`</button>
|
||||
<button type="button" class="trix-button trix-button--icon trix-button--icon-strike" data-trix-attribute="strike" title="`).concat(l.strike,'" tabindex="-1">').concat(l.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(l.link,'" tabindex="-1">').concat(l.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(l.heading1,'" tabindex="-1">').concat(l.heading1,`</button>
|
||||
<button type="button" class="trix-button trix-button--icon trix-button--icon-quote" data-trix-attribute="quote" title="`).concat(l.quote,'" tabindex="-1">').concat(l.quote,`</button>
|
||||
<button type="button" class="trix-button trix-button--icon trix-button--icon-code" data-trix-attribute="code" title="`).concat(l.code,'" tabindex="-1">').concat(l.code,`</button>
|
||||
<button type="button" class="trix-button trix-button--icon trix-button--icon-bullet-list" data-trix-attribute="bullet" title="`).concat(l.bullets,'" tabindex="-1">').concat(l.bullets,`</button>
|
||||
<button type="button" class="trix-button trix-button--icon trix-button--icon-number-list" data-trix-attribute="number" title="`).concat(l.numbers,'" tabindex="-1">').concat(l.numbers,`</button>
|
||||
<button type="button" class="trix-button trix-button--icon trix-button--icon-decrease-nesting-level" data-trix-action="decreaseNestingLevel" title="`).concat(l.outdent,'" tabindex="-1">').concat(l.outdent,`</button>
|
||||
<button type="button" class="trix-button trix-button--icon trix-button--icon-increase-nesting-level" data-trix-action="increaseNestingLevel" title="`).concat(l.indent,'" tabindex="-1">').concat(l.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(l.attachFiles,'" tabindex="-1">').concat(l.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(l.undo,'" tabindex="-1">').concat(l.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(l.redo,'" tabindex="-1">').concat(l.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(l.urlPlaceholder,'" aria-label="').concat(l.url,`" required data-trix-input>
|
||||
<div class="trix-button-group">
|
||||
<input type="button" class="trix-button trix-button--dialog" value="`).concat(l.link,`" data-trix-method="setAttribute">
|
||||
<input type="button" class="trix-button trix-button--dialog" value="`).concat(l.unlink,`" data-trix-method="removeAttribute">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`)};const q={interval:5e3};var V=Object.freeze({__proto__:null,attachments:i$1,blockAttributes:n,browser:a,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"},fileSize:u,input:M,keyNames:{8:"backspace",9:"tab",13:"return",27:"escape",37:"left",39:"right",46:"delete",68:"d",72:"h",79:"o"},lang:l,parser:j,textAttributes:W,toolbar:U,undo:q});class H{static proxyMethod(Ce){const{name:ke,toMethod:$n,toProperty:Hn,optional:zn}=z(Ce);this.prototype[ke]=function(){let Un,qn;var Xn,Kn;return $n?qn=zn?(Xn=this[$n])===null||Xn===void 0?void 0:Xn.call(this):this[$n]():Hn&&(qn=this[Hn]),zn?(Un=(Kn=qn)===null||Kn===void 0?void 0:Kn[ke],Un?_.call(Un,qn,arguments):void 0):(Un=qn[ke],_.call(Un,qn,arguments))}}}const z=function(_n){const Ce=_n.match(J);if(!Ce)throw new Error("can't parse @proxyMethod expression: ".concat(_n));const ke={name:Ce[4]};return Ce[2]!=null?ke.toMethod=Ce[1]:ke.toProperty=Ce[1],Ce[3]!=null&&(ke.optional=!0),ke},{apply:_}=Function.prototype,J=new RegExp("^(.+?)(\\(\\))?(\\?)?\\.(.+?)$");var K,G,$;class X extends H{static box(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return Ce instanceof this?Ce:this.fromUCS2String(Ce==null?void 0:Ce.toString())}static fromUCS2String(Ce){return new this(Ce,tt(Ce))}static fromCodepoints(Ce){return new this(et(Ce),Ce)}constructor(Ce,ke){super(...arguments),this.ucs2String=Ce,this.codepoints=ke,this.length=this.codepoints.length,this.ucs2Length=this.ucs2String.length}offsetToUCS2Offset(Ce){return et(this.codepoints.slice(0,Math.max(0,Ce))).length}offsetFromUCS2Offset(Ce){return tt(this.ucs2String.slice(0,Math.max(0,Ce))).length}slice(){return this.constructor.fromCodepoints(this.codepoints.slice(...arguments))}charAt(Ce){return this.slice(Ce,Ce+1)}isEqualTo(Ce){return this.constructor.box(Ce).ucs2String===this.ucs2String}toJSON(){return this.ucs2String}getCacheKey(){return this.ucs2String}toString(){return this.ucs2String}}const Y=((K=Array.from)===null||K===void 0?void 0:K.call(Array,"👼").length)===1,Q=((G=" ".codePointAt)===null||G===void 0?void 0:G.call(" ",0))!=null,Z=(($=String.fromCodePoint)===null||$===void 0?void 0:$.call(String,32,128124))===" 👼";let tt,et;tt=Y&&Q?_n=>Array.from(_n).map(Ce=>Ce.codePointAt(0)):function(_n){const Ce=[];let ke=0;const{length:$n}=_n;for(;ke<$n;){let Hn=_n.charCodeAt(ke++);if(55296<=Hn&&Hn<=56319&&ke<$n){const zn=_n.charCodeAt(ke++);(64512&zn)==56320?Hn=((1023&Hn)<<10)+(1023&zn)+65536:ke--}Ce.push(Hn)}return Ce},et=Z?_n=>String.fromCodePoint(...Array.from(_n||[])):function(_n){return(()=>{const Ce=[];return Array.from(_n).forEach(ke=>{let $n="";ke>65535&&(ke-=65536,$n+=String.fromCharCode(ke>>>10&1023|55296),ke=56320|1023&ke),Ce.push($n+String.fromCharCode(ke))}),Ce})().join("")};let it=0;class nt extends H{static fromJSONString(Ce){return this.fromJSON(JSON.parse(Ce))}constructor(){super(...arguments),this.id=++it}hasSameConstructorAs(Ce){return this.constructor===(Ce==null?void 0:Ce.constructor)}isEqualTo(Ce){return this===Ce}inspect(){const Ce=[],ke=this.contentsForInspection()||{};for(const $n in ke){const Hn=ke[$n];Ce.push("".concat($n,"=").concat(Hn))}return"#<".concat(this.constructor.name,":").concat(this.id).concat(Ce.length?" ".concat(Ce.join(", ")):"",">")}contentsForInspection(){}toJSONString(){return JSON.stringify(this)}toUTF16String(){return X.box(this)}getCacheKey(){return this.id.toString()}}const rt=function(){let _n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(_n.length!==Ce.length)return!1;for(let ke=0;ke<_n.length;ke++)if(_n[ke]!==Ce[ke])return!1;return!0},ot=function(_n){const Ce=_n.slice(0);for(var ke=arguments.length,$n=new Array(ke>1?ke-1:0),Hn=1;Hn<ke;Hn++)$n[Hn-1]=arguments[Hn];return Ce.splice(...$n),Ce},st=/[\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]/,at=function(){const _n=S$1("input",{dir:"auto",name:"x",dirName:"x.dir"}),Ce=S$1("textarea",{dir:"auto",name:"y",dirName:"y.dir"}),ke=S$1("form");ke.appendChild(_n),ke.appendChild(Ce);const $n=function(){try{return new FormData(ke).has(Ce.dirName)}catch{return!1}}(),Hn=function(){try{return _n.matches(":dir(ltr),:dir(rtl)")}catch{return!1}}();return $n?function(zn){return Ce.value=zn,new FormData(ke).get(Ce.dirName)}:Hn?function(zn){return _n.value=zn,_n.matches(":dir(rtl)")?"rtl":"ltr"}:functionLine truncated
|
||||
`);for(let Hn=0;Hn<$n.length;Hn++){const zn=$n[Hn];if(Hn>0){const Un=S$1("br");ke.push(Un)}if(zn.length){const Un=document.createTextNode(this.preserveSpaces(zn));ke.push(Un)}}return ke}}createElement(){let Ce,ke,$n;const Hn={};for(ke in this.attributes){$n=this.attributes[ke];const Un=pt(ke);if(Un){if(Un.tagName){var zn;const qn=S$1(Un.tagName);zn?(zn.appendChild(qn),zn=qn):Ce=zn=qn}if(Un.styleProperty&&(Hn[Un.styleProperty]=$n),Un.style)for(ke in Un.style)$n=Un.style[ke],Hn[ke]=$n}}if(Object.keys(Hn).length)for(ke in Ce||(Ce=S$1("span")),Hn)$n=Hn[ke],Ce.style[ke]=$n;return Ce}createContainerElement(){for(const Ce in this.attributes){const ke=this.attributes[Ce],$n=pt(Ce);if($n&&$n.groupTagName){const Hn={};return Hn[Ce]=ke,S$1($n.groupTagName,Hn)}}}preserveSpaces(Ce){return this.context.isLast&&(Ce=Ce.replace(/\ $/,d)),Ce=Ce.replace(/(\S)\ {3}(\S)/g,"$1 ".concat(d," $2")).replace(/\ {2}/g,"".concat(d," ")).replace(/\ {2}/g," ".concat(d)),(this.context.isFirst||this.context.followsWhitespace)&&(Ce=Ce.replace(/^\ /,d)),Ce}}class me extends ee{constructor(){super(...arguments),this.text=this.object,this.textConfig=this.options.textConfig}createNodes(){const Ce=[],ke=Xt.groupObjects(this.getPieces()),$n=ke.length-1;for(let zn=0;zn<ke.length;zn++){const Un=ke[zn],qn={};zn===0&&(qn.isFirst=!0),zn===$n&&(qn.isLast=!0),pe(Hn)&&(qn.followsWhitespace=!0);const Xn=this.findOrCreateCachedChildView(ge,Un,{textConfig:this.textConfig,context:qn});Ce.push(...Array.from(Xn.getNodes()||[]));var Hn=Un}return Ce}getPieces(){return Array.from(this.text.getPieces()).filter(Ce=>!Ce.hasAttribute("blockBreak"))}}const pe=_n=>/\s$/.test(_n==null?void 0:_n.toString()),{css:fe}=V;class be extends ee{constructor(){super(...arguments),this.block=this.object,this.attributes=this.block.getAttributes()}createNodes(){const Ce=[document.createComment("block")];if(this.block.isEmpty())Ce.push(S$1("br"));else{var ke;const $n=(ke=gt(this.block.getLastAttribute()))===null||ke===void 0?void 0:ke.text,Hn=this.findOrCreateCachedChildView(me,this.block.text,{textConfig:$n});Ce.push(...Array.from(Hn.getNodes()||[])),this.shouldAddExtraNewlineElement()&&Ce.push(S$1("br"))}if(this.attributes.length)return Ce;{let $n;const{tagName:Hn}=n.default;this.block.isRTL()&&($n={dir:"rtl"});const zn=S$1({tagName:Hn,attributes:$n});return Ce.forEach(Un=>zn.appendChild(Un)),[zn]}}createContainerElement(Ce){const ke={};let $n;const Hn=this.attributes[Ce],{tagName:zn,htmlAttributes:Un=[]}=gt(Hn);if(Ce===0&&this.block.isRTL()&&Object.assign(ke,{dir:"rtl"}),Hn==="attachmentGallery"){const qn=this.block.getBlockBreakPosition();$n="".concat(fe.attachmentGallery," ").concat(fe.attachmentGallery,"--").concat(qn)}return Object.entries(this.block.htmlAttributes).forEach(qn=>{let[Xn,Kn]=qn;Un.includes(Xn)&&(ke[Xn]=Kn)}),S$1({tagName:zn,className:$n,attributes:ke})}shouldAddExtraNewlineElement(){return/\n\n$/.test(this.block.toString())}}class ve extends ee{static render(Ce){const ke=S$1("div"),$n=new this(Ce,{element:ke});return $n.render(),$n.sync(),ke}constructor(){super(...arguments),this.element=this.options.element,this.elementStore=new Qt,this.setDocument(this.object)}setDocument(Ce){Ce.isEqualTo(this.document)||(this.document=this.object=Ce)}render(){if(this.childViews=[],this.shadowElement=S$1("div"),!this.document.isEmpty()){const Ce=Xt.groupObjects(this.document.getBlocks(),{asTree:!0});Array.from(Ce).forEach(ke=>{const $n=this.findOrCreateCachedChildView(be,ke);Array.from($n.getNodes()).map(Hn=>this.shadowElement.appendChild(Hn))})}}isSynced(){return xe(this.shadowElement,this.element)}sync(){const Ce=this.createDocumentFragmentForSync();for(;this.element.lastChild;)this.element.removeChild(this.element.lastChild);return this.element.appendChild(Ce),this.didSync()}didSync(){return this.elementStore.reset(Ae(this.element)),Rt(()=>this.garbageCollectCachedViews())}createDocumentFragmentForSync(){const Ce=document.createDocumentFragment();return Array.from(this.shadowElement.childNodes).forEach(ke=>{Ce.appendChild(ke.cloneNode(!0))}),Array.from(Ae(Ce)).forEach(ke=>{const $n=this.elementStore.remove(ke);$n&&ke.parentNode.replaceChild($n,ke)}),Ce}}const Ae=_n=>_n.querySelectorAll("[data-trix-store-key]"),xe=(_n,Ce)=>ye(_n.innerHTML)===ye(Ce.innerHTML),ye=_n=>_n.replace(/ /g," ");function Re(_n,Ce,ke){return(Ce=Ee(Ce))in _n?Object.defineProperty(_n,Ce,{value:ke,enumerable:!0,configurable:!0,writable:!0}):_n[Ce]=ke,_n}function Ee(_n){var Ce=function(ke,$n){if(typeof ke!="object"||ke===null)return ke;var Hn=ke[Symbol.toPrimitive];if(Hn!==void 0){var zn=Hn.call(ke,$n||"default");if(typeof zn!="object")return zn;throw new TypeError("@@toPrimitive must return a primitive value.")}return($n==="string"?String:Number)(ke)}(_n,"string");return typeof Ce=="symbol"?Ce:String(Ce)}class Se extends nt{static registerType(Ce,ke){ke.type=Ce,this.types[Ce]=ke}static fromJSON(Ce){const ke=this.types[Ce.type];if(ke)return ke.fromJSON(Ce)}constructor(Ce){let ke=arguments.length>1&&a
Line truncated
|
||||
`))(Ce),this.length=this.string.length}getValue(){return this.string}toString(){return this.string.toString()}isBlockBreak(){return this.toString()===`
|
||||
`&&this.getAttribute("blockBreak")===!0}toJSON(){const Ce=super.toJSON(...arguments);return Ce.string=this.string,Ce}canBeConsolidatedWith(Ce){return Ce&&this.hasSameConstructorAs(Ce)&&this.hasSameAttributesAsPiece(Ce)}consolidateWith(Ce){return new this.constructor(this.toString()+Ce.toString(),this.attributes)}splitAtOffset(Ce){let ke,$n;return Ce===0?(ke=null,$n=this):Ce===this.length?(ke=this,$n=null):(ke=new this.constructor(this.string.slice(0,Ce),this.attributes),$n=new this.constructor(this.string.slice(Ce),this.attributes)),[ke,$n]}toConsole(){let{string:Ce}=this;return Ce.length>15&&(Ce=Ce.slice(0,14)+"…"),JSON.stringify(Ce.toString())}}Se.registerType("string",Te);class Be extends nt{static box(Ce){return Ce instanceof this?Ce:new this(Ce)}constructor(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.objects=Ce.slice(0),this.length=this.objects.length}indexOf(Ce){return this.objects.indexOf(Ce)}splice(){for(var Ce=arguments.length,ke=new Array(Ce),$n=0;$n<Ce;$n++)ke[$n]=arguments[$n];return new this.constructor(ot(this.objects,...ke))}eachObject(Ce){return this.objects.map((ke,$n)=>Ce(ke,$n))}insertObjectAtIndex(Ce,ke){return this.splice(ke,0,Ce)}insertSplittableListAtIndex(Ce,ke){return this.splice(ke,0,...Ce.objects)}insertSplittableListAtPosition(Ce,ke){const[$n,Hn]=this.splitObjectAtPosition(ke);return new this.constructor($n).insertSplittableListAtIndex(Ce,Hn)}editObjectAtIndex(Ce,ke){return this.replaceObjectAtIndex(ke(this.objects[Ce]),Ce)}replaceObjectAtIndex(Ce,ke){return this.splice(ke,1,Ce)}removeObjectAtIndex(Ce){return this.splice(Ce,1)}getObjectAtIndex(Ce){return this.objects[Ce]}getSplittableListInRange(Ce){const[ke,$n,Hn]=this.splitObjectsAtRange(Ce);return new this.constructor(ke.slice($n,Hn+1))}selectSplittableList(Ce){const ke=this.objects.filter($n=>Ce($n));return new this.constructor(ke)}removeObjectsInRange(Ce){const[ke,$n,Hn]=this.splitObjectsAtRange(Ce);return new this.constructor(ke).splice($n,Hn-$n+1)}transformObjectsInRange(Ce,ke){const[$n,Hn,zn]=this.splitObjectsAtRange(Ce),Un=$n.map((qn,Xn)=>Hn<=Xn&&Xn<=zn?ke(qn):qn);return new this.constructor(Un)}splitObjectsAtRange(Ce){let ke,[$n,Hn,zn]=this.splitObjectAtPosition(Pe(Ce));return[$n,ke]=new this.constructor($n).splitObjectAtPosition(Ie(Ce)+zn),[$n,Hn,ke-1]}getObjectAtPosition(Ce){const{index:ke}=this.findIndexAndOffsetAtPosition(Ce);return this.objects[ke]}splitObjectAtPosition(Ce){let ke,$n;const{index:Hn,offset:zn}=this.findIndexAndOffsetAtPosition(Ce),Un=this.objects.slice(0);if(Hn!=null)if(zn===0)ke=Hn,$n=0;else{const qn=this.getObjectAtIndex(Hn),[Xn,Kn]=qn.splitAtOffset(zn);Un.splice(Hn,1,Xn,Kn),ke=Hn+1,$n=Xn.getLength()-zn}else ke=Un.length,$n=0;return[Un,ke,$n]}consolidate(){const Ce=[];let ke=this.objects[0];return this.objects.slice(1).forEach($n=>{var Hn,zn;(Hn=(zn=ke).canBeConsolidatedWith)!==null&&Hn!==void 0&&Hn.call(zn,$n)?ke=ke.consolidateWith($n):(Ce.push(ke),ke=$n)}),ke&&Ce.push(ke),new this.constructor(Ce)}consolidateFromIndexToIndex(Ce,ke){const $n=this.objects.slice(0).slice(Ce,ke+1),Hn=new this.constructor($n).consolidate().toArray();return this.splice(Ce,$n.length,...Hn)}findIndexAndOffsetAtPosition(Ce){let ke,$n=0;for(ke=0;ke<this.objects.length;ke++){const Hn=$n+this.objects[ke].getLength();if($n<=Ce&&Ce<Hn)return{index:ke,offset:Ce-$n};$n=Hn}return{index:null,offset:null}}findPositionAtIndexAndOffset(Ce,ke){let $n=0;for(let Hn=0;Hn<this.objects.length;Hn++){const zn=this.objects[Hn];if(Hn<Ce)$n+=zn.getLength();else if(Hn===Ce){$n+=ke;break}}return $n}getEndPosition(){return this.endPosition==null&&(this.endPosition=0,this.objects.forEach(Ce=>this.endPosition+=Ce.getLength())),this.endPosition}toString(){return this.objects.join("")}toArray(){return this.objects.slice(0)}toJSON(){return this.toArray()}isEqualTo(Ce){return super.isEqualTo(...arguments)||Fe(this.objects,Ce==null?void 0:Ce.objects)}contentsForInspection(){return{objects:"[".concat(this.objects.map(Ce=>Ce.inspect()).join(", "),"]")}}}const Fe=function(_n){let Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(_n.length!==Ce.length)return!1;let ke=!0;for(let $n=0;$n<_n.length;$n++){const Hn=_n[$n];ke&&!Hn.isEqualTo(Ce[$n])&&(ke=!1)}return ke},Pe=_n=>_n[0],Ie=_n=>_n[1];class Ne extends nt{static textForAttachmentWithAttributes(Ce,ke){return new this([new we(Ce,ke)])}static textForStringWithAttributes(Ce,ke){return new this([new Te(Ce,ke)])}static fromJSON(Ce){return new this(Array.from(Ce).map(ke=>Se.fromJSON(ke)))}constructor(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments);const ke=Ce.filter($n=>!$n.isEmpty());this.pieceList=new Be(ke)}copy(){return this.copyWithPieceList(this.pieceList)}copyWithPieceList(Ce){return new this.constructor(Ce.consolidate().toArray())}copyUsingObjectMap(Ce){const ke=this.getPieces().map($n=>Ce.find($n)||$n);return new this.constructor(ke)}appendText(Ce){return this.insertTextAtPosition(Ce,this.getLength())}
Line truncated
|
||||
`,ke);break;case"backward":Hn=$n.slice(0,ke).lastIndexOf(`
|
||||
`)}if(Hn!==-1)return Hn}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(Ce){return!this.hasAttributes()&&!Ce.hasAttributes()&&this.getDirection()===Ce.getDirection()}consolidateWith(Ce){const ke=Ne.textForStringWithAttributes(`
|
||||
`),$n=this.getTextWithoutBlockBreak().appendText(ke);return this.copyWithText($n.appendText(Ce.text))}splitAtOffset(Ce){let ke,$n;return Ce===0?(ke=null,$n=this):Ce===this.getLength()?(ke=this,$n=null):(ke=this.copyWithText(this.text.getTextAtRange([0,Ce])),$n=this.copyWithText(this.text.getTextAtRange([Ce,this.getLength()]))),[ke,$n]}getBlockBreakPosition(){return this.text.getLength()-1}getTextWithoutBlockBreak(){return qe(this.text)?this.text.getTextAtRange([0,this.getBlockBreakPosition()]):this.text.copy()}canBeGrouped(Ce){return this.attributes[Ce]}canBeGroupedWith(Ce,ke){const $n=Ce.getAttributes(),Hn=$n[ke],zn=this.attributes[ke];return zn===Hn&&!(gt(zn).group===!1&&!(()=>{if(!ht){ht=[];for(const Un in n){const{listAttribute:qn}=n[Un];qn!=null&&ht.push(qn)}}return ht})().includes($n[ke+1]))&&(this.getDirection()===Ce.getDirection()||Ce.isEmpty())}}const Me=function(_n){return _n=je(_n),_n=Ue(_n)},je=function(_n){let Ce=!1;const ke=_n.getPieces();let $n=ke.slice(0,ke.length-1);const Hn=ke[ke.length-1];return Hn?($n=$n.map(zn=>zn.isBlockBreak()?(Ce=!0,Ve(zn)):zn),Ce?new Ne([...$n,Hn]):_n):_n},We=Ne.textForStringWithAttributes(`
|
||||
`,{blockBreak:!0}),Ue=function(_n){return qe(_n)?_n:_n.appendText(We)},qe=function(_n){const Ce=_n.getLength();return Ce===0?!1:_n.getTextAtRange([Ce-1,Ce]).isBlockBreak()},Ve=_n=>_n.copyWithoutAttribute("blockBreak"),He=function(_n){const{listAttribute:Ce}=gt(_n);return Ce?[Ce,_n]:[_n]},ze=_n=>_n.slice(-1)[0],_e=function(_n,Ce){const ke=_n.lastIndexOf(Ce);return ke===-1?_n:ot(_n,ke,1)};class Je extends nt{static fromJSON(Ce){return new this(Array.from(Ce).map(ke=>Oe.fromJSON(ke)))}static fromString(Ce,ke){const $n=Ne.textForStringWithAttributes(Ce,ke);return new this([new Oe($n)])}constructor(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),Ce.length===0&&(Ce=[new Oe]),this.blockList=Be.box(Ce)}isEmpty(){const Ce=this.getBlockAtIndex(0);return this.blockList.length===1&&Ce.isEmpty()&&!Ce.hasAttributes()}copy(){const Ce=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).consolidateBlocks?this.blockList.consolidate().toArray():this.blockList.toArray();return new this.constructor(Ce)}copyUsingObjectsFromDocument(Ce){const ke=new Yt(Ce.getObjects());return this.copyUsingObjectMap(ke)}copyUsingObjectMap(Ce){const ke=this.getBlocks().map($n=>Ce.find($n)||$n.copyUsingObjectMap(Ce));return new this.constructor(ke)}copyWithBaseBlockAttributes(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const ke=this.getBlocks().map($n=>{const Hn=Ce.concat($n.getAttributes());return $n.copyWithAttributes(Hn)});return new this.constructor(ke)}replaceBlock(Ce,ke){const $n=this.blockList.indexOf(Ce);return $n===-1?this:new this.constructor(this.blockList.replaceObjectAtIndex(ke,$n))}insertDocumentAtRange(Ce,ke){const{blockList:$n}=Ce;ke=Lt(ke);let[Hn]=ke;const{index:zn,offset:Un}=this.locationFromPosition(Hn);let qn=this;const Xn=this.getBlockAtPosition(Hn);return Dt(ke)&&Xn.isEmpty()&&!Xn.hasAttributes()?qn=new this.constructor(qn.blockList.removeObjectAtIndex(zn)):Xn.getBlockBreakPosition()===Un&&Hn++,qn=qn.removeTextAtRange(ke),new this.constructor(qn.blockList.insertSplittableListAtPosition($n,Hn))}mergeDocumentAtRange(Ce,ke){let $n,Hn;ke=Lt(ke);const[zn]=ke,Un=this.locationFromPosition(zn),qn=this.getBlockAtIndex(Un.index).getAttributes(),Xn=Ce.getBaseBlockAttributes(),Kn=qn.slice(-Xn.length);if(rt(Xn,Kn)){const uo=qn.slice(0,-Xn.length);$n=Ce.copyWithBaseBlockAttributes(uo)}else $n=Ce.copy({consolidateBlocks:!0}).copyWithBaseBlockAttributes(qn);const to=$n.getBlockCount(),io=$n.getBlockAtIndex(0);if(rt(qn,io.getAttributes())){const uo=io.getTextWithoutBlockBreak();if(Hn=this.insertTextAtRange(uo,ke),to>1){$n=new this.constructor($n.getBlocks().slice(1));const ho=zn+uo.getLength();Hn=Hn.insertDocumentAtRange($n,ho)}}else Hn=this.insertDocumentAtRange($n,ke);return Hn}insertTextAtRange(Ce,ke){ke=Lt(ke);const[$n]=ke,{index:Hn,offset:zn}=this.locationFromPosition($n),Un=this.removeTextAtRange(ke);return new this.constructor(Un.blockList.editObjectAtIndex(Hn,qn=>qn.copyWithText(qn.text.insertTextAtPosition(Ce,zn))))}removeTextAtRange(Ce){let ke;Ce=Lt(Ce);const[$n,Hn]=Ce;if(Dt(Ce))return this;const[zn,Un]=Array.from(this.locationRangeFromRange(Ce)),qn=zn.index,Xn=zn.offset,Kn=this.getBlockAtIndex(qn),to=Un.index,io=Un.offset,uo=this.getBlockAtIndex(to);if(Hn-$n==1&&Kn.getBlockBreakPosition()===Xn&&uo.getBlockBreakPosition()!==io&&uo.text.getStringAtPosition(io)===`
|
||||
`)ke=this.blockList.editObjectAtIndex(to,ho=>ho.copyWithText(ho.text.removeTextAtRange([io,io+1])));else{let ho;const bo=Kn.text.getTextAtRange([0,Xn]),Oo=uo.text.getTextAtRange([io,uo.getLength()]),So=bo.appendText(Oo);ho=qn!==to&&Xn===0&&Kn.getAttributeLevel()>=uo.getAttributeLevel()?uo.copyWithText(So):Kn.copyWithText(So);const $o=to+1-qn;ke=this.blockList.splice(qn,$o,ho)}return new this.constructor(ke)}moveTextFromRangeToPosition(Ce,ke){let $n;Ce=Lt(Ce);const[Hn,zn]=Ce;if(Hn<=ke&&ke<=zn)return this;let Un=this.getDocumentAtRange(Ce),qn=this.removeTextAtRange(Ce);const Xn=Hn<ke;Xn&&(ke-=Un.getLength());const[Kn,...to]=Un.getBlocks();return to.length===0?($n=Kn.getTextWithoutBlockBreak(),Xn&&(ke+=1)):$n=Kn.text,qn=qn.insertTextAtRange($n,ke),to.length===0?qn:(Un=new this.constructor(to),ke+=$n.getLength(),qn.insertDocumentAtRange(Un,ke))}addAttributeAtRange(Ce,ke,$n){let{blockList:Hn}=this;return this.eachBlockAtRange($n,(zn,Un,qn)=>Hn=Hn.editObjectAtIndex(qn,function(){return gt(Ce)?zn.addAttribute(Ce,ke):Un[0]===Un[1]?zn:zn.copyWithText(zn.text.addAttributeAtRange(Ce,ke,Un))})),new this.constructor(Hn)}addAttribute(Ce,ke){let{blockList:$n}=this;return this.eachBlock((Hn,zn)=>$n=$n.editObjectAtIndex(zn,()=>Hn.addAttribute(Ce,ke))),new this.constructor($n)}removeAttributeAtRange(Ce,ke){let{blockList:$n}=this;return this.eachBlockAtRange(ke,function(Hn,zn,Un){gt(Ce)?$n=$n.editObjectAtIndex(Un,()=>Hn.removeAttribute(Ce)):zn[0]!==zn[1]&&($n=$n.editObjectAtIndex(Un,()=>Hn.copyWithText(Hn.text.removeAttributeAtRange(Ce,zn))))}),new this.constructor($n)}updateAttributesForAttachment(Ce,ke){const $n=this.getRangeOfAttachment(ke),[Hn]=Array.from($n),{index:zn}=this.locationFromPosition(Hn),Un=this.getTextAtIndex(zn);return new this.constructor(this.blockList.editObjectAtIndex(zn,qn=>qn.copyWithText(Un.updateAttributesForAttachment(Ce,ke))))}removeAttributeForAttachment(Ce,ke){const $n=this.getRangeOfAttachment(ke);return this.removeAttributeAtRange(Ce,$n)}setHTMLAttributeAtPosition(Ce,ke,$n){const Hn=this.getBlockAtPosition(Ce),zn=Hn.addHTMLAttribute(ke,$n);return this.replaceBlock(Hn,zn)}insertBlockBreakAtRange(Ce){let ke;Ce=Lt(Ce);const[$n]=Ce,{offset:Hn}=this.locationFromPosition($n),zn=this.removeTextAtRange(Ce);return Hn===0&&(ke=[new Oe]),new this.constructor(zn.blockList.insertSplittableListAtPosition(new Be(ke),$n))}applyBlockAttributeAtRange(Ce,ke,$n){const Hn=this.expandRangeToLineBreaksAndSplitBlocks($n);let zn=Hn.document;$n=Hn.range;const Un=gt(Ce);if(Un.listAttribute){zn=zn.removeLastListAttributeAtRange($n,{exceptAttributeName:Ce});const qn=zn.convertLineBreaksToBlockBreaksInRange($n);zn=qn.document,$n=qn.range}else zn=Un.exclusive?zn.removeBlockAttributesAtRange($n):Un.terminal?zn.removeLastTerminalAttributeAtRange($n):zn.consolidateBlocksAtRange($n);return zn.addAttributeAtRange(Ce,ke,$n)}removeLastListAttributeAtRange(Ce){let ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{blockList:$n}=this;return this.eachBlockAtRange(Ce,function(Hn,zn,Un){const qn=Hn.getLastAttribute();qn&>(qn).listAttribute&&qn!==ke.exceptAttributeName&&($n=$n.editObjectAtIndex(Un,()=>Hn.removeAttribute(qn)))}),new this.constructor($n)}removeLastTerminalAttributeAtRange(Ce){let{blockList:ke}=this;return this.eachBlockAtRange(Ce,function($n,Hn,zn){const Un=$n.getLastAttribute();Un&>(Un).terminal&&(ke=ke.editObjectAtIndex(zn,()=>$n.removeAttribute(Un)))}),new this.constructor(ke)}removeBlockAttributesAtRange(Ce){let{blockList:ke}=this;return this.eachBlockAtRange(Ce,function($n,Hn,zn){$n.hasAttributes()&&(ke=ke.editObjectAtIndex(zn,()=>$n.copyWithoutAttributes()))}),new this.constructor(ke)}expandRangeToLineBreaksAndSplitBlocks(Ce){let ke;Ce=Lt(Ce);let[$n,Hn]=Ce;const zn=this.locationFromPosition($n),Un=this.locationFromPosition(Hn);let qn=this;const Xn=qn.getBlockAtIndex(zn.index);if(zn.offset=Xn.findLineBreakInDirectionFromPosition("backward",zn.offset),zn.offset!=null&&(ke=qn.positionFromLocation(zn),qn=qn.insertBlockBreakAtRange([ke,ke+1]),Un.index+=1,Un.offset-=qn.getBlockAtIndex(zn.index).getLength(),zn.index+=1),zn.offset=0,Un.offset===0&&Un.index>zn.index)Un.index-=1,Un.offset=qn.getBlockAtIndex(Un.index).getBlockBreakPosition();else{const Kn=qn.getBlockAtIndex(Un.index);Kn.text.getStringAtRange([Un.offset-1,Un.offset])===`
|
||||
`?Un.offset-=1:Un.offset=Kn.findLineBreakInDirectionFromPosition("forward",Un.offset),Un.offset!==Kn.getBlockBreakPosition()&&(ke=qn.positionFromLocation(Un),qn=qn.insertBlockBreakAtRange([ke,ke+1]))}return $n=qn.positionFromLocation(zn),Hn=qn.positionFromLocation(Un),{document:qn,range:Ce=Lt([$n,Hn])}}convertLineBreaksToBlockBreaksInRange(Ce){Ce=Lt(Ce);let[ke]=Ce;const $n=this.getStringAtRange(Ce).slice(0,-1);let Hn=this;return $n.replace(/.*?\n/g,function(zn){ke+=zn.length,Hn=Hn.insertBlockBreakAtRange([ke-1,ke])}),{document:Hn,range:Ce}}consolidateBlocksAtRange(Ce){Ce=Lt(Ce);const[ke,$n]=Ce,Hn=this.locationFromPosition(ke).index,zn=this.locationFromPosition($n).index;return new this.constructor(this.blockList.consolidateFromIndexToIndex(Hn,zn))}getDocumentAtRange(Ce){Ce=Lt(Ce);const ke=this.blockList.getSplittableListInRange(Ce).toArray();return new this.constructor(ke)}getStringAtRange(Ce){let ke;const $n=Ce=Lt(Ce);return $n[$n.length-1]!==this.getLength()&&(ke=-1),this.getDocumentAtRange(Ce).toString().slice(0,ke)}getBlockAtIndex(Ce){return this.blockList.getObjectAtIndex(Ce)}getBlockAtPosition(Ce){const{index:ke}=this.locationFromPosition(Ce);return this.getBlockAtIndex(ke)}getTextAtIndex(Ce){var ke;return(ke=this.getBlockAtIndex(Ce))===null||ke===void 0?void 0:ke.text}getTextAtPosition(Ce){const{index:ke}=this.locationFromPosition(Ce);return this.getTextAtIndex(ke)}getPieceAtPosition(Ce){const{index:ke,offset:$n}=this.locationFromPosition(Ce);return this.getTextAtIndex(ke).getPieceAtPosition($n)}getCharacterAtPosition(Ce){const{index:ke,offset:$n}=this.locationFromPosition(Ce);return this.getTextAtIndex(ke).getStringAtRange([$n,$n+1])}getLength(){return this.blockList.getEndPosition()}getBlocks(){return this.blockList.toArray()}getBlockCount(){return this.blockList.length}getEditCount(){return this.editCount}eachBlock(Ce){return this.blockList.eachObject(Ce)}eachBlockAtRange(Ce,ke){let $n,Hn;Ce=Lt(Ce);const[zn,Un]=Ce,qn=this.locationFromPosition(zn),Xn=this.locationFromPosition(Un);if(qn.index===Xn.index)return $n=this.getBlockAtIndex(qn.index),Hn=[qn.offset,Xn.offset],ke($n,Hn,qn.index);for(let Kn=qn.index;Kn<=Xn.index;Kn++)if($n=this.getBlockAtIndex(Kn),$n){switch(Kn){case qn.index:Hn=[qn.offset,$n.text.getLength()];break;case Xn.index:Hn=[0,Xn.offset];break;default:Hn=[0,$n.text.getLength()]}ke($n,Hn,Kn)}}getCommonAttributesAtRange(Ce){Ce=Lt(Ce);const[ke]=Ce;if(Dt(Ce))return this.getCommonAttributesAtPosition(ke);{const $n=[],Hn=[];return this.eachBlockAtRange(Ce,function(zn,Un){if(Un[0]!==Un[1])return $n.push(zn.text.getCommonAttributesAtRange(Un)),Hn.push(Ke(zn))}),zt.fromCommonAttributesOfObjects($n).merge(zt.fromCommonAttributesOfObjects(Hn)).toObject()}}getCommonAttributesAtPosition(Ce){let ke,$n;const{index:Hn,offset:zn}=this.locationFromPosition(Ce),Un=this.getBlockAtIndex(Hn);if(!Un)return{};const qn=Ke(Un),Xn=Un.text.getAttributesAtPosition(zn),Kn=Un.text.getAttributesAtPosition(zn-1),to=Object.keys(W).filter(io=>W[io].inheritable);for(ke in Kn)$n=Kn[ke],($n===Xn[ke]||to.includes(ke))&&(qn[ke]=$n);return qn}getRangeOfCommonAttributeAtPosition(Ce,ke){const{index:$n,offset:Hn}=this.locationFromPosition(ke),zn=this.getTextAtIndex($n),[Un,qn]=Array.from(zn.getExpandedRangeForAttributeAtOffset(Ce,Hn)),Xn=this.positionFromLocation({index:$n,offset:Un}),Kn=this.positionFromLocation({index:$n,offset:qn});return Lt([Xn,Kn])}getBaseBlockAttributes(){let Ce=this.getBlockAtIndex(0).getAttributes();for(let ke=1;ke<this.getBlockCount();ke++){const $n=this.getBlockAtIndex(ke).getAttributes(),Hn=Math.min(Ce.length,$n.length);Ce=(()=>{const zn=[];for(let Un=0;Un<Hn&&$n[Un]===Ce[Un];Un++)zn.push($n[Un]);return zn})()}return Ce}getAttachmentById(Ce){for(const ke of this.getAttachments())if(ke.id===Ce)return ke}getAttachmentPieces(){let Ce=[];return this.blockList.eachObject(ke=>{let{text:$n}=ke;return Ce=Ce.concat($n.getAttachmentPieces())}),Ce}getAttachments(){return this.getAttachmentPieces().map(Ce=>Ce.attachment)}getRangeOfAttachment(Ce){let ke=0;const $n=this.blockList.toArray();for(let Hn=0;Hn<$n.length;Hn++){const{text:zn}=$n[Hn],Un=zn.getRangeOfAttachment(Ce);if(Un)return Lt([ke+Un[0],ke+Un[1]]);ke+=zn.getLength()}}getLocationRangeOfAttachment(Ce){const ke=this.getRangeOfAttachment(Ce);return this.locationRangeFromRange(ke)}getAttachmentPieceForAttachment(Ce){for(const ke of this.getAttachmentPieces())if(ke.attachment===Ce)return ke}findRangesForBlockAttribute(Ce){let ke=0;const $n=[];return this.getBlocks().forEach(Hn=>{const zn=Hn.getLength();Hn.hasAttribute(Ce)&&$n.push([ke,ke+zn]),ke+=zn}),$n}findRangesForTextAttribute(Ce){let{withValue:ke}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$n=0,Hn=[];const zn=[];return this.getPieces().forEach(Un=>{const qn=Un.getLength();(function(Xn){return ke?Xn.getAttribute(Ce)===ke:Xn.hasAttribute(Ce)})(Un)&&(Hn[1]===$n?Hn[1]=$n+qn:zn.push(Hn=[$n,$n+qn])),$n+=qn}),zn}locationFromPosition(Ce){const ke=this.blockList.findIndexAndOffsetAtPosition(Math
Line truncated
|
||||
`);if(ke===this.containerElement||this.isBlockElement(ke)){var $n;const Hn=this.getBlockAttributes(ke),zn=this.getBlockHTMLAttributes(ke);rt(Hn,($n=this.currentBlock)===null||$n===void 0?void 0:$n.attributes)||(this.currentBlock=this.appendBlockForAttributesWithElement(Hn,ke,zn),this.currentBlockElement=ke)}}appendBlockForElement(Ce){const ke=this.isBlockElement(Ce),$n=y(this.currentBlockElement,Ce);if(ke&&!this.isBlockElement(Ce.firstChild)){if(!this.isInsignificantTextNode(Ce.firstChild)||!this.isBlockElement(Ce.firstElementChild)){const Hn=this.getBlockAttributes(Ce),zn=this.getBlockHTMLAttributes(Ce);if(Ce.firstChild){if($n&&rt(Hn,this.currentBlock.attributes))return this.appendStringWithAttributes(`
|
||||
`);this.currentBlock=this.appendBlockForAttributesWithElement(Hn,Ce,zn),this.currentBlockElement=Ce}}}else if(this.currentBlockElement&&!$n&&!ke){const Hn=this.findParentBlockElement(Ce);if(Hn)return this.appendBlockForElement(Hn);this.currentBlock=this.appendEmptyBlock(),this.currentBlockElement=null}}findParentBlockElement(Ce){let{parentElement:ke}=Ce;for(;ke&&ke!==this.containerElement;){if(this.isBlockElement(ke)&&this.blockElements.includes(ke))return ke;ke=ke.parentElement}return null}processTextNode(Ce){let ke=Ce.data;var $n;return Ye(Ce.parentNode)||(ke=qt(ke),ni(($n=Ce.previousSibling)===null||$n===void 0?void 0:$n.textContent)&&(ke=ei(ke))),this.appendStringWithAttributes(ke,this.getTextAttributes(Ce.parentNode))}processElement(Ce){let ke;if(I(Ce)){if(ke=$e(Ce,"attachment"),Object.keys(ke).length){const $n=this.getTextAttributes(Ce);this.appendAttachmentWithAttributes(ke,$n),Ce.innerHTML=""}return this.processedElements.push(Ce)}switch(E(Ce)){case"br":return this.isExtraBR(Ce)||this.isBlockElement(Ce.nextSibling)||this.appendStringWithAttributes(`
|
||||
`,this.getTextAttributes(Ce)),this.processedElements.push(Ce);case"img":ke={url:Ce.getAttribute("src"),contentType:"image"};const $n=(Hn=>{const zn=Hn.getAttribute("width"),Un=Hn.getAttribute("height"),qn={};return zn&&(qn.width=parseInt(zn,10)),Un&&(qn.height=parseInt(Un,10)),qn})(Ce);for(const Hn in $n){const zn=$n[Hn];ke[Hn]=zn}return this.appendAttachmentWithAttributes(ke,this.getTextAttributes(Ce)),this.processedElements.push(Ce);case"tr":if(this.needsTableSeparator(Ce))return this.appendStringWithAttributes(j.tableRowSeparator);break;case"td":if(this.needsTableSeparator(Ce))return this.appendStringWithAttributes(j.tableCellSeparator)}}appendBlockForAttributesWithElement(Ce,ke){let $n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.blockElements.push(ke);const Hn=function(){return{text:[],attributes:arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},htmlAttributes:arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}}}(Ce,$n);return this.blocks.push(Hn),Hn}appendEmptyBlock(){return this.appendBlockForAttributesWithElement([],null)}appendStringWithAttributes(Ce,ke){return this.appendPiece(Ge(Ce,ke))}appendAttachmentWithAttributes(Ce,ke){return this.appendPiece(function($n){return{attachment:$n,attributes:arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},type:"attachment"}}(Ce,ke))}appendPiece(Ce){return this.blocks.length===0&&this.appendEmptyBlock(),this.blocks[this.blocks.length-1].text.push(Ce)}appendStringToTextAtIndex(Ce,ke){const{text:$n}=this.blocks[ke],Hn=$n[$n.length-1];if((Hn==null?void 0:Hn.type)!=="string")return $n.push(Ge(Ce));Hn.string+=Ce}prependStringToTextAtIndex(Ce,ke){const{text:$n}=this.blocks[ke],Hn=$n[0];if((Hn==null?void 0:Hn.type)!=="string")return $n.unshift(Ge(Ce));Hn.string=Ce+Hn.string}getTextAttributes(Ce){let ke;const $n={};for(const Hn in W){const zn=W[Hn];if(zn.tagName&&A(Ce,{matchingSelector:zn.tagName,untilNode:this.containerElement}))$n[Hn]=!0;else if(zn.parser){if(ke=zn.parser(Ce),ke){let Un=!1;for(const qn of this.findBlockElementAncestors(Ce))if(zn.parser(qn)===ke){Un=!0;break}Un||($n[Hn]=ke)}}else zn.styleProperty&&(ke=Ce.style[zn.styleProperty],ke&&($n[Hn]=ke))}if(I(Ce)){const Hn=$e(Ce,"attributes");for(const zn in Hn)ke=Hn[zn],$n[zn]=ke}return $n}getBlockAttributes(Ce){const ke=[];for(;Ce&&Ce!==this.containerElement;){for(const Hn in n){const zn=n[Hn];var $n;zn.parse!==!1&&E(Ce)===zn.tagName&&(($n=zn.test)!==null&&$n!==void 0&&$n.call(zn,Ce)||!zn.test)&&(ke.push(Hn),zn.listAttribute&&ke.push(zn.listAttribute))}Ce=Ce.parentNode}return ke.reverse()}getBlockHTMLAttributes(Ce){const ke={},$n=Object.values(n).find(Hn=>Hn.tagName===E(Ce));return(($n==null?void 0:$n.htmlAttributes)||[]).forEach(Hn=>{Ce.hasAttribute(Hn)&&(ke[Hn]=Ce.getAttribute(Hn))}),ke}findBlockElementAncestors(Ce){const ke=[];for(;Ce&&Ce!==this.containerElement;){const $n=E(Ce);D().includes($n)&&ke.push(Ce),Ce=Ce.parentNode}return ke}isBlockElement(Ce){if((Ce==null?void 0:Ce.nodeType)===Node.ELEMENT_NODE&&!I(Ce)&&!A(Ce,{matchingSelector:"td",untilNode:this.containerElement}))return D().includes(E(Ce))||window.getComputedStyle(Ce).display==="block"}isInsignificantTextNode(Ce){if((Ce==null?void 0:Ce.nodeType)!==Node.TEXT_NODE||!ii(Ce.data))return;const{parentNode:ke,previousSibling:$n,nextSibling:Hn}=Ce;return Qe(ke.previousSibling)&&!this.isBlockElement(ke.previousSibling)||Ye(ke)?void 0:!$n||this.isBlockElement($n)||!Hn||this.isBlockElement(Hn)}isExtraBR(Ce){return E(Ce)==="br"&&this.isBlockElement(Ce.parentNode)&&Ce.parentNode.lastChild===Ce}needsTableSeparator(Ce){if(j.removeBlankTableCells){var ke;const $n=(ke=Ce.previousSibling)===null||ke===void 0?void 0:ke.textContent;return $n&&/\S/.test($n)}return Ce.previousSibling}translateBlockElementMarginsToNewlines(){const Ce=this.getMarginOfDefaultBlockElement();for(let ke=0;ke<this.blocks.length;ke++){const $n=this.getMarginOfBlockElementAtIndex(ke);$n&&($n.top>2*Ce.top&&this.prependStringToTextAtIndex(`
|
||||
`,ke),$n.bottom>2*Ce.bottom&&this.appendStringToTextAtIndex(`
|
||||
`,ke))}}getMarginOfBlockElementAtIndex(Ce){const ke=this.blockElements[Ce];if(ke&&ke.textContent&&!D().includes(E(ke))&&!this.processedElements.includes(ke))return Ze(ke)}getMarginOfDefaultBlockElement(){const Ce=S$1(n.default.tagName);return this.containerElement.appendChild(Ce),Ze(Ce)}}const Ye=function(_n){const{whiteSpace:Ce}=window.getComputedStyle(_n);return["pre","pre-wrap","pre-line"].includes(Ce)},Qe=_n=>_n&&!ni(_n.textContent),Ze=function(_n){const Ce=window.getComputedStyle(_n);if(Ce.display==="block")return{top:parseInt(Ce.marginTop),bottom:parseInt(Ce.marginBottom)}},ti=function(_n){return E(_n)==="style"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},ei=_n=>_n.replace(new RegExp("^".concat(Ut.source,"+")),""),ii=_n=>new RegExp("^".concat(Ut.source,"*$")).test(_n),ni=_n=>/\s$/.test(_n),ri=["contenteditable","data-trix-id","data-trix-store-key","data-trix-mutable","data-trix-placeholder","tabindex"],oi="data-trix-serialized-attributes",si="[".concat(oi,"]"),ai=new RegExp("<!--block-->","g"),li={"application/json":function(_n){let Ce;if(_n instanceof Je)Ce=_n;else{if(!(_n instanceof HTMLElement))throw new Error("unserializable object");Ce=Xe.parse(_n.innerHTML).getDocument()}return Ce.toSerializableDocument().toJSONString()},"text/html":function(_n){let Ce;if(_n instanceof Je)Ce=ve.render(_n);else{if(!(_n instanceof HTMLElement))throw new Error("unserializable object");Ce=_n.cloneNode(!0)}return Array.from(Ce.querySelectorAll("[data-trix-serialize=false]")).forEach(ke=>{k(ke)}),ri.forEach(ke=>{Array.from(Ce.querySelectorAll("[".concat(ke,"]"))).forEach($n=>{$n.removeAttribute(ke)})}),Array.from(Ce.querySelectorAll(si)).forEach(ke=>{try{const $n=JSON.parse(ke.getAttribute(oi));ke.removeAttribute(oi);for(const Hn in $n){const zn=$n[Hn];ke.setAttribute(Hn,zn)}}catch{}}),Ce.innerHTML.replace(ai,"")}};var ci=Object.freeze({__proto__:null});class ui extends H{constructor(Ce,ke){super(...arguments),this.attachmentManager=Ce,this.attachment=ke,this.id=this.attachment.id,this.file=this.attachment.file}remove(){return this.attachmentManager.requestRemovalOfAttachment(this.attachment)}}ui.proxyMethod("attachment.getAttribute"),ui.proxyMethod("attachment.hasAttribute"),ui.proxyMethod("attachment.setAttribute"),ui.proxyMethod("attachment.getAttributes"),ui.proxyMethod("attachment.setAttributes"),ui.proxyMethod("attachment.isPending"),ui.proxyMethod("attachment.isPreviewable"),ui.proxyMethod("attachment.getURL"),ui.proxyMethod("attachment.getHref"),ui.proxyMethod("attachment.getFilename"),ui.proxyMethod("attachment.getFilesize"),ui.proxyMethod("attachment.getFormattedFilesize"),ui.proxyMethod("attachment.getExtension"),ui.proxyMethod("attachment.getContentType"),ui.proxyMethod("attachment.getFile"),ui.proxyMethod("attachment.setFile"),ui.proxyMethod("attachment.releaseFile"),ui.proxyMethod("attachment.getUploadProgress"),ui.proxyMethod("attachment.setUploadProgress");class hi extends H{constructor(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.managedAttachments={},Array.from(Ce).forEach(ke=>{this.manageAttachment(ke)})}getAttachments(){const Ce=[];for(const ke in this.managedAttachments){const $n=this.managedAttachments[ke];Ce.push($n)}return Ce}manageAttachment(Ce){return this.managedAttachments[Ce.id]||(this.managedAttachments[Ce.id]=new ui(this,Ce)),this.managedAttachments[Ce.id]}attachmentIsManaged(Ce){return Ce.id in this.managedAttachments}requestRemovalOfAttachment(Ce){var ke,$n;if(this.attachmentIsManaged(Ce))return(ke=this.delegate)===null||ke===void 0||($n=ke.attachmentManagerDidRequestRemovalOfAttachment)===null||$n===void 0?void 0:$n.call(ke,Ce)}unmanageAttachment(Ce){const ke=this.managedAttachments[Ce.id];return delete this.managedAttachments[Ce.id],ke}}class di{constructor(Ce){this.composition=Ce,this.document=this.composition.document;const ke=this.composition.getSelectedRange();this.startPosition=ke[0],this.endPosition=ke[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 gi extends H{constructor(){super(...arguments),this.document=new Je,this.attachments=[],this.currentAttributes={},this.revision=0}setDocument(Ce){var ke,$n;if(!Ce.isEqualTo(this.document))return this.document=Ce,this.refreshAttachments(),this.revision++,(ke=this.delegate)===null||ke===void 0||($n=ke.compositionDidChangeDocument)===null||$n===void 0?void 0:$n.call(ke,Ce)}getSnapshot(){return{document:this.document,selectedRange:this.getSelectedRange()}}loadSnapshot(Ce){var ke,$n,Hn,zn;let{document:Un,selectedRange:qn}=Ce;return(ke=this.delegate)===null||ke===void 0||($n=ke.compositionWillLoadSnapshot)===null||$n===void 0||$n.call(ke),this.setDocument(Un??new Je),this.setSelection(qn??[0,0]),(Hn=this.delegate)===null||Hn===void 0||(zn=Hn.compositionDidLoadSnapshot)===null||zn===void 0?void 0:zn.call(Hn)}insertText(Ce){let{updatePosition:ke}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{updatePosition:!0};const $n=this.getSelectedRange();this.setDocument(this.document.insertTextAtRange(Ce,$n));const Hn=$n[0],zn=Hn+Ce.getLength();return ke&&this.setSelection(zn),this.notifyDelegateOfInsertionAtRange([Hn,zn])}insertBlock(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Oe;const ke=new Je([Ce]);return this.insertDocument(ke)}insertDocument(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Je;const ke=this.getSelectedRange();this.setDocument(this.document.insertDocumentAtRange(Ce,ke));const $n=ke[0],Hn=$n+Ce.getLength();return this.setSelection(Hn),this.notifyDelegateOfInsertionAtRange([$n,Hn])}insertString(Ce,ke){const $n=this.getCurrentTextAttributes(),Hn=Ne.textForStringWithAttributes(Ce,$n);return this.insertText(Hn,ke)}insertBlockBreak(){const Ce=this.getSelectedRange();this.setDocument(this.document.insertBlockBreakAtRange(Ce));const ke=Ce[0],$n=ke+1;return this.setSelection($n),this.notifyDelegateOfInsertionAtRange([ke,$n])}insertLineBreak(){const Ce=new di(this);if(Ce.shouldDecreaseListLevel())return this.decreaseListLevel(),this.setSelection(Ce.startPosition);if(Ce.shouldPrependListItem()){const ke=new Je([Ce.block.copyWithoutText()]);return this.insertDocument(ke)}return Ce.shouldInsertBlockBreak()?this.insertBlockBreak():Ce.shouldRemoveLastBlockAttribute()?this.removeLastBlockAttribute():Ce.shouldBreakFormattedBlock()?this.breakFormattedBlock(Ce):this.insertString(`
|
||||
`)}insertHTML(Ce){const ke=Xe.parse(Ce).getDocument(),$n=this.getSelectedRange();this.setDocument(this.document.mergeDocumentAtRange(ke,$n));const Hn=$n[0],zn=Hn+ke.getLength()-1;return this.setSelection(zn),this.notifyDelegateOfInsertionAtRange([Hn,zn])}replaceHTML(Ce){const ke=Xe.parse(Ce).getDocument().copyUsingObjectsFromDocument(this.document),$n=this.getLocationRange({strict:!1}),Hn=this.document.rangeFromLocationRange($n);return this.setDocument(ke),this.setSelection(Hn)}insertFile(Ce){return this.insertFiles([Ce])}insertFiles(Ce){const ke=[];return Array.from(Ce).forEach($n=>{var Hn;if((Hn=this.delegate)!==null&&Hn!==void 0&&Hn.compositionShouldAcceptFile($n)){const zn=De.attachmentForFile($n);ke.push(zn)}}),this.insertAttachments(ke)}insertAttachment(Ce){return this.insertAttachments([Ce])}insertAttachments(Ce){let ke=new Ne;return Array.from(Ce).forEach($n=>{var Hn;const zn=$n.getType(),Un=(Hn=i$1[zn])===null||Hn===void 0?void 0:Hn.presentation,qn=this.getCurrentTextAttributes();Un&&(qn.presentation=Un);const Xn=Ne.textForAttachmentWithAttributes($n,qn);ke=ke.appendText(Xn)}),this.insertText(ke)}shouldManageDeletingInDirection(Ce){const ke=this.getLocationRange();if(Dt(ke)){if(Ce==="backward"&&ke[0].offset===0||this.shouldManageMovingCursorInDirection(Ce))return!0}else if(ke[0].index!==ke[1].index)return!0;return!1}deleteInDirection(Ce){let ke,$n,Hn,{length:zn}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const Un=this.getLocationRange();let qn=this.getSelectedRange();const Xn=Dt(qn);if(Xn?$n=Ce==="backward"&&Un[0].offset===0:Hn=Un[0].index!==Un[1].index,$n&&this.canDecreaseBlockAttributeLevel()){const Kn=this.getBlock();if(Kn.isListItem()?this.decreaseListLevel():this.decreaseBlockAttributeLevel(),this.setSelection(qn[0]),Kn.isEmpty())return!1}return Xn&&(qn=this.getExpandedRangeInDirection(Ce,{length:zn}),Ce==="backward"&&(ke=this.getAttachmentAtRange(qn))),ke?(this.editAttachment(ke),!1):(this.setDocument(this.document.removeTextAtRange(qn)),this.setSelection(qn[0]),!$n&&!Hn&&void 0)}moveTextFromRange(Ce){const[ke]=Array.from(this.getSelectedRange());return this.setDocument(this.document.moveTextFromRangeToPosition(Ce,ke)),this.setSelection(ke)}removeAttachment(Ce){const ke=this.document.getRangeOfAttachment(Ce);if(ke)return this.stopEditingAttachment(),this.setDocument(this.document.removeTextAtRange(ke)),this.setSelection(ke[0])}removeLastBlockAttribute(){const[Ce,ke]=Array.from(this.getSelectedRange()),$n=this.document.getBlockAtPosition(ke);return this.removeCurrentAttribute($n.getLastAttribute()),this.setSelection(Ce)}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(Ce){const ke=this.currentAttributes[Ce];return ke!=null&&ke!==!1}toggleCurrentAttribute(Ce){const ke=!this.currentAttributes[Ce];return ke?this.setCurrentAttribute(Ce,ke):this.removeCurrentAttribute(Ce)}canSetCurrentAttribute(Ce){return gt(Ce)?this.canSetCurrentBlockAttribute(Ce):this.canSetCurrentTextAttribute(Ce)}canSetCurrentTextAttribute(Ce){const ke=this.getSelectedDocument();if(ke){for(const $n of Array.from(ke.getAttachments()))if(!$n.hasContent())return!1;return!0}}canSetCurrentBlockAttribute(Ce){const ke=this.getBlock();if(ke)return!ke.isTerminalBlock()}setCurrentAttribute(Ce,ke){return gt(Ce)?this.setBlockAttribute(Ce,ke):(this.setTextAttribute(Ce,ke),this.currentAttributes[Ce]=ke,this.notifyDelegateOfCurrentAttributesChange())}setHTMLAtributeAtPosition(Ce,ke,$n){var Hn;const zn=this.document.getBlockAtPosition(Ce),Un=(Hn=gt(zn.getLastAttribute()))===null||Hn===void 0?void 0:Hn.htmlAttributes;if(zn&&Un!=null&&Un.includes(ke)){const qn=this.document.setHTMLAttributeAtPosition(Ce,ke,$n);this.setDocument(qn)}}setTextAttribute(Ce,ke){const $n=this.getSelectedRange();if(!$n)return;const[Hn,zn]=Array.from($n);if(Hn!==zn)return this.setDocument(this.document.addAttributeAtRange(Ce,ke,$n));if(Ce==="href"){const Un=Ne.textForStringWithAttributes(ke,{href:ke});return this.insertText(Un)}}setBlockAttribute(Ce,ke){const $n=this.getSelectedRange();if(this.canSetCurrentAttribute(Ce))return this.setDocument(this.document.applyBlockAttributeAtRange(Ce,ke,$n)),this.setSelection($n)}removeCurrentAttribute(Ce){return gt(Ce)?(this.removeBlockAttribute(Ce),this.updateCurrentAttributes()):(this.removeTextAttribute(Ce),delete this.currentAttributes[Ce],this.notifyDelegateOfCurrentAttributesChange())}removeTextAttribute(Ce){const ke=this.getSelectedRange();if(ke)return this.setDocument(this.document.removeAttributeAtRange(Ce,ke))}removeBlockAttribute(Ce){const ke=this.getSelectedRange();if(ke)return this.setDocument(this.document.removeAttributeAtRange(Ce,ke))}canDecreaseNestingLevel(){var Ce;return((Ce=this.getBlock())===null||Ce===void 0?void 0:Ce.getNes
Line truncated
|
||||
`?Hn+=1:ke=ke.removeTextAtRange(zn),zn=[Hn,Hn]):Ce.nextCharacter===`
|
||||
`?Ce.previousCharacter===`
|
||||
`?zn=[Hn-1,Hn+1]:(zn=[Hn,Hn+1],Hn+=1):Ce.startLocation.offset-1!=0&&(Hn+=1);const Un=new Je([$n.removeLastAttribute().copyWithoutText()]);return this.setDocument(ke.insertDocumentAtRange(Un,zn)),this.setSelection(Hn)}getPreviousBlock(){const Ce=this.getLocationRange();if(Ce){const{index:ke}=Ce[0];if(ke>0)return this.document.getBlockAtIndex(ke-1)}}getBlock(){const Ce=this.getLocationRange();if(Ce)return this.document.getBlockAtIndex(Ce[0].index)}getAttachmentAtRange(Ce){const ke=this.document.getDocumentAtRange(Ce);if(ke.toString()==="".concat("",`
|
||||
`))return ke.getAttachments()[0]}notifyDelegateOfCurrentAttributesChange(){var Ce,ke;return(Ce=this.delegate)===null||Ce===void 0||(ke=Ce.compositionDidChangeCurrentAttributes)===null||ke===void 0?void 0:ke.call(Ce,this.currentAttributes)}notifyDelegateOfInsertionAtRange(Ce){var ke,$n;return(ke=this.delegate)===null||ke===void 0||($n=ke.compositionDidPerformInsertionAtRange)===null||$n===void 0?void 0:$n.call(ke,Ce)}translateUTF16PositionFromOffset(Ce,ke){const $n=this.document.toUTF16String(),Hn=$n.offsetFromUCS2Offset(Ce);return $n.offsetToUCS2Offset(Hn+ke)}}gi.proxyMethod("getSelectionManager().getPointRange"),gi.proxyMethod("getSelectionManager().setLocationRangeFromPointRange"),gi.proxyMethod("getSelectionManager().createLocationRangeFromDOMRange"),gi.proxyMethod("getSelectionManager().locationIsCursorTarget"),gi.proxyMethod("getSelectionManager().selectionIsExpanded"),gi.proxyMethod("delegate?.getSelectionManager");class mi extends H{constructor(Ce){super(...arguments),this.composition=Ce,this.undoEntries=[],this.redoEntries=[]}recordUndoEntry(Ce){let{context:ke,consolidatable:$n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const Hn=this.undoEntries.slice(-1)[0];if(!$n||!pi(Hn,Ce,ke)){const zn=this.createEntry({description:Ce,context:ke});this.undoEntries.push(zn),this.redoEntries=[]}}undo(){const Ce=this.undoEntries.pop();if(Ce){const ke=this.createEntry(Ce);return this.redoEntries.push(ke),this.composition.loadSnapshot(Ce.snapshot)}}redo(){const Ce=this.redoEntries.pop();if(Ce){const ke=this.createEntry(Ce);return this.undoEntries.push(ke),this.composition.loadSnapshot(Ce.snapshot)}}canUndo(){return this.undoEntries.length>0}canRedo(){return this.redoEntries.length>0}createEntry(){let{description:Ce,context:ke}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{description:Ce==null?void 0:Ce.toString(),context:JSON.stringify(ke),snapshot:this.composition.getSnapshot()}}}const pi=(_n,Ce,ke)=>(_n==null?void 0:_n.description)===(Ce==null?void 0:Ce.toString())&&(_n==null?void 0:_n.context)===JSON.stringify(ke),fi="attachmentGallery";class bi{constructor(Ce){this.document=Ce.document,this.selectedRange=Ce.selectedRange}perform(){return this.removeBlockAttribute(),this.applyBlockAttribute()}getSnapshot(){return{document:this.document,selectedRange:this.selectedRange}}removeBlockAttribute(){return this.findRangesOfBlocks().map(Ce=>this.document=this.document.removeAttributeAtRange(fi,Ce))}applyBlockAttribute(){let Ce=0;this.findRangesOfPieces().forEach(ke=>{ke[1]-ke[0]>1&&(ke[0]+=Ce,ke[1]+=Ce,this.document.getCharacterAtPosition(ke[1])!==`
|
||||
`&&(this.document=this.document.insertBlockBreakAtRange(ke[1]),ke[1]<this.selectedRange[1]&&this.moveSelectedRangeForward(),ke[1]++,Ce++),ke[0]!==0&&this.document.getCharacterAtPosition(ke[0]-1)!==`
|
||||
`&&(this.document=this.document.insertBlockBreakAtRange(ke[0]),ke[0]<this.selectedRange[0]&&this.moveSelectedRangeForward(),ke[0]++,Ce++),this.document=this.document.applyBlockAttributeAtRange(fi,!0,ke))})}findRangesOfBlocks(){return this.document.findRangesForBlockAttribute(fi)}findRangesOfPieces(){return this.document.findRangesForTextAttribute("presentation",{withValue:"gallery"})}moveSelectedRangeForward(){this.selectedRange[0]+=1,this.selectedRange[1]+=1}}const vi=function(_n){const Ce=new bi(_n);return Ce.perform(),Ce.getSnapshot()},Ai=[vi];class xi{constructor(Ce,ke,$n){this.insertFiles=this.insertFiles.bind(this),this.composition=Ce,this.selectionManager=ke,this.element=$n,this.undoManager=new mi(this.composition),this.filters=Ai.slice(0)}loadDocument(Ce){return this.loadSnapshot({document:Ce,selectedRange:[0,0]})}loadHTML(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const ke=Xe.parse(Ce,{referenceElement:this.element}).getDocument();return this.loadDocument(ke)}loadJSON(Ce){let{document:ke,selectedRange:$n}=Ce;return ke=Je.fromJSON(ke),this.loadSnapshot({document:ke,selectedRange:$n})}loadSnapshot(Ce){return this.undoManager=new mi(this.composition),this.composition.loadSnapshot(Ce)}getDocument(){return this.composition.document}getSelectedDocument(){return this.composition.getSelectedDocument()}getSnapshot(){return this.composition.getSnapshot()}toJSON(){return this.getSnapshot()}deleteInDirection(Ce){return this.composition.deleteInDirection(Ce)}insertAttachment(Ce){return this.composition.insertAttachment(Ce)}insertAttachments(Ce){return this.composition.insertAttachments(Ce)}insertDocument(Ce){return this.composition.insertDocument(Ce)}insertFile(Ce){return this.composition.insertFile(Ce)}insertFiles(Ce){return this.composition.insertFiles(Ce)}insertHTML(Ce){return this.composition.insertHTML(Ce)}insertString(Ce){return this.composition.insertString(Ce)}insertText(Ce){return this.composition.insertText(Ce)}insertLineBreak(){return this.composition.insertLineBreak()}getSelectedRange(){return this.composition.getSelectedRange()}getPosition(){return this.composition.getPosition()}getClientRectAtPosition(Ce){const ke=this.getDocument().locationRangeFromRange([Ce,Ce+1]);return this.selectionManager.getClientRectAtLocationRange(ke)}expandSelectionInDirection(Ce){return this.composition.expandSelectionInDirection(Ce)}moveCursorInDirection(Ce){return this.composition.moveCursorInDirection(Ce)}setSelectedRange(Ce){return this.composition.setSelectedRange(Ce)}activateAttribute(Ce){let ke=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return this.composition.setCurrentAttribute(Ce,ke)}attributeIsActive(Ce){return this.composition.hasCurrentAttribute(Ce)}canActivateAttribute(Ce){return this.composition.canSetCurrentAttribute(Ce)}deactivateAttribute(Ce){return this.composition.removeCurrentAttribute(Ce)}setHTMLAtributeAtPosition(Ce,ke,$n){this.composition.setHTMLAtributeAtPosition(Ce,ke,$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(Ce){let{context:ke,consolidatable:$n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.undoManager.recordUndoEntry(Ce,{context:ke,consolidatable:$n})}redo(){if(this.canRedo())return this.undoManager.redo()}undo(){if(this.canUndo())return this.undoManager.undo()}}class yi{constructor(Ce){this.element=Ce}findLocationFromContainerAndOffset(Ce,ke){let{strict:$n}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{strict:!0},Hn=0,zn=!1;const Un={index:0,offset:0},qn=this.findAttachmentElementParentForNode(Ce);qn&&(Ce=qn.parentNode,ke=C$1(qn));const Xn=R(this.element,{usingFilter:Ei});for(;Xn.nextNode();){const Kn=Xn.currentNode;if(Kn===Ce&&O(Ce)){P(Kn)||(Un.offset+=ke);break}if(Kn.parentNode===Ce){if(Hn++===ke)break}else if(!y(Ce,Kn)&&Hn>0)break;T(Kn,{strict:$n})?(zn&&Un.index++,Un.offset=0,zn=!0):Un.offset+=Ci(Kn)}return Un}findContainerAndOffsetFromLocation(Ce){let ke,$n;if(Ce.index===0&&Ce.offset===0){for(ke=this.element,$n=0;ke.firstChild;)if(ke=ke.firstChild,w(ke)){$n=1;break}return[ke,$n]}let[Hn,zn]=this.findNodeAndOffsetFromLocation(Ce);if(Hn){if(O(Hn))Ci(Hn)===0?(ke=Hn.parentNode.parentNode,$n=C$1(Hn.parentNode),P(Hn,{name:"right"})&&$n++):(ke=Hn,$n=Ce.offset-zn);else{if(ke=Hn.parentNode,!T(Hn.previousSibling)&&!w(ke))for(;Hn===ke.lastChild&&(Hn=ke,ke=ke.parentNode,!w(ke)););$n=C$1(Hn),Ce.offset!==0&&$n++}return[ke,$n]}}findNodeAndOffsetFromLocation(Ce){let ke,$n,Hn=0;for(const zn of this.getSignificantNodesForIndex(Ce.index)){const Un=Ci(zn);if(Ce.offset<=Hn+Un)if(O(zn)){if(ke=zn,$n=Hn,Ce.offset===$n&&P
Line truncated
|
||||
`]):(Ce=qi($n),ke=qi(Hn)),{additions:Ce.filter((zn,Un)=>zn!==ke[Un]).map(Wt),deletions:ke.filter((zn,Un)=>zn!==Ce[Un]).map(Wt)}}getTextChangesFromCharacterData(){let Ce,ke;const $n=this.getMutationsByType("characterData");if($n.length){const Hn=$n[0],zn=$n[$n.length-1],Un=function(qn,Xn){let Kn,to;return qn=X.box(qn),(Xn=X.box(Xn)).length<qn.length?[to,Kn]=Vt(qn,Xn):[Kn,to]=Vt(Xn,qn),{added:Kn,removed:to}}(Wt(Hn.oldValue),Wt(zn.target.data));Ce=Un.added,ke=Un.removed}return{additions:Ce?[Ce]:[],deletions:ke?[ke]:[]}}}const qi=function(){let _n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const Ce=[];for(const ke of Array.from(_n))switch(ke.nodeType){case Node.TEXT_NODE:Ce.push(ke.data);break;case Node.ELEMENT_NODE:E(ke)==="br"?Ce.push(`
|
||||
`):Ce.push(...Array.from(qi(ke.childNodes)||[]))}return Ce};class Vi extends te{constructor(Ce){super(...arguments),this.file=Ce}perform(Ce){const ke=new FileReader;return ke.onerror=()=>Ce(!1),ke.onload=()=>{ke.onerror=null;try{ke.abort()}catch{}return Ce(!0,this.file)},ke.readAsArrayBuffer(this.file)}}class Hi{constructor(Ce){this.element=Ce}shouldIgnore(Ce){return!!a.samsungAndroid&&(this.previousEvent=this.event,this.event=Ce,this.checkSamsungKeyboardBuggyModeStart(),this.checkSamsungKeyboardBuggyModeEnd(),this.buggyMode)}checkSamsungKeyboardBuggyModeStart(){this.insertingLongTextAfterUnidentifiedChar()&&zi(this.element.innerText,this.event.data)&&(this.buggyMode=!0,this.event.preventDefault())}checkSamsungKeyboardBuggyModeEnd(){this.buggyMode&&this.event.inputType!=="insertText"&&(this.buggyMode=!1)}insertingLongTextAfterUnidentifiedChar(){var Ce;return this.isBeforeInputInsertText()&&this.previousEventWasUnidentifiedKeydown()&&((Ce=this.event.data)===null||Ce===void 0?void 0:Ce.length)>50}isBeforeInputInsertText(){return this.event.type==="beforeinput"&&this.event.inputType==="insertText"}previousEventWasUnidentifiedKeydown(){var Ce,ke;return((Ce=this.previousEvent)===null||Ce===void 0?void 0:Ce.type)==="keydown"&&((ke=this.previousEvent)===null||ke===void 0?void 0:ke.key)==="Unidentified"}}const zi=(_n,Ce)=>Ji(_n)===Ji(Ce),_i=new RegExp("(".concat("","|").concat(h,"|").concat(d,"|\\s)+"),"g"),Ji=_n=>_n.replace(_i," ").trim();class Ki extends H{constructor(Ce){super(...arguments),this.element=Ce,this.mutationObserver=new Ui(this.element),this.mutationObserver.delegate=this,this.flakyKeyboardDetector=new Hi(this.element);for(const ke in this.constructor.events)f(ke,{onElement:this.element,withCallback:this.handlerFor(ke)})}elementDidMutate(Ce){}editorWillSyncDocumentView(){return this.mutationObserver.stop()}editorDidSyncDocumentView(){return this.mutationObserver.start()}requestRender(){var Ce,ke;return(Ce=this.delegate)===null||Ce===void 0||(ke=Ce.inputControllerDidRequestRender)===null||ke===void 0?void 0:ke.call(Ce)}requestReparse(){var Ce,ke;return(Ce=this.delegate)===null||Ce===void 0||(ke=Ce.inputControllerDidRequestReparse)===null||ke===void 0||ke.call(Ce),this.requestRender()}attachFiles(Ce){const ke=Array.from(Ce).map($n=>new Vi($n));return Promise.all(ke).then($n=>{this.handleInput(function(){var Hn,zn;return(Hn=this.delegate)===null||Hn===void 0||Hn.inputControllerWillAttachFiles(),(zn=this.responder)===null||zn===void 0||zn.insertFiles($n),this.requestRender()})})}handlerFor(Ce){return ke=>{ke.defaultPrevented||this.handleInput(()=>{if(!x(this.element)){if(this.flakyKeyboardDetector.shouldIgnore(ke))return;this.eventName=Ce,this.constructor.events[Ce].call(this,ke)}})}}handleInput(Ce){try{var ke;(ke=this.delegate)===null||ke===void 0||ke.inputControllerWillHandleInput(),Ce.call(this)}finally{var $n;($n=this.delegate)===null||$n===void 0||$n.inputControllerDidHandleInput()}}createLinkHTML(Ce,ke){const $n=document.createElement("a");return $n.href=Ce,$n.textContent=ke||Ce,$n.outerHTML}}var Gi;Re(Ki,"events",{});const{browser:$i,keyNames:Xi}=V;let Yi=0;class Qi extends Ki{constructor(){super(...arguments),this.resetInputSummary()}setInputSummary(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.inputSummary.eventName=this.eventName;for(const ke in Ce){const $n=Ce[ke];this.inputSummary[ke]=$n}return this.inputSummary}resetInputSummary(){this.inputSummary={}}reset(){return this.resetInputSummary(),Pt.reset()}elementDidMutate(Ce){var ke,$n;return this.isComposing()?(ke=this.delegate)===null||ke===void 0||($n=ke.inputControllerDidAllowUnhandledInput)===null||$n===void 0?void 0:$n.call(ke):this.handleInput(function(){return this.mutationIsSignificant(Ce)&&(this.mutationIsExpected(Ce)?this.requestRender():this.requestReparse()),this.reset()})}mutationIsExpected(Ce){let{textAdded:ke,textDeleted:$n}=Ce;if(this.inputSummary.preferDocument)return!0;const Hn=ke!=null?ke===this.inputSummary.textAdded:!this.inputSummary.textAdded,zn=$n!=null?this.inputSummary.didDelete:!this.inputSummary.didDelete,Un=[`
|
||||
`,`
|
||||
`].includes(ke)&&!Hn,qn=$n===`
|
||||
`&&!zn;if(Un&&!qn||qn&&!Un){const Kn=this.getSelectedRange();if(Kn){var Xn;const to=Un?ke.replace(/\n$/,"").length||-1:(ke==null?void 0:ke.length)||1;if((Xn=this.responder)!==null&&Xn!==void 0&&Xn.positionIsBlockBreak(Kn[1]+to))return!0}}return Hn&&zn}mutationIsSignificant(Ce){var ke;const $n=Object.keys(Ce).length>0,Hn=((ke=this.compositionInput)===null||ke===void 0?void 0:ke.getEndData())==="";return $n||!Hn}getCompositionInput(){if(this.isComposing())return this.compositionInput;this.compositionInput=new rn(this)}isComposing(){return this.compositionInput&&!this.compositionInput.isEnded()}deleteInDirection(Ce,ke){var $n;return(($n=this.responder)===null||$n===void 0?void 0:$n.deleteInDirection(Ce))!==!1?this.setInputSummary({didDelete:!0}):ke?(ke.preventDefault(),this.requestRender()):void 0}serializeSelectionToDataTransfer(Ce){var ke;if(!function(Hn){if(Hn==null||!Hn.setData)return!1;for(const zn in yt){const Un=yt[zn];try{if(Hn.setData(zn,Un),!Hn.getData(zn)===Un)return!1}catch{return!1}}return!0}(Ce))return;const $n=(ke=this.responder)===null||ke===void 0?void 0:ke.getSelectedDocument().toSerializableDocument();return Ce.setData("application/x-trix-document",JSON.stringify($n)),Ce.setData("text/html",ve.render($n).innerHTML),Ce.setData("text/plain",$n.toString().replace(/\n$/,"")),!0}canAcceptDataTransfer(Ce){const ke={};return Array.from((Ce==null?void 0:Ce.types)||[]).forEach($n=>{ke[$n]=!0}),ke.Files||ke["application/x-trix-document"]||ke["text/html"]||ke["text/plain"]}getPastedHTMLUsingHiddenElement(Ce){const ke=this.getSelectedRange(),$n={position:"absolute",left:"".concat(window.pageXOffset,"px"),top:"".concat(window.pageYOffset,"px"),opacity:0},Hn=S$1({style:$n,tagName:"div",editable:!0});return document.body.appendChild(Hn),Hn.focus(),requestAnimationFrame(()=>{const zn=Hn.innerHTML;return k(Hn),this.setSelectedRange(ke),Ce(zn)})}}Re(Qi,"events",{keydown(_n){this.isComposing()||this.resetInputSummary(),this.inputSummary.didInput=!0;const Ce=Xi[_n.keyCode];if(Ce){var ke;let Hn=this.keys;["ctrl","alt","shift","meta"].forEach(zn=>{var Un;_n["".concat(zn,"Key")]&&(zn==="ctrl"&&(zn="control"),Hn=(Un=Hn)===null||Un===void 0?void 0:Un[zn])}),((ke=Hn)===null||ke===void 0?void 0:ke[Ce])!=null&&(this.setInputSummary({keyName:Ce}),Pt.reset(),Hn[Ce].call(this,_n))}if(kt(_n)){const Hn=String.fromCharCode(_n.keyCode).toLowerCase();if(Hn){var $n;const zn=["alt","shift"].map(Un=>{if(_n["".concat(Un,"Key")])return Un}).filter(Un=>Un);zn.push(Hn),($n=this.delegate)!==null&&$n!==void 0&&$n.inputControllerDidReceiveKeyboardCommand(zn)&&_n.preventDefault()}}},keypress(_n){if(this.inputSummary.eventName!=null||_n.metaKey||_n.ctrlKey&&!_n.altKey)return;const Ce=en(_n);var ke,$n;return Ce?((ke=this.delegate)===null||ke===void 0||ke.inputControllerWillPerformTyping(),($n=this.responder)===null||$n===void 0||$n.insertString(Ce),this.setInputSummary({textAdded:Ce,didDelete:this.selectionIsExpanded()})):void 0},textInput(_n){const{data:Ce}=_n,{textAdded:ke}=this.inputSummary;if(ke&&ke!==Ce&&ke.toUpperCase()===Ce){var $n;const Hn=this.getSelectedRange();return this.setSelectedRange([Hn[0],Hn[1]+ke.length]),($n=this.responder)===null||$n===void 0||$n.insertString(Ce),this.setInputSummary({textAdded:Ce}),this.setSelectedRange(Hn)}},dragenter(_n){_n.preventDefault()},dragstart(_n){var Ce,ke;return this.serializeSelectionToDataTransfer(_n.dataTransfer),this.draggedRange=this.getSelectedRange(),(Ce=this.delegate)===null||Ce===void 0||(ke=Ce.inputControllerDidStartDrag)===null||ke===void 0?void 0:ke.call(Ce)},dragover(_n){if(this.draggedRange||this.canAcceptDataTransfer(_n.dataTransfer)){_n.preventDefault();const $n={x:_n.clientX,y:_n.clientY};var Ce,ke;if(!St($n,this.draggingPoint))return this.draggingPoint=$n,(Ce=this.delegate)===null||Ce===void 0||(ke=Ce.inputControllerDidReceiveDragOverPoint)===null||ke===void 0?void 0:ke.call(Ce,this.draggingPoint)}},dragend(_n){var Ce,ke;(Ce=this.delegate)===null||Ce===void 0||(ke=Ce.inputControllerDidCancelDrag)===null||ke===void 0||ke.call(Ce),this.draggedRange=null,this.draggingPoint=null},drop(_n){var Ce,ke;_n.preventDefault();const $n=(Ce=_n.dataTransfer)===null||Ce===void 0?void 0:Ce.files,Hn=_n.dataTransfer.getData("application/x-trix-document"),zn={x:_n.clientX,y:_n.clientY};if((ke=this.responder)===null||ke===void 0||ke.setLocationRangeFromPointRange(zn),$n!=null&&$n.length)this.attachFiles($n);else if(this.draggedRange){var Un,qn;(Un=this.delegate)===null||Un===void 0||Un.inputControllerWillMoveText(),(qn=this.responder)===null||qn===void 0||qn.moveTextFromRange(this.draggedRange),this.draggedRange=null,this.requestRender()}else if(Hn){var Xn;const Kn=Je.fromJSONString(Hn);(Xn=this.responder)===null||Xn===void 0||Xn.insertDocument(Kn),this.requestRender()}this.draggedRange=null,this.draggingPoint=null},cut(_n){var Ce,ke;if((Ce=this.responder)!==null&&Ce!==void 0&&Ce.selectionIsExpanded()&&(this.serializeSelectionToDataTransfer(_n.clipboardData)&&_n.preventDefault(),(ke=this.del
Line truncated
|
||||
`,{updatePosition:!1}),this.requestRender()}},shift:{return(_n){var Ce,ke;(Ce=this.delegate)===null||Ce===void 0||Ce.inputControllerWillPerformTyping(),(ke=this.responder)===null||ke===void 0||ke.insertString(`
|
||||
`),this.requestRender(),_n.preventDefault()},tab(_n){var Ce,ke;(Ce=this.responder)!==null&&Ce!==void 0&&Ce.canDecreaseNestingLevel()&&((ke=this.responder)===null||ke===void 0||ke.decreaseNestingLevel(),this.requestRender(),_n.preventDefault())},left(_n){if(this.selectionIsInCursorTarget())return _n.preventDefault(),this.expandSelectionInDirection("backward")},right(_n){if(this.selectionIsInCursorTarget())return _n.preventDefault(),this.expandSelectionInDirection("forward")}},alt:{backspace(_n){var Ce;return this.setInputSummary({preferDocument:!1}),(Ce=this.delegate)===null||Ce===void 0?void 0:Ce.inputControllerWillPerformTyping()}},meta:{backspace(_n){var Ce;return this.setInputSummary({preferDocument:!1}),(Ce=this.delegate)===null||Ce===void 0?void 0:Ce.inputControllerWillPerformTyping()}}}),Qi.proxyMethod("responder?.getSelectedRange"),Qi.proxyMethod("responder?.setSelectedRange"),Qi.proxyMethod("responder?.expandSelectionInDirection"),Qi.proxyMethod("responder?.selectionIsInCursorTarget"),Qi.proxyMethod("responder?.selectionIsExpanded");const Zi=_n=>{var Ce;return(Ce=_n.type)===null||Ce===void 0||(Ce=Ce.match(/\/(\w+)$/))===null||Ce===void 0?void 0:Ce[1]},tn=!((Gi=" ".codePointAt)===null||Gi===void 0||!Gi.call(" ",0)),en=function(_n){if(_n.key&&tn&&_n.key.codePointAt(0)===_n.keyCode)return _n.key;{let Ce;if(_n.which===null?Ce=_n.keyCode:_n.which!==0&&_n.charCode!==0&&(Ce=_n.charCode),Ce!=null&&Xi[Ce]!=="escape")return X.fromCodepoints([Ce]).toString()}},nn=function(_n){const Ce=_n.clipboardData;if(Ce){if(Ce.types.includes("text/html")){for(const ke of Ce.types){const $n=/^CorePasteboardFlavorType/.test(ke),Hn=/^dyn\./.test(ke)&&Ce.getData(ke);if($n||Hn)return!0}return!1}{const ke=Ce.types.includes("com.apple.webarchive"),$n=Ce.types.includes("com.apple.flat-rtfd");return ke||$n}}};class rn extends H{constructor(Ce){super(...arguments),this.inputController=Ce,this.responder=this.inputController.responder,this.delegate=this.inputController.delegate,this.inputSummary=this.inputController.inputSummary,this.data={}}start(Ce){if(this.data.start=Ce,this.isSignificant()){var ke,$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=(ke=this.responder)===null||ke===void 0?void 0:ke.getSelectedRange()}}update(Ce){if(this.data.update=Ce,this.isSignificant()){const ke=this.selectPlaceholder();ke&&(this.forgetPlaceholder(),this.range=ke)}}end(Ce){return this.data.end=Ce,this.isSignificant()?(this.forgetPlaceholder(),this.canApplyToDocument()?(this.setInputSummary({preferDocument:!0,didInput:!1}),(ke=this.delegate)===null||ke===void 0||ke.inputControllerWillPerformTyping(),($n=this.responder)===null||$n===void 0||$n.setSelectedRange(this.range),(Hn=this.responder)===null||Hn===void 0||Hn.insertString(this.data.end),(zn=this.responder)===null||zn===void 0?void 0:zn.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 ke,$n,Hn,zn}getEndData(){return this.data.end}isEnded(){return this.getEndData()!=null}isSignificant(){return!$i.composesExistingText||this.inputSummary.didInput}canApplyToDocument(){var Ce,ke;return((Ce=this.data.start)===null||Ce===void 0?void 0:Ce.length)===0&&((ke=this.data.end)===null||ke===void 0?void 0:ke.length)>0&&this.range}}rn.proxyMethod("inputController.setInputSummary"),rn.proxyMethod("inputController.requestRender"),rn.proxyMethod("inputController.requestReparse"),rn.proxyMethod("responder?.selectionIsExpanded"),rn.proxyMethod("responder?.insertPlaceholder"),rn.proxyMethod("responder?.selectPlaceholder"),rn.proxyMethod("responder?.forgetPlaceholder");class on extends Ki{constructor(){super(...arguments),this.render=this.render.bind(this)}elementDidMutate(){return this.scheduledRender?this.composing?(Ce=this.delegate)===null||Ce===void 0||(ke=Ce.inputControllerDidAllowUnhandledInput)===null||ke===void 0?void 0:ke.call(Ce):void 0:this.reparse();var Ce,ke}scheduleRender(){return this.scheduledRender?this.scheduledRender:this.scheduledRender=requestAnimationFrame(this.render)}render(){var Ce,ke;cancelAnimationFrame(this.scheduledRender),this.scheduledRender=null,this.composing||(ke=this.delegate)===null||ke===void 0||ke.render(),(Ce=this.afterRender)===null||Ce===void 0||Ce.call(this),this.afterRender=null}reparse(){var Ce;return(Ce=this.delegate)===null||Ce===void 0?void 0:Ce.reparse()}insertString(){var Ce;let ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",$n=arguments.length>1?arguments[1]:void 0;return(Ce=this.delegate)===null||Ce===void 0||Ce.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var Hn;return(Hn=this.responder)===null||Hn===void 0?void 0:Hn.insertString(ke,$n)})}toggleAttributeIfSupported(Ce){var ke;if(dt().includes(Ce))return(ke
Line truncated
|
||||
`)},insertLink(){return this.activateAttributeIfSupported("href",this.event.data)},insertOrderedList(){return this.toggleAttributeIfSupported("number")},insertParagraph(){var _n;return(_n=this.delegate)===null||_n===void 0||_n.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var Ce;return(Ce=this.responder)===null||Ce===void 0?void 0:Ce.insertLineBreak()})},insertReplacementText(){const _n=this.event.dataTransfer.getData("text/plain"),Ce=this.event.getTargetRanges()[0];this.withTargetDOMRange(Ce,()=>{this.insertString(_n,{updatePosition:!1})})},insertText(){var _n;return this.insertString(this.event.data||((_n=this.event.dataTransfer)===null||_n===void 0?void 0:_n.getData("text/plain")))},insertTranspose(){return this.insertString(this.event.data)},insertUnorderedList(){return this.toggleAttributeIfSupported("bullet")}});const sn=function(_n){const Ce=document.createRange();return Ce.setStart(_n.startContainer,_n.startOffset),Ce.setEnd(_n.endContainer,_n.endOffset),Ce},an=_n=>{var Ce;return Array.from(((Ce=_n.dataTransfer)===null||Ce===void 0?void 0:Ce.types)||[]).includes("Files")},ln=_n=>{var Ce;return((Ce=_n.dataTransfer.files)===null||Ce===void 0?void 0:Ce[0])&&!cn(_n)&&!(ke=>{let{dataTransfer:$n}=ke;return $n.types.includes("Files")&&$n.types.includes("text/html")&&$n.getData("text/html").includes("urn:schemas-microsoft-com:office:office")})(_n)},cn=function(_n){const Ce=_n.clipboardData;if(Ce)return Array.from(Ce.types).filter(ke=>ke.match(/file/i)).length===Ce.types.length&&Ce.files.length>=1},un=function(_n){const Ce=_n.clipboardData;if(Ce)return Ce.types.includes("text/plain")&&Ce.types.length===1},hn=function(_n){const Ce=[];return _n.altKey&&Ce.push("alt"),_n.shiftKey&&Ce.push("shift"),Ce.push(_n.key),Ce},dn=_n=>({x:_n.clientX,y:_n.clientY}),gn="[data-trix-attribute]",mn="[data-trix-action]",pn="".concat(gn,", ").concat(mn),fn="[data-trix-dialog]",bn="".concat(fn,"[data-trix-active]"),vn="".concat(fn," [data-trix-method]"),An="".concat(fn," [data-trix-input]"),xn=(_n,Ce)=>(Ce||(Ce=Cn(_n)),_n.querySelector("[data-trix-input][name='".concat(Ce,"']"))),yn=_n=>_n.getAttribute("data-trix-action"),Cn=_n=>_n.getAttribute("data-trix-attribute")||_n.getAttribute("data-trix-dialog-attribute");class kn extends H{constructor(Ce){super(Ce),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=Ce,this.attributes={},this.actions={},this.resetDialogInputs(),f("mousedown",{onElement:this.element,matchingSelector:mn,withCallback:this.didClickActionButton}),f("mousedown",{onElement:this.element,matchingSelector:gn,withCallback:this.didClickAttributeButton}),f("click",{onElement:this.element,matchingSelector:pn,preventDefault:!0}),f("click",{onElement:this.element,matchingSelector:vn,withCallback:this.didClickDialogButton}),f("keydown",{onElement:this.element,matchingSelector:An,withCallback:this.didKeyDownDialogInput})}didClickActionButton(Ce,ke){var $n;($n=this.delegate)===null||$n===void 0||$n.toolbarDidClickButton(),Ce.preventDefault();const Hn=yn(ke);return this.getDialog(Hn)?this.toggleDialog(Hn):(zn=this.delegate)===null||zn===void 0?void 0:zn.toolbarDidInvokeAction(Hn,ke);var zn}didClickAttributeButton(Ce,ke){var $n;($n=this.delegate)===null||$n===void 0||$n.toolbarDidClickButton(),Ce.preventDefault();const Hn=Cn(ke);var zn;return this.getDialog(Hn)?this.toggleDialog(Hn):(zn=this.delegate)===null||zn===void 0||zn.toolbarDidToggleAttribute(Hn),this.refreshAttributeButtons()}didClickDialogButton(Ce,ke){const $n=A(ke,{matchingSelector:fn});return this[ke.getAttribute("data-trix-method")].call(this,$n)}didKeyDownDialogInput(Ce,ke){if(Ce.keyCode===13){Ce.preventDefault();const $n=ke.getAttribute("name"),Hn=this.getDialog($n);this.setAttribute(Hn)}if(Ce.keyCode===27)return Ce.preventDefault(),this.hideDialog()}updateActions(Ce){return this.actions=Ce,this.refreshActionButtons()}refreshActionButtons(){return this.eachActionButton((Ce,ke)=>{Ce.disabled=this.actions[ke]===!1})}eachActionButton(Ce){return Array.from(this.element.querySelectorAll(mn)).map(ke=>Ce(ke,yn(ke)))}updateAttributes(Ce){return this.attributes=Ce,this.refreshAttributeButtons()}refreshAttributeButtons(){return this.eachAttributeButton((Ce,ke)=>(Ce.disabled=this.attributes[ke]===!1,this.attributes[ke]||this.dialogIsVisible(ke)?(Ce.setAttribute("data-trix-active",""),Ce.classList.add("trix-active")):(Ce.removeAttribute("data-trix-active"),Ce.classList.remove("trix-active"))))}eachAttributeButton(Ce){return Array.from(this.element.querySelectorAll(gn)).map(ke=>Ce(ke,Cn(ke)))}applyKeyboardCommand(Ce){const ke=JSON.stringify(Ce.sort());for(const $n of Array.from(this.element.querySelectorAll("[data-trix-key]"))){const Hn=$n.getAttribute("data-trix-key").split("+");if(JSON.stringify(Hn.sort())===ke)return b("mousedo
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 Dn extends HTMLElement{connectedCallback(){this.innerHTML===""&&(this.innerHTML=U.getDefaultHTML())}}let wn=0;const Tn=function(_n){if(!_n.hasAttribute("contenteditable"))return _n.setAttribute("contenteditable",""),function(Ce){let ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ke.times=1,f(Ce,ke)}("focus",{onElement:_n,withCallback:()=>Bn(_n)})},Bn=function(_n){return Fn(_n),Pn()},Fn=function(_n){var Ce,ke;if((Ce=(ke=document).queryCommandSupported)!==null&&Ce!==void 0&&Ce.call(ke,"enableObjectResizing"))return document.execCommand("enableObjectResizing",!1,!1),f("mscontrolselect",{onElement:_n,preventDefault:!0})},Pn=function(_n){var Ce,ke;if((Ce=(ke=document).queryCommandSupported)!==null&&Ce!==void 0&&Ce.call(ke,"DefaultParagraphSeparator")){const{tagName:$n}=n.default;if(["div","p"].includes($n))return document.execCommand("DefaultParagraphSeparator",!1,$n)}},In=a.forcesObjectResizing?{display:"inline",width:"auto"}:{display:"inline-block",width:"1px"};bt("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(e,` figcaption textarea {
|
||||
resize: none;
|
||||
}
|
||||
|
||||
%t `).concat(e,` figcaption textarea.trix-autoresize-clone {
|
||||
position: absolute;
|
||||
left: -9999px;
|
||||
max-height: 0px;
|
||||
}
|
||||
|
||||
%t `).concat(e,` figcaption[data-trix-placeholder]:empty::before {
|
||||
content: attr(data-trix-placeholder);
|
||||
color: graytext;
|
||||
}
|
||||
|
||||
%t [data-trix-cursor-target] {
|
||||
display: `).concat(In.display,` !important;
|
||||
width: `).concat(In.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;
|
||||
}`));class Nn extends HTMLElement{get trixId(){return this.hasAttribute("trix-id")?this.getAttribute("trix-id"):(this.setAttribute("trix-id",++wn),this.trixId)}get labels(){const Ce=[];this.id&&this.ownerDocument&&Ce.push(...Array.from(this.ownerDocument.querySelectorAll("label[for='".concat(this.id,"']"))||[]));const ke=A(this,{matchingSelector:"label"});return ke&&[this,null].includes(ke.control)&&Ce.push(ke),Ce}get toolbarElement(){var Ce;if(this.hasAttribute("toolbar"))return(Ce=this.ownerDocument)===null||Ce===void 0?void 0:Ce.getElementById(this.getAttribute("toolbar"));if(this.parentNode){const ke="trix-toolbar-".concat(this.trixId);this.setAttribute("toolbar",ke);const $n=S$1("trix-toolbar",{id:ke});return this.parentNode.insertBefore($n,this),$n}}get form(){var Ce;return(Ce=this.inputElement)===null||Ce===void 0?void 0:Ce.form}get inputElement(){var Ce;if(this.hasAttribute("input"))return(Ce=this.ownerDocument)===null||Ce===void 0?void 0:Ce.getElementById(this.getAttribute("input"));if(this.parentNode){const ke="trix-input-".concat(this.trixId);this.setAttribute("input",ke);const $n=S$1("input",{type:"hidden",id:ke});return this.parentNode.insertBefore($n,this.nextElementSibling),$n}}get editor(){var Ce;return(Ce=this.editorController)===null||Ce===void 0?void 0:Ce.editor}get name(){var Ce;return(Ce=this.inputElement)===null||Ce===void 0?void 0:Ce.name}get value(){var Ce;return(Ce=this.inputElement)===null||Ce===void 0?void 0:Ce.value}set value(Ce){var ke;this.defaultValue=Ce,(ke=this.editor)===null||ke===void 0||ke.loadHTML(this.defaultValue)}notify(Ce,ke){if(this.editorController)return b("trix-".concat(Ce),{onElement:this,attributes:ke})}setInputElementValue(Ce){this.inputElement&&(this.inputElement.value=Ce)}connectedCallback(){this.hasAttribute("data-trix-internal")||(Tn(this),function(Ce){Ce.hasAttribute("role")||Ce.setAttribute("role","textbox")}(this),function(Ce){if(Ce.hasAttribute("aria-label")||Ce.hasAttribute("aria-labelledby"))return;const ke=function(){const $n=Array.from(Ce.labels).map(zn=>{if(!zn.contains(Ce))return zn.textContent}).filter(zn=>zn),Hn=$n.join(" ");return Hn?Ce.setAttribute("aria-label",Hn):Ce.removeAttribute("aria-label")};ke(),f("focus",{onElement:Ce,withCallback:ke})}(this),this.editorController||(b("trix-before-initialize",{onElement:this}),this.editorController=new Rn({editorElement:this,html:this.defaultValue=this.value}),requestAnimationFrame(()=>b("trix-initialize",{onElement:this}))),this.editorController.registerSelectionManager(),this.registerResetListener(),this.registerClickListener(),function(Ce){!document.querySelector(":focus")&&Ce.hasAttribute("autofocus")&&document.querySelector("[autofocus]")===Ce&&Ce.focus()}(this))}disconnectedCallback(){var Ce;return(Ce=this.editorController)===null||Ce===void 0||Ce.unregisterSelectionManager(),this.unregisterResetListener(),this.unregisterClickListener()}registerResetListener(){return this.resetListener=this.resetBubbled.bind(this),window.addEventListener("reset",this.resetListener,!1)}unregisterResetListener(){return window.removeEventListener("reset",this.resetListener,!1)}registerClickListener(){return this.clickListener=this.clickBubbled.bind(this),window.addEventListener("click",this.clickListener,!1)}unregisterClickListener(){return window.removeEventListener("click",this.clickListener,!1)}resetBubbled(Ce){if(!Ce.defaultPrevented&&Ce.target===this.form)return this.reset()}clickBubbled(Ce){if(Ce.defaultPrevented||this.contains(Ce.target))return;const ke=A(Ce.target,{matchingSelector:"label"});return ke&&Array.from(this.labels).includes(ke)?this.focus():void 0}reset(){this.value=this.defaultValue}}const On={VERSION:t$1,config:V,core:ci,models:Di,views:wi,controllers:En,observers:Sn,operations:Ln,elements:Object.freeze({__proto__:null,TrixEditorElement:Nn,TrixToolbarElement:Dn}),filters:Object.freeze({__proto__:null,Filter:bi,attachmentGalleryFilter:vi})};Object.assign(On,Di),window.Trix=On,setTimeout(function(){customElements.get("trix-toolbar")||customElements.define("trix-toolbar",Dn),customElements.get("trix-editor")||customElements.define("trix-editor",Nn)},0);function create_fragment$k(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn;return{c(){Ce=element("div"),ke=element("input"),Hn=space$3(),zn=element("trix-editor"),attr(ke,"id",$n="x-"+_n[1].name),ke.value=_n[0],attr(ke,"type","hidden"),set_custom_element_data(zn,"class","content"),set_custom_element_data(zn,"input",Un="x-"+_n[1].name),set_custom_element_data(zn,"role","textbox"),set_custom_element_data(zn,"tabindex","0"),attr(Ce,"class","tox-wrapper")},m(Kn,to){insert$1(Kn,Ce,to),append(Ce,ke),append(Ce,Hn),append(Ce,zn),_n[5](zn),qn||(Xn=listen(zn,"trix-change",_n[3]),qn=!0)},p(Kn,[to]){to&2&&$n!==($n="x-"+Kn[1].name)&&attr(ke,"id",$n),to&1&&(ke.value=Kn[0]),to&2&&Un!==(Un="x-"+Kn[1].name)&&set_custom_element_data(zn,"input",Un)},i:noop,o:noop,d(Kn){Kn&&detach(Ce),_n[5](null),qn=!1,Xn()}}}function instance$k(_n,Ce,ke){let{value:$n=""}=Ce,{field:Hn}=Ce,zn;functio
Line truncated
|
||||
`){[Ce,ke]=clip(this,Ce,ke);let Hn="";for(let zn=0,Un=0;zn<=ke&&Un<this.text.length;Un++){let qn=this.text[Un],Xn=zn+qn.length;zn>Ce&&Un&&(Hn+=$n),Ce<Xn&&ke>zn&&(Hn+=qn.slice(Math.max(0,Ce-zn),ke-zn)),zn=Xn+1}return Hn}flatten(Ce){for(let ke of this.text)Ce.push(ke)}scanIdentical(){return 0}static split(Ce,ke){let $n=[],Hn=-1;for(let zn of Ce)$n.push(zn),Hn+=zn.length+1,$n.length==32&&(ke.push(new TextLeaf($n,Hn)),$n=[],Hn=-1);return Hn>-1&&ke.push(new TextLeaf($n,Hn)),ke}}class TextNode extends Text{constructor(Ce,ke){super(),this.children=Ce,this.length=ke,this.lines=0;for(let $n of Ce)this.lines+=$n.lines}lineInner(Ce,ke,$n,Hn){for(let zn=0;;zn++){let Un=this.children[zn],qn=Hn+Un.length,Xn=$n+Un.lines-1;if((ke?Xn:qn)>=Ce)return Un.lineInner(Ce,ke,$n,Hn);Hn=qn+1,$n=Xn+1}}decompose(Ce,ke,$n,Hn){for(let zn=0,Un=0;Un<=ke&&zn<this.children.length;zn++){let qn=this.children[zn],Xn=Un+qn.length;if(Ce<=Xn&&ke>=Un){let Kn=Hn&((Un<=Ce?1:0)|(Xn>=ke?2:0));Un>=Ce&&Xn<=ke&&!Kn?$n.push(qn):qn.decompose(Ce-Un,ke-Un,$n,Kn)}Un=Xn+1}}replace(Ce,ke,$n){if([Ce,ke]=clip(this,Ce,ke),$n.lines<this.lines)for(let Hn=0,zn=0;Hn<this.children.length;Hn++){let Un=this.children[Hn],qn=zn+Un.length;if(Ce>=zn&&ke<=qn){let Xn=Un.replace(Ce-zn,ke-zn,$n),Kn=this.lines-Un.lines+Xn.lines;if(Xn.lines<Kn>>4&&Xn.lines>Kn>>6){let to=this.children.slice();return to[Hn]=Xn,new TextNode(to,this.length-(ke-Ce)+$n.length)}return super.replace(zn,qn,Xn)}zn=qn+1}return super.replace(Ce,ke,$n)}sliceString(Ce,ke=this.length,$n=`
|
||||
`){[Ce,ke]=clip(this,Ce,ke);let Hn="";for(let zn=0,Un=0;zn<this.children.length&&Un<=ke;zn++){let qn=this.children[zn],Xn=Un+qn.length;Un>Ce&&zn&&(Hn+=$n),Ce<Xn&&ke>Un&&(Hn+=qn.sliceString(Ce-Un,ke-Un,$n)),Un=Xn+1}return Hn}flatten(Ce){for(let ke of this.children)ke.flatten(Ce)}scanIdentical(Ce,ke){if(!(Ce instanceof TextNode))return 0;let $n=0,[Hn,zn,Un,qn]=ke>0?[0,0,this.children.length,Ce.children.length]:[this.children.length-1,Ce.children.length-1,-1,-1];for(;;Hn+=ke,zn+=ke){if(Hn==Un||zn==qn)return $n;let Xn=this.children[Hn],Kn=Ce.children[zn];if(Xn!=Kn)return $n+Xn.scanIdentical(Kn,ke);$n+=Xn.length+1}}static from(Ce,ke=Ce.reduce(($n,Hn)=>$n+Hn.length+1,-1)){let $n=0;for(let ho of Ce)$n+=ho.lines;if($n<32){let ho=[];for(let bo of Ce)bo.flatten(ho);return new TextLeaf(ho,ke)}let Hn=Math.max(32,$n>>5),zn=Hn<<1,Un=Hn>>1,qn=[],Xn=0,Kn=-1,to=[];function io(ho){let bo;if(ho.lines>zn&&ho instanceof TextNode)for(let Oo of ho.children)io(Oo);else ho.lines>Un&&(Xn>Un||!Xn)?(uo(),qn.push(ho)):ho instanceof TextLeaf&&Xn&&(bo=to[to.length-1])instanceof TextLeaf&&ho.lines+bo.lines<=32?(Xn+=ho.lines,Kn+=ho.length+1,to[to.length-1]=new TextLeaf(bo.text.concat(ho.text),bo.length+1+ho.length)):(Xn+ho.lines>Hn&&uo(),Xn+=ho.lines,Kn+=ho.length+1,to.push(ho))}function uo(){Xn!=0&&(qn.push(to.length==1?to[0]:TextNode.from(to,Kn)),Kn=-1,Xn=to.length=0)}for(let ho of Ce)io(ho);return uo(),qn.length==1?qn[0]:new TextNode(qn,ke)}}Text.empty=new TextLeaf([""],0);function textLength(_n){let Ce=-1;for(let ke of _n)Ce+=ke.length+1;return Ce}function appendText(_n,Ce,ke=0,$n=1e9){for(let Hn=0,zn=0,Un=!0;zn<_n.length&&Hn<=$n;zn++){let qn=_n[zn],Xn=Hn+qn.length;Xn>=ke&&(Xn>$n&&(qn=qn.slice(0,$n-Hn)),Hn<ke&&(qn=qn.slice(ke-Hn)),Un?(Ce[Ce.length-1]+=qn,Un=!1):Ce.push(qn)),Hn=Xn+1}return Ce}function sliceText(_n,Ce,ke){return appendText(_n,[""],Ce,ke)}class RawTextCursor{constructor(Ce,ke=1){this.dir=ke,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[Ce],this.offsets=[ke>0?1:(Ce instanceof TextLeaf?Ce.text.length:Ce.children.length)<<1]}nextInner(Ce,ke){for(this.done=this.lineBreak=!1;;){let $n=this.nodes.length-1,Hn=this.nodes[$n],zn=this.offsets[$n],Un=zn>>1,qn=Hn instanceof TextLeaf?Hn.text.length:Hn.children.length;if(Un==(ke>0?qn:0)){if($n==0)return this.done=!0,this.value="",this;ke>0&&this.offsets[$n-1]++,this.nodes.pop(),this.offsets.pop()}else if((zn&1)==(ke>0?0:1)){if(this.offsets[$n]+=ke,Ce==0)return this.lineBreak=!0,this.value=`
|
||||
`,this;Ce--}else if(Hn instanceof TextLeaf){let Xn=Hn.text[Un+(ke<0?-1:0)];if(this.offsets[$n]+=ke,Xn.length>Math.max(0,Ce))return this.value=Ce==0?Xn:ke>0?Xn.slice(Ce):Xn.slice(0,Xn.length-Ce),this;Ce-=Xn.length}else{let Xn=Hn.children[Un+(ke<0?-1:0)];Ce>Xn.length?(Ce-=Xn.length,this.offsets[$n]+=ke):(ke<0&&this.offsets[$n]--,this.nodes.push(Xn),this.offsets.push(ke>0?1:(Xn instanceof TextLeaf?Xn.text.length:Xn.children.length)<<1))}}}next(Ce=0){return Ce<0&&(this.nextInner(-Ce,-this.dir),Ce=this.value.length),this.nextInner(Ce,this.dir)}}class PartialTextCursor{constructor(Ce,ke,$n){this.value="",this.done=!1,this.cursor=new RawTextCursor(Ce,ke>$n?-1:1),this.pos=ke>$n?Ce.length:0,this.from=Math.min(ke,$n),this.to=Math.max(ke,$n)}nextInner(Ce,ke){if(ke<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;Ce+=Math.max(0,ke<0?this.pos-this.to:this.from-this.pos);let $n=ke<0?this.pos-this.from:this.to-this.pos;Ce>$n&&(Ce=$n),$n-=Ce;let{value:Hn}=this.cursor.next(Ce);return this.pos+=(Hn.length+Ce)*ke,this.value=Hn.length<=$n?Hn:ke<0?Hn.slice(Hn.length-$n):Hn.slice(0,$n),this.done=!this.value,this}next(Ce=0){return Ce<0?Ce=Math.max(Ce,this.from-this.pos):Ce>0&&(Ce=Math.min(Ce,this.to-this.pos)),this.nextInner(Ce,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class LineCursor{constructor(Ce){this.inner=Ce,this.afterBreak=!0,this.value="",this.done=!1}next(Ce=0){let{done:ke,lineBreak:$n,value:Hn}=this.inner.next(Ce);return ke&&this.afterBreak?(this.value="",this.afterBreak=!1):ke?(this.done=!0,this.value=""):$n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=Hn,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Text.prototype[Symbol.iterator]=function(){return this.iter()},RawTextCursor.prototype[Symbol.iterator]=PartialTextCursor.prototype[Symbol.iterator]=LineCursor.prototype[Symbol.iterator]=function(){return this});let Line$1=class{constructor(Ce,ke,$n,Hn){this.from=Ce,this.to=ke,this.number=$n,this.text=Hn}get length(){return this.to-this.from}};function clip(_n,Ce,ke){return Ce=Math.max(0,Math.min(_n.length,Ce)),[Ce,Math.max(Ce,Math.min(_n.length,ke))]}let extend="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(_n=>_n?parseInt(_n,36):1);for(let _n=1;_n<extend.length;_n++)extend[_n]+=extend[_n-1];function isExtendingChar(_n){for(let Ce=1;Ce<extend.length;Ce+=2)if(extend[Ce]>_n)return extend[Ce-1]<=_n;return!1}function isRegionalIndicator(_n){return _n>=127462&&_n<=127487}const ZWJ=8205;function findClusterBreak(_n,Ce,ke=!0,$n=!0){return(ke?nextClusterBreak:prevClusterBreak)(_n,Ce,$n)}function nextClusterBreak(_n,Ce,ke){if(Ce==_n.length)return Ce;Ce&&surrogateLow(_n.charCodeAt(Ce))&&surrogateHigh(_n.charCodeAt(Ce-1))&&Ce--;let $n=codePointAt(_n,Ce);for(Ce+=codePointSize($n);Ce<_n.length;){let Hn=codePointAt(_n,Ce);if($n==ZWJ||Hn==ZWJ||ke&&isExtendingChar(Hn))Ce+=codePointSize(Hn),$n=Hn;else if(isRegionalIndicator(Hn)){let zn=0,Un=Ce-2;for(;Un>=0&&isRegionalIndicator(codePointAt(_n,Un));)zn++,Un-=2;if(zn%2==0)break;Ce+=2}else break}return Ce}function prevClusterBreak(_n,Ce,ke){for(;Ce>0;){let $n=nextClusterBreak(_n,Ce-2,ke);if($n<Ce)return $n;Ce--}return 0}function surrogateLow(_n){return _n>=56320&&_n<57344}function surrogateHigh(_n){return _n>=55296&&_n<56320}function codePointAt(_n,Ce){let ke=_n.charCodeAt(Ce);if(!surrogateHigh(ke)||Ce+1==_n.length)return ke;let $n=_n.charCodeAt(Ce+1);return surrogateLow($n)?(ke-55296<<10)+($n-56320)+65536:ke}function fromCodePoint(_n){return _n<=65535?String.fromCharCode(_n):(_n-=65536,String.fromCharCode((_n>>10)+55296,(_n&1023)+56320))}function codePointSize(_n){return _n<65536?1:2}const DefaultS
Line truncated
|
||||
`}get readOnly(){return this.facet(readOnly)}phrase(Ce,...ke){for(let $n of this.facet(EditorState.phrases))if(Object.prototype.hasOwnProperty.call($n,Ce)){Ce=$n[Ce];break}return ke.length&&(Ce=Ce.replace(/\$(\$|\d*)/g,($n,Hn)=>{if(Hn=="$")return"$";let zn=+(Hn||1);return!zn||zn>ke.length?$n:ke[zn-1]})),Ce}languageDataAt(Ce,ke,$n=-1){let Hn=[];for(let zn of this.facet(languageData))for(let Un of zn(this,ke,$n))Object.prototype.hasOwnProperty.call(Un,Ce)&&Hn.push(Un[Ce]);return Hn}charCategorizer(Ce){return makeCategorizer(this.languageDataAt("wordChars",Ce).join(""))}wordAt(Ce){let{text:ke,from:$n,length:Hn}=this.doc.lineAt(Ce),zn=this.charCategorizer(Ce),Un=Ce-$n,qn=Ce-$n;for(;Un>0;){let Xn=findClusterBreak(ke,Un,!1);if(zn(ke.slice(Xn,Un))!=CharCategory.Word)break;Un=Xn}for(;qn<Hn;){let Xn=findClusterBreak(ke,qn);if(zn(ke.slice(qn,Xn))!=CharCategory.Word)break;qn=Xn}return Un==qn?null:EditorSelection.range(Un+$n,qn+$n)}}EditorState.allowMultipleSelections=allowMultipleSelections;EditorState.tabSize=Facet.define({combine:_n=>_n.length?_n[0]:4});EditorState.lineSeparator=lineSeparator;EditorState.readOnly=readOnly;EditorState.phrases=Facet.define({compare(_n,Ce){let ke=Object.keys(_n),$n=Object.keys(Ce);return ke.length==$n.length&&ke.every(Hn=>_n[Hn]==Ce[Hn])}});EditorState.languageData=languageData;EditorState.changeFilter=changeFilter;EditorState.transactionFilter=transactionFilter;EditorState.transactionExtender=transactionExtender;Compartment.reconfigure=StateEffect.define();function combineConfig(_n,Ce,ke={}){let $n={};for(let Hn of _n)for(let zn of Object.keys(Hn)){let Un=Hn[zn],qn=$n[zn];if(qn===void 0)$n[zn]=Un;else if(!(qn===Un||Un===void 0))if(Object.hasOwnProperty.call(ke,zn))$n[zn]=ke[zn](qn,Un);else throw new Error("Config merge conflict for field "+zn)}for(let Hn in Ce)$n[Hn]===void 0&&($n[Hn]=Ce[Hn]);return $n}class RangeValue{eq(Ce){return this==Ce}range(Ce,ke=Ce){return Range$2.create(Ce,ke,this)}}RangeValue.prototype.startSide=RangeValue.prototype.endSide=0;RangeValue.prototype.point=!1;RangeValue.prototype.mapMode=MapMode.TrackDel;let Range$2=class rK{constructor(Ce,ke,$n){this.from=Ce,this.to=ke,this.value=$n}static create(Ce,ke,$n){return new rK(Ce,ke,$n)}};function cmpRange(_n,Ce){return _n.from-Ce.from||_n.value.startSide-Ce.value.startSide}class Chunk{constructor(Ce,ke,$n,Hn){this.from=Ce,this.to=ke,this.value=$n,this.maxPoint=Hn}get length(){return this.to[this.to.length-1]}findIndex(Ce,ke,$n,Hn=0){let zn=$n?this.to:this.from;for(let Un=Hn,qn=zn.length;;){if(Un==qn)return Un;let Xn=Un+qn>>1,Kn=zn[Xn]-Ce||($n?this.value[Xn].endSide:this.value[Xn].startSide)-ke;if(Xn==Un)return Kn>=0?Un:qn;Kn>=0?qn=Xn:Un=Xn+1}}between(Ce,ke,$n,Hn){for(let zn=this.findIndex(ke,-1e9,!0),Un=this.findIndex($n,1e9,!1,zn);zn<Un;zn++)if(Hn(this.from[zn]+Ce,this.to[zn]+Ce,this.value[zn])===!1)return!1}map(Ce,ke){let $n=[],Hn=[],zn=[],Un=-1,qn=-1;for(let Xn=0;Xn<this.value.length;Xn++){let Kn=this.value[Xn],to=this.from[Xn]+Ce,io=this.to[Xn]+Ce,uo,ho;if(to==io){let bo=ke.mapPos(to,Kn.startSide,Kn.mapMode);if(bo==null||(uo=ho=bo,Kn.startSide!=Kn.endSide&&(ho=ke.mapPos(to,Kn.endSide),ho<uo)))continue}else if(uo=ke.mapPos(to,Kn.startSide),ho=ke.mapPos(io,Kn.endSide),uo>ho||uo==ho&&Kn.startSide>0&&Kn.endSide<=0)continue;(ho-uo||Kn.endSide-Kn.startSide)<0||(Un<0&&(Un=uo),Kn.point&&(qn=Math.max(qn,ho-uo)),$n.push(Kn),Hn.push(uo-Un),zn.push(ho-Un))}return{mapped:$n.length?new Chunk(Hn,zn,$n,qn):null,pos:Un}}}class RangeSet{constructor(Ce,ke,$n,Hn){this.chunkPos=Ce,this.chunk=ke,this.nextLayer=$n,this.maxPoint=Hn}static create(Ce,ke,$n,Hn){return new RangeSet(Ce,ke,$n,Hn)}get length(){let Ce=this.chunk.length-1;return Ce<0?0:Math.max(this.chunkEnd(Ce),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let Ce=this.nextLayer.size;for(let ke of this.chunk)Ce+=ke.value.length;return Ce}chunkEnd(Ce){return this.chunkPos[Ce]+this.chunk[Ce].length}update(Ce){let{add:ke=[],sort:$n=!1,filterFrom:Hn=0,filterTo:zn=this.length}=Ce,Un=Ce.filter;if(ke.length==0&&!Un)return this;if($n&&(ke=ke.slice().sort(cmpRange)),this.isEmpty)return ke.length?RangeSet.of(ke):this;let qn=new LayerCursor(this,null,-1).goto(0),Xn=0,Kn=[],to=new RangeSetBuilder;for(;qn.value||Xn<ke.length;)if(Xn<ke.length&&(qn.from-ke[Xn].from||qn.startSide-ke[Xn].value.startSide)>=0){let io=ke[Xn++];to.addInner(io.from,io.to,io.value)||Kn.push(io)}else qn.rangeIndex==1&&qn.chunkIndex<this.chunk.length&&(Xn==ke.length||this.chunkEnd(qn.chunkIndex)<ke[Xn].from)&&(!Un||Hn>this.chunkEnd(qn.chunkIndex)||zn<this.chunkPos[qn.chunkIndex])&&to.addChunk(this.chunkPos[qn.chunkIndex],this.chunk[qn.chunkIndex])?qn.nextChunk():((!Un||Hn>qn.to||zn<qn.from||Un(qn.from,qn.to,qn.value))&&(to.addInner(qn.from,qn.to,qn.value)||Kn.push(Range$2.create(qn.from,qn.to,qn.value))),qn.next());return to.finishInner(this.nextLayer.isEmpty&&!Kn.length?RangeSet.empty:this.nextLayer.update({add:Kn,filter:Un,filterFrom:Hn,filterTo:zn}))}map(Ce){if(Ce.empty||this.isEmpty)return this;let ke=
Line truncated
|
||||
`)}static newName(){let Ce=top[COUNT]||1;return top[COUNT]=Ce+1,C+Ce.toString(36)}static mount(Ce,ke,$n){let Hn=Ce[SET],zn=$n&&$n.nonce;Hn?zn&&Hn.setNonce(zn):Hn=new StyleSet(Ce,zn),Hn.mount(Array.isArray(ke)?ke:[ke],Ce)}}let adoptedSet=new Map;class StyleSet{constructor(Ce,ke){let $n=Ce.ownerDocument||Ce,Hn=$n.defaultView;if(!Ce.head&&Ce.adoptedStyleSheets&&Hn.CSSStyleSheet){let zn=adoptedSet.get($n);if(zn)return Ce[SET]=zn;this.sheet=new Hn.CSSStyleSheet,adoptedSet.set($n,this)}else this.styleTag=$n.createElement("style"),ke&&this.styleTag.setAttribute("nonce",ke);this.modules=[],Ce[SET]=this}mount(Ce,ke){let $n=this.sheet,Hn=0,zn=0;for(let Un=0;Un<Ce.length;Un++){let qn=Ce[Un],Xn=this.modules.indexOf(qn);if(Xn<zn&&Xn>-1&&(this.modules.splice(Xn,1),zn--,Xn=-1),Xn==-1){if(this.modules.splice(zn++,0,qn),$n)for(let Kn=0;Kn<qn.rules.length;Kn++)$n.insertRule(qn.rules[Kn],Hn++)}else{for(;zn<Xn;)Hn+=this.modules[zn++].rules.length;Hn+=qn.rules.length,zn++}}if($n)ke.adoptedStyleSheets.indexOf(this.sheet)<0&&(ke.adoptedStyleSheets=[this.sheet,...ke.adoptedStyleSheets]);else{let Un="";for(let Xn=0;Xn<this.modules.length;Xn++)Un+=this.modules[Xn].getRules()+`
|
||||
`;this.styleTag.textContent=Un;let qn=ke.head||ke;this.styleTag.parentNode!=qn&&qn.insertBefore(this.styleTag,qn.firstChild)}}setNonce(Ce){this.styleTag&&this.styleTag.getAttribute("nonce")!=Ce&&this.styleTag.setAttribute("nonce",Ce)}}var base={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:"'"},shift={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},mac=typeof navigator<"u"&&/Mac/.test(navigator.platform),ie$1=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var i=0;i<10;i++)base[48+i]=base[96+i]=String(i);for(var i=1;i<=24;i++)base[i+111]="F"+i;for(var i=65;i<=90;i++)base[i]=String.fromCharCode(i+32),shift[i]=String.fromCharCode(i);for(var code in base)shift.hasOwnProperty(code)||(shift[code]=base[code]);function keyName(_n){var Ce=mac&&_n.metaKey&&_n.shiftKey&&!_n.ctrlKey&&!_n.altKey||ie$1&&_n.shiftKey&&_n.key&&_n.key.length==1||_n.key=="Unidentified",ke=!Ce&&_n.key||(_n.shiftKey?shift:base)[_n.keyCode]||_n.key||"Unidentified";return ke=="Esc"&&(ke="Escape"),ke=="Del"&&(ke="Delete"),ke=="Left"&&(ke="ArrowLeft"),ke=="Up"&&(ke="ArrowUp"),ke=="Right"&&(ke="ArrowRight"),ke=="Down"&&(ke="ArrowDown"),ke}function getSelection(_n){let Ce;return _n.nodeType==11?Ce=_n.getSelection?_n:_n.ownerDocument:Ce=_n,Ce.getSelection()}function contains(_n,Ce){return Ce?_n==Ce||_n.contains(Ce.nodeType!=1?Ce.parentNode:Ce):!1}function deepActiveElement(_n){let Ce=_n.activeElement;for(;Ce&&Ce.shadowRoot;)Ce=Ce.shadowRoot.activeElement;return Ce}function hasSelection(_n,Ce){if(!Ce.anchorNode)return!1;try{return contains(_n,Ce.anchorNode)}catch{return!1}}function clientRectsFor(_n){return _n.nodeType==3?textRange(_n,0,_n.nodeValue.length).getClientRects():_n.nodeType==1?_n.getClientRects():[]}function isEquivalentPosition(_n,Ce,ke,$n){return ke?scanFor(_n,Ce,ke,$n,-1)||scanFor(_n,Ce,ke,$n,1):!1}function domIndex(_n){for(var Ce=0;;Ce++)if(_n=_n.previousSibling,!_n)return Ce}function isBlockElement(_n){return _n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(_n.nodeName)}function scanFor(_n,Ce,ke,$n,Hn){for(;;){if(_n==ke&&Ce==$n)return!0;if(Ce==(Hn<0?0:maxOffset(_n))){if(_n.nodeName=="DIV")return!1;let zn=_n.parentNode;if(!zn||zn.nodeType!=1)return!1;Ce=domIndex(_n)+(Hn<0?0:1),_n=zn}else if(_n.nodeType==1){if(_n=_n.childNodes[Ce+(Hn<0?-1:0)],_n.nodeType==1&&_n.contentEditable=="false")return!1;Ce=Hn<0?maxOffset(_n):0}else return!1}}function maxOffset(_n){return _n.nodeType==3?_n.nodeValue.length:_n.childNodes.length}function flattenRect(_n,Ce){let ke=Ce?_n.left:_n.right;return{left:ke,right:ke,top:_n.top,bottom:_n.bottom}}function windowRect(_n){let Ce=_n.visualViewport;return Ce?{left:0,right:Ce.width,top:0,bottom:Ce.height}:{left:0,right:_n.innerWidth,top:0,bottom:_n.innerHeight}}function getScale(_n,Ce){let ke=Ce.width/_n.offsetWidth,$n=Ce.height/_n.offsetHeight;return(ke>.995&&ke<1.005||!isFinite(ke)||Math.abs(Ce.width-_n.offsetWidth)<1)&&(ke=1),($n>.995&&$n<1.005||!isFinite($n)||Math.abs(Ce.height-_n.offsetHeight)<1)&&($n=1),{scaleX:ke,scaleY:$n}}function scrollRectIntoView(_n,Ce,ke,$n,Hn,zn,Un,qn){let Xn=_n.ownerDocument,Kn=Xn.defaultView||window;for(let to=_n,io=!1;to&&!io;)if(to.nodeType==1){let uo,ho=to==Xn.body,bo=1,Oo=1;if(ho)uo=windowRect(Kn);else{if(/^(fixed|sticky)$/.test(getComputedStyle(to).position)&&(io=!0),to.scrollHeight<=to.clientHeight&&to.scrollWidth<=to.clientWidth){to=to.assignedSlot||to.parentNode;continue}let Do=to.getBoundingClientRect();({scaleX:bo,scaleY:Oo}=getScale(to,Do)),uo={left:Do.left,right:Do.left+to.clientWidth*bo,top:Do.top,bottom:Do.top+to.clientHeight*Oo}}let So=0,$o=0;if(Hn=="nearest")Ce.top<uo.top?($o=-(uo.top-Ce.top+Un),ke>0&&Ce.bottom>uo.bottom+$o&&($o=Ce.bottom-uo.bottom+$o+Un)):Ce.bottom>uo.bottom&&($o=Ce.bottom-uo.bottom+Un,ke<0&&Ce.top-$o<uo.top&&($o=-(uo.top+$o-Ce.top+Un)));else{let Do=Ce.bottom-Ce.top,xo=uo.bottom-uo.top;$o=(Hn=="center"&&Do<=xo?Ce.top+Do/2-xo/2:Hn=="start"||Hn=="center"&&ke<0?Ce.top-Un:Ce.bottom-xo+Un)-uo.top}if($n=="nearest"?Ce.left<uo.left?(So=-(uo.left-Ce.left+zn),ke>0&&Ce.right>uo.right+So&&(So=Ce.right-uo.right+So+zn)):Ce.right>uo.right&&(So=Ce.right-uo.right+zn,ke<0&&Ce.left<uo.left+So&&(So=-(uo.left+So-Ce.left+zn))):So=($n=="center"?Ce.left+(Ce.right-Ce.left)/2-(uo.right-uo.left)/2:$n=="start"==qn?Ce.left-zn:Ce.right-(uo.right-uo.left)+zn)-uo.left,So||$o)if(ho)KLine truncated
|
||||
`,Hn=_n.state.doc.line(Hn.number+(ke?1:-1)),zn=_n.bidiSpans(Hn),Kn=_n.visualLineSide(Hn,!ke)}if(Xn){if(!Xn(to))return qn}else{if(!$n)return Kn;Xn=$n(to)}qn=Kn}}function byGroup(_n,Ce,ke){let $n=_n.state.charCategorizer(Ce),Hn=$n(ke);return zn=>{let Un=$n(zn);return Hn==CharCategory.Space&&(Hn=Un),Hn==Un}}function moveVertically(_n,Ce,ke,$n){let Hn=Ce.head,zn=ke?1:-1;if(Hn==(ke?_n.state.doc.length:0))return EditorSelection.cursor(Hn,Ce.assoc);let Un=Ce.goalColumn,qn,Xn=_n.contentDOM.getBoundingClientRect(),Kn=_n.coordsAtPos(Hn,Ce.assoc||-1),to=_n.documentTop;if(Kn)Un==null&&(Un=Kn.left-Xn.left),qn=zn<0?Kn.top:Kn.bottom;else{let ho=_n.viewState.lineBlockAt(Hn);Un==null&&(Un=Math.min(Xn.right-Xn.left,_n.defaultCharacterWidth*(Hn-ho.from))),qn=(zn<0?ho.top:ho.bottom)+to}let io=Xn.left+Un,uo=$n??_n.viewState.heightOracle.textHeight>>1;for(let ho=0;;ho+=10){let bo=qn+(uo+ho)*zn,Oo=posAtCoords(_n,{x:io,y:bo},!1,zn);if(bo<Xn.top||bo>Xn.bottom||(zn<0?Oo<Hn:Oo>Hn)){let So=_n.docView.coordsForChar(Oo),$o=!So||bo<So.top?-1:1;return EditorSelection.cursor(Oo,$o,void 0,Un)}}}function skipAtomicRanges(_n,Ce,ke){for(;;){let $n=0;for(let Hn of _n)Hn.between(Ce-1,Ce+1,(zn,Un,qn)=>{if(Ce>zn&&Ce<Un){let Xn=$n||ke||(Ce-zn<Un-Ce?-1:1);Ce=Xn<0?zn:Un,$n=Xn}});if(!$n)return Ce}}function skipAtoms(_n,Ce,ke){let $n=skipAtomicRanges(_n.state.facet(atomicRanges).map(Hn=>Hn(_n)),ke.from,Ce.head>ke.from?-1:1);return $n==ke.from?ke:EditorSelection.cursor($n,$n<ke.from?1:-1)}const LineBreakPlaceholder="";class DOMReader{constructor(Ce,ke){this.points=Ce,this.text="",this.lineSeparator=ke.facet(EditorState.lineSeparator)}append(Ce){this.text+=Ce}lineBreak(){this.text+=LineBreakPlaceholder}readRange(Ce,ke){if(!Ce)return this;let $n=Ce.parentNode;for(let Hn=Ce;;){this.findPointBefore($n,Hn);let zn=this.text.length;this.readNode(Hn);let Un=Hn.nextSibling;if(Un==ke)break;let qn=ContentView.get(Hn),Xn=ContentView.get(Un);(qn&&Xn?qn.breakAfter:(qn?qn.breakAfter:isBlockElement(Hn))||isBlockElement(Un)&&(Hn.nodeName!="BR"||Hn.cmIgnore)&&this.text.length>zn)&&this.lineBreak(),Hn=Un}return this.findPointBefore($n,ke),this}readTextNode(Ce){let ke=Ce.nodeValue;for(let $n of this.points)$n.node==Ce&&($n.pos=this.text.length+Math.min($n.offset,ke.length));for(let $n=0,Hn=this.lineSeparator?null:/\r\n?|\n/g;;){let zn=-1,Un=1,qn;if(this.lineSeparator?(zn=ke.indexOf(this.lineSeparator,$n),Un=this.lineSeparator.length):(qn=Hn.exec(ke))&&(zn=qn.index,Un=qn[0].length),this.append(ke.slice($n,zn<0?ke.length:zn)),zn<0)break;if(this.lineBreak(),Un>1)for(let Xn of this.points)Xn.node==Ce&&Xn.pos>this.text.length&&(Xn.pos-=Un-1);$n=zn+Un}}readNode(Ce){if(Ce.cmIgnore)return;let ke=ContentView.get(Ce),$n=ke&&ke.overrideDOMText;if($n!=null){this.findPointInside(Ce,$n.length);for(let Hn=$n.iter();!Hn.next().done;)Hn.lineBreak?this.lineBreak():this.append(Hn.value)}else Ce.nodeType==3?this.readTextNode(Ce):Ce.nodeName=="BR"?Ce.nextSibling&&this.lineBreak():Ce.nodeType==1&&this.readRange(Ce.firstChild,null)}findPointBefore(Ce,ke){for(let $n of this.points)$n.node==Ce&&Ce.childNodes[$n.offset]==ke&&($n.pos=this.text.length)}findPointInside(Ce,ke){for(let $n of this.points)(Ce.nodeType==3?$n.node==Ce:Ce.contains($n.node))&&($n.pos=this.text.length+(isAtEnd(Ce,$n.node,$n.offset)?ke:0))}}function isAtEnd(_n,Ce,ke){for(;;){if(!Ce||ke<maxOffset(Ce))return!1;if(Ce==_n)return!0;ke=domIndex(Ce)+1,Ce=Ce.parentNode}}class DOMPoint{constructor(Ce,ke){this.node=Ce,this.offset=ke,this.pos=-1}}class DOMChange{constructor(Ce,ke,$n,Hn){this.typeOver=Hn,this.bounds=null,this.text="",this.domChanged=ke>-1;let{impreciseHead:zn,impreciseAnchor:Un}=Ce.docView;if(Ce.state.readOnly&&ke>-1)this.newSel=null;else if(ke>-1&&(this.bounds=Ce.docView.domBoundsAround(ke,$n,0))){let qn=zn||Un?[]:selectionPoints(Ce),Xn=new DOMReader(qn,Ce.state);Xn.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=Xn.text,this.newSel=selectionFromPoints(qn,this.bounds.from)}else{let qn=Ce.observer.selectionRange,Xn=zn&&zn.node==qn.focusNode&&zn.offset==qn.focusOffset||!contains(Ce.contentDOM,qn.focusNode)?Ce.state.selection.main.head:Ce.docView.posFromDOM(qn.focusNode,qn.focusOffset),Kn=Un&&Un.node==qn.anchorNode&&Un.offset==qn.anchorOffset||!contains(Ce.contentDOM,qn.anchorNode)?Ce.state.selection.main.anchor:Ce.docView.posFromDOM(qn.anchorNode,qn.anchorOffset),to=Ce.viewport;if((browser.ios||browser.chrome)&&Ce.state.selection.main.empty&&Xn!=Kn&&(to.from>0||to.to<Ce.state.doc.length)){let io=Math.min(Xn,Kn),uo=Math.max(Xn,Kn),ho=to.from-io,bo=to.to-uo;(ho==0||ho==1||io==0)&&(bo==0||bo==-1||uo==Ce.state.doc.length)&&(Xn=0,Kn=Ce.state.doc.length)}this.newSel=EditorSelection.single(Kn,Xn)}}}function applyDOMChange(_n,Ce){let ke,{newSel:$n}=Ce,Hn=_n.state.selection.main,zn=_n.inputState.lastKeyTime>Date.now()-100?_n.inputState.lastKeyCode:-1;if(Ce.bounds){let{from:Un,to:qn}=Ce.bounds,Xn=Hn.from,Kn=null;(zn===8||browser.android&&Ce.text.length<qn-Un)&&(Xn=Hn.to,Kn="end");let to=findDiff(_n.state.doc.sliceStr
Line truncated
|
||||
`&&_n.lineWrapping&&($n&&($n=EditorSelection.single($n.main.anchor-1,$n.main.head-1)),ke={from:Hn.from,to:Hn.to,insert:Text.of([" "])}),ke)return applyDOMChangeInner(_n,ke,$n,zn);if($n&&!$n.main.eq(Hn)){let Un=!1,qn="select";return _n.inputState.lastSelectionTime>Date.now()-50&&(_n.inputState.lastSelectionOrigin=="select"&&(Un=!0),qn=_n.inputState.lastSelectionOrigin),_n.dispatch({selection:$n,scrollIntoView:Un,userEvent:qn}),!0}else return!1}function applyDOMChangeInner(_n,Ce,ke,$n=-1){if(browser.ios&&_n.inputState.flushIOSKey(Ce))return!0;let Hn=_n.state.selection.main;if(browser.android&&(Ce.to==Hn.to&&(Ce.from==Hn.from||Ce.from==Hn.from-1&&_n.state.sliceDoc(Ce.from,Hn.from)==" ")&&Ce.insert.length==1&&Ce.insert.lines==2&&dispatchKey(_n.contentDOM,"Enter",13)||(Ce.from==Hn.from-1&&Ce.to==Hn.to&&Ce.insert.length==0||$n==8&&Ce.insert.length<Ce.to-Ce.from&&Ce.to>Hn.head)&&dispatchKey(_n.contentDOM,"Backspace",8)||Ce.from==Hn.from&&Ce.to==Hn.to+1&&Ce.insert.length==0&&dispatchKey(_n.contentDOM,"Delete",46)))return!0;let zn=Ce.insert.toString();_n.inputState.composing>=0&&_n.inputState.composing++;let Un,qn=()=>Un||(Un=applyDefaultInsert(_n,Ce,ke));return _n.state.facet(inputHandler$1).some(Xn=>Xn(_n,Ce.from,Ce.to,zn,qn))||_n.dispatch(qn()),!0}function applyDefaultInsert(_n,Ce,ke){let $n,Hn=_n.state,zn=Hn.selection.main;if(Ce.from>=zn.from&&Ce.to<=zn.to&&Ce.to-Ce.from>=(zn.to-zn.from)/3&&(!ke||ke.main.empty&&ke.main.from==Ce.from+Ce.insert.length)&&_n.inputState.composing<0){let qn=zn.from<Ce.from?Hn.sliceDoc(zn.from,Ce.from):"",Xn=zn.to>Ce.to?Hn.sliceDoc(Ce.to,zn.to):"";$n=Hn.replaceSelection(_n.state.toText(qn+Ce.insert.sliceString(0,void 0,_n.state.lineBreak)+Xn))}else{let qn=Hn.changes(Ce),Xn=ke&&ke.main.to<=qn.newLength?ke.main:void 0;if(Hn.selection.ranges.length>1&&_n.inputState.composing>=0&&Ce.to<=zn.to&&Ce.to>=zn.to-10){let Kn=_n.state.sliceDoc(Ce.from,Ce.to),to,io=ke&&findCompositionNode(_n,ke.main.head);if(io){let bo=Ce.insert.length-(Ce.to-Ce.from);to={from:io.from,to:io.to-bo}}else to=_n.state.doc.lineAt(zn.head);let uo=zn.to-Ce.to,ho=zn.to-zn.from;$n=Hn.changeByRange(bo=>{if(bo.from==zn.from&&bo.to==zn.to)return{changes:qn,range:Xn||bo.map(qn)};let Oo=bo.to-uo,So=Oo-Kn.length;if(bo.to-bo.from!=ho||_n.state.sliceDoc(So,Oo)!=Kn||bo.to>=to.from&&bo.from<=to.to)return{range:bo};let $o=Hn.changes({from:So,to:Oo,insert:Ce.insert}),Do=bo.to-zn.to;return{changes:$o,range:Xn?EditorSelection.range(Math.max(0,Xn.anchor+Do),Math.max(0,Xn.head+Do)):bo.map($o)}})}else $n={changes:qn,selection:Xn&&Hn.selection.replaceRange(Xn)}}let Un="input.type";return(_n.composing||_n.inputState.compositionPendingChange&&_n.inputState.compositionEndedAt>Date.now()-50)&&(_n.inputState.compositionPendingChange=!1,Un+=".compose",_n.inputState.compositionFirstChange&&(Un+=".start",_n.inputState.compositionFirstChange=!1)),Hn.update($n,{userEvent:Un,scrollIntoView:!0})}function findDiff(_n,Ce,ke,$n){let Hn=Math.min(_n.length,Ce.length),zn=0;for(;zn<Hn&&_n.charCodeAt(zn)==Ce.charCodeAt(zn);)zn++;if(zn==Hn&&_n.length==Ce.length)return null;let Un=_n.length,qn=Ce.length;for(;Un>0&&qn>0&&_n.charCodeAt(Un-1)==Ce.charCodeAt(qn-1);)Un--,qn--;if($n=="end"){let Xn=Math.max(0,zn-Math.min(Un,qn));ke-=Un+Xn-zn}if(Un<zn&&_n.length<Ce.length){let Xn=ke<=zn&&ke>=Un?zn-ke:0;zn-=Xn,qn=zn+(qn-Un),Un=zn}else if(qn<zn){let Xn=ke<=zn&&ke>=qn?zn-ke:0;zn-=Xn,Un=zn+(Un-qn),qn=zn}return{from:zn,toA:Un,toB:qn}}function selectionPoints(_n){let Ce=[];if(_n.root.activeElement!=_n.contentDOM)return Ce;let{anchorNode:ke,anchorOffset:$n,focusNode:Hn,focusOffset:zn}=_n.observer.selectionRange;return ke&&(Ce.push(new DOMPoint(ke,$n)),(Hn!=ke||zn!=$n)&&Ce.push(new DOMPoint(Hn,zn))),Ce}function selectionFromPoints(_n,Ce){if(_n.length==0)return null;let ke=_n[0].pos,$n=_n.length==2?_n[1].pos:ke;return ke>-1&&$n>-1?EditorSelection.single(ke+Ce,$n+Ce):null}class InputState{setSelectionOrigin(Ce){this.lastSelectionOrigin=Ce,this.lastSelectionTime=Date.now()}constructor(Ce){this.view=Ce,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=Ce.hasFocus,browser.safari&&Ce.contentDOM.addEventListener("input",()=>null),browser.gecko&&firefoxCopyCutHack(Ce.contentDOM.ownerDocument)}handleEvent(Ce){!eventBelongsToEditor(this.view,Ce)||this.ignoreDuringComposition(Ce)||Ce.type=="keydown"&&this.keydown(Ce)||this.runHandlers(Ce.type,Ce)}runHandlers(Ce,ke){let $n=this.handlers[Ce];if($n){for(let Hn of $n.observers)Hn(this.view,ke);for(let Hn of $n.handlers){if(ke.defaultPrevente
Line truncated
|
||||
`))};zn.from==this.from&&Hn<this.from?zn.from=Hn:zn.to==this.to&&Hn>this.to&&(zn.to=Hn),!(zn.from==zn.to&&!zn.insert.length)&&(this.pendingContextChange=zn,Ce.state.readOnly||applyDOMChangeInner(Ce,zn,EditorSelection.single(this.toEditorPos($n.selectionStart),this.toEditorPos($n.selectionEnd))),this.pendingContextChange&&(this.revertPending(Ce.state),this.setSelection(Ce.state)))},this.handlers.characterboundsupdate=$n=>{let Hn=[],zn=null;for(let Un=this.toEditorPos($n.rangeStart),qn=this.toEditorPos($n.rangeEnd);Un<qn;Un++){let Xn=Ce.coordsForChar(Un);zn=Xn&&new DOMRect(Xn.left,Xn.top,Xn.right-Xn.left,Xn.bottom-Xn.top)||zn||new DOMRect,Hn.push(zn)}ke.updateCharacterBounds($n.rangeStart,Hn)},this.handlers.textformatupdate=$n=>{let Hn=[];for(let zn of $n.getTextFormats()){let Un=zn.underlineStyle,qn=zn.underlineThickness;if(Un!="None"&&qn!="None"){let Xn=`text-decoration: underline ${Un=="Dashed"?"dashed ":Un=="Squiggle"?"wavy ":""}${qn=="Thin"?1:2}px`;Hn.push(Decoration.mark({attributes:{style:Xn}}).range(this.toEditorPos(zn.rangeStart),this.toEditorPos(zn.rangeEnd)))}}Ce.dispatch({effects:setEditContextFormatting.of(Decoration.set(Hn))})},this.handlers.compositionstart=()=>{Ce.inputState.composing<0&&(Ce.inputState.composing=0,Ce.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{Ce.inputState.composing=-1,Ce.inputState.compositionFirstChange=null};for(let $n in this.handlers)ke.addEventListener($n,this.handlers[$n]);this.measureReq={read:$n=>{this.editContext.updateControlBounds($n.contentDOM.getBoundingClientRect());let Hn=getSelection($n.root);Hn&&Hn.rangeCount&&this.editContext.updateSelectionBounds(Hn.getRangeAt(0).getBoundingClientRect())}}}applyEdits(Ce){let ke=0,$n=!1,Hn=this.pendingContextChange;return Ce.changes.iterChanges((zn,Un,qn,Xn,Kn)=>{if($n)return;let to=Kn.length-(Un-zn);if(Hn&&Un>=Hn.to)if(Hn.from==zn&&Hn.to==Un&&Hn.insert.eq(Kn)){Hn=this.pendingContextChange=null,ke+=to,this.to+=to;return}else Hn=null,this.revertPending(Ce.state);if(zn+=ke,Un+=ke,Un<=this.from)this.from+=to,this.to+=to;else if(zn<this.to){if(zn<this.from||Un>this.to||this.to-this.from+Kn.length>3e4){$n=!0;return}this.editContext.updateText(this.toContextPos(zn),this.toContextPos(Un),Kn.toString()),this.to+=to}ke+=to}),Hn&&!$n&&this.revertPending(Ce.state),!$n}update(Ce){let ke=this.pendingContextChange;!this.applyEdits(Ce)||!this.rangeIsValid(Ce.state)?(this.pendingContextChange=null,this.resetRange(Ce.state),this.editContext.updateText(0,this.editContext.text.length,Ce.state.doc.sliceString(this.from,this.to)),this.setSelection(Ce.state)):(Ce.docChanged||Ce.selectionSet||ke)&&this.setSelection(Ce.state),(Ce.geometryChanged||Ce.docChanged||Ce.selectionSet)&&Ce.view.requestMeasure(this.measureReq)}resetRange(Ce){let{head:ke}=Ce.selection.main;this.from=Math.max(0,ke-1e4),this.to=Math.min(Ce.doc.length,ke+1e4)}revertPending(Ce){let ke=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(ke.from),this.toContextPos(ke.from+ke.insert.length),Ce.doc.sliceString(ke.from,ke.to))}setSelection(Ce){let{main:ke}=Ce.selection,$n=this.toContextPos(Math.max(this.from,Math.min(this.to,ke.anchor))),Hn=this.toContextPos(ke.head);(this.editContext.selectionStart!=$n||this.editContext.selectionEnd!=Hn)&&this.editContext.updateSelection($n,Hn)}rangeIsValid(Ce){let{head:ke}=Ce.selection.main;return!(this.from>0&&ke-this.from<500||this.to<Ce.doc.length&&this.to-ke<500||this.to-this.from>1e4*3)}toEditorPos(Ce){return Ce+this.from}toContextPos(Ce){return Ce-this.from}destroy(){for(let Ce in this.handlers)this.editContext.removeEventListener(Ce,this.handlers[Ce])}}class EditorView{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(Ce={}){var ke;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),Ce.parent&&Ce.parent.appendChild(this.dom);let{dispatch:$n}=Ce;this.dispatchTransactions=Ce.dispatchTransactions||$n&&(Hn=>Hn.forEach(zn=>$n(zn,this)))||(Hn=>this.update(Hn)),this.dispatch=this.dispatch.bind(this),this._root=Ce.root||getRoot(Ce.parent)||document,th
Line truncated
|
||||
--\u2028\u2029\uFEFF-]`,UnicodeRegexpSupport),Names={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 _supportsTabSize=null;function supportsTabSize(){var _n;if(_supportsTabSize==null&&typeof document<"u"&&document.body){let Ce=document.body.style;_supportsTabSize=((_n=Ce.tabSize)!==null&&_n!==void 0?_n:Ce.MozTabSize)!=null}return _supportsTabSize||!1}const specialCharConfig=Facet.define({combine(_n){let Ce=combineConfig(_n,{render:null,specialChars:Specials,addSpecialChars:null});return(Ce.replaceTabs=!supportsTabSize())&&(Ce.specialChars=new RegExp(" |"+Ce.specialChars.source,UnicodeRegexpSupport)),Ce.addSpecialChars&&(Ce.specialChars=new RegExp(Ce.specialChars.source+"|"+Ce.addSpecialChars.source,UnicodeRegexpSupport)),Ce}});function highlightSpecialChars(_n={}){return[specialCharConfig.of(_n),specialCharPlugin()]}let _plugin=null;function specialCharPlugin(){return _plugin||(_plugin=ViewPlugin.fromClass(class{constructor(_n){this.view=_n,this.decorations=Decoration.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(_n.state.facet(specialCharConfig)),this.decorations=this.decorator.createDeco(_n)}makeDecorator(_n){return new MatchDecorator({regexp:_n.specialChars,decoration:(Ce,ke,$n)=>{let{doc:Hn}=ke.state,zn=codePointAt(Ce[0],0);if(zn==9){let Un=Hn.lineAt($n),qn=ke.state.tabSize,Xn=countColumn(Un.text,qn,$n-Un.from);return Decoration.replace({widget:new TabWidget((qn-Xn%qn)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[zn]||(this.decorationCache[zn]=Decoration.replace({widget:new SpecialCharWidget(_n,zn)}))},boundary:_n.replaceTabs?void 0:/[^]/})}update(_n){let Ce=_n.state.facet(specialCharConfig);_n.startState.facet(specialCharConfig)!=Ce?(this.decorator=this.makeDecorator(Ce),this.decorations=this.decorator.createDeco(_n.view)):this.decorations=this.decorator.updateDeco(_n,this.decorations)}},{decorations:_n=>_n.decorations}))}const DefaultPlaceholder="•";function placeholder$1(_n){return _n>=32?DefaultPlaceholder:_n==10?"":String.fromCharCode(9216+_n)}class SpecialCharWidget extends WidgetType{constructor(Ce,ke){super(),this.options=Ce,this.code=ke}eq(Ce){return Ce.code==this.code}toDOM(Ce){let ke=placeholder$1(this.code),$n=Ce.state.phrase("Control character")+" "+(Names[this.code]||"0x"+this.code.toString(16)),Hn=this.options.render&&this.options.render(this.code,$n,ke);if(Hn)return Hn;let zn=document.createElement("span");return zn.textContent=ke,zn.title=$n,zn.setAttribute("aria-label",$n),zn.className="cm-specialChar",zn}ignoreEvent(){return!1}}class TabWidget extends WidgetType{constructor(Ce){super(),this.width=Ce}eq(Ce){return Ce.width==this.width}toDOM(){let Ce=document.createElement("span");return Ce.textContent=" ",Ce.className="cm-tab",Ce.style.width=this.width+"px",Ce}ignoreEvent(){return!1}}function highlightActiveLine(){return activeLineHighlighter}const lineDeco=Decoration.line({class:"cm-activeLine"}),activeLineHighlighter=ViewPlugin.fromClass(class{constructor(_n){this.decorations=this.getDeco(_n)}update(_n){(_n.docChanged||_n.selectionSet)&&(this.decorations=this.getDeco(_n.view))}getDeco(_n){let Ce=-1,ke=[];for(let $n of _n.state.selection.ranges){let Hn=_n.lineBlockAt($n.head);Hn.from>Ce&&(ke.push(lineDeco.range(Hn.from)),Ce=Hn.from)}return Decoration.set(ke)}},{decorations:_n=>_n.decorations}),MaxOff=2e3;function rectangleFor(_n,Ce,ke){let $n=Math.min(Ce.line,ke.line),Hn=Math.max(Ce.line,ke.line),zn=[];if(Ce.off>MaxOff||ke.off>MaxOff||Ce.col<0||ke.col<0){let Un=Math.min(Ce.off,ke.off),qn=Math.max(Ce.off,ke.off);for(let Xn=$n;Xn<=Hn;Xn++){let Kn=_n.doc.line(Xn);Kn.length<=qn&&zn.push(EditorSelection.range(Kn.from+Un,Kn.to+qn))}}else{let Un=Math.min(Ce.col,ke.col),qn=Math.max(Ce.col,ke.col);for(let Xn=$n;Xn<=Hn;Xn++){let Kn=_n.doc.line(Xn),to=findColumn(Kn.text,Un,_n.tabSize,!0);if(to<0)zn.push(EditorSelection.cursor(Kn.to));else{let io=findColumn(Kn.text,qn,_n.tabSize);zn.push(EditorSelection.range(Kn.from+to,Kn.from+io))}}}return zn}function absoluteColumn(_n,Ce){let ke=_n.coordsAtPos(_n.viewport.from);return ke?Math.round(Math.abs((ke.left-Ce)/_n.defaultCharacterWidth)):-1}function getPos(_n,Ce){let ke=_n.posAtCoords({x:Ce.clientX,y:Ce.clientY},!1),$n=_n.state.doc.lineAt(ke),Hn=ke-$n.from,zn=Hn>MaxOff?-1:Hn==$n.length?absoluteColumn(_n,Ce.clientX):countColumn($n.text,_n.state.tabSize,ke-$n.from);return{line:$n.number,col:zn,off:Hn}}function rectangleSelectionStyle(_n,Ce){let ke=getPos(_n,Ce),$n=_n.state.selection;return ke?{update(Hn){if(H
Line truncated
|
||||
`:$n=="r"?"\r":$n=="t"?" ":"\\")}eq(Ce){return this.search==Ce.search&&this.replace==Ce.replace&&this.caseSensitive==Ce.caseSensitive&&this.regexp==Ce.regexp&&this.wholeWord==Ce.wholeWord}create(){return this.regexp?new RegExpQuery(this):new StringQuery(this)}getCursor(Ce,ke=0,$n){let Hn=Ce.doc?Ce:EditorState.create({doc:Ce});return $n==null&&($n=Hn.doc.length),this.regexp?regexpCursor(this,Hn,ke,$n):stringCursor(this,Hn,ke,$n)}}class QueryType{constructor(Ce){this.spec=Ce}}function stringCursor(_n,Ce,ke,$n){return new SearchCursor(Ce.doc,_n.unquoted,ke,$n,_n.caseSensitive?void 0:Hn=>Hn.toLowerCase(),_n.wholeWord?stringWordTest(Ce.doc,Ce.charCategorizer(Ce.selection.main.head)):void 0)}function stringWordTest(_n,Ce){return(ke,$n,Hn,zn)=>((zn>ke||zn+Hn.length<$n)&&(zn=Math.max(0,ke-2),Hn=_n.sliceString(zn,Math.min(_n.length,$n+2))),(Ce(charBefore(Hn,ke-zn))!=CharCategory.Word||Ce(charAfter(Hn,ke-zn))!=CharCategory.Word)&&(Ce(charAfter(Hn,$n-zn))!=CharCategory.Word||Ce(charBefore(Hn,$n-zn))!=CharCategory.Word))}class StringQuery extends QueryType{constructor(Ce){super(Ce)}nextMatch(Ce,ke,$n){let Hn=stringCursor(this.spec,Ce,$n,Ce.doc.length).nextOverlapping();return Hn.done&&(Hn=stringCursor(this.spec,Ce,0,ke).nextOverlapping()),Hn.done?null:Hn.value}prevMatchInRange(Ce,ke,$n){for(let Hn=$n;;){let zn=Math.max(ke,Hn-1e4-this.spec.unquoted.length),Un=stringCursor(this.spec,Ce,zn,Hn),qn=null;for(;!Un.nextOverlapping().done;)qn=Un.value;if(qn)return qn;if(zn==ke)return null;Hn-=1e4}}prevMatch(Ce,ke,$n){return this.prevMatchInRange(Ce,0,ke)||this.prevMatchInRange(Ce,$n,Ce.doc.length)}getReplacement(Ce){return this.spec.unquote(this.spec.replace)}matchAll(Ce,ke){let $n=stringCursor(this.spec,Ce,0,Ce.doc.length),Hn=[];for(;!$n.next().done;){if(Hn.length>=ke)return null;Hn.push($n.value)}return Hn}highlight(Ce,ke,$n,Hn){let zn=stringCursor(this.spec,Ce,Math.max(0,ke-this.spec.unquoted.length),Math.min($n+this.spec.unquoted.length,Ce.doc.length));for(;!zn.next().done;)Hn(zn.value.from,zn.value.to)}}function regexpCursor(_n,Ce,ke,$n){return new RegExpCursor(Ce.doc,_n.search,{ignoreCase:!_n.caseSensitive,test:_n.wholeWord?regexpWordTest(Ce.charCategorizer(Ce.selection.main.head)):void 0},ke,$n)}function charBefore(_n,Ce){return _n.slice(findClusterBreak(_n,Ce,!1),Ce)}function charAfter(_n,Ce){return _n.slice(Ce,findClusterBreak(_n,Ce))}function regexpWordTest(_n){return(Ce,ke,$n)=>!$n[0].length||(_n(charBefore($n.input,$n.index))!=CharCategory.Word||_n(charAfter($n.input,$n.index))!=CharCategory.Word)&&(_n(charAfter($n.input,$n.index+$n[0].length))!=CharCategory.Word||_n(charBefore($n.input,$n.index+$n[0].length))!=CharCategory.Word)}class RegExpQuery extends QueryType{nextMatch(Ce,ke,$n){let Hn=regexpCursor(this.spec,Ce,$n,Ce.doc.length).next();return Hn.done&&(Hn=regexpCursor(this.spec,Ce,0,ke).next()),Hn.done?null:Hn.value}prevMatchInRange(Ce,ke,$n){for(let Hn=1;;Hn++){let zn=Math.max(ke,$n-Hn*1e4),Un=regexpCursor(this.spec,Ce,zn,$n),qn=null;for(;!Un.next().done;)qn=Un.value;if(qn&&(zn==ke||qn.from>zn+10))return qn;if(zn==ke)return null}}prevMatch(Ce,ke,$n){return this.prevMatchInRange(Ce,0,ke)||this.prevMatchInRange(Ce,$n,Ce.doc.length)}getReplacement(Ce){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(ke,$n)=>$n=="$"?"$":$n=="&"?Ce.match[0]:$n!="0"&&+$n<Ce.match.length?Ce.match[$n]:ke)}matchAll(Ce,ke){let $n=regexpCursor(this.spec,Ce,0,Ce.doc.length),Hn=[];for(;!$n.next().done;){if(Hn.length>=ke)return null;Hn.push($n.value)}return Hn}highlight(Ce,ke,$n,Hn){let zn=regexpCursor(this.spec,Ce,Math.max(0,ke-250),Math.min($n+250,Ce.doc.length));for(;!zn.next().done;)Hn(zn.value.from,zn.value.to)}}const setSearchQuery=StateEffect.define(),togglePanel$1=StateEffect.define(),searchState=StateField.define({create(_n){return new SearchState(defaultQuery(_n).create(),null)},update(_n,Ce){for(let ke of Ce.effects)ke.is(setSearchQuery)?_n=new SearchState(ke.value.create(),_n.panel):ke.is(togglePanel$1)&&(_n=new SearchState(_n.query,ke.value?createSearchPanel:null));return _n},provide:_n=>showPanel.from(_n,Ce=>Ce.panel)});class SearchState{constructor(Ce,ke){this.query=Ce,this.panel=ke}}const matchMark=Decoration.mark({class:"cm-searchMatch"}),selectedMatchMark=Decoration.mark({class:"cm-searchMatch cm-searchMatch-selected"}),searchHighlighter=ViewPlugin.fromClass(class{constructor(_n){this.view=_n,this.decorations=this.highlight(_n.state.field(searchState))}update(_n){let Ce=_n.state.field(searchState);(Ce!=_n.startState.field(searchState)||_n.docChanged||_n.selectionSet||_n.viewportChanged)&&(this.decorations=this.highlight(Ce))}highlight({query:_n,panel:Ce}){if(!Ce||!_n.spec.valid)return Decoration.none;let{view:ke}=this,$n=new RangeSetBuilder;for(let Hn=0,zn=ke.visibleRanges,Un=zn.length;Hn<Un;Hn++){let{from:qn,to:Xn}=zn[Hn];for(;Hn<Un-1&&Xn>zn[Hn+1].from-2*250;)Xn=zn[++Hn].to;_n.highlight(ke.state,qn,Xn,(Kn,to)=>{let io=ke.state.selection.ranges.some(uo=>uo.from==Kn&&uo.to==to);$n.add(Kn,to,io?selectedM
Line truncated
|
||||
`+ke.scrub(),zn=this.advance(Hn);return zn>-1&&zn<Hn.length?this.complete(Ce,$n,zn):!1}finish(Ce,ke){return(this.stage==2||this.stage==3)&&skipSpace(ke.content,this.pos)==ke.content.length?this.complete(Ce,ke,ke.content.length):!1}complete(Ce,ke,$n){return Ce.addLeafElement(ke,elt(Type.LinkReference,this.start,this.start+$n,this.elts)),!0}nextStage(Ce){return Ce?(this.pos=Ce.to-this.start,this.elts.push(Ce),this.stage++,!0):(Ce===!1&&(this.stage=-1),!1)}advance(Ce){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(parseLinkLabel(Ce,this.pos,this.start,!0)))return-1;if(Ce.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(elt(Type.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(parseURL(Ce,skipSpace(Ce,this.pos),this.start)))return-1}else if(this.stage==2){let ke=skipSpace(Ce,this.pos),$n=0;if(ke>this.pos){let Hn=parseLinkTitle(Ce,ke,this.start);if(Hn){let zn=lineEnd(Ce,Hn.to-this.start);zn>0&&(this.nextStage(Hn),$n=zn)}}return $n||($n=lineEnd(Ce,this.pos)),$n>0&&$n<Ce.length?$n:-1}else return lineEnd(Ce,this.pos)}}}function lineEnd(_n,Ce){for(;Ce<_n.length;Ce++){let ke=_n.charCodeAt(Ce);if(ke==10)break;if(!space$2(ke))return-1}return Ce}class SetextHeadingParser{nextLine(Ce,ke,$n){let Hn=ke.depth<Ce.stack.length?-1:isSetextUnderline(ke),zn=ke.next;if(Hn<0)return!1;let Un=elt(Type.HeaderMark,Ce.lineStart+ke.pos,Ce.lineStart+Hn);return Ce.nextLine(),Ce.addLeafElement($n,elt(zn==61?Type.SetextHeading1:Type.SetextHeading2,$n.start,Ce.prevLineEnd(),[...Ce.parser.parseInline($n.content,$n.start),Un])),!0}finish(){return!1}}const DefaultLeafBlocks={LinkReference(_n,Ce){return Ce.content.charCodeAt(0)==91?new LinkReferenceParser(Ce):null},SetextHeading(){return new SetextHeadingParser}},DefaultEndLeaf=[(_n,Ce)=>isAtxHeading(Ce)>=0,(_n,Ce)=>isFencedCode(Ce)>=0,(_n,Ce)=>isBlockquote(Ce)>=0,(_n,Ce)=>isBulletList(Ce,_n,!0)>=0,(_n,Ce)=>isOrderedList(Ce,_n,!0)>=0,(_n,Ce)=>isHorizontalRule(Ce,_n,!0)>=0,(_n,Ce)=>isHTMLBlock(Ce,_n,!0)>=0],scanLineResult={text:"",end:0};class BlockContext{constructor(Ce,ke,$n,Hn){this.parser=Ce,this.input=ke,this.ranges=Hn,this.line=new Line,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=Hn[Hn.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=Hn[0].from,this.block=CompositeBlock.create(Type.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=$n.length?new FragmentCursor($n,ke):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:Ce}=this;for(;;){for(let $n=0;;){let Hn=Ce.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;$n<Ce.markers.length&&(!Hn||Ce.markers[$n].from<Hn.end);){let zn=Ce.markers[$n++];this.addNode(zn.type,zn.from,zn.to)}if(!Hn)break;this.finishContext()}if(Ce.pos<Ce.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(Ce.basePos))return null;e:for(;;){for(let $n of this.parser.blockParsers)if($n){let Hn=$n(this,Ce);if(Hn!=!1){if(Hn==!0)return null;Ce.forward();continue e}}break}let ke=new LeafBlock(this.lineStart+Ce.pos,Ce.text.slice(Ce.pos));for(let $n of this.parser.leafBlockParsers)if($n){let Hn=$n(this,ke);Hn&&ke.parsers.push(Hn)}e:for(;this.nextLine()&&Ce.pos!=Ce.text.length;){if(Ce.indent<Ce.baseIndent+4){for(let $n of this.parser.endLeafBlock)if($n(this,Ce,ke))break e}for(let $n of ke.parsers)if($n.nextLine(this,Ce,ke))return null;ke.content+=`
|
||||
`+Ce.scrub();for(let $n of Ce.markers)ke.marks.push($n)}return this.finishLeaf(ke),null}stopAt(Ce){if(this.stoppedAt!=null&&this.stoppedAt<Ce)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=Ce}reuseFragment(Ce){if(!this.fragments.moveTo(this.absoluteLineStart+Ce,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let ke=this.fragments.takeNodes(this);return ke?(this.absoluteLineStart+=ke,this.lineStart=toRelative(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(Ce=this.depth-1){return this.parser.nodeSet.types[this.stack[Ce].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(Ce){let ke=scanLineResult;if(ke.end=Ce,Ce>=this.to)ke.text="";else if(ke.text=this.lineChunkAt(Ce),ke.end+=ke.text.length,this.ranges.length>1){let $n=this.absoluteLineStart,Hn=this.rangeI;for(;this.ranges[Hn].to<ke.end;){Hn++;let zn=this.ranges[Hn].from,Un=this.lineChunkAt(zn);ke.end=zn+Un.length,ke.text=ke.text.slice(0,this.ranges[Hn-1].to-$n)+Un,$n=ke.end-ke.text.length}}return ke}readLine(){let{line:Ce}=this,{text:ke,end:$n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=$n,Ce.reset(ke);Ce.depth<this.stack.length;Ce.depth++){let Hn=this.stack[Ce.depth],zn=this.parser.skipContextMarkup[Hn.type];if(!zn)throw new Error("Unhandled block context "+Type[Hn.type]);if(!zn(Hn,this,Ce))break;Ce.forward()}}lineChunkAt(Ce){let ke=this.input.chunk(Ce),$n;if(this.input.lineChunks)$n=ke==`
|
||||
`?"":ke;else{let Hn=ke.indexOf(`
|
||||
`);$n=Hn<0?ke:ke.slice(0,Hn)}return Ce+$n.length>this.to?$n.slice(0,this.to-Ce):$n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(Ce,ke,$n=0){this.block=CompositeBlock.create(Ce,$n,this.lineStart+ke,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(Ce,ke,$n=0){this.startContext(this.parser.getNodeType(Ce),ke,$n)}addNode(Ce,ke,$n){typeof Ce=="number"&&(Ce=new Tree(this.parser.nodeSet.types[Ce],none,none,($n??this.prevLineEnd())-ke)),this.block.addChild(Ce,ke-this.block.from)}addElement(Ce){this.block.addChild(Ce.toTree(this.parser.nodeSet),Ce.from-this.block.from)}addLeafElement(Ce,ke){this.addNode(this.buffer.writeElements(injectMarks(ke.children,Ce.marks),-ke.from).finish(ke.type,ke.to-ke.from),ke.from)}finishContext(){let Ce=this.stack.pop(),ke=this.stack[this.stack.length-1];ke.addChild(Ce.toTree(this.parser.nodeSet),Ce.from-ke.from),this.block=ke}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(Ce){return this.ranges.length>1?injectGaps(this.ranges,0,Ce.topNode,this.ranges[0].from,this.reusePlaceholders):Ce}finishLeaf(Ce){for(let $n of Ce.parsers)if($n.finish(this,Ce))return;let ke=injectMarks(this.parser.parseInline(Ce.content,Ce.start),Ce.marks);this.addNode(this.buffer.writeElements(ke,-Ce.start).finish(Type.Paragraph,Ce.content.length),Ce.start)}elt(Ce,ke,$n,Hn){return typeof Ce=="string"?elt(this.parser.getNodeType(Ce),ke,$n,Hn):new TreeElement(Ce,ke)}get buffer(){return new Buffer$1(this.parser.nodeSet)}}function injectGaps(_n,Ce,ke,$n,Hn){let zn=_n[Ce].to,Un=[],qn=[],Xn=ke.from+$n;function Kn(to,io){for(;io?to>=zn:to>zn;){let uo=_n[Ce+1].from-zn;$n+=uo,to+=uo,Ce++,zn=_n[Ce].to}}for(let to=ke.firstChild;to;to=to.nextSibling){Kn(to.from+$n,!0);let io=to.from+$n,uo,ho=Hn.get(to.tree);ho?uo=ho:to.to+$n>zn?(uo=injectGaps(_n,Ce,to,$n,Hn),Kn(to.to+$n,!1)):uo=to.toTree(),Un.push(uo),qn.push(io-Xn)}return Kn(ke.to+$n,!1),new Tree(ke.type,Un,qn,ke.to+$n-Xn,ke.tree?ke.tree.propValues:void 0)}class MarkdownParser extends Parser{constructor(Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn){super(),this.nodeSet=Ce,this.blockParsers=ke,this.leafBlockParsers=$n,this.blockNames=Hn,this.endLeafBlock=zn,this.skipContextMarkup=Un,this.inlineParsers=qn,this.inlineNames=Xn,this.wrappers=Kn,this.nodeTypes=Object.create(null);for(let to of Ce.types)this.nodeTypes[to.name]=to.id}createParse(Ce,ke,$n){let Hn=new BlockContext(this,Ce,ke,$n);for(let zn of this.wrappers)Hn=zn(Hn,Ce,ke,$n);return Hn}configure(Ce){let ke=resolveConfig(Ce);if(!ke)return this;let{nodeSet:$n,skipContextMarkup:Hn}=this,zn=this.blockParsers.slice(),Un=this.leafBlockParsers.slice(),qn=this.blockNames.slice(),Xn=this.inlineParsers.slice(),Kn=this.inlineNames.slice(),to=this.endLeafBlock.slice(),io=this.wrappers;if(nonEmpty(ke.defineNodes)){Hn=Object.assign({},Hn);let uo=$n.types.slice(),ho;for(let bo of ke.defineNodes){let{name:Oo,block:So,composite:$o,style:Do}=typeof bo=="string"?{name:bo}:bo;if(uo.some(Vo=>Vo.name==Oo))continue;$o&&(Hn[uo.length]=(Vo,Jo,Mo)=>$o(Jo,Mo,Vo.value));let xo=uo.length,Io=$o?["Block","BlockContext"]:So?xo>=Type.ATXHeading1&&xo<=Type.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;uo.push(NodeType.define({id:xo,name:Oo,props:Io&&[[NodeProp.group,Io]]})),Do&&(ho||(ho={}),Array.isArray(Do)||Do instanceof Tag?ho[Oo]=Do:Object.assign(ho,Do))}$n=new NodeSet(uo),ho&&($n=$n.extend(styleTags(ho)))}if(nonEmpty(ke.props)&&($n=$n.extend(...ke.props)),nonEmpty(ke.remove))for(let uo of ke.remove){let ho=this.blockNames.indexOf(uo),bo=this.inlineNames.indexOf(uo);ho>-1&&(zn[ho]=Un[ho]=void 0),bo>-1&&(Xn[bo]=void 0)}if(nonEmpty(ke.parseBlock))for(let uo of ke.parseBlock){let ho=qn.indexOf(uo.name);if(ho>-1)zn[ho]=uo.parse,Un[ho]=uo.leaf;else{let bo=uo.before?findName(qn,uo.before):uo.after?findName(qn,uo.after)+1:qn.length-1;zn.splice(bo,0,uo.parse),Un.splice(bo,0,uo.leaf),qn.splice(bo,0,uo.name)}uo.endLeaf&&to.push(uo.endLeaf)}if(nonEmpty(ke.parseInline))for(let uo of ke.parseInline){let ho=Kn.indexOf(uo.name);if(ho>-1)Xn[ho]=uo.parse;else{let bo=uo.before?findName(Kn,uo.before):uo.after?findName(Kn,uo.after)+1:Kn.length-1;Xn.splice(bo,0,uo.parse),Kn.splice(bo,0,uo.name)}}return ke.wrap&&(io=io.concat(ke.wrap)),new MarkdownParser($n,zn,Un,qn,to,Hn,Xn,Kn,io)}getNodeType(Ce){let ke=this.nodeTypes[Ce];if(ke==null)throw new RangeError(`Unknown node type '${Ce}'`);return ke}parseInline(Ce,ke){let $n=new InlineContext(this,Ce,ke);e:for(let Hn=ke;Hn<$n.end;){let zn=$n.char(Hn);for(let Un of this.inlineParsers)if(Un){let qn=Un($n,zn,Hn);if(qn>=0){Hn=qn;continue e}}Hn++}return $n.resolveMarkers(0)}}function nonEmpty(_n){return _n!=null&&_n.length>0}function resolveConfig(_n){if(!Array.isArray(_n))return _n;if(_n.length==0)return null;let Ce=resolveConfig(_n[0]);if(_n.length==1)return Ce;let ke=resolveConfig(_n.slice(1));if(!ke||!Ce)return Ce||ke;let $n=(Un,qn)=>(Un||none).co
Line truncated
|
||||
`;)zn--;this.fragmentEnd=zn?zn-1:0}let $n=this.cursor;$n||($n=this.cursor=this.fragment.tree.cursor(),$n.firstChild());let Hn=Ce+this.fragment.offset;for(;$n.to<=Hn;)if(!$n.parent())return!1;for(;;){if($n.from>=Hn)return this.fragment.from<=ke;if(!$n.childAfter(Hn))return!1}}matches(Ce){let ke=this.cursor.tree;return ke&&ke.prop(NodeProp.contextHash)==Ce}takeNodes(Ce){let ke=this.cursor,$n=this.fragment.offset,Hn=this.fragmentEnd-(this.fragment.openEnd?1:0),zn=Ce.absoluteLineStart,Un=zn,qn=Ce.block.children.length,Xn=Un,Kn=qn;for(;;){if(ke.to-$n>Hn){if(ke.type.isAnonymous&&ke.firstChild())continue;break}let to=toRelative(ke.from-$n,Ce.ranges);if(ke.to-$n<=Ce.ranges[Ce.rangeI].to)Ce.addNode(ke.tree,to);else{let io=new Tree(Ce.parser.nodeSet.types[Type.Paragraph],[],[],0,Ce.block.hashProp);Ce.reusePlaceholders.set(io,ke.tree),Ce.addNode(io,to)}if(ke.type.is("Block")&&(NotLast.indexOf(ke.type.id)<0?(Un=ke.to-$n,qn=Ce.block.children.length):(Un=Xn,qn=Kn,Xn=ke.to-$n,Kn=Ce.block.children.length)),!ke.nextSibling())break}for(;Ce.block.children.length>qn;)Ce.block.children.pop(),Ce.block.positions.pop();return Un-zn}}function toRelative(_n,Ce){let ke=_n;for(let $n=1;$n<Ce.length;$n++){let Hn=Ce[$n-1].to,zn=Ce[$n].from;Hn<_n&&(ke-=zn-Hn)}return ke}const markdownHighlighting=styleTags({"Blockquote/...":tags$1.quote,HorizontalRule:tags$1.contentSeparator,"ATXHeading1/... SetextHeading1/...":tags$1.heading1,"ATXHeading2/... SetextHeading2/...":tags$1.heading2,"ATXHeading3/...":tags$1.heading3,"ATXHeading4/...":tags$1.heading4,"ATXHeading5/...":tags$1.heading5,"ATXHeading6/...":tags$1.heading6,"Comment CommentBlock":tags$1.comment,Escape:tags$1.escape,Entity:tags$1.character,"Emphasis/...":tags$1.emphasis,"StrongEmphasis/...":tags$1.strong,"Link/... Image/...":tags$1.link,"OrderedList/... BulletList/...":tags$1.list,"BlockQuote/...":tags$1.quote,"InlineCode CodeText":tags$1.monospace,"URL Autolink":tags$1.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":tags$1.processingInstruction,"CodeInfo LinkLabel":tags$1.labelName,LinkTitle:tags$1.string,Paragraph:tags$1.content}),parser$3=new MarkdownParser(new NodeSet(nodeTypes).extend(markdownHighlighting),Object.keys(DefaultBlockParsers).map(_n=>DefaultBlockParsers[_n]),Object.keys(DefaultBlockParsers).map(_n=>DefaultLeafBlocks[_n]),Object.keys(DefaultBlockParsers),DefaultEndLeaf,DefaultSkipMarkup,Object.keys(DefaultInline).map(_n=>DefaultInline[_n]),Object.keys(DefaultInline),[]);function leftOverSpace(_n,Ce,ke){let $n=[];for(let Hn=_n.firstChild,zn=Ce;;Hn=Hn.nextSibling){let Un=Hn?Hn.from:ke;if(Un>zn&&$n.push({from:zn,to:Un}),!Hn)break;zn=Hn.to}return $n}function parseCode(_n){let{codeParser:Ce,htmlParser:ke}=_n;return{wrap:parseMixed((Hn,zn)=>{let Un=Hn.type.id;if(Ce&&(Un==Type.CodeBlock||Un==Type.FencedCode)){let qn="";if(Un==Type.FencedCode){let Kn=Hn.node.getChild(Type.CodeInfo);Kn&&(qn=zn.read(Kn.from,Kn.to))}let Xn=Ce(qn);if(Xn)return{parser:Xn,overlay:Kn=>Kn.type.id==Type.CodeText}}else if(ke&&(Un==Type.HTMLBlock||Un==Type.HTMLTag))return{parser:ke,overlay:leftOverSpace(Hn.node,Hn.from,Hn.to)};return null})}}const StrikethroughDelim={resolve:"Strikethrough",mark:"StrikethroughMark"},Strikethrough={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":tags$1.strikethrough}},{name:"StrikethroughMark",style:tags$1.processingInstruction}],parseInline:[{name:"Strikethrough",parse(_n,Ce,ke){if(Ce!=126||_n.char(ke+1)!=126||_n.char(ke+2)==126)return-1;let $n=_n.slice(ke-1,ke),Hn=_n.slice(ke+2,ke+3),zn=/\s|^$/.test($n),Un=/\s|^$/.test(Hn),qn=Punctuation.test($n),Xn=Punctuation.test(Hn);return _n.addDelimiter(StrikethroughDelim,ke,ke+2,!Un&&(!Xn||zn||qn),!zn&&(!qn||Un||Xn))},after:"Emphasis"}]};function parseRow(_n,Ce,ke=0,$n,Hn=0){let zn=0,Un=!0,qn=-1,Xn=-1,Kn=!1,to=()=>{$n.push(_n.elt("TableCell",Hn+qn,Hn+Xn,_n.parser.parseInline(Ce.slice(qn,Xn),Hn+qn)))};for(let io=ke;io<Ce.length;io++){let uo=Ce.charCodeAt(io);uo==124&&!Kn?((!Un||qn>-1)&&zn++,Un=!1,$n&&(qn>-1&&to(),$n.push(_n.elt("TableDelimiter",io+Hn,io+Hn+1))),qn=Xn=-1):(Kn||uo!=32&&uo!=9)&&(qn<0&&(qn=io),Xn=io+1),Kn=!Kn&&uo==92}return qn>-1&&(zn++,$n&&to()),zn}function hasPipe(_n,Ce){for(let ke=Ce;ke<_n.length;ke++){let $n=_n.charCodeAt(ke);if($n==124)return!0;$n==92&&ke++}return!1}const delimiterLine=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class TableParser{constructor(){this.rows=null}nextLine(Ce,ke,$n){if(this.rows==null){this.rows=!1;let Hn;if((ke.next==45||ke.next==58||ke.next==124)&&delimiterLine.test(Hn=ke.text.slice(ke.pos))){let zn=[];parseRow(Ce,$n.content,0,zn,$n.start)==parseRow(Ce,Hn,ke.pos)&&(this.rows=[Ce.elt("TableHeader",$n.start,$n.start+$n.content.length,zn),Ce.elt("TableDelimiter",Ce.lineStart+ke.pos,Ce.lineStart+ke.text.length)])}}else if(this.rows){let Hn=[];parseRow(Ce,ke.text,ke.pos,Hn,Ce.lineStart),this.rows.push(Ce.elt("TableRow",Ce.lineStart+ke.pos,Ce.lineStart+ke.text.length,Hn))}return!1}finish(Ce,ke){return this.rows?(Ce.addLeafElement(ke,Ce.elt("Table",k
Line truncated
|
||||
\${}
|
||||
} catch (\${error}) {
|
||||
\${}
|
||||
}`,{label:"try",detail:"/ catch block",type:"keyword"}),snippetCompletion("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),snippetCompletion(`if (\${}) {
|
||||
\${}
|
||||
} else {
|
||||
\${}
|
||||
}`,{label:"if",detail:"/ else block",type:"keyword"}),snippetCompletion(`class \${name} {
|
||||
constructor(\${params}) {
|
||||
\${}
|
||||
}
|
||||
}`,{label:"class",detail:"definition",type:"keyword"}),snippetCompletion('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),snippetCompletion('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],typescriptSnippets=snippets.concat([snippetCompletion("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),snippetCompletion("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),snippetCompletion("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),cache=new NodeWeakMap,ScopeNodes=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function defID(_n){return(Ce,ke)=>{let $n=Ce.node.getChild("VariableDefinition");return $n&&ke($n,_n),!0}}const functionContext=["FunctionDeclaration"],gatherCompletions={FunctionDeclaration:defID("function"),ClassDeclaration:defID("class"),ClassExpression:()=>!0,EnumDeclaration:defID("constant"),TypeAliasDeclaration:defID("type"),NamespaceDeclaration:defID("namespace"),VariableDefinition(_n,Ce){_n.matchContext(functionContext)||Ce(_n,"variable")},TypeDefinition(_n,Ce){Ce(_n,"type")},__proto__:null};function getScope(_n,Ce){let ke=cache.get(Ce);if(ke)return ke;let $n=[],Hn=!0;function zn(Un,qn){let Xn=_n.sliceString(Un.from,Un.to);$n.push({label:Xn,type:qn})}return Ce.cursor(IterMode.IncludeAnonymous).iterate(Un=>{if(Hn)Hn=!1;else if(Un.name){let qn=gatherCompletions[Un.name];if(qn&&qn(Un,zn)||ScopeNodes.has(Un.name))return!1}else if(Un.to-Un.from>8192){for(let qn of getScope(_n,Un.node))$n.push(qn);return!1}}),cache.set(Ce,$n),$n}const Identifier=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,dontComplete=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function localCompletionSource(_n){let Ce=syntaxTree(_n.state).resolveInner(_n.pos,-1);if(dontComplete.indexOf(Ce.name)>-1)return null;let ke=Ce.name=="VariableName"||Ce.to-Ce.from<20&&Identifier.test(_n.state.sliceDoc(Ce.from,Ce.to));if(!ke&&!_n.explicit)return null;let $n=[];for(let Hn=Ce;Hn;Hn=Hn.parent)ScopeNodes.has(Hn.name)&&($n=$n.concat(getScope(_n.state.doc,Hn)));return{options:$n,from:ke?Ce.from:_n.pos,validFor:Identifier}}const javascriptLanguage=LRLanguage.define({name:"javascript",parser:parser.configure({props:[indentNodeProp.add({IfStatement:continuedIndent({except:/^\s*({|else\b)/}),TryStatement:continuedIndent({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:flatIndent,SwitchBody:_n=>{let Ce=_n.textAfter,ke=/^\s*\}/.test(Ce),$n=/^\s*(case|default)\b/.test(Ce);return _n.baseIndent+(ke?0:$n?1:2)*_n.unit},Block:delimitedIndent({closing:"}"}),ArrowFunction:_n=>_n.baseIndent+_n.unit,"TemplateString BlockComment":()=>null,"Statement Property":continuedIndent({except:/^{/}),JSXElement(_n){let Ce=/^\s*<\//.test(_n.textAfter);return _n.lineIndent(_n.node.from)+(Ce?0:_n.unit)},JSXEscape(_n){let Ce=/\s*\}/.test(_n.textAfter);return _n.lineIndent(_n.node.from)+(Ce?0:_n.unit)},"JSXOpenTag JSXSelfClosingTag"(_n){return _n.column(_n.node.from)+_n.unit}}),foldNodeProp.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":foldInside,BlockComment(_n){return{from:_n.from+2,to:_n.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),jsxSublanguage={test:_n=>/^JSX/.test(_n.name),facet:defineLanguageFacet({commentTokens:{block:{open:"{/*",close:"*/}"}}})},typescriptLanguage=javascriptLanguage.configure({dialect:"ts"},"typescript"),jsxLanguage=javascriptLanguage.configure({dialect:"jsx",props:[sublanguageProp.add(_n=>_n.isTop?[jsxSublanguage]:void 0)]}),tsxLanguage=javascriptLanguage.configure({dialect:"jsx ts",props:[sublanguageProp.add(_n=>_n.isTop?[jsxSublanguage]:void 0)]},"typescript");let kwCompletion=_n=>({label:_n,type:"keyword"});const keywords="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(kwCompletion),typescriptKeywords=keywords.concat(["declare","implements","private","protected","public"].map(kwCompletion));function javascript(_n={}){let Ce=_n.jsx?_n.typescript?tsxLanguage:jsxLanguage:_n.typescript?typescriptLanguage:javascriptLanguage,ke=_n.typescript?typescriptSnippets.concat(typescriptKeywords):snippets.concat(keywords);return new LanguageSupport(Ce,[javascriptLanguage.data.of({autocomplete:ifNotIn(dontComplete,completeFromList(ke))}),javascriptLanguage.data.of({autocomplete:localCompletionSource}),_n.jsx?autoCloseTags$1:[]])}function findOpenTag(_n){for(;;){if(_n.name=="JSXOpenTag"||_n.name=="JSXSelfClosingTag"||_n.name=="JSXFragmentTag")return _n;if(_n
Line truncated
|
||||
`,attr(Ce,"class","start-typing")},m(ke,$n){insert$1(ke,Ce,$n)},p:noop,d(ke){ke&&detach(Ce)}}}function create_each_block_1$1(_n,Ce){let ke,$n=previewTitle(Ce[9].schemas,Ce[24],Ce[0])+"",Hn,zn,Un,qn;function Xn(...to){return Ce[17](Ce[24],...to)}function Kn(...to){return Ce[18](Ce[24],...to)}return{key:_n,first:null,c(){ke=element("div"),Hn=text($n),zn=space$3(),attr(ke,"class","reference-tags-option"),attr(ke,"role","button"),attr(ke,"tabindex","0"),this.first=ke},m(to,io){insert$1(to,ke,io),append(ke,Hn),append(ke,zn),Un||(qn=[listen(ke,"click",Xn),listen(ke,"keypress",Kn)],Un=!0)},p(to,io){Ce=to,io&65&&$n!==($n=previewTitle(Ce[9].schemas,Ce[24],Ce[0])+"")&&set_data(Hn,$n)},d(to){to&&detach(ke),Un=!1,run_all(qn)}}}function create_if_block_1$7(_n){let Ce,ke,$n,Hn,zn,Un;return{c(){Ce=element("div"),ke=text('Add "'),$n=text(_n[5]),Hn=text('"'),attr(Ce,"class","reference-tags-option"),attr(Ce,"role","button"),attr(Ce,"tabindex","0")},m(qn,Xn){insert$1(qn,Ce,Xn),append(Ce,ke),append(Ce,$n),append(Ce,Hn),zn||(Un=[listen(Ce,"click",_n[19]),listen(Ce,"keypress",_n[20])],zn=!0)},p(qn,Xn){Xn&32&&set_data($n,qn[5])},d(qn){qn&&detach(Ce),zn=!1,run_all(Un)}}}function create_if_block$9(_n){let Ce,ke=[],$n=new Map,Hn,zn=ensure_array_like(_n[7]);const Un=qn=>qn[3].id;for(let qn=0;qn<zn.length;qn+=1){let Xn=get_each_context$7(_n,zn,qn),Kn=Un(Xn);$n.set(Kn,ke[qn]=create_each_block$7(Kn,Xn))}return{c(){Ce=element("div");for(let qn=0;qn<ke.length;qn+=1)ke[qn].c();set_style(Ce,"display","flex"),set_style(Ce,"align-items","center"),set_style(Ce,"gap","4px")},m(qn,Xn){insert$1(qn,Ce,Xn);for(let Kn=0;Kn<ke.length;Kn+=1)ke[Kn]&&ke[Kn].m(Ce,null);Hn=!0},p(qn,Xn){Xn&1664&&(zn=ensure_array_like(qn[7]),group_outros(),ke=update_keyed_each(ke,Xn,Un,1,qn,zn,$n,Ce,outro_and_destroy_block,create_each_block$7,null,get_each_context$7),check_outros())},i(qn){if(!Hn){for(let Xn=0;Xn<zn.length;Xn+=1)transition_in(ke[Xn]);Hn=!0}},o(qn){for(let Xn=0;Xn<ke.length;Xn+=1)transition_out(ke[Xn]);Hn=!1},d(qn){qn&&detach(Ce);for(let Xn=0;Xn<ke.length;Xn+=1)ke[Xn].d()}}}function create_each_block$7(_n,Ce){let ke,$n,Hn=previewTitle(Ce[9].schemas,Ce[3])+"",zn,Un,qn,Xn,Kn,to,io,uo,ho;Kn=new Icon({props:{width:12,height:12,icon:"close"}});function bo(...Oo){return Ce[21](Ce[3],...Oo)}return{key:_n,first:null,c(){ke=element("span"),$n=element("a"),zn=text(Hn),qn=space$3(),Xn=element("button"),create_component(Kn.$$.fragment),to=space$3(),attr($n,"class","record-title"),attr($n,"href",Un=Ce[9].lucentUrl+"/records/"+Ce[3].id),attr(Xn,"type","button"),attr(Xn,"class","button-text"),attr(Xn,"aria-label","Close"),attr(ke,"class","reference-tags-selected-value"),this.first=ke},m(Oo,So){insert$1(Oo,ke,So),append(ke,$n),append($n,zn),append(ke,qn),append(ke,Xn),mount_component(Kn,Xn,null),append(ke,to),io=!0,uo||(ho=listen(Xn,"click",prevent_default(bo)),uo=!0)},p(Oo,So){Ce=Oo,(!io||So&128)&&Hn!==(Hn=previewTitle(Ce[9].schemas,Ce[3])+"")&&set_data(zn,Hn),(!io||So&128&&Un!==(Un=Ce[9].lucentUrl+"/records/"+Ce[3].id))&&attr($n,"href",Un)},i(Oo){io||(transition_in(Kn.$$.fragment,Oo),io=!0)},o(Oo){transition_out(Kn.$$.fragment,Oo),io=!1},d(Oo){Oo&&detach(ke),destroy_component(Kn),uo=!1,ho()}}}function create_fragment$d(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho=_n[8]&&create_if_block_3$4(_n),bo=_n[6]&&create_if_block_2$4(_n),Oo=_n[5]&&create_if_block_1$7(_n),So=_n[7].length>0&&create_if_block$9(_n);return{c(){Ce=element("div"),ho&&ho.c(),ke=space$3(),$n=element("input"),zn=space$3(),Un=element("div"),bo&&bo.c(),qn=space$3(),Oo&&Oo.c(),Xn=space$3(),So&&So.c(),Kn=empty$1(),attr($n,"type","search"),attr($n,"id",_n[2]),attr($n,"placeholder",Hn="Search for "+_n[1].label),attr($n,"autocomplete","off"),toggle_class($n,"is-invalid",_n[8]),attr(Un,"class","reference-tags-results"),attr(Ce,"class","reference-tags")},m($o,Do){insert$1($o,Ce,Do),ho&&ho.m(Ce,null),append(Ce,ke),append(Ce,$n),_n[15]($n),set_input_value($n,_n[5]),append(Ce,zn),append(Ce,Un),bo&&bo.m(Un,null),append(Un,qn),Oo&&Oo.m(Un,null),insert$1($o,Xn,Do),So&&So.m($o,Do),insert$1($o,Kn,Do),to=!0,io||(uo=[listen($n,"keyup",_n[13]),listen($n,"input",_n[16])],io=!0)},p($o,[Do]){$o[8]?ho?ho.p($o,Do):(ho=create_if_block_3$4($o),ho.c(),ho.m(Ce,ke)):ho&&(ho.d(1),ho=null),(!to||Do&4)&&attr($n,"id",$o[2]),(!to||Do&2&&Hn!==(Hn="Search for "+$o[1].label))&&attr($n,"placeholder",Hn),Do&32&&$n.value!==$o[5]&&set_input_value($n,$o[5]),(!to||Do&256)&&toggle_class($n,"is-invalid",$o[8]),$o[6]?bo?bo.p($o,Do):(bo=create_if_block_2$4($o),bo.c(),bo.m(Un,qn)):bo&&(bo.d(1),bo=null),$o[5]?Oo?Oo.p($o,Do):(Oo=create_if_block_1$7($o),Oo.c(),Oo.m(Un,null)):Oo&&(Oo.d(1),Oo=null),$o[7].length>0?So?(So.p($o,Do),Do&128&&transition_in(So,1)):(So=create_if_block$9($o),So.c(),transition_in(So,1),So.m(Kn.parentNode,Kn)):So&&(group_outros(),transition_out(So,1,1,()=>{So=null}),check_outros())},i($o){to||(transition_in(So),to=!0)},o($o){transition_out(So),to=!1},d($o){$o&&(detach(Ce),detach(Xn),detach(Kn)),ho&&ho.d(),_n[15](null),bo
Line truncated
|
||||
versions`),ha=space$3(),hs=element("div"),zo.c(),el=space$3(),ga=element("div"),Sr&&Sr.c(),attr(zn,"class","label text-end text-muted"),attr(uo,"class","label text-end text-muted"),attr(Do,"class","label text-end text-muted"),attr(ms,"class","label text-end text-muted"),attr($n,"class","col-8"),attr(xs,"class","label d-block text-muted "),attr(gs,"class","col-4"),attr(ke,"class","row"),attr(Ce,"class","lx-card "),attr(hs,"class","revisions")},m(Us,fs){insert$1(Us,Ce,fs),append(Ce,ke),append(ke,$n),append($n,Hn),append(Hn,zn),append(Hn,Un),append(Hn,qn),append(qn,Kn),append($n,to),append($n,io),append(io,uo),append(io,ho),append(io,Oo),append($n,So),append($n,$o),append($o,Do),append($o,xo),mount_component(Io,$o,null),append($o,Vo),append($o,Mo),append($n,Go),append($n,os),append(os,ms),append(os,is),mount_component(Yo,os,null),append(os,Ys),append(os,Js),append(ke,ko),append(ke,gs),append(gs,xs),append(gs,Qr),append(gs,cr),append(cr,ws),append(cr,Br),append(cr,_r),insert$1(Us,ha,fs),insert$1(Us,hs,fs),Il[Qs].m(hs,null),insert$1(Us,el,fs),insert$1(Us,ga,fs),Sr&&Sr.m(ga,null),_n[13](ga),Ca=!0},p(Us,[fs]){(!Ca||fs&1)&&Xn!==(Xn=Us[0].id+"")&&set_data(Kn,Xn),(!Ca||fs&1)&&bo!==(bo=Us[0]._sys.version+"")&&set_data(Oo,bo);const dr={};fs&3&&(dr.name=usernameById(Us[1],Us[0]._sys.createdBy)),Io.$set(dr),(!Ca||fs&1)&&Jo!==(Jo=friendlyDate(Us[0]._sys.createdAt)+"")&&set_data(Mo,Jo);const Vr={};fs&3&&(Vr.name=usernameById(Us[1],Us[0]._sys.updatedBy)),Yo.$set(Vr),(!Ca||fs&1)&&sr!==(sr=friendlyDate(Us[0]._sys.updatedAt)+"")&&set_data(Js,sr),(!Ca||fs&4)&&Fs!==(Fs=Us[2].revisions+"")&&set_data(Br,Fs);let nr=Qs;Qs=Zs(Us),Qs===nr?Il[Qs].p(Us,fs):(group_outros(),transition_out(Il[nr],1,1,()=>{Il[nr]=null}),check_outros(),zo=Il[Qs],zo?zo.p(Us,fs):(zo=Il[Qs]=za[Qs](Us),zo.c()),transition_in(zo,1),zo.m(hs,null)),Us[5]?Sr?(Sr.p(Us,fs),fs&32&&transition_in(Sr,1)):(Sr=create_if_block$6(Us),Sr.c(),transition_in(Sr,1),Sr.m(ga,null)):Sr&&(group_outros(),transition_out(Sr,1,1,()=>{Sr=null}),check_outros())},i(Us){Ca||(transition_in(Io.$$.fragment,Us),transition_in(Yo.$$.fragment,Us),transition_in(zo),transition_in(Sr),Ca=!0)},o(Us){transition_out(Io.$$.fragment,Us),transition_out(Yo.$$.fragment,Us),transition_out(zo),transition_out(Sr),Ca=!1},d(Us){Us&&(detach(Ce),detach(ha),detach(hs),detach(el),detach(ga)),destroy_component(Io),destroy_component(Yo),Il[Qs].d(),Sr&&Sr.d(),_n[13](null)}}}function instance$8(_n,Ce,ke){let $n,Hn,zn,Un;const qn=getContext$1("channel");let{record:Xn}=Ce,{graph:Kn}=Ce,{users:to}=Ce,{schema:io}=Ce,uo,ho="";axios.get(`${qn.lucentUrl}/records/${Xn.id}/revisions`).then(xo=>{ke(8,$n=xo.data)}).catch(xo=>{console.log(xo)});function bo(xo,Io){ke(7,Un=Kn.edges.filter(Vo=>Vo.depth===1).reduce((Vo,Jo)=>(Vo[Jo.field]||(Vo[Jo.field]={record:[],revision:[]}),Vo[Jo.field].record.push(Jo),Vo),{})),ke(7,Un=Io._edges.reduce((Vo,Jo)=>(Vo[Jo.field]||(Vo[Jo.field]={record:[],revision:[]}),Vo[Jo.field].revision.push(Jo),Vo),Un))}function Oo(xo,Io){xo.preventDefault(),ke(5,zn=Io),ke(6,Hn=io.fields.filter(Vo=>!lodashExports.isEqual(zn.data[Vo.name],Xn.data[Vo.name]))),bo(Hn,Io),uo.scrollIntoView()}function So(xo){xo.preventDefault(),ke(4,ho=""),axios.post(`${qn.lucentUrl}/records/${Xn.id}/rollback/${zn._sys.version}`).then(Io=>{window.location.reload()}).catch(Io=>{const Vo=Io.response.data.error;ke(4,ho=Vo.fieldLabel+": "+Vo.message)})}const $o=(xo,Io)=>Oo(Io,xo);function Do(xo){binding_callbacks[xo?"unshift":"push"](()=>{uo=xo,ke(3,uo)})}return _n.$$set=xo=>{"record"in xo&&ke(0,Xn=xo.record),"graph"in xo&&ke(11,Kn=xo.graph),"users"in xo&&ke(1,to=xo.users),"schema"in xo&&ke(2,io=xo.schema)},ke(8,$n=[]),ke(6,Hn=[]),ke(5,zn=null),ke(7,Un={}),[Xn,to,io,uo,ho,zn,Hn,Un,$n,Oo,So,Kn,$o,Do]}class Info extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$8,create_fragment$8,safe_not_equal,{record:0,graph:11,users:1,schema:2})}}const{window:window_1}=globals;function get_each_context$3(_n,Ce,ke){const $n=_n.slice();return $n[21]=Ce[ke],$n}function create_if_block_5(_n){let Ce,ke,$n;return{c(){Ce=element("button"),Ce.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
||||
Save`,attr(Ce,"type","button"),attr(Ce,"class","button primary ms-2 btn btn-primary btn-spinner")},m(Hn,zn){insert$1(Hn,Ce,zn),ke||($n=listen(Ce,"click",_n[11]),ke=!0)},p:noop,d(Hn){Hn&&detach(Ce),ke=!1,$n()}}}function create_if_block_4(_n){let Ce,ke,$n;return{c(){Ce=element("button"),Ce.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
||||
Create`,attr(Ce,"class","button primary btn-spinner")},m(Hn,zn){insert$1(Hn,Ce,zn),ke||($n=listen(Ce,"click",_n[11]),ke=!0)},p:noop,d(Hn){Hn&&detach(Ce),ke=!1,$n()}}}function create_if_block_3(_n){let Ce,ke;return Ce=new Info({props:{record:_n[0],graph:_n[1],users:_n[4],schema:_n[2]}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&1&&(zn.record=$n[0]),Hn&2&&(zn.graph=$n[1]),Hn&16&&(zn.users=$n[4]),Hn&4&&(zn.schema=$n[2]),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_if_block_2(_n){let Ce,ke;return Ce=new Graph({props:{graph:_n[1],record:_n[0]}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&2&&(zn.graph=$n[1]),Hn&1&&(zn.record=$n[0]),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_if_block$5(_n){let Ce,ke,$n=[],Hn=new Map,zn,Un;Ce=new FilePreview({props:{record:_n[0],schema:_n[2]}});let qn=ensure_array_like(_n[9]);const Xn=Kn=>Kn[21].name;for(let Kn=0;Kn<qn.length;Kn+=1){let to=get_each_context$3(_n,qn,Kn),io=Xn(to);Hn.set(io,$n[Kn]=create_each_block$3(io,to))}return{c(){create_component(Ce.$$.fragment),ke=space$3();for(let Kn=0;Kn<$n.length;Kn+=1)$n[Kn].c();zn=empty$1()},m(Kn,to){mount_component(Ce,Kn,to),insert$1(Kn,ke,to);for(let io=0;io<$n.length;io+=1)$n[io]&&$n[io].m(Kn,to);insert$1(Kn,zn,to),Un=!0},p(Kn,to){const io={};to&1&&(io.record=Kn[0]),to&4&&(io.schema=Kn[2]),Ce.$set(io),to&623&&(qn=ensure_array_like(Kn[9]),group_outros(),$n=update_keyed_each($n,to,Xn,1,Kn,qn,Hn,zn.parentNode,outro_and_destroy_block,create_each_block$3,zn,get_each_context$3),check_outros())},i(Kn){if(!Un){transition_in(Ce.$$.fragment,Kn);for(let to=0;to<qn.length;to+=1)transition_in($n[to]);Un=!0}},o(Kn){transition_out(Ce.$$.fragment,Kn);for(let to=0;to<$n.length;to+=1)transition_out($n[to]);Un=!1},d(Kn){Kn&&(detach(ke),detach(zn)),destroy_component(Ce,Kn);for(let to=0;to<$n.length;to+=1)$n[to].d(Kn)}}}function create_if_block_1$3(_n){let Ce,ke,$n,Hn;function zn(Xn){_n[15](Xn)}function Un(Xn){_n[16](Xn)}let qn={field:_n[21],schema:_n[2],record:_n[0],validationErrors:_n[5],isCreateMode:_n[3]};return _n[0].data!==void 0&&(qn.data=_n[0].data),_n[1]!==void 0&&(qn.graph=_n[1]),Ce=new FormField({props:qn}),binding_callbacks.push(()=>bind(Ce,"data",zn)),binding_callbacks.push(()=>bind(Ce,"graph",Un)),{c(){create_component(Ce.$$.fragment)},m(Xn,Kn){mount_component(Ce,Xn,Kn),Hn=!0},p(Xn,Kn){const to={};Kn&4&&(to.schema=Xn[2]),Kn&1&&(to.record=Xn[0]),Kn&32&&(to.validationErrors=Xn[5]),Kn&8&&(to.isCreateMode=Xn[3]),!ke&&Kn&1&&(ke=!0,to.data=Xn[0].data,add_flush_callback(()=>ke=!1)),!$n&&Kn&2&&($n=!0,to.graph=Xn[1],add_flush_callback(()=>$n=!1)),Ce.$set(to)},i(Xn){Hn||(transition_in(Ce.$$.fragment,Xn),Hn=!0)},o(Xn){transition_out(Ce.$$.fragment,Xn),Hn=!1},d(Xn){destroy_component(Ce,Xn)}}}function create_each_block$3(_n,Ce){let ke,$n,Hn,zn=Ce[6]===Ce[21].group&&create_if_block_1$3(Ce);return{key:_n,first:null,c(){ke=empty$1(),zn&&zn.c(),$n=empty$1(),this.first=ke},m(Un,qn){insert$1(Un,ke,qn),zn&&zn.m(Un,qn),insert$1(Un,$n,qn),Hn=!0},p(Un,qn){Ce=Un,Ce[6]===Ce[21].group?zn?(zn.p(Ce,qn),qn&64&&transition_in(zn,1)):(zn=create_if_block_1$3(Ce),zn.c(),transition_in(zn,1),zn.m($n.parentNode,$n)):zn&&(group_outros(),transition_out(zn,1,1,()=>{zn=null}),check_outros())},i(Un){Hn||(transition_in(zn),Hn=!0)},o(Un){transition_out(zn),Hn=!1},d(Un){Un&&(detach(ke),detach($n)),zn&&zn.d(Un)}}}function create_fragment$7(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho,bo,Oo,So,$o,Do,xo,Io,Vo;function Jo(gs){_n[12](gs)}function Mo(gs){_n[13](gs)}let Go={schema:_n[2],isCreateMode:_n[3]};_n[0]!==void 0&&(Go.record=_n[0]),_n[6]!==void 0&&(Go.activeContentTab=_n[6]),$n=new EditHeader({props:Go}),binding_callbacks.push(()=>bind($n,"record",Jo)),binding_callbacks.push(()=>bind($n,"activeContentTab",Mo));function os(gs,xs){if(gs[3])return create_if_block_4;if(gs[8])return create_if_block_5}let ms=os(_n),is=ms&&ms(_n);Xn=new Title({props:{schema:_n[2],record:_n[0],isCreateMode:_n[3]}}),to=new ErrorAlert({props:{message:_n[7]}});function Yo(gs){_n[14](gs)}let Ys={schema:_n[2],isCreateMode:_n[3]};_n[6]!==void 0&&(Ys.active=_n[6]),ho=new ContentTabs({props:Ys}),binding_callbacks.push(()=>bind(ho,"active",Yo));const sr=[create_if_block$5,create_if_block_2,create_if_block_3],Js=[];function ko(gs,xs){return xs&64&&(So=null),So==null&&(So=!["_graph","_info"].includes(gs[6])),So?0:gs[6]==="_graph"?1:gs[6]==="_info"?2:-1}return~($o=ko(_n,-1))&&(Do=Js[$o]=sr[$o](_n)),{c(){Ce=element("div"),ke=element("div"),create_component($n.$$.fragment),Un=space$3(),is&&is.c(),qn=space$3(),create_component(Xn.$$.fragment),Kn=space$3(),create_component(to.$$.fragment),io=space$3(),uo=element("div"),create_component(ho.$$.fragment),Oo=s
Line truncated
|
||||
`),Oo=element("div"),Oo.textContent=" ",So=text(`
|
||||
`),attr($n,"class","header-small mb-5"),attr(Un,"class","button primary mb-3"),Un.disabled=_n[2],attr(Kn,"class","mb-3"),attr(uo,"class","logs svelte-a3cwpi"),attr(ke,"class","lx-card mt-5"),attr(Ce,"class","common-wrapper")},m(Vo,Jo){insert$1(Vo,Ce,Jo),append(Ce,ke),append(ke,$n),append($n,Hn),append(ke,zn),append(ke,Un),append(Un,qn),append(ke,Xn),append(ke,Kn),xo&&xo.m(Kn,null),append(Kn,to),Io&&Io.m(Kn,null),append(ke,io),append(ke,uo),append(uo,ho),append(uo,bo),append(uo,Oo),_n[6](Oo),append(uo,So),$o||(Do=listen(Un,"click",_n[4]),$o=!0)},p(Vo,[Jo]){Jo&1&&set_data(Hn,Vo[0]),Jo&4&&(Un.disabled=Vo[2]),Vo[2]?xo||(xo=create_if_block_1(),xo.c(),xo.m(Kn,to)):xo&&(xo.d(1),xo=null),!Vo[2]&&Vo[3]?Io||(Io=create_if_block$1(),Io.c(),Io.m(Kn,null)):Io&&(Io.d(1),Io=null),Jo&8&&set_data(ho,Vo[3])},i:noop,o:noop,d(Vo){Vo&&detach(Ce),xo&&xo.d(),Io&&Io.d(),_n[6](null),$o=!1,Do()}}}function instance$2(_n,Ce,ke){let $n;const Hn=getContext$1("channel");let{title:zn}=Ce,{command:Un}=Ce,qn,Xn=!1;function Kn(){const uo=new EventSource(Hn.lucentUrl+"/command-report-source/"+Un.signature);uo.onmessage=function(ho){ke(2,Xn=!0);const bo=JSON.parse(ho.data);bo.date,ke(3,$n=bo.logs),qn.scrollIntoView()},uo.onerror=ho=>{console.log(ho),uo.close(),ke(2,Xn=!1)}}function to(uo){uo.preventDefault(),ke(2,Xn=!0),axios$1.post(Hn.lucentUrl+"/command/"+Un.signature).then(ho=>{Kn()})}onMount(()=>{Kn()});function io(uo){binding_callbacks[uo?"unshift":"push"](()=>{qn=uo,ke(1,qn)})}return _n.$$set=uo=>{"title"in uo&&ke(0,zn=uo.title),"command"in uo&&ke(5,Un=uo.command)},ke(3,$n=""),[zn,qn,Xn,$n,to,Un,io]}class Report extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$2,create_fragment$2,safe_not_equal,{title:0,command:5})}}function get_each_context(_n,Ce,ke){const $n=_n.slice();return $n[2]=Ce[ke],$n}function create_if_block(_n){let Ce,ke;return Ce=new Dropdown({props:{$$slots:{button:[create_button_slot],default:[create_default_slot]},$$scope:{ctx:_n}}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&32&&(zn.$$scope={dirty:Hn,ctx:$n}),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_each_block(_n){let Ce,ke=_n[2].name+"",$n;return{c(){Ce=element("a"),$n=text(ke),attr(Ce,"href",_n[0].lucentUrl+"/command-report/"+_n[2].signature),attr(Ce,"class","top-nav-item")},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,$n)},p:noop,d(Hn){Hn&&detach(Ce)}}}function create_default_slot(_n){let Ce,ke=ensure_array_like(_n[0].commands),$n=[];for(let Hn=0;Hn<ke.length;Hn+=1)$n[Hn]=create_each_block(get_each_context(_n,ke,Hn));return{c(){for(let Hn=0;Hn<$n.length;Hn+=1)$n[Hn].c();Ce=empty$1()},m(Hn,zn){for(let Un=0;Un<$n.length;Un+=1)$n[Un]&&$n[Un].m(Hn,zn);insert$1(Hn,Ce,zn)},p(Hn,zn){if(zn&1){ke=ensure_array_like(Hn[0].commands);let Un;for(Un=0;Un<ke.length;Un+=1){const qn=get_each_context(Hn,ke,Un);$n[Un]?$n[Un].p(qn,zn):($n[Un]=create_each_block(qn),$n[Un].c(),$n[Un].m(Ce.parentNode,Ce))}for(;Un<$n.length;Un+=1)$n[Un].d(1);$n.length=ke.length}},d(Hn){Hn&&detach(Ce),destroy_each($n,Hn)}}}function create_button_slot(_n){let Ce;return{c(){Ce=element("div"),Ce.textContent="Actions",attr(Ce,"slot","button")},m(ke,$n){insert$1(ke,Ce,$n)},p:noop,d(ke){ke&&detach(Ce)}}}function create_fragment$1(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn=_n[0].commands.length>0&&create_if_block(_n);return qn=new Avatar({props:{side:"28",name:_n[1].name}}),{c(){Ce=element("div"),ke=element("a"),$n=text("Members"),Hn=space$3(),Kn&&Kn.c(),zn=space$3(),Un=element("a"),create_component(qn.$$.fragment),attr(ke,"class","top-nav-item"),attr(ke,"href",_n[0].lucentUrl+"/members"),attr(Un,"href",_n[0].lucentUrl+"/profile"),attr(Ce,"class","top-nav ")},m(to,io){insert$1(to,Ce,io),append(Ce,ke),append(ke,$n),append(Ce,Hn),Kn&&Kn.m(Ce,null),append(Ce,zn),append(Ce,Un),mount_component(qn,Un,null),Xn=!0},p(to,[io]){to[0].commands.length>0&&Kn.p(to,io)},i(to){Xn||(transition_in(Kn),transition_in(qn.$$.fragment,to),Xn=!0)},o(to){transition_out(Kn),transition_out(qn.$$.fragment,to),Xn=!1},d(to){to&&detach(Ce),Kn&&Kn.d(),destroy_component(qn)}}}function instance$1(_n){const Ce=getContext$1("channel"),ke=getContext$1("user");return console.log(Ce.commands),[Ce,ke]}class Header extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1,create_fragment$1,safe_not_equal,{})}}function create_fragment(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn;$n=new Navbar({props:{schema:_n[2].schema}}),Un=new Header({});const to=[{title:_n[0]},_n[2]];var io=_n[3][_n[1]];function uo(ho,bo){let Oo={};for(let So=0;So<to.length;So+=1)Oo=assign(Oo,to[So]);return bo!==void 0&&bo&5&&(Oo=assign(Oo,get_spread_update(to,[bo&1&&{title:ho[0]},bo&4&&get_spread_object(ho[2])]))),{props:Oo}}return io&&(Xn=construct_svelte_component(io,uo(_n))),{c(){Ce=element("div"),ke=element("div"),create_component($n.$$.fragment),Hn=space$3(),zn=element("div"),create_com
Line truncated
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
@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
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
@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
|
||||
Vendored
+188
@@ -0,0 +1,188 @@
|
||||
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={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};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
|
||||
Vendored
+6
-3
@@ -1,11 +1,14 @@
|
||||
{
|
||||
"main.js": {
|
||||
"file": "assets/main-BJyanQ7P.js",
|
||||
"name": "main",
|
||||
"file": "assets/main.7c3e8b7b.js",
|
||||
"src": "main.js",
|
||||
"isEntry": true,
|
||||
"css": [
|
||||
"assets/main-Dk7njt4m.css"
|
||||
"assets/main.587d6006.css"
|
||||
]
|
||||
},
|
||||
"main.css": {
|
||||
"file": "assets/main.587d6006.css",
|
||||
"src": "main.css"
|
||||
}
|
||||
}
|
||||
@@ -1,139 +0,0 @@
|
||||
/* 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 });
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
let app;
|
||||
let channel;
|
||||
|
||||
export function createApp(channelData) {
|
||||
channel = channelData;
|
||||
|
||||
app = {
|
||||
url: (path) => {
|
||||
return channel.lucentUrl + "/" + path;
|
||||
},
|
||||
};
|
||||
return app;
|
||||
}
|
||||
|
||||
export function getApp() {
|
||||
return app;
|
||||
}
|
||||
Vendored
-3
@@ -5,9 +5,6 @@
|
||||
*/
|
||||
|
||||
import axios from "axios";
|
||||
import {loadHtmxFormsBehaviour} from "./htmx-form.js";
|
||||
|
||||
loadHtmxFormsBehaviour();
|
||||
window.axios = axios;
|
||||
export const axiosInstance = axios;
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
<script>
|
||||
let { onDelete, text } = $props();
|
||||
let isClicked = $state(false);
|
||||
|
||||
function handleTryDelete(e) {
|
||||
e.preventDefault();
|
||||
isClicked = true;
|
||||
}
|
||||
|
||||
function handleCancel(e) {
|
||||
e.preventDefault();
|
||||
isClicked = false;
|
||||
}
|
||||
|
||||
function handleRealDelete(e) {
|
||||
e.preventDefault();
|
||||
onDelete();
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if !isClicked}
|
||||
<form onsubmit={handleTryDelete}>
|
||||
<button class="danger" type="submit">
|
||||
{@render text()}
|
||||
</button>
|
||||
</form>
|
||||
{/if}
|
||||
{#if isClicked}
|
||||
Are you sure?
|
||||
<form onsubmit={handleCancel}>
|
||||
<button class="secondary" type="submit">No</button>
|
||||
</form>
|
||||
<form onsubmit={handleRealDelete}>
|
||||
<button class="danger" type="submit">Yes</button>
|
||||
</form>
|
||||
{/if}
|
||||
@@ -1,159 +0,0 @@
|
||||
<script>
|
||||
const icons = {
|
||||
"trash-can": {
|
||||
path: '<path d="M135.2 17.69C140.6 6.848 151.7 0 163.8 0H284.2C296.3 0 307.4 6.848 312.8 17.69L320 32H416C433.7 32 448 46.33 448 64C448 81.67 433.7 96 416 96H32C14.33 96 0 81.67 0 64C0 46.33 14.33 32 32 32H128L135.2 17.69zM31.1 128H416V448C416 483.3 387.3 512 352 512H95.1C60.65 512 31.1 483.3 31.1 448V128zM111.1 208V432C111.1 440.8 119.2 448 127.1 448C136.8 448 143.1 440.8 143.1 432V208C143.1 199.2 136.8 192 127.1 192C119.2 192 111.1 199.2 111.1 208zM207.1 208V432C207.1 440.8 215.2 448 223.1 448C232.8 448 240 440.8 240 432V208C240 199.2 232.8 192 223.1 192C215.2 192 207.1 199.2 207.1 208zM304 208V432C304 440.8 311.2 448 320 448C328.8 448 336 440.8 336 432V208C336 199.2 328.8 192 320 192C311.2 192 304 199.2 304 208z"/>',
|
||||
viewBox: "0 0 448 512",
|
||||
},
|
||||
"circle-chevron-down": {
|
||||
path: '<path d="M256 0C114.6 0 0 114.6 0 256c0 141.4 114.6 256 256 256s256-114.6 256-256C512 114.6 397.4 0 256 0zM390.6 246.6l-112 112C272.4 364.9 264.2 368 256 368s-16.38-3.125-22.62-9.375l-112-112c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L256 290.8l89.38-89.38c12.5-12.5 32.75-12.5 45.25 0S403.1 234.1 390.6 246.6z"/>',
|
||||
viewBox: "0 0 512 512",
|
||||
},
|
||||
"circle-chevron-up": {
|
||||
path: '<path d="M256 0C114.6 0 0 114.6 0 256c0 141.4 114.6 256 256 256s256-114.6 256-256C512 114.6 397.4 0 256 0zM390.6 310.6c-12.5 12.5-32.75 12.5-45.25 0L256 221.3L166.6 310.6c-12.5 12.5-32.75 12.5-45.25 0s-12.5-32.75 0-45.25l112-112C239.6 147.1 247.8 144 256 144s16.38 3.125 22.62 9.375l112 112C403.1 277.9 403.1 298.1 390.6 310.6z"/>',
|
||||
viewBox: "0 0 512 512",
|
||||
},
|
||||
ellipsis: {
|
||||
path: '<path d="M120 256C120 286.9 94.93 312 64 312C33.07 312 8 286.9 8 256C8 225.1 33.07 200 64 200C94.93 200 120 225.1 120 256zM280 256C280 286.9 254.9 312 224 312C193.1 312 168 286.9 168 256C168 225.1 193.1 200 224 200C254.9 200 280 225.1 280 256zM328 256C328 225.1 353.1 200 384 200C414.9 200 440 225.1 440 256C440 286.9 414.9 312 384 312C353.1 312 328 286.9 328 256z"/>',
|
||||
viewBox: "0 0 448 512",
|
||||
},
|
||||
"ellipsis-vertical": {
|
||||
path: '<path d="M64 360C94.93 360 120 385.1 120 416C120 446.9 94.93 472 64 472C33.07 472 8 446.9 8 416C8 385.1 33.07 360 64 360zM64 200C94.93 200 120 225.1 120 256C120 286.9 94.93 312 64 312C33.07 312 8 286.9 8 256C8 225.1 33.07 200 64 200zM64 152C33.07 152 8 126.9 8 96C8 65.07 33.07 40 64 40C94.93 40 120 65.07 120 96C120 126.9 94.93 152 64 152z"/>',
|
||||
viewBox: "0 0 128 512",
|
||||
},
|
||||
"angles-down": {
|
||||
path: '<path d="M169.4 278.6C175.6 284.9 183.8 288 192 288s16.38-3.125 22.62-9.375l160-160c12.5-12.5 12.5-32.75 0-45.25s-32.75-12.5-45.25 0L192 210.8L54.63 73.38c-12.5-12.5-32.75-12.5-45.25 0s-12.5 32.75 0 45.25L169.4 278.6zM329.4 265.4L192 402.8L54.63 265.4c-12.5-12.5-32.75-12.5-45.25 0s-12.5 32.75 0 45.25l160 160C175.6 476.9 183.8 480 192 480s16.38-3.125 22.62-9.375l160-160c12.5-12.5 12.5-32.75 0-45.25S341.9 252.9 329.4 265.4z"/>',
|
||||
viewBox: "0 0 384 512",
|
||||
},
|
||||
"angle-right": {
|
||||
path: '<path d="M64 448c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L178.8 256L41.38 118.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l160 160c12.5 12.5 12.5 32.75 0 45.25l-160 160C80.38 444.9 72.19 448 64 448z"/>',
|
||||
viewBox: "0 0 256 512",
|
||||
},
|
||||
"photo-film": {
|
||||
path: '<path d="M352 432c0 8.836-7.164 16-16 16H176c-8.838 0-16-7.164-16-16L160 128H48C21.49 128 .0003 149.5 .0003 176v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48L512 384h-160L352 432zM104 439c0 4.969-4.031 9-9 9h-30c-4.969 0-9-4.031-9-9v-30c0-4.969 4.031-9 9-9h30c4.969 0 9 4.031 9 9V439zM104 335c0 4.969-4.031 9-9 9h-30c-4.969 0-9-4.031-9-9v-30c0-4.969 4.031-9 9-9h30c4.969 0 9 4.031 9 9V335zM104 231c0 4.969-4.031 9-9 9h-30c-4.969 0-9-4.031-9-9v-30C56 196 60.03 192 65 192h30c4.969 0 9 4.031 9 9V231zM408 409c0-4.969 4.031-9 9-9h30c4.969 0 9 4.031 9 9v30c0 4.969-4.031 9-9 9h-30c-4.969 0-9-4.031-9-9V409zM591.1 0H239.1C213.5 0 191.1 21.49 191.1 48v256c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48v-256C640 21.49 618.5 0 591.1 0zM303.1 64c17.68 0 32 14.33 32 32s-14.32 32-32 32C286.3 128 271.1 113.7 271.1 96S286.3 64 303.1 64zM574.1 279.6C571.3 284.8 565.9 288 560 288H271.1C265.1 288 260.5 284.6 257.7 279.3C255 273.9 255.5 267.4 259.1 262.6l70-96C332.1 162.4 336.9 160 341.1 160c5.11 0 9.914 2.441 12.93 6.574l22.35 30.66l62.74-94.11C442.1 98.67 447.1 96 453.3 96c5.348 0 10.34 2.672 13.31 7.125l106.7 160C576.6 268 576.9 274.3 574.1 279.6z"/>',
|
||||
viewBox: "0 0 640 512",
|
||||
},
|
||||
file: {
|
||||
path: '<path d="M0 64C0 28.65 28.65 0 64 0H224V128C224 145.7 238.3 160 256 160H384V448C384 483.3 355.3 512 320 512H64C28.65 512 0 483.3 0 448V64zM256 128V0L384 128H256z"/>',
|
||||
viewBox: "0 0 384 512",
|
||||
},
|
||||
"circle-info": {
|
||||
path: '<path d="M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z"/>',
|
||||
viewBox: "0 0 512 512",
|
||||
},
|
||||
"table-columns": {
|
||||
path: '<path d="M0 96C0 60.65 28.65 32 64 32H448C483.3 32 512 60.65 512 96V416C512 451.3 483.3 480 448 480H64C28.65 480 0 451.3 0 416V96zM64 416H224V160H64V416zM448 160H288V416H448V160z"/>',
|
||||
viewBox: "0 0 512 512",
|
||||
},
|
||||
"arrow-down-a-z": {
|
||||
path: '<path d="M239.6 373.1c11.94-13.05 11.06-33.31-1.969-45.27c-13.55-12.42-33.76-10.52-45.22 1.973L160 366.1V64.03c0-17.7-14.33-32.03-32-32.03S96 46.33 96 64.03v302l-32.4-35.39C51.64 317.7 31.39 316.7 18.38 328.7c-13.03 11.95-13.9 32.22-1.969 45.27l87.1 96.09c12.12 13.26 35.06 13.26 47.19 0L239.6 373.1zM448 416h-50.75l73.38-73.38c9.156-9.156 11.89-22.91 6.938-34.88S460.9 288 447.1 288H319.1C302.3 288 288 302.3 288 320s14.33 32 32 32h50.75l-73.38 73.38c-9.156 9.156-11.89 22.91-6.938 34.88S307.1 480 319.1 480h127.1C465.7 480 480 465.7 480 448S465.7 416 448 416zM492.6 209.3l-79.99-160.1c-10.84-21.81-46.4-21.81-57.24 0L275.4 209.3c-7.906 15.91-1.5 35.24 14.31 43.19c15.87 7.922 35.04 1.477 42.93-14.4l7.154-14.39h88.43l7.154 14.39c6.174 12.43 23.97 23.87 42.93 14.4C494.1 244.6 500.5 225.2 492.6 209.3zM367.8 167.4L384 134.7l16.22 32.63H367.8z"/>',
|
||||
viewBox: "0 0 512 512",
|
||||
},
|
||||
"arrow-up-short-wide": {
|
||||
path: '<path d="M544 416h-223.1c-17.67 0-32 14.33-32 32s14.33 32 32 32H544c17.67 0 32-14.33 32-32S561.7 416 544 416zM320 96h32c17.67 0 31.1-14.33 31.1-32s-14.33-32-31.1-32h-32c-17.67 0-32 14.33-32 32S302.3 96 320 96zM320 224H416c17.67 0 32-14.33 32-32s-14.33-32-32-32h-95.1c-17.67 0-32 14.33-32 32S302.3 224 320 224zM320 352H480c17.67 0 32-14.33 32-32s-14.33-32-32-32h-159.1c-17.67 0-32 14.33-32 32S302.3 352 320 352zM151.6 41.95c-12.12-13.26-35.06-13.26-47.19 0l-87.1 96.09C4.475 151.1 5.35 171.4 18.38 183.3c6.141 5.629 13.89 8.414 21.61 8.414c8.672 0 17.3-3.504 23.61-10.39L96 145.9v302C96 465.7 110.3 480 128 480s32-14.33 32-32.03V145.9L192.4 181.3C204.4 194.3 224.6 195.3 237.6 183.3c13.03-11.95 13.9-32.22 1.969-45.27L151.6 41.95z"/>',
|
||||
viewBox: "0 0 576 512",
|
||||
},
|
||||
"arrow-down-wide-short": {
|
||||
path: '<path d="M416 288h-95.1c-17.67 0-32 14.33-32 32s14.33 32 32 32H416c17.67 0 32-14.33 32-32S433.7 288 416 288zM544 32h-223.1c-17.67 0-32 14.33-32 32s14.33 32 32 32H544c17.67 0 32-14.33 32-32S561.7 32 544 32zM352 416h-32c-17.67 0-32 14.33-32 32s14.33 32 32 32h32c17.67 0 31.1-14.33 31.1-32S369.7 416 352 416zM480 160h-159.1c-17.67 0-32 14.33-32 32s14.33 32 32 32H480c17.67 0 32-14.33 32-32S497.7 160 480 160zM192.4 330.7L160 366.1V64.03C160 46.33 145.7 32 128 32S96 46.33 96 64.03v302L63.6 330.7c-6.312-6.883-14.94-10.38-23.61-10.38c-7.719 0-15.47 2.781-21.61 8.414c-13.03 11.95-13.9 32.22-1.969 45.27l87.1 96.09c12.12 13.26 35.06 13.26 47.19 0l87.1-96.09c11.94-13.05 11.06-33.31-1.969-45.27C224.6 316.8 204.4 317.7 192.4 330.7z"/>',
|
||||
viewBox: "0 0 576 512",
|
||||
},
|
||||
filter: {
|
||||
path: '<path d="M3.853 54.87C10.47 40.9 24.54 32 40 32H472C487.5 32 501.5 40.9 508.1 54.87C514.8 68.84 512.7 85.37 502.1 97.33L320 320.9V448C320 460.1 313.2 471.2 302.3 476.6C291.5 482 278.5 480.9 268.8 473.6L204.8 425.6C196.7 419.6 192 410.1 192 400V320.9L9.042 97.33C-.745 85.37-2.765 68.84 3.854 54.87L3.853 54.87z"/>',
|
||||
viewBox: "0 0 512 512",
|
||||
},
|
||||
calendar: {
|
||||
path: '<path d="M96 32C96 14.33 110.3 0 128 0C145.7 0 160 14.33 160 32V64H288V32C288 14.33 302.3 0 320 0C337.7 0 352 14.33 352 32V64H400C426.5 64 448 85.49 448 112V160H0V112C0 85.49 21.49 64 48 64H96V32zM448 464C448 490.5 426.5 512 400 512H48C21.49 512 0 490.5 0 464V192H448V464z"/>',
|
||||
viewBox: "0 0 448 512",
|
||||
},
|
||||
pencil: {
|
||||
path: '<path d="M421.7 220.3L188.5 453.4L154.6 419.5L158.1 416H112C103.2 416 96 408.8 96 400V353.9L92.51 357.4C87.78 362.2 84.31 368 82.42 374.4L59.44 452.6L137.6 429.6C143.1 427.7 149.8 424.2 154.6 419.5L188.5 453.4C178.1 463.8 165.2 471.5 151.1 475.6L30.77 511C22.35 513.5 13.24 511.2 7.03 504.1C.8198 498.8-1.502 489.7 .976 481.2L36.37 360.9C40.53 346.8 48.16 333.9 58.57 323.5L291.7 90.34L421.7 220.3zM492.7 58.75C517.7 83.74 517.7 124.3 492.7 149.3L444.3 197.7L314.3 67.72L362.7 19.32C387.7-5.678 428.3-5.678 453.3 19.32L492.7 58.75z"/>',
|
||||
viewBox: "0 0 512 512",
|
||||
},
|
||||
database: {
|
||||
path: '<path d="M448 80V128C448 172.2 347.7 208 224 208C100.3 208 0 172.2 0 128V80C0 35.82 100.3 0 224 0C347.7 0 448 35.82 448 80zM393.2 214.7C413.1 207.3 433.1 197.8 448 186.1V288C448 332.2 347.7 368 224 368C100.3 368 0 332.2 0 288V186.1C14.93 197.8 34.02 207.3 54.85 214.7C99.66 230.7 159.5 240 224 240C288.5 240 348.3 230.7 393.2 214.7V214.7zM54.85 374.7C99.66 390.7 159.5 400 224 400C288.5 400 348.3 390.7 393.2 374.7C413.1 367.3 433.1 357.8 448 346.1V432C448 476.2 347.7 512 224 512C100.3 512 0 476.2 0 432V346.1C14.93 357.8 34.02 367.3 54.85 374.7z"/>',
|
||||
viewBox: "0 0 448 512",
|
||||
},
|
||||
dice: {
|
||||
path: '<path d="M447.1 224c0-12.56-4.781-25.13-14.35-34.76l-174.9-174.9C249.1 4.786 236.5 0 223.1 0C211.4 0 198.9 4.786 189.2 14.35L14.35 189.2C4.783 198.9-.0011 211.4-.0011 223.1c0 12.56 4.785 25.17 14.35 34.8l174.9 174.9c9.625 9.562 22.19 14.35 34.75 14.35s25.13-4.783 34.75-14.35l174.9-174.9C443.2 249.1 447.1 236.6 447.1 224zM96 248c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1S120 210.8 120 224S109.3 248 96 248zM224 376c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1s23.1 10.75 23.1 23.1S237.3 376 224 376zM224 248c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1S248 210.8 248 224S237.3 248 224 248zM224 120c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1s23.1 10.75 23.1 23.1S237.3 120 224 120zM352 248c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1s23.1 10.75 23.1 23.1S365.3 248 352 248zM591.1 192l-118.7 0c4.418 10.27 6.604 21.25 6.604 32.23c0 20.7-7.865 41.38-23.63 57.14l-136.2 136.2v46.37C320 490.5 341.5 512 368 512h223.1c26.5 0 47.1-21.5 47.1-47.1V240C639.1 213.5 618.5 192 591.1 192zM479.1 376c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1s23.1 10.75 23.1 23.1S493.2 376 479.1 376z"/>',
|
||||
viewBox: "0 0 640 512",
|
||||
},
|
||||
|
||||
"triangle-exclamation": {
|
||||
path: '<path d="M506.3 417l-213.3-364c-16.33-28-57.54-28-73.98 0l-213.2 364C-10.59 444.9 9.849 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM232 168c0-13.25 10.75-24 24-24S280 154.8 280 168v128c0 13.25-10.75 24-23.1 24S232 309.3 232 296V168zM256 416c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 401.9 273.4 416 256 416z"/>',
|
||||
viewBox: "0 0 512 512",
|
||||
},
|
||||
eye: {
|
||||
path: '<path d="M279.6 160.4C282.4 160.1 285.2 160 288 160C341 160 384 202.1 384 256C384 309 341 352 288 352C234.1 352 192 309 192 256C192 253.2 192.1 250.4 192.4 247.6C201.7 252.1 212.5 256 224 256C259.3 256 288 227.3 288 192C288 180.5 284.1 169.7 279.6 160.4zM480.6 112.6C527.4 156 558.7 207.1 573.5 243.7C576.8 251.6 576.8 260.4 573.5 268.3C558.7 304 527.4 355.1 480.6 399.4C433.5 443.2 368.8 480 288 480C207.2 480 142.5 443.2 95.42 399.4C48.62 355.1 17.34 304 2.461 268.3C-.8205 260.4-.8205 251.6 2.461 243.7C17.34 207.1 48.62 156 95.42 112.6C142.5 68.84 207.2 32 288 32C368.8 32 433.5 68.84 480.6 112.6V112.6zM288 112C208.5 112 144 176.5 144 256C144 335.5 208.5 400 288 400C367.5 400 432 335.5 432 256C432 176.5 367.5 112 288 112z"/>',
|
||||
viewBox: "0 0 576 512",
|
||||
},
|
||||
"circle-plus": {
|
||||
path: '<path d="M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM256 368C269.3 368 280 357.3 280 344V280H344C357.3 280 368 269.3 368 256C368 242.7 357.3 232 344 232H280V168C280 154.7 269.3 144 256 144C242.7 144 232 154.7 232 168V232H168C154.7 232 144 242.7 144 256C144 269.3 154.7 280 168 280H232V344C232 357.3 242.7 368 256 368z"/>',
|
||||
viewBox: "0 0 512 512",
|
||||
},
|
||||
"magnifying-glass": {
|
||||
path: '<path d="M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723C99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9c53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0C515.9 484.7 515.9 459.3 500.3 443.7zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128c0 70.58-57.42 128-128 128S79.1 278.6 79.1 208z"/>',
|
||||
viewBox: "0 0 512 512",
|
||||
},
|
||||
expand: {
|
||||
path: '<path d="M128 32H32C14.31 32 0 46.31 0 64v96c0 17.69 14.31 32 32 32s32-14.31 32-32V96h64c17.69 0 32-14.31 32-32S145.7 32 128 32zM416 32h-96c-17.69 0-32 14.31-32 32s14.31 32 32 32h64v64c0 17.69 14.31 32 32 32s32-14.31 32-32V64C448 46.31 433.7 32 416 32zM128 416H64v-64c0-17.69-14.31-32-32-32s-32 14.31-32 32v96c0 17.69 14.31 32 32 32h96c17.69 0 32-14.31 32-32S145.7 416 128 416zM416 320c-17.69 0-32 14.31-32 32v64h-64c-17.69 0-32 14.31-32 32s14.31 32 32 32h96c17.69 0 32-14.31 32-32v-96C448 334.3 433.7 320 416 320z"/>',
|
||||
viewBox: "0 0 448 512",
|
||||
},
|
||||
compress: {
|
||||
path: '<path d="M128 320H32c-17.69 0-32 14.31-32 32s14.31 32 32 32h64v64c0 17.69 14.31 32 32 32s32-14.31 32-32v-96C160 334.3 145.7 320 128 320zM416 320h-96c-17.69 0-32 14.31-32 32v96c0 17.69 14.31 32 32 32s32-14.31 32-32v-64h64c17.69 0 32-14.31 32-32S433.7 320 416 320zM320 192h96c17.69 0 32-14.31 32-32s-14.31-32-32-32h-64V64c0-17.69-14.31-32-32-32s-32 14.31-32 32v96C288 177.7 302.3 192 320 192zM128 32C110.3 32 96 46.31 96 64v64H32C14.31 128 0 142.3 0 160s14.31 32 32 32h96c17.69 0 32-14.31 32-32V64C160 46.31 145.7 32 128 32z"/>',
|
||||
viewBox: "0 0 448 512",
|
||||
},
|
||||
check: {
|
||||
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",
|
||||
},
|
||||
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",
|
||||
},
|
||||
};
|
||||
|
||||
let {
|
||||
width = 16,
|
||||
height = 16,
|
||||
icon,
|
||||
fill = "currentColor",
|
||||
stroke = "currentColor",
|
||||
} = $props();
|
||||
|
||||
let selectedIcon = icons[icon];
|
||||
</script>
|
||||
|
||||
<svg
|
||||
class="bi"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
{width}
|
||||
{height}
|
||||
viewBox={selectedIcon.viewBox}
|
||||
aria-labelledby={icon}
|
||||
role="presentation"
|
||||
{stroke}
|
||||
{fill}
|
||||
>
|
||||
{@html selectedIcon.path}
|
||||
</svg>
|
||||
|
||||
<style>
|
||||
svg {
|
||||
vertical-align: text-top;
|
||||
}
|
||||
</style>
|
||||
@@ -1,150 +0,0 @@
|
||||
<script>
|
||||
import { arrayMoveElement } from "../helpers";
|
||||
import { flip } from "svelte/animate";
|
||||
|
||||
let {
|
||||
sortableClass,
|
||||
onUpdate,
|
||||
items,
|
||||
itemView,
|
||||
itemCssClass,
|
||||
itemKey = "id",
|
||||
type = "list",
|
||||
handleClass = null,
|
||||
disabled = false,
|
||||
} = $props();
|
||||
// let sortableInstance = $state();
|
||||
let sortableContainer = $state();
|
||||
let draggedItem = $state();
|
||||
|
||||
function handleDragStart(event, item) {
|
||||
if (disabled) {
|
||||
return false;
|
||||
}
|
||||
draggedItem = item;
|
||||
// Set data required for drag operation
|
||||
event.dataTransfer.effectAllowed = "move";
|
||||
event.dataTransfer.setData("text/plain", item.id);
|
||||
// Set a ghost drag image
|
||||
event.currentTarget.classList.add("dragging");
|
||||
}
|
||||
|
||||
// Handle drag over another item
|
||||
function handleDragOver(event) {
|
||||
event.preventDefault();
|
||||
event.target.closest(".draggable-item").classList.add("dragover");
|
||||
event.dataTransfer.dropEffect = "move";
|
||||
}
|
||||
|
||||
// Handle dropping the item
|
||||
function handleDrop(event, targetItem) {
|
||||
event.preventDefault();
|
||||
|
||||
if (draggedItem === targetItem) return;
|
||||
// Find positions of dragged and target items
|
||||
const draggedIndex = items.findIndex(
|
||||
(item) => getItem(item, itemKey) === getItem(draggedItem, itemKey),
|
||||
);
|
||||
const targetIndex = items.findIndex(
|
||||
(item) => getItem(item, itemKey) === getItem(targetItem, itemKey),
|
||||
);
|
||||
|
||||
onUpdate(
|
||||
arrayMoveElement([...items], draggedIndex, targetIndex),
|
||||
draggedIndex,
|
||||
targetIndex,
|
||||
);
|
||||
}
|
||||
|
||||
function getItem(item, key) {
|
||||
if (key === null) {
|
||||
return item;
|
||||
}
|
||||
if (key.includes(".")) {
|
||||
return key.split(".").reduce((a, b) => a[b] ?? null, item);
|
||||
}
|
||||
return item[key];
|
||||
}
|
||||
|
||||
function handleDragEnd(event) {
|
||||
event.target.classList.remove("dragging");
|
||||
sortableContainer
|
||||
.querySelector(".dragover")
|
||||
?.classList.remove("dragover");
|
||||
draggedItem = null;
|
||||
const draggableItem = event.target.closest(".draggable-item");
|
||||
draggableItem.draggable = false;
|
||||
}
|
||||
|
||||
function handleDragLeave(event) {
|
||||
// event.target.classList.remove("dragover");
|
||||
const draggableItem = event.target.closest(".draggable-item");
|
||||
draggableItem.classList.remove("dragover");
|
||||
draggableItem.draggable = false;
|
||||
}
|
||||
|
||||
function handleMouseDown(e) {
|
||||
const handleEl = e.target.closest("." + handleClass);
|
||||
if (!handleEl) {
|
||||
return true;
|
||||
}
|
||||
const draggableItem = e.target.closest(".draggable-item");
|
||||
draggableItem.draggable = true;
|
||||
}
|
||||
|
||||
function handleMouseUp(e) {
|
||||
const handleEl = e.target.closest("." + handleClass);
|
||||
if (!handleEl) {
|
||||
return true;
|
||||
}
|
||||
const draggableItem = e.target.closest(".draggable-item");
|
||||
draggableItem.draggable = false;
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if type === "table"}
|
||||
<tbody
|
||||
class="sortable-container {sortableClass}"
|
||||
bind:this={sortableContainer}
|
||||
>
|
||||
{#each items as item (getItem(item, itemKey))}
|
||||
<tr
|
||||
animate:flip={{ duration: 100 }}
|
||||
class="draggable-item {itemCssClass}"
|
||||
draggable="false"
|
||||
onmousedown={handleMouseDown}
|
||||
onmouseup={handleMouseUp}
|
||||
ondragstart={(e) => handleDragStart(e, item)}
|
||||
ondragover={handleDragOver}
|
||||
ondragleave={handleDragLeave}
|
||||
ondrop={(e) => handleDrop(e, item)}
|
||||
ondragend={handleDragEnd}
|
||||
>
|
||||
{@render itemView(item)}
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
{:else}
|
||||
<div
|
||||
class="sortable-container {sortableClass}"
|
||||
bind:this={sortableContainer}
|
||||
>
|
||||
{#each items as item (getItem(item, itemKey))}
|
||||
<div
|
||||
animate:flip={{ duration: 100 }}
|
||||
role="listitem"
|
||||
class="draggable-item {itemCssClass}"
|
||||
draggable="false"
|
||||
onmousedown={handleMouseDown}
|
||||
onmouseup={handleMouseUp}
|
||||
ondragstart={(e) => handleDragStart(e, item)}
|
||||
ondragover={handleDragOver}
|
||||
ondragleave={handleDragLeave}
|
||||
ondrop={(e) => handleDrop(e, item)}
|
||||
ondragend={handleDragEnd}
|
||||
>
|
||||
{@render itemView(item)}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
@@ -1,124 +0,0 @@
|
||||
<script>
|
||||
import ChannelLayout from "../../layouts/ChannelLayout.svelte";
|
||||
import { post } from "../../modules/remote";
|
||||
import { getApp } from "../../app";
|
||||
import Table from "./Table.svelte";
|
||||
import Tools from "./Tools.svelte";
|
||||
|
||||
// import Tools from "./tools/Tools.svelte";
|
||||
// import Pagination from "./pagination/Pagination.svelte";
|
||||
// import ActionsOnSelected from "./ActionsOnSelected.svelte";
|
||||
// import Table from "./Table.svelte";
|
||||
let { channel, user, data } = $props();
|
||||
let newRecordName = $state("");
|
||||
const app = getApp();
|
||||
// export let schema;
|
||||
// export let users;
|
||||
// export let records;
|
||||
// export let graph;
|
||||
// // export let visibleFields;
|
||||
// export let systemFields;
|
||||
// export let sortParam;
|
||||
// export let sortField;
|
||||
// export let operators;
|
||||
// export let filter;
|
||||
// export let limit;
|
||||
// export let skip;
|
||||
// export let total;
|
||||
let inModal = false;
|
||||
// export let modalUrl;
|
||||
// export let selected = [];
|
||||
// export let isWritable = false;
|
||||
|
||||
// function refresh(e) {
|
||||
// const newUrl = e.detail;
|
||||
// axios
|
||||
// .get(newUrl)
|
||||
// .then((response) => {
|
||||
// records = response.data.records;
|
||||
// sortParam = response.data.sortParam;
|
||||
// sortField = response.data.sortField;
|
||||
// operators = response.data.operators;
|
||||
// filter = response.data.filter;
|
||||
// skip = response.data.skip;
|
||||
// limit = response.data.limit;
|
||||
// total = response.data.total;
|
||||
// modalUrl = response.data.modalUrl;
|
||||
// document.querySelector("dialog h3").scrollIntoView();
|
||||
// })
|
||||
// .catch((error) => {
|
||||
// console.log(error);
|
||||
// });
|
||||
// }
|
||||
//
|
||||
|
||||
function handleRecordCreate(e) {
|
||||
e.preventDefault();
|
||||
post(
|
||||
channel.lucentUrl + "/records",
|
||||
{
|
||||
schemaId: data.schema.id,
|
||||
title: newRecordName,
|
||||
},
|
||||
(data, err) => {
|
||||
if (err.isEmpty()) {
|
||||
Turbo.visit(app.url("records/" + data.id));
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<ChannelLayout {body} {channel} schemas={data.schemas} {user}></ChannelLayout>
|
||||
{#snippet body()}
|
||||
<div class="">
|
||||
<div class={inModal ? "mt-0" : "mt-5"}>
|
||||
<h3 class="header-normal mb-5">
|
||||
{data.schema.name}
|
||||
</h3>
|
||||
<details style="max-width: 400px;">
|
||||
<summary>New Record</summary>
|
||||
<form onsubmit={handleRecordCreate}>
|
||||
<fieldset>
|
||||
<input
|
||||
bind:value={newRecordName}
|
||||
placeholder="Record title"
|
||||
required
|
||||
/>
|
||||
</fieldset>
|
||||
<button type="submit">Create</button>
|
||||
</form>
|
||||
</details>
|
||||
<!-- {#if selected.length > 0 && !inModal && isWritable}
|
||||
<ActionsOnSelected {schema} {selected} {filter}/>
|
||||
{:else}
|
||||
<Tools
|
||||
bind:schema
|
||||
bind:records
|
||||
{systemFields}
|
||||
{sortParam}
|
||||
{sortField}
|
||||
{operators}
|
||||
{filter}
|
||||
{graph}
|
||||
{inModal}
|
||||
{modalUrl}
|
||||
{isWritable}
|
||||
on:refresh={refresh}
|
||||
/>
|
||||
{/if}
|
||||
-->
|
||||
<Tools fields={data.fields}></Tools>
|
||||
<Table records={data.records} fields={data.fields}></Table>
|
||||
</div>
|
||||
<!--
|
||||
<Pagination
|
||||
{limit}
|
||||
{skip}
|
||||
{total}
|
||||
on:refresh={refresh}
|
||||
{inModal}
|
||||
{modalUrl}
|
||||
/> -->
|
||||
</div>
|
||||
{/snippet}
|
||||
@@ -1,126 +0,0 @@
|
||||
<script>
|
||||
// import RecordRow from "./RecordRow.svelte";
|
||||
// import { previewTitle } from "../records/Preview";
|
||||
// import { usernameById } from "../account/users";
|
||||
// import Avatar from "../../common/Avatar.svelte";
|
||||
// import { selectRecord, toggleAll } from "./functions/recordSelect.js";
|
||||
// import Checkbox from "../common/Checkbox.svelte";
|
||||
// import Preview from "../files/Preview.svelte";
|
||||
// import { fileurl } from "../files/imageserver.js";
|
||||
import { getApp } from "../../app";
|
||||
|
||||
let { channel, records = [], fields = [], inModal = false } = $props();
|
||||
let params = new URLSearchParams(document.location.search);
|
||||
let columns = $state(params.get("columns")?.split(",") || []);
|
||||
let visibleFields = $derived(fields.filter((f) => columns.includes(f.id)));
|
||||
// export let schema;
|
||||
// export let users;
|
||||
// export let records;
|
||||
// export let graph;
|
||||
// export let systemFields;
|
||||
// export let sortParam;
|
||||
// export let sortField;
|
||||
// export let inModal;
|
||||
// export let isWritable;
|
||||
// export let selected = [];
|
||||
const app = getApp();
|
||||
|
||||
// function eventToggleAll(e) {
|
||||
// selected = toggleAll(e, records, selected);
|
||||
// }
|
||||
|
||||
// function select(record) {
|
||||
// selected = selectRecord(record, selected);
|
||||
// }
|
||||
|
||||
// $: visibleColumns = schema.fields.filter(
|
||||
// (c) => schema.visible?.includes(c.name) ?? [],
|
||||
// );
|
||||
</script>
|
||||
|
||||
<div class="table mt-5">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<!-- <th>
|
||||
<Checkbox
|
||||
value=""
|
||||
on:change={eventToggleAll}
|
||||
indeterminate={selected.length > 0 &&
|
||||
selected.length < records.length}
|
||||
checked={selected.length === records.length}
|
||||
></Checkbox>
|
||||
</th> -->
|
||||
<th>Title</th>
|
||||
|
||||
{#each visibleFields as field}
|
||||
<th scope="col" title={field.help}>{field.name}</th>
|
||||
{/each}
|
||||
<!-- {#each systemFields.filter( (c) => schema.visible?.includes(c.name), ) as sysField}
|
||||
<th class:is-sort={sysField.name === sortField.name}
|
||||
>{sysField.label}</th
|
||||
>
|
||||
{/each} -->
|
||||
<!-- <th></th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each records as qRecord (qRecord.record.id)}
|
||||
<tr>
|
||||
<td class="title-td">
|
||||
<div class="title-td-contents">
|
||||
<!-- <Checkbox
|
||||
on:change={() => select(record)}
|
||||
checked={selected.find(
|
||||
(r) => r.id === record.id,
|
||||
)}
|
||||
value={record}
|
||||
></Checkbox> -->
|
||||
|
||||
<a
|
||||
href="{app.url('records/')}{qRecord.record.id}"
|
||||
target={inModal ? "_blank" : "_self"}
|
||||
>
|
||||
<!-- {#if record.status === "draft"}
|
||||
<span
|
||||
style="text-transform: uppercase;font-size:10px"
|
||||
>{record.status}</span
|
||||
>
|
||||
{/if} -->
|
||||
<!-- {previewTitle(channel.schemas, record, graph)} -->
|
||||
{qRecord.recordPreview.title}
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
{#each visibleFields as field}
|
||||
<td>
|
||||
{qRecord.data.find((f) => f.fieldId === field.id)
|
||||
?.value}
|
||||
|
||||
<ul>
|
||||
{#each qRecord.children.filter((e) => e.edge.fieldId === field.id) as child}
|
||||
<li>{child.recordPreview.title}</li>
|
||||
{/each}
|
||||
</ul>
|
||||
</td>
|
||||
{/each}
|
||||
<!-- <RecordRow
|
||||
{record}
|
||||
{graph}
|
||||
{schema}
|
||||
{visibleColumns}
|
||||
{sortParam}
|
||||
{sortField}
|
||||
{users}
|
||||
/> -->
|
||||
<!-- <td>
|
||||
<Avatar
|
||||
name={usernameById(users, record._sys.updatedBy)}
|
||||
side={24}
|
||||
/>
|
||||
</td> -->
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -1,76 +0,0 @@
|
||||
<script>
|
||||
let { fields } = $props();
|
||||
|
||||
let params = new URLSearchParams(document.location.search);
|
||||
|
||||
let sortBy = $state(params.get("sortBy") + "_" + params.get("sortDir"));
|
||||
let columns = $state(params.get("columns")?.split(",") || []);
|
||||
|
||||
function handleSortAsc() {
|
||||
params.set("sortBy", sortBy.replace("_asc", ""));
|
||||
params.set("sortDir", "asc");
|
||||
Turbo.visit(window.location.pathname + `?` + params.toString());
|
||||
}
|
||||
|
||||
function handleSortDesc() {
|
||||
params.set("sortBy", sortBy.replace("_desc", ""));
|
||||
params.set("sortDir", "desc");
|
||||
Turbo.visit(window.location.pathname + `?` + params.toString());
|
||||
}
|
||||
|
||||
function handleToggleColumn() {
|
||||
params.set("columns", columns.join(","));
|
||||
Turbo.visit(window.location.pathname + `?` + params.toString());
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Radios -->
|
||||
<details class="dropdown">
|
||||
<summary> Sort by </summary>
|
||||
<ul>
|
||||
{#each fields as field}
|
||||
<li>
|
||||
<label>
|
||||
<input
|
||||
bind:group={sortBy}
|
||||
type="radio"
|
||||
value={field.id + "_asc"}
|
||||
onchange={handleSortAsc}
|
||||
/>
|
||||
{field.name}
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label>
|
||||
<input
|
||||
bind:group={sortBy}
|
||||
type="radio"
|
||||
value={field.id + "_desc"}
|
||||
onchange={handleSortDesc}
|
||||
/>
|
||||
{field.name} desc
|
||||
</label>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
</details>
|
||||
|
||||
<!-- Checkboxes -->
|
||||
<details class="dropdown">
|
||||
<summary> Show/Hide columns </summary>
|
||||
<ul>
|
||||
{#each fields as field}
|
||||
<li>
|
||||
<label>
|
||||
<input
|
||||
bind:group={columns}
|
||||
type="checkbox"
|
||||
value={field.id}
|
||||
onchange={handleToggleColumn}
|
||||
/>
|
||||
{field.name}
|
||||
</label>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
</details>
|
||||
@@ -1,65 +0,0 @@
|
||||
<script>
|
||||
import SchemaLayout from "../../layouts/SchemaLayout.svelte";
|
||||
import { post } from "../../modules/remote";
|
||||
import { getApp } from "../../app";
|
||||
let { channel, user, data, newRank } = $props();
|
||||
let name = $state("");
|
||||
let alias = $state("");
|
||||
const app = getApp();
|
||||
|
||||
function handleCreate(e) {
|
||||
e.preventDefault();
|
||||
post(
|
||||
app.url("fields"),
|
||||
{
|
||||
schemaId: data.schema.id,
|
||||
name: name,
|
||||
alias: alias,
|
||||
fieldType: data.type,
|
||||
},
|
||||
(data, err) => {
|
||||
if (err.isEmpty()) {
|
||||
Turbo.visit(app.url("fields/edit/" + data.field.id));
|
||||
} else {
|
||||
console.log(err);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<SchemaLayout {body} {channel} {user}></SchemaLayout>
|
||||
{#snippet body()}
|
||||
<h3 class="header-small mb-4 mt-5">Create a <em>{data.type}</em> field</h3>
|
||||
|
||||
<form onsubmit={handleCreate}>
|
||||
<fieldset>
|
||||
<label>
|
||||
Name
|
||||
<input
|
||||
bind:value={name}
|
||||
placeholder="ex. Description"
|
||||
minlength="2"
|
||||
maxlength="30"
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
Alias
|
||||
<input
|
||||
bind:value={alias}
|
||||
placeholder="ex. description"
|
||||
minlength="2"
|
||||
maxlength="30"
|
||||
required
|
||||
aria-describedby="alias-helper"
|
||||
/>
|
||||
<small id="alias-helper">
|
||||
Developers will use this to reference the field
|
||||
</small>
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
<button type="submit">Create</button>
|
||||
</form>
|
||||
{/snippet}
|
||||
@@ -1,160 +0,0 @@
|
||||
<script>
|
||||
import SchemaLayout from "../../layouts/SchemaLayout.svelte";
|
||||
import TextFieldProps from "./TextFieldProps.svelte";
|
||||
import RelationFieldProps from "./RelationFieldProps.svelte";
|
||||
import FileFieldProps from "./FileFieldProps.svelte";
|
||||
import DeleteButton from "../../common/DeleteButton.svelte";
|
||||
import { post } from "../../modules/remote";
|
||||
import { getApp } from "../../app";
|
||||
let { channel, user, data } = $props();
|
||||
|
||||
const app = getApp();
|
||||
|
||||
function handleUpdate(e) {
|
||||
e.preventDefault();
|
||||
post(
|
||||
app.url("fields/update"),
|
||||
{
|
||||
field: data.field,
|
||||
},
|
||||
(data, err) => {
|
||||
if (err.isEmpty()) {
|
||||
Turbo.visit(app.url("schemas"));
|
||||
} else {
|
||||
console.log(err);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
function handleDelete() {
|
||||
post(
|
||||
app.url("fields/delete"),
|
||||
{
|
||||
fieldId: data.field.id,
|
||||
},
|
||||
(data, err) => {
|
||||
if (err.isEmpty()) {
|
||||
Turbo.visit(app.url("schemas"));
|
||||
} else {
|
||||
console.log(err);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<SchemaLayout {body} {channel} {user}></SchemaLayout>
|
||||
{#snippet body()}
|
||||
<h3 class="header-small mb-4 mt-5">
|
||||
Edit <em>{data.field.type}</em> field {data.field.name}
|
||||
</h3>
|
||||
|
||||
{#if data.field.alias == "_title"}
|
||||
{@render titleField()}
|
||||
{:else}
|
||||
{@render normalfield()}
|
||||
{/if}
|
||||
{/snippet}
|
||||
|
||||
{#snippet normalfield()}
|
||||
<form onsubmit={handleUpdate}>
|
||||
<fieldset>
|
||||
<label>
|
||||
Name
|
||||
<input
|
||||
bind:value={data.field.name}
|
||||
placeholder="ex. Description"
|
||||
minlength="2"
|
||||
maxlength="30"
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
Alias
|
||||
<input
|
||||
bind:value={data.field.alias}
|
||||
placeholder="ex. description"
|
||||
minlength="2"
|
||||
maxlength="30"
|
||||
required
|
||||
aria-describedby="alias-helper"
|
||||
/>
|
||||
<small id="alias-helper">
|
||||
Developers will use this to reference the field
|
||||
</small>
|
||||
</label>
|
||||
<label>
|
||||
Help text
|
||||
<input bind:value={data.field.help} />
|
||||
</label>
|
||||
<label>
|
||||
<input
|
||||
bind:checked={data.field.translatable}
|
||||
type="checkbox"
|
||||
role="switch"
|
||||
/>
|
||||
Is Translatable
|
||||
</label>
|
||||
<fieldset>
|
||||
<label>
|
||||
<input
|
||||
bind:checked={data.field.required}
|
||||
type="checkbox"
|
||||
role="switch"
|
||||
/>
|
||||
Required
|
||||
</label>
|
||||
<label>
|
||||
<input
|
||||
bind:checked={data.field.readonly}
|
||||
type="checkbox"
|
||||
role="switch"
|
||||
/>
|
||||
Readonly
|
||||
</label>
|
||||
<label>
|
||||
<input
|
||||
bind:checked={data.field.hidden}
|
||||
type="checkbox"
|
||||
role="switch"
|
||||
/>
|
||||
Hidden
|
||||
</label>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
|
||||
{#if data.field.type === "text"}
|
||||
<TextFieldProps field={data.field}></TextFieldProps>
|
||||
{:else if data.field.type === "relation"}
|
||||
<RelationFieldProps field={data.field} schemas={data.schemas}
|
||||
></RelationFieldProps>
|
||||
{:else if data.field.type === "file"}
|
||||
<FileFieldProps field={data.field}></FileFieldProps>
|
||||
{/if}
|
||||
|
||||
<button type="submit">Update</button>
|
||||
</form>
|
||||
<DeleteButton onDelete={handleDelete}>
|
||||
{#snippet text()}
|
||||
Delete field
|
||||
{/snippet}
|
||||
</DeleteButton>
|
||||
{/snippet}
|
||||
|
||||
{#snippet titleField()}
|
||||
<form onsubmit={handleUpdate}>
|
||||
<fieldset>
|
||||
<label>
|
||||
<input
|
||||
bind:checked={data.field.translatable}
|
||||
type="checkbox"
|
||||
role="switch"
|
||||
/>
|
||||
Is Translatable
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
<button type="submit">Update</button>
|
||||
</form>
|
||||
{/snippet}
|
||||
@@ -1,15 +0,0 @@
|
||||
<script>
|
||||
let { field } = $props();
|
||||
</script>
|
||||
|
||||
<fieldset>
|
||||
<label>
|
||||
Min items
|
||||
<input type="number" bind:value={field.props.min} />
|
||||
</label>
|
||||
|
||||
<label>
|
||||
Max items
|
||||
<input type="number" bind:value={field.props.max} />
|
||||
</label>
|
||||
</fieldset>
|
||||
@@ -1,29 +0,0 @@
|
||||
<script>
|
||||
let { field, schemas } = $props();
|
||||
</script>
|
||||
|
||||
<fieldset>
|
||||
<label>
|
||||
Schemas
|
||||
<select
|
||||
bind:value={field.props.schemas}
|
||||
aria-label="Select allowed schemas"
|
||||
multiple
|
||||
size="6"
|
||||
>
|
||||
<option disabled>Select allowed schemas </option>
|
||||
{#each schemas as schema}
|
||||
<option value={schema.id}>{schema.name}</option>
|
||||
{/each}
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
Min items
|
||||
<input type="number" bind:value={field.props.min} />
|
||||
</label>
|
||||
|
||||
<label>
|
||||
Max items
|
||||
<input type="number" bind:value={field.props.max} />
|
||||
</label>
|
||||
</fieldset>
|
||||
@@ -1,20 +0,0 @@
|
||||
<script>
|
||||
let { field } = $props();
|
||||
</script>
|
||||
|
||||
<fieldset>
|
||||
<label>
|
||||
Default
|
||||
<input bind:value={field.props.default} />
|
||||
</label>
|
||||
|
||||
<label>
|
||||
Min characters
|
||||
<input type="number" bind:value={field.props.min} />
|
||||
</label>
|
||||
|
||||
<label>
|
||||
Max characters
|
||||
<input type="number" bind:value={field.props.max} />
|
||||
</label>
|
||||
</fieldset>
|
||||
@@ -1,36 +0,0 @@
|
||||
<script>
|
||||
import { getContext, onMount } from "svelte";
|
||||
import RecordRow from "./RecordRow.svelte";
|
||||
import ChannelLayout from "../../layouts/ChannelLayout.svelte";
|
||||
import { get } from "../../modules/remote";
|
||||
let { channel, user, data } = $props();
|
||||
let records = $state([]);
|
||||
let graph = $state(null);
|
||||
let users = $state([]);
|
||||
onMount(() => {
|
||||
get(channel.lucentUrl + "/home/records", {}, (data) => {
|
||||
records = data.records;
|
||||
graph = data.graph;
|
||||
users = data.users;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<ChannelLayout {body} {channel} schemas={data.schemas} {user}></ChannelLayout>
|
||||
{#snippet body()}
|
||||
<h3 class="header-small mb-4 mt-5">Latest Content changes</h3>
|
||||
{#if records.length > 0}
|
||||
<div class="table">
|
||||
<table class="">
|
||||
<tbody>
|
||||
{#each records as record (record.id)}
|
||||
<tr>
|
||||
<RecordRow {channel} {graph} {record} {users}
|
||||
></RecordRow>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{/if}
|
||||
{/snippet}
|
||||
@@ -1,41 +0,0 @@
|
||||
<script>
|
||||
import { formatDistanceToNow, parseJSON } from "date-fns";
|
||||
import Avatar from "../../common/Avatar.svelte";
|
||||
import { previewTitle } from "../../svelte/records/Preview";
|
||||
import Preview from "../../svelte/files/Preview.svelte";
|
||||
import { usernameById } from "../../svelte/account/users";
|
||||
|
||||
let { channel, users, record, graph } = $props();
|
||||
let schema = $derived(
|
||||
channel.schemas.find((s) => s.name === record.schema),
|
||||
);
|
||||
let frieldlyUpdatedAt = formatDistanceToNow(
|
||||
parseJSON(record._sys.updatedAt),
|
||||
{ addSuffix: true },
|
||||
);
|
||||
</script>
|
||||
|
||||
<td>
|
||||
<div class="row-name">
|
||||
{#if record.status === "draft"}
|
||||
<span class="status">DRAFT</span>
|
||||
{/if}
|
||||
{#if schema.type === "files"}
|
||||
<!-- <Preview {record} size="tiny" showFilename={true} /> -->
|
||||
{:else}
|
||||
<a href="{channel.lucentUrl}/records/{record.id}">
|
||||
<!-- {previewTitle(channel.schemas, record, graph)} -->
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
</td>
|
||||
<td><a href="{channel.lucentUrl}/content/{schema.name}">{schema.label}</a> </td>
|
||||
|
||||
<td>
|
||||
<div style="display: flex;gap: 14px">
|
||||
<Avatar name={usernameById(users, record._sys.updatedBy)} side={24} />
|
||||
<div class="ms-2">
|
||||
{frieldlyUpdatedAt}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
@@ -1,53 +0,0 @@
|
||||
<script>
|
||||
import AccountLayout from "../../layouts/AccountLayout.svelte";
|
||||
import { post } from "../../modules/remote";
|
||||
let { channel } = $props();
|
||||
let email = $state("");
|
||||
let message = $state("");
|
||||
let isLoading = $state(false);
|
||||
$inspect(channel);
|
||||
function login(e) {
|
||||
e.preventDefault();
|
||||
isLoading = true;
|
||||
post(
|
||||
channel.lucentUrl + "/login",
|
||||
{
|
||||
email: email,
|
||||
},
|
||||
(data, err) => {
|
||||
isLoading = false;
|
||||
message = "You will receive an email with a login link";
|
||||
},
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<AccountLayout {body} {channel}></AccountLayout>
|
||||
{#snippet body()}
|
||||
<div class="wrapper-tiny">
|
||||
{#if message}
|
||||
<div class="alert alert-info" role="alert">
|
||||
{message}
|
||||
</div>
|
||||
{:else}
|
||||
<form onsubmit={login}>
|
||||
<div class="mb-3">
|
||||
<label for="emailaddress" class="form-label"
|
||||
>Email address</label
|
||||
>
|
||||
<input
|
||||
type="email"
|
||||
bind:value={email}
|
||||
class="form-control"
|
||||
id="emailaddress"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="text-center mt-5 d-block">
|
||||
<button aria-busy={isLoading}>Login</button>
|
||||
</div>
|
||||
</form>
|
||||
{/if}
|
||||
</div>
|
||||
{/snippet}
|
||||
@@ -1,32 +0,0 @@
|
||||
<script>
|
||||
import { getSelectedLocales, getLocaleName } from "./locale.svelte.js";
|
||||
let { channel, onLocaleChange } = $props();
|
||||
let selectedLocales = $state(getSelectedLocales());
|
||||
|
||||
let selectedLocaleNames = $derived(
|
||||
selectedLocales.map((id) => getLocaleName(channel, id)),
|
||||
);
|
||||
function handleChange() {
|
||||
localStorage.setItem("selectedLocales", selectedLocales);
|
||||
onLocaleChange();
|
||||
}
|
||||
</script>
|
||||
|
||||
<details class="dropdown">
|
||||
<summary>Locales: {selectedLocaleNames.join(", ")}</summary>
|
||||
<ul>
|
||||
{#each channel.locales as locale}
|
||||
<li>
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:group={selectedLocales}
|
||||
onchange={handleChange}
|
||||
value={locale.id}
|
||||
/>
|
||||
{locale.name}
|
||||
</label>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
</details>
|
||||
@@ -1,60 +0,0 @@
|
||||
<script>
|
||||
import { getApp } from "../../app";
|
||||
import { post } from "../../modules/remote";
|
||||
import Icon from "./../../common/Icon.svelte";
|
||||
let { record, status } = $props();
|
||||
let date = $state(null);
|
||||
const app = getApp();
|
||||
function handlePublish() {
|
||||
post(app.url("records/publish"), { id: record.id }, (data, err) => {
|
||||
Turbo.visit(window.location.href);
|
||||
});
|
||||
}
|
||||
|
||||
function handleTrash() {
|
||||
post(app.url("records/trash"), { id: record.id }, (data, err) => {
|
||||
Turbo.visit(window.location.href);
|
||||
});
|
||||
}
|
||||
function handleSchedule() {
|
||||
post(
|
||||
app.url("records/schedule"),
|
||||
{ id: record.id, date: date },
|
||||
(data, err) => {
|
||||
Turbo.visit(window.location.href);
|
||||
},
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div style="display: flex; gap:20px">
|
||||
{#if status != "trashed"}
|
||||
<button onclick={handlePublish}>Publish Now</button>
|
||||
{/if}
|
||||
<details class="dropdown">
|
||||
<summary role="button" class="secondary"
|
||||
><Icon icon="ellipsis-vertical"></Icon></summary
|
||||
>
|
||||
<ul>
|
||||
<li>
|
||||
<form onsubmit={handleSchedule}>
|
||||
<fieldset role="group">
|
||||
<input
|
||||
bind:value={date}
|
||||
type="datetime-local"
|
||||
aria-label="Datetime local"
|
||||
required
|
||||
/>
|
||||
<button>Schedule</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
</li>
|
||||
<li><a href="#">View Revisions</a></li>
|
||||
{#if status != "trashed"}
|
||||
<li>
|
||||
<button onclick={handleTrash}>Move to trash</button>
|
||||
</li>
|
||||
{/if}
|
||||
</ul>
|
||||
</details>
|
||||
</div>
|
||||
@@ -1,74 +0,0 @@
|
||||
<script>
|
||||
import ChannelLayout from "../../layouts/ChannelLayout.svelte";
|
||||
import { onMount } from "svelte";
|
||||
|
||||
import LocaleChooser from "./LocaleChooser.svelte";
|
||||
import RecordForm from "./RecordForm.svelte";
|
||||
import RecordStatus from "./RecordStatus.svelte";
|
||||
import PublishingOptions from "./PublishingOptions.svelte";
|
||||
import { getSelectedLocales } from "./locale.svelte.js";
|
||||
let { channel, user, data } = $props();
|
||||
let selectedLocales = $state(getSelectedLocales());
|
||||
let record = $state(data.record);
|
||||
let showPublished = $state(false);
|
||||
|
||||
function handleLocaleChange() {
|
||||
selectedLocales = getSelectedLocales();
|
||||
}
|
||||
function toggleLiveData() {
|
||||
if (!showPublished) {
|
||||
// to avoid state sync
|
||||
Turbo.visit(window.location.href);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- <svelte:window on:beforeunload={beforeUnload} /> -->
|
||||
<ChannelLayout {body} {channel} schemas={data.schemas} {user}></ChannelLayout>
|
||||
{#snippet body()}
|
||||
<RecordStatus {channel} {record} status={data.recordStatus}></RecordStatus>
|
||||
<div style="display:flex;gap:20px;justify-content: space-between;">
|
||||
<LocaleChooser {channel} onLocaleChange={handleLocaleChange}
|
||||
></LocaleChooser>
|
||||
{#if record.publishedBy}
|
||||
<label>
|
||||
<input
|
||||
bind:checked={showPublished}
|
||||
onchange={toggleLiveData}
|
||||
type="checkbox"
|
||||
role="switch"
|
||||
/>
|
||||
Show Live Data
|
||||
</label>
|
||||
{/if}
|
||||
<PublishingOptions {record} status={data.recordStatus}
|
||||
></PublishingOptions>
|
||||
</div>
|
||||
{#if !showPublished}
|
||||
<fieldset disabled={data.recordStatus === "trashed"}>
|
||||
<RecordForm
|
||||
{channel}
|
||||
fields={data.fields}
|
||||
edgeRecordPreviews={data.edgeRecordPreviewsDraft}
|
||||
filesPreviews={data.filesPreviewsDraft}
|
||||
{record}
|
||||
{selectedLocales}
|
||||
validationErrors={data.validationErrors}
|
||||
fieldData={data.draftData}
|
||||
></RecordForm>
|
||||
</fieldset>
|
||||
{:else}
|
||||
<fieldset disabled={true}>
|
||||
<RecordForm
|
||||
{channel}
|
||||
fields={data.fields}
|
||||
edgeRecordPreviews={data.edgeRecordPreviewsLive}
|
||||
filesPreviews={data.filesPreviewsLive}
|
||||
{record}
|
||||
{selectedLocales}
|
||||
validationErrors={data.validationErrors}
|
||||
fieldData={data.liveData}
|
||||
></RecordForm>
|
||||
</fieldset>
|
||||
{/if}
|
||||
{/snippet}
|
||||
@@ -1,101 +0,0 @@
|
||||
<script>
|
||||
import TextField from "./fields/TextField.svelte";
|
||||
import RelationField from "./fields/RelationField.svelte";
|
||||
import FileField from "./fields/FileField.svelte";
|
||||
let {
|
||||
fields,
|
||||
record,
|
||||
channel,
|
||||
validationErrors,
|
||||
fieldData,
|
||||
edgeRecordPreviews,
|
||||
filesPreviews,
|
||||
selectedLocales,
|
||||
} = $props();
|
||||
const findFieldValidationError = (field, locale) => {
|
||||
return validationErrors.find(
|
||||
(f) => f.fieldId === field.id && f.locale === locale,
|
||||
);
|
||||
};
|
||||
const findDataField = (field, locale) => {
|
||||
return fieldData.find(
|
||||
(f) => f.fieldId === field.id && f.locale === locale,
|
||||
);
|
||||
};
|
||||
const findFieldEdges = (field, locale) => {
|
||||
return edgeRecordPreviews.filter(
|
||||
(e) => e.edge.fieldId === field.id && e.edge.locale === locale,
|
||||
);
|
||||
};
|
||||
const findFieldFiles = (field, locale) => {
|
||||
return filesPreviews.filter(
|
||||
(f) =>
|
||||
f.recordFile.fieldId === field.id &&
|
||||
f.recordFile.locale === locale,
|
||||
);
|
||||
};
|
||||
</script>
|
||||
|
||||
{#each fields as field}
|
||||
<div style="display:flex;gap:20px;">
|
||||
{#if field.type === "text"}
|
||||
{@render textField(field, "main")}
|
||||
{#if field.translatable}
|
||||
{#each selectedLocales as locale (locale)}
|
||||
{@render textField(field, locale)}
|
||||
{/each}
|
||||
{/if}
|
||||
{/if}
|
||||
{#if field.type === "relation"}
|
||||
{@render relationField(field, "main")}
|
||||
{#if field.translatable}
|
||||
{#each selectedLocales as locale (locale)}
|
||||
{@render relationField(field, locale)}
|
||||
{/each}
|
||||
{/if}
|
||||
{/if}
|
||||
{#if field.type === "file"}
|
||||
{@render fileField(field, "main")}
|
||||
{#if field.translatable}
|
||||
{#each selectedLocales as locale (locale)}
|
||||
{@render fileField(field, locale)}
|
||||
{/each}
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
{/each}
|
||||
|
||||
{#snippet textField(field, locale)}
|
||||
<TextField
|
||||
{channel}
|
||||
{record}
|
||||
validationError={findFieldValidationError(field, locale)}
|
||||
schemaField={field}
|
||||
{locale}
|
||||
dataField={findDataField(field, locale)}
|
||||
></TextField>
|
||||
{/snippet}
|
||||
|
||||
{#snippet relationField(field, locale)}
|
||||
<RelationField
|
||||
{channel}
|
||||
{record}
|
||||
validationError={findFieldValidationError(field, locale)}
|
||||
schemaField={field}
|
||||
{locale}
|
||||
dataField={findDataField(field, locale)}
|
||||
edgeRecordPreviews={findFieldEdges(field, locale)}
|
||||
></RelationField>
|
||||
{/snippet}
|
||||
|
||||
{#snippet fileField(field, locale)}
|
||||
<FileField
|
||||
{channel}
|
||||
{record}
|
||||
validationError={findFieldValidationError(field, locale)}
|
||||
schemaField={field}
|
||||
{locale}
|
||||
dataField={findDataField(field, locale)}
|
||||
filesPreviews={findFieldFiles(field, locale)}
|
||||
></FileField>
|
||||
{/snippet}
|
||||
@@ -1,84 +0,0 @@
|
||||
<script>
|
||||
import { getApp } from "../../app";
|
||||
import { post } from "../../modules/remote";
|
||||
let { record, status } = $props();
|
||||
const app = getApp();
|
||||
|
||||
function handleUntrash() {
|
||||
post(app.url("records/untrash"), { id: record.id }, (data, err) => {
|
||||
Turbo.visit(window.location.href);
|
||||
});
|
||||
}
|
||||
function handleUnschedule() {
|
||||
post(app.url("records/unschedule"), { id: record.id }, (data, err) => {
|
||||
Turbo.visit(window.location.href);
|
||||
});
|
||||
}
|
||||
function handleUnpublish() {
|
||||
post(app.url("records/unpublish"), { id: record.id }, (data, err) => {
|
||||
Turbo.visit(window.location.href);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="record-status record-status-{status}"
|
||||
style="display: flex; gap:20px"
|
||||
>
|
||||
{#if status === "trashed"}
|
||||
<span>This record is Trashed</span>
|
||||
<button onclick={handleUntrash}>Restore</button>
|
||||
{:else if status === "scheduled_and_published"}
|
||||
<div>
|
||||
<div>
|
||||
<span>
|
||||
This record was published at {record.publishedAt}
|
||||
</span>
|
||||
<button onclick={handleUnpublish}>Unpublish</button>
|
||||
</div>
|
||||
<div>
|
||||
<span>
|
||||
It is scheduled to be republished at {record.scheduledAt}
|
||||
</span>
|
||||
<button onclick={handleUnschedule}>Unschedule</button>
|
||||
</div>
|
||||
</div>
|
||||
{:else if status === "published"}
|
||||
<span>
|
||||
This record was published at {record.publishedAt}
|
||||
</span>
|
||||
<button onclick={handleUnpublish}>Cancel</button>
|
||||
{:else if status === "scheduled"}
|
||||
<span>
|
||||
This record is scheduled to be published at {record.scheduledAt}
|
||||
</span>
|
||||
<button onclick={handleUnschedule}>Cancel</button>
|
||||
{:else}
|
||||
<span>This record is a draft. Not yet published</span>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.record-status {
|
||||
border: 1px solid;
|
||||
border-radius: 7px;
|
||||
padding: 10px 20px;
|
||||
margin: 0 0 30px;
|
||||
font-size: 20px;
|
||||
}
|
||||
.record-status-trashed {
|
||||
border-color: red;
|
||||
}
|
||||
.record-status-scheduled_and_published {
|
||||
border-color: blue;
|
||||
}
|
||||
.record-status-published {
|
||||
border-color: green;
|
||||
}
|
||||
.record-status-scheduled {
|
||||
border-color: orange;
|
||||
}
|
||||
.record-status-draft {
|
||||
border-color: gray;
|
||||
}
|
||||
</style>
|
||||
@@ -1,10 +0,0 @@
|
||||
<script>
|
||||
let { schemaField, validationError } = $props();
|
||||
let hasError = $derived(!!validationError);
|
||||
</script>
|
||||
|
||||
{#if hasError}
|
||||
<small id={schemaField.id + "-help"}>{validationError.message}</small>
|
||||
{:else if schemaField.help != ""}
|
||||
<small id={schemaField.id + "-help"}>{schemaField.help}</small>
|
||||
{/if}
|
||||
@@ -1,9 +0,0 @@
|
||||
<script>
|
||||
import { getLocaleName } from "../locale.svelte.js";
|
||||
let { channel, schemaField, locale } = $props();
|
||||
</script>
|
||||
|
||||
{#if locale !== "main"}
|
||||
{getLocaleName(channel, locale)} >
|
||||
{/if}
|
||||
{schemaField.name} <br />
|
||||
@@ -1,222 +0,0 @@
|
||||
<script>
|
||||
import { get, post } from "../../../modules/remote";
|
||||
import { uploadFile } from "../../../modules/upload";
|
||||
import { getApp } from "../../../app";
|
||||
import FieldLabel from "./FieldLabel.svelte";
|
||||
import FieldError from "./FieldError.svelte";
|
||||
import Sortable from "../../../common/Sortable.svelte";
|
||||
let {
|
||||
channel,
|
||||
record,
|
||||
schemaField,
|
||||
dataField,
|
||||
locale,
|
||||
validationError,
|
||||
edgeRecordPreviews,
|
||||
filesPreviews,
|
||||
} = $props();
|
||||
let originalValue = dataField?.value ?? schemaField.props.default;
|
||||
let newValue = $state(originalValue);
|
||||
let valuesChanged = $derived(newValue !== originalValue);
|
||||
let errorMessage = $state("");
|
||||
|
||||
let filesInProgress = $state([]);
|
||||
let uploadInProgress = $derived(filesInProgress.length > 0);
|
||||
// let validationErrorState = $state(validationError);
|
||||
const app = getApp();
|
||||
|
||||
let suggestionsLoaded = $state(false);
|
||||
let suggestions = $state([]);
|
||||
let selectedFilesIds = $state([]);
|
||||
let dialog = $state();
|
||||
|
||||
function handleModalOpen(e) {
|
||||
// Add logic to handle adding a record
|
||||
dialog.showModal();
|
||||
if (suggestionsLoaded) {
|
||||
return;
|
||||
}
|
||||
get(app.url("records/files"), { recordId: record.id }, (data, err) => {
|
||||
suggestionsLoaded = true;
|
||||
suggestions = data;
|
||||
});
|
||||
}
|
||||
|
||||
function handleModalClose(e) {
|
||||
dialog.close();
|
||||
}
|
||||
|
||||
function handleInsertSelected() {
|
||||
suggestionsLoaded = false;
|
||||
post(
|
||||
app.url("records/files"),
|
||||
{
|
||||
toIds: selectedFilesIds,
|
||||
from: record.id,
|
||||
fieldId: schemaField.id,
|
||||
locale: locale,
|
||||
},
|
||||
(data, err) => {
|
||||
suggestionsLoaded = true;
|
||||
dialog.close();
|
||||
edgeRecordPreviews = data.edgeRecordPreviews;
|
||||
validationError = data.validationError;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
function handleSortUpdate(updatedEdges) {
|
||||
// let updatedFieldIds = updatedFields.map((f) => f.id);
|
||||
// fields = fields.filter((f) => !updatedFieldIds.includes(f.id));
|
||||
// fields = [...fields, ...updatedFields];
|
||||
post(
|
||||
app.url("records/sort-edges"),
|
||||
{
|
||||
ids: updatedEdges.map((e) => e.edge.id),
|
||||
},
|
||||
(data, err) => {
|
||||
edgeRecordPreviews = updatedEdges;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
function handleRemoveEdge(edgeId) {
|
||||
post(
|
||||
app.url("edges/delete"),
|
||||
{
|
||||
id: edgeId,
|
||||
from: record.id,
|
||||
fieldId: schemaField.id,
|
||||
locale: locale,
|
||||
},
|
||||
(data, err) => {
|
||||
edgeRecordPreviews = edgeRecordPreviews.filter(
|
||||
(e) => e.edge.id !== edgeId,
|
||||
);
|
||||
validationError = data.validationError;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
function handleFilesUpload(e) {
|
||||
let files = e.target.files ? [...e.target.files] : [];
|
||||
|
||||
let filesUploaded = files.map((file) => {
|
||||
let fileInProgress = {
|
||||
pct: 0,
|
||||
hasFailed: false,
|
||||
name: file.name,
|
||||
};
|
||||
filesInProgress.push(fileInProgress);
|
||||
|
||||
const progress = ({ pct, isComplete }) => {
|
||||
filesInProgress.find((f) => f.name === file.name).pct = pct;
|
||||
if (isComplete) {
|
||||
filesInProgress = filesInProgress.filter(
|
||||
(f) => f.name !== file.name,
|
||||
);
|
||||
}
|
||||
};
|
||||
const error = (errorMessage) => {
|
||||
filesInProgress.find((f) => f.name === file.name).hasFailed =
|
||||
true;
|
||||
};
|
||||
|
||||
uploadFile(
|
||||
file,
|
||||
record.id,
|
||||
schemaField.id,
|
||||
locale,
|
||||
progress,
|
||||
error,
|
||||
);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<div style="min-width: 400px;">
|
||||
<label>
|
||||
<FieldLabel {locale} {channel} {schemaField}></FieldLabel>
|
||||
</label>
|
||||
<FieldError {schemaField} {validationError}></FieldError>
|
||||
<button onclick={handleModalOpen}>Choose files</button>
|
||||
|
||||
<dialog bind:this={dialog}>
|
||||
<article>
|
||||
<header>
|
||||
<button onclick={handleModalClose} aria-label="Close" rel="prev"
|
||||
></button>
|
||||
<p>
|
||||
<strong>Records</strong>
|
||||
</p>
|
||||
</header>
|
||||
{#if suggestionsLoaded}
|
||||
<form>
|
||||
<button onclick={handleInsertSelected}>
|
||||
Insert selected
|
||||
</button>
|
||||
|
||||
<input
|
||||
oninput={handleFilesUpload}
|
||||
type="file"
|
||||
multiple
|
||||
disabled={uploadInProgress}
|
||||
/>
|
||||
{#each filesInProgress as fileInProgress}
|
||||
<div>
|
||||
<span>{fileInProgress.name}</span>
|
||||
<progress value={fileInProgress.pct} max="100" />
|
||||
{#if fileInProgress.hasFailed}
|
||||
<span>Error</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/each}
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
{#each suggestions as suggestion}
|
||||
<tr>
|
||||
<td>
|
||||
<input
|
||||
type="checkbox"
|
||||
value={suggestion.id}
|
||||
bind:group={selectedFilesIds}
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<a href="#">{suggestion.name}</a>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
{:else}
|
||||
<progress />
|
||||
{/if}
|
||||
</article>
|
||||
</dialog>
|
||||
<div>
|
||||
{#if filesPreviews.length == 0}
|
||||
No files exist
|
||||
{:else}
|
||||
<Sortable
|
||||
onUpdate={handleSortUpdate}
|
||||
items={filesPreviews}
|
||||
itemKey="recordFile.id"
|
||||
>
|
||||
{#snippet itemView(filesPreview)}
|
||||
<div>
|
||||
<a href="#">{filesPreview.file.name}</a>
|
||||
<button
|
||||
onclick={(e) =>
|
||||
handleRemoveEdge(filesPreview.recordFile.id)}
|
||||
>remove</button
|
||||
>
|
||||
</div>
|
||||
{/snippet}
|
||||
</Sortable>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,174 +0,0 @@
|
||||
<script>
|
||||
import { get, post } from "../../../modules/remote";
|
||||
import { getApp } from "../../../app";
|
||||
import FieldLabel from "./FieldLabel.svelte";
|
||||
import FieldError from "./FieldError.svelte";
|
||||
import Sortable from "../../../common/Sortable.svelte";
|
||||
let {
|
||||
channel,
|
||||
record,
|
||||
schemaField,
|
||||
dataField,
|
||||
locale,
|
||||
validationError,
|
||||
edgeRecordPreviews,
|
||||
} = $props();
|
||||
let originalValue = dataField?.value ?? schemaField.props.default;
|
||||
let newValue = $state(originalValue);
|
||||
let valuesChanged = $derived(newValue !== originalValue);
|
||||
let errorMessage = $state("");
|
||||
// let validationErrorState = $state(validationError);
|
||||
const app = getApp();
|
||||
|
||||
let suggestionsLoaded = $state(false);
|
||||
let suggestions = $state([]);
|
||||
let selectedRecordIds = $state([]);
|
||||
let dialog = $state();
|
||||
|
||||
function handleModalOpen(e) {
|
||||
// Add logic to handle adding a record
|
||||
dialog.showModal();
|
||||
if (suggestionsLoaded) {
|
||||
return;
|
||||
}
|
||||
get(
|
||||
app.url("records/suggest"),
|
||||
{ schemas: schemaField.props.schemas },
|
||||
(data, err) => {
|
||||
suggestionsLoaded = true;
|
||||
suggestions = data;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
function handleModalClose(e) {
|
||||
dialog.close();
|
||||
}
|
||||
|
||||
function handleInsertSelected() {
|
||||
suggestionsLoaded = false;
|
||||
post(
|
||||
app.url("edges/many"),
|
||||
{
|
||||
toIds: selectedRecordIds,
|
||||
from: record.id,
|
||||
fieldId: schemaField.id,
|
||||
locale: locale,
|
||||
},
|
||||
(data, err) => {
|
||||
suggestionsLoaded = true;
|
||||
dialog.close();
|
||||
edgeRecordPreviews = data.edgeRecordPreviews;
|
||||
validationError = data.validationError;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
function handleSortUpdate(updatedEdges) {
|
||||
// let updatedFieldIds = updatedFields.map((f) => f.id);
|
||||
// fields = fields.filter((f) => !updatedFieldIds.includes(f.id));
|
||||
// fields = [...fields, ...updatedFields];
|
||||
post(
|
||||
app.url("records/sort-edges"),
|
||||
{
|
||||
ids: updatedEdges.map((e) => e.edge.id),
|
||||
},
|
||||
(data, err) => {
|
||||
edgeRecordPreviews = updatedEdges;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
function handleRemoveEdge(edgeId) {
|
||||
post(
|
||||
app.url("edges/delete"),
|
||||
{
|
||||
id: edgeId,
|
||||
from: record.id,
|
||||
fieldId: schemaField.id,
|
||||
locale: locale,
|
||||
},
|
||||
(data, err) => {
|
||||
edgeRecordPreviews = edgeRecordPreviews.filter(
|
||||
(e) => e.edge.id !== edgeId,
|
||||
);
|
||||
validationError = data.validationError;
|
||||
},
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div style="min-width: 400px;">
|
||||
<label>
|
||||
<FieldLabel {locale} {channel} {schemaField}></FieldLabel>
|
||||
</label>
|
||||
<FieldError {schemaField} {validationError}></FieldError>
|
||||
<button onclick={handleModalOpen}>Choose record</button>
|
||||
|
||||
<dialog bind:this={dialog}>
|
||||
<article>
|
||||
<header>
|
||||
<button onclick={handleModalClose} aria-label="Close" rel="prev"
|
||||
></button>
|
||||
<p>
|
||||
<strong>Records</strong>
|
||||
</p>
|
||||
</header>
|
||||
{#if suggestionsLoaded}
|
||||
<form>
|
||||
<button onclick={handleInsertSelected}>
|
||||
Insert selected
|
||||
</button>
|
||||
<table>
|
||||
<tbody>
|
||||
{#each suggestions as suggestion}
|
||||
<tr>
|
||||
<td>
|
||||
<input
|
||||
type="checkbox"
|
||||
value={suggestion.id}
|
||||
bind:group={selectedRecordIds}
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<a href="#">{suggestion.title}</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="#">
|
||||
{suggestion.schemaName}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
{:else}
|
||||
<progress />
|
||||
{/if}
|
||||
</article>
|
||||
</dialog>
|
||||
<div>
|
||||
{#if edgeRecordPreviews.length == 0}
|
||||
No relations exist
|
||||
{:else}
|
||||
<Sortable
|
||||
onUpdate={handleSortUpdate}
|
||||
items={edgeRecordPreviews}
|
||||
itemKey="edge.id"
|
||||
>
|
||||
{#snippet itemView(edgeRecordPreview)}
|
||||
<div>
|
||||
<a href="#">{edgeRecordPreview.recordPreview.title}</a>
|
||||
{edgeRecordPreview.recordPreview.schemaName}
|
||||
<button
|
||||
onclick={(e) =>
|
||||
handleRemoveEdge(edgeRecordPreview.edge.id)}
|
||||
>remove</button
|
||||
>
|
||||
</div>
|
||||
{/snippet}
|
||||
</Sortable>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,102 +0,0 @@
|
||||
<script>
|
||||
import { post } from "../../../modules/remote";
|
||||
import { getApp } from "../../../app";
|
||||
import FieldLabel from "./FieldLabel.svelte";
|
||||
import FieldError from "./FieldError.svelte";
|
||||
let { channel, record, schemaField, dataField, locale, validationError } =
|
||||
$props();
|
||||
let originalValue = dataField?.value ?? schemaField.props.default;
|
||||
let newValue = $state(originalValue);
|
||||
let valuesChanged = $derived(newValue !== originalValue);
|
||||
// let validationErrorState = $state(validationError);
|
||||
const app = getApp();
|
||||
|
||||
function save() {
|
||||
if (!valuesChanged) {
|
||||
return;
|
||||
}
|
||||
|
||||
post(
|
||||
app.url("records/fields"),
|
||||
{
|
||||
recordId: record.id,
|
||||
id: schemaField.id,
|
||||
locale: locale,
|
||||
value: newValue,
|
||||
},
|
||||
(data, err) => {
|
||||
if (err.isNotEmpty()) {
|
||||
errorMessage = err.first();
|
||||
} else {
|
||||
validationError = data.validationError;
|
||||
originalValue = newValue;
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
let delayMs = 1000;
|
||||
let timer = $state(undefined);
|
||||
let isComposing = $state(false);
|
||||
|
||||
const schedule = () => {
|
||||
if (isComposing) {
|
||||
return;
|
||||
}
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
timer = setTimeout(flush, delayMs);
|
||||
};
|
||||
|
||||
const flush = () => {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
timer = undefined;
|
||||
}
|
||||
// value = inputValue;
|
||||
save();
|
||||
};
|
||||
|
||||
const handleInput = () => {
|
||||
schedule();
|
||||
};
|
||||
|
||||
const handleKeydown = (event) => {
|
||||
if (event.key === "Enter") {
|
||||
flush();
|
||||
}
|
||||
};
|
||||
|
||||
const handleBlur = () => {
|
||||
flush();
|
||||
};
|
||||
|
||||
const handleCompositionStart = () => {
|
||||
isComposing = true;
|
||||
};
|
||||
|
||||
const handleCompositionEnd = () => {
|
||||
isComposing = false;
|
||||
};
|
||||
</script>
|
||||
|
||||
<div style="min-width: 400px;">
|
||||
<label>
|
||||
<FieldLabel {locale} {channel} {schemaField}></FieldLabel>
|
||||
|
||||
<input
|
||||
type="text"
|
||||
bind:value={newValue}
|
||||
autocomplete="off"
|
||||
readonly={schemaField.readonly}
|
||||
aria-describedby={schemaField.id + "-help"}
|
||||
oninput={handleInput}
|
||||
onkeydown={handleKeydown}
|
||||
onblur={handleBlur}
|
||||
oncompositionstart={handleCompositionStart}
|
||||
oncompositionend={handleCompositionEnd}
|
||||
/>
|
||||
<!-- aria-invalid={hasError ? "true" : ""} -->
|
||||
<FieldError {schemaField} {validationError}></FieldError>
|
||||
</label>
|
||||
</div>
|
||||
@@ -1,11 +0,0 @@
|
||||
export function getSelectedLocales() {
|
||||
let value = $state(localStorage.getItem("selectedLocales"));
|
||||
if (value == "" || !value) {
|
||||
return [];
|
||||
}
|
||||
return value.split(",");
|
||||
}
|
||||
|
||||
export function getLocaleName(channel, id) {
|
||||
return channel.locales.find((locale) => locale.id === id).name;
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
<script>
|
||||
import SchemaLayout from "../../layouts/SchemaLayout.svelte";
|
||||
import Sortable from "../../common/Sortable.svelte";
|
||||
import DeleteButton from "../../common/DeleteButton.svelte";
|
||||
import { post } from "../../modules/remote";
|
||||
import { getApp } from "../../app";
|
||||
let { channel, user, data } = $props();
|
||||
const app = getApp();
|
||||
|
||||
function handleSchemaCreate(e) {
|
||||
e.preventDefault();
|
||||
post(
|
||||
channel.lucentUrl + "/schemas/update",
|
||||
{
|
||||
id: data.schema.id,
|
||||
name: data.schema.name,
|
||||
alias: data.schema.alias,
|
||||
revisions: data.schema.revisions,
|
||||
},
|
||||
(data, err) => {
|
||||
if (err.isEmpty()) {
|
||||
Turbo.visit(channel.lucentUrl + "/schemas");
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
function handleDelete() {
|
||||
post(
|
||||
app.url("schemas/delete"),
|
||||
{
|
||||
schemaId: data.schema.id,
|
||||
},
|
||||
(data, err) => {
|
||||
if (err.isEmpty()) {
|
||||
Turbo.visit(app.url("schemas"));
|
||||
} else {
|
||||
console.log(err);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<SchemaLayout {body} {channel} {user}></SchemaLayout>
|
||||
{#snippet body()}
|
||||
<h3>Edit Schema</h3>
|
||||
|
||||
<form onsubmit={handleSchemaCreate}>
|
||||
<fieldset>
|
||||
<label>
|
||||
Name
|
||||
<input
|
||||
bind:value={data.schema.name}
|
||||
placeholder="ex. Blog Posts"
|
||||
minlength="2"
|
||||
maxlength="30"
|
||||
required
|
||||
/>
|
||||
<small id="alias-helper">Plural is recommended</small>
|
||||
</label>
|
||||
<label>
|
||||
Alias
|
||||
<input
|
||||
bind:value={data.schema.alias}
|
||||
placeholder="ex. blog_posts"
|
||||
minlength="2"
|
||||
maxlength="30"
|
||||
required
|
||||
aria-describedby="alias-helper"
|
||||
/>
|
||||
<small id="alias-helper">
|
||||
Developers will use this to reference the field
|
||||
</small>
|
||||
</label>
|
||||
<label>
|
||||
Revision number
|
||||
<input
|
||||
bind:value={data.schema.revisions}
|
||||
type="number"
|
||||
required
|
||||
aria-describedby="revision-helper"
|
||||
/>
|
||||
<small id="revision-helper">
|
||||
How many revisions per document will be kept
|
||||
</small>
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
<button type="submit">Update</button>
|
||||
</form>
|
||||
|
||||
<DeleteButton onDelete={handleDelete}>
|
||||
{#snippet text()}
|
||||
Delete schema
|
||||
{/snippet}
|
||||
</DeleteButton>
|
||||
{/snippet}
|
||||
@@ -1,138 +0,0 @@
|
||||
<script>
|
||||
import SchemaLayout from "../../layouts/SchemaLayout.svelte";
|
||||
import Sortable from "../../common/Sortable.svelte";
|
||||
import { post } from "../../modules/remote";
|
||||
import { getApp } from "../../app";
|
||||
let { channel, user, data } = $props();
|
||||
let newSchemaName = $state("");
|
||||
let newSchemaAlias = $state("");
|
||||
let fields = $state(data.fields);
|
||||
const app = getApp();
|
||||
const createFieldUrl = (schema, type) =>
|
||||
app.url(`fields/create?schema=${schema.id}&type=${type}`);
|
||||
function handleSchemaCreate(e) {
|
||||
e.preventDefault();
|
||||
post(
|
||||
channel.lucentUrl + "/schemas",
|
||||
{
|
||||
name: newSchemaName,
|
||||
alias: newSchemaAlias,
|
||||
},
|
||||
(data, err) => {
|
||||
if (err.isEmpty()) {
|
||||
Turbo.visit(window.location.href);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
function handleSortUpdate(updatedFields) {
|
||||
let updatedFieldIds = updatedFields.map((f) => f.id);
|
||||
fields = fields.filter((f) => !updatedFieldIds.includes(f.id));
|
||||
fields = [...fields, ...updatedFields];
|
||||
|
||||
post(
|
||||
channel.lucentUrl + "/fields/reorder",
|
||||
{
|
||||
ids: updatedFieldIds,
|
||||
},
|
||||
(data, err) => {},
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<SchemaLayout {body} {channel} {user}></SchemaLayout>
|
||||
{#snippet body()}
|
||||
<h3 class="header-small mb-4 mt-5">Schemas</h3>
|
||||
|
||||
<details style="max-width: 400px;">
|
||||
<summary>Create Schema</summary>
|
||||
<form onsubmit={handleSchemaCreate}>
|
||||
<fieldset>
|
||||
<label>
|
||||
Name
|
||||
<input
|
||||
bind:value={newSchemaName}
|
||||
placeholder="ex. Blog Posts"
|
||||
minlength="2"
|
||||
maxlength="30"
|
||||
required
|
||||
/>
|
||||
<small id="alias-helper">Plural is recommended</small>
|
||||
</label>
|
||||
<label>
|
||||
Alias
|
||||
<input
|
||||
bind:value={newSchemaAlias}
|
||||
placeholder="ex. blog_posts"
|
||||
minlength="2"
|
||||
maxlength="30"
|
||||
required
|
||||
aria-describedby="alias-helper"
|
||||
/>
|
||||
<small id="alias-helper">
|
||||
Developers will use this to reference the field
|
||||
</small>
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
<button type="submit">Create</button>
|
||||
</form>
|
||||
</details>
|
||||
<div style="display: flex;gap:20px">
|
||||
{#each data.schemas as schema}
|
||||
<article style="min-width: 300px;">
|
||||
<header>
|
||||
<a href={app.url("schemas/edit/" + schema.id)}
|
||||
>{schema.name}</a
|
||||
>
|
||||
</header>
|
||||
<details>
|
||||
<summary>Fields</summary>
|
||||
<table>
|
||||
<Sortable
|
||||
type="table"
|
||||
onUpdate={handleSortUpdate}
|
||||
items={fields.filter(
|
||||
(field) => field.schemaId === schema.id,
|
||||
)}
|
||||
>
|
||||
{#snippet itemView(field)}
|
||||
<td
|
||||
><a
|
||||
href={app.url(
|
||||
"fields/edit/" + field.id,
|
||||
)}>{field.name}</a
|
||||
></td
|
||||
>
|
||||
<td>{field.type}</td>
|
||||
{/snippet}
|
||||
</Sortable>
|
||||
</table>
|
||||
</details>
|
||||
<details>
|
||||
<summary>Add field</summary>
|
||||
<ul>
|
||||
<li>
|
||||
<a href={createFieldUrl(schema, "text")}>Text</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href={createFieldUrl(schema, "file")}>File</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href={createFieldUrl(schema, "relation")}>
|
||||
Relation
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</details>
|
||||
<footer>
|
||||
<small> Id: {schema.id}</small><br />
|
||||
<small> Alias: {schema.alias}</small><br />
|
||||
<small> Revisions: {schema.revisions}</small><br />
|
||||
</footer>
|
||||
</article>
|
||||
{/each}
|
||||
</div>
|
||||
{/snippet}
|
||||
@@ -1,20 +0,0 @@
|
||||
<script>
|
||||
import AccountLayout from "../../layouts/AccountLayout.svelte";
|
||||
import Step from "./Step.svelte";
|
||||
let { channel, data } = $props();
|
||||
</script>
|
||||
|
||||
<AccountLayout {body} {channel}></AccountLayout>
|
||||
{#snippet body()}
|
||||
<div class="wrapper-tiny">
|
||||
{#each data.steps as step}
|
||||
<Step {step}></Step>
|
||||
{/each}
|
||||
|
||||
<div style="text-align: center;margin-top: 30px;">
|
||||
{#if data.allSuccess}
|
||||
<a href="/lucent/register" class="bt">Create the first user</a>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/snippet}
|
||||
@@ -1,61 +0,0 @@
|
||||
<script>
|
||||
import Icon from "../../common/Icon.svelte";
|
||||
|
||||
let { step } = $props();
|
||||
</script>
|
||||
|
||||
<div class="step step-{step.status}">
|
||||
<div style="width:100%">
|
||||
<details>
|
||||
<summary>
|
||||
{#if step.status === "success"}
|
||||
<Icon icon="check"></Icon> {step.name}
|
||||
{:else}
|
||||
<Icon icon="close"></Icon> {step.name}
|
||||
{/if}
|
||||
</summary>
|
||||
<code class="instructions">{step.instructions}</code>
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.step-success .step-icon {
|
||||
background: var(--suc10);
|
||||
color: var(--suc100);
|
||||
}
|
||||
|
||||
.step-fail .step-icon {
|
||||
background: var(--err10);
|
||||
color: var(--err100);
|
||||
}
|
||||
|
||||
.step-icon {
|
||||
padding: 12px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.step {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: start;
|
||||
gap: 10px;
|
||||
justify-content: space-between;
|
||||
|
||||
padding: 12px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
details {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.instructions {
|
||||
margin-top: 20px;
|
||||
padding: 12px;
|
||||
border-radius: 12px;
|
||||
background: var(--p10);
|
||||
white-space: break-spaces;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
@@ -1,35 +0,0 @@
|
||||
<script>
|
||||
import AccountLayout from "../../layouts/AccountLayout.svelte";
|
||||
import { post } from "../../modules/remote";
|
||||
let { channel, data } = $props();
|
||||
let isLoading = $state(false);
|
||||
function login(e) {
|
||||
e.preventDefault();
|
||||
isLoading = true;
|
||||
post(
|
||||
channel.lucentUrl + "/verify",
|
||||
{
|
||||
email: data.email,
|
||||
token: data.token,
|
||||
},
|
||||
(data, err) => {
|
||||
window.location = channel.lucentUrl;
|
||||
},
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<AccountLayout {body} {channel}></AccountLayout>
|
||||
{#snippet body()}
|
||||
<div class="wrapper-tiny">
|
||||
<form onsubmit={login}>
|
||||
<div class="mb-3 text-center">
|
||||
<h3>Login as {data.email}</h3>
|
||||
</div>
|
||||
|
||||
<div class="text-center mt-5 d-block">
|
||||
<button aria-busy={isLoading}>Enter</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{/snippet}
|
||||
+3
-97
@@ -19,108 +19,14 @@ export function readableDatetime(date) {
|
||||
return format(parseJSON(date), "dd MMM yyyy HH:mm");
|
||||
}
|
||||
|
||||
|
||||
export function stripHtml(html = "") {
|
||||
let tmp = document.createElement("div");
|
||||
tmp.innerHTML = html;
|
||||
return tmp.textContent || tmp.innerText || "";
|
||||
}
|
||||
|
||||
|
||||
export function randomId(length = 10) {
|
||||
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 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 arrayMoveElement(array, from, to) {
|
||||
if (from === to) {
|
||||
return array;
|
||||
}
|
||||
|
||||
const item = array.find((v, i) => i === from);
|
||||
const arrayWithout = array.filter((v, i) => i !== from);
|
||||
if (from > to) {
|
||||
return arrayWithout.reduce((c, v, i) => {
|
||||
if (i === to) {
|
||||
return [...c, item, v];
|
||||
}
|
||||
return [...c, v];
|
||||
}, []);
|
||||
}
|
||||
|
||||
return arrayWithout.reduce((c, v, i) => {
|
||||
if (i + 1 === to) {
|
||||
return [...c, v, item];
|
||||
}
|
||||
return [...c, v];
|
||||
}, []);
|
||||
}
|
||||
|
||||
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;
|
||||
return Math.random().toString(36).substring(2, length + 2);
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
export function loadHtmxFormsBehaviour(){
|
||||
document.querySelectorAll(".form").forEach(el => {
|
||||
initHtmxForm(el);
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function initHtmxForm(el){
|
||||
el.addEventListener("htmx:responseError", (e) => {
|
||||
el.querySelector(".form-errors").innerHTML = e.detail.xhr.response;
|
||||
});
|
||||
|
||||
const formEl = el.querySelector("form");
|
||||
|
||||
if(!formEl.getAttribute("hx-redirect")){
|
||||
return;
|
||||
}
|
||||
el.addEventListener("htmx:afterOnLoad", (e) => {
|
||||
if(e.detail.successful){
|
||||
return window.location.href = formEl.getAttribute("hx-redirect");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
<script>
|
||||
let { body, channel, user } = $props();
|
||||
</script>
|
||||
|
||||
<div
|
||||
style="text-align: center;background: var(--p20);padding: 20px;color: var(--p90)"
|
||||
>
|
||||
<h1>
|
||||
<a class="text-decoration-none" href={channel.url}
|
||||
>{channel.name ?? "Lucent Setup"}</a
|
||||
>
|
||||
</h1>
|
||||
</div>
|
||||
<div>
|
||||
{@render body()}
|
||||
</div>
|
||||
@@ -1,15 +0,0 @@
|
||||
<script>
|
||||
import Header from "./Header.svelte";
|
||||
import Navbar from "./Navbar.svelte";
|
||||
let { body, channel, user, schemas } = $props();
|
||||
</script>
|
||||
|
||||
<Header {channel} {user}></Header>
|
||||
<main>
|
||||
<aside class="sidebar-content">
|
||||
<Navbar {channel} {schemas}></Navbar>
|
||||
</aside>
|
||||
<div class="main-content">
|
||||
{@render body()}
|
||||
</div>
|
||||
</main>
|
||||
@@ -1,32 +0,0 @@
|
||||
<script>
|
||||
import Avatar from "../common/Avatar.svelte";
|
||||
// import Dropdown from "../svelte/common/Dropdown.svelte";
|
||||
let { channel, user } = $props();
|
||||
</script>
|
||||
|
||||
<div class="top-nav">
|
||||
<a class="top-nav-item" href="{channel.lucentUrl}/members">Members</a>
|
||||
<a class="top-nav-item" href="{channel.lucentUrl}/">Content</a>
|
||||
<a class="top-nav-item" href="{channel.lucentUrl}/schemas">Schemas</a>
|
||||
|
||||
<!-- {#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>-->
|
||||
<a href="{channel.lucentUrl}/profile">
|
||||
<Avatar side="28" name={user.name} />
|
||||
</a>
|
||||
</div>
|
||||
@@ -1,12 +0,0 @@
|
||||
<script>
|
||||
import { getApp } from "../app";
|
||||
let { channel, schemas } = $props();
|
||||
const app = getApp();
|
||||
</script>
|
||||
|
||||
<details name="example" open>
|
||||
<summary>Content</summary>
|
||||
{#each schemas as schema}
|
||||
<div><a href={app.url("content/" + schema.id)}>{schema.name}</a></div>
|
||||
{/each}
|
||||
</details>
|
||||
@@ -1,34 +0,0 @@
|
||||
<script>
|
||||
import {getContext} from "svelte";
|
||||
import Icon from "../common/Icon.svelte";
|
||||
|
||||
const channel = getContext("channel");
|
||||
export let schemas;
|
||||
export let title;
|
||||
export let schema;
|
||||
export let expanded = false;
|
||||
|
||||
if(schemas.find(s => s.name === schema?.name)){
|
||||
expanded = true;
|
||||
}
|
||||
|
||||
function toggleExpand(){
|
||||
expanded = !expanded;
|
||||
}
|
||||
</script>
|
||||
|
||||
<button class="sidebar-header" tabindex="0" on:click={toggleExpand}>
|
||||
{title}
|
||||
{#if expanded}
|
||||
<Icon icon="circle-chevron-up"></Icon>
|
||||
{:else}
|
||||
<Icon icon="circle-chevron-down"></Icon>
|
||||
{/if}
|
||||
</button>
|
||||
{#if expanded}
|
||||
{#each schemas 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}
|
||||
{/if}
|
||||
@@ -1,11 +0,0 @@
|
||||
<script>
|
||||
import Header from "./Header.svelte";
|
||||
let { body, channel, user } = $props();
|
||||
</script>
|
||||
|
||||
<Header {channel} {user}></Header>
|
||||
<main>
|
||||
<div class="main-content">
|
||||
{@render body()}
|
||||
</div>
|
||||
</main>
|
||||
+41
-50
@@ -1,48 +1,34 @@
|
||||
import * as Turbo from "@hotwired/turbo";
|
||||
// import "../sass/app.scss";
|
||||
import { mount, unmount } from "svelte";
|
||||
import "../css/app.css";
|
||||
import Register from "./svelte/account/Register.svelte";
|
||||
import LoginEntry from "./entry/LoginEntry/LoginEntry.svelte";
|
||||
import VerifyEntry from "./entry/VerifyEntry/VerifyEntry.svelte";
|
||||
import Profile from "./svelte/account/Profile.svelte";
|
||||
import SetupEntry from "./entry/SetupEntry/SetupEntry.svelte";
|
||||
import Members from "./svelte/members/Members.svelte";
|
||||
import RecordNotFound from "./svelte/records/NotFound.svelte";
|
||||
import RecordEditEntry from "./entry/RecordEditEntry/RecordEditEntry.svelte";
|
||||
import ContentEntry from "./entry/ContentEntry/ContentEntry.svelte";
|
||||
import HomeEntry from "./entry/HomeEntry/HomeEntry.svelte";
|
||||
import SchemaEntry from "./entry/SchemaEntry/SchemaEntry.svelte";
|
||||
import FieldCreateEntry from "./entry/FieldCreateEntry/FieldCreateEntry.svelte";
|
||||
import FieldEditEntry from "./entry/FieldEditEntry/FieldEditEntry.svelte";
|
||||
import SchemaEditEntry from "./entry/SchemaEditEntry/SchemaEditEntry.svelte";
|
||||
import BuildReport from "./svelte/build/Report.svelte";
|
||||
import { createApp } from "./app";
|
||||
import {axiosInstance} from "./bootstrap";
|
||||
import "../sass/app.scss";
|
||||
import Account from "./svelte/Account.svelte";
|
||||
import Channel from "./svelte/Channel.svelte";
|
||||
import * as bootstrap from "bootstrap";
|
||||
import Mustache from "mustache";
|
||||
|
||||
const entryComponents = {
|
||||
members: Members,
|
||||
recordEdit: RecordEditEntry,
|
||||
recordNotFound: RecordNotFound,
|
||||
contentIndex: ContentEntry,
|
||||
homeIndex: HomeEntry,
|
||||
buildReport: BuildReport,
|
||||
register: Register,
|
||||
login: LoginEntry,
|
||||
verify: VerifyEntry,
|
||||
profile: Profile,
|
||||
setup: SetupEntry,
|
||||
schemas: SchemaEntry,
|
||||
fieldCreate: FieldCreateEntry,
|
||||
fieldEdit: FieldEditEntry,
|
||||
schemaEdit: SchemaEditEntry,
|
||||
Mustache.escape = function (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
|
||||
const entryComponents = {
|
||||
account: Account,
|
||||
channel: Channel,
|
||||
};
|
||||
Turbo.start();
|
||||
|
||||
let loadedComponents = [];
|
||||
|
||||
let loadSvelte = function () {
|
||||
Turbo.cache.clear();
|
||||
loadedComponents.map((comp) => unmount(comp));
|
||||
loadedComponents.map((comp) => comp.$destroy());
|
||||
loadedComponents = [];
|
||||
|
||||
const elements = document.body.querySelectorAll(".lucent-component");
|
||||
@@ -50,24 +36,29 @@ let loadSvelte = function () {
|
||||
return;
|
||||
}
|
||||
const loadElement = function (element) {
|
||||
const jsonData = document.getElementById("json-data").innerHTML;
|
||||
|
||||
const props = JSON.parse(jsonData);
|
||||
const [__, view] = Object.entries(entryComponents).find(
|
||||
([key, _]) => props.view === key,
|
||||
const componentId = element.attributes["data-layout"].value;
|
||||
const [_, component] = Object.entries(entryComponents).find(
|
||||
([key, _]) => componentId === key
|
||||
);
|
||||
|
||||
if (!view) {
|
||||
if (!component) {
|
||||
return [];
|
||||
}
|
||||
// props.axios = axiosInstance;
|
||||
createApp(props.channel);
|
||||
|
||||
const jsonData = document.getElementById(
|
||||
"json-" + componentId
|
||||
).innerHTML;
|
||||
const props = JSON.parse(jsonData);
|
||||
props.axios = axiosInstance;
|
||||
const compOptions = {
|
||||
target: element,
|
||||
props: props,
|
||||
};
|
||||
loadedComponents = [...loadedComponents, mount(view, compOptions)];
|
||||
|
||||
loadedComponents = [...loadedComponents, new component(compOptions)];
|
||||
};
|
||||
Array.from(elements).map(loadElement);
|
||||
};
|
||||
document.addEventListener("turbo:load", loadSvelte);
|
||||
|
||||
// document.addEventListener("turbo:load", loadSvelte);
|
||||
document.addEventListener("DOMContentLoaded", loadSvelte);
|
||||
document.addEventListener("DOMContentLoaded", enableTooltipsAnywhere);
|
||||
@@ -1,111 +0,0 @@
|
||||
import axios from "axios";
|
||||
|
||||
class Errors {
|
||||
constructor(data) {
|
||||
this.data = data ?? [];
|
||||
}
|
||||
|
||||
first() {
|
||||
return this.data[0] ?? null;
|
||||
}
|
||||
|
||||
all() {
|
||||
return this.data;
|
||||
}
|
||||
|
||||
isEmpty() {
|
||||
return this.data.length === 0;
|
||||
}
|
||||
|
||||
isNotEmpty() {
|
||||
return !this.isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
function makeErrors(errs) {
|
||||
return new Errors(errs);
|
||||
}
|
||||
|
||||
export function post(url, postData, callback) {
|
||||
axios
|
||||
.post(url, postData)
|
||||
.then((res) => {
|
||||
if (res.data.redirect !== undefined) {
|
||||
// Turbo.visit(link(res.data.redirect));
|
||||
return;
|
||||
}
|
||||
const errors = makeErrors(res.data?.errors ?? []);
|
||||
if (errors.isNotEmpty()) {
|
||||
callback?.(null, errors);
|
||||
} else {
|
||||
callback?.(res.data, errors);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
const errors = makeErrors(["something went wrong"]);
|
||||
callback?.(null, errors);
|
||||
});
|
||||
}
|
||||
|
||||
export function get(url, urlParams, callback) {
|
||||
let params = url.endsWith("query")
|
||||
? {
|
||||
params: { query: JSON.stringify(urlParams) },
|
||||
paramsSerializer: (params) => serializeParams(params),
|
||||
}
|
||||
: {
|
||||
params: urlParams,
|
||||
};
|
||||
|
||||
return axios
|
||||
.get(url, params)
|
||||
.then((res) => {
|
||||
callback(res.data);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
let errors = makeErrors(["something went wrong"]);
|
||||
if (!err) {
|
||||
errors = makeErrors([]);
|
||||
}
|
||||
callback(null, errors);
|
||||
});
|
||||
}
|
||||
|
||||
function serializeParams(obj, prefix = "") {
|
||||
const params = [];
|
||||
|
||||
for (const key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
const value = obj[key];
|
||||
const paramKey = prefix ? `${prefix}[${key}]` : key;
|
||||
|
||||
if (
|
||||
typeof value === "object" &&
|
||||
value !== null &&
|
||||
!Array.isArray(value)
|
||||
) {
|
||||
// Nested object
|
||||
params.push(serializeParams(value, paramKey));
|
||||
} else if (Array.isArray(value)) {
|
||||
// Array
|
||||
value.forEach((item, index) => {
|
||||
if (typeof item === "object" && item !== null) {
|
||||
params.push(serializeParams(item, `${paramKey}[${index}]`));
|
||||
} else {
|
||||
params.push(
|
||||
`${encodeURIComponent(`${paramKey}[${index}]`)}=${encodeURIComponent(item)}`,
|
||||
);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Simple value
|
||||
params.push(
|
||||
`${encodeURIComponent(paramKey)}=${encodeURIComponent(value)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return params.flat().join("&");
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
import { getApp } from "../app";
|
||||
|
||||
export function uploadFile(file, recordId, fieldId, locale, progress, error) {
|
||||
const app = getApp();
|
||||
const csrf = document.querySelector('meta[name="csrf-token"]').content;
|
||||
const chunkSize = 2 * 1024 * 1024; // 2MB
|
||||
const totalChunks = Math.ceil(file.size / chunkSize);
|
||||
|
||||
// Start the recursive process
|
||||
sendChunk(0, null);
|
||||
|
||||
function sendChunk(currentChunk, fileId) {
|
||||
const start = currentChunk * chunkSize;
|
||||
const end = Math.min(start + chunkSize, file.size);
|
||||
const chunk = file.slice(start, end);
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("file", chunk);
|
||||
if (fileId) {
|
||||
formData.append("fileId", fileId);
|
||||
}
|
||||
|
||||
formData.append("recordId", recordId);
|
||||
formData.append("fieldId", fieldId);
|
||||
formData.append("isLast", currentChunk === totalChunks - 1);
|
||||
formData.append("filename", file.name);
|
||||
formData.append("locale", locale);
|
||||
formData.append("_token", csrf);
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", app.url("upload"), true);
|
||||
|
||||
// Success Callback
|
||||
xhr.onload = function () {
|
||||
if (xhr.status === 200) {
|
||||
const response = JSON.parse(xhr.responseText);
|
||||
let fileId = response.fileId;
|
||||
const nextChunk = currentChunk + 1;
|
||||
if (nextChunk < totalChunks) {
|
||||
progress({
|
||||
pct: Math.round((nextChunk / totalChunks) * 100),
|
||||
isComplete: false,
|
||||
});
|
||||
sendChunk(nextChunk, fileId);
|
||||
} else {
|
||||
progress({
|
||||
pct: 100,
|
||||
isComplete: true,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
error("Upload failed at chunk " + currentChunk);
|
||||
}
|
||||
};
|
||||
|
||||
xhr.send(formData);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
import Login from "./account/Login.svelte";
|
||||
import Verify from "./account/Verify.svelte";
|
||||
import Profile from "./account/Profile.svelte";
|
||||
import SetupIndex from "./setup/Index.svelte";
|
||||
import {setContext} from "svelte";
|
||||
|
||||
const components = {
|
||||
@@ -11,7 +10,6 @@
|
||||
login: Login,
|
||||
verify: Verify,
|
||||
profile: Profile,
|
||||
setup: SetupIndex,
|
||||
};
|
||||
|
||||
export let title;
|
||||
@@ -23,8 +21,8 @@
|
||||
setContext("channel", channel);
|
||||
setContext("user", user);
|
||||
</script>
|
||||
<div style="text-align: center;background: var(--p20);padding: 20px;color: var(--p90)">
|
||||
<h1><a class="text-decoration-none" href="{channel.lucentUrl}">{channel.name ?? "Lucent Setup"}</a></h1>
|
||||
<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}/>
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
import RecordEdit from "./records/Edit.svelte";
|
||||
import ContentIndex from "./content/Index.svelte";
|
||||
import {setContext} from "svelte";
|
||||
import Navbar from "./layout/Navbar.svelte";
|
||||
import Navbar from "./Navbar.svelte";
|
||||
import HomeIndex from "./home/Index.svelte";
|
||||
import BuildReport from "./build/Report.svelte";
|
||||
import Header from "./layout/Header.svelte";
|
||||
|
||||
const components = {
|
||||
members: Members,
|
||||
@@ -24,25 +23,19 @@
|
||||
export let data;
|
||||
// export let layout;
|
||||
export let channel;
|
||||
|
||||
export let sidebar;
|
||||
export let axios;
|
||||
export let readableSchemas;
|
||||
|
||||
|
||||
setContext("axios", axios);
|
||||
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);
|
||||
|
||||
</script>
|
||||
|
||||
<div class="main-wrapper">
|
||||
<div class="sidebar-content">
|
||||
<Navbar schema={data.schema} />
|
||||
</div>
|
||||
<div class="main-content">
|
||||
<Header />
|
||||
<Navbar {sidebar}/>
|
||||
|
||||
<svelte:component this={components[view]} {title} {...data}/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<script>
|
||||
import Avatar from "./account/Avatar.svelte";
|
||||
import {getContext} from "svelte";
|
||||
|
||||
export let sidebar;
|
||||
const channel = getContext("channel");
|
||||
const user = getContext("user");
|
||||
let contentIsOpen = false;
|
||||
</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 ">
|
||||
|
||||
<!-- <div>-->
|
||||
<!-- <form method="GET">-->
|
||||
<!-- <input type="search" name="filter[search_regex]" placeholder="Search"-->
|
||||
<!-- class="form-control" required/>-->
|
||||
<!-- </form>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
<div class="d-flex align-items-center ">
|
||||
<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}
|
||||
<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-primary-subtle " class:d-none={!contentIsOpen}
|
||||
data-bs-scroll="true"
|
||||
data-bs-backdrop="false"
|
||||
tabindex="-1" aria-labelledby="offcanvasScrollingLabel">
|
||||
<div class="offcanvas-body">
|
||||
<button on:click={(e) => contentIsOpen = false} class="btn btn-primary btn-sm d-xxl-none mb-4">« close</button>
|
||||
{@html sidebar}
|
||||
</div>
|
||||
</div>
|
||||
File renamed without changes.
@@ -1,7 +1,7 @@
|
||||
<script>
|
||||
import ErrorAlert from "../common/ErrorAlert.svelte";
|
||||
import SpinnerButton from "../common/SpinnerButton.svelte";
|
||||
import Avatar from "./../../common/Avatar.svelte";
|
||||
import Avatar from "./Avatar.svelte";
|
||||
import {getContext} from "svelte";
|
||||
import SuccessAlert from "../common/SuccessAlert.svelte";
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<div class="wrapper-tiny">
|
||||
<ErrorAlert message={errorMessage}/>
|
||||
<SuccessAlert bind:this={successAlert} />
|
||||
@@ -54,35 +55,33 @@
|
||||
<Avatar name={user.name}/>
|
||||
</h3>
|
||||
<form on:submit={saveName}>
|
||||
<div class="input-group mb-5">
|
||||
<div class="input-group mb-3">
|
||||
<input
|
||||
type="text"
|
||||
bind:value={name}
|
||||
class="form-control mb-3"
|
||||
class="form-control"
|
||||
placeholder="Name"
|
||||
required
|
||||
/>
|
||||
<SpinnerButton label="Update Name" />
|
||||
<SpinnerButton label="Update"/>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form on:submit={saveEmail}>
|
||||
<div class="input-group mb-5">
|
||||
<div class="input-group mb-3">
|
||||
<input
|
||||
type="email"
|
||||
bind:value={email}
|
||||
class="form-control mb-3"
|
||||
class="form-control"
|
||||
placeholder="Email"
|
||||
required
|
||||
/>
|
||||
<SpinnerButton label="Update Email" />
|
||||
<SpinnerButton label="Update"/>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="list-group">
|
||||
<a
|
||||
class="list-group-item list-group-item-action"
|
||||
href="{channel.lucentUrl}/logout">Logout from this device</a
|
||||
>
|
||||
<a class="list-group-item list-group-item-action" href="{ channel.lucentUrl }/logout">Logout from this
|
||||
device</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,44 +0,0 @@
|
||||
<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}
|
||||
@@ -1,58 +0,0 @@
|
||||
<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}
|
||||
@@ -1,25 +1,22 @@
|
||||
<script>
|
||||
import {getContext, onMount} from "svelte";
|
||||
import axios from "axios";
|
||||
|
||||
|
||||
const channel = getContext("channel");
|
||||
export let title;
|
||||
export let command;
|
||||
$: date = "";
|
||||
$: logs = "";
|
||||
|
||||
let anchorEl;
|
||||
let inProgress = false;
|
||||
|
||||
function connect() {
|
||||
const eventSource = new EventSource(channel.lucentUrl + "/command-report-source/" + command.signature );
|
||||
const eventSource = new EventSource(channel.lucentUrl + "/build-report-source");
|
||||
|
||||
eventSource.onmessage = function (event) {
|
||||
inProgress = true;
|
||||
const data = JSON.parse(event.data);
|
||||
date = data.date;
|
||||
logs = data.logs;
|
||||
anchorEl.scrollIntoView()
|
||||
|
||||
}
|
||||
eventSource.onerror = (e) => {
|
||||
console.log(e)
|
||||
@@ -31,7 +28,8 @@
|
||||
function buildWebsite(e) {
|
||||
e.preventDefault();
|
||||
inProgress = true;
|
||||
axios.post(channel.lucentUrl + "/command/" + command.signature).then(response => {
|
||||
|
||||
axios.post(channel.lucentUrl + "/build").then(response => {
|
||||
connect()
|
||||
})
|
||||
|
||||
@@ -43,41 +41,31 @@
|
||||
|
||||
</script>
|
||||
|
||||
<div class="common-wrapper">
|
||||
<div class="wrapper-tiny transparent mb-5">
|
||||
<div class="lx-card mt-5">
|
||||
|
||||
<h3 class="header-small mb-5">{title}</h3>
|
||||
|
||||
<button on:click={buildWebsite} class="button primary mb-3" disabled={inProgress}>Start
|
||||
<button on:click={buildWebsite} class="btn btn-outline-primary btn-sm mb-3" disabled={inProgress}>Start Build
|
||||
</button>
|
||||
|
||||
|
||||
|
||||
<div class="mb-3">
|
||||
{#if inProgress}
|
||||
<span class="badge text-bg-warning">
|
||||
Action in progress
|
||||
Build in progress
|
||||
</span>
|
||||
{/if}
|
||||
{#if !inProgress && logs}
|
||||
<span class="badge text-bg-info">
|
||||
Action completed
|
||||
Build completed
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="logs">{logs}
|
||||
<div bind:this={anchorEl}> </div>
|
||||
</pre>
|
||||
<pre>{logs}</pre>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.logs{
|
||||
max-height: 70vh;
|
||||
overflow: scroll;
|
||||
background: var(--p90);
|
||||
color: var(--p10);
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,14 +0,0 @@
|
||||
<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>
|
||||
|
||||
@@ -1,33 +1,23 @@
|
||||
<script>
|
||||
import {clickOutside} from "../../helpers.js";
|
||||
|
||||
export let width = "300";
|
||||
let dropdownMenu;
|
||||
export let orientation = "left";
|
||||
|
||||
export function open() {
|
||||
dropdownMenu.classList.remove("hide")
|
||||
export function hide(){
|
||||
dropdownMenu.classList.remove("show")
|
||||
}
|
||||
|
||||
export function close() {
|
||||
dropdownMenu.classList.add("hide")
|
||||
}
|
||||
|
||||
function handleClickOutside() {
|
||||
dropdownMenu.classList.add("hide")
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="dropdown">
|
||||
|
||||
<button
|
||||
class="button dropdown-button"
|
||||
|
||||
class="btn btn-sm btn-outline-primary dropdown-toggle d-flex align-items-center"
|
||||
type="button"
|
||||
on:click={open}
|
||||
data-bs-toggle="dropdown"
|
||||
data-bs-auto-close="outside"
|
||||
aria-expanded="false"
|
||||
>
|
||||
<slot name="button">Dropdown</slot>
|
||||
</button>
|
||||
<div bind:this={dropdownMenu} class="dropdown-menu hide orientation-{orientation}" use:clickOutside on:click_outside={handleClickOutside}>
|
||||
<div bind:this={dropdownMenu} class="dropdown-menu" style="width:{width}px;">
|
||||
<slot/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -3,8 +3,7 @@
|
||||
</script>
|
||||
|
||||
{#if message}
|
||||
<div class="notice notice-error" role="alert">
|
||||
<div class="title">Submission Errors</div>
|
||||
<div class="content"> {message}</div>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
{message}
|
||||
</div>
|
||||
{/if}
|
||||
@@ -56,23 +56,23 @@
|
||||
path: '<path d="M416 288h-95.1c-17.67 0-32 14.33-32 32s14.33 32 32 32H416c17.67 0 32-14.33 32-32S433.7 288 416 288zM544 32h-223.1c-17.67 0-32 14.33-32 32s14.33 32 32 32H544c17.67 0 32-14.33 32-32S561.7 32 544 32zM352 416h-32c-17.67 0-32 14.33-32 32s14.33 32 32 32h32c17.67 0 31.1-14.33 31.1-32S369.7 416 352 416zM480 160h-159.1c-17.67 0-32 14.33-32 32s14.33 32 32 32H480c17.67 0 32-14.33 32-32S497.7 160 480 160zM192.4 330.7L160 366.1V64.03C160 46.33 145.7 32 128 32S96 46.33 96 64.03v302L63.6 330.7c-6.312-6.883-14.94-10.38-23.61-10.38c-7.719 0-15.47 2.781-21.61 8.414c-13.03 11.95-13.9 32.22-1.969 45.27l87.1 96.09c12.12 13.26 35.06 13.26 47.19 0l87.1-96.09c11.94-13.05 11.06-33.31-1.969-45.27C224.6 316.8 204.4 317.7 192.4 330.7z"/>',
|
||||
viewBox: "0 0 576 512",
|
||||
},
|
||||
filter: {
|
||||
"filter": {
|
||||
path: '<path d="M3.853 54.87C10.47 40.9 24.54 32 40 32H472C487.5 32 501.5 40.9 508.1 54.87C514.8 68.84 512.7 85.37 502.1 97.33L320 320.9V448C320 460.1 313.2 471.2 302.3 476.6C291.5 482 278.5 480.9 268.8 473.6L204.8 425.6C196.7 419.6 192 410.1 192 400V320.9L9.042 97.33C-.745 85.37-2.765 68.84 3.854 54.87L3.853 54.87z"/>',
|
||||
viewBox: "0 0 512 512",
|
||||
},
|
||||
calendar: {
|
||||
"calendar": {
|
||||
path: '<path d="M96 32C96 14.33 110.3 0 128 0C145.7 0 160 14.33 160 32V64H288V32C288 14.33 302.3 0 320 0C337.7 0 352 14.33 352 32V64H400C426.5 64 448 85.49 448 112V160H0V112C0 85.49 21.49 64 48 64H96V32zM448 464C448 490.5 426.5 512 400 512H48C21.49 512 0 490.5 0 464V192H448V464z"/>',
|
||||
viewBox: "0 0 448 512",
|
||||
},
|
||||
pencil: {
|
||||
"pencil": {
|
||||
path: '<path d="M421.7 220.3L188.5 453.4L154.6 419.5L158.1 416H112C103.2 416 96 408.8 96 400V353.9L92.51 357.4C87.78 362.2 84.31 368 82.42 374.4L59.44 452.6L137.6 429.6C143.1 427.7 149.8 424.2 154.6 419.5L188.5 453.4C178.1 463.8 165.2 471.5 151.1 475.6L30.77 511C22.35 513.5 13.24 511.2 7.03 504.1C.8198 498.8-1.502 489.7 .976 481.2L36.37 360.9C40.53 346.8 48.16 333.9 58.57 323.5L291.7 90.34L421.7 220.3zM492.7 58.75C517.7 83.74 517.7 124.3 492.7 149.3L444.3 197.7L314.3 67.72L362.7 19.32C387.7-5.678 428.3-5.678 453.3 19.32L492.7 58.75z"/>',
|
||||
viewBox: "0 0 512 512",
|
||||
},
|
||||
database: {
|
||||
"database": {
|
||||
path: '<path d="M448 80V128C448 172.2 347.7 208 224 208C100.3 208 0 172.2 0 128V80C0 35.82 100.3 0 224 0C347.7 0 448 35.82 448 80zM393.2 214.7C413.1 207.3 433.1 197.8 448 186.1V288C448 332.2 347.7 368 224 368C100.3 368 0 332.2 0 288V186.1C14.93 197.8 34.02 207.3 54.85 214.7C99.66 230.7 159.5 240 224 240C288.5 240 348.3 230.7 393.2 214.7V214.7zM54.85 374.7C99.66 390.7 159.5 400 224 400C288.5 400 348.3 390.7 393.2 374.7C413.1 367.3 433.1 357.8 448 346.1V432C448 476.2 347.7 512 224 512C100.3 512 0 476.2 0 432V346.1C14.93 357.8 34.02 367.3 54.85 374.7z"/>',
|
||||
viewBox: "0 0 448 512",
|
||||
},
|
||||
dice: {
|
||||
"dice": {
|
||||
path: '<path d="M447.1 224c0-12.56-4.781-25.13-14.35-34.76l-174.9-174.9C249.1 4.786 236.5 0 223.1 0C211.4 0 198.9 4.786 189.2 14.35L14.35 189.2C4.783 198.9-.0011 211.4-.0011 223.1c0 12.56 4.785 25.17 14.35 34.8l174.9 174.9c9.625 9.562 22.19 14.35 34.75 14.35s25.13-4.783 34.75-14.35l174.9-174.9C443.2 249.1 447.1 236.6 447.1 224zM96 248c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1S120 210.8 120 224S109.3 248 96 248zM224 376c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1s23.1 10.75 23.1 23.1S237.3 376 224 376zM224 248c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1S248 210.8 248 224S237.3 248 224 248zM224 120c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1s23.1 10.75 23.1 23.1S237.3 120 224 120zM352 248c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1s23.1 10.75 23.1 23.1S365.3 248 352 248zM591.1 192l-118.7 0c4.418 10.27 6.604 21.25 6.604 32.23c0 20.7-7.865 41.38-23.63 57.14l-136.2 136.2v46.37C320 490.5 341.5 512 368 512h223.1c26.5 0 47.1-21.5 47.1-47.1V240C639.1 213.5 618.5 192 591.1 192zM479.1 376c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1s23.1 10.75 23.1 23.1S493.2 376 479.1 376z"/>',
|
||||
viewBox: "0 0 640 512",
|
||||
},
|
||||
@@ -81,7 +81,7 @@
|
||||
path: '<path d="M506.3 417l-213.3-364c-16.33-28-57.54-28-73.98 0l-213.2 364C-10.59 444.9 9.849 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM232 168c0-13.25 10.75-24 24-24S280 154.8 280 168v128c0 13.25-10.75 24-23.1 24S232 309.3 232 296V168zM256 416c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 401.9 273.4 416 256 416z"/>',
|
||||
viewBox: "0 0 512 512",
|
||||
},
|
||||
eye: {
|
||||
"eye": {
|
||||
path: '<path d="M279.6 160.4C282.4 160.1 285.2 160 288 160C341 160 384 202.1 384 256C384 309 341 352 288 352C234.1 352 192 309 192 256C192 253.2 192.1 250.4 192.4 247.6C201.7 252.1 212.5 256 224 256C259.3 256 288 227.3 288 192C288 180.5 284.1 169.7 279.6 160.4zM480.6 112.6C527.4 156 558.7 207.1 573.5 243.7C576.8 251.6 576.8 260.4 573.5 268.3C558.7 304 527.4 355.1 480.6 399.4C433.5 443.2 368.8 480 288 480C207.2 480 142.5 443.2 95.42 399.4C48.62 355.1 17.34 304 2.461 268.3C-.8205 260.4-.8205 251.6 2.461 243.7C17.34 207.1 48.62 156 95.42 112.6C142.5 68.84 207.2 32 288 32C368.8 32 433.5 68.84 480.6 112.6V112.6zM288 112C208.5 112 144 176.5 144 256C144 335.5 208.5 400 288 400C367.5 400 432 335.5 432 256C432 176.5 367.5 112 288 112z"/>',
|
||||
viewBox: "0 0 576 512",
|
||||
},
|
||||
@@ -93,40 +93,19 @@
|
||||
path: '<path d="M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723C99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9c53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0C515.9 484.7 515.9 459.3 500.3 443.7zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128c0 70.58-57.42 128-128 128S79.1 278.6 79.1 208z"/>',
|
||||
viewBox: "0 0 512 512",
|
||||
},
|
||||
expand: {
|
||||
"expand": {
|
||||
path: '<path d="M128 32H32C14.31 32 0 46.31 0 64v96c0 17.69 14.31 32 32 32s32-14.31 32-32V96h64c17.69 0 32-14.31 32-32S145.7 32 128 32zM416 32h-96c-17.69 0-32 14.31-32 32s14.31 32 32 32h64v64c0 17.69 14.31 32 32 32s32-14.31 32-32V64C448 46.31 433.7 32 416 32zM128 416H64v-64c0-17.69-14.31-32-32-32s-32 14.31-32 32v96c0 17.69 14.31 32 32 32h96c17.69 0 32-14.31 32-32S145.7 416 128 416zM416 320c-17.69 0-32 14.31-32 32v64h-64c-17.69 0-32 14.31-32 32s14.31 32 32 32h96c17.69 0 32-14.31 32-32v-96C448 334.3 433.7 320 416 320z"/>',
|
||||
viewBox: "0 0 448 512",
|
||||
},
|
||||
compress: {
|
||||
"compress": {
|
||||
path: '<path d="M128 320H32c-17.69 0-32 14.31-32 32s14.31 32 32 32h64v64c0 17.69 14.31 32 32 32s32-14.31 32-32v-96C160 334.3 145.7 320 128 320zM416 320h-96c-17.69 0-32 14.31-32 32v96c0 17.69 14.31 32 32 32s32-14.31 32-32v-64h64c17.69 0 32-14.31 32-32S433.7 320 416 320zM320 192h96c17.69 0 32-14.31 32-32s-14.31-32-32-32h-64V64c0-17.69-14.31-32-32-32s-32 14.31-32 32v96C288 177.7 302.3 192 320 192zM128 32C110.3 32 96 46.31 96 64v64H32C14.31 128 0 142.3 0 160s14.31 32 32 32h96c17.69 0 32-14.31 32-32V64C160 46.31 145.7 32 128 32z"/>',
|
||||
viewBox: "0 0 448 512",
|
||||
},
|
||||
check: {
|
||||
"check": {
|
||||
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",
|
||||
},
|
||||
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 height = 16;
|
||||
export let icon = "";
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<script>
|
||||
|
||||
import {onDestroy, onMount} from "svelte";
|
||||
import offcanvas from "bootstrap/js/src/offcanvas.js";
|
||||
export let title = "";
|
||||
let offCanvasEl;
|
||||
let offCanvasInstance;
|
||||
|
||||
export function show() {
|
||||
if(!offCanvasInstance){
|
||||
offCanvasInstance = new offcanvas(offCanvasEl);
|
||||
}
|
||||
offCanvasInstance.show();
|
||||
}
|
||||
onMount(()=>{
|
||||
offCanvasInstance = new offcanvas(offCanvasEl);
|
||||
});
|
||||
|
||||
export function hide() {
|
||||
offCanvasInstance.hide();
|
||||
}
|
||||
</script>
|
||||
|
||||
<div bind:this={offCanvasEl} class="offcanvas offcanvas-end" tabindex="-1"
|
||||
aria-labelledby="offcanvasEditContent">
|
||||
<div class="offcanvas-header">
|
||||
<h5 class="offcanvas-title">{title}</h5>
|
||||
<button type="button" on:click={hide} class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="offcanvas-body" style="overflow: auto">
|
||||
<slot/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3,7 +3,7 @@
|
||||
export let disabled = false;
|
||||
</script>
|
||||
|
||||
<button type="submit" class="button secondary btn-spinner" {disabled}>
|
||||
<button type="submit" class="btn btn-primary btn-spinner" {disabled}>
|
||||
<span
|
||||
class="spinner-border spinner-border-sm"
|
||||
role="status"
|
||||
|
||||
@@ -12,10 +12,21 @@
|
||||
</script>
|
||||
|
||||
{#if isVisible}
|
||||
<div class="notice notice-success" transition:fly={{ duration: 500 }} role="alert">
|
||||
<div class="title">Success</div>
|
||||
<div class="content"> {message}</div>
|
||||
<div
|
||||
transition:fly={{ duration: 500 }}
|
||||
class="lx-alert text-white bg-success border-1 border rounded px-3 py-0 text-center"
|
||||
role="alert"
|
||||
>
|
||||
{message}
|
||||
</div>
|
||||
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.lx-alert {
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
top: 45px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
</style>
|
||||
@@ -1,9 +0,0 @@
|
||||
<script>
|
||||
|
||||
|
||||
export let value;
|
||||
export let checked = false;
|
||||
</script>
|
||||
|
||||
<input type="checkbox" {value} on:change
|
||||
class="switch" {checked}/>
|
||||
@@ -0,0 +1,13 @@
|
||||
<script>
|
||||
import {uniqueId} from "lodash";
|
||||
|
||||
export let label = "";
|
||||
let id = uniqueId();
|
||||
</script>
|
||||
|
||||
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id={id} checked>
|
||||
<label class="form-check-label" for={id}>{label}</label>
|
||||
</div>
|
||||
|
||||
@@ -35,47 +35,49 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div style="display: flex;align-items: center; gap: 8px">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<span class="me-2">{selected.length} records selected</span>
|
||||
<div class="btn-group " role="group" aria-label="Basic example">
|
||||
<button
|
||||
on:click|preventDefault={(e) => changeStatus(e, "published")}
|
||||
type="button"
|
||||
class="button">Publish
|
||||
class="btn btn-sm btn-outline-primary">Publish
|
||||
</button
|
||||
>
|
||||
<button
|
||||
on:click|preventDefault={(e) => changeStatus(e, "draft")}
|
||||
type="button"
|
||||
class="button">Make Draft
|
||||
class="btn btn-sm btn-outline-primary">Make Draft
|
||||
</button
|
||||
>
|
||||
{#if filter["status_in"] === "trashed"}
|
||||
<button
|
||||
on:click|preventDefault={(e) => changeStatus(e, "published")}
|
||||
type="button"
|
||||
class="button">Publish
|
||||
class="btn btn-sm btn-outline-primary">Publish
|
||||
</button
|
||||
>
|
||||
{#if schema.hasDrafts}
|
||||
<button
|
||||
on:click|preventDefault={(e) => changeStatus(e, "draft")}
|
||||
type="button"
|
||||
class="button">Make Draft
|
||||
class="btn btn-sm btn-outline-primary">Make Draft
|
||||
</button
|
||||
>
|
||||
{/if}
|
||||
<button
|
||||
on:click|preventDefault={deleteRecords}
|
||||
type="button"
|
||||
class="button">Delete forever
|
||||
class="btn btn-sm btn-outline-primary">Delete forever
|
||||
</button
|
||||
>
|
||||
{:else}
|
||||
<button
|
||||
type="button"
|
||||
on:click|preventDefault={(e) => changeStatus(e, "trashed")}
|
||||
class="button">Move to trash
|
||||
class="btn btn-sm btn-outline-primary">Move to trash
|
||||
</button
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,11 +1,10 @@
|
||||
<script>
|
||||
import {getContext} from "svelte";
|
||||
import Preview from "../files/Preview.svelte";
|
||||
import {selectRecord} from "./functions/recordSelect.js";
|
||||
import Preview from "../newPreview/Preview.svelte";
|
||||
|
||||
const channel = getContext("channel");
|
||||
|
||||
export let schema;
|
||||
export let records;
|
||||
export let isWritable;
|
||||
export let selected = [];
|
||||
@@ -17,42 +16,42 @@
|
||||
|
||||
</script>
|
||||
<div class="row" style="max-width:1000px">
|
||||
{#each records as record (record.id)}
|
||||
{#each records as queryRecord (queryRecord.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)}
|
||||
class:selected={selected.includes(queryRecord)}
|
||||
>
|
||||
{#if isWritable}
|
||||
<div class="form-check">
|
||||
<input
|
||||
on:change={() => select(record)}
|
||||
on:change={() => select(queryRecord.record)}
|
||||
class="form-check-input "
|
||||
type="checkbox"
|
||||
checked={selected.find(
|
||||
(r) => r.id === record.id
|
||||
(r) => r.id === queryRecord.record.id
|
||||
)}
|
||||
value={record}
|
||||
value={queryRecord}
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="d-flex justify-content-center">
|
||||
<Preview {record} size="medium"/>
|
||||
<Preview record={queryRecord.record} />
|
||||
</div>
|
||||
|
||||
<a
|
||||
href="{channel.lucentUrl}/records/{record.id}"
|
||||
title={record._file.path}
|
||||
href="{channel.lucentUrl}/records/{queryRecord.record.id}"
|
||||
title={queryRecord.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
|
||||
">{queryRecord.record._file.path}</a
|
||||
>
|
||||
<span
|
||||
class="lx-small-text text-muted d-block text-center"
|
||||
>{record._file.mime}</span
|
||||
>{queryRecord.record._file.mime}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
<script>
|
||||
import Tools from "./tools/Tools.svelte";
|
||||
// import Tools from "./tools/Tools.svelte";
|
||||
import Pagination from "./pagination/Pagination.svelte";
|
||||
import ActionsOnSelected from "./ActionsOnSelected.svelte";
|
||||
import Table from "./Table.svelte";
|
||||
import {getContext} from "svelte";
|
||||
import Grid from "./Grid.svelte";
|
||||
import Tools from "./tools/Tools.svelte";
|
||||
|
||||
const axios = getContext("axios");
|
||||
export let schema;
|
||||
export let users;
|
||||
export let records;
|
||||
export let graph;
|
||||
// export let visibleFields;
|
||||
export let systemFields;
|
||||
export let sortParam;
|
||||
@@ -38,7 +39,6 @@
|
||||
limit = response.data.limit;
|
||||
total = response.data.total;
|
||||
modalUrl = response.data.modalUrl;
|
||||
document.querySelector("dialog h3").scrollIntoView();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
@@ -46,8 +46,8 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="">
|
||||
<div class="{inModal ? 'mt-0' : 'mt-5'}">
|
||||
<div class="wrapper-large transparent ">
|
||||
<div class="lx-card mb-4 mt-0">
|
||||
<h3 class="header-normal mb-5 ">
|
||||
{schema.label}
|
||||
</h3>
|
||||
@@ -62,7 +62,6 @@
|
||||
{sortField}
|
||||
{operators}
|
||||
{filter}
|
||||
{graph}
|
||||
{inModal}
|
||||
{modalUrl}
|
||||
{isWritable}
|
||||
@@ -70,9 +69,9 @@
|
||||
/>
|
||||
{/if}
|
||||
|
||||
{#if schema.type === "collection"}
|
||||
<Table
|
||||
{records}
|
||||
{graph}
|
||||
{schema}
|
||||
{sortParam}
|
||||
{sortField}
|
||||
@@ -82,7 +81,15 @@
|
||||
{isWritable}
|
||||
bind:selected
|
||||
/>
|
||||
{:else}
|
||||
<Grid
|
||||
{records}
|
||||
{schema}
|
||||
{isWritable}
|
||||
bind:selected
|
||||
/>
|
||||
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<Pagination
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<script>
|
||||
import RenderField from "./RenderField.svelte";
|
||||
import Avatar from "../../common/Avatar.svelte";
|
||||
import Avatar from "../account/Avatar.svelte";
|
||||
import Status from "../records/Status.svelte";
|
||||
import {usernameById} from "../account/users";
|
||||
import {friendlyDate} from "../../helpers";
|
||||
|
||||
export let schema;
|
||||
export let users;
|
||||
export let graph;
|
||||
export let record;
|
||||
export let queryRecord;
|
||||
export let sortParam;
|
||||
export let sortField;
|
||||
export let visibleColumns;
|
||||
|
||||
</script>
|
||||
|
||||
{#each visibleColumns as field, index}
|
||||
@@ -19,48 +19,40 @@
|
||||
class="field-ui-{field.info.name}"
|
||||
class:is-sort={field.name === sortField.name}
|
||||
>
|
||||
<RenderField {record} {schema} {graph} {field} />
|
||||
<RenderField {queryRecord} {field}/>
|
||||
</td>
|
||||
{/each}
|
||||
{#if schema.visible?.includes("status")}
|
||||
{#if schema.visible.includes("status")}
|
||||
<td
|
||||
class="text-center"
|
||||
class:is-sort={"-status" == sortParam || "status" == sortParam}
|
||||
>
|
||||
<Status status={record.status} />
|
||||
<Status status={queryRecord.record.status}/>
|
||||
</td>
|
||||
{/if}
|
||||
{#if schema.visible?.includes("_sys.createdBy")}
|
||||
{#if schema.visible.includes("_sys.createdBy")}
|
||||
<td
|
||||
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, queryRecord.record._sys.createdBy)} side={24}/>
|
||||
</td>
|
||||
{/if}
|
||||
{#if schema.visible?.includes("_sys.updatedBy")}
|
||||
{#if schema.visible.includes("_sys.updatedBy")}
|
||||
<td
|
||||
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, queryRecord.record._sys.updatedBy)} side={24}/>
|
||||
</td>
|
||||
{/if}
|
||||
{#if schema.visible?.includes("_sys.createdAt")}
|
||||
<td
|
||||
class:is-sort={"-_sys.createdAt" == sortParam ||
|
||||
"_sys.createdAt" == sortParam}
|
||||
>
|
||||
{friendlyDate(record._sys.createdAt)}
|
||||
{#if schema.visible.includes("_sys.createdAt")}
|
||||
<td class:is-sort={"-_sys.createdAt" == sortParam || "_sys.createdAt" == sortParam}>
|
||||
{friendlyDate(queryRecord.record._sys.createdAt)}
|
||||
</td>
|
||||
{/if}
|
||||
{#if schema.visible?.includes("_sys.updatedAt")}
|
||||
<td
|
||||
class:is-sort={"-_sys.updatedAt" == sortParam ||
|
||||
"_sys.updatedAt" == sortParam}
|
||||
>
|
||||
{friendlyDate(record._sys.updatedAt)}
|
||||
{#if schema.visible.includes("_sys.updatedAt")}
|
||||
<td class:is-sort={"-_sys.updatedAt" == sortParam || "_sys.updatedAt" == sortParam}>
|
||||
{friendlyDate(queryRecord.record._sys.updatedAt)}
|
||||
</td>
|
||||
{/if}
|
||||
@@ -29,17 +29,13 @@
|
||||
file: File,
|
||||
};
|
||||
export let field;
|
||||
export let schema;
|
||||
export let record;
|
||||
export let graph;
|
||||
export let queryRecord;
|
||||
|
||||
</script>
|
||||
|
||||
<svelte:component
|
||||
this={renderElements[field.info.name]}
|
||||
value={record.data[field.name]}
|
||||
{record}
|
||||
{graph}
|
||||
{schema}
|
||||
value={queryRecord.record.data[field.name]}
|
||||
{queryRecord}
|
||||
{field}
|
||||
/>
|
||||
@@ -3,18 +3,14 @@
|
||||
import {previewTitle} from "../records/Preview";
|
||||
import {usernameById} from "../account/users";
|
||||
import {getContext} from "svelte";
|
||||
import Avatar from "../../common/Avatar.svelte";
|
||||
import Avatar from "../account/Avatar.svelte";
|
||||
import {selectRecord, toggleAll} from "./functions/recordSelect.js";
|
||||
import Checkbox from "../common/Checkbox.svelte";
|
||||
import Preview from "../files/Preview.svelte";
|
||||
import { fileurl } from "../files/imageserver.js";
|
||||
|
||||
const channel = getContext("channel");
|
||||
|
||||
export let schema;
|
||||
export let users;
|
||||
export let records;
|
||||
export let graph;
|
||||
export let systemFields;
|
||||
export let sortParam;
|
||||
export let sortField;
|
||||
@@ -23,31 +19,31 @@
|
||||
export let selected = [];
|
||||
|
||||
function eventToggleAll(e) {
|
||||
selected = toggleAll(e, records, selected);
|
||||
selected = toggleAll(e,records,selected)
|
||||
}
|
||||
|
||||
function select(record) {
|
||||
selected = selectRecord(record, selected);
|
||||
selected = selectRecord(record, selected)
|
||||
}
|
||||
|
||||
$: visibleColumns = schema.fields.filter(
|
||||
(c) => schema.visible?.includes(c.name) ?? [],
|
||||
);
|
||||
$: visibleColumns = schema.fields.filter(c => schema.visible.includes(c.name))
|
||||
|
||||
</script>
|
||||
|
||||
<div class="table mt-5">
|
||||
<table>
|
||||
<thead>
|
||||
<div class="lx-table rounded">
|
||||
<table class="">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
{#if isWritable}
|
||||
<th>
|
||||
<Checkbox
|
||||
value=""
|
||||
on:change={eventToggleAll}
|
||||
<input
|
||||
on:change|preventDefault={eventToggleAll}
|
||||
indeterminate={selected.length > 0 &&
|
||||
selected.length < records.length}
|
||||
checked={selected.length === records.length}
|
||||
></Checkbox>
|
||||
checked={selected.length == records.length}
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
/>
|
||||
</th>
|
||||
{/if}
|
||||
|
||||
@@ -56,117 +52,72 @@
|
||||
class="field-ui-{field.info.name ?? field.ui}"
|
||||
class:is-sort={field.name === sortField.name}
|
||||
scope="col"
|
||||
title={field.help}>{field.label}</th
|
||||
title={field.help}
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top">{field.label}</th
|
||||
>
|
||||
{/each}
|
||||
{#each systemFields.filter( (c) => schema.visible?.includes(c.name), ) as sysField}
|
||||
<th class:is-sort={sysField.name === sortField.name}
|
||||
>{sysField.label}</th
|
||||
>
|
||||
{#each systemFields.filter(c => schema.visible.includes(c.name)) as sysField}
|
||||
<th>{sysField.label}</th>
|
||||
{/each}
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each records as record (record.id)}
|
||||
{#each records as queryRecord (queryRecord.record.id)}
|
||||
<tr>
|
||||
<td class="title-td">
|
||||
<div class="title-td-contents">
|
||||
<div
|
||||
class="title-td-contents d-inline-flex justify-content-between w-100 align-items-center"
|
||||
>
|
||||
<div class="d-flex align-items-center ">
|
||||
{#if isWritable}
|
||||
<Checkbox
|
||||
on:change={() => select(record)}
|
||||
<div class="form-check">
|
||||
<input
|
||||
on:change={() => select(queryRecord.record)}
|
||||
class="form-check-input "
|
||||
type="checkbox"
|
||||
checked={selected.find(
|
||||
(r) => r.id === record.id,
|
||||
(r) => r.id === queryRecord.record.id
|
||||
)}
|
||||
value={record}
|
||||
></Checkbox>
|
||||
{/if}
|
||||
{#if record._file?.path}
|
||||
<div class="file-table-row">
|
||||
<Preview
|
||||
{record}
|
||||
size={record._file?.width > 0
|
||||
? "medium"
|
||||
: "small"}
|
||||
value={queryRecord}
|
||||
/>
|
||||
|
||||
<div>
|
||||
{#if record.status === "draft"}
|
||||
<span
|
||||
style="text-transform: uppercase;font-size:10px"
|
||||
>{record.status}</span
|
||||
>
|
||||
{/if}
|
||||
<a
|
||||
href="{channel.lucentUrl}/records/{record.id}"
|
||||
target={inModal
|
||||
? "_blank"
|
||||
: "_self"}
|
||||
>
|
||||
{previewTitle(
|
||||
channel.schemas,
|
||||
record,
|
||||
graph,
|
||||
)}
|
||||
</a>
|
||||
<span
|
||||
>{(
|
||||
record._file.size / 1024
|
||||
).toFixed(1)}kB</span
|
||||
>
|
||||
|
||||
{#if record._file.width > 0}
|
||||
<span
|
||||
>{record._file.width +
|
||||
"x" +
|
||||
record._file.height}</span
|
||||
>
|
||||
{/if}
|
||||
<a
|
||||
href={fileurl(channel, record)}
|
||||
target="_blank"
|
||||
>
|
||||
Download
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
{/if}
|
||||
|
||||
<a
|
||||
href="{channel.lucentUrl}/records/{record.id}"
|
||||
|
||||
class="me-2 text-decoration-none text-dark fs-6"
|
||||
href="{channel.lucentUrl}/records/{queryRecord.record.id}"
|
||||
target={inModal ? "_blank" : "_self"}
|
||||
title={previewTitle(queryRecord.record)}
|
||||
data-bs-toggle="tooltip" data-bs-placement="left"
|
||||
|
||||
>
|
||||
{#if record.status === "draft"}
|
||||
<span
|
||||
style="text-transform: uppercase;font-size:10px"
|
||||
>{record.status}</span
|
||||
>
|
||||
{/if}
|
||||
{previewTitle(
|
||||
channel.schemas,
|
||||
record,
|
||||
graph,
|
||||
)}
|
||||
{previewTitle(queryRecord.record)}
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
<div>
|
||||
<Avatar
|
||||
name={usernameById(
|
||||
users,
|
||||
queryRecord.record._sys.updatedBy
|
||||
)}
|
||||
side={24}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<RecordRow
|
||||
{record}
|
||||
{graph}
|
||||
{queryRecord}
|
||||
{schema}
|
||||
{visibleColumns}
|
||||
{sortParam}
|
||||
{sortField}
|
||||
{users}
|
||||
/>
|
||||
<td>
|
||||
<Avatar
|
||||
name={usernameById(users, record._sys.updatedBy)}
|
||||
side={24}
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
<script>
|
||||
import Preview from "../../files/Preview.svelte";
|
||||
|
||||
export let record;
|
||||
export let queryRecord;
|
||||
export let field;
|
||||
export let graph;
|
||||
|
||||
let filePreviews = queryRecord?._children[field.name];
|
||||
|
||||
let filePreviews = graph.edges?.filter((ed) => ed.field === field.name && ed.source === record.id)
|
||||
.map((ed) => graph.records.find((r) => r.id === ed.target));
|
||||
// if (edges[0]) {
|
||||
// firstRecord = record._children.find((r) => r.data.id === edges[0].to);
|
||||
// }
|
||||
</script>
|
||||
|
||||
<!-- {#if firstRecord}
|
||||
<Preview record={firstRecord} size="tiny" />
|
||||
{/if} -->
|
||||
<div class="d-flex me-1">
|
||||
{#each filePreviews as file}
|
||||
<div class="me-1">
|
||||
|
||||
@@ -1,25 +1,16 @@
|
||||
<script>
|
||||
import PreviewCardSmall from "../../records/PreviewCardSmall.svelte";
|
||||
|
||||
export let record;
|
||||
export let queryRecord;
|
||||
export let field;
|
||||
export let schemas;
|
||||
export let graph;
|
||||
|
||||
$: recordEdges =
|
||||
graph.edges
|
||||
?.filter((ed) => ed.field === field.name && ed.source === record.id)
|
||||
.map((edge) => {
|
||||
return graph.records.find((r) => r.id === edge.target);
|
||||
})
|
||||
.filter((record) => (!record ? false : true)) ?? [];
|
||||
$: recordEdges = queryRecord?._children[field.name];
|
||||
|
||||
</script>
|
||||
|
||||
<div class="references">
|
||||
{#each recordEdges as recordEdge}
|
||||
<span class="reference">
|
||||
<PreviewCardSmall {schemas} {graph} record={recordEdge}/>
|
||||
<span class="mr-3">
|
||||
<PreviewCardSmall record={recordEdge}/>
|
||||
</span>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
</script>
|
||||
|
||||
{#each pages as i}
|
||||
<li class="page-item" class:active={currentPage === i}>
|
||||
{#if currentPage === i}
|
||||
<li class="page-item">
|
||||
{#if currentPage == i}
|
||||
<span class="page-link active">{i}</span>
|
||||
{:else}
|
||||
<a class="page-link" on:click={(e) => goto(e, i)} href={url(i)}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script>
|
||||
import { createEventDispatcher } from "svelte";
|
||||
const dispatch = createEventDispatcher();
|
||||
import { range } from "lodash";
|
||||
import NavItem from "./NavItem.svelte";
|
||||
export let inModal;
|
||||
export let modalUrl;
|
||||
@@ -42,7 +43,7 @@
|
||||
</script>
|
||||
|
||||
<nav>
|
||||
<ul class="pagination">
|
||||
<ul class="pagination justify-content-center">
|
||||
{#if totalPages > 1}
|
||||
<li class="page-item disabled" class:disabled={currentPage === 1}>
|
||||
<a on:click={first} href="/" class="page-link"> First </a>
|
||||
@@ -68,7 +69,7 @@
|
||||
{/if}
|
||||
</ul>
|
||||
</nav>
|
||||
<p style="display: flex;justify-content: center; gap: 4px">
|
||||
<p class="text-muted text-center">
|
||||
Showing
|
||||
<span class="font-medium">{+skip + 1}</span>
|
||||
to
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<script>
|
||||
import {createEventDispatcher, getContext} from "svelte";
|
||||
import {previewTitle} from "../../records/Preview";
|
||||
import Icon from "../../common/Icon.svelte";
|
||||
|
||||
const channel = getContext("channel");
|
||||
const dispatch = createEventDispatcher();
|
||||
@@ -11,7 +10,8 @@
|
||||
export let value;
|
||||
export let inModal;
|
||||
export let modalUrl;
|
||||
export let graph;
|
||||
export let records
|
||||
|
||||
let filter = {
|
||||
label: "",
|
||||
operator: "",
|
||||
@@ -24,9 +24,6 @@
|
||||
extractLabel(schema, key),
|
||||
].reduce((mem, fn) => fn(mem), filter);
|
||||
|
||||
|
||||
|
||||
|
||||
function extractOperator(key) {
|
||||
return (filter) => {
|
||||
if (filter.isReference) {
|
||||
@@ -54,14 +51,13 @@
|
||||
|
||||
}
|
||||
|
||||
const filterRecord = extractFilterRecord(graph, value);
|
||||
|
||||
function extractFilterRecord(graph, value) {
|
||||
const filterRecord = extractFilterRecord(records, value);
|
||||
|
||||
function extractFilterRecord(records, value) {
|
||||
if (!filter.isReference) {
|
||||
return null;
|
||||
}
|
||||
return graph.records.find(r => r.id === value);
|
||||
return records.find(r => r.id === value);
|
||||
}
|
||||
|
||||
function removeFilter(k) {
|
||||
@@ -77,20 +73,30 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<span class="applied-filter">
|
||||
|
||||
<span class="applied-filter d-inline-block border border-primary rounded lx-small-text me-1 px-2 py-1">
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
{#if filter.isReference && filterRecord}
|
||||
{filter.label} is {previewTitle(channel.schemas, filterRecord)}
|
||||
{filter.label} is {previewTitle(filterRecord)}
|
||||
{:else}
|
||||
{filter.label} {operators.find((o) => o.name === filter.operator)?.symbol ?? ""} {operators.find((o) => o.name === filter.operator)?.hasValue ? value : ""}
|
||||
{filter.label} {operators.find((o) => o.name === filter.operator)?.symbol ?? ""} {value}
|
||||
{/if}
|
||||
|
||||
<button
|
||||
on:click|preventDefault={() => removeFilter(key)}
|
||||
type="button"
|
||||
class="button-text"
|
||||
class="btn-close btn-close ms-1"
|
||||
aria-label="Close"
|
||||
><Icon width={12} height={12} icon="close"></Icon></button>
|
||||
/>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<style>
|
||||
.applied-filter {
|
||||
background-color: #fff;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.applied-filter:hover {
|
||||
opacity: .8;
|
||||
background-color: #eee;
|
||||
}
|
||||
</style>
|
||||
@@ -1,35 +0,0 @@
|
||||
<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}
|
||||
@@ -1,8 +1,8 @@
|
||||
<script>
|
||||
import Icon from "../../common/Icon.svelte";
|
||||
import {createEventDispatcher} from "svelte";
|
||||
import Dropdown from "../../common/Dropdown.svelte";
|
||||
import FilterReferenceInput from "./FilterReferenceInput.svelte";
|
||||
import Dropdown from "../../common/Dropdown.svelte";
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
export let schema;
|
||||
@@ -14,10 +14,50 @@
|
||||
let dropdown;
|
||||
let search = "";
|
||||
let systemFieldsFiltered = systemFields;
|
||||
if (schema.type === "collection") {
|
||||
if (schema.type == "collection") {
|
||||
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) {
|
||||
e.preventDefault();
|
||||
let filterKeyValue = search.split("=")[0] ?? "";
|
||||
@@ -39,195 +79,63 @@
|
||||
} else {
|
||||
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>
|
||||
|
||||
|
||||
<div>
|
||||
<Dropdown bind:this={dropdown}>
|
||||
<div class="mx-2 d-flex align-items-center">
|
||||
<Dropdown bind:this={dropdown} width="300">
|
||||
<div slot="button">
|
||||
<Icon icon="filter"/>
|
||||
<span class="ms-1">Filter</span>
|
||||
</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 class="px-3 py-1 d-flex align-items-center">
|
||||
<select bind:value={selectedField} class="form-select">
|
||||
{#each filterableFields as field}
|
||||
<option value={field}>{field.label}</option>
|
||||
{/each}
|
||||
</select>
|
||||
</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>
|
||||
<div class="px-3 py-1 d-flex align-items-center">
|
||||
<select class="form-select" bind:value={selectedOperator}>
|
||||
{#each operatorsFiltered as operator}
|
||||
<option value={operator}>{operator.label}</option>
|
||||
{/each}
|
||||
{/if}
|
||||
|
||||
{#if activeField && !activeOperator}
|
||||
<button class="dropdown-item button" on:click={e => activeField = null }>
|
||||
<Icon icon="arrow-left"></Icon>
|
||||
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}
|
||||
{/if}
|
||||
{#if activeField && activeOperator}
|
||||
<button class="dropdown-item button" on:click={e => activeOperator = null }>
|
||||
<Icon icon="arrow-left"></Icon>
|
||||
Back
|
||||
</button>
|
||||
<div class="selected-filter">field: {activeField.label} operator: {activeOperator.label}</div>
|
||||
<div class="filter-input">
|
||||
</select>
|
||||
</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
|
||||
type="text"
|
||||
class="form-control"
|
||||
bind:value={selectedInput}
|
||||
/>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="px-3 py-1 d-flex align-items-center">
|
||||
<button
|
||||
on:click={applyFilter}
|
||||
class="button applied-filter"
|
||||
on:click={addFilter}
|
||||
class="btn btn-outline-primary"
|
||||
type="button"
|
||||
>
|
||||
Add filter
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
</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>
|
||||
<hr/>
|
||||
<div><h6 class="dropdown-header">Advanced filters</h6></div>
|
||||
<form on:submit={submitSearch}>
|
||||
<div class="px-3 py-1 d-flex align-items-center">
|
||||
<input
|
||||
bind:value={search}
|
||||
type="search"
|
||||
class="mb-2 mt-2"
|
||||
class="form-control"
|
||||
placeholder="Advanced filters"
|
||||
required
|
||||
/>
|
||||
|
||||
<button class="button applied-filter">
|
||||
Submit
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
</Dropdown>
|
||||
|
||||
</div>
|
||||
@@ -1,15 +1,18 @@
|
||||
<script>
|
||||
import {createEventDispatcher, getContext} from "svelte";
|
||||
import {debounce} from "lodash";
|
||||
import {previewTitle} from "../../records/Preview";
|
||||
|
||||
|
||||
const channel = getContext("channel");
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
export let value = "";
|
||||
export let field;
|
||||
|
||||
let search = "";
|
||||
$: searchOptions = [];
|
||||
let search = ""
|
||||
$: searchOptions = []
|
||||
|
||||
|
||||
const updateResults = debounce((e) => {
|
||||
axios
|
||||
@@ -32,36 +35,44 @@
|
||||
|
||||
function apply(e, newOption) {
|
||||
e.preventDefault();
|
||||
value = newOption.id;
|
||||
value = newOption.id
|
||||
dispatch("addFilter");
|
||||
value = "";
|
||||
value = ""
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="reference-tags">
|
||||
<input
|
||||
type="search"
|
||||
on:keyup={updateResults}
|
||||
class="form-control dropdown-toggle"
|
||||
bind:value={search}
|
||||
placeholder={"Search for "+field.label}
|
||||
data-bs-toggle="dropdown"
|
||||
autocomplete="off"
|
||||
/>
|
||||
|
||||
<div class="reference-tags-results">
|
||||
<div class="dropdown-menu w-100">
|
||||
|
||||
{#if searchOptions}
|
||||
{#each searchOptions as option (option.id)}
|
||||
<div
|
||||
class="reference-tags-option"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
on:click={(e) => apply(e, option)}
|
||||
on:keypress={(e) => apply(e, option)}
|
||||
>
|
||||
{previewTitle(channel.schemas, option)}
|
||||
<span class="dropdown-item">
|
||||
{previewTitle( option)}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{:else}
|
||||
<div class="start-typing">Start typing...</div>
|
||||
|
||||
Start typing...
|
||||
{/each}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<script>
|
||||
import Icon from "../../../common/Icon.svelte";
|
||||
import Icon from "../../common/Icon.svelte";
|
||||
import {createEventDispatcher} from "svelte";
|
||||
import Dropdown from "../../common/Dropdown.svelte";
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
export let schema;
|
||||
@@ -12,22 +11,14 @@
|
||||
export let systemFields = [];
|
||||
|
||||
$: sortableFields = schema.fields.filter(
|
||||
(f) =>
|
||||
![
|
||||
"reference",
|
||||
"file",
|
||||
"json",
|
||||
"id",
|
||||
"rich",
|
||||
"markdown",
|
||||
"block",
|
||||
].includes(f.info.name),
|
||||
(f) => !["reference", "file", "json", "id", "rich", "markdown", "block"].includes(f.info.name)
|
||||
);
|
||||
$: systemFieldsFiltered = systemFields;
|
||||
$: if (schema.type === "collection") {
|
||||
systemFieldsFiltered = systemFields.filter((f) => f.files === false);
|
||||
}
|
||||
|
||||
|
||||
function triggerSortField(fieldSort) {
|
||||
const url = new URL(modalUrl ?? window.location.href);
|
||||
url.searchParams.set("sort", fieldSort);
|
||||
@@ -40,91 +31,101 @@
|
||||
|
||||
function sortAsc(e, field) {
|
||||
e.preventDefault();
|
||||
let prefix = systemFields.map((el) => el.name).includes(field.name)
|
||||
? ""
|
||||
: "data.";
|
||||
let prefix = systemFields.map((el) => el.name).includes(field.name) ? "" : "data.";
|
||||
return triggerSortField(prefix + field.name);
|
||||
}
|
||||
|
||||
function sortDesc(e, field) {
|
||||
e.preventDefault();
|
||||
let prefix = systemFields.map((el) => el.name).includes(field.name)
|
||||
? ""
|
||||
: "data.";
|
||||
let prefix = systemFields.map((el) => el.name).includes(field.name) ? "" : "data.";
|
||||
return triggerSortField("-" + prefix + field.name);
|
||||
}
|
||||
</script>
|
||||
|
||||
<Dropdown>
|
||||
<div slot="button">
|
||||
<div class=" ">
|
||||
<button
|
||||
class="btn btn-sm btn-outline-primary dropdown-toggle d-flex align-items-center"
|
||||
type="button"
|
||||
data-bs-toggle="dropdown"
|
||||
data-bs-auto-close="outside"
|
||||
aria-expanded="false"
|
||||
>
|
||||
{#if sortParam.startsWith("-")}
|
||||
<Icon icon="arrow-down-wide-short"/>
|
||||
{:else}
|
||||
<Icon icon="arrow-up-short-wide"/>
|
||||
{/if}
|
||||
<span class="ms-1">{sortField.label}</span>
|
||||
</div>
|
||||
<div>
|
||||
</button>
|
||||
<div class="dropdown-menu" style="width:auto;max-width:800px;">
|
||||
<div class="row">
|
||||
{#each sortableFields as field}
|
||||
<div class="dropdown-item">
|
||||
<div class="col-4 px-3 py-1 d-flex align-items-center">
|
||||
<div class="btn-group w-100">
|
||||
<button
|
||||
on:click={(e) => sortAsc(e, field)}
|
||||
title="Sort Ascending"
|
||||
class="button button-icon {field.name == sortField.name &&
|
||||
!sortParam.startsWith('-')
|
||||
? 'active'
|
||||
: ''} "
|
||||
class="btn btn-sm {field.name == sortField.name && !sortParam.startsWith("-")
|
||||
? 'btn-primary'
|
||||
: 'btn-outline-primary'} "
|
||||
>
|
||||
<Icon icon="arrow-up-short-wide"/>
|
||||
</button>
|
||||
<button
|
||||
on:click={(e) => sortDesc(e, field)}
|
||||
title="Sort Descending"
|
||||
class="button button-icon {field.name == sortField.name &&
|
||||
sortParam.startsWith('-')
|
||||
? 'active'
|
||||
: ''} "
|
||||
class="btn btn-sm {field.name == sortField.name && sortParam.startsWith("-")
|
||||
? 'btn-primary'
|
||||
: 'btn-outline-primary'} "
|
||||
>
|
||||
<Icon icon="arrow-down-wide-short"/>
|
||||
</button>
|
||||
<button
|
||||
title="Sort Ascending"
|
||||
on:click={(e) => sortAsc(e, field)}
|
||||
class="button"
|
||||
class="btn btn-sm btn-outline-primary w-100 text-nowrap"
|
||||
style="overflow: hidden;"
|
||||
>
|
||||
{field.label}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{/each}
|
||||
<h6 class="dropdown-header">System</h6>
|
||||
</div>
|
||||
<h6 class="dropdown-header px-0">System</h6>
|
||||
<div class="row">
|
||||
{#each systemFieldsFiltered as field}
|
||||
<div class="dropdown-item">
|
||||
<div class="col-4 px-3 py-1 d-flex align-items-center">
|
||||
<div class="btn-group w-100">
|
||||
<button
|
||||
on:click={(e) => sortAsc(e, field)}
|
||||
title="Sort Ascending"
|
||||
class="button button-icon {field.name == sortParam
|
||||
? 'active'
|
||||
: ''} "
|
||||
class="btn btn-sm {field.name == sortParam
|
||||
? 'btn-primary'
|
||||
: 'btn-outline-primary'} "
|
||||
>
|
||||
<Icon icon="arrow-up-short-wide"/>
|
||||
</button>
|
||||
<button
|
||||
on:click={(e) => sortDesc(e, field)}
|
||||
title="Sort Descending"
|
||||
class="button button-icon {'-' + field.name == sortParam
|
||||
? 'active'
|
||||
: ''} "
|
||||
class="btn btn-sm {'-' + field.name == sortParam
|
||||
? 'btn-primary'
|
||||
: 'btn-outline-primary'} "
|
||||
>
|
||||
<Icon icon="arrow-down-wide-short"/>
|
||||
</button>
|
||||
<button
|
||||
title="Sort Ascending"
|
||||
on:click={(e) => sortAsc(e, field)}
|
||||
class="button"
|
||||
class="btn btn-sm btn-outline-primary w-100 text-nowrap"
|
||||
style="overflow: hidden;"
|
||||
>
|
||||
{field.label}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</Dropdown>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,12 +1,10 @@
|
||||
<script>
|
||||
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 AppliedFilter from "./AppliedFilter.svelte";
|
||||
import { createEventDispatcher, getContext } from "svelte";
|
||||
import Dropdown from "../../common/Dropdown.svelte";
|
||||
import AppliedFilterNotLinked from "./AppliedFilterNotLinked.svelte";
|
||||
import {getContext, createEventDispatcher} from "svelte";
|
||||
|
||||
const channel = getContext("channel");
|
||||
|
||||
@@ -20,7 +18,6 @@
|
||||
export let modalUrl;
|
||||
export let isWritable;
|
||||
export let records;
|
||||
export let graph;
|
||||
export let systemFields = [];
|
||||
// export let visibleFields = [];
|
||||
|
||||
@@ -39,8 +36,9 @@
|
||||
if (inModal) {
|
||||
dispatch("refresh", url);
|
||||
} else {
|
||||
window.location = url;
|
||||
window.location.href = url;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function uploadComplete(e) {
|
||||
@@ -48,8 +46,9 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-filters">
|
||||
<div class="mb-3 d-flex align-items-center justify-content-between">
|
||||
<div class=" d-flex align-items-center">
|
||||
|
||||
<SortFields
|
||||
{schema}
|
||||
{sortParam}
|
||||
@@ -60,6 +59,7 @@
|
||||
on:refresh
|
||||
/>
|
||||
|
||||
|
||||
<FilterFields
|
||||
bind:schema
|
||||
{systemFields}
|
||||
@@ -71,67 +71,78 @@
|
||||
/>
|
||||
|
||||
<form method="GET" on:submit={search}>
|
||||
<input
|
||||
type="search"
|
||||
name="filter[search_regex]"
|
||||
placeholder="Search"
|
||||
class="search"
|
||||
required
|
||||
/>
|
||||
<input type="search" name="filter[search_regex]" placeholder="Search"
|
||||
class="form-control" required>
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div style="display:flex;align-items: center;gap:4px">
|
||||
<div class="d-flex align-items-center ">
|
||||
{#if schema.type === "collection"}
|
||||
{#if !inModal && isWritable}
|
||||
<a
|
||||
href="{channel.lucentUrl}/records/new?schema={schema.name}"
|
||||
class="button"
|
||||
class="btn btn-sm btn-primary"
|
||||
>
|
||||
New Record
|
||||
</a>
|
||||
{/if}
|
||||
{:else }
|
||||
<div>
|
||||
<div class="d-inline-block ms-1">
|
||||
<Uploader {schema} on:uploadComplete={uploadComplete}/>
|
||||
</div>
|
||||
{/if}
|
||||
{#if !inModal}
|
||||
<Dropdown orientation="right">
|
||||
<div slot="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-vertical"/>
|
||||
</div>
|
||||
</button>
|
||||
|
||||
<ul class="dropdown-menu">
|
||||
{#if filter["status_in"] === "trashed"}
|
||||
{#if isWritable}
|
||||
<li>
|
||||
<a
|
||||
class="dropdown-item"
|
||||
href="{channel.lucentUrl}/content/{schema.name}/emptyTrash"
|
||||
>
|
||||
Empty trash
|
||||
</a>
|
||||
</li>
|
||||
{/if}
|
||||
{: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
|
||||
class="dropdown-item"
|
||||
href="{channel.lucentUrl}/content/{schema.name}?filter[status_in]=trashed"
|
||||
>View trashed records</a
|
||||
>
|
||||
<a
|
||||
class="dropdown-item"
|
||||
href="{channel.lucentUrl}/content/{schema.name}?notlinked=*"
|
||||
>View unlinked records</a
|
||||
>
|
||||
</li>
|
||||
{/if}
|
||||
</Dropdown>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="applied-filters">
|
||||
<AppliedFilterNotLinked {inModal} {modalUrl} on:refresh
|
||||
></AppliedFilterNotLinked>
|
||||
|
||||
{#if Object.entries(filter).length > 0}
|
||||
<div class=" d-flex mb-3">
|
||||
{#each Object.entries(filter) as [k, v]}
|
||||
<AppliedFilter
|
||||
{schema}
|
||||
@@ -140,9 +151,10 @@
|
||||
value={v}
|
||||
{inModal}
|
||||
{modalUrl}
|
||||
{graph}
|
||||
{records}
|
||||
on:refresh
|
||||
/>
|
||||
{/each}
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
<script>
|
||||
import { createEventDispatcher, getContext } from "svelte";
|
||||
import Icon from "../../common/Icon.svelte";
|
||||
import Index from "../content/Index.svelte";
|
||||
import axios from "axios";
|
||||
|
||||
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) {
|
||||
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",
|
||||
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>
|
||||
@@ -1,35 +0,0 @@
|
||||
<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>
|
||||
@@ -0,0 +1,54 @@
|
||||
<script>
|
||||
import {createEventDispatcher, getContext} from "svelte";
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
const channel = getContext("channel");
|
||||
let isOpen = false;
|
||||
|
||||
export function open() {
|
||||
isOpen = true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<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">
|
||||
|
||||
|
||||
<button
|
||||
on:click|preventDefault={(e) => (isOpen = false)}
|
||||
type="button"
|
||||
class="btn-close"
|
||||
data-bs-dismiss="modal"
|
||||
aria-label="Close"
|
||||
/>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<style>
|
||||
.modal-dialog {
|
||||
width: auto;
|
||||
max-width: 100%;
|
||||
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
margin: 40px auto;
|
||||
width: auto;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -1,13 +1,9 @@
|
||||
|
||||
|
||||
|
||||
export function sortByField(from, to, edges, fieldName, references) {
|
||||
export function sortByField(from, to, queryRecords, fieldName) {
|
||||
if (from === to) {
|
||||
return edges;
|
||||
return queryRecords;
|
||||
}
|
||||
let referenceIds = references.map(r => r.id);
|
||||
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)) ?? [];
|
||||
let edgesTosort = queryRecords?.filter((qr) => qr.edge.field === fieldName && qr.edge.depth === 1 ) ?? [];
|
||||
let remainingEdge = queryRecords?.filter((qr) => !(qr.edge.field === fieldName && qr.edge.depth === 1)) ?? [];
|
||||
|
||||
edgesTosort = array_move(edgesTosort,from, to);
|
||||
return [...remainingEdge, ...edgesTosort];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script>
|
||||
import Icon from "../../common/Icon.svelte";
|
||||
import { imgurl } from "./imageserver.js";
|
||||
import Icon from "../common/Icon.svelte";
|
||||
import {imgurl} from "../files/imageserver";
|
||||
import {getContext} from "svelte";
|
||||
|
||||
export let record;
|
||||
@@ -29,18 +29,18 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div style="display: flex;align-items: center;gap: 5px;">
|
||||
{#if record}
|
||||
{#if record._file.mime.startsWith("image")}
|
||||
<!-- href={imgurl(record)} -->
|
||||
<a
|
||||
href="{channel.lucentUrl}/records/{record.id}"
|
||||
title={record._file.originalName}
|
||||
title={record._file.path}
|
||||
class="d-flex align-items-center justify-content-center "
|
||||
style="width:{imageSide}px;height:{imageSide}px"
|
||||
>
|
||||
<img
|
||||
class="rounded w-100"
|
||||
src={imgurl(channel, record)}
|
||||
src={imgurl(record)}
|
||||
alt={record._file.path}
|
||||
/>
|
||||
</a>
|
||||
@@ -48,12 +48,12 @@
|
||||
<a
|
||||
href="{channel.lucentUrl}/records/{record.id}"
|
||||
title={record._file.path}
|
||||
class="file-preview-small"
|
||||
class="btn btn-outline-primary btn-sm d-flex align-items-center justify-content-center"
|
||||
style="width:{imageSide}px;height:{imageSide}px"
|
||||
>
|
||||
<Icon icon="file" width={fileSide} height={fileSide}/>
|
||||
<span class="ms-2"
|
||||
>.{record._file.path.split(".").pop().toLowerCase()}</span
|
||||
<span class="ms-2" style="font-size:{fontSize}px"
|
||||
>.{record._file.path.split(".").pop()}</span
|
||||
>
|
||||
</a>
|
||||
{/if}
|
||||
@@ -63,14 +63,6 @@
|
||||
href="{channel.lucentUrl}/records/{record.id}"
|
||||
title={record._file.path}
|
||||
class="preview-file-filename lx-small-text text-decoration-none"
|
||||
>{record._file.path}
|
||||
</a>
|
||||
>{record._file.path}</a
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
img {
|
||||
border-radius: 12px;
|
||||
padding: 4px;
|
||||
}
|
||||
</style>
|
||||
@@ -43,15 +43,16 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<fieldset class="upload-button" disabled={isLoading}>
|
||||
<label class="button primary btn-spinner ">
|
||||
<fieldset disabled={isLoading}>
|
||||
<label class="btn btn-primary btn-sm btn-spinner ">
|
||||
Upload file
|
||||
<span
|
||||
class="spinner-border spinner-border-sm"
|
||||
role="status"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
Upload file
|
||||
|
||||
>
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</span>
|
||||
<input
|
||||
on:input={upload}
|
||||
class="form-control"
|
||||
|
||||
@@ -1,30 +1,15 @@
|
||||
export function imgurl(channel, record) {
|
||||
import {getContext} from "svelte";
|
||||
|
||||
export function imgurl(record) {
|
||||
|
||||
if(record._file.mime === "image/svg+xml"){
|
||||
return fileurl(channel, record);
|
||||
return fileurl(record);
|
||||
}
|
||||
return channel.disks[record._file.disk] + `/thumbs/${record._file.path}`;
|
||||
const channel = getContext("channel")
|
||||
return channel.filesUrl + `/thumbs/${record._file.path}`;
|
||||
}
|
||||
|
||||
export function fileurl(channel, record) {
|
||||
return channel.disks[record._file.disk] + `/${record._file.path}`;
|
||||
}
|
||||
|
||||
export function htmlurl(channel, record, preset) {
|
||||
|
||||
let html = "";
|
||||
let url = fileurl(channel, record)
|
||||
|
||||
if (record._file.width > 0) {
|
||||
let presetUrl = url;
|
||||
if (preset) {
|
||||
presetUrl = channel.disks[record._file.disk] + `/templates/${preset}/${record._file.path}`;
|
||||
}
|
||||
html = `<img src="${presetUrl}" alt="${record._file.path}" />`
|
||||
} else if (record._file.mime === "image/svg+xml") {
|
||||
html = `<img src="${url}" alt="${record._file.path}"/>`
|
||||
} else {
|
||||
html = `<a href="${url}">${record._file.originalName}</a>`
|
||||
}
|
||||
|
||||
return html;
|
||||
export function fileurl(record) {
|
||||
const channel = getContext("channel")
|
||||
return channel.filesUrl + `/${record._file.path}`;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<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>
|
||||
Loaded 100 of 531 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user