fix clone
This commit is contained in:
1 parent
82ee9d2dcf
commit
9a5ad32315
33 files changed
+654
-496
No files matched your search
@@ -15,7 +15,7 @@ use Illuminate\Support\Facades\Auth;
|
|||||||
|
|
||||||
class CloneProjekt
|
class CloneProjekt
|
||||||
{
|
{
|
||||||
public static function clone(Projekte $record)
|
public static function clone(Projekte $original_projekt)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* projektes
|
* projektes
|
||||||
@@ -28,66 +28,68 @@ class CloneProjekt
|
|||||||
* projekt_objekte_im_details
|
* projekt_objekte_im_details
|
||||||
* projekt_objektes
|
* projekt_objektes
|
||||||
*/
|
*/
|
||||||
$NEW = $record->replicate();
|
$neues_projekt = $original_projekt->replicate();
|
||||||
$NEW->cloned_from_id = $record->id;
|
$neues_projekt->cloned_from_id = $original_projekt->id;
|
||||||
$NEW->save();
|
$neues_projekt->save();
|
||||||
|
|
||||||
ProjektUser::create(['user_id' => Auth::user()->id, 'projekte_id' => $NEW->id, 'evaluation_gutachten' => 0]);
|
ProjektUser::create(['user_id' => Auth::user()->id, 'projekte_id' => $neues_projekt->id, 'evaluation_gutachten' => 0]);
|
||||||
|
|
||||||
$res = ProjektObjekte::where('projekte_id', $record->id)->get();
|
$methoden_map = [];
|
||||||
|
$projekt_methoden = ProjektMethode::where('projekte_id', $original_projekt->id)->get();
|
||||||
|
foreach ($projekt_methoden as $projekt_methode) {
|
||||||
|
$new_projekt_methode = $projekt_methode->replicate();
|
||||||
|
$new_projekt_methode->projekte_id = $neues_projekt->id;
|
||||||
|
$new_projekt_methode->cloned_from_id = $projekt_methode->id;
|
||||||
|
$new_projekt_methode->save();
|
||||||
|
$methoden_map[$projekt_methode->id] = $new_projekt_methode->id;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($res as $row) {
|
$projekt_objekte = ProjektObjekte::where('projekte_id', $original_projekt->id)->get();
|
||||||
$new = $row->replicate();
|
foreach ($projekt_objekte as $projekt_objekt) {
|
||||||
$new->projekte_id = $NEW->id;
|
$new_projekt_objekt = $projekt_objekt->replicate();
|
||||||
$new->cloned_from_id = $row->id;
|
$new_projekt_objekt->projekte_id = $neues_projekt->id;
|
||||||
$new->save();
|
$new_projekt_objekt->cloned_from_id = $projekt_objekt->id;
|
||||||
|
$new_projekt_objekt->save();
|
||||||
|
|
||||||
$res2 = ProjektObjekteImDetail::where('projekte_id', $record->id)->where('projekt_objekte_id', $row->id)->get();
|
$projekt_objekt_im_details = ProjektObjekteImDetail::where('projekte_id', $original_projekt->id)->where('projekt_objekte_id', $projekt_objekt->id)->get();
|
||||||
foreach ($res2 as $row2) {
|
foreach ($projekt_objekt_im_details as $projekt_objekt_im_detail) {
|
||||||
$new2 = $row2->replicate();
|
$new_projekt_objekt_im_detail = $projekt_objekt_im_detail->replicate();
|
||||||
$new2->projekte_id = $NEW->id;
|
$new_projekt_objekt_im_detail->projekte_id = $neues_projekt->id;
|
||||||
$new2->projekt_objekte_id = $new->id;
|
$new_projekt_objekt_im_detail->projekt_objekte_id = $new_projekt_objekt->id;
|
||||||
$new2->cloned_from_id = $row2->id;
|
$new_projekt_objekt_im_detail->cloned_from_id = $projekt_objekt_im_detail->id;
|
||||||
$new2->save();
|
$new_projekt_objekt_im_detail->projekt_methode_id = $methoden_map[$projekt_objekt_im_detail->projekt_methode_id];
|
||||||
|
$new_projekt_objekt_im_detail->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$res = ProjektAllgemeinflaechen::where('projekte_id', $record->id)->get();
|
$projekt_allgemeinflaechen = ProjektAllgemeinflaechen::where('projekte_id', $original_projekt->id)->get();
|
||||||
|
foreach ($projekt_allgemeinflaechen as $projekt_allgemeinflaeche) {
|
||||||
|
$new_projekt_allgemeinflaeche = $projekt_allgemeinflaeche->replicate();
|
||||||
|
$new_projekt_allgemeinflaeche->projekte_id = $neues_projekt->id;
|
||||||
|
$new_projekt_allgemeinflaeche->cloned_from_id = $projekt_allgemeinflaeche->id;
|
||||||
|
$new_projekt_allgemeinflaeche->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
$projekt_inhaltsverzeichnise = ProjektInhaltsverzeichnis::where('projekte_id', $original_projekt->id)->get();
|
||||||
|
foreach ($projekt_inhaltsverzeichnise as $projekt_inhaltsverzeichnis) {
|
||||||
|
$new_projekt_inhaltsverzeichnis = $projekt_inhaltsverzeichnis->replicate();
|
||||||
|
$new_projekt_inhaltsverzeichnis->projekte_id = $neues_projekt->id;
|
||||||
|
$new_projekt_inhaltsverzeichnis->cloned_from_id = $projekt_inhaltsverzeichnis->id;
|
||||||
|
$new_projekt_inhaltsverzeichnis->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
$res = ProjektMerkmale::where('projekte_id', $original_projekt->id)->get();
|
||||||
foreach ($res as $row) {
|
foreach ($res as $row) {
|
||||||
$new = $row->replicate();
|
$new = $row->replicate();
|
||||||
$new->projekte_id = $NEW->id;
|
$new->projekte_id = $neues_projekt->id;
|
||||||
$new->cloned_from_id = $row->id;
|
$new->cloned_from_id = $row->id;
|
||||||
$new->save();
|
$new->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
$res = ProjektInhaltsverzeichnis::where('projekte_id', $record->id)->get();
|
$res = ProjektPlatzhalter::where('projekte_id', $original_projekt->id)->get();
|
||||||
foreach ($res as $row) {
|
foreach ($res as $row) {
|
||||||
$new = $row->replicate();
|
$new = $row->replicate();
|
||||||
$new->projekte_id = $NEW->id;
|
$new->projekte_id = $neues_projekt->id;
|
||||||
$new->cloned_from_id = $row->id;
|
|
||||||
$new->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
$res = ProjektMerkmale::where('projekte_id', $record->id)->get();
|
|
||||||
foreach ($res as $row) {
|
|
||||||
$new = $row->replicate();
|
|
||||||
$new->projekte_id = $NEW->id;
|
|
||||||
$new->cloned_from_id = $row->id;
|
|
||||||
$new->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
$res = ProjektMethode::where('projekte_id', $record->id)->get();
|
|
||||||
foreach ($res as $row) {
|
|
||||||
$new = $row->replicate();
|
|
||||||
$new->projekte_id = $NEW->id;
|
|
||||||
$new->cloned_from_id = $row->id;
|
|
||||||
$new->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
$res = ProjektPlatzhalter::where('projekte_id', $record->id)->get();
|
|
||||||
foreach ($res as $row) {
|
|
||||||
$new = $row->replicate();
|
|
||||||
$new->projekte_id = $NEW->id;
|
|
||||||
$new->cloned_from_id = $row->id;
|
$new->cloned_from_id = $row->id;
|
||||||
$new->save();
|
$new->save();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class GutachtenValidation
|
|||||||
->duration(10000)
|
->duration(10000)
|
||||||
->body('Die Tabelle der <b>Allgemeinflächen</b> ist leer.')
|
->body('Die Tabelle der <b>Allgemeinflächen</b> ist leer.')
|
||||||
->send();
|
->send();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
foreach ($res as $value) {
|
foreach ($res as $value) {
|
||||||
@@ -61,7 +61,7 @@ class GutachtenValidation
|
|||||||
->duration(10000)
|
->duration(10000)
|
||||||
->body('Für die Allgemeinfläche <b>'.$value->raumart.'</b> fehlt die Angabe des <u>Geschoßes</u>.')
|
->body('Für die Allgemeinfläche <b>'.$value->raumart.'</b> fehlt die Angabe des <u>Geschoßes</u>.')
|
||||||
->send();
|
->send();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (! $value->raumart) {
|
if (! $value->raumart) {
|
||||||
@@ -83,7 +83,7 @@ class GutachtenValidation
|
|||||||
->duration(10000)
|
->duration(10000)
|
||||||
->body('Für die Allgemeinfläche <b>'.$value->raumart.'</b> fehlt die Angabe der <u>Fläche</u>.')
|
->body('Für die Allgemeinfläche <b>'.$value->raumart.'</b> fehlt die Angabe der <u>Fläche</u>.')
|
||||||
->send();
|
->send();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -95,11 +95,11 @@ class GutachtenValidation
|
|||||||
$collect = [];
|
$collect = [];
|
||||||
foreach ($res as $value) {
|
foreach ($res as $value) {
|
||||||
$res2 = ProjektObjekteImDetail::where('projekte_id', $record->id)->where('projekt_objekte_id', $value->id)->first();
|
$res2 = ProjektObjekteImDetail::where('projekte_id', $record->id)->where('projekt_objekte_id', $value->id)->first();
|
||||||
if(!$res2){
|
if (! $res2) {
|
||||||
$collect[] = $value->top_nummer;
|
$collect[] = $value->top_nummer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($collect){
|
if ($collect) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Fehler bei Verbindungen von Objekt zu Objekt im Detail')
|
->title('Fehler bei Verbindungen von Objekt zu Objekt im Detail')
|
||||||
->body('Für die <u>Objekte</u>:<div class="py-2 text-gray-500">'.implode(', ', $collect).'</div>fehlen die <u>Objekte im Detail</u>. Daten können nochmals hochladen werden.')
|
->body('Für die <u>Objekte</u>:<div class="py-2 text-gray-500">'.implode(', ', $collect).'</div>fehlen die <u>Objekte im Detail</u>. Daten können nochmals hochladen werden.')
|
||||||
@@ -115,14 +115,14 @@ class GutachtenValidation
|
|||||||
* jedes objekt im detail hat eine Verbindung zu einem objekt
|
* jedes objekt im detail hat eine Verbindung zu einem objekt
|
||||||
*/
|
*/
|
||||||
$res = ProjektObjekteImDetail::where('projekte_id', $record->id)->get();
|
$res = ProjektObjekteImDetail::where('projekte_id', $record->id)->get();
|
||||||
$collect=[];
|
$collect = [];
|
||||||
foreach ($res as $value) {
|
foreach ($res as $value) {
|
||||||
$res2 = ProjektObjekte::where('projekte_id', $record->id)->where('id', $value->projekt_objekte_id)->first();
|
$res2 = ProjektObjekte::where('projekte_id', $record->id)->where('id', $value->projekt_objekte_id)->first();
|
||||||
if(!$res2){
|
if (! $res2) {
|
||||||
$collect[] = $value->geschoss .' '.$value->raumart;
|
$collect[] = $value->geschoss.' '.$value->raumart;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($collect){
|
if ($collect) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Fehler bei Verbindungen von Objekt im Detail zu Objekt')
|
->title('Fehler bei Verbindungen von Objekt im Detail zu Objekt')
|
||||||
->body('Für die <u>Objekte im Detail</u>: <div class="py-2 text-gray-500">'.implode(', ', $collect).'</div>fehlt das<u>Objekte</u>. Daten können nochmals hochladen werden.')
|
->body('Für die <u>Objekte im Detail</u>: <div class="py-2 text-gray-500">'.implode(', ', $collect).'</div>fehlt das<u>Objekte</u>. Daten können nochmals hochladen werden.')
|
||||||
@@ -133,23 +133,17 @@ class GutachtenValidation
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ProjektObjekteImDetail + raumart
|
* ProjektObjekteImDetail + raumart
|
||||||
* -> cosistent
|
* -> cosistent
|
||||||
* ProjektMethode + raumart
|
* ProjektMethode + raumart
|
||||||
*/
|
*/
|
||||||
|
$raumarts_ObjekteImDetail = ProjektObjekteImDetail::where('projekte_id', $record->id)->groupBy('raumart')->pluck('raumart')->toArray();
|
||||||
|
$raumarts_Methode = ProjektMethode::where('projekte_id', $record->id)->pluck('raumart')->toArray();
|
||||||
|
|
||||||
$raumarts_oid = ProjektObjekteImDetail::where('projekte_id', $record->id)->groupBy('raumart')->pluck('raumart')->toArray();
|
$extra_oid = array_diff($raumarts_ObjekteImDetail, $raumarts_Methode);
|
||||||
$raumarts_meth = ProjektMethode::where('projekte_id', $record->id)->pluck('raumart')->toArray();
|
$extra_meth = array_diff($raumarts_Methode, $raumarts_ObjekteImDetail);
|
||||||
|
|
||||||
|
|
||||||
$extra_oid = array_diff($raumarts_oid, $raumarts_meth);
|
|
||||||
$extra_meth = array_diff($raumarts_meth, $raumarts_oid);
|
|
||||||
|
|
||||||
// dd($extra_oid, $raumarts_meth);
|
|
||||||
|
|
||||||
if ($extra_oid) {
|
if ($extra_oid) {
|
||||||
$titel = \count($extra_oid) == 1 ? 'Für diese "Raumart" aus "Objekte im Detail" ist keine "Raum Methode" definiert' : 'Für diese "Raumarten" aus "Objekte im Detail" sind keine "Raum Methoden" definiert';
|
$titel = \count($extra_oid) == 1 ? 'Für diese "Raumart" aus "Objekte im Detail" ist keine "Raum Methode" definiert' : 'Für diese "Raumarten" aus "Objekte im Detail" sind keine "Raum Methoden" definiert';
|
||||||
@@ -171,7 +165,7 @@ class GutachtenValidation
|
|||||||
->icon('heroicon-o-exclamation-triangle')
|
->icon('heroicon-o-exclamation-triangle')
|
||||||
->duration(10000)
|
->duration(10000)
|
||||||
->danger()
|
->danger()
|
||||||
->body(implode('<br>', $extra_oid))
|
->body(implode('<br>', $extra_meth))
|
||||||
->send();
|
->send();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -254,7 +248,7 @@ class GutachtenValidation
|
|||||||
->duration(10000)
|
->duration(10000)
|
||||||
->body('Für den Raum mit der ID <b>'.$value->id.'</b> fehlt die Angabe der <u>Top Nummer</u>.')
|
->body('Für den Raum mit der ID <b>'.$value->id.'</b> fehlt die Angabe der <u>Top Nummer</u>.')
|
||||||
->send();
|
->send();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (! $value->projektobjekteimdetail->first()->raumart) {
|
if (! $value->projektobjekteimdetail->first()->raumart) {
|
||||||
@@ -333,7 +327,7 @@ class GutachtenValidation
|
|||||||
->body('Inhaltsverzeichnis fehlt!')
|
->body('Inhaltsverzeichnis fehlt!')
|
||||||
->duration(10000)
|
->duration(10000)
|
||||||
->send();
|
->send();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,11 +7,14 @@ use App\Actions\Validation\GutachtenValidation;
|
|||||||
use App\Filament\Resources\Projektes\ProjekteResource;
|
use App\Filament\Resources\Projektes\ProjekteResource;
|
||||||
use App\Models\Konto;
|
use App\Models\Konto;
|
||||||
use App\Models\Projekte;
|
use App\Models\Projekte;
|
||||||
|
use App\Models\ProjektMethode;
|
||||||
|
use App\Models\ProjektObjekteImDetail;
|
||||||
use App\Traits\HasBackUrl;
|
use App\Traits\HasBackUrl;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Filament\Actions\Action;
|
use Filament\Actions\Action;
|
||||||
use Filament\Actions\ActionGroup;
|
use Filament\Actions\ActionGroup;
|
||||||
use Filament\Actions\DeleteAction;
|
use Filament\Actions\DeleteAction;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
use Filament\Notifications\Notification;
|
use Filament\Notifications\Notification;
|
||||||
use Filament\Resources\Pages\EditRecord;
|
use Filament\Resources\Pages\EditRecord;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
@@ -151,17 +154,37 @@ class EditProjekte extends EditRecord
|
|||||||
GutachtenValidation::run($record);
|
GutachtenValidation::run($record);
|
||||||
$this->record->refresh();
|
$this->record->refresh();
|
||||||
}),
|
}),
|
||||||
|
DeleteAction::make()->icon('heroicon-o-trash')
|
||||||
|
->label('Projekt löschen')
|
||||||
|
->modalDescription('Möchten Sie dieses Projekt wirklich löschen? Die Daten werden unwiderbringlich gelöscht, dieser Vorgang kann nicht rückgängig gemacht werden.')
|
||||||
|
->requiresConfirmation(),
|
||||||
|
Action::make('fix_cloned_method_id')
|
||||||
|
->label('Fix cloned Method Id')
|
||||||
|
->tooltip('Visible only by me')
|
||||||
|
->visible(fn () => Auth::user()->id == 1)
|
||||||
|
->icon('phosphor-arrow-fat-line-right-fill')
|
||||||
|
->modalIcon('phosphor-arrow-fat-line-right-fill')
|
||||||
|
->schema([
|
||||||
|
Select::make('authorId')
|
||||||
|
->label('Author')
|
||||||
|
->options(Projekte::query()->pluck('interner_name', 'id'))
|
||||||
|
->required(),
|
||||||
|
])->action(function (array $data, Projekte $record): void {
|
||||||
|
$res = ProjektObjekteImDetail::where('projekte_id', 15)->get();
|
||||||
|
foreach ($res as $row) {
|
||||||
|
$projekt_methode_id = ProjektMethode::where('cloned_from_id', $row->projekt_methode_id)->value('id');
|
||||||
|
ProjektObjekteImDetail::where('id', $row->id)->update(['projekt_methode_id' => $projekt_methode_id]);
|
||||||
|
}
|
||||||
|
}),
|
||||||
Action::make('reparieren')
|
Action::make('reparieren')
|
||||||
->color('success')
|
|
||||||
->label('Daten reparieren ..')
|
->label('Daten reparieren ..')
|
||||||
|
->tooltip('Visible only by me')
|
||||||
|
->visible(fn () => Auth::user()->id == 1)
|
||||||
->modalIcon('phosphor-arrow-fat-line-right-fill')
|
->modalIcon('phosphor-arrow-fat-line-right-fill')
|
||||||
->modalDescription(self::reparierenText())
|
->modalDescription(self::reparierenText())
|
||||||
// ->hidden(fn ($record): bool => ! $record->cloned_from_id)
|
// ->hidden(fn ($record): bool => ! $record->cloned_from_id)
|
||||||
->action(fn ($record) => Reparieren::run($record))
|
->action(fn ($record) => Reparieren::run($record))
|
||||||
->icon('phosphor-arrow-fat-line-right-fill'),
|
->icon('phosphor-arrow-fat-line-right-fill'),
|
||||||
DeleteAction::make()->icon('heroicon-o-trash')
|
|
||||||
->label('Projekt löschen')
|
|
||||||
->modalDescription('Möchten Sie dieses Projekt wirklich löschen? Die Daten werden unwiderbringlich gelöscht, dieser Vorgang kann nicht rückgängig gemacht werden.'),
|
|
||||||
])->label('Admin')
|
])->label('Admin')
|
||||||
->icon('phosphor-user-circle')
|
->icon('phosphor-user-circle')
|
||||||
->button(),
|
->button(),
|
||||||
|
|||||||
@@ -272,7 +272,6 @@ class ProjektObjekteRelationManager extends RelationManager
|
|||||||
return Orientierung::whereIn('id', $res)->orderBy('id')->pluck('name', 'id');
|
return Orientierung::whereIn('id', $res)->orderBy('id')->pluck('name', 'id');
|
||||||
}),
|
}),
|
||||||
TernaryFilter::make('nicht_in_orientierung')
|
TernaryFilter::make('nicht_in_orientierung')
|
||||||
->default(0)
|
|
||||||
->label('"Nicht in Orientierung" anzeigen'),
|
->label('"Nicht in Orientierung" anzeigen'),
|
||||||
], FiltersLayout::AboveContent)
|
], FiltersLayout::AboveContent)
|
||||||
->deferFilters(false)
|
->deferFilters(false)
|
||||||
|
|||||||
@@ -4,6 +4,15 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property int $id
|
||||||
|
* @property int $projekte_id
|
||||||
|
* @property int $cloned_from_id
|
||||||
|
* @property int $added_manuel
|
||||||
|
* @property string $geschoss
|
||||||
|
* @property string $raumart
|
||||||
|
* @property float $flaeche
|
||||||
|
*/
|
||||||
class ProjektAllgemeinflaechen extends Model
|
class ProjektAllgemeinflaechen extends Model
|
||||||
{
|
{
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
|
|||||||
@@ -4,6 +4,27 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property int $id
|
||||||
|
* @property int $projekte_id
|
||||||
|
* @property int $cloned_from_id
|
||||||
|
* @property int $added_manuel
|
||||||
|
* @property int $inhaltselement_id
|
||||||
|
* @property int $inhaltsverzeichnis_id
|
||||||
|
* @property int $textblock_id
|
||||||
|
* @property int $konto_textblock_id
|
||||||
|
* @property int $sort
|
||||||
|
* @property float $ordnungszahl
|
||||||
|
* @property string $name
|
||||||
|
* @property string $part
|
||||||
|
* @property int $ueberschrift_verbergen
|
||||||
|
* @property int $seite
|
||||||
|
* @property int $neue_seite
|
||||||
|
* @property int $no_edit
|
||||||
|
* @property string $textblock_name
|
||||||
|
* @property string $textblock
|
||||||
|
* @property string $textblock2
|
||||||
|
*/
|
||||||
class ProjektInhaltsverzeichnis extends Model
|
class ProjektInhaltsverzeichnis extends Model
|
||||||
{
|
{
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
|
|||||||
@@ -4,6 +4,15 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property int $id
|
||||||
|
* @property int $projekte_id
|
||||||
|
* @property int $projekt_objekte_id
|
||||||
|
* @property int $cloned_from_id
|
||||||
|
* @property int $added_manuel
|
||||||
|
* @property string $code
|
||||||
|
* @property string $name
|
||||||
|
*/
|
||||||
class ProjektMerkmale extends Model
|
class ProjektMerkmale extends Model
|
||||||
{
|
{
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
@@ -14,7 +23,7 @@ class ProjektMerkmale extends Model
|
|||||||
'name',
|
'name',
|
||||||
];
|
];
|
||||||
|
|
||||||
public static function getfreecode($projekte_id)
|
public static function getfreecode(int $projekte_id)
|
||||||
{
|
{
|
||||||
|
|
||||||
$possible = range('a', 'j');
|
$possible = range('a', 'j');
|
||||||
|
|||||||
@@ -4,6 +4,15 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property int $id
|
||||||
|
* @property int $projekte_id
|
||||||
|
* @property int $cloned_from_id
|
||||||
|
* @property int $methode_id
|
||||||
|
* @property int $aufstellung_id
|
||||||
|
* @property string $raumart
|
||||||
|
* @property float $faktor
|
||||||
|
*/
|
||||||
class ProjektMethode extends Model
|
class ProjektMethode extends Model
|
||||||
{
|
{
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
@@ -11,7 +20,6 @@ class ProjektMethode extends Model
|
|||||||
'cloned_from_id',
|
'cloned_from_id',
|
||||||
'methode_id',
|
'methode_id',
|
||||||
'aufstellung_id',
|
'aufstellung_id',
|
||||||
'geschoss',
|
|
||||||
'raumart',
|
'raumart',
|
||||||
'faktor',
|
'faktor',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -6,6 +6,28 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property int $id
|
||||||
|
* @property int $projekte_id
|
||||||
|
* @property int $cloned_from_id
|
||||||
|
* @property int $added_manuel
|
||||||
|
* @property int $orientierung_id
|
||||||
|
* @property int $nicht_in_orientierung
|
||||||
|
* @property string $top_nummer
|
||||||
|
* @property string $type
|
||||||
|
* @property string $raumart
|
||||||
|
* @property string $nutzwert
|
||||||
|
* @property string $a
|
||||||
|
* @property string $b
|
||||||
|
* @property string $c
|
||||||
|
* @property string $d
|
||||||
|
* @property string $e
|
||||||
|
* @property string $f
|
||||||
|
* @property string $g
|
||||||
|
* @property string $h
|
||||||
|
* @property string $i
|
||||||
|
* @property string $j
|
||||||
|
*/
|
||||||
class ProjektObjekte extends Model
|
class ProjektObjekte extends Model
|
||||||
{
|
{
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
@@ -18,7 +40,6 @@ class ProjektObjekte extends Model
|
|||||||
'type',
|
'type',
|
||||||
'raumart',
|
'raumart',
|
||||||
'nutzwert',
|
'nutzwert',
|
||||||
'added_manuel',
|
|
||||||
'a',
|
'a',
|
||||||
'b',
|
'b',
|
||||||
'c',
|
'c',
|
||||||
|
|||||||
@@ -4,11 +4,26 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property int $id
|
||||||
|
* @property int $projekte_id
|
||||||
|
* @property int $projekt_objekte_id
|
||||||
|
* @property int $projekt_methode_id
|
||||||
|
* @property int $cloned_from_id
|
||||||
|
* @property int $added_manuel
|
||||||
|
* @property int $methode_id
|
||||||
|
* @property int $top_nummer
|
||||||
|
* @property string $geschoss
|
||||||
|
* @property string $raumart
|
||||||
|
* @property float $flaeche
|
||||||
|
* @property int $nutzwert
|
||||||
|
*/
|
||||||
class ProjektObjekteImDetail extends Model
|
class ProjektObjekteImDetail extends Model
|
||||||
{
|
{
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'projekte_id',
|
'projekte_id',
|
||||||
'projekt_objekte_id',
|
'projekt_objekte_id',
|
||||||
|
'projekt_methode_id',
|
||||||
'cloned_from_id',
|
'cloned_from_id',
|
||||||
'added_manuel',
|
'added_manuel',
|
||||||
'methode_id',
|
'methode_id',
|
||||||
|
|||||||
@@ -4,6 +4,14 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property int $id
|
||||||
|
* @property int $projekte_id
|
||||||
|
* @property int $cloned_from_id
|
||||||
|
* @property string $platzhalter
|
||||||
|
* @property string $platzhaltertext
|
||||||
|
* @property int $controll
|
||||||
|
*/
|
||||||
class ProjektPlatzhalter extends Model
|
class ProjektPlatzhalter extends Model
|
||||||
{
|
{
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
|
|||||||
@@ -5,6 +5,24 @@ namespace App\Models;
|
|||||||
use App\Models\Scopes\KontoScope;
|
use App\Models\Scopes\KontoScope;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property int $id
|
||||||
|
* @property int $cloned_from_id
|
||||||
|
* @property int $konto_id
|
||||||
|
* @property int $auftraggeber_id
|
||||||
|
* @property string $interner_name
|
||||||
|
* @property string $offizieller_name
|
||||||
|
* @property string $ort
|
||||||
|
* @property string $beschreibung
|
||||||
|
* @property string $erstellung
|
||||||
|
* @property string $status
|
||||||
|
* @property int $projekt_farben_verwenden
|
||||||
|
* @property string $deckblatt_bg
|
||||||
|
* @property string $schmuckfarbe_header
|
||||||
|
* @property string $farbe_borders
|
||||||
|
* @property int $evaluation_gutachten
|
||||||
|
* @property int $pdf_nutzwerte_tabellen_umbruch
|
||||||
|
*/
|
||||||
class Projekte extends Model
|
class Projekte extends Model
|
||||||
{
|
{
|
||||||
protected $primaryKey = 'id';
|
protected $primaryKey = 'id';
|
||||||
|
|||||||
+11
-1
@@ -18,9 +18,19 @@ use Illuminate\Foundation\Auth\User as Authenticatable;
|
|||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
use Spatie\Permission\Traits\HasRoles;
|
use Spatie\Permission\Traits\HasRoles;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property int $id
|
||||||
|
* @property int $konto_id
|
||||||
|
* @property string $gender
|
||||||
|
* @property string $name
|
||||||
|
* @property string $email
|
||||||
|
* @property string $password
|
||||||
|
* @property int $agb_akzeptiert
|
||||||
|
* @property int $app_verified_at
|
||||||
|
*/
|
||||||
class User extends Authenticatable implements FilamentUser, HasAppAuthentication, HasAppAuthenticationRecovery, HasEmailAuthentication, MustVerifyEmail
|
class User extends Authenticatable implements FilamentUser, HasAppAuthentication, HasAppAuthenticationRecovery, HasEmailAuthentication, MustVerifyEmail
|
||||||
{
|
{
|
||||||
/** @use HasFactory<\Database\Factories\UserFactory> */
|
/** @use HasFactory<UserFactory> */
|
||||||
use HasFactory, HasRoles, Notifiable, SoftDeletes;
|
use HasFactory, HasRoles, Notifiable, SoftDeletes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Generated
+341
-320
File diff suppressed because it is too large.
Load diff
@@ -1,2 +1,2 @@
|
|||||||
/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
||||||
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-tracking:initial;--tw-duration:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-outline-style:solid;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-ease:initial;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-x-reverse:0;--tw-content:"";--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-mono:var(--mono-font-family), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-sky-400:oklch(74.6% .16 232.661);--color-gray-100:var(--gray-100);--color-gray-200:var(--gray-200);--color-gray-300:var(--gray-300);--color-gray-400:var(--gray-400);--color-gray-500:var(--gray-500);--color-gray-600:var(--gray-600);--color-gray-700:var(--gray-700);--color-gray-900:var(--gray-900);--color-gray-950:var(--gray-950);--color-black:#000;--color-white:#fff;--spacing:.25rem;--breakpoint-sm:40rem;--breakpoint-md:48rem;--breakpoint-lg:64rem;--breakpoint-xl:80rem;--breakpoint-2xl:96rem;--container-3xs:16rem;--container-2xs:18rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-thin:100;--font-weight-extralight:200;--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--tracking-tighter:-.05em;--tracking-tight:-.025em;--leading-loose:2;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-family), ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--default-mono-font-family:var(--mono-font-family), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-primary-400:var(--primary-400)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}imgLine truncated
|
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-tracking:initial;--tw-duration:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-outline-style:solid;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-ease:initial;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-x-reverse:0;--tw-content:"";--tw-space-x-reverse:0;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial}}}@layer theme{:root,:host{--font-mono:var(--mono-font-family), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-sky-400:oklch(74.6% .16 232.661);--color-gray-100:var(--gray-100);--color-gray-200:var(--gray-200);--color-gray-300:var(--gray-300);--color-gray-400:var(--gray-400);--color-gray-500:var(--gray-500);--color-gray-600:var(--gray-600);--color-gray-700:var(--gray-700);--color-gray-900:var(--gray-900);--color-gray-950:var(--gray-950);--color-black:#000;--color-white:#fff;--spacing:.25rem;--breakpoint-sm:40rem;--breakpoint-md:48rem;--breakpoint-lg:64rem;--breakpoint-xl:80rem;--breakpoint-2xl:96rem;--container-3xs:16rem;--container-2xs:18rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-thin:100;--font-weight-extralight:200;--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--tracking-tighter:-.05em;--tracking-tight:-.025em;--leading-loose:2;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-family), ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--default-mono-font-family:var(--mono-font-family), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-primary-400:var(--primary-400)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-coLine truncated
|
||||||
@@ -1 +1 @@
|
|||||||
@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-cyrillic-ext-wght-normal-IYF56FF6.woff2") format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-cyrillic-wght-normal-JEOLYBOO.woff2") format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-greek-ext-wght-normal-EOVOK2B5.woff2") format("woff2-variations");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-greek-wght-normal-IRE366VL.woff2") format("woff2-variations");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-vietnamese-wght-normal-CE5GGD3W.woff2") format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-latin-ext-wght-normal-HA22NDSG.woff2") format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-latin-wght-normal-NRMW37G5.woff2") format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
|
@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-cyrillic-ext-wght-normal-SP7Z6XGK.woff2") format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-cyrillic-wght-normal-DR6K5BQD.woff2") format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-greek-ext-wght-normal-A2J6H3EX.woff2") format("woff2-variations");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-greek-wght-normal-ZABHMKQG.woff2") format("woff2-variations");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-vietnamese-wght-normal-VWEHJHBA.woff2") format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-latin-ext-wght-normal-ZIT2UBIY.woff2") format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-latin-wght-normal-DIHYUR35.woff2") format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
|||||||
(()=>{var re=Object.create,K=Object.defineProperty,ne=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty,oe=Object.getOwnPropertyNames,ae=Object.getOwnPropertyDescriptor,se=t=>K(t,"__esModule",{value:!0}),le=(t,n)=>()=>(n||(n={exports:{}},t(n.exports,n)),n.exports),fe=(t,n,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of oe(n))!ie.call(t,a)&&a!=="default"&&K(t,a,{get:()=>n[a],enumerable:!(i=ae(n,a))||i.enumerable});return t},ue=t=>fe(se(K(t!=null?re(ne(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),ce=le((t,n)=>{(function(i,a,w){if(!i)return;for(var f={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},v={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},m={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},x={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},M,y=1;y<20;++y)f[111+y]="f"+y;for(y=0;y<=9;++y)f[y+96]=y.toString();function C(e,r,s){if(e.addEventListener){e.addEventListener(r,s,!1);return}e.attachEvent("on"+r,s)}function U(e){if(e.type=="keypress"){var r=String.fromCharCode(e.which);return e.shiftKey||(r=r.toLowerCase()),r}return f[e.which]?f[e.which]:v[e.which]?v[e.which]:String.fromCharCode(e.which).toLowerCase()}function F(e,r){return e.sort().join(",")===r.sort().join(",")}function V(e){var r=[];return e.shiftKey&&r.push("shift"),e.altKey&&r.push("alt"),e.ctrlKey&&r.push("ctrl"),e.metaKey&&r.push("meta"),r}function H(e){if(e.preventDefault){e.preventDefault();return}e.returnValue=!1}function B(e){if(e.stopPropagation){e.stopPropagation();return}e.cancelBubble=!0}function P(e){return e=="shift"||e=="ctrl"||e=="alt"||e=="meta"}function X(){if(!M){M={};for(var e in f)e>95&&e<112||f.hasOwnProperty(e)&&(M[f[e]]=e)}return M}function Y(e,r,s){return s||(s=X()[e]?"keydown":"keypress"),s=="keypress"&&r.length&&(s="keydown"),s}function Q(e){return e==="+"?["+"]:(e=e.replace(/\+{2}/g,"+plus"),e.split("+"))}function G(e,r){var s,h,k,S=[];for(s=Q(e),k=0;k<s.length;++k)h=s[k],x[h]&&(h=x[h]),r&&r!="keypress"&&m[h]&&(h=m[h],S.push("shift")),P(h)&&S.push(h);return r=Y(h,S,r),{key:h,modifiers:S,action:r}}function R(e,r){return e===null||e===a?!1:e===r?!0:R(e.parentNode,r)}function g(e){var r=this;if(e=e||a,!(r instanceof g))return new g(e);r.target=e,r._callbacks={},r._directMap={};var s={},h,k=!1,S=!1,E=!1;function L(o){o=o||{};var u=!1,p;for(p in s){if(o[p]){u=!0;continue}s[p]=0}u||(E=!1)}function I(o,u,p,l,d,b){var c,_,A=[],O=p.type;if(!r._callbacks[o])return[];for(O=="keyup"&&P(o)&&(u=[o]),c=0;c<r._callbacks[o].length;++c)if(_=r._callbacks[o][c],!(!l&&_.seq&&s[_.seq]!=_.level)&&O==_.action&&(O=="keypress"&&!p.metaKey&&!p.ctrlKey||F(u,_.modifiers))){var ee=!l&&_.combo==d,te=l&&_.seq==l&&_.level==b;(ee||te)&&r._callbacks[o].splice(c,1),A.push(_)}return A}function D(o,u,p,l){r.stopCallback(u,u.target||u.srcElement,p,l)||o(u,p)===!1&&(H(u),B(u))}r._handleKey=function(o,u,p){var l=I(o,u,p),d,b={},c=0,_=!1;for(d=0;d<l.length;++d)l[d].seq&&(c=Math.max(c,l[d].level));for(d=0;d<l.length;++d){if(l[d].seq){if(l[d].level!=c)continue;_=!0,b[l[d].seq]=1,D(l[d].callback,p,l[d].combo,l[d].seq);continue}_||D(l[d].callback,p,l[d].combo)}var A=p.type=="keypress"&&S;p.type==E&&!P(o)&&!A&&L(b),S=_&&p.type=="keydown"};function q(o){typeof o.which!="number"&&(o.which=o.keyCode);var u=U(o);if(u){if(o.type=="keyup"&&k===u){k=!1;return}r.handleKey(u,V(o),o)}}function Z(){clearTimeout(h),h=setTimeout(L,1e3)}function $(o,u,p,l){s[o]=0;function d(O){return function(){E=O,++s[o],Z()}}function b(O){D(p,O,o),l!=="keyup"&&(k=U(O)),setTimeout(L,10)}for(var c=0;c<u.length;++c){var _=c+1===u.length,A=_?b:d(l||G(u[c+1]).action);z(u[c],A,l,o,c)}}function z(o,u,p,l,d){r._directMap[o+":"+p]=u,o=o.replace(/\s+/g," ");var b=o.split(" "),c;if(b.length>1){$(o,b,u,p);return}c=G(o,p),r._callbacks[c.key]=r._callbacks[c.key]||[],I(c.key,c.modifiers,{type:c.action},l,o,d),r._callbacks[c.key][l?"unshift":"push"]({callback:u,modifiers:c.modifiers,action:c.action,seq:l,level:d,combo:o})}r._bindMultiple=function(o,u,p){for(var l=0;l<o.length;++l)z(o[l],u,p)},C(e,"keypress",q),C(e,"keydown",q),C(e,"keyup",q)}g.prototype.bind=function(e,r,s){var h=this;return e=e instanceof Array?e:[e],h._bindMultiple.call(h,e,r,s),h},g.prototype.unbind=function(e,r){var s=this;return s.bind.call(s,e,function(){},r)},g.prototype.trigger=function(e,r){var s=this;return s._directMap[e+":"+r]&&s._directMap[e+":"+r]({},e),s},g.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},g.prototype.stopCallback=function(e,r){var s=this;if((" "+Line truncated
|
(()=>{var re=Object.create,N=Object.defineProperty,ne=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty,oe=Object.getOwnPropertyNames,se=Object.getOwnPropertyDescriptor,ae=t=>N(t,"__esModule",{value:!0}),le=(t,n)=>()=>(n||(n={exports:{}},t(n.exports,n)),n.exports),fe=(t,n,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of oe(n))!ie.call(t,s)&&s!=="default"&&N(t,s,{get:()=>n[s],enumerable:!(i=se(n,s))||i.enumerable});return t},ue=t=>fe(ae(N(t!=null?re(ne(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),ce=le((t,n)=>{(function(i,s,w){if(!i)return;for(var u={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},m={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},v={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},k={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},M,y=1;y<20;++y)u[111+y]="f"+y;for(y=0;y<=9;++y)u[y+96]=y.toString();function P(e,r,a){if(e.addEventListener){e.addEventListener(r,a,!1);return}e.attachEvent("on"+r,a)}function x(e){if(e.type=="keypress"){var r=String.fromCharCode(e.which);return e.shiftKey||(r=r.toLowerCase()),r}return u[e.which]?u[e.which]:m[e.which]?m[e.which]:String.fromCharCode(e.which).toLowerCase()}function F(e,r){return e.sort().join(",")===r.sort().join(",")}function V(e){var r=[];return e.shiftKey&&r.push("shift"),e.altKey&&r.push("alt"),e.ctrlKey&&r.push("ctrl"),e.metaKey&&r.push("meta"),r}function H(e){if(e.preventDefault){e.preventDefault();return}e.returnValue=!1}function B(e){if(e.stopPropagation){e.stopPropagation();return}e.cancelBubble=!0}function E(e){return e=="shift"||e=="ctrl"||e=="alt"||e=="meta"}function X(){if(!M){M={};for(var e in u)e>95&&e<112||u.hasOwnProperty(e)&&(M[u[e]]=e)}return M}function Y(e,r,a){return a||(a=X()[e]?"keydown":"keypress"),a=="keypress"&&r.length&&(a="keydown"),a}function Q(e){return e==="+"?["+"]:(e=e.replace(/\+{2}/g,"+plus"),e.split("+"))}function G(e,r){var a,h,O,A=[];for(a=Q(e),O=0;O<a.length;++O)h=a[O],k[h]&&(h=k[h]),r&&r!="keypress"&&v[h]&&(h=v[h],A.push("shift")),E(h)&&A.push(h);return r=Y(h,A,r),{key:h,modifiers:A,action:r}}function R(e,r){return e===null||e===s?!1:e===r?!0:R(e.parentNode,r)}function g(e){var r=this;if(e=e||s,!(r instanceof g))return new g(e);r.target=e,r._callbacks={},r._directMap={};var a={},h,O=!1,A=!1,L=!1;function D(o){o=o||{};var f=!1,p;for(p in a){if(o[p]){f=!0;continue}a[p]=0}f||(L=!1)}function I(o,f,p,l,d,b){var c,_,C=[],S=p.type;if(!r._callbacks[o])return[];for(S=="keyup"&&E(o)&&(f=[o]),c=0;c<r._callbacks[o].length;++c)if(_=r._callbacks[o][c],!(!l&&_.seq&&a[_.seq]!=_.level)&&S==_.action&&(S=="keypress"&&!p.metaKey&&!p.ctrlKey||F(f,_.modifiers))){var ee=!l&&_.combo==d,te=l&&_.seq==l&&_.level==b;(ee||te)&&r._callbacks[o].splice(c,1),C.push(_)}return C}function q(o,f,p,l){r.stopCallback(f,f.target||f.srcElement,p,l)||o(f,p)===!1&&(H(f),B(f))}r._handleKey=function(o,f,p){var l=I(o,f,p),d,b={},c=0,_=!1;for(d=0;d<l.length;++d)l[d].seq&&(c=Math.max(c,l[d].level));for(d=0;d<l.length;++d){if(l[d].seq){if(l[d].level!=c)continue;_=!0,b[l[d].seq]=1,q(l[d].callback,p,l[d].combo,l[d].seq);continue}_||q(l[d].callback,p,l[d].combo)}var C=p.type=="keypress"&&A;p.type==L&&!E(o)&&!C&&D(b),A=_&&p.type=="keydown"};function T(o){typeof o.which!="number"&&(o.which=o.keyCode);var f=x(o);if(f){if(o.type=="keyup"&&O===f){O=!1;return}r.handleKey(f,V(o),o)}}function Z(){clearTimeout(h),h=setTimeout(D,1e3)}function $(o,f,p,l){a[o]=0;function d(S){return function(){L=S,++a[o],Z()}}function b(S){q(p,S,o),l!=="keyup"&&(O=x(S)),setTimeout(D,10)}for(var c=0;c<f.length;++c){var _=c+1===f.length,C=_?b:d(l||G(f[c+1]).action);z(f[c],C,l,o,c)}}function z(o,f,p,l,d){r._directMap[o+":"+p]=f,o=o.replace(/\s+/g," ");var b=o.split(" "),c;if(b.length>1){$(o,b,f,p);return}c=G(o,p),r._callbacks[c.key]=r._callbacks[c.key]||[],I(c.key,c.modifiers,{type:c.action},l,o,d),r._callbacks[c.key][l?"unshift":"push"]({callback:f,modifiers:c.modifiers,action:c.action,seq:l,level:d,combo:o})}r._bindMultiple=function(o,f,p){for(var l=0;l<o.length;++l)z(o[l],f,p)},P(e,"keypress",T),P(e,"keydown",T),P(e,"keyup",T)}g.prototype.bind=function(e,r,a){var h=this;return e=e instanceof Array?e:[e],h._bindMultiple.call(h,e,r,a),h},g.prototype.unbind=function(e,r){var a=this;return a.bind.call(a,e,function(){},r)},g.prototype.trigger=function(e,r){var a=this;return a._directMap[e+":"+r]&&a._directMap[e+":"+r]({},e),a},g.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},g.prototype.stopCallback=function(e,r){var a=this;if((" "+Line truncated
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
var wr=Object.defineProperty;var Lr=(e,t)=>{for(var i in t)wr(e,i,{get:t[i],enumerable:!0})};var oa={};Lr(oa,{FileOrigin:()=>Nt,FileStatus:()=>vt,OptionTypes:()=>Hi,Status:()=>ol,create:()=>ht,destroy:()=>bt,find:()=>ji,getOptions:()=>Yi,parse:()=>Wi,registerPlugin:()=>xe,setOptions:()=>Bt,supported:()=>Ui});var Mr=e=>e instanceof HTMLElement,Ar=(e,t=[],i=[])=>{let a={...e},n=[],l=[],o=()=>({...a}),r=()=>{let g=[...n];return n.length=0,g},s=()=>{let g=[...l];l.length=0,g.forEach(({type:f,data:b})=>{p(f,b)})},p=(g,f,b)=>{if(b&&!document.hidden){l.push({type:g,data:f});return}u[g]&&u[g](f),n.push({type:g,data:f})},c=(g,...f)=>m[g]?m[g](...f):null,d={getState:o,processActionQueue:r,processDispatchQueue:s,dispatch:p,query:c},m={};t.forEach(g=>{m={...g(a),...m}});let u={};return i.forEach(g=>{u={...g(p,c,a),...u}}),d},Pr=(e,t,i)=>{if(typeof i=="function"){e[t]=i;return}Object.defineProperty(e,t,{...i})},te=(e,t)=>{for(let i in e)e.hasOwnProperty(i)&&t(i,e[i])},je=e=>{let t={};return te(e,i=>{Pr(t,i,e[i])}),t},ce=(e,t,i=null)=>{if(i===null)return e.getAttribute(t)||e.hasAttribute(t);e.setAttribute(t,i)},zr="http://www.w3.org/2000/svg",Fr=["svg","path"],Fa=e=>Fr.includes(e),oi=(e,t,i={})=>{typeof t=="object"&&(i=t,t=null);let a=Fa(e)?document.createElementNS(zr,e):document.createElement(e);return t&&(Fa(e)?ce(a,"class",t):a.className=t),te(i,(n,l)=>{ce(a,n,l)}),a},Or=e=>(t,i)=>{typeof i<"u"&&e.children[i]?e.insertBefore(t,e.children[i]):e.appendChild(t)},Dr=(e,t)=>(i,a)=>(typeof a<"u"?t.splice(a,0,i):t.push(i),i),Cr=(e,t)=>i=>(t.splice(t.indexOf(i),1),i.element.parentNode&&e.removeChild(i.element),i),Br=typeof window<"u"&&typeof window.document<"u",Tn=()=>Br,kr=Tn()?oi("svg"):{},Nr="children"in kr?e=>e.children.length:e=>e.childNodes.length,vn=(e,t,i,a)=>{let n=i[0]||e.left,l=i[1]||e.top,o=n+e.width,r=l+e.height*(a[1]||1),s={element:{...e},inner:{left:e.left,top:e.top,right:e.right,bottom:e.bottom},outer:{left:n,top:l,right:o,bottom:r}};return t.filter(p=>!p.isRectIgnored()).map(p=>p.rect).forEach(p=>{Oa(s.inner,{...p.inner}),Oa(s.outer,{...p.outer})}),Da(s.inner),s.outer.bottom+=s.element.marginBottom,s.outer.right+=s.element.marginRight,Da(s.outer),s},Oa=(e,t)=>{t.top+=e.top,t.right+=e.left,t.bottom+=e.top,t.left+=e.left,t.bottom>e.bottom&&(e.bottom=t.bottom),t.right>e.right&&(e.right=t.right)},Da=e=>{e.width=e.right-e.left,e.height=e.bottom-e.top},Ke=e=>typeof e=="number",Vr=(e,t,i,a=.001)=>Math.abs(e-t)<a&&Math.abs(i)<a,Gr=({stiffness:e=.5,damping:t=.75,mass:i=10}={})=>{let a=null,n=null,l=0,o=!1,p=je({interpolate:(c,d)=>{if(o)return;if(!(Ke(a)&&Ke(n))){o=!0,l=0;return}let m=-(n-a)*e;l+=m/i,n+=l,l*=t,Vr(n,a,l)||d?(n=a,l=0,o=!0,p.onupdate(n),p.oncomplete(n)):p.onupdate(n)},target:{set:c=>{if(Ke(c)&&!Ke(n)&&(n=c),a===null&&(a=c,n=c),a=c,n===a||typeof a>"u"){o=!0,l=0,p.onupdate(n),p.oncomplete(n);return}o=!1},get:()=>a},resting:{get:()=>o},onupdate:c=>{},oncomplete:c=>{}});return p};var Ur=e=>e<.5?2*e*e:-1+(4-2*e)*e,Hr=({duration:e=500,easing:t=Ur,delay:i=0}={})=>{let a=null,n,l,o=!0,r=!1,s=null,c=je({interpolate:(d,m)=>{o||s===null||(a===null&&(a=d),!(d-a<i)&&(n=d-a-i,n>=e||m?(n=1,l=r?0:1,c.onupdate(l*s),c.oncomplete(l*s),o=!0):(l=n/e,c.onupdate((n>=0?t(r?1-l:l):0)*s))))},target:{get:()=>r?0:s,set:d=>{if(s===null){s=d,c.onupdate(d),c.oncomplete(d);return}d<s?(s=1,r=!0):(r=!1,s=d),o=!1,a=null}},resting:{get:()=>o},onupdate:d=>{},oncomplete:d=>{}});return c},Ca={spring:Gr,tween:Hr},Wr=(e,t,i)=>{let a=e[t]&&typeof e[t][i]=="object"?e[t][i]:e[t]||e,n=typeof a=="string"?a:a.type,l=typeof a=="object"?{...a}:{};return Ca[n]?Ca[n](l):null},qi=(e,t,i,a=!1)=>{t=Array.isArray(t)?t:[t],t.forEach(n=>{e.forEach(l=>{let o=l,r=()=>i[l],s=p=>i[l]=p;typeof l=="object"&&(o=l.key,r=l.getter||r,s=l.setter||s),!(n[o]&&!a)&&(n[o]={get:r,set:s})})})},jr=({mixinConfig:e,viewProps:t,viewInternalAPI:i,viewExternalAPI:a})=>{let n={...t},l=[];return te(e,(o,r)=>{let s=Wr(r);if(!s)return;s.onupdate=c=>{t[o]=c},s.target=n[o],qi([{key:o,setter:c=>{s.target!==c&&(s.target=c)},getter:()=>t[o]}],[i,a],t,!0),l.push(s)}),{write:o=>{let r=document.hidden,s=!0;return l.forEach(p=>{p.resting||(s=!1),p.interpolate(o,r)}),s},destroy:()=>{}}},Yr=e=>(t,i)=>{e.addEventListener(t,i)},qr=e=>(t,i)=>{e.removeEventListener(t,i)},$r=({mixinConfig:e,viewProps:t,viewInternalAPI:i,viewExternalAPI:a,viewState:n,view:l})=>{let o=[],r=Yr(l.element),s=qr(l.element);return a.on=(p,c)=>{o.push({type:p,fn:c}),r(p,c)},a.off=(p,c)=>{o.splice(o.findIndex(d=>d.type===p&&d.fn===c),1),s(p,c)},{write:()=>!0,destroy:()=>{o.forEach(p=>{s(p.type,p.fn)})}}},Xr=({mixinConfig:e,viewProps:t,viewExternalAPI:i})=>{qi(e,i,t)},ge=e=>e!=null,Kr={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0},Zr=({mixinConfig:e,viewProps:t,viewInternalAPI:i,viewExternalAPI:a,view:n})=>{let l={...t},o={};qi(e,[i,a],t);let r=()=>[t.translateX||0,t.translateY||0],s=()=>[t.scaleX||0,t.scaleY||0],p=()=>n.rect?vn(n.rect,n.childViews,r(),s()):null;return i.Line truncated
|
var wr=Object.defineProperty;var Lr=(e,t)=>{for(var i in t)wr(e,i,{get:t[i],enumerable:!0})};var oa={};Lr(oa,{FileOrigin:()=>Nt,FileStatus:()=>It,OptionTypes:()=>Hi,Status:()=>ol,create:()=>bt,destroy:()=>Et,find:()=>ji,getOptions:()=>Yi,parse:()=>Wi,registerPlugin:()=>Re,setOptions:()=>Bt,supported:()=>Ui});var Mr=e=>e instanceof HTMLElement,Ar=(e,t=[],i=[])=>{let a={...e},n=[],l=[],o=()=>({...a}),r=()=>{let g=[...n];return n.length=0,g},s=()=>{let g=[...l];l.length=0,g.forEach(({type:f,data:b})=>{p(f,b)})},p=(g,f,b)=>{if(b&&!document.hidden){l.push({type:g,data:f});return}u[g]&&u[g](f),n.push({type:g,data:f})},c=(g,...f)=>m[g]?m[g](...f):null,d={getState:o,processActionQueue:r,processDispatchQueue:s,dispatch:p,query:c},m={};t.forEach(g=>{m={...g(a),...m}});let u={};return i.forEach(g=>{u={...g(p,c,a),...u}}),d},Pr=(e,t,i)=>{if(typeof i=="function"){e[t]=i;return}Object.defineProperty(e,t,{...i})},te=(e,t)=>{for(let i in e)e.hasOwnProperty(i)&&t(i,e[i])},Ye=e=>{let t={};return te(e,i=>{Pr(t,i,e[i])}),t},ce=(e,t,i=null)=>{if(i===null)return e.getAttribute(t)||e.hasAttribute(t);e.setAttribute(t,i)},zr="http://www.w3.org/2000/svg",Fr=["svg","path"],Fa=e=>Fr.includes(e),oi=(e,t,i={})=>{typeof t=="object"&&(i=t,t=null);let a=Fa(e)?document.createElementNS(zr,e):document.createElement(e);return t&&(Fa(e)?ce(a,"class",t):a.className=t),te(i,(n,l)=>{ce(a,n,l)}),a},Or=e=>(t,i)=>{typeof i<"u"&&e.children[i]?e.insertBefore(t,e.children[i]):e.appendChild(t)},Dr=(e,t)=>(i,a)=>(typeof a<"u"?t.splice(a,0,i):t.push(i),i),Cr=(e,t)=>i=>(t.splice(t.indexOf(i),1),i.element.parentNode&&e.removeChild(i.element),i),Br=typeof window<"u"&&typeof window.document<"u",Tn=()=>Br,kr=Tn()?oi("svg"):{},Nr="children"in kr?e=>e.children.length:e=>e.childNodes.length,vn=(e,t,i,a)=>{let n=i[0]||e.left,l=i[1]||e.top,o=n+e.width,r=l+e.height*(a[1]||1),s={element:{...e},inner:{left:e.left,top:e.top,right:e.right,bottom:e.bottom},outer:{left:n,top:l,right:o,bottom:r}};return t.filter(p=>!p.isRectIgnored()).map(p=>p.rect).forEach(p=>{Oa(s.inner,{...p.inner}),Oa(s.outer,{...p.outer})}),Da(s.inner),s.outer.bottom+=s.element.marginBottom,s.outer.right+=s.element.marginRight,Da(s.outer),s},Oa=(e,t)=>{t.top+=e.top,t.right+=e.left,t.bottom+=e.top,t.left+=e.left,t.bottom>e.bottom&&(e.bottom=t.bottom),t.right>e.right&&(e.right=t.right)},Da=e=>{e.width=e.right-e.left,e.height=e.bottom-e.top},Ze=e=>typeof e=="number",Vr=(e,t,i,a=.001)=>Math.abs(e-t)<a&&Math.abs(i)<a,Gr=({stiffness:e=.5,damping:t=.75,mass:i=10}={})=>{let a=null,n=null,l=0,o=!1,p=Ye({interpolate:(c,d)=>{if(o)return;if(!(Ze(a)&&Ze(n))){o=!0,l=0;return}let m=-(n-a)*e;l+=m/i,n+=l,l*=t,Vr(n,a,l)||d?(n=a,l=0,o=!0,p.onupdate(n),p.oncomplete(n)):p.onupdate(n)},target:{set:c=>{if(Ze(c)&&!Ze(n)&&(n=c),a===null&&(a=c,n=c),a=c,n===a||typeof a>"u"){o=!0,l=0,p.onupdate(n),p.oncomplete(n);return}o=!1},get:()=>a},resting:{get:()=>o},onupdate:c=>{},oncomplete:c=>{}});return p};var Ur=e=>e<.5?2*e*e:-1+(4-2*e)*e,Hr=({duration:e=500,easing:t=Ur,delay:i=0}={})=>{let a=null,n,l,o=!0,r=!1,s=null,c=Ye({interpolate:(d,m)=>{o||s===null||(a===null&&(a=d),!(d-a<i)&&(n=d-a-i,n>=e||m?(n=1,l=r?0:1,c.onupdate(l*s),c.oncomplete(l*s),o=!0):(l=n/e,c.onupdate((n>=0?t(r?1-l:l):0)*s))))},target:{get:()=>r?0:s,set:d=>{if(s===null){s=d,c.onupdate(d),c.oncomplete(d);return}d<s?(s=1,r=!0):(r=!1,s=d),o=!1,a=null}},resting:{get:()=>o},onupdate:d=>{},oncomplete:d=>{}});return c},Ca={spring:Gr,tween:Hr},Wr=(e,t,i)=>{let a=e[t]&&typeof e[t][i]=="object"?e[t][i]:e[t]||e,n=typeof a=="string"?a:a.type,l=typeof a=="object"?{...a}:{};return Ca[n]?Ca[n](l):null},qi=(e,t,i,a=!1)=>{t=Array.isArray(t)?t:[t],t.forEach(n=>{e.forEach(l=>{let o=l,r=()=>i[l],s=p=>i[l]=p;typeof l=="object"&&(o=l.key,r=l.getter||r,s=l.setter||s),!(n[o]&&!a)&&(n[o]={get:r,set:s})})})},jr=({mixinConfig:e,viewProps:t,viewInternalAPI:i,viewExternalAPI:a})=>{let n={...t},l=[];return te(e,(o,r)=>{let s=Wr(r);if(!s)return;s.onupdate=c=>{t[o]=c},s.target=n[o],qi([{key:o,setter:c=>{s.target!==c&&(s.target=c)},getter:()=>t[o]}],[i,a],t,!0),l.push(s)}),{write:o=>{let r=document.hidden,s=!0;return l.forEach(p=>{p.resting||(s=!1),p.interpolate(o,r)}),s},destroy:()=>{}}},Yr=e=>(t,i)=>{e.addEventListener(t,i)},qr=e=>(t,i)=>{e.removeEventListener(t,i)},$r=({mixinConfig:e,viewProps:t,viewInternalAPI:i,viewExternalAPI:a,viewState:n,view:l})=>{let o=[],r=Yr(l.element),s=qr(l.element);return a.on=(p,c)=>{o.push({type:p,fn:c}),r(p,c)},a.off=(p,c)=>{o.splice(o.findIndex(d=>d.type===p&&d.fn===c),1),s(p,c)},{write:()=>!0,destroy:()=>{o.forEach(p=>{s(p.type,p.fn)})}}},Xr=({mixinConfig:e,viewProps:t,viewExternalAPI:i})=>{qi(e,i,t)},fe=e=>e!=null,Kr={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0},Zr=({mixinConfig:e,viewProps:t,viewInternalAPI:i,viewExternalAPI:a,view:n})=>{let l={...t},o={};qi(e,[i,a],t);let r=()=>[t.translateX||0,t.translateY||0],s=()=>[t.scaleX||0,t.scaleY||0],p=()=>n.rect?vn(n.rect,n.childViews,r(),s()):null;return i.Line truncated
|
||||||
`);for(let a of i){let n=Ws(a);if(n){t.name=n;continue}let l=js(a);if(l){t.size=l;continue}let o=Ys(a);if(o){t.source=o;continue}}return t},qs=e=>{let t={source:null,complete:!1,progress:0,size:null,timestamp:null,duration:0,request:null},i=()=>t.progress,a=()=>{t.request&&t.request.abort&&t.request.abort()},n=()=>{let r=t.source;o.fire("init",r),r instanceof File?o.fire("load",r):r instanceof Blob?o.fire("load",Et(r,r.name)):Di(r)?o.fire("load",Hs(r)):l(r)},l=r=>{if(!e){o.fire("error",{type:"error",body:"Can't load URL",code:400});return}t.timestamp=Date.now(),t.request=e(r,s=>{t.duration=Date.now()-t.timestamp,t.complete=!0,s instanceof Blob&&(s=Et(s,s.name||kt(r))),o.fire("load",s instanceof Blob?s:s?s.body:null)},s=>{o.fire("error",typeof s=="string"?{type:"error",code:0,body:s}:s)},(s,p,c)=>{if(c&&(t.size=c),t.duration=Date.now()-t.timestamp,!s){t.progress=null;return}t.progress=p/c,o.fire("progress",t.progress)},()=>{o.fire("abort")},s=>{let p=Zi(typeof s=="string"?s:s.headers);o.fire("meta",{size:t.size||p.size,filename:p.name,source:p.source})})},o={...ui(),setSource:r=>t.source=r,getProgress:i,abort:a,load:n};return o},Wa=e=>/GET|HEAD/.test(e),Je=(e,t,i)=>{let a={onheaders:()=>{},onprogress:()=>{},onload:()=>{},ontimeout:()=>{},onerror:()=>{},onabort:()=>{},abort:()=>{n=!0,o.abort()}},n=!1,l=!1;i={method:"POST",headers:{},withCredentials:!1,...i},t=encodeURI(t),Wa(i.method)&&e&&(t=`${t}${encodeURIComponent(typeof e=="string"?e:JSON.stringify(e))}`);let o=new XMLHttpRequest,r=Wa(i.method)?o:o.upload;return r.onprogress=s=>{n||a.onprogress(s.lengthComputable,s.loaded,s.total)},o.onreadystatechange=()=>{o.readyState<2||o.readyState===4&&o.status===0||l||(l=!0,a.onheaders(o))},o.onload=()=>{o.status>=200&&o.status<300?a.onload(o):a.onerror(o)},o.onerror=()=>a.onerror(o),o.onabort=()=>{n=!0,a.onabort()},o.ontimeout=()=>a.ontimeout(o),o.open(i.method,t,!0),Tt(i.timeout)&&(o.timeout=i.timeout),Object.keys(i.headers).forEach(s=>{let p=unescape(encodeURIComponent(i.headers[s]));o.setRequestHeader(s,p)}),i.responseType&&(o.responseType=i.responseType),i.withCredentials&&(o.withCredentials=!0),o.send(e),a},ie=(e,t,i,a)=>({type:e,code:t,body:i,headers:a}),et=e=>t=>{e(ie("error",0,"Timeout",t.getAllResponseHeaders()))},ja=e=>/\?/.test(e),Ct=(...e)=>{let t="";return e.forEach(i=>{t+=ja(t)&&ja(i)?i.replace(/\?/,"&"):i}),t},Li=(e="",t)=>{if(typeof t=="function")return t;if(!t||!fe(t.url))return null;let i=t.onload||(n=>n),a=t.onerror||(n=>null);return(n,l,o,r,s,p)=>{let c=Je(n,Ct(e,t.url),{...t,responseType:"blob"});return c.onload=d=>{let m=d.getAllResponseHeaders(),u=Zi(m).name||kt(n);l(ie("load",d.status,t.method==="HEAD"?null:Et(i(d.response),u),m))},c.onerror=d=>{o(ie("error",d.status,a(d.response)||d.statusText,d.getAllResponseHeaders()))},c.onheaders=d=>{p(ie("headers",d.status,null,d.getAllResponseHeaders()))},c.ontimeout=et(o),c.onprogress=r,c.onabort=s,c}},ye={QUEUED:0,COMPLETE:1,PROCESSING:2,ERROR:3,WAITING:4},$s=(e,t,i,a,n,l,o,r,s,p,c)=>{let d=[],{chunkTransferId:m,chunkServer:u,chunkSize:g,chunkRetryDelays:f}=c,b={serverId:m,aborted:!1},v=t.ondata||(w=>w),h=t.onload||((w,F)=>F==="HEAD"?w.getResponseHeader("Upload-Offset"):w.response),T=t.onerror||(w=>null),I=w=>{let F=new FormData;de(n)&&F.append(i,JSON.stringify(n));let S=typeof t.headers=="function"?t.headers(a,n):{...t.headers,"Upload-Length":a.size},L={...t,headers:S},D=Je(v(F),Ct(e,t.url),L);D.onload=O=>w(h(O,L.method)),D.onerror=O=>o(ie("error",O.status,T(O.response)||O.statusText,O.getAllResponseHeaders())),D.ontimeout=et(o)},y=w=>{let F=Ct(e,u.url,b.serverId),L={headers:typeof t.headers=="function"?t.headers(b.serverId):{...t.headers},method:"HEAD"},D=Je(null,F,L);D.onload=O=>w(h(O,L.method)),D.onerror=O=>o(ie("error",O.status,T(O.response)||O.statusText,O.getAllResponseHeaders())),D.ontimeout=et(o)},E=Math.floor(a.size/g);for(let w=0;w<=E;w++){let F=w*g,S=a.slice(F,F+g,"application/offset+octet-stream");d[w]={index:w,size:S.size,offset:F,data:S,file:a,progress:0,retries:[...f],status:ye.QUEUED,error:null,request:null,timeout:null}}let _=()=>l(b.serverId),x=w=>w.status===ye.QUEUED||w.status===ye.ERROR,R=w=>{if(b.aborted)return;if(w=w||d.find(x),!w){d.every(C=>C.status===ye.COMPLETE)&&_();return}w.status=ye.PROCESSING,w.progress=null;let F=u.ondata||(C=>C),S=u.onerror||(C=>null),L=u.onload||(()=>{}),D=Ct(e,u.url,b.serverId),O=typeof u.headers=="function"?u.headers(w):{...u.headers,"Content-Type":"application/offset+octet-stream","Upload-Offset":w.offset,"Upload-Length":a.size,"Upload-Name":a.name},U=w.request=Je(F(w.data),D,{...u,headers:O});U.onload=C=>{L(C,w.index,d.length),w.status=ye.COMPLETE,w.request=null,A()},U.onprogress=(C,X,Z)=>{w.progress=C?X:null,P()},U.onerror=C=>{w.status=ye.ERROR,w.request=null,w.error=S(C.response)||C.statusText,z(w)||o(ie("error",C.status,S(C.response)||C.statusText,C.getAllResponseHeaders()))},U.ontimeout=C=>{w.status=ye.ERROR,w.request=null,z(w)||et(o)(C)},U.onabort=()=>{w.status=ye.QUEUED,w.request=null,s()
Line truncated
|
`);for(let a of i){let n=Ws(a);if(n){t.name=n;continue}let l=js(a);if(l){t.size=l;continue}let o=Ys(a);if(o){t.source=o;continue}}return t},qs=e=>{let t={source:null,complete:!1,progress:0,size:null,timestamp:null,duration:0,request:null},i=()=>t.progress,a=()=>{t.request&&t.request.abort&&t.request.abort()},n=()=>{let r=t.source;o.fire("init",r),r instanceof File?o.fire("load",r):r instanceof Blob?o.fire("load",Tt(r,r.name)):Di(r)?o.fire("load",Hs(r)):l(r)},l=r=>{if(!e){o.fire("error",{type:"error",body:"Can't load URL",code:400});return}t.timestamp=Date.now(),t.request=e(r,s=>{t.duration=Date.now()-t.timestamp,t.complete=!0,s instanceof Blob&&(s=Tt(s,s.name||kt(r))),o.fire("load",s instanceof Blob?s:s?s.body:null)},s=>{o.fire("error",typeof s=="string"?{type:"error",code:0,body:s}:s)},(s,p,c)=>{if(c&&(t.size=c),t.duration=Date.now()-t.timestamp,!s){t.progress=null;return}t.progress=p/c,o.fire("progress",t.progress)},()=>{o.fire("abort")},s=>{let p=Zi(typeof s=="string"?s:s.headers);o.fire("meta",{size:t.size||p.size,filename:p.name,source:p.source})})},o={...ui(),setSource:r=>t.source=r,getProgress:i,abort:a,load:n};return o},Wa=e=>/GET|HEAD/.test(e),et=(e,t,i)=>{let a={onheaders:()=>{},onprogress:()=>{},onload:()=>{},ontimeout:()=>{},onerror:()=>{},onabort:()=>{},abort:()=>{n=!0,o.abort()}},n=!1,l=!1;i={method:"POST",headers:{},withCredentials:!1,...i},t=encodeURI(t),Wa(i.method)&&e&&(t=`${t}${encodeURIComponent(typeof e=="string"?e:JSON.stringify(e))}`);let o=new XMLHttpRequest,r=Wa(i.method)?o:o.upload;return r.onprogress=s=>{n||a.onprogress(s.lengthComputable,s.loaded,s.total)},o.onreadystatechange=()=>{o.readyState<2||o.readyState===4&&o.status===0||l||(l=!0,a.onheaders(o))},o.onload=()=>{o.status>=200&&o.status<300?a.onload(o):a.onerror(o)},o.onerror=()=>a.onerror(o),o.onabort=()=>{n=!0,a.onabort()},o.ontimeout=()=>a.ontimeout(o),o.open(i.method,t,!0),vt(i.timeout)&&(o.timeout=i.timeout),Object.keys(i.headers).forEach(s=>{let p=unescape(encodeURIComponent(i.headers[s]));o.setRequestHeader(s,p)}),i.responseType&&(o.responseType=i.responseType),i.withCredentials&&(o.withCredentials=!0),o.send(e),a},ae=(e,t,i,a)=>({type:e,code:t,body:i,headers:a}),tt=e=>t=>{e(ae("error",0,"Timeout",t.getAllResponseHeaders()))},ja=e=>/\?/.test(e),Ct=(...e)=>{let t="";return e.forEach(i=>{t+=ja(t)&&ja(i)?i.replace(/\?/,"&"):i}),t},Li=(e="",t)=>{if(typeof t=="function")return t;if(!t||!he(t.url))return null;let i=t.onload||(n=>n),a=t.onerror||(n=>null);return(n,l,o,r,s,p)=>{let c=et(n,Ct(e,t.url),{...t,responseType:"blob"});return c.onload=d=>{let m=d.getAllResponseHeaders(),u=Zi(m).name||kt(n);l(ae("load",d.status,t.method==="HEAD"?null:Tt(i(d.response),u),m))},c.onerror=d=>{o(ae("error",d.status,a(d.response)||d.statusText,d.getAllResponseHeaders()))},c.onheaders=d=>{p(ae("headers",d.status,null,d.getAllResponseHeaders()))},c.ontimeout=tt(o),c.onprogress=r,c.onabort=s,c}},Se={QUEUED:0,COMPLETE:1,PROCESSING:2,ERROR:3,WAITING:4},$s=(e,t,i,a,n,l,o,r,s,p,c)=>{let d=[],{chunkTransferId:m,chunkServer:u,chunkSize:g,chunkRetryDelays:f}=c,b={serverId:m,aborted:!1},v=t.ondata||(w=>w),h=t.onload||((w,F)=>F==="HEAD"?w.getResponseHeader("Upload-Offset"):w.response),T=t.onerror||(w=>null),I=w=>{let F=new FormData;de(n)&&F.append(i,JSON.stringify(n));let S=typeof t.headers=="function"?t.headers(a,n):{...t.headers,"Upload-Length":a.size},L={...t,headers:S},D=et(v(F),Ct(e,t.url),L);D.onload=O=>w(h(O,L.method)),D.onerror=O=>o(ae("error",O.status,T(O.response)||O.statusText,O.getAllResponseHeaders())),D.ontimeout=tt(o)},y=w=>{let F=Ct(e,u.url,b.serverId),L={headers:typeof t.headers=="function"?t.headers(b.serverId):{...t.headers},method:"HEAD"},D=et(null,F,L);D.onload=O=>w(h(O,L.method)),D.onerror=O=>o(ae("error",O.status,T(O.response)||O.statusText,O.getAllResponseHeaders())),D.ontimeout=tt(o)},E=Math.floor(a.size/g);for(let w=0;w<=E;w++){let F=w*g,S=a.slice(F,F+g,"application/offset+octet-stream");d[w]={index:w,size:S.size,offset:F,data:S,file:a,progress:0,retries:[...f],status:Se.QUEUED,error:null,request:null,timeout:null}}let _=()=>l(b.serverId),x=w=>w.status===Se.QUEUED||w.status===Se.ERROR,R=w=>{if(b.aborted)return;if(w=w||d.find(x),!w){d.every(C=>C.status===Se.COMPLETE)&&_();return}w.status=Se.PROCESSING,w.progress=null;let F=u.ondata||(C=>C),S=u.onerror||(C=>null),L=u.onload||(()=>{}),D=Ct(e,u.url,b.serverId),O=typeof u.headers=="function"?u.headers(w):{...u.headers,"Content-Type":"application/offset+octet-stream","Upload-Offset":w.offset,"Upload-Length":a.size,"Upload-Name":a.name},U=w.request=et(F(w.data),D,{...u,headers:O});U.onload=C=>{L(C,w.index,d.length),w.status=Se.COMPLETE,w.request=null,A()},U.onprogress=(C,X,Z)=>{w.progress=C?X:null,P()},U.onerror=C=>{w.status=Se.ERROR,w.request=null,w.error=S(C.response)||C.statusText,z(w)||o(ae("error",C.status,S(C.response)||C.statusText,C.getAllResponseHeaders()))},U.ontimeout=C=>{w.status=Se.ERROR,w.request=null,z(w)||tt(o)(C)},U.onabort=()=>{w.status=Se.QUEUED,w.request=null,s()
Line truncated
|
||||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var vi=typeof window<"u"&&typeof window.document<"u",Ce=vi?window:{},Ta=vi&&Ce.document.documentElement?"ontouchstart"in Ce.document.documentElement:!1,va=vi?"PointerEvent"in Ce:!1,Q="cropper",Ia="all",_l="crop",wl="move",Ll="zoom",lt="e",ot="w",It="s",Ye="n",Vt="ne",Gt="nw",Ut="se",Ht="sw",pa="".concat(Q,"-crop"),cl="".concat(Q,"-disabled"),Te="".concat(Q,"-hidden"),dl="".concat(Q,"-hide"),Up="".concat(Q,"-invisible"),Ti="".concat(Q,"-modal"),ma="".concat(Q,"-move"),jt="".concat(Q,"Action"),bi="".concat(Q,"Preview"),xa="crop",Ml="move",Al="none",ua="crop",ga="cropend",fa="cropmove",ha="cropstart",pl="dblclick",Hp=Ta?"touchstart":"mousedown",Wp=Ta?"touchmove":"mousemove",jp=Ta?"touchend touchcancel":"mouseup",ml=va?"pointerdown":Hp,ul=va?"pointermove":Wp,gl=va?"pointerup pointercancel":jp,fl="ready",hl="resize",bl="wheel",ba="zoom",El="image/jpeg",Yp=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,qp=/^data:/,$p=/^data:image\/jpeg;base64,/,Xp=/^img|canvas$/i,Pl=200,zl=100,Tl={viewMode:0,dragMode:xa,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:Pl,minContainerHeight:zl,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Kp='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',Zp=Number.isNaN||Ce.isNaN;function q(e){return typeof e=="number"&&!Zp(e)}var vl=function(t){return t>0&&t<1/0};function ra(e){return typeof e>"u"}function rt(e){return ca(e)==="object"&&e!==null}var Qp=Object.prototype.hasOwnProperty;function xt(e){if(!rt(e))return!1;try{var t=e.constructor,i=t.prototype;return t&&i&&Qp.call(i,"isPrototypeOf")}catch{return!1}}function Ee(e){return typeof e=="function"}var Jp=Array.prototype.slice;function Fl(e){return Array.from?Array.from(e):Jp.call(e)}function le(e,t){return e&&Ee(t)&&(Array.isArray(e)||q(e.length)?Fl(e).forEach(function(i,a){t.call(e,i,a,e)}):rt(e)&&Object.keys(e).forEach(function(i){t.call(e,e[i],i,e)})),e}var J=Object.assign||function(t){for(var i=arguments.length,a=new Array(i>1?i-1:0),n=1;n<i;n++)a[n-1]=arguments[n];return rt(t)&&a.length>0&&a.forEach(function(l){rt(l)&&Object.keys(l).forEach(function(o){t[o]=l[o]})}),t},em=/\.\d*(?:0|9){12}\d*$/;function Rt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return em.test(e)?Math.round(e*t)/t:e}var tm=/^width|height|left|top|marginLeft|marginTop$/;function qe(e,t){var i=e.style;le(t,function(a,n){tm.test(n)&&q(a)&&(a="".concat(a,"px")),i[n]=a})}function im(e,t){return e.classList?e.classList.contains(t):e.className.indexOf(t)>-1}function pe(e,t){if(t){if(q(e.length)){le(e,function(a){pe(a,t)});return}if(e.classList){e.classList.add(t);return}var i=e.className.trim();i?i.indexOf(t)<0&&(e.className="".concat(i," ").concat(t)):e.className=t}}function De(e,t){if(t){if(q(e.length)){le(e,function(i){De(i,t)});return}if(e.classList){e.classList.remove(t);return}e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,""))}}function yt(e,t,i){if(t){if(q(e.length)){le(e,function(a){yt(a,t,i)});return}i?pe(e,t):De(e,t)}}var am=/([a-z\d])([A-Z])/g;function ya(e){return e.replace(am,"$1-$2").toLowerCase()}function Ea(e,t){return rt(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(ya(t)))}function Yt(e,t,i){rt(i)?e[t]=i:e.dataset?e.dataset[t]=i:e.setAttribute("data-".concat(ya(t)),i)}function nm(e,t){if(rt(e[t]))try{delete e[t]}catch{e[t]=void 0}else if(e.dataset)try{
Line truncated
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var vi=typeof window<"u"&&typeof window.document<"u",Be=vi?window:{},Ta=vi&&Be.document.documentElement?"ontouchstart"in Be.document.documentElement:!1,va=vi?"PointerEvent"in Be:!1,Q="cropper",Ia="all",_l="crop",wl="move",Ll="zoom",ot="e",rt="w",xt="s",qe="n",Vt="ne",Gt="nw",Ut="se",Ht="sw",pa="".concat(Q,"-crop"),cl="".concat(Q,"-disabled"),Ie="".concat(Q,"-hidden"),dl="".concat(Q,"-hide"),Up="".concat(Q,"-invisible"),Ti="".concat(Q,"-modal"),ma="".concat(Q,"-move"),jt="".concat(Q,"Action"),bi="".concat(Q,"Preview"),xa="crop",Ml="move",Al="none",ua="crop",ga="cropend",fa="cropmove",ha="cropstart",pl="dblclick",Hp=Ta?"touchstart":"mousedown",Wp=Ta?"touchmove":"mousemove",jp=Ta?"touchend touchcancel":"mouseup",ml=va?"pointerdown":Hp,ul=va?"pointermove":Wp,gl=va?"pointerup pointercancel":jp,fl="ready",hl="resize",bl="wheel",ba="zoom",El="image/jpeg",Yp=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,qp=/^data:/,$p=/^data:image\/jpeg;base64,/,Xp=/^img|canvas$/i,Pl=200,zl=100,Tl={viewMode:0,dragMode:xa,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:Pl,minContainerHeight:zl,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Kp='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',Zp=Number.isNaN||Be.isNaN;function q(e){return typeof e=="number"&&!Zp(e)}var vl=function(t){return t>0&&t<1/0};function ra(e){return typeof e>"u"}function st(e){return ca(e)==="object"&&e!==null}var Qp=Object.prototype.hasOwnProperty;function yt(e){if(!st(e))return!1;try{var t=e.constructor,i=t.prototype;return t&&i&&Qp.call(i,"isPrototypeOf")}catch{return!1}}function ve(e){return typeof e=="function"}var Jp=Array.prototype.slice;function Fl(e){return Array.from?Array.from(e):Jp.call(e)}function oe(e,t){return e&&ve(t)&&(Array.isArray(e)||q(e.length)?Fl(e).forEach(function(i,a){t.call(e,i,a,e)}):st(e)&&Object.keys(e).forEach(function(i){t.call(e,e[i],i,e)})),e}var J=Object.assign||function(t){for(var i=arguments.length,a=new Array(i>1?i-1:0),n=1;n<i;n++)a[n-1]=arguments[n];return st(t)&&a.length>0&&a.forEach(function(l){st(l)&&Object.keys(l).forEach(function(o){t[o]=l[o]})}),t},em=/\.\d*(?:0|9){12}\d*$/;function St(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return em.test(e)?Math.round(e*t)/t:e}var tm=/^width|height|left|top|marginLeft|marginTop$/;function $e(e,t){var i=e.style;oe(t,function(a,n){tm.test(n)&&q(a)&&(a="".concat(a,"px")),i[n]=a})}function im(e,t){return e.classList?e.classList.contains(t):e.className.indexOf(t)>-1}function pe(e,t){if(t){if(q(e.length)){oe(e,function(a){pe(a,t)});return}if(e.classList){e.classList.add(t);return}var i=e.className.trim();i?i.indexOf(t)<0&&(e.className="".concat(i," ").concat(t)):e.className=t}}function Ce(e,t){if(t){if(q(e.length)){oe(e,function(i){Ce(i,t)});return}if(e.classList){e.classList.remove(t);return}e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,""))}}function Rt(e,t,i){if(t){if(q(e.length)){oe(e,function(a){Rt(a,t,i)});return}i?pe(e,t):Ce(e,t)}}var am=/([a-z\d])([A-Z])/g;function ya(e){return e.replace(am,"$1-$2").toLowerCase()}function Ea(e,t){return st(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(ya(t)))}function Yt(e,t,i){st(i)?e[t]=i:e.dataset?e.dataset[t]=i:e.setAttribute("data-".concat(ya(t)),i)}function nm(e,t){if(st(e[t]))try{delete e[t]}catch{e[t]=void 0}else if(e.dataset)try{
Line truncated
|
||||||
<defs>
|
<defs>
|
||||||
<radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15">
|
<radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15">
|
||||||
<stop offset='50%' stop-color='#000000'/>
|
<stop offset='50%' stop-color='#000000'/>
|
||||||
@@ -18,7 +18,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|||||||
</mask>
|
</mask>
|
||||||
</defs>
|
</defs>
|
||||||
<rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect>
|
<rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect>
|
||||||
</svg>`,ro=0,fu=e=>e.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:({root:t,props:i})=>{let a=gu;if(document.querySelector("base")){let n=new URL(window.location.href.replace(window.location.hash,"")).href;a=a.replace(/url\(\#/g,"url("+n+"#")}ro++,t.element.classList.add(`filepond--image-preview-overlay-${i.status}`),t.element.innerHTML=a.replace(/__UID__/g,ro)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),hu=function(){self.onmessage=e=>{createImageBitmap(e.data.message.file).then(t=>{self.postMessage({id:e.data.id,message:t},[t])})}},bu=function(){self.onmessage=e=>{let t=e.data.message.imageData,i=e.data.message.colorMatrix,a=t.data,n=a.length,l=i[0],o=i[1],r=i[2],s=i[3],p=i[4],c=i[5],d=i[6],m=i[7],u=i[8],g=i[9],f=i[10],b=i[11],v=i[12],h=i[13],T=i[14],I=i[15],y=i[16],E=i[17],_=i[18],x=i[19],R=0,z=0,P=0,A=0,B=0;for(;R<n;R+=4)z=a[R]/255,P=a[R+1]/255,A=a[R+2]/255,B=a[R+3]/255,a[R]=Math.max(0,Math.min((z*l+P*o+A*r+B*s+p)*255,255)),a[R+1]=Math.max(0,Math.min((z*c+P*d+A*m+B*u+g)*255,255)),a[R+2]=Math.max(0,Math.min((z*f+P*b+A*v+B*h+T)*255,255)),a[R+3]=Math.max(0,Math.min((z*I+P*y+A*E+B*_+x)*255,255));self.postMessage({id:e.data.id,message:t},[t.data.buffer])}},Eu=(e,t)=>{let i=new Image;i.onload=()=>{let a=i.naturalWidth,n=i.naturalHeight;i=null,t(a,n)},i.src=e},Tu={1:()=>[1,0,0,1,0,0],2:e=>[-1,0,0,1,e,0],3:(e,t)=>[-1,0,0,-1,e,t],4:(e,t)=>[1,0,0,-1,0,t],5:()=>[0,1,1,0,0,0],6:(e,t)=>[0,1,-1,0,t,0],7:(e,t)=>[0,-1,-1,0,t,e],8:e=>[0,-1,1,0,0,e]},vu=(e,t,i,a)=>{a!==-1&&e.transform.apply(e,Tu[a](t,i))},Iu=(e,t,i,a)=>{t=Math.round(t),i=Math.round(i);let n=document.createElement("canvas");n.width=t,n.height=i;let l=n.getContext("2d");return a>=5&&a<=8&&([t,i]=[i,t]),vu(l,t,i,a),l.drawImage(e,0,0,t,i),n},po=e=>/^image/.test(e.type)&&!/svg/.test(e.type),xu=10,yu=10,Ru=e=>{let t=Math.min(xu/e.width,yu/e.height),i=document.createElement("canvas"),a=i.getContext("2d"),n=i.width=Math.ceil(e.width*t),l=i.height=Math.ceil(e.height*t);a.drawImage(e,0,0,n,l);let o=null;try{o=a.getImageData(0,0,n,l).data}catch{return null}let r=o.length,s=0,p=0,c=0,d=0;for(;d<r;d+=4)s+=o[d]*o[d],p+=o[d+1]*o[d+1],c+=o[d+2]*o[d+2];return s=La(s,r),p=La(p,r),c=La(c,r),{r:s,g:p,b:c}},La=(e,t)=>Math.floor(Math.sqrt(e/(t/4))),Su=(e,t)=>(t=t||document.createElement("canvas"),t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t),_u=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(new Uint8ClampedArray(e.data)),t},wu=e=>new Promise((t,i)=>{let a=new Image;a.crossOrigin="Anonymous",a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),Lu=e=>{let t=fu(e),i=uu(e),{createWorker:a}=e.utils,n=(h,T,I)=>new Promise(y=>{h.ref.imageData||(h.ref.imageData=I.getContext("2d").getImageData(0,0,I.width,I.height));let E=_u(h.ref.imageData);if(!T||T.length!==20)return I.getContext("2d").putImageData(E,0,0),y();let _=a(bu);_.post({imageData:E,colorMatrix:T},x=>{I.getContext("2d").putImageData(x,0,0),_.terminate(),y()},[E.data.buffer])}),l=(h,T)=>{h.removeChildView(T),T.image.width=1,T.image.height=1,T._destroy()},o=({root:h})=>{let T=h.ref.images.shift();return T.opacity=0,T.translateY=-15,h.ref.imageViewBin.push(T),T},r=({root:h,props:T,image:I})=>{let y=T.id,E=h.query("GET_ITEM",{id:y});if(!E)return;let _=E.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},x=h.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),R,z,P=!1;h.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(R=E.getMetadata("markup")||[],z=E.getMetadata("resize"),P=!0);let A=h.appendChildView(h.createChildView(i,{id:y,image:I,crop:_,resize:z,markup:R,dirty:P,background:x,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),h.childViews.length);h.ref.images.push(A),A.opacity=1,A.scaleX=1,A.scaleY=1,A.translateY=0,setTimeout(()=>{h.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:y})},250)},s=({root:h,props:T})=>{let I=h.query("GET_ITEM",{id:T.id});if(!I)return;let y=h.ref.images[h.ref.images.length-1];y.crop=I.getMetadata("crop"),y.background=h.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),h.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(y.dirty=!0,y.resize=I.getMetadata("resize"),y.markup=I.getMetadata("markup"))},p=({root:h,props:T,action:I})=>{if(!/crop|filter|markup|resize/.test(I.change.key)||!h.ref.images.length)return;let y=h.query("GET_ITEM",{id:T.id});if(y){if(/filter/.test(I.change.key)){let E=h.ref.images[h.ref.images.length-1];n(h,I.change.value,E.image);return}if(/crop|markup|resize/.test(I.change.key)){let E=y.getMetadata("crop"),_=h.ref.images[h.ref.images.length-1];if(E&&E.aspectRatio&&_.crop&&_.crop.aspectRatio&&Math.abs(E.aspectRatio-_.crop.aspectRatio)>1e-5){let x=o({root:h});r({root:h,props:T,image:Su(x.image)})}else s({root:h,props:T})}}},c=h=>{let I=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./),y=I?parseInt(I[1]):null;return y!==null&&y<=58?!1:"createImagLine truncated
|
</svg>`,ro=0,fu=e=>e.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:({root:t,props:i})=>{let a=gu;if(document.querySelector("base")){let n=new URL(window.location.href.replace(window.location.hash,"")).href;a=a.replace(/url\(\#/g,"url("+n+"#")}ro++,t.element.classList.add(`filepond--image-preview-overlay-${i.status}`),t.element.innerHTML=a.replace(/__UID__/g,ro)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),hu=function(){self.onmessage=e=>{createImageBitmap(e.data.message.file).then(t=>{self.postMessage({id:e.data.id,message:t},[t])})}},bu=function(){self.onmessage=e=>{let t=e.data.message.imageData,i=e.data.message.colorMatrix,a=t.data,n=a.length,l=i[0],o=i[1],r=i[2],s=i[3],p=i[4],c=i[5],d=i[6],m=i[7],u=i[8],g=i[9],f=i[10],b=i[11],v=i[12],h=i[13],T=i[14],I=i[15],y=i[16],E=i[17],_=i[18],x=i[19],R=0,z=0,P=0,A=0,B=0;for(;R<n;R+=4)z=a[R]/255,P=a[R+1]/255,A=a[R+2]/255,B=a[R+3]/255,a[R]=Math.max(0,Math.min((z*l+P*o+A*r+B*s+p)*255,255)),a[R+1]=Math.max(0,Math.min((z*c+P*d+A*m+B*u+g)*255,255)),a[R+2]=Math.max(0,Math.min((z*f+P*b+A*v+B*h+T)*255,255)),a[R+3]=Math.max(0,Math.min((z*I+P*y+A*E+B*_+x)*255,255));self.postMessage({id:e.data.id,message:t},[t.data.buffer])}},Eu=(e,t)=>{let i=new Image;i.onload=()=>{let a=i.naturalWidth,n=i.naturalHeight;i=null,t(a,n)},i.src=e},Tu={1:()=>[1,0,0,1,0,0],2:e=>[-1,0,0,1,e,0],3:(e,t)=>[-1,0,0,-1,e,t],4:(e,t)=>[1,0,0,-1,0,t],5:()=>[0,1,1,0,0,0],6:(e,t)=>[0,1,-1,0,t,0],7:(e,t)=>[0,-1,-1,0,t,e],8:e=>[0,-1,1,0,0,e]},vu=(e,t,i,a)=>{a!==-1&&e.transform.apply(e,Tu[a](t,i))},Iu=(e,t,i,a)=>{t=Math.round(t),i=Math.round(i);let n=document.createElement("canvas");n.width=t,n.height=i;let l=n.getContext("2d");return a>=5&&a<=8&&([t,i]=[i,t]),vu(l,t,i,a),l.drawImage(e,0,0,t,i),n},po=e=>/^image/.test(e.type)&&!/svg/.test(e.type),xu=10,yu=10,Ru=e=>{let t=Math.min(xu/e.width,yu/e.height),i=document.createElement("canvas"),a=i.getContext("2d"),n=i.width=Math.ceil(e.width*t),l=i.height=Math.ceil(e.height*t);a.drawImage(e,0,0,n,l);let o=null;try{o=a.getImageData(0,0,n,l).data}catch{return null}let r=o.length,s=0,p=0,c=0,d=0;for(;d<r;d+=4)s+=o[d]*o[d],p+=o[d+1]*o[d+1],c+=o[d+2]*o[d+2];return s=La(s,r),p=La(p,r),c=La(c,r),{r:s,g:p,b:c}},La=(e,t)=>Math.floor(Math.sqrt(e/(t/4))),Su=(e,t)=>(t=t||document.createElement("canvas"),t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t),_u=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(new Uint8ClampedArray(e.data)),t},wu=e=>new Promise((t,i)=>{let a=new Image;a.crossOrigin="Anonymous",a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),Lu=e=>{let t=fu(e),i=uu(e),{createWorker:a}=e.utils,n=(h,T,I)=>new Promise(y=>{h.ref.imageData||(h.ref.imageData=I.getContext("2d").getImageData(0,0,I.width,I.height));let E=_u(h.ref.imageData);if(!T||T.length!==20)return I.getContext("2d").putImageData(E,0,0),y();let _=a(bu);_.post({imageData:E,colorMatrix:T},x=>{I.getContext("2d").putImageData(x,0,0),_.terminate(),y()},[E.data.buffer])}),l=(h,T)=>{h.removeChildView(T),T.image.width=1,T.image.height=1,T._destroy()},o=({root:h})=>{let T=h.ref.images.shift();return T.opacity=0,T.translateY=-15,h.ref.imageViewBin.push(T),T},r=({root:h,props:T,image:I})=>{let y=T.id,E=h.query("GET_ITEM",{id:y});if(!E)return;let _=E.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},x=h.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),R,z,P=!1;h.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(R=E.getMetadata("markup")||[],z=E.getMetadata("resize"),P=!0);let A=h.appendChildView(h.createChildView(i,{id:y,image:I,crop:_,resize:z,markup:R,dirty:P,background:x,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),h.childViews.length);h.ref.images.push(A),A.opacity=1,A.scaleX=1,A.scaleY=1,A.translateY=0,setTimeout(()=>{h.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:y})},250)},s=({root:h,props:T})=>{let I=h.query("GET_ITEM",{id:T.id});if(!I)return;let y=h.ref.images[h.ref.images.length-1];y.crop=I.getMetadata("crop"),y.background=h.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),h.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(y.dirty=!0,y.resize=I.getMetadata("resize"),y.markup=I.getMetadata("markup"))},p=({root:h,props:T,action:I})=>{if(!/crop|filter|markup|resize/.test(I.change.key)||!h.ref.images.length)return;let y=h.query("GET_ITEM",{id:T.id});if(y){if(/filter/.test(I.change.key)){let E=h.ref.images[h.ref.images.length-1];n(h,I.change.value,E.image);return}if(/crop|markup|resize/.test(I.change.key)){let E=y.getMetadata("crop"),_=h.ref.images[h.ref.images.length-1];if(E&&E.aspectRatio&&_.crop&&_.crop.aspectRatio&&Math.abs(E.aspectRatio-_.crop.aspectRatio)>1e-5){let x=o({root:h});r({root:h,props:T,image:Su(x.image)})}else s({root:h,props:T})}}},c=h=>{let I=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./),y=I?parseInt(I[1]):null;return y!==null&&y<=58?!1:"createImagLine truncated
|
||||||
`+W.outerHTML+`
|
`+W.outerHTML+`
|
||||||
`},""),_=`
|
`},""),_=`
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ xmlns="http://www.w3.org/2000/svg">
|
|||||||
${p.outerHTML}${_}
|
${p.outerHTML}${_}
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</svg>`;n(Z)},o.readAsText(e)}),pg=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(e.data),t},mg=()=>{let e={resize:c,filter:p},t=(d,m)=>(d.forEach(u=>{m=e[u.type](m,u.data)}),m),i=(d,m)=>{let u=d.transforms,g=null;if(u.forEach(f=>{f.type==="filter"&&(g=f)}),g){let f=null;u.forEach(b=>{b.type==="resize"&&(f=b)}),f&&(f.data.matrix=g.data,u=u.filter(b=>b.type!=="filter"))}m(t(u,d.imageData))};self.onmessage=d=>{i(d.data.message,m=>{self.postMessage({id:d.data.id,message:m},[m.data.buffer])})};let a=1,n=1,l=1;function o(d,m,u){let g=m[d]/255,f=m[d+1]/255,b=m[d+2]/255,v=m[d+3]/255,h=g*u[0]+f*u[1]+b*u[2]+v*u[3]+u[4],T=g*u[5]+f*u[6]+b*u[7]+v*u[8]+u[9],I=g*u[10]+f*u[11]+b*u[12]+v*u[13]+u[14],y=g*u[15]+f*u[16]+b*u[17]+v*u[18]+u[19],E=Math.max(0,h*y)+a*(1-y),_=Math.max(0,T*y)+n*(1-y),x=Math.max(0,I*y)+l*(1-y);m[d]=Math.max(0,Math.min(1,E))*255,m[d+1]=Math.max(0,Math.min(1,_))*255,m[d+2]=Math.max(0,Math.min(1,x))*255}let r=self.JSON.stringify([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]);function s(d){return self.JSON.stringify(d||[])===r}function p(d,m){if(!m||s(m))return d;let u=d.data,g=u.length,f=m[0],b=m[1],v=m[2],h=m[3],T=m[4],I=m[5],y=m[6],E=m[7],_=m[8],x=m[9],R=m[10],z=m[11],P=m[12],A=m[13],B=m[14],w=m[15],F=m[16],S=m[17],L=m[18],D=m[19],O=0,U=0,C=0,X=0,Z=0,K=0,me=0,V=0,W=0,$=0,oe=0,ee=0;for(;O<g;O+=4)U=u[O]/255,C=u[O+1]/255,X=u[O+2]/255,Z=u[O+3]/255,K=U*f+C*b+X*v+Z*h+T,me=U*I+C*y+X*E+Z*_+x,V=U*R+C*z+X*P+Z*A+B,W=U*w+C*F+X*S+Z*L+D,$=Math.max(0,K*W)+a*(1-W),oe=Math.max(0,me*W)+n*(1-W),ee=Math.max(0,V*W)+l*(1-W),u[O]=Math.max(0,Math.min(1,$))*255,u[O+1]=Math.max(0,Math.min(1,oe))*255,u[O+2]=Math.max(0,Math.min(1,ee))*255;return d}function c(d,m){let{mode:u="contain",upscale:g=!1,width:f,height:b,matrix:v}=m;if(v=!v||s(v)?null:v,!f&&!b)return p(d,v);if(f===null?f=b:b===null&&(b=f),u!=="force"){let A=f/d.width,B=b/d.height,w=1;if(u==="cover"?w=Math.max(A,B):u==="contain"&&(w=Math.min(A,B)),w>1&&g===!1)return p(d,v);f=d.width*w,b=d.height*w}let h=d.width,T=d.height,I=Math.round(f),y=Math.round(b),E=d.data,_=new Uint8ClampedArray(I*y*4),x=h/I,R=T/y,z=Math.ceil(x*.5),P=Math.ceil(R*.5);for(let A=0;A<y;A++)for(let B=0;B<I;B++){let w=(B+A*I)*4,F=0,S=0,L=0,D=0,O=0,U=0,C=0,X=(A+.5)*R;for(let Z=Math.floor(A*R);Z<(A+1)*R;Z++){let K=Math.abs(X-(Z+.5))/P,me=(B+.5)*x,V=K*K;for(let W=Math.floor(B*x);W<(B+1)*x;W++){let $=Math.abs(me-(W+.5))/z,oe=Math.sqrt(V+$*$);if(oe>=-1&&oe<=1&&(F=2*oe*oe*oe-3*oe*oe+1,F>0)){$=4*(W+Z*h);let ee=E[$+3];C+=F*ee,L+=F,ee<255&&(F=F*ee/250),D+=F*E[$],O+=F*E[$+1],U+=F*E[$+2],S+=F}}}_[w]=D/S,_[w+1]=O/S,_[w+2]=U/S,_[w+3]=C/L,v&&o(w,_,v)}return{data:_,width:I,height:y}}},ug=(e,t)=>{if(e.getUint32(t+4,!1)!==1165519206)return;t+=4;let i=e.getUint16(t+=6,!1)===18761;t+=e.getUint32(t+4,i);let a=e.getUint16(t,i);t+=2;for(let n=0;n<a;n++)if(e.getUint16(t+n*12,i)===274)return e.setUint16(t+n*12+8,1,i),!0;return!1},gg=e=>{let t=new DataView(e);if(t.getUint16(0)!==65496)return null;let i=2,a,n,l=!1;for(;i<t.byteLength&&(a=t.getUint16(i,!1),n=t.getUint16(i+2,!1)+2,!(!(a>=65504&&a<=65519||a===65534)||(l||(l=ug(t,i,n)),i+n>t.byteLength)));)i+=n;return e.slice(0,i)},fg=e=>new Promise(t=>{let i=new FileReader;i.onload=()=>t(gg(i.result)||null),i.readAsArrayBuffer(e.slice(0,256*1024))}),hg=()=>window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,bg=(e,t)=>{let i=hg();if(i){let a=new i;return a.append(e),a.getBlob(t)}return new Blob([e],{type:t})},Eg=()=>Math.random().toString(36).substr(2,9),Tg=e=>{let t=new Blob(["(",e.toString(),")()"],{type:"application/javascript"}),i=URL.createObjectURL(t),a=new Worker(i),n=[];return{transfer:()=>{},post:(l,o,r)=>{let s=Eg();n[s]=o,a.onmessage=p=>{let c=n[p.data.id];c&&(c(p.data.message),delete n[p.data.id])},a.postMessage({id:s,message:l},r)},terminate:()=>{a.terminate(),URL.revokeObjectURL(i)}}},vg=e=>new Promise((t,i)=>{let a=new Image;a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),Ig=e=>e.reduce((t,i)=>t.then(a=>i().then(Array.prototype.concat.bind(a))),Promise.resolve([])),xg=(e,t)=>new Promise(i=>{let a={width:e.width,height:e.height},n=e.getContext("2d"),l=t.sort(So).map(o=>()=>new Promise(r=>{Mg[o[0]](n,a,o[1],r)&&r()}));Ig(l).then(()=>i(e))}),At=(e,t)=>{e.beginPath(),e.lineCap=t["stroke-linecap"],e.lineJoin=t["stroke-linejoin"],e.lineWidth=t["stroke-width"],t["stroke-dasharray"].length&&e.setLineDash(t["stroke-dasharray"].split(",")),e.fillStyle=t.fill,e.strokeStyle=t.stroke,e.globalAlpha=t.opacity||1},Pt=e=>{e.fill(),e.stroke(),e.globalAlpha=1},yg=(e,t,i)=>{let a=Mt(i,t),n=pt(i,t);return At(e,n),e.rect(a.x,a.y,a.width,a.height),Pt(e,n),!0},Rg=(e,t,i)=>{let a=Mt(i,t),n=pt(i,t);At(e,n);let l=a.x,o=a.y,r=a.width,s=a.height,p=.5522848,c=r/2*p,d=s/2*p,m=l+r,u=o+s,g=l+r/2,f=o+s/2;return e.moveTo(l,f),e.bezierCurveTo(l,f-d,g-c,o,g,o),e.bezierCurveTo(g+c,o,m,f-d,m,f),e.bezierCurveTo(m,f+d,g+c,u,g,u),e.bezierCurveTo(Line truncated
|
</svg>`;n(Z)},o.readAsText(e)}),pg=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(e.data),t},mg=()=>{let e={resize:c,filter:p},t=(d,m)=>(d.forEach(u=>{m=e[u.type](m,u.data)}),m),i=(d,m)=>{let u=d.transforms,g=null;if(u.forEach(f=>{f.type==="filter"&&(g=f)}),g){let f=null;u.forEach(b=>{b.type==="resize"&&(f=b)}),f&&(f.data.matrix=g.data,u=u.filter(b=>b.type!=="filter"))}m(t(u,d.imageData))};self.onmessage=d=>{i(d.data.message,m=>{self.postMessage({id:d.data.id,message:m},[m.data.buffer])})};let a=1,n=1,l=1;function o(d,m,u){let g=m[d]/255,f=m[d+1]/255,b=m[d+2]/255,v=m[d+3]/255,h=g*u[0]+f*u[1]+b*u[2]+v*u[3]+u[4],T=g*u[5]+f*u[6]+b*u[7]+v*u[8]+u[9],I=g*u[10]+f*u[11]+b*u[12]+v*u[13]+u[14],y=g*u[15]+f*u[16]+b*u[17]+v*u[18]+u[19],E=Math.max(0,h*y)+a*(1-y),_=Math.max(0,T*y)+n*(1-y),x=Math.max(0,I*y)+l*(1-y);m[d]=Math.max(0,Math.min(1,E))*255,m[d+1]=Math.max(0,Math.min(1,_))*255,m[d+2]=Math.max(0,Math.min(1,x))*255}let r=self.JSON.stringify([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]);function s(d){return self.JSON.stringify(d||[])===r}function p(d,m){if(!m||s(m))return d;let u=d.data,g=u.length,f=m[0],b=m[1],v=m[2],h=m[3],T=m[4],I=m[5],y=m[6],E=m[7],_=m[8],x=m[9],R=m[10],z=m[11],P=m[12],A=m[13],B=m[14],w=m[15],F=m[16],S=m[17],L=m[18],D=m[19],O=0,U=0,C=0,X=0,Z=0,K=0,me=0,V=0,W=0,$=0,re=0,ee=0;for(;O<g;O+=4)U=u[O]/255,C=u[O+1]/255,X=u[O+2]/255,Z=u[O+3]/255,K=U*f+C*b+X*v+Z*h+T,me=U*I+C*y+X*E+Z*_+x,V=U*R+C*z+X*P+Z*A+B,W=U*w+C*F+X*S+Z*L+D,$=Math.max(0,K*W)+a*(1-W),re=Math.max(0,me*W)+n*(1-W),ee=Math.max(0,V*W)+l*(1-W),u[O]=Math.max(0,Math.min(1,$))*255,u[O+1]=Math.max(0,Math.min(1,re))*255,u[O+2]=Math.max(0,Math.min(1,ee))*255;return d}function c(d,m){let{mode:u="contain",upscale:g=!1,width:f,height:b,matrix:v}=m;if(v=!v||s(v)?null:v,!f&&!b)return p(d,v);if(f===null?f=b:b===null&&(b=f),u!=="force"){let A=f/d.width,B=b/d.height,w=1;if(u==="cover"?w=Math.max(A,B):u==="contain"&&(w=Math.min(A,B)),w>1&&g===!1)return p(d,v);f=d.width*w,b=d.height*w}let h=d.width,T=d.height,I=Math.round(f),y=Math.round(b),E=d.data,_=new Uint8ClampedArray(I*y*4),x=h/I,R=T/y,z=Math.ceil(x*.5),P=Math.ceil(R*.5);for(let A=0;A<y;A++)for(let B=0;B<I;B++){let w=(B+A*I)*4,F=0,S=0,L=0,D=0,O=0,U=0,C=0,X=(A+.5)*R;for(let Z=Math.floor(A*R);Z<(A+1)*R;Z++){let K=Math.abs(X-(Z+.5))/P,me=(B+.5)*x,V=K*K;for(let W=Math.floor(B*x);W<(B+1)*x;W++){let $=Math.abs(me-(W+.5))/z,re=Math.sqrt(V+$*$);if(re>=-1&&re<=1&&(F=2*re*re*re-3*re*re+1,F>0)){$=4*(W+Z*h);let ee=E[$+3];C+=F*ee,L+=F,ee<255&&(F=F*ee/250),D+=F*E[$],O+=F*E[$+1],U+=F*E[$+2],S+=F}}}_[w]=D/S,_[w+1]=O/S,_[w+2]=U/S,_[w+3]=C/L,v&&o(w,_,v)}return{data:_,width:I,height:y}}},ug=(e,t)=>{if(e.getUint32(t+4,!1)!==1165519206)return;t+=4;let i=e.getUint16(t+=6,!1)===18761;t+=e.getUint32(t+4,i);let a=e.getUint16(t,i);t+=2;for(let n=0;n<a;n++)if(e.getUint16(t+n*12,i)===274)return e.setUint16(t+n*12+8,1,i),!0;return!1},gg=e=>{let t=new DataView(e);if(t.getUint16(0)!==65496)return null;let i=2,a,n,l=!1;for(;i<t.byteLength&&(a=t.getUint16(i,!1),n=t.getUint16(i+2,!1)+2,!(!(a>=65504&&a<=65519||a===65534)||(l||(l=ug(t,i,n)),i+n>t.byteLength)));)i+=n;return e.slice(0,i)},fg=e=>new Promise(t=>{let i=new FileReader;i.onload=()=>t(gg(i.result)||null),i.readAsArrayBuffer(e.slice(0,256*1024))}),hg=()=>window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,bg=(e,t)=>{let i=hg();if(i){let a=new i;return a.append(e),a.getBlob(t)}return new Blob([e],{type:t})},Eg=()=>Math.random().toString(36).substr(2,9),Tg=e=>{let t=new Blob(["(",e.toString(),")()"],{type:"application/javascript"}),i=URL.createObjectURL(t),a=new Worker(i),n=[];return{transfer:()=>{},post:(l,o,r)=>{let s=Eg();n[s]=o,a.onmessage=p=>{let c=n[p.data.id];c&&(c(p.data.message),delete n[p.data.id])},a.postMessage({id:s,message:l},r)},terminate:()=>{a.terminate(),URL.revokeObjectURL(i)}}},vg=e=>new Promise((t,i)=>{let a=new Image;a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),Ig=e=>e.reduce((t,i)=>t.then(a=>i().then(Array.prototype.concat.bind(a))),Promise.resolve([])),xg=(e,t)=>new Promise(i=>{let a={width:e.width,height:e.height},n=e.getContext("2d"),l=t.sort(So).map(o=>()=>new Promise(r=>{Mg[o[0]](n,a,o[1],r)&&r()}));Ig(l).then(()=>i(e))}),Pt=(e,t)=>{e.beginPath(),e.lineCap=t["stroke-linecap"],e.lineJoin=t["stroke-linejoin"],e.lineWidth=t["stroke-width"],t["stroke-dasharray"].length&&e.setLineDash(t["stroke-dasharray"].split(",")),e.fillStyle=t.fill,e.strokeStyle=t.stroke,e.globalAlpha=t.opacity||1},zt=e=>{e.fill(),e.stroke(),e.globalAlpha=1},yg=(e,t,i)=>{let a=At(i,t),n=mt(i,t);return Pt(e,n),e.rect(a.x,a.y,a.width,a.height),zt(e,n),!0},Rg=(e,t,i)=>{let a=At(i,t),n=mt(i,t);Pt(e,n);let l=a.x,o=a.y,r=a.width,s=a.height,p=.5522848,c=r/2*p,d=s/2*p,m=l+r,u=o+s,g=l+r/2,f=o+s/2;return e.moveTo(l,f),e.bezierCurveTo(l,f-d,g-c,o,g,o),e.bezierCurveTo(g+c,o,m,f-d,m,f),e.bezierCurveTo(m,f+d,g+c,u,g,u),e.bezierCurveTo(Line truncated
|
||||||
/*! Bundled license information:
|
/*! Bundled license information:
|
||||||
|
|
||||||
filepond/dist/filepond.esm.js:
|
filepond/dist/filepond.esm.js:
|
||||||
|
|||||||
@@ -1,43 +1,43 @@
|
|||||||
var ss=Object.defineProperty;var Sd=Object.getOwnPropertyDescriptor;var Td=Object.getOwnPropertyNames;var Ld=Object.prototype.hasOwnProperty;var Cd=(o,p,v)=>()=>{if(v)throw v[0];try{return o&&(p=o(o=0)),p}catch(L){throw v=[L],L}};var Ke=(o,p)=>()=>{try{return p||o((p={exports:{}}).exports,p),p.exports}catch(v){throw p=0,v}};var Ed=(o,p,v,L)=>{if(p&&typeof p=="object"||typeof p=="function")for(let b of Td(p))!Ld.call(o,b)&&b!==v&&ss(o,b,{get:()=>p[b],enumerable:!(L=Sd(p,b))||L.enumerable});return o};var zd=o=>Ed(ss({},"__esModule",{value:!0}),o);var We=Ke((Yo,Qo)=>{(function(o,p){typeof Yo=="object"&&typeof Qo<"u"?Qo.exports=p():typeof define=="function"&&define.amd?define(p):(o=o||self,o.CodeMirror=p())})(Yo,(function(){"use strict";var o=navigator.userAgent,p=navigator.platform,v=/gecko\/\d/i.test(o),L=/MSIE \d/.test(o),b=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(o),S=/Edge\/(\d+)/.exec(o),s=L||b||S,h=s&&(L?document.documentMode||6:+(S||b)[1]),g=!S&&/WebKit\//.test(o),C=g&&/Qt\/\d+\.\d+/.test(o),k=!S&&/Chrome\/(\d+)/.exec(o),c=k&&+k[1],d=/Opera\//.test(o),x=/Apple Computer/.test(navigator.vendor),z=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(o),M=/PhantomJS/.test(o),w=x&&(/Mobile\/\w+/.test(o)||navigator.maxTouchPoints>2),W=/Android/.test(o),E=w||W||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(o),N=w||/Mac/.test(p),K=/\bCrOS\b/.test(o),J=/win/i.test(p),re=d&&o.match(/Version\/(\d*\.\d*)/);re&&(re=Number(re[1])),re&&re>=15&&(d=!1,g=!0);var q=N&&(C||d&&(re==null||re<12.11)),F=v||s&&h>=9;function D(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Q=function(e,t){var n=e.className,r=D(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function j(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function V(e,t){return j(e).appendChild(t)}function y(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function G(e,t,n,r){var i=y(e,t,n,r);return i.setAttribute("role","presentation"),i}var X;document.createRange?X=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:X=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function O(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function R(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function se(e,t){var n=e.className;D(t).test(n)||(e.className+=(n?" ":"")+t)}function _e(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!D(n[r]).test(t)&&(t+=" "+n[r]);return t}var I=function(e){e.select()};w?I=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(I=function(e){try{e.select()}catch{}});function T(e){return e.display.wrapper.ownerDocument}function he(e){return ze(e.display.wrapper)}function ze(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function de(e){return T(e).defaultView}function Ee(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function ge(e,t,n){t||(t={});for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n!==!1||!Object.prototype.hasOwnProperty.call(t,r))&&(t[r]=e[r]);return t}function Oe(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=r||0,l=i||0;;){var u=e.indexOf(" ",a);if(u<0||u>=t)return l+(t-a);l+=u-a,l+=n-l%n,a=u+1}}var qe=function(){this.id=null,this.f=null,this.time=0,this.handler=Ee(this.onTimeout,this)};qe.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},qe.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function Se(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var Be=50,Ze={toString:function(){return"CodeMirror.Pass"}},ke={scroll:!1},Je={origin:"*mouse"},Re={origin:"+move"};function Ge(e,t,n){for(var r=0,i=0;;){var a=e.indexOf(" ",r);a==-1&&(a=e.length);var l=a-r;if(a==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=a-r,i+=n-i%n,r=a+1,i>=t)return r}}var U=[""];function Z(e){for(;U.length<=e;)U.push(ce(U)+" ");return U[e]}function ce(e){return e[e.length-1]}function He(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function te(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function fe(){}function oe(e,t){var n;return Object.create?n=Object.create(e):(fe.prototype=e,n=new fe),t&&ge(t,n),n}var Ue=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function we(e){return/\Line truncated
|
var ss=Object.defineProperty;var Sd=Object.getOwnPropertyDescriptor;var Td=Object.getOwnPropertyNames;var Ld=Object.prototype.hasOwnProperty;var Cd=(o,p,v)=>()=>{if(v)throw v[0];try{return o&&(p=o(o=0)),p}catch(L){throw v=[L],L}};var Ke=(o,p)=>()=>{try{return p||o((p={exports:{}}).exports,p),p.exports}catch(v){throw p=0,v}};var Ed=(o,p,v,L)=>{if(p&&typeof p=="object"||typeof p=="function")for(let b of Td(p))!Ld.call(o,b)&&b!==v&&ss(o,b,{get:()=>p[b],enumerable:!(L=Sd(p,b))||L.enumerable});return o};var zd=o=>Ed(ss({},"__esModule",{value:!0}),o);var We=Ke((Yo,Qo)=>{(function(o,p){typeof Yo=="object"&&typeof Qo<"u"?Qo.exports=p():typeof define=="function"&&define.amd?define(p):(o=o||self,o.CodeMirror=p())})(Yo,(function(){"use strict";var o=navigator.userAgent,p=navigator.platform,v=/gecko\/\d/i.test(o),L=/MSIE \d/.test(o),b=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(o),S=/Edge\/(\d+)/.exec(o),s=L||b||S,h=s&&(L?document.documentMode||6:+(S||b)[1]),g=!S&&/WebKit\//.test(o),C=g&&/Qt\/\d+\.\d+/.test(o),k=!S&&/Chrome\/(\d+)/.exec(o),c=k&&+k[1],d=/Opera\//.test(o),x=/Apple Computer/.test(navigator.vendor),E=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(o),z=/PhantomJS/.test(o),w=x&&(/Mobile\/\w+/.test(o)||navigator.maxTouchPoints>2),U=/Android/.test(o),M=w||U||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(o),O=w||/Mac/.test(p),W=/\bCrOS\b/.test(o),J=/win/i.test(p),re=d&&o.match(/Version\/(\d*\.\d*)/);re&&(re=Number(re[1])),re&&re>=15&&(d=!1,g=!0);var F=O&&(C||d&&(re==null||re<12.11)),q=v||s&&h>=9;function D(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Q=function(e,t){var n=e.className,r=D(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function j(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function V(e,t){return j(e).appendChild(t)}function y(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function G(e,t,n,r){var i=y(e,t,n,r);return i.setAttribute("role","presentation"),i}var X;document.createRange?X=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:X=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function N(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function R(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function se(e,t){var n=e.className;D(t).test(n)||(e.className+=(n?" ":"")+t)}function _e(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!D(n[r]).test(t)&&(t+=" "+n[r]);return t}var I=function(e){e.select()};w?I=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(I=function(e){try{e.select()}catch{}});function T(e){return e.display.wrapper.ownerDocument}function he(e){return ze(e.display.wrapper)}function ze(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function de(e){return T(e).defaultView}function Ee(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function ge(e,t,n){t||(t={});for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n!==!1||!Object.prototype.hasOwnProperty.call(t,r))&&(t[r]=e[r]);return t}function Oe(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=r||0,l=i||0;;){var u=e.indexOf(" ",a);if(u<0||u>=t)return l+(t-a);l+=u-a,l+=n-l%n,a=u+1}}var qe=function(){this.id=null,this.f=null,this.time=0,this.handler=Ee(this.onTimeout,this)};qe.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},qe.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function Se(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var Be=50,Ze={toString:function(){return"CodeMirror.Pass"}},ke={scroll:!1},Je={origin:"*mouse"},Re={origin:"+move"};function Ge(e,t,n){for(var r=0,i=0;;){var a=e.indexOf(" ",r);a==-1&&(a=e.length);var l=a-r;if(a==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=a-r,i+=n-i%n,r=a+1,i>=t)return r}}var $=[""];function Z(e){for(;$.length<=e;)$.push(ce($)+" ");return $[e]}function ce(e){return e[e.length-1]}function He(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function te(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function fe(){}function oe(e,t){var n;return Object.create?n=Object.create(e):(fe.prototype=e,n=new fe),t&&ge(t,n),n}var Ue=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function we(e){return/\Line truncated
|
||||||
|
|
||||||
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
|
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
|
||||||
`,t);i==-1&&(i=e.length);var a=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),l=a.indexOf("\r");l!=-1?(n.push(a.slice(0,l)),t+=l+1):(n.push(a),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},hr=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},ti=(function(){var e=y("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")})(),$t=null;function to(e){if($t!=null)return $t;var t=V(e,y("span","x")),n=t.getBoundingClientRect(),r=X(t,0,1).getBoundingClientRect();return $t=Math.abs(n.left-r.left)>1}var Wr={},Kt={};function Gt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Wr[e]=t}function Cr(e,t){Kt[e]=t}function Ur(e){if(typeof e=="string"&&Kt.hasOwnProperty(e))e=Kt[e];else if(e&&typeof e.name=="string"&&Kt.hasOwnProperty(e.name)){var t=Kt[e.name];typeof t=="string"&&(t={name:t}),e=oe(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ur("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ur("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function $r(e,t){t=Ur(t);var n=Wr[t.name];if(!n)return $r(e,"text/plain");var r=n(e,t);if(gr.hasOwnProperty(t.name)){var i=gr[t.name];for(var a in i)i.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r["_"+a]=r[a]),r[a]=i[a])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var gr={};function Kr(e,t){var n=gr.hasOwnProperty(e)?gr[e]:gr[e]={};ge(t,n)}function Vt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function _n(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Gr(e,t,n){return e.startState?e.startState(t,n):!0}var at=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};at.prototype.eol=function(){return this.pos>=this.string.length},at.prototype.sol=function(){return this.pos==this.lineStart},at.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},at.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},at.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},at.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},at.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},at.prototype.skipToEnd=function(){this.pos=this.string.length},at.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},at.prototype.backUp=function(e){this.pos-=e},at.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Oe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Oe(this.string,this.lineStart,this.tabSize):0)},at.prototype.indentation=function(){return Oe(this.string,null,this.tabSize)-(this.lineStart?Oe(this.string,this.lineStart,this.tabSize):0)},at.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(l){return n?l.toLowerCase():l},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var a=this.string.slice(this.pos).match(e);return a&&a.index>0?null:(a&&t!==!1&&(this.pos+=a[0].length),a)}},at.prototype.current=function(){return this.string.slice(this.start,this.pos)},at.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},at.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},at.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Ae(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],a=i.chunkSize();if(t<a){n=i;break}t-=a}return n.lines[t]}function ir(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(a){var l=a.text;i==n.line&&(l=l.slice(0,n.ch)),i==t.line&&(l=l.slice(t.ch)),r.push(l),++i}),r}function kn(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function Bt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function _(e){if(e.parent==null)return null;for(var t=e.parent,n=Se(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function P(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var
Line truncated
|
`,t);i==-1&&(i=e.length);var a=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),l=a.indexOf("\r");l!=-1?(n.push(a.slice(0,l)),t+=l+1):(n.push(a),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},hr=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},ti=(function(){var e=y("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")})(),$t=null;function to(e){if($t!=null)return $t;var t=V(e,y("span","x")),n=t.getBoundingClientRect(),r=X(t,0,1).getBoundingClientRect();return $t=Math.abs(n.left-r.left)>1}var Wr={},Kt={};function Gt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Wr[e]=t}function Cr(e,t){Kt[e]=t}function Ur(e){if(typeof e=="string"&&Kt.hasOwnProperty(e))e=Kt[e];else if(e&&typeof e.name=="string"&&Kt.hasOwnProperty(e.name)){var t=Kt[e.name];typeof t=="string"&&(t={name:t}),e=oe(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ur("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ur("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function $r(e,t){t=Ur(t);var n=Wr[t.name];if(!n)return $r(e,"text/plain");var r=n(e,t);if(gr.hasOwnProperty(t.name)){var i=gr[t.name];for(var a in i)i.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r["_"+a]=r[a]),r[a]=i[a])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var gr={};function Kr(e,t){var n=gr.hasOwnProperty(e)?gr[e]:gr[e]={};ge(t,n)}function Vt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function _n(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Gr(e,t,n){return e.startState?e.startState(t,n):!0}var at=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};at.prototype.eol=function(){return this.pos>=this.string.length},at.prototype.sol=function(){return this.pos==this.lineStart},at.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},at.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},at.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},at.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},at.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},at.prototype.skipToEnd=function(){this.pos=this.string.length},at.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},at.prototype.backUp=function(e){this.pos-=e},at.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Oe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Oe(this.string,this.lineStart,this.tabSize):0)},at.prototype.indentation=function(){return Oe(this.string,null,this.tabSize)-(this.lineStart?Oe(this.string,this.lineStart,this.tabSize):0)},at.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(l){return n?l.toLowerCase():l},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var a=this.string.slice(this.pos).match(e);return a&&a.index>0?null:(a&&t!==!1&&(this.pos+=a[0].length),a)}},at.prototype.current=function(){return this.string.slice(this.start,this.pos)},at.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},at.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},at.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Ae(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],a=i.chunkSize();if(t<a){n=i;break}t-=a}return n.lines[t]}function ir(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(a){var l=a.text;i==n.line&&(l=l.slice(0,n.ch)),i==t.line&&(l=l.slice(t.ch)),r.push(l),++i}),r}function kn(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function Bt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function _(e){if(e.parent==null)return null;for(var t=e.parent,n=Se(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function P(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var
Line truncated
|
||||||
`?(ue=A.appendChild(y("span",ee[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ue.setAttribute("cm-text",ee[0]),e.col+=1):(ue=e.cm.options.specialCharPlaceholder(ee[0]),ue.setAttribute("cm-text",ee[0]),s&&h<9?A.appendChild(y("span",[ue])):A.appendChild(ue),e.col+=1);e.map.push(e.pos,e.pos+1,ue),e.pos++}}if(e.trailingSpace=u.charCodeAt(t.length-1)==32,n||r||i||m||a||l){var xe=n||"";r&&(xe+=r),i&&(xe+=i);var be=y("span",[A],xe,a);if(l)for(var Ce in l)l.hasOwnProperty(Ce)&&Ce!="style"&&Ce!="class"&&be.setAttribute(Ce,l[Ce]);return e.content.appendChild(be)}e.content.appendChild(A)}}function Wc(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var a=e.charAt(i);a==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(a="\xA0"),r+=a,n=a==" "}return r}function Uc(e,t){return function(n,r,i,a,l,u,f){i=i?i+" cm-force-border":"cm-force-border";for(var m=n.pos,A=m+r.length;;){for(var B=void 0,ee=0;ee<t.length&&(B=t[ee],!(B.to>m&&B.from<=m));ee++);if(B.to>=A)return e(n,r,i,a,l,u,f);e(n,r.slice(0,B.to-m),i,a,null,u,f),a=null,r=r.slice(B.to-m),m=B.to}}}function Ea(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function $c(e,t,n){var r=e.markedSpans,i=e.text,a=0;if(!r){for(var l=1;l<n.length;l+=2)t.addToken(t,i.slice(a,a=n[l]),La(n[l+1],t.cm.options));return}for(var u=i.length,f=0,m=1,A="",B,ee,Y=0,ie,ue,me,ve,xe;;){if(Y==f){ie=ue=me=ee="",xe=null,ve=null,Y=1/0;for(var be=[],Ce=void 0,Ne=0;Ne<r.length;++Ne){var Fe=r[Ne],$e=Fe.marker;if($e.type=="bookmark"&&Fe.from==f&&$e.widgetNode)be.push($e);else if(Fe.from<=f&&(Fe.to==null||Fe.to>f||$e.collapsed&&Fe.to==f&&Fe.from==f)){if(Fe.to!=null&&Fe.to!=f&&Y>Fe.to&&(Y=Fe.to,ue=""),$e.className&&(ie+=" "+$e.className),$e.css&&(ee=(ee?ee+";":"")+$e.css),$e.startStyle&&Fe.from==f&&(me+=" "+$e.startStyle),$e.endStyle&&Fe.to==Y&&(Ce||(Ce=[])).push($e.endStyle,Fe.to),$e.title&&((xe||(xe={})).title=$e.title),$e.attributes)for(var Ve in $e.attributes)(xe||(xe={}))[Ve]=$e.attributes[Ve];$e.collapsed&&(!ve||oo(ve.marker,$e)<0)&&(ve=Fe)}else Fe.from>f&&Y>Fe.from&&(Y=Fe.from)}if(Ce)for(var vt=0;vt<Ce.length;vt+=2)Ce[vt+1]==Y&&(ue+=" "+Ce[vt]);if(!ve||ve.from==f)for(var rt=0;rt<be.length;++rt)Ea(t,0,be[rt]);if(ve&&(ve.from||0)==f){if(Ea(t,(ve.to==null?u+1:ve.to)-f,ve.marker,ve.from==null),ve.to==null)return;ve.to==f&&(ve=!1)}}if(f>=u)break;for(var Ot=Math.min(u,Y);;){if(A){var At=f+A.length;if(!ve){var ut=At>Ot?A.slice(0,Ot-f):A;t.addToken(t,ut,B?B+ie:ie,me,f+ut.length==Y?ue:"",ee,xe)}if(At>=Ot){A=A.slice(Ot-f),f=Ot;break}f=At,me=""}A=i.slice(a,a=n[m++]),B=La(n[m++],t.cm.options)}}}function za(e,t,n){this.line=t,this.rest=Nc(t),this.size=this.rest?_(ce(this.rest))-n+1:1,this.node=this.text=null,this.hidden=mr(e,t)}function si(e,t,n){for(var r=[],i,a=t;a<n;a=i){var l=new za(e.doc,Ae(e.doc,a),a);i=a+l.size,r.push(l)}return r}var Yr=null;function Kc(e){Yr?Yr.ops.push(e):e.ownsGroup=Yr={ops:[e],delayedCallbacks:[]}}function Gc(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Zc(e,t){var n=e.ownsGroup;if(n)try{Gc(n)}finally{Yr=null,t(n)}}var Tn=null;function ht(e,t){var n=nr(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;Yr?i=Yr.delayedCallbacks:Tn?i=Tn:(i=Tn=[],setTimeout(Xc,0));for(var a=function(u){i.push(function(){return n[u].apply(null,r)})},l=0;l<n.length;++l)a(l)}}function Xc(){var e=Tn;Tn=null;for(var t=0;t<e.length;++t)e[t]()}function Ma(e,t,n,r){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];a=="text"?Qc(e,t):a=="gutter"?Da(e,t,n,r):a=="class"?uo(e,t):a=="widget"&&Vc(e,t,r)}t.changes=null}function Ln(e){return e.node==e.text&&(e.node=y("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),s&&h<8&&(e.node.style.zIndex=2)),e.node}function Yc(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=Ln(t);t.background=r.insertBefore(y("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Aa(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Ca(e,t)}function Qc(e,t){var n=t.text.className,r=Aa(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,uo(e,t)):n&&(t.te
Line truncated
|
`?(ue=A.appendChild(y("span",ee[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ue.setAttribute("cm-text",ee[0]),e.col+=1):(ue=e.cm.options.specialCharPlaceholder(ee[0]),ue.setAttribute("cm-text",ee[0]),s&&h<9?A.appendChild(y("span",[ue])):A.appendChild(ue),e.col+=1);e.map.push(e.pos,e.pos+1,ue),e.pos++}}if(e.trailingSpace=u.charCodeAt(t.length-1)==32,n||r||i||m||a||l){var xe=n||"";r&&(xe+=r),i&&(xe+=i);var be=y("span",[A],xe,a);if(l)for(var Ce in l)l.hasOwnProperty(Ce)&&Ce!="style"&&Ce!="class"&&be.setAttribute(Ce,l[Ce]);return e.content.appendChild(be)}e.content.appendChild(A)}}function Wc(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var a=e.charAt(i);a==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(a="\xA0"),r+=a,n=a==" "}return r}function Uc(e,t){return function(n,r,i,a,l,u,f){i=i?i+" cm-force-border":"cm-force-border";for(var m=n.pos,A=m+r.length;;){for(var B=void 0,ee=0;ee<t.length&&(B=t[ee],!(B.to>m&&B.from<=m));ee++);if(B.to>=A)return e(n,r,i,a,l,u,f);e(n,r.slice(0,B.to-m),i,a,null,u,f),a=null,r=r.slice(B.to-m),m=B.to}}}function Ea(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function $c(e,t,n){var r=e.markedSpans,i=e.text,a=0;if(!r){for(var l=1;l<n.length;l+=2)t.addToken(t,i.slice(a,a=n[l]),La(n[l+1],t.cm.options));return}for(var u=i.length,f=0,m=1,A="",B,ee,Y=0,ie,ue,me,ve,xe;;){if(Y==f){ie=ue=me=ee="",xe=null,ve=null,Y=1/0;for(var be=[],Ce=void 0,Ne=0;Ne<r.length;++Ne){var Fe=r[Ne],$e=Fe.marker;if($e.type=="bookmark"&&Fe.from==f&&$e.widgetNode)be.push($e);else if(Fe.from<=f&&(Fe.to==null||Fe.to>f||$e.collapsed&&Fe.to==f&&Fe.from==f)){if(Fe.to!=null&&Fe.to!=f&&Y>Fe.to&&(Y=Fe.to,ue=""),$e.className&&(ie+=" "+$e.className),$e.css&&(ee=(ee?ee+";":"")+$e.css),$e.startStyle&&Fe.from==f&&(me+=" "+$e.startStyle),$e.endStyle&&Fe.to==Y&&(Ce||(Ce=[])).push($e.endStyle,Fe.to),$e.title&&((xe||(xe={})).title=$e.title),$e.attributes)for(var Ve in $e.attributes)(xe||(xe={}))[Ve]=$e.attributes[Ve];$e.collapsed&&(!ve||oo(ve.marker,$e)<0)&&(ve=Fe)}else Fe.from>f&&Y>Fe.from&&(Y=Fe.from)}if(Ce)for(var vt=0;vt<Ce.length;vt+=2)Ce[vt+1]==Y&&(ue+=" "+Ce[vt]);if(!ve||ve.from==f)for(var rt=0;rt<be.length;++rt)Ea(t,0,be[rt]);if(ve&&(ve.from||0)==f){if(Ea(t,(ve.to==null?u+1:ve.to)-f,ve.marker,ve.from==null),ve.to==null)return;ve.to==f&&(ve=!1)}}if(f>=u)break;for(var Ot=Math.min(u,Y);;){if(A){var At=f+A.length;if(!ve){var ut=At>Ot?A.slice(0,Ot-f):A;t.addToken(t,ut,B?B+ie:ie,me,f+ut.length==Y?ue:"",ee,xe)}if(At>=Ot){A=A.slice(Ot-f),f=Ot;break}f=At,me=""}A=i.slice(a,a=n[m++]),B=La(n[m++],t.cm.options)}}}function za(e,t,n){this.line=t,this.rest=Nc(t),this.size=this.rest?_(ce(this.rest))-n+1:1,this.node=this.text=null,this.hidden=mr(e,t)}function si(e,t,n){for(var r=[],i,a=t;a<n;a=i){var l=new za(e.doc,Ae(e.doc,a),a);i=a+l.size,r.push(l)}return r}var Yr=null;function Kc(e){Yr?Yr.ops.push(e):e.ownsGroup=Yr={ops:[e],delayedCallbacks:[]}}function Gc(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Zc(e,t){var n=e.ownsGroup;if(n)try{Gc(n)}finally{Yr=null,t(n)}}var Tn=null;function ht(e,t){var n=nr(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;Yr?i=Yr.delayedCallbacks:Tn?i=Tn:(i=Tn=[],setTimeout(Xc,0));for(var a=function(u){i.push(function(){return n[u].apply(null,r)})},l=0;l<n.length;++l)a(l)}}function Xc(){var e=Tn;Tn=null;for(var t=0;t<e.length;++t)e[t]()}function Ma(e,t,n,r){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];a=="text"?Qc(e,t):a=="gutter"?Da(e,t,n,r):a=="class"?uo(e,t):a=="widget"&&Vc(e,t,r)}t.changes=null}function Ln(e){return e.node==e.text&&(e.node=y("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),s&&h<8&&(e.node.style.zIndex=2)),e.node}function Yc(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=Ln(t);t.background=r.insertBefore(y("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Aa(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Ca(e,t)}function Qc(e,t){var n=t.text.className,r=Aa(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,uo(e,t)):n&&(t.te
Line truncated
|
||||||
top: `+Ce+"px; width: "+(Ne??f-be)+`px;
|
top: `+Ce+"px; width: "+(Ne??f-be)+`px;
|
||||||
height: `+(Fe-Ce)+"px"))}function B(be,Ce,Ne){var Fe=Ae(i,be),$e=Fe.text.length,Ve,vt;function rt(ut,Dt){return fi(e,ne(be,ut),"div",Fe,Dt)}function Ot(ut,Dt,yt){var ft=Ga(e,Fe,null,ut),ct=Dt=="ltr"==(yt=="after")?"left":"right",lt=yt=="after"?ft.begin:ft.end-(/\s/.test(Fe.text.charAt(ft.end-1))?2:1);return rt(lt,ct)[ct]}var At=Pe(Fe,i.direction);return nt(At,Ce||0,Ne??$e,function(ut,Dt,yt,ft){var ct=yt=="ltr",lt=rt(ut,ct?"left":"right"),qt=rt(Dt-1,ct?"right":"left"),pn=Ce==null&&ut==0,Sr=Ne==null&&Dt==$e,St=ft==0,rr=!At||ft==At.length-1;if(qt.top-lt.top<=3){var bt=(m?pn:Sr)&&St,Zo=(m?Sr:pn)&&rr,cr=bt?u:(ct?lt:qt).left,Nr=Zo?f:(ct?qt:lt).right;A(cr,lt.top,Nr-cr,lt.bottom)}else{var Or,Lt,hn,Xo;ct?(Or=m&&pn&&St?u:lt.left,Lt=m?f:Ot(ut,yt,"before"),hn=m?u:Ot(Dt,yt,"after"),Xo=m&&Sr&&rr?f:qt.right):(Or=m?Ot(ut,yt,"before"):u,Lt=!m&&pn&&St?f:lt.right,hn=!m&&Sr&&rr?u:qt.left,Xo=m?Ot(Dt,yt,"after"):f),A(Or,lt.top,Lt-Or,lt.bottom),lt.bottom<qt.top&&A(u,lt.bottom,null,qt.top),A(hn,qt.top,Xo-hn,qt.bottom)}(!Ve||pi(lt,Ve)<0)&&(Ve=lt),pi(qt,Ve)<0&&(Ve=qt),(!vt||pi(lt,vt)<0)&&(vt=lt),pi(qt,vt)<0&&(vt=qt)}),{start:Ve,end:vt}}var ee=t.from(),Y=t.to();if(ee.line==Y.line)B(ee.line,ee.ch,Y.ch);else{var ie=Ae(i,ee.line),ue=Ae(i,Y.line),me=Zt(ie)==Zt(ue),ve=B(ee.line,ee.ch,me?ie.text.length+1:null).end,xe=B(Y.line,me?0:null,Y.ch).start;me&&(ve.top<xe.top-2?(A(ve.right,ve.top,null,ve.bottom),A(u,xe.top,xe.left,xe.bottom)):A(ve.right,ve.top,xe.left-ve.right,ve.bottom)),ve.bottom<xe.top&&A(u,ve.bottom,null,xe.top)}n.appendChild(a)}function ko(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||en(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Qa(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||So(e))}function wo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&en(e))},100)}function So(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(it(e,"focus",e,t),e.state.focused=!0,se(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),g&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ko(e))}function en(e,t){e.state.delayingBlurEvent||(e.state.focused&&(it(e,"blur",e,t),e.state.focused=!1,Q(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function hi(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,a=0,l=0;l<t.view.length;l++){var u=t.view[l],f=e.options.lineWrapping,m=void 0,A=0;if(!u.hidden){if(i+=u.line.height,s&&h<8){var B=u.node.offsetTop+u.node.offsetHeight;m=B-n,n=B}else{var ee=u.node.getBoundingClientRect();m=ee.bottom-ee.top,!f&&u.text.firstChild&&(A=u.text.firstChild.getBoundingClientRect().right-ee.left-1)}var Y=u.line.height-m;if((Y>.005||Y<-.005)&&(i<r&&(a-=Y),Bt(u.line,m),Va(u.line),u.rest))for(var ie=0;ie<u.rest.length;ie++)Va(u.rest[ie]);if(A>e.display.sizerWidth){var ue=Math.ceil(A/Jr(e.display));ue>e.display.maxLineLength&&(e.display.maxLineLength=ue,e.display.maxLine=u.line,e.display.maxLineChanged=!0)}}}Math.abs(a)>2&&(t.scroller.scrollTop+=a)}function Va(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function gi(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-ui(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,a=P(t,r),l=P(t,i);if(n&&n.ensure){var u=n.ensure.from.line,f=n.ensure.to.line;u<a?(a=u,l=P(t,ar(Ae(t,u))+e.wrapper.clientHeight)):Math.min(f,t.lastLine())>=l&&(a=P(t,ar(Ae(t,f))-e.wrapper.clientHeight),l=f)}return{from:a,to:Math.max(l,a+1)}}function df(e,t){if(!ot(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,a=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(a.defaultView.innerHeight||a.documentElement.clientHeight)&&(i=!1),i!=null&&!M){var l=y("div","\u200B",null,`position: absolute;
|
height: `+(Fe-Ce)+"px"))}function B(be,Ce,Ne){var Fe=Ae(i,be),$e=Fe.text.length,Ve,vt;function rt(ut,Dt){return fi(e,ne(be,ut),"div",Fe,Dt)}function Ot(ut,Dt,yt){var ft=Ga(e,Fe,null,ut),ct=Dt=="ltr"==(yt=="after")?"left":"right",lt=yt=="after"?ft.begin:ft.end-(/\s/.test(Fe.text.charAt(ft.end-1))?2:1);return rt(lt,ct)[ct]}var At=Pe(Fe,i.direction);return nt(At,Ce||0,Ne??$e,function(ut,Dt,yt,ft){var ct=yt=="ltr",lt=rt(ut,ct?"left":"right"),qt=rt(Dt-1,ct?"right":"left"),pn=Ce==null&&ut==0,Sr=Ne==null&&Dt==$e,St=ft==0,rr=!At||ft==At.length-1;if(qt.top-lt.top<=3){var bt=(m?pn:Sr)&&St,Zo=(m?Sr:pn)&&rr,cr=bt?u:(ct?lt:qt).left,Nr=Zo?f:(ct?qt:lt).right;A(cr,lt.top,Nr-cr,lt.bottom)}else{var Or,Lt,hn,Xo;ct?(Or=m&&pn&&St?u:lt.left,Lt=m?f:Ot(ut,yt,"before"),hn=m?u:Ot(Dt,yt,"after"),Xo=m&&Sr&&rr?f:qt.right):(Or=m?Ot(ut,yt,"before"):u,Lt=!m&&pn&&St?f:lt.right,hn=!m&&Sr&&rr?u:qt.left,Xo=m?Ot(Dt,yt,"after"):f),A(Or,lt.top,Lt-Or,lt.bottom),lt.bottom<qt.top&&A(u,lt.bottom,null,qt.top),A(hn,qt.top,Xo-hn,qt.bottom)}(!Ve||pi(lt,Ve)<0)&&(Ve=lt),pi(qt,Ve)<0&&(Ve=qt),(!vt||pi(lt,vt)<0)&&(vt=lt),pi(qt,vt)<0&&(vt=qt)}),{start:Ve,end:vt}}var ee=t.from(),Y=t.to();if(ee.line==Y.line)B(ee.line,ee.ch,Y.ch);else{var ie=Ae(i,ee.line),ue=Ae(i,Y.line),me=Zt(ie)==Zt(ue),ve=B(ee.line,ee.ch,me?ie.text.length+1:null).end,xe=B(Y.line,me?0:null,Y.ch).start;me&&(ve.top<xe.top-2?(A(ve.right,ve.top,null,ve.bottom),A(u,xe.top,xe.left,xe.bottom)):A(ve.right,ve.top,xe.left-ve.right,ve.bottom)),ve.bottom<xe.top&&A(u,ve.bottom,null,xe.top)}n.appendChild(a)}function ko(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||en(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Qa(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||So(e))}function wo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&en(e))},100)}function So(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(it(e,"focus",e,t),e.state.focused=!0,se(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),g&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ko(e))}function en(e,t){e.state.delayingBlurEvent||(e.state.focused&&(it(e,"blur",e,t),e.state.focused=!1,Q(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function hi(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,a=0,l=0;l<t.view.length;l++){var u=t.view[l],f=e.options.lineWrapping,m=void 0,A=0;if(!u.hidden){if(i+=u.line.height,s&&h<8){var B=u.node.offsetTop+u.node.offsetHeight;m=B-n,n=B}else{var ee=u.node.getBoundingClientRect();m=ee.bottom-ee.top,!f&&u.text.firstChild&&(A=u.text.firstChild.getBoundingClientRect().right-ee.left-1)}var Y=u.line.height-m;if((Y>.005||Y<-.005)&&(i<r&&(a-=Y),Bt(u.line,m),Va(u.line),u.rest))for(var ie=0;ie<u.rest.length;ie++)Va(u.rest[ie]);if(A>e.display.sizerWidth){var ue=Math.ceil(A/Jr(e.display));ue>e.display.maxLineLength&&(e.display.maxLineLength=ue,e.display.maxLine=u.line,e.display.maxLineChanged=!0)}}}Math.abs(a)>2&&(t.scroller.scrollTop+=a)}function Va(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function gi(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-ui(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,a=P(t,r),l=P(t,i);if(n&&n.ensure){var u=n.ensure.from.line,f=n.ensure.to.line;u<a?(a=u,l=P(t,ar(Ae(t,u))+e.wrapper.clientHeight)):Math.min(f,t.lastLine())>=l&&(a=P(t,ar(Ae(t,f))-e.wrapper.clientHeight),l=f)}return{from:a,to:Math.max(l,a+1)}}function df(e,t){if(!ot(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,a=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(a.defaultView.innerHeight||a.documentElement.clientHeight)&&(i=!1),i!=null&&!z){var l=y("div","\u200B",null,`position: absolute;
|
||||||
top: `+(t.top-n.viewOffset-ui(e.display))+`px;
|
top: `+(t.top-n.viewOffset-ui(e.display))+`px;
|
||||||
height: `+(t.bottom-t.top+er(e)+n.barHeight)+`px;
|
height: `+(t.bottom-t.top+er(e)+n.barHeight)+`px;
|
||||||
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(i),e.display.lineSpace.removeChild(l)}}}function pf(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?ne(t.line,t.ch+1,"before"):t,t=t.ch?ne(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var a=0;a<5;a++){var l=!1,u=Xt(e,t),f=!n||n==t?u:Xt(e,n);i={left:Math.min(u.left,f.left),top:Math.min(u.top,f.top)-r,right:Math.max(u.left,f.left),bottom:Math.max(u.bottom,f.bottom)+r};var m=To(e,i),A=e.doc.scrollTop,B=e.doc.scrollLeft;if(m.scrollTop!=null&&(An(e,m.scrollTop),Math.abs(e.doc.scrollTop-A)>1&&(l=!0)),m.scrollLeft!=null&&(Dr(e,m.scrollLeft),Math.abs(e.doc.scrollLeft-B)>1&&(l=!0)),!l)break}return i}function hf(e,t){var n=To(e,t);n.scrollTop!=null&&An(e,n.scrollTop),n.scrollLeft!=null&&Dr(e,n.scrollLeft)}function To(e,t){var n=e.display,r=Vr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,a=fo(e),l={};t.bottom-t.top>a&&(t.bottom=t.top+a);var u=e.doc.height+co(n),f=t.top<r,m=t.bottom>u-r;if(t.top<i)l.scrollTop=f?0:t.top;else if(t.bottom>i+a){var A=Math.min(t.top,(m?u:t.bottom)-a);A!=i&&(l.scrollTop=A)}var B=e.options.fixedGutter?0:n.gutters.offsetWidth,ee=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-B,Y=Er(e)-n.gutters.offsetWidth,ie=t.right-t.left>Y;return ie&&(t.right=t.left+Y),t.left<10?l.scrollLeft=0:t.left<ee?l.scrollLeft=Math.max(0,t.left+B-(ie?0:10)):t.right>Y+ee-3&&(l.scrollLeft=t.right+(ie?0:10)-Y),l}function Lo(e,t){t!=null&&(mi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function tn(e){mi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Mn(e,t,n){(t!=null||n!=null)&&mi(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function gf(e,t){mi(e),e.curOp.scrollToPos=t}function mi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=$a(e,t.from),r=$a(e,t.to);Ja(e,n,r,t.margin)}}function Ja(e,t,n,r){var i=To(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Mn(e,i.scrollLeft,i.scrollTop)}function An(e,t){Math.abs(e.doc.scrollTop-t)<2||(v||Eo(e,{top:t}),el(e,t,!0),v&&Eo(e),Fn(e,100))}function el(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Dr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,ol(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Dn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+co(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+er(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var qr=function(e,t,n){this.cm=n;var r=this.vert=y("div",[y("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=y("div",[y("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),Ie(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ie(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,s&&h<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};qr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},qr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},qr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.di
Line truncated
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(i),e.display.lineSpace.removeChild(l)}}}function pf(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?ne(t.line,t.ch+1,"before"):t,t=t.ch?ne(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var a=0;a<5;a++){var l=!1,u=Xt(e,t),f=!n||n==t?u:Xt(e,n);i={left:Math.min(u.left,f.left),top:Math.min(u.top,f.top)-r,right:Math.max(u.left,f.left),bottom:Math.max(u.bottom,f.bottom)+r};var m=To(e,i),A=e.doc.scrollTop,B=e.doc.scrollLeft;if(m.scrollTop!=null&&(An(e,m.scrollTop),Math.abs(e.doc.scrollTop-A)>1&&(l=!0)),m.scrollLeft!=null&&(Dr(e,m.scrollLeft),Math.abs(e.doc.scrollLeft-B)>1&&(l=!0)),!l)break}return i}function hf(e,t){var n=To(e,t);n.scrollTop!=null&&An(e,n.scrollTop),n.scrollLeft!=null&&Dr(e,n.scrollLeft)}function To(e,t){var n=e.display,r=Vr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,a=fo(e),l={};t.bottom-t.top>a&&(t.bottom=t.top+a);var u=e.doc.height+co(n),f=t.top<r,m=t.bottom>u-r;if(t.top<i)l.scrollTop=f?0:t.top;else if(t.bottom>i+a){var A=Math.min(t.top,(m?u:t.bottom)-a);A!=i&&(l.scrollTop=A)}var B=e.options.fixedGutter?0:n.gutters.offsetWidth,ee=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-B,Y=Er(e)-n.gutters.offsetWidth,ie=t.right-t.left>Y;return ie&&(t.right=t.left+Y),t.left<10?l.scrollLeft=0:t.left<ee?l.scrollLeft=Math.max(0,t.left+B-(ie?0:10)):t.right>Y+ee-3&&(l.scrollLeft=t.right+(ie?0:10)-Y),l}function Lo(e,t){t!=null&&(mi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function tn(e){mi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Mn(e,t,n){(t!=null||n!=null)&&mi(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function gf(e,t){mi(e),e.curOp.scrollToPos=t}function mi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=$a(e,t.from),r=$a(e,t.to);Ja(e,n,r,t.margin)}}function Ja(e,t,n,r){var i=To(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Mn(e,i.scrollLeft,i.scrollTop)}function An(e,t){Math.abs(e.doc.scrollTop-t)<2||(v||Eo(e,{top:t}),el(e,t,!0),v&&Eo(e),Fn(e,100))}function el(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Dr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,ol(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Dn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+co(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+er(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var qr=function(e,t,n){this.cm=n;var r=this.vert=y("div",[y("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=y("div",[y("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),Ie(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ie(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,s&&h<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};qr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},qr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},qr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.di
Line truncated
|
||||||
`},setDirection:mt(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&Af(this.cm))})}),Mt.prototype.eachLine=Mt.prototype.iter;var Nl=0;function Uf(e){var t=this;if(Ol(t),!(ot(t,e)||lr(t.display,e))){kt(e),s&&(Nl=+new Date);var n=Mr(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,a=Array(i),l=0,u=function(){++l==i&>(t,function(){n=je(t.doc,n);var Y={from:n,to:n,text:t.doc.splitLines(a.filter(function(ie){return ie!=null}).join(t.doc.lineSeparator())),origin:"paste"};an(t.doc,Y),_l(t.doc,yr(je(t.doc,n),je(t.doc,xr(Y))))})()},f=function(Y,ie){if(t.options.allowDropFileTypes&&Se(t.options.allowDropFileTypes,Y.type)==-1){u();return}var ue=new FileReader;ue.onerror=function(){return u()},ue.onload=function(){var me=ue.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(me)){u();return}a[ie]=me,u()},ue.readAsText(Y)},m=0;m<r.length;m++)f(r[m],m);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var A=e.dataTransfer.getData("Text");if(A){var B;if(t.state.draggingText&&!t.state.draggingText.copy&&(B=t.listSelections()),ki(t.doc,yr(n,n)),B)for(var ee=0;ee<B.length;++ee)ln(t.doc,"",B[ee].anchor,B[ee].head,"drag");t.replaceSelection(A,"around","paste"),t.display.input.focus()}}catch{}}}}function $f(e,t){if(s&&(!e.state.draggingText||+new Date-Nl<100)){dr(t);return}if(!(ot(e,t)||lr(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!x)){var n=y("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}function Kf(e,t){var n=Mr(e,t);if(n){var r=document.createDocumentFragment();_o(e,n,r),e.display.dragCursor||(e.display.dragCursor=y("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),V(e.display.dragCursor,r)}}function Ol(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Pl(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var a=0;a<n.length;a++)e(n[a])})}}var Bl=!1;function Gf(){Bl||(Zf(),Bl=!0)}function Zf(){var e;Ie(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Pl(Xf)},100))}),Ie(window,"blur",function(){return Pl(en)})}function Xf(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var wr={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Wn=0;Wn<10;Wn++)wr[Wn+48]=wr[Wn+96]=String(Wn);for(var Ti=65;Ti<=90;Ti++)wr[Ti]=String.fromCharCode(Ti);for(var Un=1;Un<=12;Un++)wr[Un+111]=wr[Un+63235]="F"+Un;var ur={};ur.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ur.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ur.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transpoLine truncated
|
`},setDirection:mt(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&Af(this.cm))})}),Mt.prototype.eachLine=Mt.prototype.iter;var Nl=0;function Uf(e){var t=this;if(Ol(t),!(ot(t,e)||lr(t.display,e))){kt(e),s&&(Nl=+new Date);var n=Mr(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,a=Array(i),l=0,u=function(){++l==i&>(t,function(){n=je(t.doc,n);var Y={from:n,to:n,text:t.doc.splitLines(a.filter(function(ie){return ie!=null}).join(t.doc.lineSeparator())),origin:"paste"};an(t.doc,Y),_l(t.doc,yr(je(t.doc,n),je(t.doc,xr(Y))))})()},f=function(Y,ie){if(t.options.allowDropFileTypes&&Se(t.options.allowDropFileTypes,Y.type)==-1){u();return}var ue=new FileReader;ue.onerror=function(){return u()},ue.onload=function(){var me=ue.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(me)){u();return}a[ie]=me,u()},ue.readAsText(Y)},m=0;m<r.length;m++)f(r[m],m);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var A=e.dataTransfer.getData("Text");if(A){var B;if(t.state.draggingText&&!t.state.draggingText.copy&&(B=t.listSelections()),ki(t.doc,yr(n,n)),B)for(var ee=0;ee<B.length;++ee)ln(t.doc,"",B[ee].anchor,B[ee].head,"drag");t.replaceSelection(A,"around","paste"),t.display.input.focus()}}catch{}}}}function $f(e,t){if(s&&(!e.state.draggingText||+new Date-Nl<100)){dr(t);return}if(!(ot(e,t)||lr(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!x)){var n=y("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}function Kf(e,t){var n=Mr(e,t);if(n){var r=document.createDocumentFragment();_o(e,n,r),e.display.dragCursor||(e.display.dragCursor=y("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),V(e.display.dragCursor,r)}}function Ol(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Pl(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var a=0;a<n.length;a++)e(n[a])})}}var Bl=!1;function Gf(){Bl||(Zf(),Bl=!0)}function Zf(){var e;Ie(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Pl(Xf)},100))}),Ie(window,"blur",function(){return Pl(en)})}function Xf(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var wr={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Wn=0;Wn<10;Wn++)wr[Wn+48]=wr[Wn+96]=String(Wn);for(var Ti=65;Ti<=90;Ti++)wr[Ti]=String.fromCharCode(Ti);for(var Un=1;Un<=12;Un++)wr[Un+111]=wr[Un+63235]="F"+Un;var ur={};ur.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ur.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ur.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transpoLine truncated
|
||||||
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Wl(e,t){var n=Ae(e.doc,t),r=Zt(n);return r!=n&&(t=_(r)),jo(!0,e,r,t,1)}function Jf(e,t){var n=Ae(e.doc,t),r=Ic(n);return r!=n&&(t=_(r)),jo(!0,e,n,t,-1)}function Ul(e,t){var n=Wl(e,t.line),r=Ae(e.doc,n.line),i=Pe(r,e.doc.direction);if(!i||i[0].level==0){var a=Math.max(n.ch,r.text.search(/\S/)),l=t.line==n.line&&t.ch<=a&&t.ch;return ne(n.line,l?0:a,n.sticky)}return n}function Ci(e,t,n){if(typeof t=="string"&&(t=$n[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Ze}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function ed(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=un(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&un(t,e.options.extraKeys,n,e)||un(t,e.options.keyMap,n,e)}var td=new qe;function Kn(e,t,n,r){var i=e.state.keySeq;if(i){if(jl(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:td.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),$l(e,i+" "+t,n,r))return!0}return $l(e,t,n,r)}function $l(e,t,n,r){var i=ed(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&ht(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(kt(n),ko(e)),!!i}function Kl(e,t){var n=Hl(t,!0);return n?t.shiftKey&&!e.state.keySeq?Kn(e,"Shift-"+n,t,function(r){return Ci(e,r,!0)})||Kn(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return Ci(e,r)}):Kn(e,n,t,function(r){return Ci(e,r)}):!1}function rd(e,t,n){return Kn(e,"'"+n+"'",t,function(r){return Ci(e,r,!0)})}var Ro=null;function Gl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=R(he(t)),!ot(t,e))){s&&h<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=Kl(t,e);d&&(Ro=r?n:null,!r&&n==88&&!ti&&(N?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),v&&!N&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&nd(t)}}function nd(e){var t=e.display.lineDiv;se(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(Q(t,"CodeMirror-crosshair"),_t(document,"keyup",n),_t(document,"mouseover",n))}Ie(document,"keyup",n),Ie(document,"mouseover",n)}function Zl(e){e.keyCode==16&&(this.doc.sel.shift=!1),ot(this,e)}function Xl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(lr(t.display,e)||ot(t,e)||e.ctrlKey&&!e.altKey||N&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(d&&n==Ro){Ro=null,kt(e);return}if(!(d&&(!e.which||e.which<10)&&Kl(t,e))){var i=String.fromCharCode(r??n);i!="\b"&&(rd(t,e,i)||t.display.input.onKeyPress(e))}}}var id=400,Ho=function(e,t,n){this.time=e,this.pos=t,this.button=n};Ho.prototype.compare=function(e,t,n){return this.time+id>e&&ye(t,this.pos)==0&&n==this.button};var Gn,Zn;function od(e,t){var n=+new Date;return Zn&&Zn.compare(n,e,t)?(Gn=Zn=null,"triple"):Gn&&Gn.compare(n,e,t)?(Zn=new Ho(n,e,t),Gn=null,"double"):(Gn=new Ho(n,e,t),Zn=null,"single")}function Yl(e){var t=this,n=t.display;if(!(ot(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,lr(n,e)){g||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!Wo(t,e)){var r=Mr(t,e),i=Ut(e),a=r?od(r,i):"single";de(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&ad(t,i,r,a,e))&&(i==1?r?sd(t,r,a,e):yn(e)==n.scroller&&kt(e):i==2?(r&&_i(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(F?t.display.input.onContextMenu(e):wo(t)))}}}function ad(e,t,n,r,i){var a="Click";return r=="double"?a="Double"+a:r=="triple"&&(a="Triple"+a),a=(t==1?"Left":t==2?"Middle":"Right")+a,Kn(e,Rl(a,i),i,function(l){if(typeof l=="string"&&(l=$n[l]),!l)return!1;var u=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),u=l(e,n)!=Ze}finally{e.state.suppressEdits=!1}return u})}function ld(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var a=K?n.shiftKey&&n.metaKey:n.altKey;i.unit=a?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=N?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(N?n.altKey:n.ctrlKey)),i}function sd(e,t,n,r){s?setTimeout(Ee(Qa,e),0):e.curOp.focus=R(he(e));var i=ld(e,n,r),a=e.doc.sel,l;e.options.dragDrop&&eo&&!e.isReadOnly()&&n=="single"&&(l=a.contains(t))>-1&&(ye((l=a.ranges[l]).from(),t)<0||t.xRel>0)&&(ye(l.to(),t)>0||t.xRel<0)?ud(e,r,t,i):cd(e,r,t,i)}function ud(e,t,n,r){var i=e.display,a=!1,l=gt(e,function(m){g&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:wo(e)),_t(i.wrapper.ownerDocument,"mouseup",l),_t(i.wrapper.ownerDocument,"mousemove",u),_t(i.scroller,"dragstart",f),_t(i.scroller,"drop",l),a||(kt(m),r.a
Line truncated
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Wl(e,t){var n=Ae(e.doc,t),r=Zt(n);return r!=n&&(t=_(r)),jo(!0,e,r,t,1)}function Jf(e,t){var n=Ae(e.doc,t),r=Ic(n);return r!=n&&(t=_(r)),jo(!0,e,n,t,-1)}function Ul(e,t){var n=Wl(e,t.line),r=Ae(e.doc,n.line),i=Pe(r,e.doc.direction);if(!i||i[0].level==0){var a=Math.max(n.ch,r.text.search(/\S/)),l=t.line==n.line&&t.ch<=a&&t.ch;return ne(n.line,l?0:a,n.sticky)}return n}function Ci(e,t,n){if(typeof t=="string"&&(t=$n[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Ze}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function ed(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=un(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&un(t,e.options.extraKeys,n,e)||un(t,e.options.keyMap,n,e)}var td=new qe;function Kn(e,t,n,r){var i=e.state.keySeq;if(i){if(jl(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:td.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),$l(e,i+" "+t,n,r))return!0}return $l(e,t,n,r)}function $l(e,t,n,r){var i=ed(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&ht(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(kt(n),ko(e)),!!i}function Kl(e,t){var n=Hl(t,!0);return n?t.shiftKey&&!e.state.keySeq?Kn(e,"Shift-"+n,t,function(r){return Ci(e,r,!0)})||Kn(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return Ci(e,r)}):Kn(e,n,t,function(r){return Ci(e,r)}):!1}function rd(e,t,n){return Kn(e,"'"+n+"'",t,function(r){return Ci(e,r,!0)})}var Ro=null;function Gl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=R(he(t)),!ot(t,e))){s&&h<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=Kl(t,e);d&&(Ro=r?n:null,!r&&n==88&&!ti&&(O?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),v&&!O&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&nd(t)}}function nd(e){var t=e.display.lineDiv;se(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(Q(t,"CodeMirror-crosshair"),_t(document,"keyup",n),_t(document,"mouseover",n))}Ie(document,"keyup",n),Ie(document,"mouseover",n)}function Zl(e){e.keyCode==16&&(this.doc.sel.shift=!1),ot(this,e)}function Xl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(lr(t.display,e)||ot(t,e)||e.ctrlKey&&!e.altKey||O&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(d&&n==Ro){Ro=null,kt(e);return}if(!(d&&(!e.which||e.which<10)&&Kl(t,e))){var i=String.fromCharCode(r??n);i!="\b"&&(rd(t,e,i)||t.display.input.onKeyPress(e))}}}var id=400,Ho=function(e,t,n){this.time=e,this.pos=t,this.button=n};Ho.prototype.compare=function(e,t,n){return this.time+id>e&&ye(t,this.pos)==0&&n==this.button};var Gn,Zn;function od(e,t){var n=+new Date;return Zn&&Zn.compare(n,e,t)?(Gn=Zn=null,"triple"):Gn&&Gn.compare(n,e,t)?(Zn=new Ho(n,e,t),Gn=null,"double"):(Gn=new Ho(n,e,t),Zn=null,"single")}function Yl(e){var t=this,n=t.display;if(!(ot(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,lr(n,e)){g||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!Wo(t,e)){var r=Mr(t,e),i=Ut(e),a=r?od(r,i):"single";de(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&ad(t,i,r,a,e))&&(i==1?r?sd(t,r,a,e):yn(e)==n.scroller&&kt(e):i==2?(r&&_i(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(q?t.display.input.onContextMenu(e):wo(t)))}}}function ad(e,t,n,r,i){var a="Click";return r=="double"?a="Double"+a:r=="triple"&&(a="Triple"+a),a=(t==1?"Left":t==2?"Middle":"Right")+a,Kn(e,Rl(a,i),i,function(l){if(typeof l=="string"&&(l=$n[l]),!l)return!1;var u=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),u=l(e,n)!=Ze}finally{e.state.suppressEdits=!1}return u})}function ld(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var a=W?n.shiftKey&&n.metaKey:n.altKey;i.unit=a?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=O?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(O?n.altKey:n.ctrlKey)),i}function sd(e,t,n,r){s?setTimeout(Ee(Qa,e),0):e.curOp.focus=R(he(e));var i=ld(e,n,r),a=e.doc.sel,l;e.options.dragDrop&&eo&&!e.isReadOnly()&&n=="single"&&(l=a.contains(t))>-1&&(ye((l=a.ranges[l]).from(),t)<0||t.xRel>0)&&(ye(l.to(),t)>0||t.xRel<0)?ud(e,r,t,i):cd(e,r,t,i)}function ud(e,t,n,r){var i=e.display,a=!1,l=gt(e,function(m){g&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:wo(e)),_t(i.wrapper.ownerDocument,"mouseup",l),_t(i.wrapper.ownerDocument,"mousemove",u),_t(i.scroller,"dragstart",f),_t(i.scroller,"drop",l),a||(kt(m),r.a
Line truncated
|
||||||
`)==t){if(r.ranges.length%Qt.text.length==0){m=[];for(var A=0;A<Qt.text.length;A++)m.push(a.splitLines(Qt.text[A]))}}else f.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(m=He(f,function(ve){return[ve]}));for(var B=e.curOp.updateInput,ee=r.ranges.length-1;ee>=0;ee--){var Y=r.ranges[ee],ie=Y.from(),ue=Y.to();Y.empty()&&(n&&n>0?ie=ne(ie.line,ie.ch-n):e.state.overwrite&&!u?ue=ne(ue.line,Math.min(Ae(a,ue.line).text.length,ue.ch+ce(f).length)):u&&Qt&&Qt.lineWise&&Qt.text.join(`
|
`)==t){if(r.ranges.length%Qt.text.length==0){m=[];for(var A=0;A<Qt.text.length;A++)m.push(a.splitLines(Qt.text[A]))}}else f.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(m=He(f,function(ve){return[ve]}));for(var B=e.curOp.updateInput,ee=r.ranges.length-1;ee>=0;ee--){var Y=r.ranges[ee],ie=Y.from(),ue=Y.to();Y.empty()&&(n&&n>0?ie=ne(ie.line,ie.ch-n):e.state.overwrite&&!u?ue=ne(ue.line,Math.min(Ae(a,ue.line).text.length,ue.ch+ce(f).length)):u&&Qt&&Qt.lineWise&&Qt.text.join(`
|
||||||
`)==f.join(`
|
`)==f.join(`
|
||||||
`)&&(ie=ue=ne(ie.line,0)));var me={from:ie,to:ue,text:m?m[ee%m.length]:f,origin:i||(u?"paste":e.state.cutIncoming>l?"cut":"+input")};an(e.doc,me),ht(e,"inputRead",e,me)}t&&!u&&ns(e,t),tn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=B),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function rs(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Nt(t,function(){return $o(t,n,0,null,"paste")}),!0}function ns(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var a=e.getModeAt(i.head),l=!1;if(a.electricChars){for(var u=0;u<a.electricChars.length;u++)if(t.indexOf(a.electricChars.charAt(u))>-1){l=Xn(e,i.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(Ae(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Xn(e,i.head.line,"smart"));l&&ht(e,"electricInput",e,i.head.line)}}}function is(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,a={anchor:ne(i,0),head:ne(i+1,0)};n.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:n}}function Ko(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function os(){var e=y("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=y("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return g?e.style.width="1000px":e.setAttribute("wrap","off"),w&&(e.style.border="1px solid black"),t}function vd(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){de(this).focus(),this.display.input.focus()},setOption:function(r,i){var a=this.options,l=a[r];a[r]==i&&r!="mode"||(a[r]=i,t.hasOwnProperty(r)&>(this,t[r])(this,i,l),it(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](Li(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,a=0;a<i.length;++a)if(i[a]==r||i[a].name==r)return i.splice(a,1),!0},addOverlay:Tt(function(r,i){var a=r.token?r:e.getMode(this.options,r);if(a.startState)throw new Error("Overlays may not be stateful.");te(this.state.overlays,{mode:a,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(l){return l.priority}),this.state.modeGen++,zt(this)}),removeOverlay:Tt(function(r){for(var i=this.state.overlays,a=0;a<i.length;++a){var l=i[a].modeSpec;if(l==r||typeof r=="string"&&l.name==r){i.splice(a,1),this.state.modeGen++,zt(this);return}}}),indentLine:Tt(function(r,i,a){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),ae(this.doc,r)&&Xn(this,r,i,a)}),indentSelection:Tt(function(r){for(var i=this.doc.sel.ranges,a=-1,l=0;l<i.length;l++){var u=i[l];if(u.empty())u.head.line>a&&(Xn(this,u.head.line,r,!0),a=u.head.line,l==this.doc.sel.primIndex&&tn(this));else{var f=u.from(),m=u.to(),A=Math.max(a,f.line);a=Math.min(this.lastLine(),m.line-(m.ch?0:1))+1;for(var B=A;B<a;++B)Xn(this,B,r);var ee=this.doc.sel.ranges;f.ch==0&&i.length==ee.length&&ee[l].from().ch>0&&Oo(this.doc,l,new Ye(f,ee[l].to()),ke)}}}),getTokenAt:function(r,i){return ga(this,r,i)},getLineTokens:function(r,i){return ga(this,ne(r),i,!0)},getTokenTypeAt:function(r){r=je(this.doc,r);var i=da(this,Ae(this.doc,r.line)),a=0,l=(i.length-1)/2,u=r.ch,f;if(u==0)f=i[2];else for(;;){var m=a+l>>1;if((m?i[m*2-1]:0)>=u)l=m;else if(i[m*2+1]<u)a=m+1;else{f=i[m*2+2];break}}var A=f?f.indexOf("overlay "):-1;return A<0?f:A==0?null:f.slice(0,A-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var a=[];if(!n.hasOwnProperty(i))return a;var l=n[i],u=this.getModeAt(r);if(typeof u[i]=="string")l[u[i]]&&a.push(l[u[i]]);else if(u[i])for(var f=0;f<u[i].length;f++){var m=l[u[i][f]];m&&a.push(m)}else u.helperType&&l[u.helperType]?a.push(l[u.helperType]):l[u.name]&&a.push(l[u.name]);for(var A=0;A<l._global.length;A++){var B=l._global[A];B.pred(u,this)&&Se(a,B.val)==-1&&a.push(B.val)}return a},getStateAfter:function(r,i){var a=this.doc;return r=ua(a,r??a.first+a.size-1),wn(this,r+1,i).state},cursorCoords:function(r,i){var a,l=this.doc.sel.primary();return r==null?a=l.head:typeof r=="object"?a=je(this.doc,r):a=r?l.from():l.to(),Xt(this,a,i||"page")},charCoords:function(r,i){return fi(this,je(this.doc,r),i||"page")},coordsChar:function(r,i){return r=Ua(this,r,i||"page"),mo(this,r.left,r.top)},lineAtHeight:function(r,i){return r=Ua(this,{top:r,left:0},i||"page").top,P(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,a){var l=!1,u;if(typeof r=="number"){var f=this.doc.first+
Line truncated
|
`)&&(ie=ue=ne(ie.line,0)));var me={from:ie,to:ue,text:m?m[ee%m.length]:f,origin:i||(u?"paste":e.state.cutIncoming>l?"cut":"+input")};an(e.doc,me),ht(e,"inputRead",e,me)}t&&!u&&ns(e,t),tn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=B),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function rs(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Nt(t,function(){return $o(t,n,0,null,"paste")}),!0}function ns(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var a=e.getModeAt(i.head),l=!1;if(a.electricChars){for(var u=0;u<a.electricChars.length;u++)if(t.indexOf(a.electricChars.charAt(u))>-1){l=Xn(e,i.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(Ae(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Xn(e,i.head.line,"smart"));l&&ht(e,"electricInput",e,i.head.line)}}}function is(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,a={anchor:ne(i,0),head:ne(i+1,0)};n.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:n}}function Ko(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function os(){var e=y("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=y("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return g?e.style.width="1000px":e.setAttribute("wrap","off"),w&&(e.style.border="1px solid black"),t}function vd(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){de(this).focus(),this.display.input.focus()},setOption:function(r,i){var a=this.options,l=a[r];a[r]==i&&r!="mode"||(a[r]=i,t.hasOwnProperty(r)&>(this,t[r])(this,i,l),it(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](Li(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,a=0;a<i.length;++a)if(i[a]==r||i[a].name==r)return i.splice(a,1),!0},addOverlay:Tt(function(r,i){var a=r.token?r:e.getMode(this.options,r);if(a.startState)throw new Error("Overlays may not be stateful.");te(this.state.overlays,{mode:a,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(l){return l.priority}),this.state.modeGen++,zt(this)}),removeOverlay:Tt(function(r){for(var i=this.state.overlays,a=0;a<i.length;++a){var l=i[a].modeSpec;if(l==r||typeof r=="string"&&l.name==r){i.splice(a,1),this.state.modeGen++,zt(this);return}}}),indentLine:Tt(function(r,i,a){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),ae(this.doc,r)&&Xn(this,r,i,a)}),indentSelection:Tt(function(r){for(var i=this.doc.sel.ranges,a=-1,l=0;l<i.length;l++){var u=i[l];if(u.empty())u.head.line>a&&(Xn(this,u.head.line,r,!0),a=u.head.line,l==this.doc.sel.primIndex&&tn(this));else{var f=u.from(),m=u.to(),A=Math.max(a,f.line);a=Math.min(this.lastLine(),m.line-(m.ch?0:1))+1;for(var B=A;B<a;++B)Xn(this,B,r);var ee=this.doc.sel.ranges;f.ch==0&&i.length==ee.length&&ee[l].from().ch>0&&Oo(this.doc,l,new Ye(f,ee[l].to()),ke)}}}),getTokenAt:function(r,i){return ga(this,r,i)},getLineTokens:function(r,i){return ga(this,ne(r),i,!0)},getTokenTypeAt:function(r){r=je(this.doc,r);var i=da(this,Ae(this.doc,r.line)),a=0,l=(i.length-1)/2,u=r.ch,f;if(u==0)f=i[2];else for(;;){var m=a+l>>1;if((m?i[m*2-1]:0)>=u)l=m;else if(i[m*2+1]<u)a=m+1;else{f=i[m*2+2];break}}var A=f?f.indexOf("overlay "):-1;return A<0?f:A==0?null:f.slice(0,A-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var a=[];if(!n.hasOwnProperty(i))return a;var l=n[i],u=this.getModeAt(r);if(typeof u[i]=="string")l[u[i]]&&a.push(l[u[i]]);else if(u[i])for(var f=0;f<u[i].length;f++){var m=l[u[i][f]];m&&a.push(m)}else u.helperType&&l[u.helperType]?a.push(l[u.helperType]):l[u.name]&&a.push(l[u.name]);for(var A=0;A<l._global.length;A++){var B=l._global[A];B.pred(u,this)&&Se(a,B.val)==-1&&a.push(B.val)}return a},getStateAfter:function(r,i){var a=this.doc;return r=ua(a,r??a.first+a.size-1),wn(this,r+1,i).state},cursorCoords:function(r,i){var a,l=this.doc.sel.primary();return r==null?a=l.head:typeof r=="object"?a=je(this.doc,r):a=r?l.from():l.to(),Xt(this,a,i||"page")},charCoords:function(r,i){return fi(this,je(this.doc,r),i||"page")},coordsChar:function(r,i){return r=Ua(this,r,i||"page"),mo(this,r.left,r.top)},lineAtHeight:function(r,i){return r=Ua(this,{top:r,left:0},i||"page").top,P(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,a){var l=!1,u;if(typeof r=="number"){var f=this.doc.first+
Line truncated
|
||||||
`,me=Me(ue,Y)?"w":ee&&ue==`
|
`,me=Me(ue,Y)?"w":ee&&ue==`
|
||||||
`?"n":!ee||/\s/.test(ue)?null:"p";if(ee&&!ie&&!me&&(me="s"),B&&B!=me){n<0&&(n=1,A(),t.sticky="after");break}if(me&&(B=me),n>0&&!A(!ie))break}var ve=wi(e,t,a,l,!0);return Xe(a,ve)&&(ve.hitSide=!0),ve}function as(e,t,n,r){var i=e.doc,a=t.left,l;if(r=="page"){var u=Math.min(e.display.wrapper.clientHeight,de(e).innerHeight||i(e).documentElement.clientHeight),f=Math.max(u-.5*Vr(e.display),3);l=(n>0?t.bottom:t.top)+n*f}else r=="line"&&(l=n>0?t.bottom+3:t.top-3);for(var m;m=mo(e,a,l),!!m.outside;){if(n<0?l<=0:l>=i.height){m.hitSide=!0;break}l+=n*5}return m}var Qe=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new qe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Qe.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,Ko(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function a(u){for(var f=u.target;f;f=f.parentNode){if(f==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(f.className))break}return!1}Ie(i,"paste",function(u){!a(u)||ot(r,u)||rs(u,r)||h<=11&&setTimeout(gt(r,function(){return t.updateFromDOM()}),20)}),Ie(i,"compositionstart",function(u){t.composing={data:u.data,done:!1}}),Ie(i,"compositionupdate",function(u){t.composing||(t.composing={data:u.data,done:!1})}),Ie(i,"compositionend",function(u){t.composing&&(u.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ie(i,"touchstart",function(){return n.forceCompositionEnd()}),Ie(i,"input",function(){t.composing||t.readFromDOMSoon()});function l(u){if(!(!a(u)||ot(r,u))){if(r.somethingSelected())zi({lineWise:!1,text:r.getSelections()}),u.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var f=is(r);zi({lineWise:!0,text:f.text}),u.type=="cut"&&r.operation(function(){r.setSelections(f.ranges,0,ke),r.replaceSelection("",null,"cut")})}else return;if(u.clipboardData){u.clipboardData.clearData();var m=Qt.text.join(`
|
`?"n":!ee||/\s/.test(ue)?null:"p";if(ee&&!ie&&!me&&(me="s"),B&&B!=me){n<0&&(n=1,A(),t.sticky="after");break}if(me&&(B=me),n>0&&!A(!ie))break}var ve=wi(e,t,a,l,!0);return Xe(a,ve)&&(ve.hitSide=!0),ve}function as(e,t,n,r){var i=e.doc,a=t.left,l;if(r=="page"){var u=Math.min(e.display.wrapper.clientHeight,de(e).innerHeight||i(e).documentElement.clientHeight),f=Math.max(u-.5*Vr(e.display),3);l=(n>0?t.bottom:t.top)+n*f}else r=="line"&&(l=n>0?t.bottom+3:t.top-3);for(var m;m=mo(e,a,l),!!m.outside;){if(n<0?l<=0:l>=i.height){m.hitSide=!0;break}l+=n*5}return m}var Qe=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new qe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Qe.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,Ko(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function a(u){for(var f=u.target;f;f=f.parentNode){if(f==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(f.className))break}return!1}Ie(i,"paste",function(u){!a(u)||ot(r,u)||rs(u,r)||h<=11&&setTimeout(gt(r,function(){return t.updateFromDOM()}),20)}),Ie(i,"compositionstart",function(u){t.composing={data:u.data,done:!1}}),Ie(i,"compositionupdate",function(u){t.composing||(t.composing={data:u.data,done:!1})}),Ie(i,"compositionend",function(u){t.composing&&(u.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ie(i,"touchstart",function(){return n.forceCompositionEnd()}),Ie(i,"input",function(){t.composing||t.readFromDOMSoon()});function l(u){if(!(!a(u)||ot(r,u))){if(r.somethingSelected())zi({lineWise:!1,text:r.getSelections()}),u.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var f=is(r);zi({lineWise:!0,text:f.text}),u.type=="cut"&&r.operation(function(){r.setSelections(f.ranges,0,ke),r.replaceSelection("",null,"cut")})}else return;if(u.clipboardData){u.clipboardData.clearData();var m=Qt.text.join(`
|
||||||
`);if(u.clipboardData.setData("Text",m),u.clipboardData.getData("Text")==m){u.preventDefault();return}}var A=os(),B=A.firstChild;Ko(B),r.display.lineSpace.insertBefore(A,r.display.lineSpace.firstChild),B.value=Qt.text.join(`
|
`);if(u.clipboardData.setData("Text",m),u.clipboardData.getData("Text")==m){u.preventDefault();return}}var A=os(),B=A.firstChild;Ko(B),r.display.lineSpace.insertBefore(A,r.display.lineSpace.firstChild),B.value=Qt.text.join(`
|
||||||
`);var ee=R(ze(i));I(B),setTimeout(function(){r.display.lineSpace.removeChild(A),ee.focus(),ee==i&&n.showPrimarySelection()},50)}}Ie(i,"copy",l),Ie(i,"cut",l)},Qe.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Qe.prototype.prepareSelection=function(){var e=Ya(this.cm,!1);return e.focus=R(ze(this.div))==this.div,e},Qe.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Qe.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Qe.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var a=Mi(t,e.anchorNode,e.anchorOffset),l=Mi(t,e.focusNode,e.focusOffset);if(!(a&&!a.bad&&l&&!l.bad&&ye(Zr(a,l),r)==0&&ye(Et(a,l),i)==0)){var u=t.display.view,f=r.line>=t.display.viewFrom&&ls(t,r)||{node:u[0].measure.map[2],offset:0},m=i.line<t.display.viewTo&&ls(t,i);if(!m){var A=u[u.length-1].measure,B=A.maps?A.maps[A.maps.length-1]:A.map;m={node:B[B.length-1],offset:B[B.length-2]-B[B.length-3]}}if(!f||!m){e.removeAllRanges();return}var ee=e.rangeCount&&e.getRangeAt(0),Y;try{Y=X(f.node,f.offset,m.offset,m.node)}catch{}Y&&(!v&&t.state.focused?(e.collapse(f.node,f.offset),Y.collapsed||(e.removeAllRanges(),e.addRange(Y))):(e.removeAllRanges(),e.addRange(Y)),ee&&e.anchorNode==null?e.addRange(ee):v&&this.startGracePeriod()),this.rememberSelection()}},Qe.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Qe.prototype.showMultipleSelections=function(e){V(this.cm.display.cursorDiv,e.cursors),V(this.cm.display.selectionDiv,e.selection)},Qe.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Qe.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return O(this.div,t)},Qe.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||R(ze(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Qe.prototype.blur=function(){this.div.blur()},Qe.prototype.getField=function(){return this.div},Qe.prototype.supportsTouch=function(){return!0},Qe.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):Nt(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},Qe.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Qe.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(W&&k&&this.cm.display.gutterSpecs.length&&bd(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=Mi(t,e.anchorNode,e.anchorOffset),r=Mi(t,e.focusNode,e.focusOffset);n&&r&&Nt(t,function(){wt(t.doc,yr(n,r),ke),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Qe.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=ne(r.line-1,Ae(e.doc,r.line-1).length)),i.ch==Ae(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=ne(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var a,l,u;r.line==t.viewFrom||(a=Ar(e,r.line))==0?(l=_(t.view[0].line),u=t.view[0].node):(l=_(t.view[a].line),u=t.view[a-1].node.nextSibling);var f=Ar(e,i.line),m,A;if(f==t.view.length-1?(m=t.viewTo-1,A=t.lineDiv.lastChild):(m=_(t.view[f+1].line)-1,A=t.view[f+1].node.previousSibling),!u)return!1;for(var B=e.doc.splitLines(yd(e,u,A,l,m)),ee=ir(e.doc,ne(l,0),ne(m,Ae(e.doc,m).text.length));B.length>1&&ee.length>1;)if(ce(B)==ce(ee))B.pop(),ee.pop(),m--;else if(B[0]==ee[0])B.shift(),ee.shift(),l++;else break;for(var Y=0,ie=0,ue=B[0],me=ee[0],ve=Math.min(ue.length,me.length);Y<ve&&ue.charCodeAt(Y)==me.charCodeAt(Y);)++Y;for(var xe=ce(B),be=ce(ee),Ce=Math.min(xe.length-(B.length==1?Y:0),be.length-(ee.length==1?Y:0));ie<Ce&&xe.charCodeAt(xe.length-ie-1)==be.charCodeAt(be.length-ie-1);)++ie;if(B.l
Line truncated
|
`);var ee=R(ze(i));I(B),setTimeout(function(){r.display.lineSpace.removeChild(A),ee.focus(),ee==i&&n.showPrimarySelection()},50)}}Ie(i,"copy",l),Ie(i,"cut",l)},Qe.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Qe.prototype.prepareSelection=function(){var e=Ya(this.cm,!1);return e.focus=R(ze(this.div))==this.div,e},Qe.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Qe.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Qe.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var a=Mi(t,e.anchorNode,e.anchorOffset),l=Mi(t,e.focusNode,e.focusOffset);if(!(a&&!a.bad&&l&&!l.bad&&ye(Zr(a,l),r)==0&&ye(Et(a,l),i)==0)){var u=t.display.view,f=r.line>=t.display.viewFrom&&ls(t,r)||{node:u[0].measure.map[2],offset:0},m=i.line<t.display.viewTo&&ls(t,i);if(!m){var A=u[u.length-1].measure,B=A.maps?A.maps[A.maps.length-1]:A.map;m={node:B[B.length-1],offset:B[B.length-2]-B[B.length-3]}}if(!f||!m){e.removeAllRanges();return}var ee=e.rangeCount&&e.getRangeAt(0),Y;try{Y=X(f.node,f.offset,m.offset,m.node)}catch{}Y&&(!v&&t.state.focused?(e.collapse(f.node,f.offset),Y.collapsed||(e.removeAllRanges(),e.addRange(Y))):(e.removeAllRanges(),e.addRange(Y)),ee&&e.anchorNode==null?e.addRange(ee):v&&this.startGracePeriod()),this.rememberSelection()}},Qe.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Qe.prototype.showMultipleSelections=function(e){V(this.cm.display.cursorDiv,e.cursors),V(this.cm.display.selectionDiv,e.selection)},Qe.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Qe.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return N(this.div,t)},Qe.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||R(ze(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Qe.prototype.blur=function(){this.div.blur()},Qe.prototype.getField=function(){return this.div},Qe.prototype.supportsTouch=function(){return!0},Qe.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):Nt(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},Qe.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Qe.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(U&&k&&this.cm.display.gutterSpecs.length&&bd(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=Mi(t,e.anchorNode,e.anchorOffset),r=Mi(t,e.focusNode,e.focusOffset);n&&r&&Nt(t,function(){wt(t.doc,yr(n,r),ke),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Qe.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=ne(r.line-1,Ae(e.doc,r.line-1).length)),i.ch==Ae(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=ne(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var a,l,u;r.line==t.viewFrom||(a=Ar(e,r.line))==0?(l=_(t.view[0].line),u=t.view[0].node):(l=_(t.view[a].line),u=t.view[a-1].node.nextSibling);var f=Ar(e,i.line),m,A;if(f==t.view.length-1?(m=t.viewTo-1,A=t.lineDiv.lastChild):(m=_(t.view[f+1].line)-1,A=t.view[f+1].node.previousSibling),!u)return!1;for(var B=e.doc.splitLines(yd(e,u,A,l,m)),ee=ir(e.doc,ne(l,0),ne(m,Ae(e.doc,m).text.length));B.length>1&&ee.length>1;)if(ce(B)==ce(ee))B.pop(),ee.pop(),m--;else if(B[0]==ee[0])B.shift(),ee.shift(),l++;else break;for(var Y=0,ie=0,ue=B[0],me=ee[0],ve=Math.min(ue.length,me.length);Y<ve&&ue.charCodeAt(Y)==me.charCodeAt(Y);)++Y;for(var xe=ce(B),be=ce(ee),Ce=Math.min(xe.length-(B.length==1?Y:0),be.length-(ee.length==1?Y:0));ie<Ce&&xe.charCodeAt(xe.length-ie-1)==be.charCodeAt(be.length-ie-1);)++ie;if(B.l
Line truncated
|
||||||
`),I(i))}else return;l.type=="cut"&&(r.state.cutIncoming=+new Date)}}Ie(i,"cut",a),Ie(i,"copy",a),Ie(e.scroller,"paste",function(l){if(!(lr(e,l)||ot(r,l))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var u=new Event("paste");u.clipboardData=l.clipboardData,i.dispatchEvent(u)}}),Ie(e.lineSpace,"selectstart",function(l){lr(e,l)||kt(l)}),Ie(i,"compositionstart",function(){var l=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:l,range:r.markText(l,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ie(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},st.prototype.createField=function(e){this.wrapper=os(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Ko(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},st.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},st.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Ya(e);if(e.options.moveInputWithCursor){var i=Xt(e,n.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-a.left))}return r},st.prototype.showSelection=function(e){var t=this.cm,n=t.display;V(n.cursorDiv,e.cursors),V(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},st.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&I(this.textarea),s&&h>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",s&&h>=9&&(this.hasSelection=null));this.resetting=!1}},st.prototype.getField=function(){return this.textarea},st.prototype.supportsTouch=function(){return!1},st.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!E||R(ze(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},st.prototype.blur=function(){this.textarea.blur()},st.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},st.prototype.receivedFocus=function(){this.slowPoll()},st.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},st.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},st.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||hr(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(s&&h>=9&&this.hasSelection===i||N&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(a==8203&&!r&&(r="\u200B"),a==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(r.length,i.length);l<u&&r.charCodeAt(l)==i.charCodeAt(l);)++l;return Nt(t,function(){$o(t,i.slice(l),r.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
|
`),I(i))}else return;l.type=="cut"&&(r.state.cutIncoming=+new Date)}}Ie(i,"cut",a),Ie(i,"copy",a),Ie(e.scroller,"paste",function(l){if(!(lr(e,l)||ot(r,l))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var u=new Event("paste");u.clipboardData=l.clipboardData,i.dispatchEvent(u)}}),Ie(e.lineSpace,"selectstart",function(l){lr(e,l)||kt(l)}),Ie(i,"compositionstart",function(){var l=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:l,range:r.markText(l,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ie(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},st.prototype.createField=function(e){this.wrapper=os(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Ko(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},st.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},st.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Ya(e);if(e.options.moveInputWithCursor){var i=Xt(e,n.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-a.left))}return r},st.prototype.showSelection=function(e){var t=this.cm,n=t.display;V(n.cursorDiv,e.cursors),V(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},st.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&I(this.textarea),s&&h>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",s&&h>=9&&(this.hasSelection=null));this.resetting=!1}},st.prototype.getField=function(){return this.textarea},st.prototype.supportsTouch=function(){return!1},st.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!M||R(ze(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},st.prototype.blur=function(){this.textarea.blur()},st.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},st.prototype.receivedFocus=function(){this.slowPoll()},st.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},st.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},st.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||hr(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(s&&h>=9&&this.hasSelection===i||O&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(a==8203&&!r&&(r="\u200B"),a==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(r.length,i.length);l<u&&r.charCodeAt(l)==i.charCodeAt(l);)++l;return Nt(t,function(){$o(t,i.slice(l),r.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
|
||||||
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},st.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},st.prototype.onKeyPress=function(){s&&h>=9&&(this.hasSelection=null),this.fastPoll()},st.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Mr(n,e),l=r.scroller.scrollTop;if(!a||d)return;var u=n.options.resetSelectionOnContextMenu;u&&n.doc.sel.contains(a)==-1&>(n,wt)(n.doc,yr(a),ke);var f=i.style.cssText,m=t.wrapper.style.cssText,A=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
|
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},st.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},st.prototype.onKeyPress=function(){s&&h>=9&&(this.hasSelection=null),this.fastPoll()},st.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Mr(n,e),l=r.scroller.scrollTop;if(!a||d)return;var u=n.options.resetSelectionOnContextMenu;u&&n.doc.sel.contains(a)==-1&>(n,wt)(n.doc,yr(a),ke);var f=i.style.cssText,m=t.wrapper.style.cssText,A=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
|
||||||
top: `+(e.clientY-A.top-5)+"px; left: "+(e.clientX-A.left-5)+`px;
|
top: `+(e.clientY-A.top-5)+"px; left: "+(e.clientX-A.left-5)+`px;
|
||||||
z-index: 1000; background: `+(s?"rgba(255, 255, 255, .05)":"transparent")+`;
|
z-index: 1000; background: `+(s?"rgba(255, 255, 255, .05)":"transparent")+`;
|
||||||
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var B;g&&(B=i.ownerDocument.defaultView.scrollY),r.input.focus(),g&&i.ownerDocument.defaultView.scrollTo(null,B),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=Y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function ee(){if(i.selectionStart!=null){var ue=n.somethingSelected(),me="\u200B"+(ue?i.value:"");i.value="\u21DA",i.value=me,t.prevInput=ue?"":"\u200B",i.selectionStart=1,i.selectionEnd=me.length,r.selForContextMenu=n.doc.sel}}function Y(){if(t.contextMenuPending==Y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,i.style.cssText=f,s&&h<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!s||s&&h<9)&&ee();var ue=0,me=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?gt(n,Ll)(n):ue++<10?r.detectingSelectAll=setTimeout(me,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(me,200)}}if(s&&h>=9&&ee(),F){dr(e);var ie=function(){_t(window,"mouseup",ie),setTimeout(Y,20)};Ie(window,"mouseup",ie)}else setTimeout(Y,50)},st.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},st.prototype.setUneditable=function(){},st.prototype.needsContentAttribute=!1;function _d(e,t){if(t=t?ge(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=R(ze(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=u.getValue()}var i;if(e.form&&(Ie(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var l=a.submit=function(){r(),a.submit=i,a.submit(),a.submit=l}}catch{}}t.finishInit=function(f){f.save=r,f.getTextArea=function(){return e},f.toTextArea=function(){f.toTextArea=isNaN,r(),e.parentNode.removeChild(f.getWrapperElement()),e.style.display="",e.form&&(_t(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var u=tt(function(f){return e.parentNode.insertBefore(f,e.nextSibling)},t);return u}function kd(e){e.off=_t,e.on=Ie,e.wheelEventPixels=zf,e.Doc=Mt,e.splitLines=Ht,e.countColumn=Oe,e.findColumn=Ge,e.isWordChar=we,e.Pass=Ze,e.signal=it,e.Line=Xr,e.changeEnd=xr,e.scrollbarModel=rl,e.Pos=ne,e.cmpPos=ye,e.modes=Wr,e.mimeModes=Kt,e.resolveMode=Ur,e.getMode=$r,e.modeExtensions=gr,e.extendMode=Kr,e.copyState=Vt,e.startState=Gr,e.innerMode=_n,e.commands=$n,e.keyMap=ur,e.keyName=Hl,e.isModifierKey=jl,e.lookupKey=un,e.normalizeKeyMap=Qf,e.StringStream=at,e.SharedTextMarker=Hn,e.TextMarker=kr,e.LineWidget=Rn,e.e_preventDefault=kt,e.e_stopPropagation=Rr,e.e_stop=dr,e.addClass=se,e.contains=O,e.rmClass=Q,e.keyNames=wr}pd(tt),vd(tt);var wd="iter insert remove copy getEditor constructor".split(" ");for(var Ai in Mt.prototype)Mt.prototype.hasOwnProperty(Ai)&&Se(wd,Ai)<0&&(tt.prototype[Ai]=(function(e){return function(){return e.apply(this.doc,arguments)}})(Mt.prototype[Ai]));return Wt(Mt),tt.inputStyles={textarea:st,contenteditable:Qe},tt.defineMode=function(e){!tt.defaults.mode&&e!="null"&&(tt.defaults.mode=e),Gt.apply(this,arguments)},tt.defineMIME=Cr,tt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),tt.defineMIME("text/plain","null"),tt.defineExtension=function(e,t){tt.prototype[e]=t},tt.defineDocExtension=function(e,t){Mt.prototype[e]=t},tt.fromTextArea=_d,kd(tt),tt.version="5.65.21",tt}))});var Yn=Ke((us,cs)=>{(function(o){typeof us=="object"&&typeof cs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.overlayMode=function(p,v,L){return{startState:function(){return{base:o.startState(p),overlay:o.startState(v),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(b){return{base:o.copyState(p,b.base),overlay:o.copyState(v,b.overlay),basePos:b.basePos,baseCur:null,overlayPos:b.overlayPos,overlayCur:null}},token:function(b,S){return(b!=S.streamSeen||Math.min(S.basePos,S.overlayPos)<b.start)&&(S.streamSeen=b,S.basePos=S.overlayPos=b.start),b.start==S.basePos&&(S.baseCur=p.token(b,S.base),S.basePos=b.pos),b.start==S.overlayPos&&(b.pos=b.start,S.overlayCur=v.token(b,S.overlay),S.overlayPos=b.pos),b.pos=Math.min(S.basePos,S.overlayPos),S.overlayCur==null?S.baseCur:S.baseCur!=null&&S.overlay.combineTokens||L&&S.overlay.combineTokens==null?S.baseCur+" "+S.overlayCur:S.overlayCur},indent:p.indent&&function(b,S,s){return p.indent(b.base,S,s)},electricChars:p.electricChars,innerMode:function(b){return{state:b.base,mode:p}},blankLine:function(b){var S,s;return p.blankLine&&(S=p.blankLine(b.base)),v.blankLine&&(s=v.blankLine(b.overlay)),s==null?S:L&&S!=null?S+" "+s:s}}}})});var ps=Ke((fs,ds)=>{(function(o){typeof fs=="object"&&type
Line truncated
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var B;g&&(B=i.ownerDocument.defaultView.scrollY),r.input.focus(),g&&i.ownerDocument.defaultView.scrollTo(null,B),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=Y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function ee(){if(i.selectionStart!=null){var ue=n.somethingSelected(),me="\u200B"+(ue?i.value:"");i.value="\u21DA",i.value=me,t.prevInput=ue?"":"\u200B",i.selectionStart=1,i.selectionEnd=me.length,r.selForContextMenu=n.doc.sel}}function Y(){if(t.contextMenuPending==Y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,i.style.cssText=f,s&&h<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!s||s&&h<9)&&ee();var ue=0,me=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?gt(n,Ll)(n):ue++<10?r.detectingSelectAll=setTimeout(me,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(me,200)}}if(s&&h>=9&&ee(),q){dr(e);var ie=function(){_t(window,"mouseup",ie),setTimeout(Y,20)};Ie(window,"mouseup",ie)}else setTimeout(Y,50)},st.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},st.prototype.setUneditable=function(){},st.prototype.needsContentAttribute=!1;function _d(e,t){if(t=t?ge(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=R(ze(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=u.getValue()}var i;if(e.form&&(Ie(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var l=a.submit=function(){r(),a.submit=i,a.submit(),a.submit=l}}catch{}}t.finishInit=function(f){f.save=r,f.getTextArea=function(){return e},f.toTextArea=function(){f.toTextArea=isNaN,r(),e.parentNode.removeChild(f.getWrapperElement()),e.style.display="",e.form&&(_t(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var u=tt(function(f){return e.parentNode.insertBefore(f,e.nextSibling)},t);return u}function kd(e){e.off=_t,e.on=Ie,e.wheelEventPixels=zf,e.Doc=Mt,e.splitLines=Ht,e.countColumn=Oe,e.findColumn=Ge,e.isWordChar=we,e.Pass=Ze,e.signal=it,e.Line=Xr,e.changeEnd=xr,e.scrollbarModel=rl,e.Pos=ne,e.cmpPos=ye,e.modes=Wr,e.mimeModes=Kt,e.resolveMode=Ur,e.getMode=$r,e.modeExtensions=gr,e.extendMode=Kr,e.copyState=Vt,e.startState=Gr,e.innerMode=_n,e.commands=$n,e.keyMap=ur,e.keyName=Hl,e.isModifierKey=jl,e.lookupKey=un,e.normalizeKeyMap=Qf,e.StringStream=at,e.SharedTextMarker=Hn,e.TextMarker=kr,e.LineWidget=Rn,e.e_preventDefault=kt,e.e_stopPropagation=Rr,e.e_stop=dr,e.addClass=se,e.contains=N,e.rmClass=Q,e.keyNames=wr}pd(tt),vd(tt);var wd="iter insert remove copy getEditor constructor".split(" ");for(var Ai in Mt.prototype)Mt.prototype.hasOwnProperty(Ai)&&Se(wd,Ai)<0&&(tt.prototype[Ai]=(function(e){return function(){return e.apply(this.doc,arguments)}})(Mt.prototype[Ai]));return Wt(Mt),tt.inputStyles={textarea:st,contenteditable:Qe},tt.defineMode=function(e){!tt.defaults.mode&&e!="null"&&(tt.defaults.mode=e),Gt.apply(this,arguments)},tt.defineMIME=Cr,tt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),tt.defineMIME("text/plain","null"),tt.defineExtension=function(e,t){tt.prototype[e]=t},tt.defineDocExtension=function(e,t){Mt.prototype[e]=t},tt.fromTextArea=_d,kd(tt),tt.version="5.65.21",tt}))});var Yn=Ke((us,cs)=>{(function(o){typeof us=="object"&&typeof cs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.overlayMode=function(p,v,L){return{startState:function(){return{base:o.startState(p),overlay:o.startState(v),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(b){return{base:o.copyState(p,b.base),overlay:o.copyState(v,b.overlay),basePos:b.basePos,baseCur:null,overlayPos:b.overlayPos,overlayCur:null}},token:function(b,S){return(b!=S.streamSeen||Math.min(S.basePos,S.overlayPos)<b.start)&&(S.streamSeen=b,S.basePos=S.overlayPos=b.start),b.start==S.basePos&&(S.baseCur=p.token(b,S.base),S.basePos=b.pos),b.start==S.overlayPos&&(b.pos=b.start,S.overlayCur=v.token(b,S.overlay),S.overlayPos=b.pos),b.pos=Math.min(S.basePos,S.overlayPos),S.overlayCur==null?S.baseCur:S.baseCur!=null&&S.overlay.combineTokens||L&&S.overlay.combineTokens==null?S.baseCur+" "+S.overlayCur:S.overlayCur},indent:p.indent&&function(b,S,s){return p.indent(b.base,S,s)},electricChars:p.electricChars,innerMode:function(b){return{state:b.base,mode:p}},blankLine:function(b){var S,s;return p.blankLine&&(S=p.blankLine(b.base)),v.blankLine&&(s=v.blankLine(b.overlay)),s==null?S:L&&S!=null?S+" "+s:s}}}})});var ps=Ke((fs,ds)=>{(function(o){typeof fs=="object"&&type
Line truncated
|
||||||
`}else{var N=M[1],K=M[5],J=!(L.test(M[2])||M[2].indexOf(">")>=0),re=J?parseInt(M[3],10)+1+M[4]:M[2].replace("x"," ");h[g]=`
|
`}else{var O=z[1],W=z[5],J=!(L.test(z[2])||z[2].indexOf(">")>=0),re=J?parseInt(z[3],10)+1+z[4]:z[2].replace("x"," ");h[g]=`
|
||||||
`+N+re+K,J&&b(S,C)}}S.replaceSelections(h)};function b(S,s){var h=s.line,g=0,C=0,k=p.exec(S.getLine(h)),c=k[1];do{g+=1;var d=h+g,x=S.getLine(d),z=p.exec(x);if(z){var M=z[1],w=parseInt(k[3],10)+g-C,W=parseInt(z[3],10),E=W;if(c===M&&!isNaN(W))w===W&&(E=W+1),w>W&&(E=w+1),S.replaceRange(x.replace(p,M+E+z[4]+z[5]),{line:d,ch:0},{line:d,ch:x.length});else{if(c.length>M.length||c.length<M.length&&g===1)return;C+=1}}}while(z)}})});var ms=Ke((hs,gs)=>{(function(o){typeof hs=="object"&&typeof gs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){o.defineOption("placeholder","",function(h,g,C){var k=C&&C!=o.Init;if(g&&!k)h.on("blur",b),h.on("change",S),h.on("swapDoc",S),o.on(h.getInputField(),"compositionupdate",h.state.placeholderCompose=function(){L(h)}),S(h);else if(!g&&k){h.off("blur",b),h.off("change",S),h.off("swapDoc",S),o.off(h.getInputField(),"compositionupdate",h.state.placeholderCompose),p(h);var c=h.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}g&&!h.hasFocus()&&b(h)});function p(h){h.state.placeholder&&(h.state.placeholder.parentNode.removeChild(h.state.placeholder),h.state.placeholder=null)}function v(h){p(h);var g=h.state.placeholder=document.createElement("pre");g.style.cssText="height: 0; overflow: visible",g.style.direction=h.getOption("direction"),g.className="CodeMirror-placeholder CodeMirror-line-like";var C=h.getOption("placeholder");typeof C=="string"&&(C=document.createTextNode(C)),g.appendChild(C),h.display.lineSpace.insertBefore(g,h.display.lineSpace.firstChild)}function L(h){setTimeout(function(){var g=!1;if(h.lineCount()==1){var C=h.getInputField();g=C.nodeName=="TEXTAREA"?!h.getLine(0).length:!/[^\u200b]/.test(C.querySelector(".CodeMirror-line").textContent)}g?v(h):p(h)},20)}function b(h){s(h)&&v(h)}function S(h){var g=h.getWrapperElement(),C=s(h);g.className=g.className.replace(" CodeMirror-empty","")+(C?" CodeMirror-empty":""),C?v(h):p(h)}function s(h){return h.lineCount()===1&&h.getLine(0)===""}})});var ys=Ke((vs,bs)=>{(function(o){typeof vs=="object"&&typeof bs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineOption("styleSelectedText",!1,function(k,c,d){var x=d&&d!=o.Init;c&&!x?(k.state.markedSelection=[],k.state.markedSelectionStyle=typeof c=="string"?c:"CodeMirror-selectedtext",g(k),k.on("cursorActivity",p),k.on("change",v)):!c&&x&&(k.off("cursorActivity",p),k.off("change",v),h(k),k.state.markedSelection=k.state.markedSelectionStyle=null)});function p(k){k.state.markedSelection&&k.operation(function(){C(k)})}function v(k){k.state.markedSelection&&k.state.markedSelection.length&&k.operation(function(){h(k)})}var L=8,b=o.Pos,S=o.cmpPos;function s(k,c,d,x){if(S(c,d)!=0)for(var z=k.state.markedSelection,M=k.state.markedSelectionStyle,w=c.line;;){var W=w==c.line?c:b(w,0),E=w+L,N=E>=d.line,K=N?d:b(E,0),J=k.markText(W,K,{className:M});if(x==null?z.push(J):z.splice(x++,0,J),N)break;w=E}}function h(k){for(var c=k.state.markedSelection,d=0;d<c.length;++d)c[d].clear();c.length=0}function g(k){h(k);for(var c=k.listSelections(),d=0;d<c.length;d++)s(k,c[d].from(),c[d].to())}function C(k){if(!k.somethingSelected())return h(k);if(k.listSelections().length>1)return g(k);var c=k.getCursor("start"),d=k.getCursor("end"),x=k.state.markedSelection;if(!x.length)return s(k,c,d);var z=x[0].find(),M=x[x.length-1].find();if(!z||!M||d.line-c.line<=L||S(c,M.to)>=0||S(d,z.from)<=0)return g(k);for(;S(c,z.from)>0;)x.shift().clear(),z=x[0].find();for(S(c,z.from)<0&&(z.to.line-c.line<L?(x.shift().clear(),s(k,c,z.to,0)):s(k,c,z.from,0));S(d,M.to)<0;)x.pop().clear(),M=x[x.length-1].find();S(d,M.to)>0&&(d.line-M.from.line<L?(x.pop().clear(),s(k,M.from,d)):s(k,M.to,d))}})});var ks=Ke((xs,_s)=>{(function(o){typeof xs=="object"&&typeof _s=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var p=o.Pos;function v(w){var W=w.flags;return W??(w.ignoreCase?"i":"")+(w.global?"g":"")+(w.multiline?"m":"")}function L(w,W){for(var E=v(w),N=E,K=0;K<W.length;K++)N.indexOf(W.charAt(K))==-1&&(N+=W.charAt(K));return E==N?w:new RegExp(w.source,N)}function b(w){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(w.source)}function S(w,W,E){W=L(W,"g");for(var N=E.line,K=E.ch,J=w.lastLine();N<=J;N++,K=0){W.lastIndex=K;var re=w.getLine(N),q=W.exec(re);if(q)return{from:p(N,q.index),to:p(N,q.index+q[0].length),match:q}}}function s(w,W,E){if(!b(W))return S(w,W,E);W=L(W,"gm");for(var N,K=1,J=E.line,re=w.lastLine();J<=re;){for(var q=0;q<K&&!(J>re);q++){var F=w.getLine(J++);N=N==null?F:N+`
|
`+O+re+W,J&&b(S,C)}}S.replaceSelections(h)};function b(S,s){var h=s.line,g=0,C=0,k=p.exec(S.getLine(h)),c=k[1];do{g+=1;var d=h+g,x=S.getLine(d),E=p.exec(x);if(E){var z=E[1],w=parseInt(k[3],10)+g-C,U=parseInt(E[3],10),M=U;if(c===z&&!isNaN(U))w===U&&(M=U+1),w>U&&(M=w+1),S.replaceRange(x.replace(p,z+M+E[4]+E[5]),{line:d,ch:0},{line:d,ch:x.length});else{if(c.length>z.length||c.length<z.length&&g===1)return;C+=1}}}while(E)}})});var ms=Ke((hs,gs)=>{(function(o){typeof hs=="object"&&typeof gs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){o.defineOption("placeholder","",function(h,g,C){var k=C&&C!=o.Init;if(g&&!k)h.on("blur",b),h.on("change",S),h.on("swapDoc",S),o.on(h.getInputField(),"compositionupdate",h.state.placeholderCompose=function(){L(h)}),S(h);else if(!g&&k){h.off("blur",b),h.off("change",S),h.off("swapDoc",S),o.off(h.getInputField(),"compositionupdate",h.state.placeholderCompose),p(h);var c=h.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}g&&!h.hasFocus()&&b(h)});function p(h){h.state.placeholder&&(h.state.placeholder.parentNode.removeChild(h.state.placeholder),h.state.placeholder=null)}function v(h){p(h);var g=h.state.placeholder=document.createElement("pre");g.style.cssText="height: 0; overflow: visible",g.style.direction=h.getOption("direction"),g.className="CodeMirror-placeholder CodeMirror-line-like";var C=h.getOption("placeholder");typeof C=="string"&&(C=document.createTextNode(C)),g.appendChild(C),h.display.lineSpace.insertBefore(g,h.display.lineSpace.firstChild)}function L(h){setTimeout(function(){var g=!1;if(h.lineCount()==1){var C=h.getInputField();g=C.nodeName=="TEXTAREA"?!h.getLine(0).length:!/[^\u200b]/.test(C.querySelector(".CodeMirror-line").textContent)}g?v(h):p(h)},20)}function b(h){s(h)&&v(h)}function S(h){var g=h.getWrapperElement(),C=s(h);g.className=g.className.replace(" CodeMirror-empty","")+(C?" CodeMirror-empty":""),C?v(h):p(h)}function s(h){return h.lineCount()===1&&h.getLine(0)===""}})});var ys=Ke((vs,bs)=>{(function(o){typeof vs=="object"&&typeof bs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineOption("styleSelectedText",!1,function(k,c,d){var x=d&&d!=o.Init;c&&!x?(k.state.markedSelection=[],k.state.markedSelectionStyle=typeof c=="string"?c:"CodeMirror-selectedtext",g(k),k.on("cursorActivity",p),k.on("change",v)):!c&&x&&(k.off("cursorActivity",p),k.off("change",v),h(k),k.state.markedSelection=k.state.markedSelectionStyle=null)});function p(k){k.state.markedSelection&&k.operation(function(){C(k)})}function v(k){k.state.markedSelection&&k.state.markedSelection.length&&k.operation(function(){h(k)})}var L=8,b=o.Pos,S=o.cmpPos;function s(k,c,d,x){if(S(c,d)!=0)for(var E=k.state.markedSelection,z=k.state.markedSelectionStyle,w=c.line;;){var U=w==c.line?c:b(w,0),M=w+L,O=M>=d.line,W=O?d:b(M,0),J=k.markText(U,W,{className:z});if(x==null?E.push(J):E.splice(x++,0,J),O)break;w=M}}function h(k){for(var c=k.state.markedSelection,d=0;d<c.length;++d)c[d].clear();c.length=0}function g(k){h(k);for(var c=k.listSelections(),d=0;d<c.length;d++)s(k,c[d].from(),c[d].to())}function C(k){if(!k.somethingSelected())return h(k);if(k.listSelections().length>1)return g(k);var c=k.getCursor("start"),d=k.getCursor("end"),x=k.state.markedSelection;if(!x.length)return s(k,c,d);var E=x[0].find(),z=x[x.length-1].find();if(!E||!z||d.line-c.line<=L||S(c,z.to)>=0||S(d,E.from)<=0)return g(k);for(;S(c,E.from)>0;)x.shift().clear(),E=x[0].find();for(S(c,E.from)<0&&(E.to.line-c.line<L?(x.shift().clear(),s(k,c,E.to,0)):s(k,c,E.from,0));S(d,z.to)<0;)x.pop().clear(),z=x[x.length-1].find();S(d,z.to)>0&&(d.line-z.from.line<L?(x.pop().clear(),s(k,z.from,d)):s(k,z.to,d))}})});var ks=Ke((xs,_s)=>{(function(o){typeof xs=="object"&&typeof _s=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var p=o.Pos;function v(w){var U=w.flags;return U??(w.ignoreCase?"i":"")+(w.global?"g":"")+(w.multiline?"m":"")}function L(w,U){for(var M=v(w),O=M,W=0;W<U.length;W++)O.indexOf(U.charAt(W))==-1&&(O+=U.charAt(W));return M==O?w:new RegExp(w.source,O)}function b(w){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(w.source)}function S(w,U,M){U=L(U,"g");for(var O=M.line,W=M.ch,J=w.lastLine();O<=J;O++,W=0){U.lastIndex=W;var re=w.getLine(O),F=U.exec(re);if(F)return{from:p(O,F.index),to:p(O,F.index+F[0].length),match:F}}}function s(w,U,M){if(!b(U))return S(w,U,M);U=L(U,"gm");for(var O,W=1,J=M.line,re=w.lastLine();J<=re;){for(var F=0;F<W&&!(J>re);F++){var q=w.getLine(J++);O=O==null?q:O+`
|
||||||
`+F}K=K*2,W.lastIndex=E.ch;var D=W.exec(N);if(D){var Q=N.slice(0,D.index).split(`
|
`+q}W=W*2,U.lastIndex=M.ch;var D=U.exec(O);if(D){var Q=O.slice(0,D.index).split(`
|
||||||
`),j=D[0].split(`
|
`),j=D[0].split(`
|
||||||
`),V=E.line+Q.length-1,y=Q[Q.length-1].length;return{from:p(V,y),to:p(V+j.length-1,j.length==1?y+j[0].length:j[j.length-1].length),match:D}}}}function h(w,W,E){for(var N,K=0;K<=w.length;){W.lastIndex=K;var J=W.exec(w);if(!J)break;var re=J.index+J[0].length;if(re>w.length-E)break;(!N||re>N.index+N[0].length)&&(N=J),K=J.index+1}return N}function g(w,W,E){W=L(W,"g");for(var N=E.line,K=E.ch,J=w.firstLine();N>=J;N--,K=-1){var re=w.getLine(N),q=h(re,W,K<0?0:re.length-K);if(q)return{from:p(N,q.index),to:p(N,q.index+q[0].length),match:q}}}function C(w,W,E){if(!b(W))return g(w,W,E);W=L(W,"gm");for(var N,K=1,J=w.getLine(E.line).length-E.ch,re=E.line,q=w.firstLine();re>=q;){for(var F=0;F<K&&re>=q;F++){var D=w.getLine(re--);N=N==null?D:D+`
|
`),V=M.line+Q.length-1,y=Q[Q.length-1].length;return{from:p(V,y),to:p(V+j.length-1,j.length==1?y+j[0].length:j[j.length-1].length),match:D}}}}function h(w,U,M){for(var O,W=0;W<=w.length;){U.lastIndex=W;var J=U.exec(w);if(!J)break;var re=J.index+J[0].length;if(re>w.length-M)break;(!O||re>O.index+O[0].length)&&(O=J),W=J.index+1}return O}function g(w,U,M){U=L(U,"g");for(var O=M.line,W=M.ch,J=w.firstLine();O>=J;O--,W=-1){var re=w.getLine(O),F=h(re,U,W<0?0:re.length-W);if(F)return{from:p(O,F.index),to:p(O,F.index+F[0].length),match:F}}}function C(w,U,M){if(!b(U))return g(w,U,M);U=L(U,"gm");for(var O,W=1,J=w.getLine(M.line).length-M.ch,re=M.line,F=w.firstLine();re>=F;){for(var q=0;q<W&&re>=F;q++){var D=w.getLine(re--);O=O==null?D:D+`
|
||||||
`+N}K*=2;var Q=h(N,W,J);if(Q){var j=N.slice(0,Q.index).split(`
|
`+O}W*=2;var Q=h(O,U,J);if(Q){var j=O.slice(0,Q.index).split(`
|
||||||
`),V=Q[0].split(`
|
`),V=Q[0].split(`
|
||||||
`),y=re+j.length,G=j[j.length-1].length;return{from:p(y,G),to:p(y+V.length-1,V.length==1?G+V[0].length:V[V.length-1].length),match:Q}}}}var k,c;String.prototype.normalize?(k=function(w){return w.normalize("NFD").toLowerCase()},c=function(w){return w.normalize("NFD")}):(k=function(w){return w.toLowerCase()},c=function(w){return w});function d(w,W,E,N){if(w.length==W.length)return E;for(var K=0,J=E+Math.max(0,w.length-W.length);;){if(K==J)return K;var re=K+J>>1,q=N(w.slice(0,re)).length;if(q==E)return re;q>E?J=re:K=re+1}}function x(w,W,E,N){if(!W.length)return null;var K=N?k:c,J=K(W).split(/\r|\n\r?/);e:for(var re=E.line,q=E.ch,F=w.lastLine()+1-J.length;re<=F;re++,q=0){var D=w.getLine(re).slice(q),Q=K(D);if(J.length==1){var j=Q.indexOf(J[0]);if(j==-1)continue e;var E=d(D,Q,j,K)+q;return{from:p(re,d(D,Q,j,K)+q),to:p(re,d(D,Q,j+J[0].length,K)+q)}}else{var V=Q.length-J[0].length;if(Q.slice(V)!=J[0])continue e;for(var y=1;y<J.length-1;y++)if(K(w.getLine(re+y))!=J[y])continue e;var G=w.getLine(re+J.length-1),X=K(G),O=J[J.length-1];if(X.slice(0,O.length)!=O)continue e;return{from:p(re,d(D,Q,V,K)+q),to:p(re+J.length-1,d(G,X,O.length,K))}}}}function z(w,W,E,N){if(!W.length)return null;var K=N?k:c,J=K(W).split(/\r|\n\r?/);e:for(var re=E.line,q=E.ch,F=w.firstLine()-1+J.length;re>=F;re--,q=-1){var D=w.getLine(re);q>-1&&(D=D.slice(0,q));var Q=K(D);if(J.length==1){var j=Q.lastIndexOf(J[0]);if(j==-1)continue e;return{from:p(re,d(D,Q,j,K)),to:p(re,d(D,Q,j+J[0].length,K))}}else{var V=J[J.length-1];if(Q.slice(0,V.length)!=V)continue e;for(var y=1,E=re-J.length+1;y<J.length-1;y++)if(K(w.getLine(E+y))!=J[y])continue e;var G=w.getLine(re+1-J.length),X=K(G);if(X.slice(X.length-J[0].length)!=J[0])continue e;return{from:p(re+1-J.length,d(G,X,G.length-J[0].length,K)),to:p(re,d(D,Q,V.length,K))}}}}function M(w,W,E,N){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=w,E=E?w.clipPos(E):p(0,0),this.pos={from:E,to:E};var K;typeof N=="object"?K=N.caseFold:(K=N,N=null),typeof W=="string"?(K==null&&(K=!1),this.matches=function(J,re){return(J?z:x)(w,W,re,K)}):(W=L(W,"gm"),!N||N.multiline!==!1?this.matches=function(J,re){return(J?C:s)(w,W,re)}:this.matches=function(J,re){return(J?g:S)(w,W,re)})}M.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(w){var W=this.doc.clipPos(w?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(W=p(W.line,W.ch),w?(W.ch--,W.ch<0&&(W.line--,W.ch=(this.doc.getLine(W.line)||"").length)):(W.ch++,W.ch>(this.doc.getLine(W.line)||"").length&&(W.ch=0,W.line++)),o.cmpPos(W,this.doc.clipPos(W))!=0))return this.atOccurrence=!1;var E=this.matches(w,W);if(this.afterEmptyMatch=E&&o.cmpPos(E.from,E.to)==0,E)return this.pos=E,this.atOccurrence=!0,this.pos.match||!0;var N=p(w?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:N,to:N},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(w,W){if(this.atOccurrence){var E=o.splitLines(w);this.doc.replaceRange(E,this.pos.from,this.pos.to,W),this.pos.to=p(this.pos.from.line+E.length-1,E[E.length-1].length+(E.length==1?this.pos.from.ch:0))}}},o.defineExtension("getSearchCursor",function(w,W,E){return new M(this.doc,w,W,E)}),o.defineDocExtension("getSearchCursor",function(w,W,E){return new M(this,w,W,E)}),o.defineExtension("selectMatches",function(w,W){for(var E=[],N=this.getSearchCursor(w,this.getCursor("from"),W);N.findNext()&&!(o.cmpPos(N.to(),this.getCursor("to"))>0);)E.push({anchor:N.from(),head:N.to()});E.length&&this.setSelections(E,0)})})});var Vo=Ke((ws,Ss)=>{(function(o){typeof ws=="object"&&typeof Ss=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";function p(O,R,se,_e,I,T){this.indented=O,this.column=R,this.type=se,this.info=_e,this.align=I,this.prev=T}function v(O,R,se,_e){var I=O.indented;return O.context&&O.context.type=="statement"&&se!="statement"&&(I=O.context.indented),O.context=new p(I,R,se,_e,null,O.context)}function L(O){var R=O.context.type;return(R==")"||R=="]"||R=="}")&&(O.indented=O.context.indented),O.context=O.context.prev}function b(O,R,se){if(R.prevToken=="variable"||R.prevToken=="type"||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(O.string.slice(0,se))||R.typeAtEndOfLine&&O.column()==O.indentation())return!0}function S(O){for(;;){if(!O||O.type=="top")return!0;if(O.type=="}"&&O.prev.info!="namespace")return!1;O=O.prev}}o.defineMode("clike",function(O,R){var se=O.indentUnit,_e=R.statementIndentUnit||se,I=R.dontAlignCalls,T=R.keywords||{},he=R.types||{},ze=R.builtin||{},de=R.blockKeywords||{},Ee=R.defKeywords||{},ge=R.atoms||{},Oe=R.hooks||{},qe=R.multiLineStrings,Se=R.indentStatements!==!1,Be=R.indentSwitch!==!1,Ze=R.namespaceSeparator,ke=R.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,Je=R.numberStart||/[\d\.]/,Re=R.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)
Line truncated
|
`),y=re+j.length,G=j[j.length-1].length;return{from:p(y,G),to:p(y+V.length-1,V.length==1?G+V[0].length:V[V.length-1].length),match:Q}}}}var k,c;String.prototype.normalize?(k=function(w){return w.normalize("NFD").toLowerCase()},c=function(w){return w.normalize("NFD")}):(k=function(w){return w.toLowerCase()},c=function(w){return w});function d(w,U,M,O){if(w.length==U.length)return M;for(var W=0,J=M+Math.max(0,w.length-U.length);;){if(W==J)return W;var re=W+J>>1,F=O(w.slice(0,re)).length;if(F==M)return re;F>M?J=re:W=re+1}}function x(w,U,M,O){if(!U.length)return null;var W=O?k:c,J=W(U).split(/\r|\n\r?/);e:for(var re=M.line,F=M.ch,q=w.lastLine()+1-J.length;re<=q;re++,F=0){var D=w.getLine(re).slice(F),Q=W(D);if(J.length==1){var j=Q.indexOf(J[0]);if(j==-1)continue e;var M=d(D,Q,j,W)+F;return{from:p(re,d(D,Q,j,W)+F),to:p(re,d(D,Q,j+J[0].length,W)+F)}}else{var V=Q.length-J[0].length;if(Q.slice(V)!=J[0])continue e;for(var y=1;y<J.length-1;y++)if(W(w.getLine(re+y))!=J[y])continue e;var G=w.getLine(re+J.length-1),X=W(G),N=J[J.length-1];if(X.slice(0,N.length)!=N)continue e;return{from:p(re,d(D,Q,V,W)+F),to:p(re+J.length-1,d(G,X,N.length,W))}}}}function E(w,U,M,O){if(!U.length)return null;var W=O?k:c,J=W(U).split(/\r|\n\r?/);e:for(var re=M.line,F=M.ch,q=w.firstLine()-1+J.length;re>=q;re--,F=-1){var D=w.getLine(re);F>-1&&(D=D.slice(0,F));var Q=W(D);if(J.length==1){var j=Q.lastIndexOf(J[0]);if(j==-1)continue e;return{from:p(re,d(D,Q,j,W)),to:p(re,d(D,Q,j+J[0].length,W))}}else{var V=J[J.length-1];if(Q.slice(0,V.length)!=V)continue e;for(var y=1,M=re-J.length+1;y<J.length-1;y++)if(W(w.getLine(M+y))!=J[y])continue e;var G=w.getLine(re+1-J.length),X=W(G);if(X.slice(X.length-J[0].length)!=J[0])continue e;return{from:p(re+1-J.length,d(G,X,G.length-J[0].length,W)),to:p(re,d(D,Q,V.length,W))}}}}function z(w,U,M,O){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=w,M=M?w.clipPos(M):p(0,0),this.pos={from:M,to:M};var W;typeof O=="object"?W=O.caseFold:(W=O,O=null),typeof U=="string"?(W==null&&(W=!1),this.matches=function(J,re){return(J?E:x)(w,U,re,W)}):(U=L(U,"gm"),!O||O.multiline!==!1?this.matches=function(J,re){return(J?C:s)(w,U,re)}:this.matches=function(J,re){return(J?g:S)(w,U,re)})}z.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(w){var U=this.doc.clipPos(w?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(U=p(U.line,U.ch),w?(U.ch--,U.ch<0&&(U.line--,U.ch=(this.doc.getLine(U.line)||"").length)):(U.ch++,U.ch>(this.doc.getLine(U.line)||"").length&&(U.ch=0,U.line++)),o.cmpPos(U,this.doc.clipPos(U))!=0))return this.atOccurrence=!1;var M=this.matches(w,U);if(this.afterEmptyMatch=M&&o.cmpPos(M.from,M.to)==0,M)return this.pos=M,this.atOccurrence=!0,this.pos.match||!0;var O=p(w?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:O,to:O},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(w,U){if(this.atOccurrence){var M=o.splitLines(w);this.doc.replaceRange(M,this.pos.from,this.pos.to,U),this.pos.to=p(this.pos.from.line+M.length-1,M[M.length-1].length+(M.length==1?this.pos.from.ch:0))}}},o.defineExtension("getSearchCursor",function(w,U,M){return new z(this.doc,w,U,M)}),o.defineDocExtension("getSearchCursor",function(w,U,M){return new z(this,w,U,M)}),o.defineExtension("selectMatches",function(w,U){for(var M=[],O=this.getSearchCursor(w,this.getCursor("from"),U);O.findNext()&&!(o.cmpPos(O.to(),this.getCursor("to"))>0);)M.push({anchor:O.from(),head:O.to()});M.length&&this.setSelections(M,0)})})});var Vo=Ke((ws,Ss)=>{(function(o){typeof ws=="object"&&typeof Ss=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";function p(N,R,se,_e,I,T){this.indented=N,this.column=R,this.type=se,this.info=_e,this.align=I,this.prev=T}function v(N,R,se,_e){var I=N.indented;return N.context&&N.context.type=="statement"&&se!="statement"&&(I=N.context.indented),N.context=new p(I,R,se,_e,null,N.context)}function L(N){var R=N.context.type;return(R==")"||R=="]"||R=="}")&&(N.indented=N.context.indented),N.context=N.context.prev}function b(N,R,se){if(R.prevToken=="variable"||R.prevToken=="type"||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(N.string.slice(0,se))||R.typeAtEndOfLine&&N.column()==N.indentation())return!0}function S(N){for(;;){if(!N||N.type=="top")return!0;if(N.type=="}"&&N.prev.info!="namespace")return!1;N=N.prev}}o.defineMode("clike",function(N,R){var se=N.indentUnit,_e=R.statementIndentUnit||se,I=R.dontAlignCalls,T=R.keywords||{},he=R.types||{},ze=R.builtin||{},de=R.blockKeywords||{},Ee=R.defKeywords||{},ge=R.atoms||{},Oe=R.hooks||{},qe=R.multiLineStrings,Se=R.indentStatements!==!1,Be=R.indentSwitch!==!1,Ze=R.namespaceSeparator,ke=R.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,Je=R.numberStart||/[\d\.]/,Re=R.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)
Line truncated
|
||||||
`&&(b.innerActive=b.inner=null);else for(var s=0;s<v.length;++s){var h=v[s];h.open===`
|
`&&(b.innerActive=b.inner=null);else for(var s=0;s<v.length;++s){var h=v[s];h.open===`
|
||||||
`&&(b.innerActive=h,b.inner=o.startState(h.mode,S.indent?S.indent(b.outer,"",""):0))}},electricChars:p.electricChars,innerMode:function(b){return b.inner?{state:b.inner,mode:b.innerActive.mode}:{state:b.outer,mode:p}}}}})});var lc=Ke((oc,ac)=>{(function(o){typeof oc=="object"&&typeof ac=="object"?o(We(),Di(),ic()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../../addon/mode/simple","../../addon/mode/multiplex"],o):o(CodeMirror)})(function(o){"use strict";o.defineSimpleMode("handlebars-tags",{start:[{regex:/\{\{\{/,push:"handlebars_raw",token:"tag"},{regex:/\{\{!--/,push:"dash_comment",token:"comment"},{regex:/\{\{!/,push:"comment",token:"comment"},{regex:/\{\{/,push:"handlebars",token:"tag"}],handlebars_raw:[{regex:/\}\}\}/,pop:!0,token:"tag"}],handlebars:[{regex:/\}\}/,pop:!0,token:"tag"},{regex:/"(?:[^\\"]|\\.)*"?/,token:"string"},{regex:/'(?:[^\\']|\\.)*'?/,token:"string"},{regex:/>|[#\/]([A-Za-z_]\w*)/,token:"keyword"},{regex:/(?:else|this)\b/,token:"keyword"},{regex:/\d+/i,token:"number"},{regex:/=|~|@|true|false/,token:"atom"},{regex:/(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/,token:"variable-2"}],dash_comment:[{regex:/--\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],comment:[{regex:/\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],meta:{blockCommentStart:"{{--",blockCommentEnd:"--}}"}}),o.defineMode("handlebars",function(p,v){var L=o.getMode(p,"handlebars-tags");return!v||!v.base?L:o.multiplexingMode(o.getMode(p,v.base),{open:"{{",close:/\}\}\}?/,mode:L,parseDelimiters:!0})}),o.defineMIME("text/x-handlebars-template","handlebars")})});var cc=Ke((sc,uc)=>{(function(o){"use strict";typeof sc=="object"&&typeof uc=="object"?o(We(),Yn(),mn(),vn(),Vu(),gn(),ea(),ta(),tc(),lc()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../../addon/mode/overlay","../xml/xml","../javascript/javascript","../coffeescript/coffeescript","../css/css","../sass/sass","../stylus/stylus","../pug/pug","../handlebars/handlebars"],o):o(CodeMirror)})(function(o){var p={script:[["lang",/coffee(script)?/,"coffeescript"],["type",/^(?:text|application)\/(?:x-)?coffee(?:script)?$/,"coffeescript"],["lang",/^babel$/,"javascript"],["type",/^text\/babel$/,"javascript"],["type",/^text\/ecmascript-\d+$/,"javascript"]],style:[["lang",/^stylus$/i,"stylus"],["lang",/^sass$/i,"sass"],["lang",/^less$/i,"text/x-less"],["lang",/^scss$/i,"text/x-scss"],["type",/^(text\/)?(x-)?styl(us)?$/i,"stylus"],["type",/^text\/sass/i,"sass"],["type",/^(text\/)?(x-)?scss$/i,"text/x-scss"],["type",/^(text\/)?(x-)?less$/i,"text/x-less"]],template:[["lang",/^vue-template$/i,"vue"],["lang",/^pug$/i,"pug"],["lang",/^handlebars$/i,"handlebars"],["type",/^(text\/)?(x-)?pug$/i,"pug"],["type",/^text\/x-handlebars-template$/i,"handlebars"],[null,null,"vue-template"]]};o.defineMode("vue-template",function(v,L){var b={token:function(S){if(S.match(/^\{\{.*?\}\}/))return"meta mustache";for(;S.next()&&!S.match("{{",!1););return null}};return o.overlayMode(o.getMode(v,L.backdrop||"text/html"),b)}),o.defineMode("vue",function(v){return o.getMode(v,{name:"htmlmixed",tags:p})},"htmlmixed","xml","javascript","coffeescript","css","sass","stylus","pug","handlebars"),o.defineMIME("script/x-vue","vue"),o.defineMIME("text/x-vue","vue")})});var pc=Ke((fc,dc)=>{(function(o){typeof fc=="object"&&typeof dc=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("yaml",function(){var p=["true","false","on","off","yes","no"],v=new RegExp("\\b(("+p.join(")|(")+"))$","i");return{token:function(L,b){var S=L.peek(),s=b.escaped;if(b.escaped=!1,S=="#"&&(L.pos==0||/\s/.test(L.string.charAt(L.pos-1))))return L.skipToEnd(),"comment";if(L.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(b.literal&&L.indentation()>b.keyCol)return L.skipToEnd(),"string";if(b.literal&&(b.literal=!1),L.sol()){if(b.keyCol=0,b.pair=!1,b.pairStart=!1,L.match("---")||L.match("..."))return"def";if(L.match(/\s*-\s+/))return"meta"}if(L.match(/^(\{|\}|\[|\])/))return S=="{"?b.inlinePairs++:S=="}"?b.inlinePairs--:S=="["?b.inlineList++:b.inlineList--,"meta";if(b.inlineList>0&&!s&&S==",")return L.next(),"meta";if(b.inlinePairs>0&&!s&&S==",")return b.keyCol=0,b.pair=!1,b.pairStart=!1,L.next(),"meta";if(b.pairStart){if(L.match(/^\s*(\||\>)\s*/))return b.literal=!0,"meta";if(L.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(b.inlinePairs==0&&L.match(/^\s*-?[0-9\.\,]+\s?$/)||b.inlinePairs>0&&L.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(L.match(v))return"keyword"}return!b.pair&&L.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^\s,\[\]{}#&*!|>'"%@`])[^#:]*(?=:($|\s))/)?(b.pair=!0,b.keyCol=L.indentation(),"atom"):b.pair&&L.match(/^:\s*/)?(b.pairStart=!0,"meta"):(b.pairStart=!1,b.escaped=S=="\\",L.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},lineComment:"#",fold:"indent"}}),o.defineMIME(Line truncated
|
`&&(b.innerActive=h,b.inner=o.startState(h.mode,S.indent?S.indent(b.outer,"",""):0))}},electricChars:p.electricChars,innerMode:function(b){return b.inner?{state:b.inner,mode:b.innerActive.mode}:{state:b.outer,mode:p}}}}})});var lc=Ke((oc,ac)=>{(function(o){typeof oc=="object"&&typeof ac=="object"?o(We(),Di(),ic()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../../addon/mode/simple","../../addon/mode/multiplex"],o):o(CodeMirror)})(function(o){"use strict";o.defineSimpleMode("handlebars-tags",{start:[{regex:/\{\{\{/,push:"handlebars_raw",token:"tag"},{regex:/\{\{!--/,push:"dash_comment",token:"comment"},{regex:/\{\{!/,push:"comment",token:"comment"},{regex:/\{\{/,push:"handlebars",token:"tag"}],handlebars_raw:[{regex:/\}\}\}/,pop:!0,token:"tag"}],handlebars:[{regex:/\}\}/,pop:!0,token:"tag"},{regex:/"(?:[^\\"]|\\.)*"?/,token:"string"},{regex:/'(?:[^\\']|\\.)*'?/,token:"string"},{regex:/>|[#\/]([A-Za-z_]\w*)/,token:"keyword"},{regex:/(?:else|this)\b/,token:"keyword"},{regex:/\d+/i,token:"number"},{regex:/=|~|@|true|false/,token:"atom"},{regex:/(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/,token:"variable-2"}],dash_comment:[{regex:/--\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],comment:[{regex:/\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],meta:{blockCommentStart:"{{--",blockCommentEnd:"--}}"}}),o.defineMode("handlebars",function(p,v){var L=o.getMode(p,"handlebars-tags");return!v||!v.base?L:o.multiplexingMode(o.getMode(p,v.base),{open:"{{",close:/\}\}\}?/,mode:L,parseDelimiters:!0})}),o.defineMIME("text/x-handlebars-template","handlebars")})});var cc=Ke((sc,uc)=>{(function(o){"use strict";typeof sc=="object"&&typeof uc=="object"?o(We(),Yn(),mn(),vn(),Vu(),gn(),ea(),ta(),tc(),lc()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../../addon/mode/overlay","../xml/xml","../javascript/javascript","../coffeescript/coffeescript","../css/css","../sass/sass","../stylus/stylus","../pug/pug","../handlebars/handlebars"],o):o(CodeMirror)})(function(o){var p={script:[["lang",/coffee(script)?/,"coffeescript"],["type",/^(?:text|application)\/(?:x-)?coffee(?:script)?$/,"coffeescript"],["lang",/^babel$/,"javascript"],["type",/^text\/babel$/,"javascript"],["type",/^text\/ecmascript-\d+$/,"javascript"]],style:[["lang",/^stylus$/i,"stylus"],["lang",/^sass$/i,"sass"],["lang",/^less$/i,"text/x-less"],["lang",/^scss$/i,"text/x-scss"],["type",/^(text\/)?(x-)?styl(us)?$/i,"stylus"],["type",/^text\/sass/i,"sass"],["type",/^(text\/)?(x-)?scss$/i,"text/x-scss"],["type",/^(text\/)?(x-)?less$/i,"text/x-less"]],template:[["lang",/^vue-template$/i,"vue"],["lang",/^pug$/i,"pug"],["lang",/^handlebars$/i,"handlebars"],["type",/^(text\/)?(x-)?pug$/i,"pug"],["type",/^text\/x-handlebars-template$/i,"handlebars"],[null,null,"vue-template"]]};o.defineMode("vue-template",function(v,L){var b={token:function(S){if(S.match(/^\{\{.*?\}\}/))return"meta mustache";for(;S.next()&&!S.match("{{",!1););return null}};return o.overlayMode(o.getMode(v,L.backdrop||"text/html"),b)}),o.defineMode("vue",function(v){return o.getMode(v,{name:"htmlmixed",tags:p})},"htmlmixed","xml","javascript","coffeescript","css","sass","stylus","pug","handlebars"),o.defineMIME("script/x-vue","vue"),o.defineMIME("text/x-vue","vue")})});var pc=Ke((fc,dc)=>{(function(o){typeof fc=="object"&&typeof dc=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("yaml",function(){var p=["true","false","on","off","yes","no"],v=new RegExp("\\b(("+p.join(")|(")+"))$","i");return{token:function(L,b){var S=L.peek(),s=b.escaped;if(b.escaped=!1,S=="#"&&(L.pos==0||/\s/.test(L.string.charAt(L.pos-1))))return L.skipToEnd(),"comment";if(L.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(b.literal&&L.indentation()>b.keyCol)return L.skipToEnd(),"string";if(b.literal&&(b.literal=!1),L.sol()){if(b.keyCol=0,b.pair=!1,b.pairStart=!1,L.match("---")||L.match("..."))return"def";if(L.match(/\s*-\s+/))return"meta"}if(L.match(/^(\{|\}|\[|\])/))return S=="{"?b.inlinePairs++:S=="}"?b.inlinePairs--:S=="["?b.inlineList++:b.inlineList--,"meta";if(b.inlineList>0&&!s&&S==",")return L.next(),"meta";if(b.inlinePairs>0&&!s&&S==",")return b.keyCol=0,b.pair=!1,b.pairStart=!1,L.next(),"meta";if(b.pairStart){if(L.match(/^\s*(\||\>)\s*/))return b.literal=!0,"meta";if(L.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(b.inlinePairs==0&&L.match(/^\s*-?[0-9\.\,]+\s?$/)||b.inlinePairs>0&&L.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(L.match(v))return"keyword"}return!b.pair&&L.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^\s,\[\]{}#&*!|>'"%@`])[^#:]*(?=:($|\s))/)?(b.pair=!0,b.keyCol=L.indentation(),"atom"):b.pair&&L.match(/^:\s*/)?(b.pairStart=!0,"meta"):(b.pairStart=!1,b.escaped=S=="\\",L.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},lineComment:"#",fold:"indent"}}),o.defineMIME(Line truncated
|
||||||
`,T=`
|
`,T=`
|
||||||
`+O;_e&&se++,_e&&X.ch===0&&(T=O+`
|
`+N;_e&&se++,_e&&X.ch===0&&(T=N+`
|
||||||
`,se--),jr(y,!1,[I,T]),y.setSelection({line:R,ch:0},{line:se,ch:0})}var s=o.codemirror,h=s.getCursor("start"),g=s.getCursor("end"),C=s.getTokenAt({line:h.line,ch:h.ch||1}),k=s.getLineHandle(h.line),c=b(s,h.line,k,C),d,x,z;if(c==="single"){var M=k.text.slice(0,h.ch).replace("`",""),w=k.text.slice(h.ch).replace("`","");s.replaceRange(M+w,{line:h.line,ch:0},{line:h.line,ch:99999999999999}),h.ch--,h!==g&&g.ch--,s.setSelection(h,g),s.focus()}else if(c==="fenced")if(h.line!==g.line||h.ch!==g.ch){for(d=h.line;d>=0&&(k=s.getLineHandle(d),!v(k));d--);var W=s.getTokenAt({line:d,ch:1}),E=L(W).fencedChars,N,K,J,re;v(s.getLineHandle(h.line))?(N="",K=h.line):v(s.getLineHandle(h.line-1))?(N="",K=h.line-1):(N=E+`
|
`,se--),jr(y,!1,[I,T]),y.setSelection({line:R,ch:0},{line:se,ch:0})}var s=o.codemirror,h=s.getCursor("start"),g=s.getCursor("end"),C=s.getTokenAt({line:h.line,ch:h.ch||1}),k=s.getLineHandle(h.line),c=b(s,h.line,k,C),d,x,E;if(c==="single"){var z=k.text.slice(0,h.ch).replace("`",""),w=k.text.slice(h.ch).replace("`","");s.replaceRange(z+w,{line:h.line,ch:0},{line:h.line,ch:99999999999999}),h.ch--,h!==g&&g.ch--,s.setSelection(h,g),s.focus()}else if(c==="fenced")if(h.line!==g.line||h.ch!==g.ch){for(d=h.line;d>=0&&(k=s.getLineHandle(d),!v(k));d--);var U=s.getTokenAt({line:d,ch:1}),M=L(U).fencedChars,O,W,J,re;v(s.getLineHandle(h.line))?(O="",W=h.line):v(s.getLineHandle(h.line-1))?(O="",W=h.line-1):(O=M+`
|
||||||
`,K=h.line),v(s.getLineHandle(g.line))?(J="",re=g.line,g.ch===0&&(re+=1)):g.ch!==0&&v(s.getLineHandle(g.line+1))?(J="",re=g.line+1):(J=E+`
|
`,W=h.line),v(s.getLineHandle(g.line))?(J="",re=g.line,g.ch===0&&(re+=1)):g.ch!==0&&v(s.getLineHandle(g.line+1))?(J="",re=g.line+1):(J=M+`
|
||||||
`,re=g.line+1),g.ch===0&&(re-=1),s.operation(function(){s.replaceRange(J,{line:re,ch:0},{line:re+(J?0:1),ch:0}),s.replaceRange(N,{line:K,ch:0},{line:K+(N?0:1),ch:0})}),s.setSelection({line:K+(N?1:0),ch:0},{line:re+(N?1:-1),ch:0}),s.focus()}else{var q=h.line;if(v(s.getLineHandle(h.line))&&(b(s,h.line+1)==="fenced"?(d=h.line,q=h.line+1):(x=h.line,q=h.line-1)),d===void 0)for(d=q;d>=0&&(k=s.getLineHandle(d),!v(k));d--);if(x===void 0)for(z=s.lineCount(),x=q;x<z&&(k=s.getLineHandle(x),!v(k));x++);s.operation(function(){s.replaceRange("",{line:d,ch:0},{line:d+1,ch:0}),s.replaceRange("",{line:x-1,ch:0},{line:x,ch:0})}),s.focus()}else if(c==="indented"){if(h.line!==g.line||h.ch!==g.ch)d=h.line,x=g.line,g.ch===0&&x--;else{for(d=h.line;d>=0;d--)if(k=s.getLineHandle(d),!k.text.match(/^\s*$/)&&b(s,d,k)!=="indented"){d+=1;break}for(z=s.lineCount(),x=h.line;x<z;x++)if(k=s.getLineHandle(x),!k.text.match(/^\s*$/)&&b(s,x,k)!=="indented"){x-=1;break}}var F=s.getLineHandle(x+1),D=F&&s.getTokenAt({line:x+1,ch:F.text.length-1}),Q=D&&L(D).indentedCode;s.operation(function(){Q&&s.replaceRange(`
|
`,re=g.line+1),g.ch===0&&(re-=1),s.operation(function(){s.replaceRange(J,{line:re,ch:0},{line:re+(J?0:1),ch:0}),s.replaceRange(O,{line:W,ch:0},{line:W+(O?0:1),ch:0})}),s.setSelection({line:W+(O?1:0),ch:0},{line:re+(O?1:-1),ch:0}),s.focus()}else{var F=h.line;if(v(s.getLineHandle(h.line))&&(b(s,h.line+1)==="fenced"?(d=h.line,F=h.line+1):(x=h.line,F=h.line-1)),d===void 0)for(d=F;d>=0&&(k=s.getLineHandle(d),!v(k));d--);if(x===void 0)for(E=s.lineCount(),x=F;x<E&&(k=s.getLineHandle(x),!v(k));x++);s.operation(function(){s.replaceRange("",{line:d,ch:0},{line:d+1,ch:0}),s.replaceRange("",{line:x-1,ch:0},{line:x,ch:0})}),s.focus()}else if(c==="indented"){if(h.line!==g.line||h.ch!==g.ch)d=h.line,x=g.line,g.ch===0&&x--;else{for(d=h.line;d>=0;d--)if(k=s.getLineHandle(d),!k.text.match(/^\s*$/)&&b(s,d,k)!=="indented"){d+=1;break}for(E=s.lineCount(),x=h.line;x<E;x++)if(k=s.getLineHandle(x),!k.text.match(/^\s*$/)&&b(s,x,k)!=="indented"){x-=1;break}}var q=s.getLineHandle(x+1),D=q&&s.getTokenAt({line:x+1,ch:q.text.length-1}),Q=D&&L(D).indentedCode;s.operation(function(){Q&&s.replaceRange(`
|
||||||
`,{line:x+1,ch:0});for(var y=d;y<=x;y++)s.indentLine(y,"subtract")}),s.focus()}else{var j=h.line===g.line&&h.ch===g.ch&&h.ch===0,V=h.line!==g.line;j||V?S(s,h,g,p):jr(s,!1,["`","`"])}}function Bi(o){la(o.codemirror,"quote")}function Jn(o){Lr(o.codemirror,"smaller")}function ji(o){Lr(o.codemirror,"bigger")}function Ri(o){Lr(o.codemirror,void 0,1)}function Hi(o){Lr(o.codemirror,void 0,2)}function Wi(o){Lr(o.codemirror,void 0,3)}function na(o){Lr(o.codemirror,void 0,4)}function ia(o){Lr(o.codemirror,void 0,5)}function oa(o){Lr(o.codemirror,void 0,6)}function Ui(o){var p=o.codemirror,v="*";["-","+","*"].includes(o.options.unorderedListStyle)&&(v=o.options.unorderedListStyle),la(p,"unordered-list",v)}function $i(o){la(o.codemirror,"ordered-list")}function Ki(o){Pd(o.codemirror)}function Gi(o){var p=o.options,v="https://";if(p.promptURLs){var L=prompt(p.promptTexts.link,v);if(!L)return!1;v=bc(L)}xc(o,"link",p.insertTexts.link,v)}function Zi(o){var p=o.options,v="https://";if(p.promptURLs){var L=prompt(p.promptTexts.image,v);if(!L)return!1;v=bc(L)}xc(o,"image",p.insertTexts.image,v)}function bc(o){return encodeURI(o).replace(/([\\()])/g,"\\$1")}function aa(o){o.openBrowseFileWindow()}function yc(o,p){var v=o.codemirror,L=Tr(v),b=o.options,S=p.substr(p.lastIndexOf("/")+1),s=S.substring(S.lastIndexOf(".")+1).replace(/\?.*$/,"").toLowerCase();if(["png","jpg","jpeg","gif","svg","apng","avif","webp"].includes(s))jr(v,L.image,b.insertTexts.uploadedImage,p);else{var h=b.insertTexts.link;h[0]="["+S,jr(v,L.link,h,p)}o.updateStatusBar("upload-image",o.options.imageTexts.sbOnUploaded.replace("#image_name#",S)),setTimeout(function(){o.updateStatusBar("upload-image",o.options.imageTexts.sbInit)},1e3)}function Xi(o){var p=o.codemirror,v=Tr(p),L=o.options;jr(p,v.table,L.insertTexts.table)}function Yi(o){var p=o.codemirror,v=Tr(p),L=o.options;jr(p,v.image,L.insertTexts.horizontalRule)}function Qi(o){var p=o.codemirror;p.undo(),p.focus()}function Vi(o){var p=o.codemirror;p.redo(),p.focus()}function bn(o){var p=o.codemirror,v=p.getWrapperElement(),L=v.nextSibling,b=o.toolbarElements&&o.toolbarElements["side-by-side"],S=!1,s=v.parentNode;L.classList.contains("editor-preview-active-side")?(o.options.sideBySideFullscreen===!1&&s.classList.remove("sided--no-fullscreen"),L.classList.remove("editor-preview-active-side"),b&&b.classList.remove("active"),v.classList.remove("CodeMirror-sided")):(setTimeout(function(){p.getOption("fullScreen")||(o.options.sideBySideFullscreen===!1?s.classList.add("sided--no-fullscreen"):Br(o)),L.classList.add("editor-preview-active-side")},1),b&&b.classList.add("active"),v.classList.add("CodeMirror-sided"),S=!0);var h=v.lastChild;if(h.classList.contains("editor-preview-active")){h.classList.remove("editor-preview-active");var g=o.toolbarElements.preview,C=o.toolbar_div;g.classList.remove("active"),C.classList.remove("disabled-for-preview")}var k=function(){var d=o.options.previewRender(o.value(),L);d!=null&&(L.innerHTML=d)};if(p.sideBySideRenderingFunction||(p.sideBySideRenderingFunction=k),S){var c=o.options.previewRender(o.value(),L);c!=null&&(L.innerHTML=c),p.on("update",p.sideBySideRenderingFunction)}else p.off("update",p.sideBySideRenderingFunction);p.refresh()}function Ji(o){var p=o.codemirror,v=p.getWrapperElement(),L=o.toolbar_div,b=o.options.toolbar?o.toolbarElements.preview:!1,S=v.lastChild,s=p.getWrapperElement().nextSibling;if(s.classList.contains("editor-preview-active-side")&&bn(o),!S||!S.classList.contains("editor-preview-full")){if(S=document.createElement("div"),S.className="editor-preview-full",o.options.previewClass)if(Array.isArray(o.options.previewClass))for(var h=0;h<o.options.previewClass.length;h++)S.classList.add(o.options.previewClass[h]);else typeof o.options.previewClass=="string"&&S.classList.add(o.options.previewClass);v.appendChild(S)}S.classList.contains("editor-preview-active")?(S.classList.remove("editor-preview-active"),b&&(b.classList.remove("active"),L.classList.remove("disabled-for-preview"))):(setTimeout(function(){S.classList.add("editor-preview-active")},1),b&&(b.classList.add("active"),L.classList.add("disabled-for-preview")));var g=o.options.previewRender(o.value(),S);g!==null&&(S.innerHTML=g)}function jr(o,p,v,L){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active")){var b,S=v[0],s=v[1],h={},g={};Object.assign(h,o.getCursor("start")),Object.assign(g,o.getCursor("end")),L&&(S=S.replace("#url#",L),s=s.replace("#url#",L)),p?(b=o.getLine(h.line),S=b.slice(0,h.ch),s=b.slice(h.ch),o.replaceRange(S+s,{line:h.line,ch:0})):(b=o.getSelection(),o.replaceSelection(S+b+s),h.ch+=S.length,h!==g&&(g.ch+=S.length)),o.setSelection(h,g),o.focus()}}function Lr(o,p,v){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active")){for(var L=o.getCursor("start"),b=o.getCursor("end"),S=L.line;S<=b.line;S++)(function(s){var h=o.getLine(s),g=h.search(/[^#]/);p!==void 0?g<=0?p=="bigger"?h="###### "+h:h="# "+h:g==6&&p=="smaller"?h=h.substr(7):g==1&&p
Line truncated
|
`,{line:x+1,ch:0});for(var y=d;y<=x;y++)s.indentLine(y,"subtract")}),s.focus()}else{var j=h.line===g.line&&h.ch===g.ch&&h.ch===0,V=h.line!==g.line;j||V?S(s,h,g,p):jr(s,!1,["`","`"])}}function Bi(o){la(o.codemirror,"quote")}function Jn(o){Lr(o.codemirror,"smaller")}function ji(o){Lr(o.codemirror,"bigger")}function Ri(o){Lr(o.codemirror,void 0,1)}function Hi(o){Lr(o.codemirror,void 0,2)}function Wi(o){Lr(o.codemirror,void 0,3)}function na(o){Lr(o.codemirror,void 0,4)}function ia(o){Lr(o.codemirror,void 0,5)}function oa(o){Lr(o.codemirror,void 0,6)}function Ui(o){var p=o.codemirror,v="*";["-","+","*"].includes(o.options.unorderedListStyle)&&(v=o.options.unorderedListStyle),la(p,"unordered-list",v)}function $i(o){la(o.codemirror,"ordered-list")}function Ki(o){Pd(o.codemirror)}function Gi(o){var p=o.options,v="https://";if(p.promptURLs){var L=prompt(p.promptTexts.link,v);if(!L)return!1;v=bc(L)}xc(o,"link",p.insertTexts.link,v)}function Zi(o){var p=o.options,v="https://";if(p.promptURLs){var L=prompt(p.promptTexts.image,v);if(!L)return!1;v=bc(L)}xc(o,"image",p.insertTexts.image,v)}function bc(o){return encodeURI(o).replace(/([\\()])/g,"\\$1")}function aa(o){o.openBrowseFileWindow()}function yc(o,p){var v=o.codemirror,L=Tr(v),b=o.options,S=p.substr(p.lastIndexOf("/")+1),s=S.substring(S.lastIndexOf(".")+1).replace(/\?.*$/,"").toLowerCase();if(["png","jpg","jpeg","gif","svg","apng","avif","webp"].includes(s))jr(v,L.image,b.insertTexts.uploadedImage,p);else{var h=b.insertTexts.link;h[0]="["+S,jr(v,L.link,h,p)}o.updateStatusBar("upload-image",o.options.imageTexts.sbOnUploaded.replace("#image_name#",S)),setTimeout(function(){o.updateStatusBar("upload-image",o.options.imageTexts.sbInit)},1e3)}function Xi(o){var p=o.codemirror,v=Tr(p),L=o.options;jr(p,v.table,L.insertTexts.table)}function Yi(o){var p=o.codemirror,v=Tr(p),L=o.options;jr(p,v.image,L.insertTexts.horizontalRule)}function Qi(o){var p=o.codemirror;p.undo(),p.focus()}function Vi(o){var p=o.codemirror;p.redo(),p.focus()}function bn(o){var p=o.codemirror,v=p.getWrapperElement(),L=v.nextSibling,b=o.toolbarElements&&o.toolbarElements["side-by-side"],S=!1,s=v.parentNode;L.classList.contains("editor-preview-active-side")?(o.options.sideBySideFullscreen===!1&&s.classList.remove("sided--no-fullscreen"),L.classList.remove("editor-preview-active-side"),b&&b.classList.remove("active"),v.classList.remove("CodeMirror-sided")):(setTimeout(function(){p.getOption("fullScreen")||(o.options.sideBySideFullscreen===!1?s.classList.add("sided--no-fullscreen"):Br(o)),L.classList.add("editor-preview-active-side")},1),b&&b.classList.add("active"),v.classList.add("CodeMirror-sided"),S=!0);var h=v.lastChild;if(h.classList.contains("editor-preview-active")){h.classList.remove("editor-preview-active");var g=o.toolbarElements.preview,C=o.toolbar_div;g.classList.remove("active"),C.classList.remove("disabled-for-preview")}var k=function(){var d=o.options.previewRender(o.value(),L);d!=null&&(L.innerHTML=d)};if(p.sideBySideRenderingFunction||(p.sideBySideRenderingFunction=k),S){var c=o.options.previewRender(o.value(),L);c!=null&&(L.innerHTML=c),p.on("update",p.sideBySideRenderingFunction)}else p.off("update",p.sideBySideRenderingFunction);p.refresh()}function Ji(o){var p=o.codemirror,v=p.getWrapperElement(),L=o.toolbar_div,b=o.options.toolbar?o.toolbarElements.preview:!1,S=v.lastChild,s=p.getWrapperElement().nextSibling;if(s.classList.contains("editor-preview-active-side")&&bn(o),!S||!S.classList.contains("editor-preview-full")){if(S=document.createElement("div"),S.className="editor-preview-full",o.options.previewClass)if(Array.isArray(o.options.previewClass))for(var h=0;h<o.options.previewClass.length;h++)S.classList.add(o.options.previewClass[h]);else typeof o.options.previewClass=="string"&&S.classList.add(o.options.previewClass);v.appendChild(S)}S.classList.contains("editor-preview-active")?(S.classList.remove("editor-preview-active"),b&&(b.classList.remove("active"),L.classList.remove("disabled-for-preview"))):(setTimeout(function(){S.classList.add("editor-preview-active")},1),b&&(b.classList.add("active"),L.classList.add("disabled-for-preview")));var g=o.options.previewRender(o.value(),S);g!==null&&(S.innerHTML=g)}function jr(o,p,v,L){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active")){var b,S=v[0],s=v[1],h={},g={};Object.assign(h,o.getCursor("start")),Object.assign(g,o.getCursor("end")),L&&(S=S.replace("#url#",L),s=s.replace("#url#",L)),p?(b=o.getLine(h.line),S=b.slice(0,h.ch),s=b.slice(h.ch),o.replaceRange(S+s,{line:h.line,ch:0})):(b=o.getSelection(),o.replaceSelection(S+b+s),h.ch+=S.length,h!==g&&(g.ch+=S.length)),o.setSelection(h,g),o.focus()}}function Lr(o,p,v){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active")){for(var L=o.getCursor("start"),b=o.getCursor("end"),S=L.line;S<=b.line;S++)(function(s){var h=o.getLine(s),g=h.search(/[^#]/);p!==void 0?g<=0?p=="bigger"?h="###### "+h:h="# "+h:g==6&&p=="smaller"?h=h.substr(7):g==1&&p
Line truncated
|
||||||
|
|
||||||
| Column 1 | Column 2 | Column 3 |
|
| Column 1 | Column 2 | Column 3 |
|
||||||
| -------- | -------- | -------- |
|
| -------- | -------- | -------- |
|
||||||
@@ -48,4 +48,4 @@ b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.
|
|||||||
-----
|
-----
|
||||||
|
|
||||||
`]},jd={link:"URL for the link:",image:"URL of the image:"},Rd={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},Hd={bold:"**",code:"```",italic:"*"},Wd={sbInit:"Attach files by drag and dropping or pasting from clipboard.",sbOnDragEnter:"Drop image to upload it.",sbOnDrop:"Uploading image #images_names#...",sbProgress:"Uploading #file_name#: #progress#%",sbOnUploaded:"Uploaded #image_name#",sizeUnits:" B, KB, MB"},Ud={noFileGiven:"You must select a file.",typeNotAllowed:"This image type is not allowed.",fileTooLarge:`Image #image_name# is too big (#image_size#).
|
`]},jd={link:"URL for the link:",image:"URL of the image:"},Rd={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},Hd={bold:"**",code:"```",italic:"*"},Wd={sbInit:"Attach files by drag and dropping or pasting from clipboard.",sbOnDragEnter:"Drop image to upload it.",sbOnDrop:"Uploading image #images_names#...",sbProgress:"Uploading #file_name#: #progress#%",sbOnUploaded:"Uploaded #image_name#",sizeUnits:" B, KB, MB"},Ud={noFileGiven:"You must select a file.",typeNotAllowed:"This image type is not allowed.",fileTooLarge:`Image #image_name# is too big (#image_size#).
|
||||||
Maximum file size is #image_max_size#.`,importError:"Something went wrong when uploading the image #image_name#."};Te.prototype.uploadImages=function(o,p,v){if(o.length!==0){for(var L=[],b=0;b<o.length;b++)L.push(o[b].name),this.uploadImage(o[b],p,v);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",L.join(", ")))}};Te.prototype.uploadImagesUsingCustomFunction=function(o,p){if(p.length!==0){for(var v=[],L=0;L<p.length;L++)v.push(p[L].name),this.uploadImageUsingCustomFunction(o,p[L]);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",v.join(", ")))}};Te.prototype.updateStatusBar=function(o,p){if(this.gui.statusbar){var v=this.gui.statusbar.getElementsByClassName(o);v.length===1?this.gui.statusbar.getElementsByClassName(o)[0].textContent=p:v.length===0?console.log("EasyMDE: status bar item "+o+" was not found."):console.log("EasyMDE: Several status bar items named "+o+" was found.")}};Te.prototype.markdown=function(o){if(marked){var p;if(this.options&&this.options.renderingConfig&&this.options.renderingConfig.markedOptions?p=this.options.renderingConfig.markedOptions:p={},this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1?p.breaks=!1:p.breaks=!0,this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0){var v=this.options.renderingConfig.hljs||window.hljs;v&&(p.highlight=function(b,S){return S&&v.getLanguage(S)?v.highlight(S,b).value:v.highlightAuto(b).value})}marked.setOptions(p);var L=marked.parse(o);return this.options.renderingConfig&&typeof this.options.renderingConfig.sanitizerFunction=="function"&&(L=this.options.renderingConfig.sanitizerFunction.call(this,L)),L=qd(L),L=Fd(L),L}};Te.prototype.render=function(o){if(o||(o=this.element||document.getElementsByTagName("textarea")[0]),this._rendered&&this._rendered===o)return;this.element=o;var p=this.options,v=this,L={};function b(E){let N=E.getInputField(),K=N.form;if(K){let J=Array.from(K.elements).filter(q=>!(q.closest&&q.closest(".editor-toolbar")||q.offsetParent===null)),re=J.indexOf(N);re!==-1&&re+1<J.length&&J[re+1]&&J[re+1].focus()}}function S(E){let N=E.getInputField(),K=N.form;if(K){let J=Array.from(K.elements).filter(q=>!(q.closest&&q.closest(".editor-toolbar")||q.offsetParent===null)),re=J.indexOf(N);if(re!==-1)for(let q=re-1;q>=0;q--){let F=J[q];if(F){F.focus();break}}}}for(var s in p.shortcuts)p.shortcuts[s]!==null&&Vn[s]!==null&&(function(E){L[vc(p.shortcuts[E])]=function(){var N=Vn[E];typeof N=="function"?N(v):typeof N=="string"&&window.open(N,"_blank")}})(s);L.Enter="newlineAndIndentContinueMarkdownList",L.Tab=E=>{let N=E.getSelection();N&&N.length>0?E.execCommand("indentMore"):b(E)},L["Shift-Tab"]=E=>{let N=E.getSelection();N&&N.length>0?E.execCommand("indentLess"):S(E)},L.Esc=function(E){E.getOption("fullScreen")&&Br(v)},this.documentOnKeyDown=function(E){E=E||window.event,E.keyCode==27&&v.codemirror.getOption("fullScreen")&&Br(v)},document.addEventListener("keydown",this.documentOnKeyDown,!1);var h,g;p.overlayMode?(CodeMirror.defineMode("overlay-mode",function(E){return CodeMirror.overlayMode(CodeMirror.getMode(E,p.spellChecker!==!1?"spell-checker":"gfm"),p.overlayMode.mode,p.overlayMode.combine)}),h="overlay-mode",g=p.parsingConfig,g.gitHubSpice=!1):(h=p.parsingConfig,h.name="gfm",h.gitHubSpice=!1),p.spellChecker!==!1&&(h="spell-checker",g=p.parsingConfig,g.name="gfm",g.gitHubSpice=!1,typeof p.spellChecker=="function"?p.spellChecker({codeMirrorInstance:CodeMirror}):CodeMirrorSpellChecker({codeMirrorInstance:CodeMirror}));function C(E,N,K){return{addNew:!1}}if(CodeMirror.getMode("php").mime="text/x-php",this.codemirror=CodeMirror.fromTextArea(o,{mode:h,backdrop:g,theme:p.theme!=null?p.theme:"easymde",tabSize:p.tabSize!=null?p.tabSize:2,indentUnit:p.tabSize!=null?p.tabSize:2,indentWithTabs:p.indentWithTabs!==!1,lineNumbers:p.lineNumbers===!0,autofocus:p.autofocus===!0,extraKeys:L,direction:p.direction,lineWrapping:p.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:p.placeholder||o.getAttribute("placeholder")||"",styleSelectedText:p.styleSelectedText!=null?p.styleSelectedText:!ra(),scrollbarStyle:p.scrollbarStyle!=null?p.scrollbarStyle:"native",configureMouse:C,inputStyle:p.inputStyle!=null?p.inputStyle:ra()?"contenteditable":"textarea",spellcheck:p.nativeSpellcheck!=null?p.nativeSpellcheck:!0,autoRefresh:p.autoRefresh!=null?p.autoRefresh:!1}),this.codemirror.getScrollerElement().style.minHeight=p.minHeight,typeof p.maxHeight<"u"&&this.codemirror.getScrollerElement().style.setProperty(this.hasExplicitMinHeight?"max-height":"height",p.maxHeight),p.forceSync===!0){var k=this.codemirror;k.on("change",function(){k.save()})}this.gui={};var c=document.createElement("div");c.classList.add("EasyMDEContainer"),c.setAttribute("role","application");var d=this.codemirror.getWrapperElement();d.parentNode.insertBefore(c,d),c.appendChild(d),p.toolbar!==!1&&(this.gui.t
Line truncated
|
Maximum file size is #image_max_size#.`,importError:"Something went wrong when uploading the image #image_name#."};Te.prototype.uploadImages=function(o,p,v){if(o.length!==0){for(var L=[],b=0;b<o.length;b++)L.push(o[b].name),this.uploadImage(o[b],p,v);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",L.join(", ")))}};Te.prototype.uploadImagesUsingCustomFunction=function(o,p){if(p.length!==0){for(var v=[],L=0;L<p.length;L++)v.push(p[L].name),this.uploadImageUsingCustomFunction(o,p[L]);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",v.join(", ")))}};Te.prototype.updateStatusBar=function(o,p){if(this.gui.statusbar){var v=this.gui.statusbar.getElementsByClassName(o);v.length===1?this.gui.statusbar.getElementsByClassName(o)[0].textContent=p:v.length===0?console.log("EasyMDE: status bar item "+o+" was not found."):console.log("EasyMDE: Several status bar items named "+o+" was found.")}};Te.prototype.markdown=function(o){if(marked){var p;if(this.options&&this.options.renderingConfig&&this.options.renderingConfig.markedOptions?p=this.options.renderingConfig.markedOptions:p={},this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1?p.breaks=!1:p.breaks=!0,this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0){var v=this.options.renderingConfig.hljs||window.hljs;v&&(p.highlight=function(b,S){return S&&v.getLanguage(S)?v.highlight(S,b).value:v.highlightAuto(b).value})}marked.setOptions(p);var L=marked.parse(o);return this.options.renderingConfig&&typeof this.options.renderingConfig.sanitizerFunction=="function"&&(L=this.options.renderingConfig.sanitizerFunction.call(this,L)),L=qd(L),L=Fd(L),L}};Te.prototype.render=function(o){if(o||(o=this.element||document.getElementsByTagName("textarea")[0]),this._rendered&&this._rendered===o)return;this.element=o;var p=this.options,v=this,L={};function b(O){let W=O.getInputField(),J=W.form;if(J){let re=Array.from(J.elements).filter(q=>!(q.closest&&q.closest(".editor-toolbar")||q.offsetParent===null)),F=re.indexOf(W);F!==-1&&F+1<re.length&&re[F+1]&&re[F+1].focus()}}function S(O){let W=O.getInputField(),J=W.form;if(J){let re=Array.from(J.elements).filter(q=>!(q.closest&&q.closest(".editor-toolbar")||q.offsetParent===null)),F=re.indexOf(W);if(F!==-1)for(let q=F-1;q>=0;q--){let D=re[q];if(D){D.focus();break}}}}for(var s in p.shortcuts)p.shortcuts[s]!==null&&Vn[s]!==null&&(function(O){L[vc(p.shortcuts[O])]=function(){var W=Vn[O];typeof W=="function"?W(v):typeof W=="string"&&window.open(W,"_blank")}})(s);L.Enter="newlineAndIndentContinueMarkdownList",L.Tab=O=>{let W=O.getSelection();W&&W.length>0?O.execCommand("indentMore"):b(O)},L["Shift-Tab"]=O=>{let W=O.getSelection();W&&W.length>0?O.execCommand("indentLess"):S(O)},L.Esc=function(O){O.getOption("fullScreen")&&Br(v)},this.documentOnKeyDown=function(O){O=O||window.event,O.keyCode==27&&v.codemirror.getOption("fullScreen")&&Br(v)},document.addEventListener("keydown",this.documentOnKeyDown,!1);var h,g;p.overlayMode?(CodeMirror.defineMode("overlay-mode",function(O){return CodeMirror.overlayMode(CodeMirror.getMode(O,p.spellChecker!==!1?"spell-checker":"gfm"),p.overlayMode.mode,p.overlayMode.combine)}),h="overlay-mode",g=p.parsingConfig,g.gitHubSpice=!1):(h=p.parsingConfig,h.name="gfm",h.gitHubSpice=!1),p.spellChecker!==!1&&(h="spell-checker",g=p.parsingConfig,g.name="gfm",g.gitHubSpice=!1,typeof p.spellChecker=="function"?p.spellChecker({codeMirrorInstance:CodeMirror}):CodeMirrorSpellChecker({codeMirrorInstance:CodeMirror}));function C(O,W,J){return{addNew:!1}}CodeMirror.getMode("php").mime="text/x-php",this.codemirror=CodeMirror.fromTextArea(o,{mode:h,backdrop:g,theme:p.theme!=null?p.theme:"easymde",tabSize:p.tabSize!=null?p.tabSize:2,indentUnit:p.tabSize!=null?p.tabSize:2,indentWithTabs:p.indentWithTabs!==!1,lineNumbers:p.lineNumbers===!0,autofocus:p.autofocus===!0,extraKeys:L,direction:p.direction,lineWrapping:p.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:p.placeholder||o.getAttribute("placeholder")||"",styleSelectedText:p.styleSelectedText!=null?p.styleSelectedText:!ra(),scrollbarStyle:p.scrollbarStyle!=null?p.scrollbarStyle:"native",configureMouse:C,inputStyle:p.inputStyle!=null?p.inputStyle:ra()?"contenteditable":"textarea",spellcheck:p.nativeSpellcheck!=null?p.nativeSpellcheck:!0,autoRefresh:p.autoRefresh!=null?p.autoRefresh:!1});var k=this.codemirror.getScrollerElement();if(k.style.minHeight=p.minHeight,typeof p.maxHeight<"u"&&(k.setAttribute("tabindex","0"),k.style.setProperty(this.hasExplicitMinHeight?"max-height":"height",p.maxHeight)),p.forceSync===!0){var c=this.codemirror;c.on("change",function(){c.save()})}this.gui={};var d=document.createElement("div");d.classList.add("EasyMDEContainer"),d.setAttribute("role","application");var x=this.codemirror.getWrapperElement();x.parentNode.insertBefore(d,x),d.appendChild(x),p.toolbar!==!1&&(this
Line truncated
|
||||||
@@ -1,37 +1,37 @@
|
|||||||
var Am=Object.defineProperty;var oo=(t,e)=>{for(var n in e)Am(t,n,{get:e[n],enumerable:!0})};var ei={};oo(ei,{CommandManager:()=>Dr,Editor:()=>j0,Extendable:()=>Yo,Extension:()=>j,Fragment:()=>K0,InputRule:()=>$t,MappablePosition:()=>Jl,Mark:()=>ee,MarkView:()=>H0,Node:()=>$,NodePos:()=>Tf,NodeView:()=>X0,PasteRule:()=>jn,ResizableNodeView:()=>Zo,ResizableNodeview:()=>G0,Tracker:()=>Z0,attrsEqual:()=>rf,callOrReturn:()=>q,canInsertNode:()=>Xl,combineTransactionSteps:()=>_o,commands:()=>Pl,createAtomBlockMarkdownSpec:()=>af,createBlockMarkdownSpec:()=>Ht,createChainableState:()=>Rr,createDocument:()=>zo,createElement:()=>q0,createInlineMarkdownSpec:()=>cf,createMappablePosition:()=>ef,createNodeFromContent:()=>cn,createStyleTag:()=>of,decodeHtmlEntities:()=>O0,defaultBlockAt:()=>un,deleteProps:()=>Rl,elementFromString:()=>$n,encodeHtmlEntities:()=>R0,escapeForRegEx:()=>Yl,extensions:()=>hf,findChildren:()=>fn,findChildrenInRange:()=>$l,findDuplicates:()=>qu,findParentNode:()=>qe,findParentNodeClosestToPos:()=>Vo,flattenExtensions:()=>Wo,fromString:()=>Ku,generateHTML:()=>t0,generateJSON:()=>n0,generateText:()=>r0,getAttributes:()=>qo,getAttributesFromExtensions:()=>_l,getChangedRanges:()=>Vn,getDebugJSON:()=>Xu,getExtensionField:()=>P,getHTMLFromFragment:()=>Ir,getMarkAttributes:()=>Hl,getMarkRange:()=>Fo,getMarkType:()=>nt,getMarksBetween:()=>Pr,getNodeAtPosition:()=>Ul,getNodeAttributes:()=>Ju,getNodeType:()=>re,getRenderedAttributes:()=>kt,getSchema:()=>Uo,getSchemaByResolvedExtensions:()=>Vl,getSchemaTypeByName:()=>Hn,getSchemaTypeNameByName:()=>Lr,getSplittedAttributes:()=>Er,getStyleProperty:()=>Ql,getText:()=>jl,getTextBetween:()=>Wl,getTextContentFromNodes:()=>Yu,getTextSerializersFromSchema:()=>Ko,getUpdatedPosition:()=>Zu,h:()=>q0,injectExtensionAttributesToParseRule:()=>Dl,inputRulesPlugin:()=>df,isActive:()=>Jo,isAndroid:()=>Or,isAtEndOfNode:()=>Kl,isAtStartOfNode:()=>ql,isEmptyObject:()=>Uu,isExtensionRulesEnabled:()=>Ll,isFirefox:()=>D0,isFunction:()=>Fl,isList:()=>Po,isMacOS:()=>zl,isMarkActive:()=>Ho,isNodeActive:()=>Ke,isNodeEmpty:()=>hn,isNodeSelection:()=>Br,isNodeViewSelected:()=>i0,isNumber:()=>sf,isPlainObject:()=>Tr,isRegExp:()=>$o,isSafari:()=>Wu,isString:()=>I0,isTextSelection:()=>_n,isiOS:()=>an,markInputRule:()=>Me,markPasteRule:()=>ge,markdown:()=>lf,marksEqual:()=>z0,mergeAttributes:()=>N,mergeDeep:()=>Zl,minMax:()=>tt,nodeInputRule:()=>Hr,nodePasteRule:()=>Y0,objectIncludes:()=>Nr,parseAttributes:()=>Go,parseIndentedBlocks:()=>zr,pasteRulesPlugin:()=>ff,posToDOMRect:()=>Gl,removeDuplicates:()=>Gu,renderNestedMarkdownContent:()=>Wn,resolveExtensions:()=>jo,resolveFocusPosition:()=>Bo,rewriteUnknownContent:()=>s0,selectionToInsertionEnd:()=>Bl,serializeAttributes:()=>Xo,sortExtensions:()=>Fn,splitExtensions:()=>dn,textInputRule:()=>U0,textPasteRule:()=>Q0,textblockTypeInputRule:()=>Un,updateMarkViewAttributes:()=>ea,wrappingInputRule:()=>Je});function be(t){this.content=t}be.prototype={constructor:be,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new be(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new be(n)},addToStart:function(t,e){return new be([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new be(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new be(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=be.from(t),t.size?new be(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=be.from(t),t.size?new be(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=be.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};be.from=function(t){if(t instanceof be)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new be(e)};var fs=be;function Sc(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){let s=o.text,l=i.text,a=0;for(;s[a]==l[a];a++)n++;return a&&a<s.length&&a<l.length&&Mc(s.charCodeAt(a-1))&&vc(s.charCodeAt(a))&&n--,n}if(o.content.size||i.content.size){let s=Sc(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function Cc(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),l=e.child(--i),a=s.nodeSizeLine truncated
|
var dg=Object.defineProperty;var po=(t,e)=>{for(var n in e)dg(t,n,{get:e[n],enumerable:!0})};var ci={};po(ci,{CommandManager:()=>cn,DECORATION_MANAGER_PLUGIN_KEY:()=>an,Decoration:()=>qr,DecorationManager:()=>Rf,Editor:()=>sx,Extendable:()=>si,Extension:()=>G,Fragment:()=>ux,InlineDecoration:()=>th,InputRule:()=>Ht,MappablePosition:()=>ta,Mark:()=>te,MarkView:()=>Qw,Node:()=>F,NodeDecoration:()=>nh,NodePos:()=>eh,NodeView:()=>gx,PasteRule:()=>Qn,ResizableNodeView:()=>ai,ResizableNodeview:()=>mx,Tracker:()=>wx,WidgetDecoration:()=>rh,attrsEqual:()=>ra,callOrReturn:()=>U,canInsertNode:()=>oa,combineTransactionSteps:()=>Yo,commands:()=>Sf,createAtomBlockMarkdownSpec:()=>$f,createBlockMarkdownSpec:()=>Yn,createChainableState:()=>Fr,createDocument:()=>qo,createElement:()=>hx,createInlineMarkdownSpec:()=>zf,createMappablePosition:()=>wf,createNodeFromContent:()=>un,createStyleTag:()=>Df,createWidgetDecoration:()=>cx,decodeHtmlEntities:()=>Bw,defaultBlockAt:()=>Gn,deleteProps:()=>$l,elementFromString:()=>Un,encodeHtmlEntities:()=>$w,escapeForRegEx:()=>ia,extensions:()=>rx,findChildren:()=>Xn,findChildrenInRange:()=>Ul,findDuplicates:()=>uf,findParentNode:()=>xt,findParentNodeClosestToPos:()=>hn,flattenExtensions:()=>Qo,fromString:()=>df,generateHTML:()=>Bb,generateJSON:()=>$b,generateText:()=>zb,getAttributes:()=>ni,getAttributesFromExtensions:()=>ql,getChangedRanges:()=>pn,getDebugJSON:()=>pf,getExtensionField:()=>L,getHTMLFromFragment:()=>Wr,getMarkAttributes:()=>_l,getMarkRange:()=>Xo,getMarkType:()=>tt,getMarksBetween:()=>jr,getNodeAtPosition:()=>Yl,getNodeAttributes:()=>ff,getNodeType:()=>oe,getPreviousBlockSibling:()=>Ql,getRenderedAttributes:()=>wt,getSchema:()=>ei,getSchemaByResolvedExtensions:()=>Jl,getSchemaTypeByName:()=>ln,getSchemaTypeNameByName:()=>Vr,getSplittedAttributes:()=>$r,getStyleProperty:()=>sa,getText:()=>Xl,getTextBetween:()=>Gl,getTextContentFromNodes:()=>mf,getTextSerializersFromSchema:()=>ti,getUpdatedPosition:()=>bf,h:()=>hx,injectExtensionAttributesToParseRule:()=>zl,inputRulesPlugin:()=>Hf,isActive:()=>ri,isAndroid:()=>Hr,isAtEndOfNode:()=>Zl,isAtStartOfNode:()=>ea,isEmptyObject:()=>cf,isExtensionRulesEnabled:()=>Hl,isFirefox:()=>zw,isFunction:()=>Kl,isList:()=>Uo,isMacOS:()=>jl,isMarkActive:()=>Jo,isNodeActive:()=>Ke,isNodeEmpty:()=>mn,isNodeSelection:()=>_r,isNodeViewSelected:()=>Fb,isNumber:()=>Lf,isPlainObject:()=>Pr,isProseMirrorAddMarkStep:()=>Vb,isProseMirrorAddNodeMarkStep:()=>Wb,isProseMirrorAttrStep:()=>jb,isProseMirrorCellSelection:()=>_b,isProseMirrorDocAttrStep:()=>Ub,isProseMirrorFragment:()=>gf,isProseMirrorNodeSelection:()=>Kb,isProseMirrorRemoveMarkStep:()=>qb,isProseMirrorRemoveNodeMarkStep:()=>Jb,isProseMirrorReplaceAroundStep:()=>Gb,isProseMirrorReplaceStep:()=>Xb,isProseMirrorSlice:()=>Yb,isProseMirrorStep:()=>kt,isProseMirrorStepResult:()=>Qb,isRegExp:()=>Go,isSafari:()=>of,isString:()=>Fw,isTextSelection:()=>Jn,isiOS:()=>dn,liveWidgetKeys:()=>Nf,markInputRule:()=>Me,markPasteRule:()=>ke,markdown:()=>Xw,marksEqual:()=>Yw,mergeAttributes:()=>R,mergeDeep:()=>aa,minMax:()=>et,nodeInputRule:()=>Jr,nodePasteRule:()=>yx,objectIncludes:()=>zr,parseAttributes:()=>oi,parseIndentedBlocks:()=>Ur,pasteRulesPlugin:()=>Vf,posToDOMRect:()=>na,removeDuplicates:()=>hf,renderNestedMarkdownContent:()=>Kr,resolveExtensions:()=>Zo,resolveFocusPosition:()=>Ko,rewriteUnknownContent:()=>Zb,selectionToInsertionEnd:()=>Wl,serializeAttributes:()=>ii,sortExtensions:()=>Kn,splitExtensions:()=>fn,textInputRule:()=>dx,textPasteRule:()=>bx,textblockTypeInputRule:()=>Zn,updateMarkViewAttributes:()=>ca,wrappingInputRule:()=>St});var Cc=Object.defineProperty,mo=(t,e)=>{let n={};for(var r in t)Cc(n,r,{get:t[r],enumerable:!0});return e||Cc(n,Symbol.toStringTag,{value:"Module"}),n};function ye(t){this.content=t}ye.prototype={constructor:ye,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new ye(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new ye(n)},addToStart:function(t,e){return new ye([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new ye(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new ye(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=ye.from(t),t.size?new ye(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=ye.from(t),t.size?new ye(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=ye.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){vaLine truncated
|
||||||
`)}};Ot.empty=new Ot(!0);var ys=class{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function Dc(t){let e=[];do e.push(Dm(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Dm(t){let e=[];do e.push(Lm(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Lm(t){let e=Bm(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=Im(t,e);else break;return e}function pc(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Im(t,e){let n=pc(t),r=n;return t.eat(",")&&(t.next!="}"?r=pc(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Pm(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.isInGroup(e)&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function Bm(t){if(t.eat("(")){let e=Dc(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=Pm(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function zm(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,a){let c={term:a,to:l};return e[s].push(c),c}function o(s,l){s.forEach(a=>a.to=l)}function i(s,l){if(s.type=="choice")return s.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(s.type=="seq")for(let a=0;;a++){let c=i(s.exprs[a],l);if(a==s.exprs.length-1)return c;o(c,l=n())}else if(s.type=="star"){let a=n();return r(l,a),o(i(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=n();return o(i(s.expr,l),a),o(i(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(i(s.expr,l));if(s.type=="range"){let a=l;for(let c=0;c<s.min;c++){let d=n();o(i(s.expr,a),d),a=d}if(s.max==-1)o(i(s.expr,a),a);else for(let c=s.min;c<s.max;c++){let d=n();r(a,d),o(i(s.expr,a),d),a=d}return[r(a)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Lc(t,e){return e-t}function mc(t,e){let n=[];return r(e),n.sort(Lc);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:l,to:a}=i[s];!l&&n.indexOf(a)==-1&&r(a)}}}function Hm(t){let e=Object.create(null);return n(mc(t,0));function n(r){let o=[];r.forEach(s=>{t[s].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let d=0;d<o.length;d++)o[d][0]==l&&(c=o[d][1]);mc(t,a).forEach(d=>{c||o.push([l,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let i=e[r.join(",")]=new Ot(r.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let l=o[s][1].sort(Lc);i.next.push({type:o[s][0],next:e[l.join(",")]||n(l)})}return i}}function $m(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let l=0;l<o.next.length;l++){let{type:a,next:c}=o.next[l];s.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Ic(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Pc(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function Bc(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${r}`);for(let o in t)t[o].validate&&t[o].validate(e[o])}function zc(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new bs(t,r,e[r]);return n}var or=class t{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=zc(e,r.attrs),this.defaultAttrs=Ic(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ot.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAtt
Line truncated
|
`)}};Rt.empty=new Rt(!0);var vs=class{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function jc(t){let e=[];do e.push(mg(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function mg(t){let e=[];do e.push(gg(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function gg(t){let e=wg(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=yg(t,e);else break;return e}function Mc(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function yg(t,e){let n=Mc(t),r=n;return t.eat(",")&&(t.next!="}"?r=Mc(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function bg(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.isInGroup(e)&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function wg(t){if(t.eat("(")){let e=jc(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=bg(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function xg(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,a){let c={term:a,to:l};return e[s].push(c),c}function o(s,l){s.forEach(a=>a.to=l)}function i(s,l){if(s.type=="choice")return s.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(s.type=="seq")for(let a=0;;a++){let c=i(s.exprs[a],l);if(a==s.exprs.length-1)return c;o(c,l=n())}else if(s.type=="star"){let a=n();return r(l,a),o(i(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=n();return o(i(s.expr,l),a),o(i(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(i(s.expr,l));if(s.type=="range"){let a=l;for(let c=0;c<s.min;c++){let d=n();o(i(s.expr,a),d),a=d}if(s.max==-1)o(i(s.expr,a),a);else for(let c=s.min;c<s.max;c++){let d=n();r(a,d),o(i(s.expr,a),d),a=d}return[r(a)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function _c(t,e){return e-t}function Tc(t,e){let n=[];return r(e),n.sort(_c);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:l,to:a}=i[s];!l&&n.indexOf(a)==-1&&r(a)}}}function kg(t){let e=Object.create(null);return n(Tc(t,0));function n(r){let o=[];r.forEach(s=>{t[s].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let d=0;d<o.length;d++)o[d][0]==l&&(c=o[d][1]);Tc(t,a).forEach(d=>{c||o.push([l,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let i=e[r.join(",")]=new Rt(r.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let l=o[s][1].sort(_c);i.next.push({type:o[s][0],next:e[l.join(",")]||n(l)})}return i}}function Sg(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let l=0;l<o.next.length;l++){let{type:a,next:c}=o.next[l];s.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Uc(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Kc(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function qc(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${r}`);for(let o in t)t[o].validate&&t[o].validate(e[o])}function Jc(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Ms(t,r,e[r]);return n}var fr=class t{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Jc(e,r.attrs),this.defaultAttrs=Uc(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Rt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAtt
Line truncated
|
||||||
`);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(s.linebreakReplacement.create(),n,!0),l[a]&&this.insertNode(s.text(l[a]),n,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=o.content[o.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),l;$c.hasOwnProperty(s)&&this.parser.normalizeLists&&jm(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:Wm.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,d=this.needsBlock;if(Hc.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let u=a&&a.skip?n:this.readStyles(e,n);u&&this.addAll(e,u),c&&this.sync(i),this.needsBlock=d}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
`);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(s.linebreakReplacement.create(),n,!0),l[a]&&this.insertNode(s.text(l[a]),n,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=o.content[o.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),l;Xc.hasOwnProperty(s)&&this.parser.normalizeLists&&Ag(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:Tg.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,d=this.needsBlock;if(Gc.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let u=a&&a.skip?n:this.readStyles(e,n);u&&this.addAll(e,u),c&&this.sync(i),this.needsBlock=d}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
||||||
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],s=r.getPropertyValue(i);if(s)for(let l=void 0;;){let a=this.parser.matchStyle(i,s,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?n=n.filter(c=>!a.clearMark(c)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(e,n,r,o){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(s,n.attrs||null,r,n.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[n.mark];r=r.concat(a.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,n,r,o){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=o==null?null:e.childNodes[o];s!=l;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n,r){let o,i;for(let s=this.open,l=0;s>=0;s--){let a=this.nodes[s],c=a.findWrapping(e);if(c&&(!o||o.length>c.length+l)&&(o=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!o)return null;this.sync(i);for(let s=0;s<o.length;s++)n=this.enterInner(o[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let o=this.findPlace(e,n,r);if(o){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=G.none;for(let l of o.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):wc(l.type,e.type))&&(s=l.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,n,r,o){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,o)),i}enterInner(e,n,r,o=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let l=yc(e,i,s.options);s.options&nr&&s.content.length==0&&(l|=nr);let a=G.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):wc(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new vn(e,n,a,o,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=ir)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=i;a--)if(s(l-1,a))return!0;return!1}else{let d=a>0||a==0&&o?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;a--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};function jm(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&$c.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Um(t,e){return(t.matches||t.msMatchesSelector||t.webkitM
Line truncated
|
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],s=r.getPropertyValue(i);if(s)for(let l=void 0;;){let a=this.parser.matchStyle(i,s,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?n=n.filter(c=>!a.clearMark(c)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(e,n,r,o){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(s,n.attrs||null,r,n.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[n.mark];r=r.concat(a.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,n,r,o){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=o==null?null:e.childNodes[o];s!=l;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n,r){let o,i;for(let s=this.open,l=0;s>=0;s--){let a=this.nodes[s],c=a.findWrapping(e);if(c&&(!o||o.length>c.length+l)&&(o=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!o)return null;this.sync(i);for(let s=0;s<o.length;s++)n=this.enterInner(o[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let o=this.findPlace(e,n,r);if(o){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=q.none;for(let l of o.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):Nc(l.type,e.type))&&(s=l.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,n,r,o){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,o)),i}enterInner(e,n,r,o=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let l=Ec(e,i,s.options);s.options&dr&&s.content.length==0&&(l|=dr);let a=q.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):Nc(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new En(e,n,a,o,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=hr)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=i;a--)if(s(l-1,a))return!0;return!1}else{let d=a>0||a==0&&o?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;a--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};function Ag(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Xc.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Eg(t,e){return(t.matches||t.msMatchesSelector||t.webkitM
Line truncated
|
||||||
`))}})}function og(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function ig(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new le(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new A(v.from(s),0,0),1,!0))}function Oe(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,d=n-2;c>i;c--,d--){let u=o.node(c),f=o.index(c);if(u.type.spec.isolating)return!1;let h=u.content.cutByIndex(f,u.childCount),p=r&&r[d+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[d]||u;if(!u.canReplace(f+1,u.childCount)||!m.type.validContent(h))return!1}let l=o.indexAfter(i),a=r&&r[0];return o.node(i).canReplaceWith(l,l,a?a.type:o.node(i+1).type)}function sg(t,e,n=1,r){let o=t.doc.resolve(e),i=v.empty,s=v.empty;for(let l=o.depth,a=o.depth-n,c=n-1;l>a;l--,c--){i=v.from(o.node(l).copy(i));let d=r&&r[c];s=v.from(d?d.type.create(d.attrs,s):o.node(l).copy(s))}t.step(new pe(e,e,new A(i.append(s),n,n),!0))}function Ie(t,e){let n=t.resolve(e),r=n.index();return Gc(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function lg(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let i=e.child(o),s=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function Gc(t,e){return!!(t&&e&&!t.isLeaf&&lg(t,e))}function Gt(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let i,s,l=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),l++,s=r.node(o).maybeChild(l)):(i=r.node(o).maybeChild(l-1),s=r.node(o+1)),i&&!i.isTextblock&&Gc(i,s)&&r.node(o).canReplace(l,l+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function ag(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(e-n),s=i.node().type;if(o&&s.inlineContent){let d=s.whitespace=="pre",u=!!s.contentMatch.matchType(o);d&&!u?r=!1:!d&&u&&(r=!0)}let l=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);Jc(t,d.node(),d.before(),l)}s.inlineContent&&Ts(t,e+n-1,s,i.node().contentMatchAt(i.index()),r==null);let a=t.mapping.slice(l),c=a.map(e-n);if(t.step(new pe(c,a.map(e+n,-1),A.empty,!0)),r===!0){let d=t.doc.resolve(c);qc(t,d.node(),d.before(),t.steps.length)}return t}function cg(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function mo(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),c=r.node(s),d=!1;if(i==1)d=c.canReplace(a,a,o);else{let u=c.contentMatchAt(a).findWrapping(o.firstChild.type);d=u&&c.canReplaceWith(a,a,u[0])}if(d)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function fr(t,e,n=e,r=A.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return Xc(o,i,r)?new pe(e,n,r):new vs(o,i,r).fit()}function Xc(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var vs=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=v.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=v.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,l=o.depth;for(;s&&l&&i.childCount==1;)i=i.firstChild.content,s--,l--;let a=new A(i,s,l);return e>-1?new le(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new pe(r.pos,o.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++
Line truncated
|
`))}})}function Vg(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function Wg(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new le(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new A(C.from(s),0,0),1,!0))}function Ie(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,d=n-2;c>i;c--,d--){let u=o.node(c),f=o.index(c);if(u.type.spec.isolating)return!1;let h=u.content.cutByIndex(f,u.childCount),p=r&&r[d+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[d]||u;if(!u.canReplace(f+1,u.childCount)||!m.type.validContent(h))return!1}let l=o.indexAfter(i),a=r&&r[0];return o.node(i).canReplaceWith(l,l,a?a.type:o.node(i+1).type)}function jg(t,e,n=1,r){let o=t.doc.resolve(e),i=C.empty,s=C.empty;for(let l=o.depth,a=o.depth-n,c=n-1;l>a;l--,c--){i=C.from(o.node(l).copy(i));let d=r&&r[c];s=C.from(d?d.type.create(d.attrs,s):o.node(l).copy(s))}t.step(new ue(e,e,new A(i.append(s),n,n),!0))}function _e(t,e){let n=t.resolve(e),r=n.index();return sd(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function _g(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let i=e.child(o),s=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function sd(t,e){return!!(t&&e&&!t.isLeaf&&_g(t,e))}function In(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let i,s,l=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),l++,s=r.node(o).maybeChild(l)):(i=r.node(o).maybeChild(l-1),s=r.node(o+1)),i&&!i.isTextblock&&sd(i,s)&&r.node(o).canReplace(l,l+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function Ug(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(e-n),s=i.node().type;if(o&&s.inlineContent){let d=s.whitespace=="pre",u=!!s.contentMatch.matchType(o);d&&!u?r=!1:!d&&u&&(r=!0)}let l=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);id(t,d.node(),d.before(),l)}s.inlineContent&&Ls(t,e+n-1,s,i.node().contentMatchAt(i.index()),r==null);let a=t.mapping.slice(l),c=a.map(e-n);if(t.step(new ue(c,a.map(e+n,-1),A.empty,!0)),r===!0){let d=t.doc.resolve(c);od(t,d.node(),d.before(),t.steps.length)}return t}function Kg(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function Mo(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),c=r.node(s),d=!1;if(i==1)d=c.canReplace(a,a,o);else{let u=c.contentMatchAt(a).findWrapping(o.firstChild.type);d=u&&c.canReplaceWith(a,a,u[0])}if(d)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function xr(t,e,n=e,r=A.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return ld(o,i,r)?new ue(e,n,r):new Rs(o,i,r).fit()}function ld(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var Rs=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=C.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=C.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,l=o.depth;for(;s&&l&&i.childCount==1;)i=i.firstChild.content,s--,l--;let a=new A(i,s,l);return e>-1?new le(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new ue(r.pos,o.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++
Line truncated
|
||||||
`).scrollIntoView()),!0)};function Hs(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var $s=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=Hs(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let l=n.after(),a=t.tr.replaceWith(l,l,s.createAndFill());a.setSelection(I.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},Fs=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof we||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=Hs(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,l=t.tr.insert(s,i.createAndFill());l.setSelection(E.create(l.doc,s+1)),e(l.scrollIntoView())}return!0},_s=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(Oe(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&pt(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function yg(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof L&&e.selection.node.isBlock)return!r.parentOffset||!Oe(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],s,l,a=!1,c=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){a=r.end(h)==r.pos+(r.depth-h),c=r.start(h)==r.pos-(r.depth-h),l=Hs(r.node(h-1).contentMatchAt(r.indexAfter(h-1)));let m=t&&t(o.parent,a,r);i.unshift(m||(a&&l?{type:l}:null)),s=h;break}else{if(h==1)return!1;i.unshift(null)}let d=e.tr;(e.selection instanceof E||e.selection instanceof we)&&d.deleteSelection();let u=d.mapping.map(r.pos),f=Oe(d.doc,u,i.length,i);if(f||(i[0]=l?{type:l}:null,f=Oe(d.doc,u,i.length,i)),!f)return!1;if(d.split(u,i.length,i),!a&&c&&r.node(s).type!=l){let h=d.mapping.map(r.before(s)),p=d.doc.resolve(h);l&&r.node(s-1).canReplaceWith(p.index(),p.index()+1,l)&&d.setNodeMarkup(d.mapping.map(r.before(s)),l)}return n&&n(d.scrollIntoView()),!0}}var bg=yg();var bd=(t,e)=>{let{$from:n,to:r}=t.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),e&&e(t.tr.setSelection(L.create(t.doc,o))),!0)},wg=(t,e)=>(e&&e(t.tr.setSelection(new we(t.doc))),!0);function xg(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||Ie(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function wd(t,e,n,r){let o=e.nodeBefore,i=e.nodeAfter,s,l,a=o.type.spec.isolating||i.type.spec.isolating;if(!a&&xg(t,e,n))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(l=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&l.matchType(s[0]||i.type).validEnd){if(n){let h=e.pos+i.nodeSize,p=v.empty;for(let y=s.length-1;y>=0;y--)p=v.from(s[y].create(null,p));p=v.from(o.copy(p));let m=t.tr.step(new le(e.pos-1,h,e.pos,h,new A(p,1,0),s.length,!0)),g=m.doc.resolve(h+2*s.length);g.nodeAfter&&g.nodeAfter.type==o.type&&Ie(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView())}return!0}let d=i.type.spec.isolating||r>0&&a?null:I.findFrom(e,1),u=d&&d.$from.blockRange(d.$to),f=u&&pt(u);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(u,f).scrollIntoView()),!0;if(c&&Rn(i,"start",!0)&&Rn(o,"end")){let h=o,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let m=i,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,m.content)){if(n){let y=v.empty;for(let b=p.length-1;b>=0;b--)y=v.from(p[b].copy(y));let x=t.tr.step(new le(e.pos-p.length,e.pos+i.nodeSize,e.pos+g,e.pos+i.nodeSize-g,new A(y,p.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function xd(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(e.tr.setSelection(E.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}var Vs=xd(-1),Ws=xd(1);function kd(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=s&&En(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function js(t,e=null){return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:l}}=n.selection.ranges[i];n.doc.nodesBetween(s,l,(a,c)=>{if(o)return!1;if(!(!a.isTextblock||a.hasMarkup(t,e)))if(a.type==t)o=!0;else{let d=n.doc.resolve(c),u=d.index();o=d.parent.canReplaceWith(u,u+1,t)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:l},$to:{pos:a}}=n.selection.ranges[s];i.setBlockType(l,a,t,e)}r(i.scrollIntoView())}return!0}}function Us(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}var Os=Us(cd,Rs,Ds),ad=Us(cd,Is,Ps),Dt={Enter:Us(zs,Fs,_s,bg),"Mod-Enter":$s,Backspace:Os,"Mod-
Line truncated
|
`).scrollIntoView()),!0)};function Us(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var Ks=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=Us(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let l=n.after(),a=t.tr.replaceWith(l,l,s.createAndFill());a.setSelection(I.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},qs=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof be||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=Us(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,l=t.tr.insert(s,i.createAndFill());l.setSelection(N.create(l.doc,s+1)),e(l.scrollIntoView())}return!0},Js=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(Ie(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&ft(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function ey(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof D&&e.selection.node.isBlock)return!r.parentOffset||!Ie(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],s,l,a=!1,c=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){a=r.end(h)==r.pos+(r.depth-h),c=r.start(h)==r.pos-(r.depth-h),l=Us(r.node(h-1).contentMatchAt(r.indexAfter(h-1)));let m=t&&t(o.parent,a,r);i.unshift(m||(a&&l?{type:l}:null)),s=h;break}else{if(h==1)return!1;i.unshift(null)}let d=e.tr;(e.selection instanceof N||e.selection instanceof be)&&d.deleteSelection();let u=d.mapping.map(r.pos),f=Ie(d.doc,u,i.length,i);if(f||(i[0]=l?{type:l}:null,f=Ie(d.doc,u,i.length,i)),!f)return!1;if(d.split(u,i.length,i),!a&&c&&r.node(s).type!=l){let h=d.mapping.map(r.before(s)),p=d.doc.resolve(h);l&&r.node(s-1).canReplaceWith(p.index(),p.index()+1,l)&&d.setNodeMarkup(d.mapping.map(r.before(s)),l)}return n&&n(d.scrollIntoView()),!0}}var ty=ey();var Od=(t,e)=>{let{$from:n,to:r}=t.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),e&&e(t.tr.setSelection(D.create(t.doc,o))),!0)},ny=(t,e)=>(e&&e(t.tr.setSelection(new be(t.doc))),!0);function ry(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||_e(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function Nd(t,e,n,r){let o=e.nodeBefore,i=e.nodeAfter,s,l,a=o.type.spec.isolating||i.type.spec.isolating;if(!a&&ry(t,e,n))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(l=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&l.matchType(s[0]||i.type).validEnd){if(n){let h=e.pos+i.nodeSize,p=C.empty;for(let y=s.length-1;y>=0;y--)p=C.from(s[y].create(null,p));p=C.from(o.copy(p));let m=t.tr.step(new le(e.pos-1,h,e.pos,h,new A(p,1,0),s.length,!0)),g=m.doc.resolve(h+2*s.length);g.nodeAfter&&g.nodeAfter.type==o.type&&_e(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView())}return!0}let d=i.type.spec.isolating||r>0&&a?null:I.findFrom(e,1),u=d&&d.$from.blockRange(d.$to),f=u&&ft(u);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(u,f).scrollIntoView()),!0;if(c&&$n(i,"start",!0)&&$n(o,"end")){let h=o,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let m=i,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,m.content)){if(n){let y=C.empty;for(let b=p.length-1;b>=0;b--)y=C.from(p[b].copy(y));let x=t.tr.step(new le(e.pos-p.length,e.pos+i.nodeSize,e.pos+g,e.pos+i.nodeSize-g,new A(y,p.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function Rd(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(e.tr.setSelection(N.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}var Gs=Rd(-1),Xs=Rd(1);function Dd(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=s&&Ln(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function Ys(t,e=null){return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:l}}=n.selection.ranges[i];n.doc.nodesBetween(s,l,(a,c)=>{if(o)return!1;if(!(!a.isTextblock||a.hasMarkup(t,e)))if(a.type==t)o=!0;else{let d=n.doc.resolve(c),u=d.index();o=d.parent.canReplaceWith(u,u+1,t)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:l},$to:{pos:a}}=n.selection.ranges[s];i.setBlockType(l,a,t,e)}r(i.scrollIntoView())}return!0}}function Qs(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}var $s=Qs(xd,zs,Hs),wd=Qs(xd,Vs,Ws),Lt={Enter:Qs(_s,qs,Js,ty),"Mod-Enter":Ks,Backspace:$s,"Mod-
Line truncated
|
||||||
`),u&&p==h.nodeValue.length)for(let m=h,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(l=a={node:g.parentNode,offset:me(g)+1});break}let y=m.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let m=h.childNodes[p-1];u=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(ze&&d.focusNode&&d.focusNode!=a.node&&d.focusNode.nodeType==1){let h=d.focusNode.childNodes[d.focusOffset];h&&h.contentEditable=="false"&&(o=!0)}if(!(o||u&&ke)&&sn(l.node,l.offset,d.anchorNode,d.anchorOffset)&&sn(a.node,a.offset,d.focusNode,d.focusOffset))return;let f=!1;if((c.extend||e==n)&&!(u&&ze)){c.collapse(l.node,l.offset);try{e!=n&&c.extend(a.node,a.offset),f=!0}catch{}}if(!f){if(e>n){let p=l;l=a,a=p}let h=document.createRange();h.setEnd(a.node,a.offset),h.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let l=r+i.border,a=s-i.border;if(e>=l&&n<=a){this.dirty=e==r||n==s?Zt:Rd,e==l&&n==a&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Ue:i.markDirty(e-l,n-l);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Zt:Ue}r=s}this.dirty=Zt}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Zt:Rd;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},xo=class extends ln{constructor(e,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==He&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},rl=class extends ln{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},tn=class t extends ln{constructor(e,n,r,o,i){super(e,[],r,o),this.mark=n,this.spec=i}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=Ze.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new t(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Ue||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Ue&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=He){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=He}}slice(e,n,r){let o=t.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=ll(i,n,s,r)),e>0&&(i=ll(i,0,e,r));for(let l=0;l<i.length;l++)i[l].parent=o;return o.children=i,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},Bt=class t extends ln{constructor(e,n,r,o,i,s,l){super(e,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=l}static create(e,n,r,o,i,s){let l=i.nodeViews[n.type.name],a,c=l&&l(n,i,()=>{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,o),d=c&&c.dom,u=c&&c.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:u}=Ze.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!u&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let f=d;return d=fu(d,r,n),c?a=new ol(e,n,r,o,d,u||null,f,c):n.isText?new ko(e,n,r,o,d,f):new t(e,n,r,o,d,u||null,f)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentEle
Line truncated
|
`),u&&p==h.nodeValue.length)for(let m=h,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(l=a={node:g.parentNode,offset:pe(g)+1});break}let y=m.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let m=h.childNodes[p-1];u=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if($e&&d.focusNode&&d.focusNode!=a.node&&d.focusNode.nodeType==1){let h=d.focusNode.childNodes[d.focusOffset];h&&h.contentEditable=="false"&&(o=!0)}if(!(o||u&&xe)&&rn(l.node,l.offset,d.anchorNode,d.anchorOffset)&&rn(a.node,a.offset,d.focusNode,d.focusOffset))return;let f=!1;if((c.extend||e==n)&&!(u&&$e)){c.collapse(l.node,l.offset);try{e!=n&&c.extend(a.node,a.offset),f=!0}catch{}}if(!f){if(e>n){let p=l;l=a,a=p}let h=document.createRange();h.setEnd(a.node,a.offset),h.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let l=r+i.border,a=s-i.border;if(e>=l&&n<=a){this.dirty=e==r||n==s?Yt:Wd,e==l&&n==a&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Ue:i.markDirty(e-l,n-l);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Yt:Ue}r=s}this.dirty=Yt}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Yt:Wd;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},No=class extends on{constructor(e,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.hasAttribute("contenteditable")||(s.contentEditable="false"),s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==ze&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},cl=class extends on{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},Zt=class t extends on{constructor(e,n,r,o,i){super(e,[],r,o),this.mark=n,this.spec=i}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=Qe.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new t(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Ue||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Ue&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=ze){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=ze}}slice(e,n,r){let o=t.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=hl(i,n,s,r)),e>0&&(i=hl(i,0,e,r));for(let l=0;l<i.length;l++)i[l].parent=o;return o.children=i,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},$t=class t extends on{constructor(e,n,r,o,i,s,l){super(e,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=l}static create(e,n,r,o,i,s){let l=i.nodeViews[n.type.name],a,c=l&&l(n,i,()=>{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,o),d=c&&c.dom,u=c&&c.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:u}=Qe.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!u&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let f=d;return d=Cu(d,r,n),c?a=new dl(e,n,r,o,d,u||null,f,c):n.isText?new Ro(e,n,r,o,d,f):new t(e,n,r,o,d,u||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let n={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(n.preserveWhitespace="full"),!this.contentDOM)n.getContent=()=>this.node.content;else if(!this.contentLost)n.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let o=this.children[r];if(this.dom.contains(o.dom.parentNode)){n.contentElemen
Line truncated
|
||||||
|
|
||||||
`);return{dom:a,text:f,slice:e}}function Sl(t,e,n,r,o){let i=o.parent.type.spec.code,s,l;if(!n&&!e)return null;let a=!!e&&(r||i||!n);if(a){if(t.someProp("transformPastedText",f=>{e=f(e,i||r,t)}),i)return l=new A(v.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
`);return{dom:a,text:f,slice:e}}function El(t,e,n,r,o){let i=o.parent.type.spec.code,s,l;if(!n&&!e)return null;let a=!!e&&(r||i||!n);if(a){if(t.someProp("transformPastedText",f=>{e=f(e,i||r,t)}),i)return l=new A(C.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
||||||
`))),0,0),t.someProp("transformPasted",f=>{l=f(l,t,!0)}),l;let u=t.someProp("clipboardTextParser",f=>f(e,o,r,t));if(u)l=u;else{let f=o.marks(),{schema:h}=t.state,p=Ze.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(h.text(m,f)))})}}else t.someProp("transformPastedHTML",u=>{n=u(n,t)}),s=py(n),Sr&&my(s);let c=s&&s.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let u=+d[3];u>0;u--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Te.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||d),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!uy.test(f.parentNode.nodeName)?{ignore:!0}:null}})),d)l=gy(jd(l,+d[1],+d[2]),d[4]);else if(l=A.maxOpen(fy(l.content,o),!0),l.openStart||l.openEnd){let u=0,f=0;for(let h=l.content.firstChild;u<l.openStart&&!h.type.spec.isolating;u++,h=h.firstChild);for(let h=l.content.lastChild;f<l.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);l=jd(l,u,f)}return t.someProp("transformPasted",u=>{l=u(l,t,a)}),l}var uy=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function fy(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),i,s=[];if(t.forEach(l=>{if(!s)return;let a=o.findWrapping(l.type),c;if(!a)return s=null;if(c=s.length&&i.length&&bu(a,i,l,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=wu(s[s.length-1],i.length));let d=yu(l,a);s.push(d),o=o.matchType(d.type),i=a}}),s)return v.from(s)}return t}function yu(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,v.from(t));return t}function bu(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=bu(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(v.from(yu(n,t,o+1))))}}function wu(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,wu(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(v.empty,!0);return t.copy(n.append(r))}function dl(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,l=s.content;return t.childCount>1&&(i=0),o<r-1&&(l=dl(l,e,n,r,o+1,i)),o>=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,i<=o).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(v.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function jd(t,e,n){return e<t.openStart&&(t=new A(dl(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new A(dl(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}var xu={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function ku(){return document.implementation.createHTMLDocument("title")}var Gs=null;function hy(t){let e=window.trustedTypes;return e?(Gs||(Gs=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Gs.createHTML(t)):t}function py(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=ku(),r=n.body,o=/<([a-z][^>\s]+)/i.exec(t),i;if((i=o&&xu[o[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),r.innerHTML=hy(t),i)for(let s=0;s<i.length;s++)r=r.querySelector(i[s])||r;for(let s=0;s<n.styleSheets.length;s++){let l=n.styleSheets[s];for(let a=0;a<l.rules.length;a++){let c=l.rules[a];if(c instanceof CSSStyleRule){let d=r.querySelectorAll(c.selectorText);for(let u=0;u<d.length;u++)d[u].style.cssText+=c.style.cssText}}}return r}function my(t){let e=t.querySelectorAll(ue?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function gy(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:i,openEnd:s}=t;for(let l=r.length-2;l>=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;o=v.from(a.create(r[l+1],o)),i++,s++}return new A(o,i,s)}var Ce={},ve={},yy={touchstart:!0,touchmove:!0},ul=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChang
Line truncated
|
`))),0,0),t.someProp("transformPasted",f=>{l=f(l,t,!0)}),l;let u=t.someProp("clipboardTextParser",f=>f(e,o,r,t));if(u)l=u;else{let f=o.marks(),{schema:h}=t.state,p=Qe.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(h.text(m,f)))})}}else t.someProp("transformPastedHTML",u=>{n=u(n,t)}),s=Yy(n),Rr&&Qy(s);let c=s&&s.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let u=+d[3];u>0;u--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Ne.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||d),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!Jy.test(f.parentNode.nodeName)?{ignore:!0}:null}})),d)l=Zy(tu(l,+d[1],+d[2]),d[4]);else if(l=A.maxOpen(Gy(l.content,o),!0),l.openStart||l.openEnd){let u=0,f=0;for(let h=l.content.firstChild;u<l.openStart&&!h.type.spec.isolating;u++,h=h.firstChild);for(let h=l.content.lastChild;f<l.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);l=tu(l,u,f)}return t.someProp("transformPasted",u=>{l=u(l,t,a)}),l}var Jy=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Gy(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),i,s=[];if(t.forEach(l=>{if(!s)return;let a=o.findWrapping(l.type),c;if(!a)return s=null;if(c=s.length&&i.length&&Ou(a,i,l,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=Nu(s[s.length-1],i.length));let d=Eu(l,a);s.push(d),o=o.matchType(d.type),i=a}}),s)return C.from(s)}return t}function Eu(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,C.from(t));return t}function Ou(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=Ou(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(C.from(Eu(n,t,o+1))))}}function Nu(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Nu(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(C.empty,!0);return t.copy(n.append(r))}function gl(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,l=s.content;return t.childCount>1&&(i=0),o<r-1&&(l=gl(l,e,n,r,o+1,i)),o>=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,i<=o).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(C.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function tu(t,e,n){return e<t.openStart&&(t=new A(gl(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new A(gl(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}var Ru={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function Du(){return document.implementation.createHTMLDocument("title")}var Cr=null;function Xy(t){let e=window.trustedTypes;if(!e)return t;if(!Cr){if(Cr=e.defaultPolicy)try{return Cr.createHTML(t)}catch{}Cr=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})}return Cr.createHTML(t)}function Yy(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Du(),r=n.body,o=/<([a-z][^>\s]+)/i.exec(t),i;if((i=o&&Ru[o[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),r.innerHTML=Xy(t),i)for(let s=0;s<i.length;s++)r=r.querySelector(i[s])||r;for(let s=0;s<n.styleSheets.length;s++){let l=n.styleSheets[s];for(let a=0;a<l.rules.length;a++){let c=l.rules[a];if(c instanceof CSSStyleRule){let d=r.querySelectorAll(c.selectorText);for(let u=0;u<d.length;u++)d[u].style.cssText+=c.style.cssText}}}return r}function Qy(t){let e=t.querySelectorAll(me?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function Zy(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:i,openEnd:s}=t;for(let l=r.length-2;l>=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;try{a.checkAttrs(r[l+1])}catch{break}o=C.from(a.create(r[l+1],o)),i++,s++}return new A(o,i,s)}var Ce={},ve={},e0={touchstart:!0,touchmove:!0},yl=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.com
Line truncated
|
||||||
|
|
||||||
`,textSerializers:s={}}=n||{},l="";return t.nodesBetween(r,o,(a,c,d,u)=>{var f;a.isBlock&&c>r&&(l+=i);let h=s?.[a.type.name];if(h)return d&&(l+=h({node:a,pos:c,parent:d,index:u,range:e})),!1;a.isText&&(l+=(f=a?.text)==null?void 0:f.slice(Math.max(r,c)-c,o-c))}),l}function jl(t,e){let n={from:0,to:t.content.size};return Wl(t,n,e)}function Ko(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function r0(t,e,n){let{blockSeparator:r=`
|
`,textSerializers:s={}}=n||{},l="";return t.nodesBetween(r,o,(a,c,d,u)=>{a.isBlock&&c>r&&(l+=i);let f=s?.[a.type.name];if(f)return d&&(l+=f({node:a,pos:c,parent:d,index:u,range:e})),!1;if(a.isText){var h;l+=a==null||(h=a.text)===null||h===void 0?void 0:h.slice(Math.max(r,c)-c,o-c)}}),l}function Xl(t,e){return Gl(t,{from:0,to:t.content.size},e)}function ti(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function zb(t,e,n){let{blockSeparator:r=`
|
||||||
|
|
||||||
`,textSerializers:o={}}=n||{},i=Uo(e),s=te.fromJSON(i,t);return jl(s,{blockSeparator:r,textSerializers:{...Ko(i),...o}})}function Ju(t,e){let n=re(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,l=>{i.push(l)});let s=i.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function qo(t,e){let n=Lr(typeof e=="string"?e:e.name,t.schema);return n==="node"?Ju(t,e):n==="mark"?Hl(t,e):{}}function Gu(t,e=JSON.stringify){let n={};return t.filter(r=>{let o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function o0(t){let e=Gu(t);return e.length===1?e:e.filter((n,r)=>!e.filter((i,s)=>s!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function Vn(t){let{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,i)=>{let s=[];if(o.ranges.length)o.forEach((l,a)=>{s.push({from:l,to:a})});else{let{from:l,to:a}=n[i];if(l===void 0||a===void 0)return;s.push({from:l,to:a})}s.forEach(({from:l,to:a})=>{let c=e.slice(i).map(l,-1),d=e.slice(i).map(a),u=e.invert().map(c,-1),f=e.invert().map(d);r.push({oldRange:{from:u,to:f},newRange:{from:c,to:d}})})}),o0(r)}function Xu(t,e=0){let r=t.type===t.type.schema.topNodeType?0:1,o=e,i=o+t.nodeSize,s=t.marks.map(c=>{let d={type:c.type.name};return Object.keys(c.attrs).length&&(d.attrs={...c.attrs}),d}),l={...t.attrs},a={type:t.type.name,from:o,to:i};return Object.keys(l).length&&(a.attrs=l),s.length&&(a.marks=s),t.content.childCount&&(a.content=[],t.forEach((c,d)=>{var u;(u=a.content)==null||u.push(Xu(c,e+d+r))})),t.text&&(a.text=t.text),a}function Pr(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(o=>{let i=n.resolve(t),s=Fo(i,o.type);s&&r.push({mark:o,...s})}):n.nodesBetween(t,e,(o,i)=>{!o||o?.nodeSize===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}var Ul=(t,e,n,r=20)=>{let o=t.doc.resolve(n),i=r,s=null;for(;i>0&&s===null;){let l=o.node(i);l?.type.name===e?s=l:i-=1}return[s,i]};function Hn(t,e){return e.nodes[t]||e.marks[t]||null}function Er(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{let o=t.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}var Yu=(t,e=500)=>{let n="",r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,l)=>{var a,c;let d=((c=(a=o.type.spec).toText)==null?void 0:c.call(a,{node:o,pos:i,parent:s,index:l}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?d:d.slice(0,Math.max(0,r-i))}),n};function Ho(t,e,n={}){let{empty:r,ranges:o}=t.selection,i=e?nt(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(u=>i?i.name===u.type.name:!0).find(u=>Nr(u.attrs,n,{strict:!1}));let s=0,l=[];if(o.forEach(({$from:u,$to:f})=>{let h=u.pos,p=f.pos;t.doc.nodesBetween(h,p,(m,g)=>{if(i&&m.inlineContent&&!m.type.allowsMarkType(i))return!1;if(!m.isText&&!m.marks.length)return;let y=Math.max(h,g),x=Math.min(p,g+m.nodeSize),b=x-y;s+=b,l.push(...m.marks.map(w=>({mark:w,from:y,to:x})))})}),s===0)return!1;let a=l.filter(u=>i?i.name===u.mark.type.name:!0).filter(u=>Nr(u.mark.attrs,n,{strict:!1})).reduce((u,f)=>u+f.to-f.from,0),c=l.filter(u=>i?u.mark.type!==i&&u.mark.type.excludes(i):!0).reduce((u,f)=>u+f.to-f.from,0);return(a>0?a+c:a)>=s}function Jo(t,e,n={}){if(!e)return Ke(t,null,n)||Ho(t,null,n);let r=Lr(e,t.schema);return r==="node"?Ke(t,e,n):r==="mark"?Ho(t,e,n):!1}var Kl=(t,e)=>{let{$from:n,$to:r,$anchor:o}=t.selection;if(e){let i=qe(l=>l.type.name===e)(t.selection);if(!i)return!1;let s=t.doc.resolve(i.pos+1);return o.pos+1===s.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},ql=t=>{let{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function Ll(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Po(t,e){let{nodeExtensions:n}=dn(e),r=n.find(s=>s.name===t);if(!r)return!1;let o={name:r.name,options:r.options,storage:r.storage},i=q(P(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function hn(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return!/\S/.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(i=>{o!==!1&&(hn(i,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function Br(t){return t instanceof L}function i0({selection:t,pos:e,nodeSize:n,selectedOnTextSelection:r=!1}){let{from:o,to:i}=t;return!!(o<=e&&i>=e+n||r&&_n(t)&&o>e&&i<e+n)}var Jl=class Qu{constructor(e){this.position=e}static fromJSON(e){return new Qu(e.position)}toJSON(){return{position:this.position}}};function Zu(t,e){let n=e.mapping.mapResult(t.position);return{position:new Jl(n.pos),mapResult:n}}function ef(t){return new Jl(t)}function Gl(t,e,n){let o=t.state.doc.content.size,i=tt(e,0,o),s=tt(n,0,o),l=t.coordsAtPos(i),a=t.coordsAtPos(s,-1),c=Math.min(l.top,a.top),d=Math.max(l.bottom,a.bottom)
Line truncated
|
`,textSerializers:o={}}=n||{},i=ei(e);return Xl(se.fromJSON(i,t),{blockSeparator:r,textSerializers:{...ti(i),...o}})}function ff(t,e){let n=oe(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,l=>{i.push(l)});let s=i.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function ni(t,e){let n=Vr(typeof e=="string"?e:e.name,t.schema);return n==="node"?ff(t,e):n==="mark"?_l(t,e):{}}function hf(t,e=JSON.stringify){let n={};return t.filter(r=>{let o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function Hb(t){let e=hf(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,i)=>i!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function pn(t){let{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,i)=>{let s=[];if(o.ranges.length)o.forEach((l,a)=>{s.push({from:l,to:a})});else{let{from:l,to:a}=n[i];if(l===void 0||a===void 0)return;s.push({from:l,to:a})}s.forEach(({from:l,to:a})=>{let c=e.slice(i).map(l,-1),d=e.slice(i).map(a),u=e.invert().map(c,-1),f=e.invert().map(d);r.push({oldRange:{from:u,to:f},newRange:{from:c,to:d}})})}),Hb(r)}function pf(t,e=0){let n=t.type===t.type.schema.topNodeType?0:1,r=e,o=r+t.nodeSize,i=t.marks.map(a=>{let c={type:a.type.name};return Object.keys(a.attrs).length&&(c.attrs={...a.attrs}),c}),s={...t.attrs},l={type:t.type.name,from:r,to:o};return Object.keys(s).length&&(l.attrs=s),i.length&&(l.marks=i),t.content.childCount&&(l.content=[],t.forEach((a,c)=>{var d;(d=l.content)===null||d===void 0||d.push(pf(a,e+c+n))})),t.text&&(l.text=t.text),l}function jr(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(o=>{let i=Xo(n.resolve(t),o.type);i&&r.push({mark:o,...i})}):n.nodesBetween(t,e,(o,i)=>{!o||o?.nodeSize===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}var Yl=(t,e,n,r=20)=>{let o=t.doc.resolve(n),i=r,s=null;for(;i>0&&s===null;){let l=o.node(i);l?.type.name===e?s=l:i-=1}return[s,i]},Ql=t=>{let e=t.depth-1;if(e<0)return null;let n=t.index(e);return n===0?null:t.node(e).child(n-1)};function ln(t,e){return e.nodes[t]||e.marks[t]||null}function $r(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{let o=t.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}var mf=(t,e=500)=>{let n="",r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,l)=>{var a,c;let d=((a=(c=o.type.spec).toText)===null||a===void 0?void 0:a.call(c,{node:o,pos:i,parent:s,index:l}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?d:d.slice(0,Math.max(0,r-i))}),n};function Jo(t,e,n={}){let{empty:r,ranges:o}=t.selection,i=e?tt(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>zr(d.attrs,n,{strict:!1}));let s=0,l=[];if(o.forEach(({$from:d,$to:u})=>{let f=d.pos,h=u.pos;t.doc.nodesBetween(f,h,(p,m)=>{if(i&&p.inlineContent&&!p.type.allowsMarkType(i))return!1;if(!p.isText&&!p.marks.length)return;let g=Math.max(f,m),y=Math.min(h,m+p.nodeSize),x=y-g;s+=x,l.push(...p.marks.map(b=>({mark:b,from:g,to:y})))})}),s===0)return!1;let a=l.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>zr(d.mark.attrs,n,{strict:!1})).reduce((d,u)=>d+u.to-u.from,0),c=l.filter(d=>i?d.mark.type!==i&&d.mark.type.excludes(i):!0).reduce((d,u)=>d+u.to-u.from,0);return(a>0?a+c:a)>=s}function ri(t,e,n={}){if(!e)return Ke(t,null,n)||Jo(t,null,n);let r=Vr(e,t.schema);return r==="node"?Ke(t,e,n):r==="mark"?Jo(t,e,n):!1}var Zl=(t,e)=>{let{$from:n,$to:r,$anchor:o}=t.selection;if(e){let i=xt(l=>l.type.name===e)(t.selection);if(!i)return!1;let s=t.doc.resolve(i.pos+1);return o.pos+1===s.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},ea=t=>{let{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function Hl(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Uo(t,e){let{nodeExtensions:n}=fn(e),r=n.find(i=>i.name===t);if(!r)return!1;let o=U(L(r,"group",{name:r.name,options:r.options,storage:r.storage}));return typeof o!="string"?!1:o.split(" ").includes("list")}function mn(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){if(n){if(t.type.name==="hardBreak")return!0;if(t.isText){var r;return!/\S/.test((r=t.text)!==null&&r!==void 0?r:"")}}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(i=>{o!==!1&&(mn(i,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function _r(t){return t instanceof D}function Fb({selection:t,pos:e,nodeSize:n,selectedOnTextSelection:r=!1}){let{from:o,to:i}=t;return!!(o<=e&&i>=e+n||r&&Jn(t)&&o>e&&i<e+n)}function kt(t){if(t===null||typeof t!="object")return!1;let e=t;return!(typeof e.apply!="function"||typeof e.getMap!="function"||typeof e.invert!="function"||typeof e.map!="function"||typeof e.merge!="function"||typeof e.toJSON!="function")}function Vb(t){if(t===null||typeof t!="object")return!1;let e=t
Line truncated
|
||||||
|
|
||||||
`);return`:::${c}${m}
|
`);return`:::${c}${m}
|
||||||
|
|
||||||
${g}
|
${g}
|
||||||
|
|
||||||
:::`}}}function P0(t){if(!t.trim())return{};let e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(t);for(;r!==null;){let[,o,i,s]=r;e[o]=i||s,r=n.exec(t)}return e}function B0(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function cf(t){let{nodeName:e,name:n,getContent:r,parseAttributes:o=P0,serializeAttributes:i=B0,defaultAttributes:s={},selfClosing:l=!1,allowedAttributes:a}=t,c=n||e,d=f=>{if(!a)return f;let h={};return a.forEach(p=>{let m=typeof p=="string"?p:p.name,g=typeof p=="string"?void 0:p.skipIfDefault;if(m in f){let y=f[m];if(g!==void 0&&y===g)return;h[m]=y}}),h},u=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(f,h)=>{let p={...s,...f.attributes};if(l)return h.createNode(e,p);let m=r?r(f):f.content||"";return m?h.createNode(e,p,[h.createTextNode(m)]):h.createNode(e,p,[])},markdownTokenizer:{name:e,level:"inline",start(f){let h=l?new RegExp(`\\[${u}\\s*[^\\]]*\\]`):new RegExp(`\\[${u}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${u}\\]`),p=f.match(h),m=p?.index;return m!==void 0?m:-1},tokenize(f,h,p){let m=l?new RegExp(`^\\[${u}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${u}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${u}\\]`),g=f.match(m);if(!g)return;let y="",x="";if(l){let[,w]=g;x=w}else{let[,w,k]=g;x=w,y=k||""}let b=o(x.trim());return{type:e,raw:g[0],content:y.trim(),attributes:b}}},renderMarkdown:f=>{let h="";r?h=r(f):f.content&&f.content.length>0&&(h=f.content.filter(y=>y.type==="text").map(y=>y.text).join(""));let p=d(f.attrs||{}),m=i(p),g=m?` ${m}`:"";return l?`[${c}${g}]`:`[${c}${g}]${h}[/${c}]`}}}function zr(t,e,n){var r,o,i,s;let l=t.split(`
|
:::`}}}function Jw(t){let e={};return Bf(t,"shortcode").forEach(n=>{n.type==="keyValue"&&(e[n.name]=n.value)}),e}function Gw(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function zf(t){let{nodeName:e,name:n,getContent:r,parseAttributes:o=Jw,serializeAttributes:i=Gw,defaultAttributes:s={},selfClosing:l=!1,allowedAttributes:a}=t,c=n||e,d=f=>{if(!a)return f;let h={};return a.forEach(p=>{let m=typeof p=="string"?p:p.name,g=typeof p=="string"?void 0:p.skipIfDefault;if(m in f){let y=f[m];if(g!==void 0&&y===g)return;h[m]=y}}),h},u=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(f,h)=>{let p={...s,...f.attributes};if(l)return h.createNode(e,p);let m=r?r(f):f.content||"";return m?h.createNode(e,p,[h.createTextNode(m)]):h.createNode(e,p,[])},markdownTokenizer:{name:e,level:"inline",start(f){let h=l?new RegExp(`\\[${u}\\s*[^\\]]*\\]`):new RegExp(`\\[${u}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${u}\\]`),p=f.match(h),m=p?.index;return m!==void 0?m:-1},tokenize(f,h,p){let m=l?new RegExp(`^\\[${u}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${u}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${u}\\]`),g=f.match(m);if(!g)return;let y="",x="";if(l){let[,w]=g;x=w}else{let[,w,k]=g;x=w,y=k||""}let b=o(x.trim());return{type:e,raw:g[0],content:y.trim(),attributes:b}}},renderMarkdown:f=>{let h="";r?h=r(f):f.content&&f.content.length>0&&(h=f.content.filter(y=>y.type==="text").map(y=>y.text).join(""));let p=d(f.attrs||{}),m=i(p),g=m?` ${m}`:"";return l?`[${c}${g}]`:`[${c}${g}]${h}[/${c}]`}}}function Ur(t,e,n){let r=t.split(`
|
||||||
`),a=[],c="",d=0,u=e.baseIndentSize||2;for(;d<l.length;){let f=l[d],h=f.match(e.itemPattern);if(!h){if(a.length>0)break;if(f.trim()===""){d+=1,c=`${c}${f}
|
`),o=[],i="",s=0,l=e.baseIndentSize||2;for(;s<r.length;){let d=r[s],u=d.match(e.itemPattern);if(!u){if(o.length>0)break;if(d.trim()===""){s+=1,i=`${i}${d}
|
||||||
`;continue}else return}let p=e.extractItemData(h),{indentLevel:m,mainContent:g}=p;c=`${c}${f}
|
`;continue}else return}let f=e.extractItemData(u),{indentLevel:h,mainContent:p}=f;i=`${i}${d}
|
||||||
`;let y=[g];for(d+=1;d<l.length;){let k=l[d];if(k.trim()===""){let S=l.slice(d+1).findIndex(O=>O.trim()!=="");if(S===-1)break;if((((o=(r=l[d+1+S].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:o.length)||0)>m){y.push(k),c=`${c}${k}
|
`;let m=[p];for(s+=1;s<r.length;){var a;let b=r[s];if(b.trim()===""){var c;let w=r.slice(s+1).findIndex(k=>k.trim()!=="");if(w===-1)break;if((((c=r[s+1+w].match(/^(\s*)/))===null||c===void 0||(c=c[1])===null||c===void 0?void 0:c.length)||0)>h){m.push(b),i=`${i}${b}
|
||||||
`,d+=1;continue}else break}if((((s=(i=k.match(/^(\s*)/))==null?void 0:i[1])==null?void 0:s.length)||0)>m)y.push(k),c=`${c}${k}
|
`,s+=1;continue}else break}if((((a=b.match(/^(\s*)/))===null||a===void 0||(a=a[1])===null||a===void 0?void 0:a.length)||0)>h)m.push(b),i=`${i}${b}
|
||||||
`,d+=1;else break}let x,b=y.slice(1);if(b.length>0){let k=b.map(C=>C.slice(m+u)).join(`
|
`,s+=1;else break}let g,y=m.slice(1);if(y.length>0){let b=y.map(w=>w.slice(h+l)).join(`
|
||||||
`);k.trim()&&(e.customNestedParser?x=e.customNestedParser(k):x=n.blockTokens(k))}let w=e.createToken(p,x);a.push(w)}if(a.length!==0)return{items:a,raw:c}}function Wn(t,e,n,r){if(!t||!Array.isArray(t.content))return"";let o=typeof n=="function"?n(r):n,[i,...s]=t.content,l=e.renderChildren([i]),a=`${o}${l}`;return s&&s.length>0&&s.forEach((c,d)=>{var u,f;let h=(f=(u=e.renderChild)==null?void 0:u.call(e,c,d+1))!=null?f:e.renderChildren([c]);if(h!=null){let p=h.split(`
|
`);b.trim()&&(e.customNestedParser?g=e.customNestedParser(b):g=n.blockTokens(b))}let x=e.createToken(f,g);o.push(x)}if(o.length!==0)return{items:o,raw:i}}function Kr(t,e,n,r){if(!t||!Array.isArray(t.content))return"";let o=typeof n=="function"?n(r):n,[i,...s]=t.content,l=`${o}${e.renderChildren([i])}`;return s&&s.length>0&&s.forEach((a,c)=>{var d,u;let f=(d=(u=e.renderChild)===null||u===void 0?void 0:u.call(e,a,c+1))!==null&&d!==void 0?d:e.renderChildren([a]);if(f!=null){let h=f.split(`
|
||||||
`).map(m=>m?e.indent(m):e.indent("")).join(`
|
`).map(p=>p?e.indent(p):e.indent("")).join(`
|
||||||
`);a+=c.type==="paragraph"?`
|
`);l+=a.type==="paragraph"?`
|
||||||
|
|
||||||
${p}`:`
|
${h}`:`
|
||||||
${p}`}}),a}function _u(t){return typeof t.type=="string"?t.type:t.type.name}function z0(t,e){if(t.length!==e.length)return!1;let n=Array.from({length:e.length},()=>!1);return t.every(r=>{let o=_u(r),i=e.findIndex((s,l)=>!n[l]&&o===_u(s)&&rf(r.attrs,s.attrs));return i===-1?!1:(n[i]=!0,!0)})}function Zl(t,e){let n={...t};return Tr(t)&&Tr(e)&&Object.keys(e).forEach(r=>{Tr(e[r])&&Tr(t[r])?n[r]=Zl(t[r],e[r]):n[r]=e[r]}),n}function ea(t,e,n={}){let{state:r}=e,{doc:o,tr:i}=r,s=t;o.descendants((l,a)=>{let c=i.mapping.map(a),d=i.mapping.map(a)+l.nodeSize,u=null;if(l.marks.forEach(h=>{if(h!==s)return!1;u=h}),!u)return;let f=!1;if(Object.keys(n).forEach(h=>{n[h]!==u.attrs[h]&&(f=!0)}),f){let h=t.type.create({...t.attrs,...n});i.removeMark(c,d,t.type),i.addMark(c,d,h)}}),i.docChanged&&e.view.dispatch(i)}var H0=class{constructor(t,e,n){this.component=t,this.editor=e.editor,this.options={...n},this.mark=e.mark,this.HTMLAttributes=e.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(t,e){ea(e||this.mark,this.editor,t)}ignoreMutation(t){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:t}):t.type==="selection"||this.dom.contains(t.target)&&t.type==="childList"&&(an()||Or())&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(n=>n.isContentEditable)?!1:this.contentDOM===t.target&&t.type==="attributes"?!0:!this.contentDOM.contains(t.target)}},$t=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},$0=(t,e)=>{if($o(e))return e.exec(t);let n=e(t);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Lo(t){var e;let{editor:n,from:r,to:o,text:i,rules:s,plugin:l}=t,{view:a}=n;if(a.composing)return!1;let c=a.state.doc.resolve(r);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(f=>f.type.spec.code))return!1;let d=!1,u=Yu(c)+i;return s.forEach(f=>{if(d)return;let h=$0(u,f.find);if(!h)return;let p=h[0].length-i.length;if(p>0){let C=c.parentOffset-p;if(C<0||c.parent.textBetween(C,c.parentOffset)!==h[0].slice(0,p))return}let m=a.state.tr,g=Rr({state:a.state,transaction:m}),y={from:r-(h[0].length-i.length),to:o},{commands:x,chain:b,can:w}=new Dr({editor:n,state:g});f.handler({state:g,range:y,match:h,commands:x,chain:b,can:w})===null||!m.steps.length||(f.undoable&&m.setMeta(l,{transform:m,from:r,to:o,text:i}),a.dispatch(m),d=!0)}),d}function df(t){let{editor:e,rules:n}=t,r=new D({state:{init(){return null},apply(o,i,s){let l=o.getMeta(r);if(l)return l;let a=o.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:d}=a;typeof d=="string"?d=d:d=Ir(v.from(d),s.schema);let{from:u}=a,f=u+d.length;Lo({editor:e,from:u,to:f,text:d,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,l){return Lo({editor:e,from:i,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{let{$cursor:i}=o.state.selection;i&&Lo({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;let{$cursor:s}=o.state.selection;return s?Lo({editor:e,from:s.pos,to:s.pos,text:`
|
${h}`}}),l}var Xw=mo({createAtomBlockMarkdownSpec:()=>$f,createBlockMarkdownSpec:()=>Yn,createInlineMarkdownSpec:()=>zf,parseAttributes:()=>oi,parseIndentedBlocks:()=>Ur,renderNestedMarkdownContent:()=>Kr,serializeAttributes:()=>ii});function ef(t){return typeof t.type=="string"?t.type:t.type.name}function Yw(t,e){if(t.length!==e.length)return!1;let n=Array.from({length:e.length},()=>!1);return t.every(r=>{let o=ef(r),i=e.findIndex((s,l)=>!n[l]&&o===ef(s)&&ra(r.attrs,s.attrs));return i===-1?!1:(n[i]=!0,!0)})}function aa(t,e){let n={...t};return Pr(t)&&Pr(e)&&Object.keys(e).forEach(r=>{Pr(e[r])&&Pr(t[r])?n[r]=aa(t[r],e[r]):n[r]=e[r]}),n}function ca(t,e,n={}){let{state:r}=e,{doc:o,tr:i}=r,s=t;o.descendants((l,a)=>{let c=i.mapping.map(a),d=i.mapping.map(a)+l.nodeSize,u=null;if(l.marks.forEach(h=>{if(h!==s)return!1;u=h}),!u)return;let f=!1;if(Object.keys(n).forEach(h=>{n[h]!==u.attrs[h]&&(f=!0)}),f){let h=t.type.create({...t.attrs,...n});i.removeMark(c,d,t.type),i.addMark(c,d,h)}}),i.docChanged&&e.view.dispatch(i)}var Qw=class{constructor(t,e,n){this.component=t,this.editor=e.editor,this.options={...n},this.mark=e.mark,this.HTMLAttributes=e.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(t,e){ca(e||this.mark,this.editor,t)}ignoreMutation(t){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:t}):t.type==="selection"||this.dom.contains(t.target)&&t.type==="childList"&&(dn()||Hr())&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===t.target&&t.type==="attributes"?!0:!this.contentDOM.contains(t.target)}},Ht=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!==null&&e!==void 0?e:!0}},Zw=(t,e)=>{if(Go(e))return e.exec(t);let n=e(t);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function jo(t){var e;let{editor:n,from:r,to:o,text:i,rules:s,plugin:l}=t,{view:a}=n;if(a.composing)return!1;let c=a.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let d=!1,u=mf(c)+i;return s.forEach(f=>{if(d)return;let h=Zw(u,f.find);if(!h)return;let p=h[0].length-i.length;if(p>0){let k=c.parentOffset-p;if(k<0||c.parent.textBetween(k,c.parentOffset)!==h[0].slice(0,p))return}let m=a.state.tr,g=Fr({state:a.state,transaction:m}),y={from:r-(h[0].length-i.length),to:o},{commands:x,chain:b,can:w}=new cn({editor:n,state:g});f.handler({state:g,range:y,match:h,commands:x,chain:b,can:w})===null||!m.steps.length||(f.undoable&&m.setMeta(l,{transform:m,from:r,to:o,text:i}),a.dispatch(m),d=!0)}),d}function Hf(t){let{editor:e,rules:n}=t,r=new $({state:{init(){return null},apply(o,i,s){let l=o.getMeta(r);if(l)return l;let a=o.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:c}=a;typeof c=="string"?c=c:c=Wr(C.from(c),s.schema);let{from:d}=a,u=d+c.length;jo({editor:e,from:d,to:u,text:c,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,l){return jo({editor:e,from:i,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{let{$cursor:i}=o.state.selection;i&&jo({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;let{$cursor:s}=o.state.selection;return s?jo({editor:e,from:s.pos,to:s.pos,text:`
|
||||||
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var Yo=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...q(P(this,"addOptions",{name:this.name}))}}get storage(){return{...q(P(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){let e=this.extend({...this.config,addOptions:()=>Zl(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){let e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},ee=class uf extends Yo{constructor(){super(...arguments),this.type="mark"}static create(e={}){let n=typeof e=="function"?e():e;return new uf(n)}static handleExit({editor:e,mark:n}){let{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){let s=o.marks();if(!!!s.find(c=>c?.type.name===n.name))return!1;let a=s.find(c=>c?.type.name===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){let n=typeof e=="function"?e():e;return super.extend(n)}},jn=class{constructor(t){this.find=t.find,this.handler=t.handler}},F0=(t,e,n)=>{if($o(e))return[...t.matchAll(e)];let r=e(t,n);return r?r.map(o=>{let i=[o.text];return i.index=o.index,i.input=t,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};function _0(t){let{editor:e,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:l}=t,{commands:a,chain:c,can:d}=new Dr({editor:e,state:n}),u=[];return n.doc.nodesBetween(r,o,(h,p)=>{var m,g,y,x,b;if((g=(m=h.type)==null?void 0:m.spec)!=null&&g.code||!(h.isText||h.isTextblock||h.isInline))return;let w=(b=(x=(y=h.content)==null?void 0:y.size)!=null?x:h.nodeSize)!=null?b:0,k=Math.max(r,p),C=Math.min(o,p+w);if(k>=C)return;let S=h.isText?h.text||"":h.textBetween(k-p,C-p,void 0,"\uFFFC");F0(S,i.find,s).forEach(T=>{if(T.index===void 0)return;let O=k+T.index+1,z=O+T[0].length,F={from:n.tr.mapping.map(O),to:n.tr.mapping.map(z)},B=i.handler({state:n,range:F,match:T,commands:a,chain:c,can:d,pasteEvent:s,dropEvent:l});u.push(B)})}),u.every(h=>h!==null)}var Io=null,V0=t=>{var e;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function ff(t){let{editor:e,rules:n}=t,r=null,o=!1,i=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}let a=({state:d,from:u,to:f,rule:h,pasteEvt:p})=>{let m=d.tr,g=Rr({state:d,transaction:m});if(!(!_0({editor:e,state:g,from:Math.max(u-1,0),to:f.b-1,rule:h,pasteEvent:p,dropEvent:l})||!m.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return n.map(d=>new D({view(u){let f=p=>{var m;r=(m=u.dom.parentElement)!=null&&m.contains(p.target)?u.dom.parentElement:null,r&&(Io=e)},h=()=>{Io&&(Io=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(u,f)=>{if(i=r===u.dom.parentElement,l=f,!i){let h=Io;h?.isEditable&&setTimeout(()=>{let p=h.state.selection;p&&h.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(u,f)=>{var h;let p=(h=f.clipboardData)==null?void 0:h.getData("text/html");return s=f,o=!!p?.includes("data-pm-slice"),!1}}},appendTransaction:(u,f,h)=>{let p=u[0],m=p.getMeta("uiEvent")==="paste"&&!o,g=p.getMeta("uiEvent")==="drop"&&!i,y=p.getMeta("applyPasteRules"),x=!!y;if(!m&&!g&&!x)return;if(x){let{text:k}=y;typeof k=="string"?k=k:k=Ir(v.from(k),h.schema);let{from:C}=y,S=C+k.length,R=V0(k);return a({rule:d,state:h,from:C,to:{b:S},pasteEvt:R})}let b=f.doc.content.findDiffStart(h.doc.content),w=f.doc.content.findDiffEnd(h.doc.content);if(!(!sf(b)||!w||b===w.b))return a({rule:d,state:h,from:b,to:w,pasteEvt:s})}}))}var Qo=class{constructor(t,e){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=jo(t),this.schema=Vl(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{let n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Hn(e.name,this.schema)},r=P(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){let{editor:t}=this;return Fn([...this.extensions].reverse()).flatMap(r=>{let o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:Hn(r.name,this.schema)},i=[],s=P(r,"addKeyboardShortcuts",o),l={};if(r.type==="mark"&&P(r,"exitable",o)&&(l.ArrowRight=()=>ee.handleExit({editor:t,mark:r})),s){let f=Object.fr
Line truncated
|
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var si=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...U(L(this,"addOptions",{name:this.name}))}}get storage(){return{...U(L(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){let e=this.extend({...this.config,addOptions:()=>aa(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){let e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},te=class Ff extends si{constructor(...e){super(...e),this.type="mark"}static create(e={}){let n=typeof e=="function"?e():e;return new Ff(n)}static handleExit({editor:e,mark:n}){let{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){let i=o.marks();if(!i.find(l=>l?.type.name===n.name))return!1;let s=i.find(l=>l?.type.name===n.name);return s&&r.removeStoredMark(s),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){let n=typeof e=="function"?e():e;return super.extend(n)}},Qn=class{constructor(t){this.find=t.find,this.handler=t.handler}},ex=(t,e,n)=>{if(Go(e))return[...t.matchAll(e)];let r=e(t,n);return r?r.map(o=>{let i=[o.text];return i.index=o.index,i.input=t,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};function tx(t){let{editor:e,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:l}=t,{commands:a,chain:c,can:d}=new cn({editor:e,state:n}),u=[];return n.doc.nodesBetween(r,o,(f,h)=>{var p,m,g,y;if(!((p=f.type)===null||p===void 0||(p=p.spec)===null||p===void 0)&&p.code||!(f.isText||f.isTextblock||f.isInline))return;let x=(m=(g=(y=f.content)===null||y===void 0?void 0:y.size)!==null&&g!==void 0?g:f.nodeSize)!==null&&m!==void 0?m:0,b=Math.max(r,h),w=Math.min(o,h+x);if(b>=w)return;let k=f.isText?f.text||"":f.textBetween(b-h,w-h,void 0,"\uFFFC");ex(k,i.find,s).forEach(v=>{if(v.index===void 0)return;let S=b+v.index+1,E=S+v[0].length,T={from:n.tr.mapping.map(S),to:n.tr.mapping.map(E)},O=i.handler({state:n,range:T,match:v,commands:a,chain:c,can:d,pasteEvent:s,dropEvent:l});u.push(O)})}),u.every(f=>f!==null)}var _o=null,nx=t=>{var e;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function Vf(t){let{editor:e,rules:n}=t,r=null,o=!1,i=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}let a=({state:c,from:d,to:u,rule:f,pasteEvt:h})=>{let p=c.tr,m=Fr({state:c,transaction:p});if(!(!tx({editor:e,state:m,from:Math.max(d-1,0),to:u.b-1,rule:f,pasteEvent:h,dropEvent:l})||!p.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,p}};return n.map(c=>new $({view(d){let u=h=>{var p;r=!((p=d.dom.parentElement)===null||p===void 0)&&p.contains(h.target)?d.dom.parentElement:null,r&&(_o=e)},f=()=>{_o&&(_o=null)};return window.addEventListener("dragstart",u),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",u),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(d,u)=>{if(i=r===d.dom.parentElement,l=u,!i){let f=_o;f?.isEditable&&setTimeout(()=>{let h=f.state.selection;h&&f.commands.deleteRange({from:h.from,to:h.to})},10)}return!1},paste:(d,u)=>{var f;let h=(f=u.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return s=u,o=!!h?.includes("data-pm-slice"),!1}}},appendTransaction:(d,u,f)=>{let h=d[0],p=h.getMeta("uiEvent")==="paste"&&!o,m=h.getMeta("uiEvent")==="drop"&&!i,g=h.getMeta("applyPasteRules"),y=!!g;if(!p&&!m&&!y)return;if(y){let{text:w}=g;typeof w=="string"?w=w:w=Wr(C.from(w),f.schema);let{from:k}=g,v=k+w.length,S=nx(w);return a({rule:c,state:f,from:k,to:{b:v},pasteEvt:S})}let x=u.doc.content.findDiffStart(f.doc.content),b=u.doc.content.findDiffEnd(f.doc.content);if(!(!Lf(x)||!b||x===b.b))return a({rule:c,state:f,from:x,to:b,pasteEvt:s})}}))}var li=class{constructor(t,e){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=e,this.baseExtensions=t,this.extensions=Zo(t),this.schema=Jl(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{let n=L(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:ln(e.name,this.schema)});return n?{...t,...n()}:t},{})}get plugins(){let{editor:t}=this,e=Kn([...this.extensions].reverse()).flatMap(r=>{let o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:ln(r.name,this.schema)},i=[],s=L(r,"addKeyboardShortcuts",o)
Line truncated
|
||||||
|
|
||||||
`)}}})]}}),gf=j.create({name:"commands",addCommands(){return{...Pl}}}),yf=j.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,o;let i=()=>{var s,l,a,c;if((c=(a=(l=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:l.filterTransaction)==null?void 0:a.call(l,t))!=null?c:t.getMeta("y-sync$"))return;let d=_o(t.before,[t,...e]);Vn(d).forEach(h=>{d.mapping.mapResult(h.oldRange.from).deletedAfter&&d.mapping.mapResult(h.oldRange.to).deletedBefore&&d.before.nodesBetween(h.oldRange.from,h.oldRange.to,(p,m)=>{let g=m+p.nodeSize-2,y=h.oldRange.from<=m&&g<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:m,to:g,newFrom:d.mapping.map(m),newTo:d.mapping.map(g),deletedRange:h.oldRange,newRange:h.newRange,partial:!y,editor:this.editor,transaction:t,combinedTransform:d})})});let f=d.mapping;d.steps.forEach((h,p)=>{var m,g;if(h instanceof ht){let y=f.slice(p).map(h.from,-1),x=f.slice(p).map(h.to),b=f.invert().map(y,-1),w=f.invert().map(x),k=y>0?(m=d.doc.nodeAt(y-1))==null?void 0:m.marks.some(S=>S.eq(h.mark)):!1,C=(g=d.doc.nodeAt(x))==null?void 0:g.marks.some(S=>S.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:b,to:w},newRange:{from:y,to:x},partial:!!(C||k),editor:this.editor,transaction:t,combinedTransform:d})}})};(o=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||o?setTimeout(i,0):i()}}),bf=j.create({name:"drop",addProseMirrorPlugins(){return[new D({key:new H("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),wf=j.create({name:"editable",addProseMirrorPlugins(){return[new D({key:new H("editable"),props:{editable:()=>this.editor.options.editable}})]}}),xf=new H("focusEvents"),kf=j.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new D({key:xf,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;let r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;let r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Sf=j.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{let{selection:a,doc:c}=l,{empty:d,$anchor:u}=a,{pos:f,parent:h}=u,p=u.parent.isTextblock&&f>0?l.doc.resolve(f-1):u,m=p.parent.type.spec.isolating,g=u.pos-u.parentOffset,y=m&&p.parent.childCount===1?g===u.pos:I.atStart(c).from===f;return!d||!h.type.isTextblock||h.textContent.length||!y||y&&u.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return an()||zl()?i:o},addProseMirrorPlugins(){return[new D({key:new H("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(m=>m.getMeta("composition")))return;let r=t.some(m=>m.docChanged)&&!e.doc.eq(n.doc),o=t.some(m=>m.getMeta("preventClearDocument"));if(!r||o)return;let{empty:i,from:s,to:l}=e.selection,a=I.atStart(e.doc).from,c=I.atEnd(e.doc).to;if(i||!(s===a&&l===c)||!hn(n.doc))return;let f=n.tr,h=Rr({state:n,transaction:f}),{commands:p}=new Dr({editor:this.editor,state:h});if(p.clearNodes(),!!f.steps.length)return f}})]}}),Cf=j.create({name:"paste",addProseMirrorPlugins(){return[new D({key:new H("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),vf=j.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new D({key:new H("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!=null?t:"0"}}}})]}}),Mf=j.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:t}=dn(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new D({key:new H("textDirection"),props:{attributes:()=>{let t=this.options
Line truncated
|
`)}}})]}}),_f=G.create({name:"commands",addCommands(){return{...Sf}}}),Uf=G.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r;let o=()=>{var i,s,l;if((i=(s=this.editor.options.coreExtensionOptions)===null||s===void 0||(s=s.delete)===null||s===void 0||(l=s.filterTransaction)===null||l===void 0?void 0:l.call(s,t))!==null&&i!==void 0?i:t.getMeta("y-sync$"))return;let a=Yo(t.before,[t,...e]);pn(a).forEach(d=>{a.mapping.mapResult(d.oldRange.from).deletedAfter&&a.mapping.mapResult(d.oldRange.to).deletedBefore&&a.before.nodesBetween(d.oldRange.from,d.oldRange.to,(u,f)=>{let h=f+u.nodeSize-2,p=d.oldRange.from<=f&&h<=d.oldRange.to;this.editor.emit("delete",{type:"node",node:u,from:f,to:h,newFrom:a.mapping.map(f),newTo:a.mapping.map(h),deletedRange:d.oldRange,newRange:d.newRange,partial:!p,editor:this.editor,transaction:t,combinedTransform:a})})});let c=a.mapping;a.steps.forEach((d,u)=>{if(d instanceof ut){var f,h;let p=c.slice(u).map(d.from,-1),m=c.slice(u).map(d.to),g=c.invert().map(p,-1),y=c.invert().map(m),x=p>0?(f=a.doc.nodeAt(p-1))===null||f===void 0?void 0:f.marks.some(w=>w.eq(d.mark)):!1,b=(h=a.doc.nodeAt(m))===null||h===void 0?void 0:h.marks.some(w=>w.eq(d.mark));this.editor.emit("delete",{type:"mark",mark:d.mark,from:d.from,to:d.to,deletedRange:{from:g,to:y},newRange:{from:p,to:m},partial:!!(b||x),editor:this.editor,transaction:t,combinedTransform:a})}})};!((n=(r=this.editor.options.coreExtensionOptions)===null||r===void 0||(r=r.delete)===null||r===void 0?void 0:r.async)!==null&&n!==void 0)||n?setTimeout(o,0):o()}}),Kf=G.create({name:"drop",addProseMirrorPlugins(){return[new $({key:new W("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),qf=G.create({name:"editable",addProseMirrorPlugins(){return[new $({key:new W("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Jf=new W("focusEvents"),Gf=G.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new $({key:Jf,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;let r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;let r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Xf=G.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{let{selection:a,doc:c}=l,{empty:d,$anchor:u}=a,{pos:f,parent:h}=u,p=u.parent.isTextblock&&f>0?l.doc.resolve(f-1):u,m=p.parent.type.spec.isolating,g=u.pos-u.parentOffset,y=m&&p.parent.childCount===1?g===u.pos:I.atStart(c).from===f;return!d||!h.type.isTextblock||h.textContent.length||!y||y&&u.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return dn()||jl()?i:o},addProseMirrorPlugins(){return[new $({key:new W("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(h=>h.getMeta("composition")))return;let r=t.some(h=>h.docChanged)&&!e.doc.eq(n.doc),o=t.some(h=>h.getMeta("preventClearDocument"));if(!r||o)return;let{empty:i,from:s,to:l}=e.selection,a=I.atStart(e.doc).from,c=I.atEnd(e.doc).to;if(i||!(s===a&&l===c)||!mn(n.doc))return;let d=n.tr,u=Fr({state:n,transaction:d}),{commands:f}=new cn({editor:this.editor,state:u});if(f.clearNodes(),!!d.steps.length)return d}})]}}),Yf=G.create({name:"paste",addProseMirrorPlugins(){return[new $({key:new W("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),Qf=G.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new $({key:new W("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!==null&&t!==void 0?t:"0"}}}})]}}),Zf=G.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:t}=fn(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}
Line truncated
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,61 +101,61 @@ img.ProseMirror-separator {
|
|||||||
|
|
||||||
.ProseMirror-focused .ProseMirror-gapcursor {
|
.ProseMirror-focused .ProseMirror-gapcursor {
|
||||||
display: block;
|
display: block;
|
||||||
}`,j0=class extends N0{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Zu,createMappablePosition:ef},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:o})=>this.options.onDrop(n,r,o)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),this.on("delete",this.options.onDelete);let e=this.createDoc();if(!this.editorState){let n=Bo(e,this.options.autofocus);this.editorState=On.create({doc:e,schema:this.schema,selection:n||void 0})}this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let t=this.editorView.dom;t?.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=of(W0,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){let n=Fl(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;let e=this.state.plugins,n=e;if([].concat(t).forEach(o=>{let i=typeof o=="string"?`${o}$`:o.key;n=n.filter(s=>!s.key.startsWith(i))}),e.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e,n,r;let i=[...this.options.enableCoreExtensions?[wf,mf.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),gf,kf,Sf,vf.configure({value:(r=(n=this.options.coreExtensionOptions
Line truncated
|
}`,sx=class extends Mw{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:bf,createMappablePosition:wf},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:o})=>this.options.onDrop(n,r,o)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),this.on("delete",this.options.onDelete);let e=this.createDoc();if(!this.editorState){let n=Ko(e,this.options.autofocus);this.editorState=Bn.create({doc:e,schema:this.schema,selection:n||void 0})}ox(this.schema),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let t=this.editorView.dom;t?.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():cn.createFakeChain()}can(){return this.commandManager?this.commandManager.can():cn.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Df(ix,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return Cf&&!this.hasWarnedStaleDecorationRead&&vw(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){let n=Kl(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.vi
Line truncated
|
||||||
|
|
||||||
`,textSerializers:n={}}=t||{};return jl(this.state.doc,{blockSeparator:e,textSerializers:{...Ko(this.schema),...n}})}get isEmpty(){return hn(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){let e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new Tf(e,this,!1,n)}get $doc(){return this.$pos(0)}};function Me(t){return new $t({find:t.find,handler:({state:e,range:n,match:r})=>{let o=q(t.getAttributes,void 0,r);if(o===!1||o===null)return null;let{tr:i}=e,s=r[r.length-1],l=r[0];if(s){let a=l.search(/\S/),c=n.from+l.indexOf(s),d=c+s.length;if(Pr(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(m=>m===t.type&&m!==h.mark.type)).filter(h=>h.to>c).length)return null;d<n.to&&i.delete(d,n.to),c>n.from&&i.delete(n.from+a,c);let f=n.from+a+s.length;i.addMark(n.from+a,f,t.type.create(o||{})),i.removeStoredMark(t.type)}},undoable:t.undoable})}function Hr(t){return new $t({find:t.find,handler:({state:e,range:n,match:r})=>{let o=q(t.getAttributes,void 0,r)||{},{tr:i}=e,s=n.from,l=n.to,a=t.type.create(o);if(r[1]){let c=r[0].lastIndexOf(r[1]),d=s+c;d>l?d=l:l=d+r[1].length;let u=r[0][r[0].length-1];i.insertText(u,s+r[0].length-1),i.replaceWith(d,l,a)}else if(r[0]){let c=t.type.isInline?s:s-1;i.insert(c,t.type.create(o)).delete(i.mapping.map(s),i.mapping.map(l))}i.scrollIntoView()},undoable:t.undoable})}function Un(t){return new $t({find:t.find,handler:({state:e,range:n,match:r})=>{let o=e.doc.resolve(n.from),i=q(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)},undoable:t.undoable})}function U0(t){return new $t({find:t.find,handler:({state:e,range:n,match:r})=>{let o=t.replace,i=n.from,s=n.to;if(r[1]){let l=r[0].lastIndexOf(r[1]);o+=r[0].slice(l+r[1].length),i+=l;let a=i-s;a>0&&(o=r[0].slice(l-a,l)+o,i=s)}e.tr.insertText(o,i,s)},undoable:t.undoable})}function Je(t){return new $t({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{let i=q(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),c=a&&En(a,t.type,i);if(!c)return null;if(s.wrap(a,c),t.keepMarks&&t.editor){let{selection:u,storedMarks:f}=e,{splittableMarks:h}=t.editor.extensionManager,p=f||u.$to.parentOffset&&u.$from.marks();if(p){let m=p.filter(g=>h.includes(g.type.name));s.ensureMarks(m)}}if(t.keepAttributes){let u=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(u,i).run()}let d=s.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&Ie(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&s.join(n.from-1)},undoable:t.undoable})}function K0(t){return t.children}var q0=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);let{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},J0=t=>"touches"in t,Zo=class{constructor(t){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=l=>{if(!this.isResizing||!this.activeHandle)return;let a=l.clientX-this.startX,c=l.clientY-this.startY;this.handleResize(a,c)},this.handleTouchMove=l=>{if(!this.isResizing||!this.activeHandle)return;let a=l.touches[0];if(!a)return;let c=a.clientX-this.startX,d=a.clientY-this.startY;this.handleResize(c,d)},this.handleMouseUp=()=>{if(!this.isResizing)return;let l=this.element.offsetWidth,a=this.element.offsetHeight;this.onCommit(l,a),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,n,r,o,i,s;this.node=t.node,this.editor=t.editor,this.element=t.element,this.eleme
Line truncated
|
`,textSerializers:n={}}=t||{};return Xl(this.state.doc,{blockSeparator:e,textSerializers:{...ti(this.schema),...n}})}get isEmpty(){return mn(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(t=(e=this.editorView)===null||e===void 0?void 0:e.isDestroyed)!==null&&t!==void 0?t:!0}$node(t,e){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(t,e))||null}$pos(t){let e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new eh(e,this,!1,n)}get $doc(){return this.$pos(0)}},qr=class{static Inline(t,e,n={},r){return new th(t,e,n,r)}static Node(t,e,n={},r){return new nh(t,e,n,r)}static Widget(t,e,n){let{key:r,...o}=n;return new rh(t,e,r,o)}},th=class extends qr{constructor(t,e,n={},r){super(),this.kind="inline",this.from=t,this.to=e,this.attrs=n,this.spec=r}get anchor(){return this.from}toPMDecoration(t){let e=t?{...this.spec,extensionName:t}:this.spec;return Z.inline(this.from,this.to,this.attrs,e)}},nh=class extends qr{constructor(t,e,n={},r){super(),this.kind="node",this.from=t,this.to=e,this.attrs=n,this.spec=r}get anchor(){return this.from}toPMDecoration(t){let e=t?{...this.spec,extensionName:t}:this.spec;return Z.node(this.from,this.to,this.attrs,e)}},rh=class extends qr{constructor(t,e,n,r){super(),this.kind="widget",this.pos=t,this.render=e,this.key=n,this.spec=r}get anchor(){return this.pos}toPMDecoration(t){let e=t?{...this.spec,key:this.key,extensionName:t}:{...this.spec,key:this.key};return Z.widget(this.pos,this.render,e)}};function lx(t,e){let n=t,r=n[e];if(!r){r={renderers:new Map,props:new Map,pendingProps:new Map,flushScheduled:!1},n[e]=r;let o=r;t.on("destroy",()=>{o.pendingProps.clear(),o.renderers.forEach(i=>i.destroy()),o.renderers.clear(),o.props.clear()})}return r}function ax(t){t.flushScheduled=!1;for(let[e,n]of t.pendingProps){let r=t.renderers.get(e);r&&(r.updateProps(n),t.props.set(e,{...n}))}t.pendingProps.clear()}function cx(t){let{editor:e,pos:n,key:r,props:o,cacheKey:i,context:s,create:l,materialize:a,side:c,relaxedSide:d,marks:u,stopEvent:f,ignoreSelection:h,destroy:p}=t,m=lx(e,i);if(m.renderers.has(r)){var g;let x=(g=m.pendingProps.get(r))!==null&&g!==void 0?g:m.props.get(r);(!x||!ra(x,o))&&(m.pendingProps.set(r,o),m.flushScheduled||(m.flushScheduled=!0,queueMicrotask(()=>ax(m))))}let y=(x,b)=>{let w={...o,...s(b)},k=m.renderers.get(r);return k?k.updateProps(w):(k=l(w),m.renderers.set(r,k),m.props.set(r,{...o})),a(k)};return qr.Widget(n,y,{key:r,side:c,relaxedSide:d,marks:u,stopEvent:f,ignoreSelection:h,destroy:x=>{if(!Nf(e).has(r))try{var b;(b=m.renderers.get(r))===null||b===void 0||b.destroy(),m.renderers.delete(r),m.props.delete(r),m.pendingProps.delete(r)}finally{p?.(x)}}})}function Me(t){return new Ht({find:t.find,handler:({state:e,range:n,match:r})=>{let o=U(t.getAttributes,void 0,r);if(o===!1||o===null)return null;let{tr:i}=e,s=r[r.length-1],l=r[0];if(s){let a=l.search(/\S/),c=n.from+l.indexOf(s),d=c+s.length;if(jr(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(h=>h===t.type&&h!==f.mark.type)).filter(f=>f.to>c).length)return null;d<n.to&&i.delete(d,n.to),c>n.from&&i.delete(n.from+a,c);let u=n.from+a+s.length;i.addMark(n.from+a,u,t.type.create(o||{})),i.removeStoredMark(t.type)}},undoable:t.undoable})}function Jr(t){return new Ht({find:t.find,handler:({state:e,range:n,match:r})=>{let o=U(t.getAttributes,void 0,r)||{},{tr:i}=e,s=n.from,l=n.to,a=t.type.create(o);if(r[1]){let c=s+r[0].lastIndexOf(r[1]);c>l?c=l:l=c+r[1].length;let d=r[0][r[0].length-1];i.insertText(d,s+r[0].length-1),i.replaceWith(c,l,a)}else if(r[0]){let c=t.type.isInline?s:s-1;i.insert(c,t.type.create(o)).delete(i.mapping.map(s),i.mapping.map(l))}i.scrollIntoView()},undoable:t.undoable})}function Zn(t){return new Ht({find:t.find,handler:({state:e,range:n,match:r})=>{let o=e.doc.resolve(n.from),i=U(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)},undoable:t.undoable})}function dx(t){return new Ht({find:t.find,handler:({state:e,range:n,match:r})=>{let o=t.replace,i=n.from,s=n.to;if(r[1]){let l=r[0].lastIndexOf(r[1]);o+=r[0].slice(l+r[1].length),i+=l;let a=i-s;a>0&&(o=r[0].slice(l-a,l)+o,i=s)}e.tr.insertText(o,i,s)},undoable:t.undoable})}function St(t){return new Ht({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{let i=U(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),a=l&&Ln(l,t.type,i);if(!a)return null;if(s.wrap(l,a),t.keepMarks&&t.editor){let{selection:d,storedMarks:u}=e,{splittableMarks:f}=t.editor.extensionManager,h=u||d.$to.par
Line truncated
|
||||||
`).map(u=>u.trim()===""?n:`${n} ${u}`);r.push(d.join(`
|
`).map(c=>c.trim()===""?n:`${n} ${c}`);r.push(a.join(`
|
||||||
`))}),r.join(`
|
`))}),r.join(`
|
||||||
${n}
|
${n}
|
||||||
`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>Aw(this.editor,this.type)}},addInputRules(){return[Je({find:Ew,type:this.type})]}}),Uf=Nw;var Ow=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Rw=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Dw=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Lw=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Iw=ee.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return Kn("strong",{...N(this.options.HTMLAttributes,t),children:Kn("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Me({find:Ow,type:this.type}),Me({find:Dw,type:this.type})]},addPasteRules(){return[ge({find:Rw,type:this.type}),ge({find:Lw,type:this.type})]}}),Kf=Iw;var Pw=t=>{let e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},Bw=t=>{let e=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=e.exec(t))!==null;)r.index>0&&t[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},zw=ee.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",N(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Me({find:Pw,type:this.type})]},addPasteRules(){return[ge({find:Bw,type:this.type})]}}),qf=zw;var da=4,Hw=/^```([a-z]+)?[\s\n]$/,$w=/^~~~([a-z]+)?[\s\n]$/,Fw=$.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:da,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;let{languageClassPrefix:n}=this.options;if(!n)return null;let i=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",N(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n,r;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&((r=t.raw)==null?void 0:r.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="",o=((n=t.attrs)==null?void 0:n.language)||"";return t.content?r=[`\`\`\`${o}`,e.renderChildren(t.content),"```"].join(`
|
`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>qx(this.editor,this.type)}},addInputRules(){return[St({find:Jx,type:this.type})]}}),Ah=Gx;var Xx=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Yx=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Qx=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Zx=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,ek=te.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return er("strong",{...R(this.options.HTMLAttributes,t),children:er("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Me({find:Xx,type:this.type}),Me({find:Qx,type:this.type})]},addPasteRules(){return[ke({find:Yx,type:this.type}),ke({find:Zx,type:this.type})]}}),Eh=ek;var tk=t=>{let e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},nk=t=>{let e=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=e.exec(t))!==null;)r.index>0&&t[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},rk=te.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",R(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Me({find:tk,type:this.type})]},addPasteRules(){return[ke({find:nk,type:this.type})]}}),Oh=rk;var ka=4,ok=/^```([a-z]+)?[\s\n]$/,ik=/^~~~([a-z]+)?[\s\n]$/,sk=F.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:ka,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;let{languageClassPrefix:n}=this.options;if(!n)return null;let r=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",R(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n,r;return((n=t.raw)===null||n===void 0?void 0:n.startsWith("```"))===!1&&((r=t.raw)===null||r===void 0?void 0:r.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="",o=((n=t.attrs)===null||n===void 0?void 0:n.language)||"";return t.content?r=[`\`\`\`${o}`,e.renderChildren(t.content),"```"].join(`
|
||||||
`):r=`\`\`\`${o}
|
`):r=`\`\`\`${o}
|
||||||
|
|
||||||
\`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;let n=(e=this.options.tabSize)!=null?e:da,{state:r}=t,{selection:o}=r,{$from:i,empty:s}=o;if(i.parent.type!==this.type)return!1;let l=" ".repeat(n);return s?t.commands.insertContent(l):t.commands.command(({tr:a})=>{let{from:c,to:d}=o,h=r.doc.textBetween(c,d,`
|
\`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;let n=(e=this.options.tabSize)!==null&&e!==void 0?e:ka,{state:r}=t,{selection:o}=r,{$from:i,empty:s}=o;if(i.parent.type!==this.type)return!1;let l=" ".repeat(n);return s?t.commands.insertContent(l):t.commands.command(({tr:a})=>{let{from:c,to:d}=o,u=r.doc.textBetween(c,d,`
|
||||||
`,`
|
`,`
|
||||||
`).split(`
|
`).split(`
|
||||||
`).map(p=>l+p).join(`
|
`).map(f=>l+f).join(`
|
||||||
`);return a.replaceWith(c,d,r.schema.text(h)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;let n=(e=this.options.tabSize)!=null?e:da,{state:r}=t,{selection:o}=r,{$from:i,empty:s}=o;return i.parent.type!==this.type?!1:s?t.commands.command(({tr:l})=>{var a;let{pos:c}=i,d=i.start(),u=i.end(),h=r.doc.textBetween(d,u,`
|
`);return a.replaceWith(c,d,r.schema.text(u)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;let n=(e=this.options.tabSize)!==null&&e!==void 0?e:ka,{state:r}=t,{selection:o}=r,{$from:i,empty:s}=o;return i.parent.type!==this.type?!1:s?t.commands.command(({tr:l})=>{var a;let{pos:c}=i,d=i.start(),u=i.end(),f=r.doc.textBetween(d,u,`
|
||||||
`,`
|
`,`
|
||||||
`).split(`
|
`).split(`
|
||||||
`),p=0,m=0,g=c-d;for(let C=0;C<h.length;C+=1){if(m+h[C].length>=g){p=C;break}m+=h[C].length+1}let x=((a=h[p].match(/^ */))==null?void 0:a[0])||"",b=Math.min(x.length,n);if(b===0)return!0;let w=d;for(let C=0;C<p;C+=1)w+=h[C].length+1;return l.delete(w,w+b),c-w<=b&&l.setSelection(E.create(l.doc,w)),!0}):t.commands.command(({tr:l})=>{let{from:a,to:c}=o,f=r.doc.textBetween(a,c,`
|
`),h=0,p=0,m=c-d;for(let b=0;b<f.length;b+=1){if(p+f[b].length>=m){h=b;break}p+=f[b].length+1}let g=((a=f[h].match(/^ */))===null||a===void 0?void 0:a[0])||"",y=Math.min(g.length,n);if(y===0)return!0;let x=d;for(let b=0;b<h;b+=1)x+=f[b].length+1;return l.delete(x,x+y),c-x<=y&&l.setSelection(N.create(l.doc,x)),!0}):t.commands.command(({tr:l})=>{let{from:a,to:c}=o,d=r.doc.textBetween(a,c,`
|
||||||
`,`
|
`,`
|
||||||
`).split(`
|
`).split(`
|
||||||
`).map(h=>{var p;let m=((p=h.match(/^ */))==null?void 0:p[0])||"",g=Math.min(m.length,n);return h.slice(g)}).join(`
|
`).map(u=>{var f;let h=((f=u.match(/^ */))===null||f===void 0?void 0:f[0])||"",p=Math.min(h.length,n);return u.slice(p)}).join(`
|
||||||
`);return l.replaceWith(a,c,r.schema.text(f)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;let i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
|
`);return l.replaceWith(a,c,r.schema.text(d)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;let i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
|
||||||
|
|
||||||
`);return!i||!s?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:t})=>{if(!this.options.exitOnArrowUp)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type||r.parentOffset!==0)return!1;let i=r.before();return i>0?!1:t.commands.insertDefaultBlock({pos:i})},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;let l=o.after();return l===void 0?!1:r.nodeAt(l)?t.commands.command(({tr:c})=>(c.setSelection(I.near(r.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[Un({find:Hw,type:this.type,getAttributes:t=>({language:t[1]})}),Un({find:$w,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new D({key:new H("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;let n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=o?.mode;if(!n||!i)return!1;let{tr:s,schema:l}=t.state,a=l.text(n.replace(/\r\n?/g,`
|
`);return!i||!s?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:t})=>{if(!this.options.exitOnArrowUp)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type||r.parentOffset!==0)return!1;let i=r.before();return i>0?!1:t.commands.insertDefaultBlock({pos:i})},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type||o.parentOffset!==o.parent.nodeSize-2)return!1;let s=o.after();return s===void 0?!1:r.nodeAt(s)?t.commands.command(({tr:l})=>(l.setSelection(I.near(r.resolve(s))),!0)):t.commands.exitCode()}}},addInputRules(){return[Zn({find:ok,type:this.type,getAttributes:t=>({language:t[1]})}),Zn({find:ik,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new $({key:new W("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;let n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=o?.mode;if(!n||!i)return!1;let{tr:s,schema:l}=t.state,a=l.text(n.replace(/\r\n?/g,`
|
||||||
`));return s.replaceSelectionWith(this.type.create({language:i},a)),s.selection.$from.parent.type!==this.type&&s.setSelection(E.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),Jf=Fw;var Gf=$.create({name:"customBlock",group:"block",atom:!0,defining:!0,draggable:!0,selectable:!0,isolating:!0,allowGapCursor:!0,inline:!1,addNodeView(){return({editor:t,node:e,getPos:n,HTMLAttributes:r,decorations:o,extension:i})=>{let s=document.createElement("div");s.setAttribute("data-config",JSON.stringify(e.attrs.config)),s.setAttribute("data-id",e.attrs.id),s.setAttribute("data-type","customBlock");let l=document.createElement("div");if(l.className="fi-fo-rich-editor-custom-block-header fi-not-prose",s.appendChild(l),t.isEditable&&typeof e.attrs.config=="object"&&e.attrs.config!==null&&Object.keys(e.attrs.config).length>0){let c=document.createElement("div");c.className="fi-fo-rich-editor-custom-block-edit-btn-ctn",l.appendChild(c);let d=document.createElement("button");d.className="fi-icon-btn",d.type="button",d.innerHTML=i.options.editCustomBlockButtonIconHtml,d.addEventListener("click",()=>i.options.editCustomBlockUsing(e.attrs.id,e.attrs.config)),c.appendChild(d)}let a=document.createElement("p");if(a.className="fi-fo-rich-editor-custom-block-heading",a.textContent=e.attrs.label,l.appendChild(a),t.isEditable){let c=document.createElement("div");c.className="fi-fo-rich-editor-custom-block-delete-btn-ctn",l.appendChild(c);let d=document.createElement("button");d.className="fi-icon-btn",d.type="button",d.innerHTML=i.options.deleteCustomBlockButtonIconHtml,d.addEventListener("click",()=>t.chain().setNodeSelection(n()).deleteSelection().run()),c.appendChild(d)}if(e.attrs.preview){let c=document.createElement("div"),d=["fi-fo-rich-editor-custom-block-preview"];e.attrs.shouldApplyProseStylingToPreview||d.push("fi-not-prose"),c.className=d.join(" "),c.innerHTML=new TextDecoder().decode(Uint8Array.from(atob(e.attrs.preview),u=>u.charCodeAt(0))),s.appendChild(c)}return{dom:s}}},addOptions(){return{deleteCustomBlockButtonIconHtml:null,editCustomBlockButtonIconHtml:null,editCustomBlockUsing:()=>{},insertCustomBlockUsing:()=>{}}},addAttributes(){return{config:{default:null,parseHTML:t=>JSON.parse(t.getAttribute("data-config")),renderHTML:t=>t.config?{"data-config":JSON.stringify(t.config)}:{}},id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),rendered:!1},preview:{default:null,parseHTML:t=>t.getAttribute("data-preview"),rendered:!1},shouldApplyProseStylingToPreview:{default:!1,rendered:!1}}},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["div",N({"data-type":"customBlock"},t)]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1,{selection:r}=e,{empty:o,anchor:i}=r;if(!o)return!1;let s=new te,l=0;return e.doc.nodesBetween(i-1,i,(a,c)=>{if(a.type.name===this.name)return n=!0,s=a,l=c,!1}),n})}},addProseMirrorPlugins(){let{insertCustomBlockUsing:t}=this.options;return[new D({props:{handleDrop(e,n){if(!n||(n.preventDefault(),!n.dataTransfer.getData("customBlock")))return!1;let r=n.dataTransfer.getData("customBlock");return t(r,e.posAtCoords({left:n.clientX,top:n.clientY}).pos),!1}}})]}});var ii=(t,e)=>{let n=e.view.domAtPos(t).node,r=n.nodeType===Node.ELEMENT_NODE?n:n.parentElement;return r?r.offsetParent!==null:!1},_w=(t,e,n)=>{for(let r=t.depth;r>0;r-=1){let o=t.node(r),i=e(o),s=ii(t.start(r),n);if(i&&s)return{pos:r>0?t.before(r):0,start:t.start(r),depth:r,node:o}}},Xf=(t,e)=>{let{state:n,view:r,extensionManager:o}=t,{schema:i,selection:s}=n,{empty:l,$anchor:a}=s,c=!!o.extensions.find(y=>y.name==="gapCursor");if(!l||a.parent.type!==i.nodes.detailsSummary||!c||e==="right"&&a.parentOffset!==a.parent.nodeSize-2)return!1;let d=qe(y=>y.type===i.nodes.details)(s);if(!d)return!1;let u=fn(d.node,y=>y.type===i.nodes.detailsContent);if(!u.length||ii(d.start+u[0].pos+1,t))return!1;let h=n.doc.resolve(d.pos+d.node.nodeSize),p=ce.findFrom(h,1,!1);if(!p)return!1;let{tr:m}=n,g=new ce(p);return m.setSelection(g),m.scrollIntoView(),r.dispatch(m),!0},Yf=$.create({name:"details",content:"detailsSummary detailsContent",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,addOptions(){return{persist:!1,openClassName:"is-open",HTMLAttributes:{},renderToggleButton:({element:t,isOpen:e})=>{t.setAttribute("aria-label",e?"Collapse details content":"Expand details content")}}},addAttributes(){return this.options.persist?{open:{default:!1,parseHTML:t=>t.hasAttribute("open"),renderHTML:({open:t})=>t?{open:""}:{}}}:[]},parseHTML(){return[{tag:"details"}]},renderHTML({HTMLAttributes:t}){return["details",N(this.options.HTMLAttributes,t),0]},...Ht({nodeName:"details",content:"block"}),addNodeView(){return({editor:t,getPos:e,node:n,HTMLAttributes:r})=>{let o=document.createElement("div"),i=N(this.options.HTM
Line truncated
|
`));return s.replaceSelectionWith(this.type.create({language:i},a)),s.selection.$from.parent.type!==this.type&&s.setSelection(N.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),Nh=sk;var Rh=F.create({name:"customBlock",group:"block",atom:!0,defining:!0,draggable:!0,selectable:!0,isolating:!0,allowGapCursor:!0,inline:!1,addNodeView(){return({editor:t,node:e,getPos:n,HTMLAttributes:r,decorations:o,extension:i})=>{let s=document.createElement("div");s.setAttribute("data-config",JSON.stringify(e.attrs.config)),s.setAttribute("data-id",e.attrs.id),s.setAttribute("data-type","customBlock");let l=document.createElement("div");if(l.className="fi-fo-rich-editor-custom-block-header fi-not-prose",s.appendChild(l),t.isEditable&&typeof e.attrs.config=="object"&&e.attrs.config!==null&&Object.keys(e.attrs.config).length>0){let c=document.createElement("div");c.className="fi-fo-rich-editor-custom-block-edit-btn-ctn",l.appendChild(c);let d=document.createElement("button");d.className="fi-icon-btn",d.type="button",d.innerHTML=i.options.editCustomBlockButtonIconHtml,d.addEventListener("click",()=>i.options.editCustomBlockUsing(e.attrs.id,e.attrs.config)),c.appendChild(d)}let a=document.createElement("p");if(a.className="fi-fo-rich-editor-custom-block-heading",a.textContent=e.attrs.label,l.appendChild(a),t.isEditable){let c=document.createElement("div");c.className="fi-fo-rich-editor-custom-block-delete-btn-ctn",l.appendChild(c);let d=document.createElement("button");d.className="fi-icon-btn",d.type="button",d.innerHTML=i.options.deleteCustomBlockButtonIconHtml,d.addEventListener("click",()=>t.chain().setNodeSelection(n()).deleteSelection().run()),c.appendChild(d)}if(e.attrs.preview){let c=document.createElement("div"),d=["fi-fo-rich-editor-custom-block-preview"];e.attrs.shouldApplyProseStylingToPreview||d.push("fi-not-prose"),c.className=d.join(" "),c.innerHTML=new TextDecoder().decode(Uint8Array.from(atob(e.attrs.preview),u=>u.charCodeAt(0))),s.appendChild(c)}return{dom:s}}},addOptions(){return{deleteCustomBlockButtonIconHtml:null,editCustomBlockButtonIconHtml:null,editCustomBlockUsing:()=>{},insertCustomBlockUsing:()=>{}}},addAttributes(){return{config:{default:null,parseHTML:t=>JSON.parse(t.getAttribute("data-config")),renderHTML:t=>t.config?{"data-config":JSON.stringify(t.config)}:{}},id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),rendered:!1},preview:{default:null,parseHTML:t=>t.getAttribute("data-preview"),rendered:!1},shouldApplyProseStylingToPreview:{default:!1,rendered:!1}}},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["div",R({"data-type":"customBlock"},t)]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1,{selection:r}=e,{empty:o,anchor:i}=r;if(!o)return!1;let s=new se,l=0;return e.doc.nodesBetween(i-1,i,(a,c)=>{if(a.type.name===this.name)return n=!0,s=a,l=c,!1}),n})}},addProseMirrorPlugins(){let{insertCustomBlockUsing:t}=this.options;return[new $({props:{handleDrop(e,n){if(!n||(n.preventDefault(),!n.dataTransfer.getData("customBlock")))return!1;let r=n.dataTransfer.getData("customBlock");return t(r,e.posAtCoords({left:n.clientX,top:n.clientY}).pos),!1}}})]}});var pi=(t,e)=>{let n=e.view.domAtPos(t).node,r=n.nodeType===Node.ELEMENT_NODE?n:n.parentElement;return r?r.offsetParent!==null:!1},lk=(t,e,n)=>{for(let r=t.depth;r>0;r-=1){let o=t.node(r),i=e(o),s=pi(t.start(r),n);if(i&&s)return{pos:r>0?t.before(r):0,start:t.start(r),depth:r,node:o}}},Dh=(t,e)=>{let{state:n,view:r,extensionManager:o}=t,{schema:i,selection:s}=n,{empty:l,$anchor:a}=s,c=!!o.extensions.find(g=>g.name==="gapCursor");if(!l||a.parent.type!==i.nodes.detailsSummary||!c||e==="right"&&a.parentOffset!==a.parent.nodeSize-2)return!1;let d=xt(g=>g.type===i.nodes.details)(s);if(!d)return!1;let u=Xn(d.node,g=>g.type===i.nodes.detailsContent);if(!u.length||pi(d.start+u[0].pos+1,t))return!1;let f=n.doc.resolve(d.pos+d.node.nodeSize),h=ce.findFrom(f,1,!1);if(!h)return!1;let{tr:p}=n,m=new ce(h);return p.setSelection(m),p.scrollIntoView(),r.dispatch(p),!0},Lh=F.create({name:"details",content:"detailsSummary detailsContent",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,addOptions(){return{persist:!1,openClassName:"is-open",HTMLAttributes:{},renderToggleButton:({element:t,isOpen:e})=>{t.setAttribute("aria-label",e?"Collapse details content":"Expand details content")}}},addAttributes(){return this.options.persist?{open:{default:!1,parseHTML:t=>t.hasAttribute("open"),renderHTML:({open:t})=>t?{open:""}:{}}}:[]},parseHTML(){return[{tag:"details"}]},renderHTML({HTMLAttributes:t}){return["details",R(this.options.HTMLAttributes,t),0]},...Yn({nodeName:"details",content:"block"}),addNodeView(){return({editor:t,getPos:e,node:n,HTMLAttributes:r})=>{let o=document.createElement("div"),i=R(this.options.HTM
Line truncated
|
||||||
|
|
||||||
`):""}),eh=Vw;var th=$.create({name:"grid",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"gridColumn+",addOptions(){return{HTMLAttributes:{class:"grid-layout"}}},addAttributes(){return{"data-cols":{default:2,parseHTML:t=>t.getAttribute("data-cols")},"data-from-breakpoint":{default:"md",parseHTML:t=>t.getAttribute("data-from-breakpoint")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-template-columns: repeat(${t["data-cols"]}, 1fr)`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("grid-layout")&&null}]},renderHTML({HTMLAttributes:t}){return["div",N(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGrid:({columns:t=[1,1],fromBreakpoint:e,coordinates:n=null}={})=>({tr:r,dispatch:o,editor:i})=>{let s=i.schema.nodes.gridColumn,l=Array.isArray(t)&&t.length?t:[1,1],a=[];for(let u=0;u<l.length;u+=1)a.push(s.createAndFill({"data-col-span":Number(l[u]??1)||1}));let c=l.map(u=>Number(u)||1).reduce((u,f)=>u+f,0),d=i.schema.nodes.grid.createChecked({"data-cols":c,"data-from-breakpoint":e},a);if(o){let u=r.selection.anchor+1;[null,void 0].includes(n?.from)?r.replaceSelectionWith(d).scrollIntoView().setSelection(E.near(r.doc.resolve(u))):r.replaceRangeWith(n.from,n.to,d).scrollIntoView().setSelection(E.near(r.doc.resolve(n.from)))}return!0}}}});var nh=$.create({name:"gridColumn",content:"block+",isolating:!0,addOptions(){return{HTMLAttributes:{class:"grid-layout-col"}}},addAttributes(){return{"data-col-span":{default:1,parseHTML:t=>t.getAttribute("data-col-span"),renderHTML:t=>({"data-col-span":t["data-col-span"]??1})},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-column: span ${t["data-col-span"]??1};`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("grid-layout-col")&&null}]},renderHTML({HTMLAttributes:t}){return["div",N(this.options.HTMLAttributes,t),0]}});var Ww=$.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",N(this.options.HTMLAttributes,t)]},renderText(){return`
|
`):""}),Bh=ak;var $h=F.create({name:"grid",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"gridColumn+",addOptions(){return{HTMLAttributes:{class:"grid-layout"}}},addAttributes(){return{"data-cols":{default:2,parseHTML:t=>t.getAttribute("data-cols")},"data-from-breakpoint":{default:"md",parseHTML:t=>t.getAttribute("data-from-breakpoint")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-template-columns: repeat(${t["data-cols"]}, 1fr)`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("grid-layout")&&null}]},renderHTML({HTMLAttributes:t}){return["div",R(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGrid:({columns:t=[1,1],fromBreakpoint:e,coordinates:n=null}={})=>({tr:r,dispatch:o,editor:i})=>{let s=i.schema.nodes.gridColumn,l=Array.isArray(t)&&t.length?t:[1,1],a=[];for(let u=0;u<l.length;u+=1)a.push(s.createAndFill({"data-col-span":Number(l[u]??1)||1}));let c=l.map(u=>Number(u)||1).reduce((u,f)=>u+f,0),d=i.schema.nodes.grid.createChecked({"data-cols":c,"data-from-breakpoint":e},a);if(o){let u=r.selection.anchor+1;[null,void 0].includes(n?.from)?r.replaceSelectionWith(d).scrollIntoView().setSelection(N.near(r.doc.resolve(u))):r.replaceRangeWith(n.from,n.to,d).scrollIntoView().setSelection(N.near(r.doc.resolve(n.from)))}return!0}}}});var zh=F.create({name:"gridColumn",content:"block+",isolating:!0,addOptions(){return{HTMLAttributes:{class:"grid-layout-col"}}},addAttributes(){return{"data-col-span":{default:1,parseHTML:t=>t.getAttribute("data-col-span"),renderHTML:t=>({"data-col-span":t["data-col-span"]??1})},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-column: span ${t["data-col-span"]??1};`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("grid-layout-col")&&null}]},renderHTML({HTMLAttributes:t}){return["div",R(this.options.HTMLAttributes,t),0]}});var ck=F.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",R(this.options.HTMLAttributes,t)]},renderText(){return`
|
||||||
`},renderMarkdown:()=>`
|
`},renderMarkdown:()=>`
|
||||||
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:o,storedMarks:i}=n;if(o.$from.parent.type.spec.isolating)return!1;let{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,a=i||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&a&&s){let u=a.filter(f=>l.includes(f.type.name));c.ensureMarks(u)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),rh=Ww;var jw=$.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,N(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;let r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,o="#".repeat(r);return t.content?`${o} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Un({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),oh=jw;var Uw=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,Kw=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,qw=ee.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||Ql(t,"background-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",N(this.options.HTMLAttributes,t),0]},renderMarkdown:(t,e)=>`==${e.renderChildren(t)}==`,parseMarkdown:(t,e)=>e.applyMark("highlight",e.parseInline(t.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:t=>t.indexOf("=="),tokenize(t,e,n){let o=/^(==)([^=]+)(==)/.exec(t);if(o){let i=o[2].trim(),s=n.inlineTokens(i);return{type:"highlight",raw:o[0],text:i,tokens:s}}}},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Me({find:Uw,type:this.type})]},addPasteRules(){return[ge({find:Kw,type:this.type})]}}),ih=qw;var Jw=$.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",N(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!Xl(e,e.schema.nodes[this.name]))return!1;let{selection:n}=e,{$to:r}=n,o=t();return Br(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({state:i,tr:s,dispatch:l})=>{if(l){let{$to:a}=s.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?s.setSelection(E.create(s.doc,a.pos+1)):a.nodeAfter.isBlock?s.setSelection(L.create(s.doc,a.pos)):s.setSelection(E.create(s.doc,a.pos));else{let d=i.schema.nodes[this.options.nextNodeType]||a.parent.type.contentMatch.defaultType,u=d?.create();u&&(s.insert(c,u),s.setSelection(E.create(s.doc,c+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Hr({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),sh=Jw;var Gw=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Xw=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Yw=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Qw=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Zw=ee.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",N(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.to
Line truncated
|
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:o,storedMarks:i}=n;if(o.$from.parent.type.spec.isolating)return!1;let{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,a=i||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&a&&s){let u=a.filter(f=>l.includes(f.type.name));c.ensureMarks(u)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Hh=ck;var dk=F.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,R(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;let r=!((n=t.attrs)===null||n===void 0)&&n.level?parseInt(t.attrs.level,10):1,o="#".repeat(r);return t.content?`${o} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Zn({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),Fh=dk;var uk=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,fk=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,hk=te.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||sa(t,"background-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",R(this.options.HTMLAttributes,t),0]},renderMarkdown:(t,e)=>`==${e.renderChildren(t)}==`,parseMarkdown:(t,e)=>e.applyMark("highlight",e.parseInline(t.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:t=>t.indexOf("=="),tokenize(t,e,n){let r=/^(==)([^=]+)(==)/.exec(t);if(r){let o=r[2].trim(),i=n.inlineTokens(o);return{type:"highlight",raw:r[0],text:o,tokens:i}}}},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Me({find:uk,type:this.type})]},addPasteRules(){return[ke({find:fk,type:this.type})]}}),Vh=hk;var pk=F.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",R(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!oa(e,e.schema.nodes[this.name]))return!1;let{selection:n}=e,{$to:r}=n,o=t();return _r(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({state:i,tr:s,dispatch:l})=>{if(l){let{$to:a}=s.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?s.setSelection(N.create(s.doc,a.pos+1)):a.nodeAfter.isBlock?s.setSelection(D.create(s.doc,a.pos)):s.setSelection(N.create(s.doc,a.pos));else{let d=i.schema.nodes[this.options.nextNodeType]||a.parent.type.contentMatch.defaultType,u=d?.create();u&&(s.insert(c,u),s.setSelection(N.create(s.doc,c+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Jr({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Wh=pk;var mk=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,gk=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,yk=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,bk=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,wk=te.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",R(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({co
Line truncated
|
||||||
`,ax="\uFE0F",cx="\u200D",ma="\uFFFC",si=null,li=null;function dx(t=[]){let e={};Ee.groups=e;let n=new Ee;si==null&&(si=ph(nx)),li==null&&(li=ph(rx)),M(n,"'",Mi),M(n,"{",jr),M(n,"}",Ur),M(n,"[",di),M(n,"]",ui),M(n,"(",fi),M(n,")",hi),M(n,"<",pi),M(n,">",mi),M(n,"\uFF08",gi),M(n,"\uFF09",yi),M(n,"\u300C",bi),M(n,"\u300D",wi),M(n,"\u300E",xi),M(n,"\u300F",ki),M(n,"\uFF1C",Si),M(n,"\uFF1E",Ci),M(n,"&",vi),M(n,"*",Ti),M(n,"@",_t),M(n,"`",Ei),M(n,"^",Ni),M(n,":",yn),M(n,",",Aa),M(n,"$",Oi),M(n,".",it),M(n,"=",Ri),M(n,"!",Ea),M(n,"-",Fe),M(n,"%",Kr),M(n,"|",Di),M(n,"+",Li),M(n,"#",Ii),M(n,"?",qr),M(n,'"',Na),M(n,"/",st),M(n,";",Oa),M(n,"~",Jr),M(n,"_",Pi),M(n,"\\",Ai),M(n,"\u30FB",xh);let r=oe(n,Ct,Ma,{[ya]:!0});oe(r,Ct,r);let o=oe(r,St,bh,{[Wr]:!0}),i=oe(r,_r,wh,{[Vr]:!0}),s=oe(n,St,vt,{[ba]:!0});oe(s,Ct,o),oe(s,St,s),oe(o,Ct,o),oe(o,St,o);let l=oe(n,_r,ka,{[wa]:!0});oe(l,St),oe(l,Ct,i),oe(l,_r,l),oe(i,Ct,i),oe(i,St),oe(i,_r,i);let a=M(n,pa,Ta,{[ua]:!0}),c=M(n,hh,va,{[ua]:!0}),d=oe(n,ha,va,{[ua]:!0});M(n,ma,d),M(c,pa,a),M(c,ma,d),oe(c,ha,d),M(d,hh),M(d,pa),oe(d,ha,d),M(d,ma,d);let u=oe(n,fa,kh,{[yh]:!0});M(u,"#"),oe(u,fa,u),M(u,ax,u);let f=M(u,cx);M(f,"#"),oe(f,fa,u);let h=[[St,s],[Ct,o]],p=[[St,null],[_r,l],[Ct,i]];for(let m=0;m<si.length;m++)Ft(n,si[m],Sa,vt,h);for(let m=0;m<li.length;m++)Ft(n,li[m],Ca,ka,p);gn(Sa,{tld:!0,ascii:!0},e),gn(Ca,{utld:!0,alpha:!0},e),Ft(n,"file",ci,vt,h),Ft(n,"mailto",ci,vt,h),Ft(n,"http",qn,vt,h),Ft(n,"https",qn,vt,h),Ft(n,"ftp",qn,vt,h),Ft(n,"ftps",qn,vt,h),gn(ci,{scheme:!0,ascii:!0},e),gn(qn,{slashscheme:!0,ascii:!0},e),t=t.sort((m,g)=>m[0]>g[0]?1:-1);for(let m=0;m<t.length;m++){let g=t[m][0],x=t[m][1]?{[ox]:!0}:{[ix]:!0};g.indexOf("-")>=0?x[xa]=!0:St.test(g)?Ct.test(g)?x[Wr]=!0:x[ba]=!0:x[ya]=!0,fh(n,g,g,x)}return fh(n,"localhost",Gr,{ascii:!0}),n.jd=new Ee(Bi),{start:n,tokens:Object.assign({groups:e},Sh)}}function Ch(t,e){let n=ux(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,o=[],i=0,s=0;for(;s<r;){let l=t,a=null,c=0,d=null,u=-1,f=-1;for(;s<r&&(a=l.go(n[s]));)l=a,l.accepts()?(u=0,f=0,d=l):u>=0&&(u+=n[s].length,f++),c+=n[s].length,i+=n[s].length,s++;i-=u,s-=f,c-=u,o.push({t:d.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}function ux(t){let e=[],n=t.length,r=0;for(;r<n;){let o=t.charCodeAt(r),i,s=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Ft(t,e,n,r,o){let i,s=e.length;for(let l=0;l<s-1;l++){let a=e[l];t.j[a]?i=t.j[a]:(i=new Ee(r),i.jr=o.slice(),t.j[a]=i),t=i}return i=new Ee(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function ph(t){let e=[],n=[],r=0,o="0123456789";for(;r<t.length;){let i=0;for(;o.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(t[r]),r++}return e}var Xr={defaultProtocol:"http",events:null,format:mh,formatHref:mh,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Ra(t,e=null){let n=Object.assign({},Xr);t&&(n=Object.assign(n,t instanceof Ra?t.o:t));let r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}Ra.prototype={o:Xr,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){let r=e!=null,o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:Xr[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){let e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function mh(t){return t}function vh(t,e){this.t="token",this.v=t,this.tk=e}vh.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){let e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"\u2026":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Xr.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){let e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},l=t.get("className",n,e),a=t.get("target",n,e),c=t.get("rel",n,e),d=t.getObj("attributes",n,e),u=t.getObj("events",n,e);return s.href=r,l&&(s.class=l),a&&(s.target=a),c&&(s.rel=c),d&&Object.assign(s,d),{tagName:o,attributes:s,content:i,eventListeners:u}}};function zi(t,e){class n extends vh{constructor(o,i){super(o,i),thLine truncated
|
`,Ek="\uFE0F",Ok="\u200D",Ta="\uFFFC",mi=null,gi=null;function Nk(t=[]){let e={};Ae.groups=e;let n=new Ae;mi==null&&(mi=Xh(Sk)),gi==null&&(gi=Xh(Ck)),M(n,"'",Ii),M(n,"{",eo),M(n,"}",to),M(n,"[",wi),M(n,"]",xi),M(n,"(",ki),M(n,")",Si),M(n,"<",Ci),M(n,">",vi),M(n,"\uFF08",Mi),M(n,"\uFF09",Ti),M(n,"\u300C",Ai),M(n,"\u300D",Ei),M(n,"\u300E",Oi),M(n,"\u300F",Ni),M(n,"\uFF1C",Ri),M(n,"\uFF1E",Di),M(n,"&",Li),M(n,"*",Pi),M(n,"@",Vt),M(n,"`",$i),M(n,"^",zi),M(n,":",xn),M(n,",",za),M(n,"$",Hi),M(n,".",ot),M(n,"=",Fi),M(n,"!",Ha),M(n,"-",Fe),M(n,"%",no),M(n,"|",Vi),M(n,"+",Wi),M(n,"#",ji),M(n,"?",ro),M(n,'"',Fa),M(n,"/",it),M(n,";",Va),M(n,"~",oo),M(n,"_",_i),M(n,"\\",Bi),M(n,"\u30FB",np);let r=ne(n,vt,Ba,{[Ea]:!0});ne(r,vt,r);let o=ne(r,Ct,ep,{[Zr]:!0}),i=ne(r,Yr,tp,{[Qr]:!0}),s=ne(n,Ct,Mt,{[Oa]:!0});ne(s,vt,o),ne(s,Ct,s),ne(o,vt,o),ne(o,Ct,o);let l=ne(n,Yr,Da,{[Na]:!0});ne(l,Ct),ne(l,vt,i),ne(l,Yr,l),ne(i,vt,i),ne(i,Ct),ne(i,Yr,i);let a=M(n,Ma,$a,{[Sa]:!0}),c=M(n,Gh,Pa,{[Sa]:!0}),d=ne(n,va,Pa,{[Sa]:!0});M(n,Ta,d),M(c,Ma,a),M(c,Ta,d),ne(c,va,d),M(d,Gh),M(d,Ma),ne(d,va,d),M(d,Ta,d);let u=ne(n,Ca,rp,{[Zh]:!0});M(u,"#"),ne(u,Ca,u),M(u,Ek,u);let f=M(u,Ok);M(f,"#"),ne(f,Ca,u);let h=[[Ct,s],[vt,o]],p=[[Ct,null],[Yr,l],[vt,i]];for(let m=0;m<mi.length;m++)Ft(n,mi[m],La,Mt,h);for(let m=0;m<gi.length;m++)Ft(n,gi[m],Ia,Da,p);wn(La,{tld:!0,ascii:!0},e),wn(Ia,{utld:!0,alpha:!0},e),Ft(n,"file",bi,Mt,h),Ft(n,"mailto",bi,Mt,h),Ft(n,"http",tr,Mt,h),Ft(n,"https",tr,Mt,h),Ft(n,"ftp",tr,Mt,h),Ft(n,"ftps",tr,Mt,h),wn(bi,{scheme:!0,ascii:!0},e),wn(tr,{slashscheme:!0,ascii:!0},e),t=t.sort((m,g)=>m[0]>g[0]?1:-1);for(let m=0;m<t.length;m++){let g=t[m][0],x=t[m][1]?{[vk]:!0}:{[Mk]:!0};g.indexOf("-")>=0?x[Ra]=!0:Ct.test(g)?vt.test(g)?x[Zr]=!0:x[Oa]=!0:x[Ea]=!0,Jh(n,g,g,x)}return Jh(n,"localhost",io,{ascii:!0}),n.jd=new Ae(Ui),{start:n,tokens:Object.assign({groups:e},op)}}function ip(t,e){let n=Rk(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,o=[],i=0,s=0;for(;s<r;){let l=t,a=null,c=0,d=null,u=-1,f=-1;for(;s<r&&(a=l.go(n[s]));)l=a,l.accepts()?(u=0,f=0,d=l):u>=0&&(u+=n[s].length,f++),c+=n[s].length,i+=n[s].length,s++;i-=u,s-=f,c-=u,o.push({t:d.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}function Rk(t){let e=[],n=t.length,r=0;for(;r<n;){let o=t.charCodeAt(r),i,s=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Ft(t,e,n,r,o){let i,s=e.length;for(let l=0;l<s-1;l++){let a=e[l];t.j[a]?i=t.j[a]:(i=new Ae(r),i.jr=o.slice(),t.j[a]=i),t=i}return i=new Ae(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function Xh(t){let e=[],n=[],r=0,o="0123456789";for(;r<t.length;){let i=0;for(;o.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(t[r]),r++}return e}var so={defaultProtocol:"http",events:null,format:Yh,formatHref:Yh,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Wa(t,e=null){let n=Object.assign({},so);t&&(n=Object.assign(n,t instanceof Wa?t.o:t));let r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}Wa.prototype={o:so,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){let r=e!=null,o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:so[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){let e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Yh(t){return t}function sp(t,e){this.t="token",this.v=t,this.tk=e}sp.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){let e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"\u2026":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=so.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){let e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},l=t.get("className",n,e),a=t.get("target",n,e),c=t.get("rel",n,e),d=t.getObj("attributes",n,e),u=t.getObj("events",n,e);return s.href=r,l&&(s.class=l),a&&(s.target=a),c&&(s.rel=c),d&&Object.assign(s,d),{tagName:o,attributes:s,content:i,eventListeners:u}}};function Ki(t,e){class n extends sp{constructor(o,i){super(o,i),thLine truncated
|
||||||
1. Must only contain digits, lowercase ASCII letters or "-"
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
||||||
2. Cannot start or end with "-"
|
2. Cannot start or end with "-"
|
||||||
3. "-" cannot repeat`);Z.customSchemes.push([t,e])}function bx(){Z.scanner=dx(Z.customSchemes);for(let t=0;t<Z.tokenQueue.length;t++)Z.tokenQueue[t][1]({scanner:Z.scanner});Z.parser=px(Z.scanner.tokens);for(let t=0;t<Z.pluginQueue.length;t++)Z.pluginQueue[t][1]({scanner:Z.scanner,parser:Z.parser});return Z.initialized=!0,Z}function Hi(t){return Z.initialized||bx(),mx(Z.parser.start,t,Ch(Z.scanner.start,t))}Hi.scan=Ch;function $i(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}let r=new Ra(n),o=Hi(t),i=[];for(let s=0;s<o.length;s++){let l=o[s];l.isLink&&(!e||l.t===e)&&r.check(l)&&i.push(l.toFormattedObject(r))}return i}var La="[\0- \xA0\u1680\u180E\u2000-\u2029\u205F\u3000]",wx=new RegExp(La),xx=new RegExp(`${La}$`),kx=new RegExp(La,"g");function Sx(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function Cx(t){return new D({key:new H("autolink"),appendTransaction:(e,n,r)=>{let o=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),i=e.some(c=>c.getMeta("preventAutolink"));if(!o||i)return;let{tr:s}=r,l=_o(n.doc,[...e]);if(Vn(l).forEach(({newRange:c})=>{let d=$l(r.doc,c,h=>h.isTextblock),u,f;if(d.length>1)u=d[0],f=r.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(d.length){let h=r.doc.textBetween(c.from,c.to," "," ");if(!xx.test(h))return;u=d[0],f=r.doc.textBetween(u.pos,c.to,void 0," ")}if(u&&f){let h=f.split(wx).filter(Boolean);if(h.length<=0)return!1;let p=h[h.length-1],m=u.pos+f.lastIndexOf(p);if(!p)return!1;let g=Hi(p).map(y=>y.toObject(t.defaultProtocol));if(!Sx(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:m+y.start+1,to:m+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>t.validate(y.value)).filter(y=>t.shouldAutoLink(y.value)).forEach(y=>{Pr(y.from,y.to,r.doc).some(x=>x.mark.type===t.type)||s.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!s.steps.length)return s}})}function vx(t){return new D({key:new H("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,i;if(r.button!==0||!e.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{let a=r.target;if(!a)return!1;let c=t.editor.view.dom;s=a.closest("a"),s&&!c.contains(s)&&(s=null)}if(!s)return!1;let l=!1;if(t.enableClickSelection&&(l=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){let a=qo(e.state,t.type.name),c=(o=s.href)!=null?o:a.href,d=(i=s.target)!=null?i:a.target;c&&(window.open(c,d),l=!0)}return l}}})}var Mx=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,Tx=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function Th(t,e){let n=0;for(let r=e-1;r>=0&&t[r]==="\\";r-=1)n+=1;return n%2===1}function Ax(t,e){let n=0,r=0;for(;r<e;){if(t[r]!=="`"){r+=1;continue}if(n===0&&Th(t,r)){r+=1;continue}let o=0;for(;r<e&&t[r]==="`";)o+=1,r+=1;n===0?n=o:o===n&&(n=0)}return n>0}function Ah(t,e,n){var r,o;let[,i,s]=e;return(e.index?t[e.index-1]:void 0)==="!"||Th(t,(r=e.index)!=null?r:0)||Ax(t,(o=e.index)!=null?o:0)?!1:!!i.trim()&&n(s)}function Eh(t){var e,n;let[r,o,i,,s,l,a]=t,c=(e=s??l)!=null?e:a;return{index:(n=t.index)!=null?n:0,text:r,replaceWith:o,data:{href:i,title:c||null,markdown:!0}}}function Ex(t,e){return t.index<e.index+e.text.length&&e.index<t.index+t.text.length}function Nh(t){var e,n,r;return{href:(e=t.data)==null?void 0:e.href,title:(r=(n=t.data)==null?void 0:n.title)!=null?r:null}}function Nx(t){let e=Me({find:n=>{let r=Mx.exec(n);return!r||!Ah(n,r,t.isAllowedHref)?null:Eh(r)},type:t.type,getAttributes:Nh});return new $t({find:e.find,handler:n=>{let r=e.handler(n);return r!==null&&n.state.tr.steps.length&&n.state.tr.setMeta("preventAutolink",!0),r}})}function Ox(t){let e=ge({find:n=>{var r,o;let i=[];for(let l of n.matchAll(Tx))Ah(n,l,t.isAllowedHref)&&i.push(Eh(l));let s=((o=(r=t.findPlainUrls)==null?void 0:r.call(t,n))!=null?o:[]).filter(l=>!i.some(a=>Ex(a,l)));return[...i,...s]},type:t.type,getAttributes:Nh});return new jn({find:e.find,handler:n=>{var r;let o=e.handler(n);return o!==null&&n.state.tr.steps.length&&((r=n.match.data)!=null&&r.markdown)&&n.state.tr.setMeta("preventAutolink",!0),o}})}function Rx(t){return new D({key:new H("handlePasteLink"),props:{handlePaste:(e,n,r)=>{let{shouldAutoLink:o}=t,{state:i}=e,{selection:s}=i,{empty:l}=s;if(l)return!1;let a="";r.content.forEach(d=>{a+=d.textContent});let c=$i(a,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===a);return!a||!c||o!==void 0&&!o(c.value)?!1:t.editor.commands.setMark(t.type,{href:c.href})}}})}function Mt(t,e){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{let o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(kx,"").match(new RegExp(`^(?:(?:${n.map(r=>r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|Line truncated
|
3. "-" cannot repeat`);ee.customSchemes.push([t,e])}function zk(){ee.scanner=Nk(ee.customSchemes);for(let t=0;t<ee.tokenQueue.length;t++)ee.tokenQueue[t][1]({scanner:ee.scanner});ee.parser=Ik(ee.scanner.tokens);for(let t=0;t<ee.pluginQueue.length;t++)ee.pluginQueue[t][1]({scanner:ee.scanner,parser:ee.parser});return ee.initialized=!0,ee}function qi(t){return ee.initialized||zk(),Pk(ee.parser.start,t,ip(ee.scanner.start,t))}qi.scan=ip;function _a(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}let r=new Wa(n),o=qi(t),i=[];for(let s=0;s<o.length;s++){let l=o[s];l.isLink&&(!e||l.t===e)&&r.check(l)&&i.push(l.toFormattedObject(r))}return i}var Ua="[\0- \xA0\u1680\u180E\u2000-\u2029\u205F\u3000]",Hk=new RegExp(Ua),Fk=new RegExp(`${Ua}$`),Vk=new RegExp(Ua,"g");function Wk(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function jk(t){return new $({key:new W("autolink"),appendTransaction:(e,n,r)=>{let o=e.some(a=>a.docChanged)&&!n.doc.eq(r.doc),i=e.some(a=>a.getMeta("preventAutolink"));if(!o||i)return;let{tr:s}=r,l=Yo(n.doc,[...e]);if(pn(l).forEach(({newRange:a})=>{let c=Ul(r.doc,a,f=>f.isTextblock),d,u;if(c.length>1)d=c[0],u=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(c.length){let f=r.doc.textBetween(a.from,a.to," "," ");if(!Fk.test(f))return;d=c[0],u=r.doc.textBetween(d.pos,a.to,void 0," ")}if(d&&u){let f=u.split(Hk).filter(Boolean);if(f.length<=0)return!1;let h=f[f.length-1],p=d.pos+u.lastIndexOf(h);if(!h)return!1;let m=qi(h).map(g=>g.toObject(t.defaultProtocol));if(!Wk(m))return!1;m.filter(g=>g.isLink).map(g=>({...g,from:p+g.start+1,to:p+g.end+1})).filter(g=>r.schema.marks.code?!r.doc.rangeHasMark(g.from,g.to,r.schema.marks.code):!0).filter(g=>t.validate(g.value)).filter(g=>t.shouldAutoLink(g.value)).forEach(g=>{jr(g.from,g.to,r.doc).some(y=>y.mark.type===t.type)||s.addMark(g.from,g.to,t.type.create({href:g.href}))})}}),!!s.steps.length)return s}})}function _k(t){return new $({key:new W("handleClickLink"),props:{handleClick:(e,n,r)=>{if(r.button!==0||!e.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement)o=r.target;else{let a=r.target;if(!a)return!1;let c=t.editor.view.dom;o=a.closest("a"),o&&!c.contains(o)&&(o=null)}if(!o)return!1;let i=!1;if(t.enableClickSelection&&(i=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){var s,l;let a=ni(e.state,t.type.name),c=(s=o.href)!==null&&s!==void 0?s:a.href,d=(l=o.target)!==null&&l!==void 0?l:a.target;c&&(window.open(c,d),i=!0)}return i}}})}var Uk=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,Kk=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function ap(t,e){let n=0;for(let r=e-1;r>=0&&t[r]==="\\";r-=1)n+=1;return n%2===1}function qk(t,e){let n=0,r=0;for(;r<e;){if(t[r]!=="`"){r+=1;continue}if(n===0&&ap(t,r)){r+=1;continue}let o=0;for(;r<e&&t[r]==="`";)o+=1,r+=1;n===0?n=o:o===n&&(n=0)}return n>0}function cp(t,e,n){var r,o;let[,i,s]=e;return(e.index?t[e.index-1]:void 0)==="!"||ap(t,(r=e.index)!==null&&r!==void 0?r:0)||qk(t,(o=e.index)!==null&&o!==void 0?o:0)?!1:!!i.trim()&&n(s)}function dp(t){var e,n;let[r,o,i,,s,l,a]=t,c=(e=s??l)!==null&&e!==void 0?e:a;return{index:(n=t.index)!==null&&n!==void 0?n:0,text:r,replaceWith:o,data:{href:i,title:c||null,markdown:!0}}}function Jk(t,e){return t.index<e.index+e.text.length&&e.index<t.index+t.text.length}function up(t){var e,n,r;return{href:(e=t.data)===null||e===void 0?void 0:e.href,title:(n=(r=t.data)===null||r===void 0?void 0:r.title)!==null&&n!==void 0?n:null}}function Gk(t){let e=Me({find:n=>{let r=Uk.exec(n);return!r||!cp(n,r,t.isAllowedHref)?null:dp(r)},type:t.type,getAttributes:up});return new Ht({find:e.find,handler:n=>{let r=e.handler(n);return r!==null&&n.state.tr.steps.length&&n.state.tr.setMeta("preventAutolink",!0),r}})}function Xk(t){let e=ke({find:n=>{var r,o;let i=[];for(let l of n.matchAll(Kk))cp(n,l,t.isAllowedHref)&&i.push(dp(l));let s=((r=(o=t.findPlainUrls)===null||o===void 0?void 0:o.call(t,n))!==null&&r!==void 0?r:[]).filter(l=>!i.some(a=>Jk(a,l)));return[...i,...s]},type:t.type,getAttributes:up});return new Qn({find:e.find,handler:n=>{var r;let o=e.handler(n);return o!==null&&n.state.tr.steps.length&&(!((r=n.match.data)===null||r===void 0)&&r.markdown)&&n.state.tr.setMeta("preventAutolink",!0),o}})}function Yk(t){return new $({key:new W("handlePasteLink"),props:{handlePaste:(e,n,r)=>{let{shouldAutoLink:o}=t,{state:i}=e,{selection:s}=i,{empty:l}=s;if(l)return!1;let a="";r.content.forEach(d=>{a+=d.textContent});let c=_a(a,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===a);return!a||!c||o!==void 0&&!o(c.value)?!1:t.editor.commands.setMark(t.type,{href:c.href})}}})}function Tt(t,e){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{let o=typeof r=="string"?
Line truncated
|
||||||
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Px,this.editor.getAttributes(Rh)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Je({find:Dh,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Je({find:Dh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Rh),editor:this.editor})),[t]}}),Bx=(t,e,n)=>{let{selection:r}=t;if(!r.empty)return null;let{$from:o}=r;if(!o.parent.isTextblock||o.parentOffset!==o.parent.content.size)return null;let i=-1;for(let h=o.depth;h>0;h-=1)if(o.node(h).type.name===e){i=h;break}if(i<0)return null;let s=o.node(i),l=o.index(i);if(l+1>=s.childCount)return null;let a=s.child(l+1);if(!n.includes(a.type.name))return null;let c=t.schema.nodes[e],d=!1;if(a.forEach(h=>{h.type===c&&h.childCount>1&&(d=!0)}),!d)return null;let u=t.doc.resolve(o.after()).nodeAfter;if(!u||!n.includes(u.type.name))return null;let f=[];return u.forEach(h=>{f.push(h)}),f.length===0?null:{listItemDepth:i,nestedList:u,nestedListPos:o.after(),insertPos:o.after(i),items:f}},zx=(t,e,n,r)=>{let o=Bx(t,n,r);if(!o)return!1;let{selection:i}=t,{nestedList:s,nestedListPos:l,insertPos:a,items:c}=o,d=t.tr;d.delete(l,l+s.nodeSize);let u=d.mapping.map(a);return d.insert(u,v.from(c)),d.setSelection(i.map(d.doc,d.mapping)),e&&e(d),!0},Hx=(t,e,n)=>zx(t.state,t.view.dispatch,e,n),Bh=(t,e)=>j.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>Hx(this.editor,t,e);return{Delete:n,"Mod-Delete":n}}}),zh=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],Fi="abcdefghijklmnopqrstuvwxyz",$x="[a-zA-Z]{1,2}",Hh=String.raw`\d+|[ivxlcdmIVXLCDM]+|${$x}`;function Vi(t){let e=t,n="";for(let[r,o]of zh)for(;e>=r;)n+=o,e-=r;return n}function Ha(t){return Vi(t).toUpperCase()}function $h(t){let e=t.toLowerCase(),n=0,r=0;for(;n<e.length;){let o=!1;for(let[i,s]of zh)if(e.startsWith(s,n)){r+=i,n+=s.length,o=!0;break}if(!o)return 0}return r}function Fx(t){if(!/^[ivxlcdmIVXLCDM]+$/.test(t))return!1;let e=$h(t);return e<=0?!1:(t===t.toLowerCase()?Vi(e):Ha(e))===t}function _x(t){let e=t.toLowerCase();if(e.length===1)return e.charCodeAt(0)-97+1;if(e.length===2){let n=e.charCodeAt(0)-97,r=e.charCodeAt(1)-97;return(n+1)*26+r+1}return 0}function _i(t){if(t<=26)return Fi[t-1];let e=Math.floor((t-1)/26)-1,n=(t-1)%26;return e<0?Fi[n]:Fi[e]+Fi[n]}function Wi(t){if(!(!t||/^\d+$/.test(t))){if(Fx(t))return t===t.toLowerCase()?"i":"I";if(/^[a-z]{1,2}$/.test(t))return"a";if(/^[A-Z]{1,2}$/.test(t))return"A"}}function $a(t){if(/^\d+$/.test(t))return parseInt(t,10);let e=Wi(t);if(e==="i"||e==="I")return $h(t);if(e==="a"||e==="A"){let r=_x(t);return r>0?r:1}let n=parseInt(t,10);return Number.isNaN(n)?1:n}function Vx(t,e){if(t==="numeric")return String(e);switch(t){case"a":return _i(e);case"A":return _i(e).toUpperCase();case"i":return Vi(e);case"I":return Ha(e);default:return String(e)}}function Wx(t){var e;if(t.length===0)return!1;let n=(e=Wi(t[0]))!=null?e:"numeric",r=$a(t[0]);if(r<1)return!1;for(let o=0;o<t.length;o++){let i=Vx(n,r+o);if(t[o]!==i)return!1}return!0}function jx(t){return{type:Wi(t),start:$a(t)}}function Ux(t){let{type:e,start:n}=jx(t),r={};return e&&(r.type=e),n!==1&&(r.start=n),r}function Kx(t,e,n=". "){let r=e+1;if(!t||t==="1")return`${r}${n}`;switch(t){case"a":return`${_i(r)}${n}`;case"A":return`${_i(r).toUpperCase()}${n}`;case"i":return`${Vi(r)}${n}`;case"I":return`${Ha(r)}${n}`;default:return`${r}${n}`}}function qx(t){var e,n;let r=(e=t.tokens)==null?void 0:e[0];return!!(t.text&&((n=t.tokens)==null?void 0:n.length)===1&&r?.type==="list"&&r.ordered&&r.raw===t.text)}function Jx(t,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(t)):e.parseInline([{type:"text",raw:t,text:t}])}var Fa=$.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",N(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{var n;if(t.type!=="list_item")return[];let r=(n=e.parseBlockChildren)!=null?n:e.parseChildren,o=[];if(t.tokens&&t.tokens.length>0){if(qx(t))return{type:"listItem",content:[{type:"paragraph",content:Jx(t.text||"",e)}]};if(t.tokens.some(s=>s.type==="paragraph"))o=r(t.tokens);else{let s=t.tokens[0];if(s&&s.type==="text"&&s.tokens&&s.tokens.length>0){if(o=[{type:"paragraph",content:e.parseInline(s.tokens)}],t.tokens.length>1){let a=t.tokens.slice(1),c=r(a);o.push(...c)}}else o=r(t.tokens)}}return o.lengt
Line truncated
|
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Zk,this.editor.getAttributes(hp)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=St({find:pp,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=St({find:pp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(hp),editor:this.editor})),[t]}}),eS=(t,e,n)=>{let{selection:r}=t;if(!r.empty)return null;let{$from:o}=r;if(!o.parent.isTextblock||o.parentOffset!==o.parent.content.size)return null;let i=-1;for(let h=o.depth;h>0;h-=1)if(o.node(h).type.name===e){i=h;break}if(i<0)return null;let s=o.node(i),l=o.index(i);if(l+1>=s.childCount)return null;let a=s.child(l+1);if(!n.includes(a.type.name))return null;let c=t.schema.nodes[e],d=!1;if(a.forEach(h=>{h.type===c&&h.childCount>1&&(d=!0)}),!d)return null;let u=t.doc.resolve(o.after()).nodeAfter;if(!u||!n.includes(u.type.name))return null;let f=[];return u.forEach(h=>{f.push(h)}),f.length===0?null:{listItemDepth:i,nestedList:u,nestedListPos:o.after(),insertPos:o.after(i),items:f}},tS=(t,e,n,r)=>{let o=eS(t,n,r);if(!o)return!1;let{selection:i}=t,{nestedList:s,nestedListPos:l,insertPos:a,items:c}=o,d=t.tr;d.delete(l,l+s.nodeSize);let u=d.mapping.map(a);return d.insert(u,C.from(c)),d.setSelection(i.map(d.doc,d.mapping)),e&&e(d),!0},nS=(t,e,n)=>tS(t.state,t.view.dispatch,e,n),xp=(t,e)=>G.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>nS(this.editor,t,e);return{Delete:n,"Mod-Delete":n}}}),kp=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],Ji="abcdefghijklmnopqrstuvwxyz",Sp=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function Xi(t){let e=t,n="";for(let[r,o]of kp)for(;e>=r;)n+=o,e-=r;return n}function Ja(t){return Xi(t).toUpperCase()}function Cp(t){let e=t.toLowerCase(),n=0,r=0;for(;n<e.length;){let o=!1;for(let[i,s]of kp)if(e.startsWith(s,n)){r+=i,n+=s.length,o=!0;break}if(!o)return 0}return r}function rS(t){if(!/^[ivxlcdmIVXLCDM]+$/.test(t))return!1;let e=Cp(t);return e<=0?!1:(t===t.toLowerCase()?Xi(e):Ja(e))===t}function oS(t){let e=t.toLowerCase();if(e.length===1)return e.charCodeAt(0)-97+1;if(e.length===2){let n=e.charCodeAt(0)-97,r=e.charCodeAt(1)-97;return(n+1)*26+r+1}return 0}function Gi(t){if(t<=26)return Ji[t-1];let e=Math.floor((t-1)/26)-1,n=(t-1)%26;return e<0?Ji[n]:Ji[e]+Ji[n]}function Yi(t){if(!(!t||/^\d+$/.test(t))){if(rS(t))return t===t.toLowerCase()?"i":"I";if(/^[a-z]{1,2}$/.test(t))return"a";if(/^[A-Z]{1,2}$/.test(t))return"A"}}function Ga(t){if(/^\d+$/.test(t))return parseInt(t,10);let e=Yi(t);if(e==="i"||e==="I")return Cp(t);if(e==="a"||e==="A"){let r=oS(t);return r>0?r:1}let n=parseInt(t,10);return Number.isNaN(n)?1:n}function iS(t,e){if(t==="numeric")return String(e);switch(t){case"a":return Gi(e);case"A":return Gi(e).toUpperCase();case"i":return Xi(e);case"I":return Ja(e);default:return String(e)}}function sS(t){var e;if(t.length===0)return!1;let n=(e=Yi(t[0]))!==null&&e!==void 0?e:"numeric",r=Ga(t[0]);if(r<1)return!1;for(let o=0;o<t.length;o++){let i=iS(n,r+o);if(t[o]!==i)return!1}return!0}function lS(t){return{type:Yi(t),start:Ga(t)}}function aS(t){let{type:e,start:n}=lS(t),r={};return e&&(r.type=e),n!==1&&(r.start=n),r}function cS(t,e,n=". "){let r=e+1;if(!t||t==="1")return`${r}${n}`;switch(t){case"a":return`${Gi(r)}${n}`;case"A":return`${Gi(r).toUpperCase()}${n}`;case"i":return`${Xi(r)}${n}`;case"I":return`${Ja(r)}${n}`;default:return`${r}${n}`}}function dS(t){var e,n;let r=(e=t.tokens)===null||e===void 0?void 0:e[0];return!!(t.text&&((n=t.tokens)===null||n===void 0?void 0:n.length)===1&&r?.type==="list"&&r.ordered&&r.raw===t.text)}function uS(t,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(t)):e.parseInline([{type:"text",raw:t,text:t}])}var Xa=F.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",R(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{var n;if(t.type!=="list_item")return[];let r=(n=e.parseBlockChildren)!==null&&n!==void 0?n:e.parseChildren,o=[];if(t.tokens&&t.tokens.length>0){if(dS(t))return{type:"listItem",content:[{type:"paragraph",content:uS(t.text||"",e)}]};if(t.tokens.some(i=>i.type==="paragraph"))o=r(t.tokens);else{let i=t.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(o=[{type:"paragraph",content:e.parseInline(i.tokens)}],t.tokens.length>1){let s=r(t.tokens.slice(1));o.push
Line truncated
|
||||||
`).trim(),contentLines:p,raw:g.join(`
|
`).trim(),contentLines:p,raw:g.join(`
|
||||||
`)}),r=m,n=m}return[e,r]}var sk=new RegExp(`^(${Hh})([.)])\\s+(.+)$`);function lk(t){let e=t.split(`
|
`)}),r=m,n=m}return[e,r]}var CS=new RegExp(`^(${Sp})([.)])\\s+(.+)$`);function vS(t){let e=t.split(`
|
||||||
`).filter(i=>i.trim().length>0);if(e.length===0)return null;let n=[];for(let i of e){let s=i.trim().match(sk);if(!s)return null;n.push({marker:s[1],content:s[3]})}let r=n.map(i=>i.marker);return Wx(r)?{type:"orderedList",attrs:Ux(n[0].marker),content:n.map(i=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:i.content}]}]}))}:null}function Wh(t,e,n){let r=[],o=0;for(;o<t.length;){let i=t[o];if(i.indent===e){let{paragraphLines:s,blockLines:l}=ok(i.contentLines),a=s.join(`
|
`).filter(r=>r.trim().length>0);if(e.length===0)return null;let n=[];for(let r of e){let o=r.trim().match(CS);if(!o)return null;n.push({marker:o[1],content:o[3]})}return sS(n.map(r=>r.marker))?{type:"orderedList",attrs:aS(n[0].marker),content:n.map(r=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:r.content}]}]}))}:null}function Mp(t,e,n){let r=[],o=0;for(;o<t.length;){let i=t[o];if(i.indent===e){let{paragraphLines:s,blockLines:l}=kS(i.contentLines),a=s.join(`
|
||||||
`).trim(),c=[];a&&c.push({type:"paragraph",raw:a,tokens:n.inlineTokens(a)});let d=l.join(`
|
`).trim(),c=[];a&&c.push({type:"paragraph",raw:a,tokens:n.inlineTokens(a)});let d=l.join(`
|
||||||
`).trim();if(d){let h=n.blockTokens(d);c.push(...h)}let u=o+1,f=[];for(;u<t.length&&t[u].indent>e;)f.push(t[u]),u+=1;if(f.length>0){let h=Math.min(...f.map(m=>m.indent)),p=Wh(f,h,n);c.push({type:"list",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:p,raw:f.map(m=>m.raw).join(`
|
`).trim();if(d){let h=n.blockTokens(d);c.push(...h)}let u=o+1,f=[];for(;u<t.length&&t[u].indent>e;)f.push(t[u]),u+=1;if(f.length>0){let h=Mp(f,Math.min(...f.map(p=>p.indent)),n);c.push({type:"list",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:h,raw:f.map(p=>p.raw).join(`
|
||||||
`)})}r.push({type:"list_item",raw:i.raw,tokens:c}),o=u}else o+=1}return r}function ak(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];let r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(o=>{if(o.type==="paragraph"||o.type==="list"||o.type==="blockquote"||o.type==="code")r.push(...e.parseChildren([o]));else if(o.type==="text"&&o.tokens){let i=e.parseChildren([o]);r.push({type:"paragraph",content:i})}else{let i=e.parseChildren([o]);i.length>0&&r.push(...i)}}),{type:"listItem",content:r}})}var ck="listItem",Lh="textStyle",Ih=/^(\d+)\.\s$/;function Ph(t){let e=t.match(/list-style-type\s*:\s*([^;]+)/i);if(!e)return null;switch(e[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}var Va=$.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>{let e=t.getAttribute("type");if(e)return e;let n=t.getAttribute("style");if(n){let o=Ph(n);if(o)return o}let r=t.querySelector("li");if(r){let o=r.getAttribute("style");if(o){let i=Ph(o);if(i)return i}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){let{start:e,type:n,...r}=t,o=N(this.options.HTMLAttributes,r);return e!==1&&(o.start=e),n&&n!=="1"&&(o.type=n),["ol",o,0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];let n=t.start||1,r=t.typeMarker,o=t.items?ak(t.items,e):[],i={};return n!==1&&(i.start=n),r&&(i.type=r),Object.keys(i).length>0?{type:"orderedList",attrs:i,content:o}:{type:"orderedList",content:o}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
`)})}r.push({type:"list_item",raw:i.raw,tokens:c}),o=u}else o+=1}return r}function MS(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];let r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(o=>{if(o.type==="paragraph"||o.type==="list"||o.type==="blockquote"||o.type==="code")r.push(...e.parseChildren([o]));else if(o.type==="text"&&o.tokens){let i=e.parseChildren([o]);r.push({type:"paragraph",content:i})}else{let i=e.parseChildren([o]);i.length>0&&r.push(...i)}}),{type:"listItem",content:r}})}var TS="listItem",yp="textStyle",bp=/^(\d+)\.\s$/;function wp(t){let e=t.match(/list-style-type\s*:\s*([^;]+)/i);if(!e)return null;switch(e[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}var Qa=F.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>{let e=t.getAttribute("type");if(e)return e;let n=t.getAttribute("style");if(n){let o=wp(n);if(o)return o}let r=t.querySelector("li");if(r){let o=r.getAttribute("style");if(o){let i=wp(o);if(i)return i}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){let{start:e,type:n,...r}=t,o=R(this.options.HTMLAttributes,r);return e!==1&&(o.start=e),n&&n!=="1"&&(o.type=n),["ol",o,0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];let n=t.start||1,r=t.typeMarker,o=t.items?MS(t.items,e):[],i={};return n!==1&&(i.start=n),r&&(i.type=r),Object.keys(i).length>0?{type:"orderedList",attrs:i,content:o}:{type:"orderedList",content:o}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
||||||
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(t,e,n)=>{var r,o;let i=t.split(`
|
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(t,e,n)=>{var r,o;let i=t.split(`
|
||||||
`),[s,l]=ik(i);if(s.length===0)return;let a=Wh(s,s[0].indent,n);if(a.length===0)return;let c=((r=s[0])==null?void 0:r.number)||1,d=(o=s[0])==null?void 0:o.type;return{type:"list",ordered:!0,start:c,typeMarker:d,items:a,raw:i.slice(0,l).join(`
|
`),[s,l]=SS(i);if(s.length===0)return;let a=Mp(s,s[0].indent,n);if(a.length!==0)return{type:"list",ordered:!0,start:((r=s[0])===null||r===void 0?void 0:r.number)||1,typeMarker:(o=s[0])===null||o===void 0?void 0:o.type,items:a,raw:i.slice(0,l).join(`
|
||||||
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ck,this.editor.getAttributes(Lh)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new D({props:{handlePaste:(t,e)=>{var n,r;let o=(n=e.clipboardData)==null?void 0:n.getData("text/html");if(o?.trim())return!1;let i=(r=e.clipboardData)==null?void 0:r.getData("text/plain");if(!i)return!1;let s=lk(i);if(!s)return!1;try{let l=t.state.schema.nodeFromJSON(s),a=t.state.tr.replaceSelectionWith(l);return t.dispatch(a),!0}catch{return!1}}}})]},addInputRules(){let t=(n,r)=>(!r.attrs.type||r.attrs.type==="1")&&r.childCount+r.attrs.start===+n[1],e=Je({find:Ih,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Je({find:Ih,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(Lh)}),joinPredicate:t,editor:this.editor})),[e]}}),dk=/^\s*(\[([( |x])?\])\s$/,uk=$.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{let e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",N(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{let n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){let r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;let o=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return Wn(t,e,o)},addExtensions(){return this.options.nested?[Bh(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{let o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div"),c=u=>{var f,h;l.ariaLabel=((h=(f=this.options.a11y)==null?void 0:f.checkboxLabel)==null?void 0:h.call(f,u,l.checked))||`Task item checkbox for ${u.textContent||"empty task item"}`};c(t),i.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",u=>u.preventDefault()),l.addEventListener("change",u=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}let{checked:f}=u.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{let p=n();if(typeof p!="number")return!1;let m=h.doc.nodeAt(p);return h.setNodeMarkup(p,void 0,{...m?.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,f])=>{o.setAttribute(u,f)}),o.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,i.append(l,s),o.append(i,a),Object.entries(e).forEach(([u,f])=>{o.setAttribute(u,f)});let d=new Set(Object.keys(e));return{dom:o,contentDOM:a,update:u=>{if(u.type!==this.type)return!1;o.dataset.checked=u.attrs.checked,l.checked=u.attrs.checked,c(u);let f=r.extensionManager.attributes,h=kt(u,f),p=new Set(Object.keys(h)),m=this.options.HTMLAttributes;return d.forEach(g=>{p.has(g)||(g in m?o.setAttribute(g,m[g]):o.removeAttribute(g))}),Object.entries(h).forEach(([g,y])=>{y==null?g in m?o.setAttribute(g,m[g]):o.removeAttribute(g):o.setAttribute(g,y)}),d=p,!0}}}},addInputRules(){return[Je({find:dk,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),fk=$.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",N(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChild
Line truncated
|
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(TS,this.editor.getAttributes(yp)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new $({props:{handlePaste:(t,e)=>{var n,r;let o=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/html");if(o?.trim())return!1;let i=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!i)return!1;let s=vS(i);if(!s)return!1;try{let l=t.state.schema.nodeFromJSON(s),a=t.state.tr.replaceSelectionWith(l);return t.dispatch(a),!0}catch{return!1}}}})]},addInputRules(){let t=(n,r)=>(!r.attrs.type||r.attrs.type==="1")&&r.childCount+r.attrs.start===+n[1],e=St({find:bp,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=St({find:bp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(yp)}),joinPredicate:t,editor:this.editor})),[e]}}),AS=/^\s*(\[([( |x])?\])\s$/,ES="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",OS=(t,e,n)=>{var r;return(n==null||(r=n.checkboxLabel)===null||r===void 0?void 0:r.call(n,t,e))||`Task item checkbox for ${t.textContent||"empty task item"}`},NS=F.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{let e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:t=>{var e;return(e=t.querySelector("div"))!==null&&e!==void 0?e:t}}]},renderHTML({node:t,HTMLAttributes:e}){return["li",R(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{let n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){let r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;let r=`- [${!((n=t.attrs)===null||n===void 0)&&n.checked?"x":" "}] `;return Kr(t,e,r)},addExtensions(){return this.options.nested?[xp(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{let o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div");s.style.cssText=ES;let c=u=>{let f=OS(u,u.attrs.checked,this.options.a11y);l.setAttribute("aria-label",f),s.textContent=f};c(t),i.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",u=>u.preventDefault()),l.addEventListener("change",u=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}let{checked:f}=u.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{let p=n();if(typeof p!="number")return!1;let m=h.doc.nodeAt(p);return h.setNodeMarkup(p,void 0,{...m?.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,f])=>{o.setAttribute(u,f)}),o.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,i.append(l,s),o.append(i,a),Object.entries(e).forEach(([u,f])=>{o.setAttribute(u,f)});let d=new Set(Object.keys(e));return{dom:o,contentDOM:a,update:u=>{if(u.type!==this.type)return!1;o.dataset.checked=u.attrs.checked,l.checked=u.attrs.checked,c(u);let f=r.extensionManager.attributes,h=wt(u,f),p=new Set(Object.keys(h)),m=this.options.HTMLAttributes;return d.forEach(g=>{p.has(g)||(g in m?o.setAttribute(g,m[g]):o.removeAttribute(g))}),Object.entries(h).forEach(([g,y])=>{y==null?g in m?o.setAttribute(g,m[g]):o.removeAttribute(g):o.setAttribute(g,y)}),d=p,!0}}}},addInputRules(){return[St({find:AS,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),RS=F.create({name:"taskList",addOptions()
Line truncated
|
||||||
`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;let n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){let r=i=>{let s=zr(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,a)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:a}),customNestedParser:r},n);if(s){let l={type:"taskList",raw:s.raw,items:s.items},a=i.slice(s.raw.length);return a.trim()?[l,...n.blockTokens(a)]:[l]}return n.blockTokens(i)},o=zr(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,s)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:s}),customNestedParser:r},n);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),JT=j.create({name:"listKit",addExtensions(){let t=[];return this.options.bulletList!==!1&&t.push(za.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(Fa.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(Zx.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(Va.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(uk.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(fk.configure(this.options.taskList)),t}});var Jn=(t,e,n={})=>{t.dom.closest("form")?.dispatchEvent(new CustomEvent(e,{composed:!0,cancelable:!0,detail:n}))},Wa=({files:t,acceptedTypes:e,acceptedTypesValidationMessage:n,maxSize:r,maxSizeValidationMessage:o})=>{for(let i of t){if(e&&!e.includes(i.type))return n;if(r&&i.size>+r*1024)return o}return null},ja=()=>("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)),hk=({editor:t,acceptedTypes:e,acceptedTypesValidationMessage:n,get$WireUsing:r,key:o,maxSize:i,maxSizeValidationMessage:s,statePath:l,uploadingMessage:a})=>{let c=d=>r().callSchemaComponentMethod(o,"getUploadedFileAttachmentTemporaryUrl",{attachment:d});return new D({key:new H("localFiles"),props:{handleDrop(d,u){if(!u.dataTransfer?.files.length)return!1;let f=Array.from(u.dataTransfer.files),h=Wa({files:f,acceptedTypes:e,acceptedTypesValidationMessage:n,maxSize:i,maxSizeValidationMessage:s});if(h)return d.dom.dispatchEvent(new CustomEvent("rich-editor-file-validation-message",{bubbles:!0,detail:{key:o,livewireId:r().id,validationMessage:h}})),!1;if(!f.length)return!1;Jn(d,"form-processing-started",{message:a}),u.preventDefault(),u.stopPropagation();let p=d.posAtCoords({left:u.clientX,top:u.clientY});return f.forEach((m,g)=>{t.setEditable(!1),d.dom.dispatchEvent(new CustomEvent("rich-editor-uploading-file",{bubbles:!0,detail:{key:o,livewireId:r().id}}));let y=ja();r().upload(`componentFileAttachments.${l}.${y}`,m,()=>{c(y).then(x=>{x&&(t.chain().insertContentAt(p?.pos??0,{type:"image",attrs:{id:y,src:x}}).run(),t.setEditable(!0),d.dom.dispatchEvent(new CustomEvent("rich-editor-uploaded-file",{bubbles:!0,detail:{key:o,livewireId:r().id}})),g===f.length-1&&Jn(d,"form-processing-finished"))})})}),!0},handlePaste(d,u){let f=u.clipboardData?.files?.length?Array.from(u.clipboardData.files):[],h=u.clipboardData?.getData("text")?.length>0,p=u.clipboardData?.getData("text/html")||"";if(f.length&&!h){let m=Wa({files:f,acceptedTypes:e,acceptedTypesValidationMessage:n,maxSize:i,maxSizeValidationMessage:s});return m?(d.dom.dispatchEvent(new CustomEvent("rich-editor-file-validation-message",{bubbles:!0,detail:{key:o,livewireId:r().id,validationMessage:m}})),!1):(u.preventDefault(),u.stopPropagation(),Jn(d,"form-processing-started",{message:a}),f.forEach((g,y)=>{t.setEditable(!1),d.dom.dispatchEvent(new CustomEvent("rich-editor-uploading-file",{bubbles:!0,detail:{key:o,livewireId:r().id}}));let x=ja();r().upload(`componentFileAttachments.${l}.${x}`,g,()=>{c(x).then(b=>{b&&(t.chain().insertContentAt(t.state.selection.anchor,{type:"image",attrs:{id:x,src:b}}).run(),t.setEditable(!0),d.dom.dispatchEvent(new CustomEvent("rich-editor-uploaded-file",{bubbles:!0,detail:{key:o,livewireId:r().id}})),y===f.length-1&&Jn(d,"form-processing-finished"))})})}),!0)}if(p){let g=new DOMParser().parseFromString(p,"text/html"),y=g.querySelectorAll("img[src]");if(y.length){u.stopPropagation();let{from:x,to:b}=t.state.selection;return Jn(d,"form-processing-started",{message:a}),t.setEditable(!1),d.dom.dispatchEvent(new CustomEvent("rich-editor-uploading-file",{bubbles:!
Line truncated
|
`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;let n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||e===void 0?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){let r=i=>{let s=Ur(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,a)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:a}),customNestedParser:r},n);if(s){let l={type:"taskList",raw:s.raw,items:s.items},a=i.slice(s.raw.length);return a.trim()?[l,...n.blockTokens(a)]:[l]}return n.blockTokens(i)},o=Ur(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,s)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:s}),customNestedParser:r},n);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),ET=G.create({name:"listKit",addExtensions(){let t=[];return this.options.bulletList!==!1&&t.push(qa.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(Xa.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(gS.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(Qa.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(NS.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(RS.configure(this.options.taskList)),t}});var rr=(t,e,n={})=>{t.dom.closest("form")?.dispatchEvent(new CustomEvent(e,{composed:!0,cancelable:!0,detail:n}))},Za=({files:t,acceptedTypes:e,acceptedTypesValidationMessage:n,maxSize:r,maxSizeValidationMessage:o})=>{for(let i of t){if(e&&!e.includes(i.type))return n;if(r&&i.size>+r*1024)return o}return null},ec=()=>("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)),DS=({editor:t,acceptedTypes:e,acceptedTypesValidationMessage:n,get$WireUsing:r,key:o,maxSize:i,maxSizeValidationMessage:s,statePath:l,uploadingMessage:a})=>{let c=d=>r().callSchemaComponentMethod(o,"getUploadedFileAttachmentTemporaryUrl",{attachment:d});return new $({key:new W("localFiles"),props:{handleDrop(d,u){if(!u.dataTransfer?.files.length)return!1;let f=Array.from(u.dataTransfer.files),h=Za({files:f,acceptedTypes:e,acceptedTypesValidationMessage:n,maxSize:i,maxSizeValidationMessage:s});if(h)return d.dom.dispatchEvent(new CustomEvent("rich-editor-file-validation-message",{bubbles:!0,detail:{key:o,livewireId:r().id,validationMessage:h}})),!1;if(!f.length)return!1;rr(d,"form-processing-started",{message:a}),u.preventDefault(),u.stopPropagation();let p=d.posAtCoords({left:u.clientX,top:u.clientY});return f.forEach((m,g)=>{t.setEditable(!1),d.dom.dispatchEvent(new CustomEvent("rich-editor-uploading-file",{bubbles:!0,detail:{key:o,livewireId:r().id}}));let y=ec();r().upload(`componentFileAttachments.${l}.${y}`,m,()=>{c(y).then(x=>{x&&(t.chain().insertContentAt(p?.pos??0,{type:"image",attrs:{id:y,src:x}}).run(),t.setEditable(!0),d.dom.dispatchEvent(new CustomEvent("rich-editor-uploaded-file",{bubbles:!0,detail:{key:o,livewireId:r().id}})),g===f.length-1&&rr(d,"form-processing-finished"))})})}),!0},handlePaste(d,u){let f=u.clipboardData?.files?.length?Array.from(u.clipboardData.files):[],h=u.clipboardData?.getData("text")?.length>0,p=u.clipboardData?.getData("text/html")||"";if(f.length&&!h){let m=Za({files:f,acceptedTypes:e,acceptedTypesValidationMessage:n,maxSize:i,maxSizeValidationMessage:s});return m?(d.dom.dispatchEvent(new CustomEvent("rich-editor-file-validation-message",{bubbles:!0,detail:{key:o,livewireId:r().id,validationMessage:m}})),!1):(u.preventDefault(),u.stopPropagation(),rr(d,"form-processing-started",{message:a}),f.forEach((g,y)=>{t.setEditable(!1),d.dom.dispatchEvent(new CustomEvent("rich-editor-uploading-file",{bubbles:!0,detail:{key:o,livewireId:r().id}}));let x=ec();r().upload(`componentFileAttachments.${l}.${x}`,g,()=>{c(x).then(b=>{b&&(t.chain().insertContentAt(t.state.selection.anchor,{type:"image",attrs:{id:x,src:b}}).run(),t.setEditable(!0),d.dom.dispatchEvent(new CustomEvent("rich-editor-uploaded-file",{bubbles:!0,detail:{key:o,livewireId:r().id}})),y===f.length-1&&rr(d,"form-processing-finished"))})})}),!0)}if(p){let g=new DOMParser().parseFromString(p,"text/html"),y=g.querySelectorAll("img[src]");if(y.length){u.stopPropagation();let{from:x,to:b}=t.state.selection;return rr(d,"form-processing-started",{message:a}),t.setEditable(!1),d.dom.dispatchEvent(new CustomEvent("rich-editor-uploading-fil
Line truncated
|
||||||
`);return/\s/.test(r)}):!1}function Wk(t){return()=>{let e=t.state.selection.$anchor.pos,n=t.view.coordsAtPos(e),{top:r,right:o,bottom:i,left:s}=n;try{return new DOMRect(s,r,o-s,i-r)}catch{return null}}}function jk(t,e,n,r){return n?()=>{let o=r.getState(t.state),i=o?.decorationId,s=e.dom.querySelector(`[data-decoration-id="${i}"]`);return s?.getBoundingClientRect()||null}:Wk(t)}function Uk({match:t,dismissedRange:e,state:n,transaction:r,editor:o,shouldResetDismissed:i,effectiveAllowSpaces:s}){return i?.({editor:o,state:n,range:e,match:t,transaction:r,allowSpaces:s})?!1:s?t.range.from===e.from:t.range.from===e.from&&!Vk(r)}function Kk({view:t,pluginKeyRef:e}){let n=t.state.tr.setMeta(e,{exit:!0});t.dispatch(n)}function qk({pluginKey:t,decorationTag:e,decorationClass:n,decorationContent:r,decorationEmptyClass:o,renderer:i,dispatchExit:s}){return{handleKeyDown(l,a){var c,d;let u=t.getState(l.state);return u.active?a.key==="Escape"||a.key==="Esc"?((c=i?.onKeyDown)==null||c.call(i,{view:l,event:a,range:u.range}),s(l),!0):((d=i?.onKeyDown)==null?void 0:d.call(i,{view:l,event:a,range:u.range}))||!1:!1},decorations(l){let a=t.getState(l),{active:c,range:d,decorationId:u,query:f}=a;if(!c)return null;let h=!f?.length,p=[n];return h&&p.push(o),X.create(l.doc,[ne.inline(d.from,d.to,{nodeName:e,class:p.join(" "),"data-decoration-id":u||void 0,"data-decoration-content":r})])}}}function Jk({editor:t,char:e,effectiveAllowSpaces:n,allowToIncludeChar:r,allowedPrefixes:o,startOfLine:i,findSuggestionMatch:s,allow:l,shouldShow:a,shouldKeepDismissed:c,pluginKey:d}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(u,f,h,p){let{isEditable:m}=t,{composing:g}=t.view,{selection:y}=u,{empty:x,from:b}=y,w={...f},k=u.getMeta(d);if(k&&k.exit)return w.active=!1,w.decorationId=null,w.range={from:0,to:0},w.query=null,w.text=null,w.dismissedRange=f.active?{...f.range}:f.dismissedRange,w;if(w.composing=g,u.docChanged&&w.dismissedRange!==null&&(w.dismissedRange={from:u.mapping.map(w.dismissedRange.from),to:u.mapping.map(w.dismissedRange.to)}),m&&(x||t.view.composing)){(b<f.range.from||b>f.range.to)&&!g&&!f.composing&&(w.active=!1);let C=s({char:e,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:o,startOfLine:i,$position:y.$from}),S=`id_${Math.floor(Math.random()*4294967295)}`;C&&l({editor:t,state:p,range:C.range,isActive:f.active})&&(!a||a({editor:t,range:C.range,query:C.query,text:C.text,transaction:u}))?(w.dismissedRange!==null&&!c({match:C,dismissedRange:w.dismissedRange,state:p,transaction:u})&&(w.dismissedRange=null),w.dismissedRange===null?(w.active=!0,w.decorationId=f.decorationId||S,w.range=C.range,w.query=C.query,w.text=C.text):w.active=!1):(C||(w.dismissedRange=null),w.active=!1)}else w.active=!1;return w.active||(w.decorationId=null,w.range={from:0,to:0},w.query=null,w.text=null),w}}}function Gk({editor:t,items:e}){let n=null,r=null,o=null,i=()=>{r!==null&&(clearTimeout(r),r=null),o?.(),o=null},s=c=>new Promise(d=>{o=d,r=setTimeout(()=>{r=null;let u=o;o=null,u?.()},c)}),l=()=>{n?.abort(),i(),n=null};return{abort:l,fetch:async(c,d)=>{l(),n=new AbortController;let u=n;if(d>0&&await s(d),n!==u||u.signal.aborted)return{status:"aborted"};try{let f=await e({editor:t,query:c,signal:u.signal});return n!==u||u.signal.aborted?{status:"aborted"}:{status:"resolved",items:f}}catch{return n!==u||u.signal.aborted?{status:"aborted"}:{status:"error"}}}}}function Xk({placement:t,offset:e,flip:n,floatingUi:r}){var o,i,s,l;let a=[es({mainAxis:(o=e.mainAxis)!=null?o:4,crossAxis:(i=e.crossAxis)!=null?i:0})];return n&&a.push(Vt()),(s=r?.middleware)!=null&&s.length&&a.push(...r.middleware),{placement:t,strategy:(l=r?.strategy)!=null?l:"absolute",middleware:a}}function Yk(t){if(t instanceof HTMLElement)return t;if(typeof t=="string")try{let e=document.querySelector(t);if(e)return e}catch{return document.body}return document.body}function Qk({getReferenceRect:t,contextElement:e,config:n,container:r,dismissOnOutsideClick:o,dismiss:i}){return(s,l={})=>{let a={getBoundingClientRect:()=>{var p;return(p=t())!=null?p:new DOMRect},contextElement:e},c=!1,d=!s.isConnected;d&&Yk(r).appendChild(s),l.onPosition||(s.style.visibility="hidden",s.style.width="max-content");let f=vp(a,s,()=>{Wt(a,s,{placement:n.placement,strategy:n.strategy,middleware:n.middleware}).then(({x:p,y:m,placement:g,strategy:y})=>{if(l.onPosition){l.onPosition({x:p,y:m,placement:g,strategy:y});return}Object.assign(s.style,{position:y,left:`${p}px`,top:`${m}px`}),c||(c=!0,s.style.visibility="")})},l.autoUpdate),h;return o&&(h=p=>{let m=p.target;!(m instanceof Node)||s.contains(m)||e.contains(m)||i()},document.addEventListener("pointerdown",h,!0)),()=>{f(),h&&document.removeEventListener("pointerdown",h,!0),d&&s.remove()}}}function Zk({editor:t,pluginKey:e,items:n,renderer:r,minQueryLength:o,debounce:i,initialItems:s,placement:l,offset:a,container:c,flip:d,floatingUi:u,dismissOnOutsideClick:f,command:h,clientRectFor:p,dispatchExit:m}
Line truncated
|
`);return/\s/.test(r)}):!1}function a1(t){return()=>{let e=t.state.selection.$anchor.pos,{top:n,right:r,bottom:o,left:i}=t.view.coordsAtPos(e);try{return new DOMRect(i,n,r-i,o-n)}catch{return null}}}function c1(t,e,n,r){return n?()=>{let o=r.getState(t.state),i=o?.decorationId,s=e.dom.querySelector(`[data-decoration-id="${i}"]`);return s?.getBoundingClientRect()||null}:a1(t)}function d1({match:t,dismissedRange:e,state:n,transaction:r,editor:o,shouldResetDismissed:i,effectiveAllowSpaces:s}){return i?.({editor:o,state:n,range:e,match:t,transaction:r,allowSpaces:s})?!1:s?t.range.from===e.from:t.range.from===e.from&&!l1(r)}function u1({view:t,pluginKeyRef:e}){let n=t.state.tr.setMeta(e,{exit:!0});t.dispatch(n)}function f1({pluginKey:t,decorationTag:e,decorationClass:n,decorationContent:r,decorationEmptyClass:o,renderer:i,dispatchExit:s}){return{handleKeyDown(l,a){var c;let d=t.getState(l.state);if(!d.active)return!1;if(a.key==="Escape"||a.key==="Esc"){var u;return i==null||(u=i.onKeyDown)===null||u===void 0||u.call(i,{view:l,event:a,range:d.range}),s(l),!0}return(i==null||(c=i.onKeyDown)===null||c===void 0?void 0:c.call(i,{view:l,event:a,range:d.range}))||!1},decorations(l){let{active:a,range:c,decorationId:d,query:u}=t.getState(l);if(!a)return null;let f=!u?.length,h=[n];return f&&h.push(o),K.create(l.doc,[Z.inline(c.from,c.to,{nodeName:e,class:h.join(" "),"data-decoration-id":d||void 0,"data-decoration-content":r})])}}}function h1({editor:t,char:e,effectiveAllowSpaces:n,allowToIncludeChar:r,allowedPrefixes:o,startOfLine:i,findSuggestionMatch:s,allow:l,shouldShow:a,shouldKeepDismissed:c,pluginKey:d}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(u,f,h,p){let{isEditable:m}=t,{composing:g}=t.view,{selection:y}=u,{empty:x,from:b}=y,w={...f},k=u.getMeta(d);if(k&&k.exit)return w.active=!1,w.decorationId=null,w.range={from:0,to:0},w.query=null,w.text=null,w.dismissedRange=f.active?{...f.range}:f.dismissedRange,w;if(w.composing=g,u.docChanged&&w.dismissedRange!==null&&(w.dismissedRange={from:u.mapping.map(w.dismissedRange.from),to:u.mapping.map(w.dismissedRange.to)}),m&&(x||t.view.composing)){(b<f.range.from||b>f.range.to)&&!g&&!f.composing&&(w.active=!1);let v=s({char:e,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:o,startOfLine:i,$position:y.$from}),S=`id_${Math.floor(Math.random()*4294967295)}`;v&&l({editor:t,state:p,range:v.range,isActive:f.active})&&(!a||a({editor:t,range:v.range,query:v.query,text:v.text,transaction:u}))?(w.dismissedRange!==null&&!c({match:v,dismissedRange:w.dismissedRange,state:p,transaction:u})&&(w.dismissedRange=null),w.dismissedRange===null?(w.active=!0,w.decorationId=f.decorationId||S,w.range=v.range,w.query=v.query,w.text=v.text):w.active=!1):(v||(w.dismissedRange=null),w.active=!1)}else w.active=!1;return w.active||(w.decorationId=null,w.range={from:0,to:0},w.query=null,w.text=null),w}}}function p1({editor:t,items:e}){let n=null,r=null,o=null,i=()=>{r!==null&&(clearTimeout(r),r=null),o?.(),o=null},s=c=>new Promise(d=>{o=d,r=setTimeout(()=>{r=null;let u=o;o=null,u?.()},c)}),l=()=>{n?.abort(),i(),n=null};return{abort:l,fetch:async(c,d)=>{l(),n=new AbortController;let u=n;if(d>0&&await s(d),n!==u||u.signal.aborted)return{status:"aborted"};try{let f=await e({editor:t,query:c,signal:u.signal});return n!==u||u.signal.aborted?{status:"aborted"}:{status:"resolved",items:f}}catch{return n!==u||u.signal.aborted?{status:"aborted"}:{status:"error"}}}}}function m1({placement:t,offset:e,flip:n,floatingUi:r}){var o,i,s,l;let a=[as({mainAxis:(o=e.mainAxis)!==null&&o!==void 0?o:4,crossAxis:(i=e.crossAxis)!==null&&i!==void 0?i:0})];return n&&a.push(Wt()),!(r==null||(s=r.middleware)===null||s===void 0)&&s.length&&a.push(...r.middleware),{placement:t,strategy:(l=r?.strategy)!==null&&l!==void 0?l:"absolute",middleware:a}}function g1(t){if(t instanceof HTMLElement)return t;if(typeof t=="string")try{let e=document.querySelector(t);if(e)return e}catch{return document.body}return document.body}function y1({getReferenceRect:t,contextElement:e,config:n,container:r,dismissOnOutsideClick:o,dismiss:i}){return(s,l={})=>{let a={getBoundingClientRect:()=>{var p;return(p=t())!==null&&p!==void 0?p:new DOMRect},contextElement:e},c=!1,d=!s.isConnected;d&&g1(r).appendChild(s),l.onPosition||(s.style.visibility="hidden",s.style.width="max-content");let f=sm(a,s,()=>{jt(a,s,{placement:n.placement,strategy:n.strategy,middleware:n.middleware}).then(({x:p,y:m,placement:g,strategy:y})=>{if(l.onPosition){l.onPosition({x:p,y:m,placement:g,strategy:y});return}Object.assign(s.style,{position:y,left:`${p}px`,top:`${m}px`}),c||(c=!0,s.style.visibility="")})},l.autoUpdate),h;return o&&(h=p=>{let m=p.target;!(m instanceof Node)||s.contains(m)||e.contains(m)||i()},document.addEventListener("pointerdown",h,!0)),()=>{f(),h&&document.removeEventListener("pointerdown",h,!0),d&&s.remove()}}}function b1({editor:t,pluginKey:e,items:n,renderer:r,minQueryLength:o,debounce:i,ini
Line truncated
|
||||||
`).map(e=>!e.includes("|")||!e.includes("`")?e:c1(e)).join(`
|
`).map(e=>!e.includes("|")||!e.includes("`")?e:AC(e)).join(`
|
||||||
`)}function u1(t){return(t||"").replace(/\s+/g," ").trim()}function f1(t,e,n={}){var r;let o=(r=n.cellLineSeparator)!=null?r:a1;if(!t||!t.content||t.content.length===0)return"";let i=[];t.content.forEach(m=>{let g=[];m.content&&m.content.forEach(y=>{let x="";y.content&&Array.isArray(y.content)&&y.content.length>1?x=y.content.map(S=>e.renderChildren(S)).join(o):x=y.content?e.renderChildren(y.content):"";let b=u1(x.split(o).join(`
|
`)}function OC(t){return(t||"").replace(/\s+/g," ").trim()}function NC(t,e,n={}){var r;let o=(r=n.cellLineSeparator)!==null&&r!==void 0?r:"";if(!t||!t.content||t.content.length===0)return"";let i=[];t.content.forEach(p=>{let m=[];p.content&&p.content.forEach(g=>{let y="";g.content&&Array.isArray(g.content)&&g.content.length>1?y=g.content.map(k=>e.renderChildren(k)).join(o):y=g.content?e.renderChildren(g.content):"";let x=OC(y.split(o).join(`
|
||||||
`).replace(/[ \t]*\r?\n[ \t]*/g,"<br>")),w=y.type==="tableHeader",k=YS(y.attrs);g.push({text:b,isHeader:w,align:k})}),i.push(g)});let s=i.reduce((m,g)=>Math.max(m,g.length),0);if(s===0)return"";let l=Array.from({length:s}).fill(0);i.forEach(m=>{var g;for(let y=0;y<s;y+=1){let b=(((g=m[y])==null?void 0:g.text)||"").length;b>l[y]&&(l[y]=b),l[y]<3&&(l[y]=3)}});let a=(m,g)=>m+" ".repeat(Math.max(0,g-m.length)),c=i[0],d=c.some(m=>m.isHeader),u=Array.from({length:s}).fill(null);i.forEach(m=>{var g;for(let y=0;y<s;y+=1)!u[y]&&((g=m[y])!=null&&g.align)&&(u[y]=m[y].align)});let f=`
|
`).replace(/[ \t]*\r?\n[ \t]*/g,"<br>")),b=g.type==="tableHeader",w=gC(g.attrs);m.push({text:x,isHeader:b,align:w})}),i.push(m)});let s=i.reduce((p,m)=>Math.max(p,m.length),0);if(s===0)return"";let l=Array.from({length:s}).fill(0);i.forEach(p=>{for(let g=0;g<s;g+=1){var m;let y=(((m=p[g])===null||m===void 0?void 0:m.text)||"").length;y>l[g]&&(l[g]=y),l[g]<3&&(l[g]=3)}});let a=(p,m)=>p+" ".repeat(Math.max(0,m-p.length)),c=i[0],d=c.some(p=>p.isHeader),u=Array.from({length:s}).fill(null);i.forEach(p=>{for(let g=0;g<s;g+=1){var m;!u[g]&&(!((m=p[g])===null||m===void 0)&&m.align)&&(u[g]=p[g].align)}});let f=`
|
||||||
`,h=Array.from({length:s}).map((m,g)=>d&&c[g]&&c[g].text||"");return f+=`| ${h.map((m,g)=>a(m,l[g])).join(" | ")} |
|
`,h=Array.from({length:s}).map((p,m)=>d&&c[m]&&c[m].text||"");return f+=`| ${h.map((p,m)=>a(p,l[m])).join(" | ")} |
|
||||||
`,f+=`| ${l.map((m,g)=>{let y=Math.max(3,m),x=u[g];return x==="left"?`:${"-".repeat(y)}`:x==="right"?`${"-".repeat(y)}:`:x==="center"?`:${"-".repeat(y)}:`:"-".repeat(y)}).join(" | ")} |
|
`,f+=`| ${l.map((p,m)=>{let g=Math.max(3,p),y=u[m];return y==="left"?`:${"-".repeat(g)}`:y==="right"?`${"-".repeat(g)}:`:y==="center"?`:${"-".repeat(g)}:`:"-".repeat(g)}).join(" | ")} |
|
||||||
`,(d?i.slice(1):i).forEach(m=>{f+=`| ${Array.from({length:s}).fill(0).map((g,y)=>a(m[y]&&m[y].text||"",l[y])).join(" | ")} |
|
`,(d?i.slice(1):i).forEach(p=>{f+=`| ${Array.from({length:s}).fill(0).map((m,g)=>a(p[g]&&p[g].text||"",l[g])).join(" | ")} |
|
||||||
`}),f}var h1=f1,p1=$.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:r1,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){let{colgroup:n,tableWidth:r,tableMinWidth:o}=o1(t,this.options.cellMinWidth),i=e.style;function s(){return i||(r?`width: ${r}`:`min-width: ${o}`)}let l=["table",N(this.options.HTMLAttributes,e,{style:s()}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},l]:l},parseMarkdown:(t,e)=>{let n=[],r=Array.isArray(t.align)?t.align:[];if(t.header){let o=[];t.header.forEach((i,s)=>{var l;let a=us((l=r[s])!=null?l:i.align),c=a?{align:a}:{};o.push(e.createNode("tableHeader",c,[{type:"paragraph",content:e.parseInline(i.tokens)}]))}),n.push(e.createNode("tableRow",{},o))}return t.rows&&t.rows.forEach(o=>{let i=[];o.forEach((s,l)=>{var a;let c=us((a=r[l])!=null?a:s.align),d=c?{align:c}:{};i.push(e.createNode("tableCell",d,[{type:"paragraph",content:e.parseInline(s.tokens)}]))}),n.push(e.createNode("tableRow",{},i))}),e.createNode("table",void 0,n)},renderMarkdown:(t,e)=>h1(t,e),markdownTokenizer:{name:"table",level:"block",start:t=>{let e=t.split(`
|
`}),f}var RC=F.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:SC,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){let{colgroup:n,tableWidth:r,tableMinWidth:o}=CC(t,this.options.cellMinWidth),i=e.style;function s(){return i||(r?`width: ${r}`:`min-width: ${o}`)}let l=["table",R(this.options.HTMLAttributes,e,{style:s()}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},l]:l},parseMarkdown:(t,e)=>{let n=[],r=Array.isArray(t.align)?t.align:[];if(t.header){let o=[];t.header.forEach((i,s)=>{var l;let a=bs((l=r[s])!==null&&l!==void 0?l:i.align),c=a?{align:a}:{};o.push(e.createNode("tableHeader",c,[{type:"paragraph",content:e.parseInline(i.tokens)}]))}),n.push(e.createNode("tableRow",{},o))}return t.rows&&t.rows.forEach(o=>{let i=[];o.forEach((s,l)=>{var a;let c=bs((a=r[l])!==null&&a!==void 0?a:s.align),d=c?{align:c}:{};i.push(e.createNode("tableCell",d,[{type:"paragraph",content:e.parseInline(s.tokens)}]))}),n.push(e.createNode("tableRow",{},i))}),e.createNode("table",void 0,n)},renderMarkdown:(t,e)=>NC(t,e),markdownTokenizer:{name:"table",level:"block",start:t=>{let e=t.split(`
|
||||||
`);if(e.length<2)return-1;let n=e[1];return!/^[ \t|:]*-[ \t|:-]*$/.test(n)||!n.includes("|")?-1:e[0].includes("|")?0:-1},tokenize(t,e,n){let r=t.indexOf(`
|
`);if(e.length<2)return-1;let n=e[1];return!/^[ \t|:]*-[ \t|:-]*$/.test(n)||!n.includes("|")?-1:e[0].includes("|")?0:-1},tokenize(t,e,n){let r=t.indexOf(`
|
||||||
|
|
||||||
`),o=r>=0?t.slice(0,r):t,i=o.split(`
|
`),o=r>=0?t.slice(0,r):t,i=o.split(`
|
||||||
`);if(i.length<2)return;let s=i[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(s)||!s.includes("|"))return;let l=d1(o);if(l===o)return;let c=n.blockTokens(l)[0];if(c?.type!=="table"||!c.raw)return;let d=c.raw.split(`
|
`);if(i.length<2)return;let s=i[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(s)||!s.includes("|"))return;let l=EC(o);if(l===o)return;let a=n.blockTokens(l)[0];if(a?.type!=="table"||!a.raw)return;let c=a.raw.split(`
|
||||||
`).length,u=t.split(`
|
`).length,d=t.split(`
|
||||||
`).slice(0,d).join(`
|
`).slice(0,c).join(`
|
||||||
`);return{...c,raw:u}}},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:i})=>{let s=s1(i.schema,t,e,n);if(o){let l=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(E.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>em(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>tm(t,e),deleteColumn:()=>({state:t,dispatch:e})=>nm(t,e),addRowBefore:()=>({state:t,dispatch:e})=>om(t,e),addRowAfter:()=>({state:t,dispatch:e})=>im(t,e),deleteRow:()=>({state:t,dispatch:e})=>sm(t,e),deleteTable:()=>({state:t,dispatch:e})=>cm(t,e),mergeCells:()=>({state:t,dispatch:e})=>ac(t,e),splitCell:()=>({state:t,dispatch:e})=>cc(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Zn("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Zn("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>am(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>ac(t,e)?!0:cc(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>lm(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>dc(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>dc(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&lc(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){let r=Y.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:ds,"Mod-Backspace":ds,Delete:ds,"Mod-Delete":ds}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[um({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],hm({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){let t=this.options.resizable&&this.editor.isEditable,e=this.options.View;return t||!e?null:({node:n,view:r,HTMLAttributes:o})=>{let i=N(this.options.HTMLAttributes,o);return new e(n,this.options.cellMinWidth,r,i)}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{tableRole:q(P(t,"tableRole",e))}}}),xm=j.create({name:"tableKit",addExtensions(){let t=[];return this.options.table!==!1&&t.push(p1.configure(this.options.table)),this.options.tableCell!==!1&&t.push(e1.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(t1.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(n1.configure(this.options.tableRow)),t}});var m1=$.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),km=m1;var g1=j.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{let e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).some(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),Sm=g1;var y1=ee.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",N(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){let o=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!o)return;let i=o[2].trim();return{type:"underline",raw:o[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Cm=y1;var vm=(t,e)=>{Wt({getBoundingClientRect:()=>{let{from:r,to:o}=t.state.selection,i=t.view.coo
Line truncated
|
`);return{...a,raw:d}}},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:i})=>{let s=MC(i.schema,t,e,n);if(o){let l=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(N.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>Bm(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>$m(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{let n=hn(t.selection.$from,r=>r.type.name==="table");return zm(t,e&&(r=>{n&&Qm(r,n.pos),e(r)}))},addRowBefore:()=>({state:t,dispatch:e})=>Fm(t,e),addRowAfter:()=>({state:t,dispatch:e})=>Vm(t,e),deleteRow:()=>({state:t,dispatch:e})=>{let n=hn(t.selection.$from,r=>r.type.name==="table");return Wm(t,e&&(r=>{n&&Qm(r,n.pos),e(r)}))},deleteTable:()=>({state:t,dispatch:e})=>Um(t,e),mergeCells:()=>({state:t,dispatch:e})=>bc(t,e),splitCell:()=>({state:t,dispatch:e})=>wc(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>ar("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>ar("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>_m(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>bc(t,e)?!0:wc(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>jm(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>xc(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>xc(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&yc(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){let r=X.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:ys,"Mod-Backspace":ys,Delete:ys,"Mod-Delete":ys}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[qm({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Gm({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){let t=this.options.resizable&&this.editor.isEditable,e=this.options.View;return t||!e?null:({node:n,view:r,HTMLAttributes:o})=>{let i=R(this.options.HTMLAttributes,o);return new e(n,this.options.cellMinWidth,r,i)}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{tableRole:U(L(t,"tableRole",e))}}}),rg=G.create({name:"tableKit",addExtensions(){let t=[];return this.options.table!==!1&&t.push(RC.configure(this.options.table)),this.options.tableCell!==!1&&t.push(wC.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(xC.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(kC.configure(this.options.tableRow)),t}});var DC=F.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),og=DC;var LC=G.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{let e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).some(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),ig=LC;var IC=te.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",R(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!r)return;let o=r[2].trim();return{type:"underline",raw:r[0],text:o,tokens:n.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.c
Line truncated
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
var Ht=Math.min,vt=Math.max,Wt=Math.round;var st=i=>({x:i,y:i}),Ji={left:"right",right:"left",bottom:"top",top:"bottom"};function Ce(i,t,e){return vt(i,Ht(t,e))}function Vt(i,t){return typeof i=="function"?i(t):i}function yt(i){return i.split("-")[0]}function zt(i){return i.split("-")[1]}function Le(i){return i==="x"?"y":"x"}function Ie(i){return i==="y"?"height":"width"}function ut(i){let t=i[0];return t==="t"||t==="b"?"y":"x"}function Te(i){return Le(ut(i))}function Ze(i,t,e){e===void 0&&(e=!1);let n=zt(i),o=Te(i),s=Ie(o),r=o==="x"?n===(e?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=Ft(r)),[r,Ft(r)]}function ti(i){let t=Ft(i);return[oe(i),t,oe(t)]}function oe(i){return i.includes("start")?i.replace("start","end"):i.replace("end","start")}var Je=["left","right"],Qe=["right","left"],Qi=["top","bottom"],Zi=["bottom","top"];function tn(i,t,e){switch(i){case"top":case"bottom":return e?t?Qe:Je:t?Je:Qe;case"left":case"right":return t?Qi:Zi;default:return[]}}function ei(i,t,e,n){let o=zt(i),s=tn(yt(i),e==="start",n);return o&&(s=s.map(r=>r+"-"+o),t&&(s=s.concat(s.map(oe)))),s}function Ft(i){let t=yt(i);return Ji[t]+i.slice(t.length)}function en(i){return{top:0,right:0,bottom:0,left:0,...i}}function ii(i){return typeof i!="number"?en(i):{top:i,right:i,bottom:i,left:i}}function Et(i){let{x:t,y:e,width:n,height:o}=i;return{width:n,height:o,top:e,left:t,right:t+n,bottom:e+o,x:t,y:e}}function ni(i,t,e){let{reference:n,floating:o}=i,s=ut(t),r=Te(t),a=Ie(r),l=yt(t),c=s==="y",h=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,f=n[a]/2-o[a]/2,p;switch(l){case"top":p={x:h,y:n.y-o.height};break;case"bottom":p={x:h,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-o.width,y:d};break;default:p={x:n.x,y:n.y}}switch(zt(t)){case"start":p[r]-=f*(e&&c?-1:1);break;case"end":p[r]+=f*(e&&c?-1:1);break}return p}async function oi(i,t){var e;t===void 0&&(t={});let{x:n,y:o,platform:s,rects:r,elements:a,strategy:l}=i,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Vt(t,i),g=ii(p),S=a[f?d==="floating"?"reference":"floating":d],D=Et(await s.getClippingRect({element:(e=await(s.isElement==null?void 0:s.isElement(S)))==null||e?S:S.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),w=d==="floating"?{x:n,y:o,width:r.floating.width,height:r.floating.height}:r.reference,A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),O=await(s.isElement==null?void 0:s.isElement(A))?await(s.getScale==null?void 0:s.getScale(A))||{x:1,y:1}:{x:1,y:1},_=Et(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:A,strategy:l}):w);return{top:(D.top-_.top+g.top)/O.y,bottom:(_.bottom-D.bottom+g.bottom)/O.y,left:(D.left-_.left+g.left)/O.x,right:(_.right-D.right+g.right)/O.x}}var nn=50,si=async(i,t,e)=>{let{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=e,a=r.detectOverflow?r:{...r,detectOverflow:oi},l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:i,floating:t,strategy:o}),{x:h,y:d}=ni(c,n,l),f=n,p=0,g={};for(let m=0;m<s.length;m++){let S=s[m];if(!S)continue;let{name:D,fn:w}=S,{x:A,y:O,data:_,reset:C}=await w({x:h,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:g,rects:c,platform:a,elements:{reference:i,floating:t}});h=A??h,d=O??d,g[D]={...g[D],..._},C&&p<nn&&(p++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(c=C.rects===!0?await r.getElementRects({reference:i,floating:t,strategy:o}):C.rects),{x:h,y:d}=ni(c,f,l)),m=-1)}return{x:h,y:d,placement:f,strategy:o,middlewareData:g}};var ri=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(t){var e,n;let{placement:o,middlewareData:s,rects:r,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...S}=Vt(i,t);if((e=s.arrow)!=null&&e.alignmentOffset)return{};let D=yt(o),w=ut(a),A=yt(a)===a,O=await(l.isRTL==null?void 0:l.isRTL(c.floating)),_=f||(A||!m?[Ft(a)]:ti(a)),C=g!=="none";!f&&C&&_.push(...ei(a,m,g,O));let q=[a,..._],J=await l.detectOverflow(t,S),R=[],$=((n=s.flip)==null?void 0:n.overflows)||[];if(h&&R.push(J[D]),d){let B=Ze(o,r,O);R.push(J[B[0]],J[B[1]])}if($=[...$,{placement:o,overflows:R}],!R.every(B=>B<=0)){var X,et;let B=(((X=s.flip)==null?void 0:X.index)||0)+1,Q=q[B];if(Q&&(!(d==="alignment"?w!==ut(Q):!1)||$.every(P=>ut(P.placement)===w?P.overflows[0]>0:!0)))return{data:{index:B,overflows:$},reset:{placement:Q}};let F=(et=$.filter(W=>W.overflows[0]<=0).sort((W,P)=>W.overflows[1]-P.overflows[1])[0])==null?void 0:et.placement;if(!F)switch(p){case"bestFit":{var H;let W=(H=$.filter(P=>{if(C){let V=ut(P.placement);return V===w||V==="y"}return!0}).map(P=>[P.placementLine truncated
|
var zt=Math.min,yt=Math.max,$t=Math.round;var st=i=>({x:i,y:i}),tn={left:"right",right:"left",bottom:"top",top:"bottom"};function Ce(i,t,e){return yt(i,zt(t,e))}function Kt(i,t){return typeof i=="function"?i(t):i}function wt(i){return i.split("-")[0]}function Xt(i){return i.split("-")[1]}function Le(i){return i==="x"?"y":"x"}function Ie(i){return i==="y"?"height":"width"}function ut(i){let t=i[0];return t==="t"||t==="b"?"y":"x"}function Te(i){return Le(ut(i))}function Ze(i,t,e){e===void 0&&(e=!1);let n=Xt(i),o=Te(i),s=Ie(o),r=o==="x"?n===(e?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=Vt(r)),[r,Vt(r)]}function ti(i){let t=Vt(i);return[se(i),t,se(t)]}function se(i){return i.includes("start")?i.replace("start","end"):i.replace("end","start")}var Je=["left","right"],Qe=["right","left"],en=["top","bottom"],nn=["bottom","top"];function on(i,t,e){switch(i){case"top":case"bottom":return e?t?Qe:Je:t?Je:Qe;case"left":case"right":return t?en:nn;default:return[]}}function ei(i,t,e,n){let o=Xt(i),s=on(wt(i),e==="start",n);return o&&(s=s.map(r=>r+"-"+o),t&&(s=s.concat(s.map(se)))),s}function Vt(i){let t=wt(i);return tn[t]+i.slice(t.length)}function sn(i){return{top:0,right:0,bottom:0,left:0,...i}}function ii(i){return typeof i!="number"?sn(i):{top:i,right:i,bottom:i,left:i}}function Ot(i){let{x:t,y:e,width:n,height:o}=i;return{width:n,height:o,top:e,left:t,right:t+n,bottom:e+o,x:t,y:e}}function ni(i,t,e){let{reference:n,floating:o}=i,s=ut(t),r=Te(t),a=Ie(r),l=wt(t),c=s==="y",h=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,f=n[a]/2-o[a]/2,p;switch(l){case"top":p={x:h,y:n.y-o.height};break;case"bottom":p={x:h,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-o.width,y:d};break;default:p={x:n.x,y:n.y}}switch(Xt(t)){case"start":p[r]-=f*(e&&c?-1:1);break;case"end":p[r]+=f*(e&&c?-1:1);break}return p}async function oi(i,t){var e;t===void 0&&(t={});let{x:n,y:o,platform:s,rects:r,elements:a,strategy:l}=i,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Kt(t,i),g=ii(p),S=a[f?d==="floating"?"reference":"floating":d],D=Ot(await s.getClippingRect({element:(e=await(s.isElement==null?void 0:s.isElement(S)))==null||e?S:S.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),w=d==="floating"?{x:n,y:o,width:r.floating.width,height:r.floating.height}:r.reference,A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),O=await(s.isElement==null?void 0:s.isElement(A))?await(s.getScale==null?void 0:s.getScale(A))||{x:1,y:1}:{x:1,y:1},_=Ot(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:A,strategy:l}):w);return{top:(D.top-_.top+g.top)/O.y,bottom:(_.bottom-D.bottom+g.bottom)/O.y,left:(D.left-_.left+g.left)/O.x,right:(_.right-D.right+g.right)/O.x}}var rn=50,si=async(i,t,e)=>{let{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=e,a=r.detectOverflow?r:{...r,detectOverflow:oi},l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:i,floating:t,strategy:o}),{x:h,y:d}=ni(c,n,l),f=n,p=0,g={};for(let m=0;m<s.length;m++){let S=s[m];if(!S)continue;let{name:D,fn:w}=S,{x:A,y:O,data:_,reset:C}=await w({x:h,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:g,rects:c,platform:a,elements:{reference:i,floating:t}});h=A??h,d=O??d,g[D]={...g[D],..._},C&&p<rn&&(p++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(c=C.rects===!0?await r.getElementRects({reference:i,floating:t,strategy:o}):C.rects),{x:h,y:d}=ni(c,f,l)),m=-1)}return{x:h,y:d,placement:f,strategy:o,middlewareData:g}};var ri=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(t){var e,n;let{placement:o,middlewareData:s,rects:r,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...S}=Kt(i,t);if((e=s.arrow)!=null&&e.alignmentOffset)return{};let D=wt(o),w=ut(a),A=wt(a)===a,O=await(l.isRTL==null?void 0:l.isRTL(c.floating)),_=f||(A||!m?[Vt(a)]:ti(a)),C=g!=="none";!f&&C&&_.push(...ei(a,m,g,O));let q=[a,..._],J=await l.detectOverflow(t,S),R=[],W=((n=s.flip)==null?void 0:n.overflows)||[];if(h&&R.push(J[D]),d){let N=Ze(o,r,O);R.push(J[N[0]],J[N[1]])}if(W=[...W,{placement:o,overflows:R}],!R.every(N=>N<=0)){var K,et;let N=(((K=s.flip)==null?void 0:K.index)||0)+1,Q=q[N];if(Q&&(!(d==="alignment"?w!==ut(Q):!1)||W.every(P=>ut(P.placement)===w?P.overflows[0]>0:!0)))return{data:{index:N,overflows:W},reset:{placement:Q}};let F=(et=W.filter(z=>z.overflows[0]<=0).sort((z,P)=>z.overflows[1]-P.overflows[1])[0])==null?void 0:et.placement;if(!F)switch(p){case"bestFit":{var V;let z=(V=W.filter(P=>{if(C){let X=ut(P.placement);return X===w||X==="y"}return!0}).map(P=>[P.placementLine truncated
|
||||||
/*! Bundled license information:
|
/*! Bundled license information:
|
||||||
|
|
||||||
sortablejs/modular/sortable.esm.js:
|
sortablejs/modular/sortable.esm.js:
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
(()=>{var d=()=>({isSticky:!1,width:0,resizeObserver:null,boundUpdateWidth:null,init(){let i=this.$el.parentElement;i&&(this.updateWidth(),this.resizeObserver=new ResizeObserver(()=>this.updateWidth()),this.resizeObserver.observe(i),this.boundUpdateWidth=this.updateWidth.bind(this),window.addEventListener("resize",this.boundUpdateWidth))},enableSticky(){this.isSticky=this.$el.getBoundingClientRect().top>0},disableSticky(){this.isSticky=!1},updateWidth(){let i=this.$el.parentElement;if(!i)return;let e=getComputedStyle(this.$root.querySelector(".fi-ac"));this.width=i.offsetWidth+parseInt(e.marginInlineStart,10)*-1+parseInt(e.marginInlineEnd,10)*-1},destroy(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.boundUpdateWidth&&(window.removeEventListener("resize",this.boundUpdateWidth),this.boundUpdateWidth=null)}});var u=function(i,e,n){let t=i;if(e.startsWith("/")&&(n=!0,e=e.slice(1)),n)return e;for(;e.startsWith("../");)t=t.includes(".")?t.slice(0,t.lastIndexOf(".")):null,e=e.slice(3);return["",null,void 0].includes(t)?e:["",null,void 0].includes(e)?t:`${t}.${e}`},h=i=>{let e=Alpine.findClosest(i,n=>n.__livewire);if(!e)throw"Could not find Livewire component in DOM tree.";return e.__livewire};document.addEventListener("alpine:init",()=>{window.Alpine.data("filamentSchema",({livewireId:i,schemaKey:e})=>({handleFormValidationError(n){n.detail.livewireId===i&&this.$nextTick(()=>{let t=this.$el.querySelector("[data-validation-error]");if(!t)return;let r=t;for(;r;)r.dispatchEvent(new CustomEvent("expand")),r=r.parentNode;setTimeout(()=>t.closest("[data-field-wrapper]").scrollIntoView({behavior:"smooth",block:"start",inline:"start"}),200)})},handleClientSideStateReset(n){n.detail.livewireId!==i||n.detail.schemaKey!==e||this.$nextTick(()=>{let t=this.$el.querySelectorAll("[autofocus]");for(let r of t)if(r.offsetParent!==null&&(r.focus(),document.activeElement===r))break})},isStateChanged(n,t){if(n===void 0)return!1;try{return JSON.stringify(n)!==JSON.stringify(t)}catch{return n!==t}}})),window.Alpine.data("filamentSchemaComponent",({path:i,containerPath:e,$wire:n})=>({$statePath:i,$get:(t,r)=>n.$get(u(e,t,r)),$set:(t,r,a,o=!1)=>n.$set(u(e,t,a),r,o),get $state(){return n.$get(i)}})),window.Alpine.data("filamentActionsSchemaComponent",d),Livewire.hook("commit",({component:i,commit:e,respond:n,succeed:t,fail:r})=>{t(({snapshot:a,effects:o})=>{o.dispatches?.forEach(s=>{if(!s.params?.awaitSchemaComponent)return;let l=Array.from(i.el.querySelectorAll(`[wire\\:partial="schema-component::${s.params.awaitSchemaComponent}"]`)).filter(c=>h(c)===i);if(l.length!==1){if(l.length>1)throw`Multiple schema components found with key [${s.params.awaitSchemaComponent}].`;window.addEventListener(`schema-component-${i.id}-${s.params.awaitSchemaComponent}-loaded`,()=>{window.dispatchEvent(new CustomEvent(s.name,{detail:s.params}))},{once:!0})}})})})});})();
|
(()=>{var c=()=>({isSticky:!1,width:0,resizeObserver:null,boundUpdateWidth:null,init(){let i=this.$el.parentElement;i&&(this.updateWidth(),this.resizeObserver=new ResizeObserver(()=>this.updateWidth()),this.resizeObserver.observe(i),this.boundUpdateWidth=this.updateWidth.bind(this),window.addEventListener("resize",this.boundUpdateWidth))},enableSticky(){this.isSticky=this.$el.getBoundingClientRect().top>0},disableSticky(){this.isSticky=!1},updateWidth(){let i=this.$el.parentElement;if(!i)return;let e=getComputedStyle(this.$root.querySelector(".fi-ac"));this.width=i.offsetWidth+parseInt(e.marginInlineStart,10)*-1+parseInt(e.marginInlineEnd,10)*-1},destroy(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.boundUpdateWidth&&(window.removeEventListener("resize",this.boundUpdateWidth),this.boundUpdateWidth=null)}});var u=function(i,e,n){let t=i;if(e.startsWith("/")&&(n=!0,e=e.slice(1)),n)return e;for(;e.startsWith("../");)t=t.includes(".")?t.slice(0,t.lastIndexOf(".")):null,e=e.slice(3);return["",null,void 0].includes(t)?e:["",null,void 0].includes(e)?t:`${t}.${e}`},h=i=>{let e=Alpine.findClosest(i,n=>n.__livewire);if(!e)throw"Could not find Livewire component in DOM tree.";return e.__livewire},l=!1;document.addEventListener("invalid",i=>{let e=i.target;if(!e.closest("[data-field-wrapper]")||e.offsetParent!==null&&getComputedStyle(e).visibility!=="hidden"||(i.preventDefault(),l))return;l=!0;let n=e;for(;n;)n.dispatchEvent(new CustomEvent("expand")),n=n.parentNode;requestAnimationFrame(()=>requestAnimationFrame(()=>{e.form?.reportValidity(),setTimeout(()=>l=!1,100)}))},!0);document.addEventListener("alpine:init",()=>{window.Alpine.data("filamentSchema",({livewireId:i,schemaKey:e,isLoadingDeferred:n=!1})=>({intersectionObserver:null,isLoadingDeferredSchema:!1,init(){n&&(this.intersectionObserver=new IntersectionObserver(async t=>{if(!(!t[0]?.isIntersecting||this.isLoadingDeferredSchema)){this.isLoadingDeferredSchema=!0;try{await this.$wire.loadDeferredSchema(e),this.intersectionObserver?.disconnect()}catch{}finally{this.isLoadingDeferredSchema=!1}}}),this.intersectionObserver.observe(this.$el))},destroy(){this.intersectionObserver?.disconnect()},handleFormValidationError(t){t.detail.livewireId===i&&this.$nextTick(()=>{let r=this.$el.querySelector("[data-validation-error]");if(!r)return;let s=r;for(;s;)s.dispatchEvent(new CustomEvent("expand")),s=s.parentNode;setTimeout(()=>r.closest("[data-field-wrapper]").scrollIntoView({behavior:"smooth",block:"start",inline:"start"}),200)})},handleClientSideStateReset(t){t.detail.livewireId!==i||t.detail.schemaKey!==e||this.$nextTick(()=>{let r=this.$el.querySelectorAll("[autofocus]");for(let s of r)if(s.offsetParent!==null&&(s.focus(),document.activeElement===s))break})},isStateChanged(t,r){if(t===void 0)return!1;try{return JSON.stringify(t)!==JSON.stringify(r)}catch{return t!==r}}})),window.Alpine.data("filamentSchemaComponent",({path:i,containerPath:e,$wire:n})=>({$statePath:i,$get:(t,r)=>n.$get(u(e,t,r)),$set:(t,r,s,o=!1)=>n.$set(u(e,t,s),r,o),get $state(){return n.$get(i)}})),window.Alpine.data("filamentActionsSchemaComponent",c),Livewire.hook("commit",({component:i,commit:e,respond:n,succeed:t,fail:r})=>{t(({snapshot:s,effects:o})=>{o.dispatches?.forEach(a=>{if(!a.params?.awaitSchemaComponent)return;let d=Array.from(i.el.querySelectorAll(`[wire\\:partial="schema-component::${a.params.awaitSchemaComponent}"]`)).filter(f=>h(f)===i);if(d.length!==1){if(d.length>1)throw`Multiple schema components found with key [${a.params.awaitSchemaComponent}].`;window.addEventListener(`schema-component-${i.id}-${a.params.awaitSchemaComponent}-loaded`,()=>{window.dispatchEvent(new CustomEvent(a.name,{detail:a.params}))},{once:!0})}})})})});})();
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
var Ht=Math.min,vt=Math.max,Wt=Math.round;var st=i=>({x:i,y:i}),Ji={left:"right",right:"left",bottom:"top",top:"bottom"};function Ce(i,t,e){return vt(i,Ht(t,e))}function Vt(i,t){return typeof i=="function"?i(t):i}function yt(i){return i.split("-")[0]}function zt(i){return i.split("-")[1]}function Le(i){return i==="x"?"y":"x"}function Ie(i){return i==="y"?"height":"width"}function ut(i){let t=i[0];return t==="t"||t==="b"?"y":"x"}function Te(i){return Le(ut(i))}function Ze(i,t,e){e===void 0&&(e=!1);let n=zt(i),o=Te(i),s=Ie(o),r=o==="x"?n===(e?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=Ft(r)),[r,Ft(r)]}function ti(i){let t=Ft(i);return[oe(i),t,oe(t)]}function oe(i){return i.includes("start")?i.replace("start","end"):i.replace("end","start")}var Je=["left","right"],Qe=["right","left"],Qi=["top","bottom"],Zi=["bottom","top"];function tn(i,t,e){switch(i){case"top":case"bottom":return e?t?Qe:Je:t?Je:Qe;case"left":case"right":return t?Qi:Zi;default:return[]}}function ei(i,t,e,n){let o=zt(i),s=tn(yt(i),e==="start",n);return o&&(s=s.map(r=>r+"-"+o),t&&(s=s.concat(s.map(oe)))),s}function Ft(i){let t=yt(i);return Ji[t]+i.slice(t.length)}function en(i){return{top:0,right:0,bottom:0,left:0,...i}}function ii(i){return typeof i!="number"?en(i):{top:i,right:i,bottom:i,left:i}}function Et(i){let{x:t,y:e,width:n,height:o}=i;return{width:n,height:o,top:e,left:t,right:t+n,bottom:e+o,x:t,y:e}}function ni(i,t,e){let{reference:n,floating:o}=i,s=ut(t),r=Te(t),a=Ie(r),l=yt(t),c=s==="y",h=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,f=n[a]/2-o[a]/2,p;switch(l){case"top":p={x:h,y:n.y-o.height};break;case"bottom":p={x:h,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-o.width,y:d};break;default:p={x:n.x,y:n.y}}switch(zt(t)){case"start":p[r]-=f*(e&&c?-1:1);break;case"end":p[r]+=f*(e&&c?-1:1);break}return p}async function oi(i,t){var e;t===void 0&&(t={});let{x:n,y:o,platform:s,rects:r,elements:a,strategy:l}=i,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Vt(t,i),g=ii(p),x=a[f?d==="floating"?"reference":"floating":d],D=Et(await s.getClippingRect({element:(e=await(s.isElement==null?void 0:s.isElement(x)))==null||e?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),w=d==="floating"?{x:n,y:o,width:r.floating.width,height:r.floating.height}:r.reference,A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),O=await(s.isElement==null?void 0:s.isElement(A))?await(s.getScale==null?void 0:s.getScale(A))||{x:1,y:1}:{x:1,y:1},_=Et(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:A,strategy:l}):w);return{top:(D.top-_.top+g.top)/O.y,bottom:(_.bottom-D.bottom+g.bottom)/O.y,left:(D.left-_.left+g.left)/O.x,right:(_.right-D.right+g.right)/O.x}}var nn=50,si=async(i,t,e)=>{let{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=e,a=r.detectOverflow?r:{...r,detectOverflow:oi},l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:i,floating:t,strategy:o}),{x:h,y:d}=ni(c,n,l),f=n,p=0,g={};for(let m=0;m<s.length;m++){let x=s[m];if(!x)continue;let{name:D,fn:w}=x,{x:A,y:O,data:_,reset:C}=await w({x:h,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:g,rects:c,platform:a,elements:{reference:i,floating:t}});h=A??h,d=O??d,g[D]={...g[D],..._},C&&p<nn&&(p++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(c=C.rects===!0?await r.getElementRects({reference:i,floating:t,strategy:o}):C.rects),{x:h,y:d}=ni(c,f,l)),m=-1)}return{x:h,y:d,placement:f,strategy:o,middlewareData:g}};var ri=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(t){var e,n;let{placement:o,middlewareData:s,rects:r,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...x}=Vt(i,t);if((e=s.arrow)!=null&&e.alignmentOffset)return{};let D=yt(o),w=ut(a),A=yt(a)===a,O=await(l.isRTL==null?void 0:l.isRTL(c.floating)),_=f||(A||!m?[Ft(a)]:ti(a)),C=g!=="none";!f&&C&&_.push(...ei(a,m,g,O));let J=[a,..._],Q=await l.detectOverflow(t,x),R=[],z=((n=s.flip)==null?void 0:n.overflows)||[];if(h&&R.push(Q[D]),d){let P=Ze(o,r,O);R.push(Q[P[0]],Q[P[1]])}if(z=[...z,{placement:o,overflows:R}],!R.every(P=>P<=0)){var Y,N;let P=(((Y=s.flip)==null?void 0:Y.index)||0)+1,et=J[P];if(et&&(!(d==="alignment"?w!==ut(et):!1)||z.every(k=>ut(k.placement)===w?k.overflows[0]>0:!0)))return{data:{index:P,overflows:z},reset:{placement:et}};let W=(N=z.filter($=>$.overflows[0]<=0).sort(($,k)=>$.overflows[1]-k.overflows[1])[0])==null?void 0:N.placement;if(!W)switch(p){case"bestFit":{var H;let $=(H=z.filter(k=>{if(C){let K=ut(k.placement);return K===w||K==="y"}return!0}).map(k=>[k.placemenLine truncated
|
var Vt=Math.min,yt=Math.max,$t=Math.round;var st=i=>({x:i,y:i}),tn={left:"right",right:"left",bottom:"top",top:"bottom"};function Ce(i,t,e){return yt(i,Vt(t,e))}function zt(i,t){return typeof i=="function"?i(t):i}function wt(i){return i.split("-")[0]}function Kt(i){return i.split("-")[1]}function Le(i){return i==="x"?"y":"x"}function Ie(i){return i==="y"?"height":"width"}function ut(i){let t=i[0];return t==="t"||t==="b"?"y":"x"}function Te(i){return Le(ut(i))}function Ze(i,t,e){e===void 0&&(e=!1);let n=Kt(i),o=Te(i),s=Ie(o),r=o==="x"?n===(e?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=Wt(r)),[r,Wt(r)]}function ti(i){let t=Wt(i);return[oe(i),t,oe(t)]}function oe(i){return i.includes("start")?i.replace("start","end"):i.replace("end","start")}var Je=["left","right"],Qe=["right","left"],en=["top","bottom"],nn=["bottom","top"];function on(i,t,e){switch(i){case"top":case"bottom":return e?t?Qe:Je:t?Je:Qe;case"left":case"right":return t?en:nn;default:return[]}}function ei(i,t,e,n){let o=Kt(i),s=on(wt(i),e==="start",n);return o&&(s=s.map(r=>r+"-"+o),t&&(s=s.concat(s.map(oe)))),s}function Wt(i){let t=wt(i);return tn[t]+i.slice(t.length)}function sn(i){return{top:0,right:0,bottom:0,left:0,...i}}function ii(i){return typeof i!="number"?sn(i):{top:i,right:i,bottom:i,left:i}}function Ot(i){let{x:t,y:e,width:n,height:o}=i;return{width:n,height:o,top:e,left:t,right:t+n,bottom:e+o,x:t,y:e}}function ni(i,t,e){let{reference:n,floating:o}=i,s=ut(t),r=Te(t),a=Ie(r),l=wt(t),c=s==="y",h=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,f=n[a]/2-o[a]/2,p;switch(l){case"top":p={x:h,y:n.y-o.height};break;case"bottom":p={x:h,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-o.width,y:d};break;default:p={x:n.x,y:n.y}}switch(Kt(t)){case"start":p[r]-=f*(e&&c?-1:1);break;case"end":p[r]+=f*(e&&c?-1:1);break}return p}async function oi(i,t){var e;t===void 0&&(t={});let{x:n,y:o,platform:s,rects:r,elements:a,strategy:l}=i,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=zt(t,i),g=ii(p),x=a[f?d==="floating"?"reference":"floating":d],D=Ot(await s.getClippingRect({element:(e=await(s.isElement==null?void 0:s.isElement(x)))==null||e?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),w=d==="floating"?{x:n,y:o,width:r.floating.width,height:r.floating.height}:r.reference,A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),O=await(s.isElement==null?void 0:s.isElement(A))?await(s.getScale==null?void 0:s.getScale(A))||{x:1,y:1}:{x:1,y:1},N=Ot(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:A,strategy:l}):w);return{top:(D.top-N.top+g.top)/O.y,bottom:(N.bottom-D.bottom+g.bottom)/O.y,left:(D.left-N.left+g.left)/O.x,right:(N.right-D.right+g.right)/O.x}}var rn=50,si=async(i,t,e)=>{let{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=e,a=r.detectOverflow?r:{...r,detectOverflow:oi},l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:i,floating:t,strategy:o}),{x:h,y:d}=ni(c,n,l),f=n,p=0,g={};for(let m=0;m<s.length;m++){let x=s[m];if(!x)continue;let{name:D,fn:w}=x,{x:A,y:O,data:N,reset:L}=await w({x:h,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:g,rects:c,platform:a,elements:{reference:i,floating:t}});h=A??h,d=O??d,g[D]={...g[D],...N},L&&p<rn&&(p++,typeof L=="object"&&(L.placement&&(f=L.placement),L.rects&&(c=L.rects===!0?await r.getElementRects({reference:i,floating:t,strategy:o}):L.rects),{x:h,y:d}=ni(c,f,l)),m=-1)}return{x:h,y:d,placement:f,strategy:o,middlewareData:g}};var ri=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(t){var e,n;let{placement:o,middlewareData:s,rects:r,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...x}=zt(i,t);if((e=s.arrow)!=null&&e.alignmentOffset)return{};let D=wt(o),w=ut(a),A=wt(a)===a,O=await(l.isRTL==null?void 0:l.isRTL(c.floating)),N=f||(A||!m?[Wt(a)]:ti(a)),L=g!=="none";!f&&L&&N.push(...ei(a,m,g,O));let J=[a,...N],Q=await l.detectOverflow(t,x),M=[],W=((n=s.flip)==null?void 0:n.overflows)||[];if(h&&M.push(Q[D]),d){let C=Ze(o,r,O);M.push(Q[C[0]],Q[C[1]])}if(W=[...W,{placement:o,overflows:M}],!M.every(C=>C<=0)){var z,et;let C=(((z=s.flip)==null?void 0:z.index)||0)+1,K=J[C];if(K&&(!(d==="alignment"?w!==ut(K):!1)||W.every(k=>ut(k.placement)===w?k.overflows[0]>0:!0)))return{data:{index:C,overflows:W},reset:{placement:K}};let P=(et=W.filter(X=>X.overflows[0]<=0).sort((X,k)=>X.overflows[1]-k.overflows[1])[0])==null?void 0:et.placement;if(!P)switch(p){case"bestFit":{var V;let X=(V=W.filter(k=>{if(L){let U=ut(k.placement);return U===w||U==="y"}return!0}).map(k=>[k.placementLine truncated
|
||||||
/*! Bundled license information:
|
/*! Bundled license information:
|
||||||
|
|
||||||
sortablejs/modular/sortable.esm.js:
|
sortablejs/modular/sortable.esm.js:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
var Rc=Object.defineProperty;var Nc=(s,t,e)=>t in s?Rc(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var S=(s,t,e)=>Nc(s,typeof t!="symbol"?t+"":t,e);function ps(s){return s+.5|0}var Jt=(s,t,e)=>Math.max(Math.min(s,e),t);function gs(s){return Jt(ps(s*2.55),0,255)}function Kt(s){return Jt(ps(s*255),0,255)}function Wt(s){return Jt(ps(s/2.55)/100,0,1)}function ro(s){return Jt(ps(s*100),0,100)}var bt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},kn=[..."0123456789ABCDEF"],zc=s=>kn[s&15],Vc=s=>kn[(s&240)>>4]+kn[s&15],ni=s=>(s&240)>>4===(s&15),Wc=s=>ni(s.r)&&ni(s.g)&&ni(s.b)&&ni(s.a);function Bc(s){var t=s.length,e;return s[0]==="#"&&(t===4||t===5?e={r:255&bt[s[1]]*17,g:255&bt[s[2]]*17,b:255&bt[s[3]]*17,a:t===5?bt[s[4]]*17:255}:(t===7||t===9)&&(e={r:bt[s[1]]<<4|bt[s[2]],g:bt[s[3]]<<4|bt[s[4]],b:bt[s[5]]<<4|bt[s[6]],a:t===9?bt[s[7]]<<4|bt[s[8]]:255})),e}var Hc=(s,t)=>s<255?t(s):"";function $c(s){var t=Wc(s)?zc:Vc;return s?"#"+t(s.r)+t(s.g)+t(s.b)+Hc(s.a,t):void 0}var jc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function co(s,t,e){let i=t*Math.min(e,1-e),n=(r,o=(r+s/30)%12)=>e-i*Math.max(Math.min(o-3,9-o,1),-1);return[n(0),n(8),n(4)]}function Uc(s,t,e){let i=(n,r=(n+s/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function Yc(s,t,e){let i=co(s,1,.5),n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)i[n]*=1-t-e,i[n]+=t;return i}function Zc(s,t,e,i,n){return s===n?(t-e)/i+(t<e?6:0):t===n?(e-s)/i+2:(s-t)/i+4}function vn(s){let e=s.r/255,i=s.g/255,n=s.b/255,r=Math.max(e,i,n),o=Math.min(e,i,n),a=(r+o)/2,l,c,h;return r!==o&&(h=r-o,c=a>.5?h/(2-r-o):h/(r+o),l=Zc(e,i,n,h,r),l=l*60+.5),[l|0,c||0,a]}function Sn(s,t,e,i){return(Array.isArray(t)?s(t[0],t[1],t[2]):s(t,e,i)).map(Kt)}function Mn(s,t,e){return Sn(co,s,t,e)}function qc(s,t,e){return Sn(Yc,s,t,e)}function Gc(s,t,e){return Sn(Uc,s,t,e)}function ho(s){return(s%360+360)%360}function Xc(s){let t=jc.exec(s),e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?gs(+t[5]):Kt(+t[5]));let n=ho(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=qc(n,r,o):t[1]==="hsv"?i=Gc(n,r,o):i=Mn(n,r,o),{r:i[0],g:i[1],b:i[2],a:e}}function Jc(s,t){var e=vn(s);e[0]=ho(e[0]+t),e=Mn(e),s.r=e[0],s.g=e[1],s.b=e[2]}function Kc(s){if(!s)return;let t=vn(s),e=t[0],i=ro(t[1]),n=ro(t[2]);return s.a<255?`hsla(${e}, ${i}%, ${n}%, ${Wt(s.a)})`:`hsl(${e}, ${i}%, ${n}%)`}var oo={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},ao={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};functionLine truncated
|
var Nc=Object.defineProperty;var zc=(s,t,e)=>t in s?Nc(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var S=(s,t,e)=>zc(s,typeof t!="symbol"?t+"":t,e);function ps(s){return s+.5|0}var Jt=(s,t,e)=>Math.max(Math.min(s,e),t);function gs(s){return Jt(ps(s*2.55),0,255)}function Kt(s){return Jt(ps(s*255),0,255)}function Wt(s){return Jt(ps(s/2.55)/100,0,1)}function oo(s){return Jt(ps(s*100),0,100)}var bt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},kn=[..."0123456789ABCDEF"],Vc=s=>kn[s&15],Wc=s=>kn[(s&240)>>4]+kn[s&15],ni=s=>(s&240)>>4===(s&15),Bc=s=>ni(s.r)&&ni(s.g)&&ni(s.b)&&ni(s.a);function Hc(s){var t=s.length,e;return s[0]==="#"&&(t===4||t===5?e={r:255&bt[s[1]]*17,g:255&bt[s[2]]*17,b:255&bt[s[3]]*17,a:t===5?bt[s[4]]*17:255}:(t===7||t===9)&&(e={r:bt[s[1]]<<4|bt[s[2]],g:bt[s[3]]<<4|bt[s[4]],b:bt[s[5]]<<4|bt[s[6]],a:t===9?bt[s[7]]<<4|bt[s[8]]:255})),e}var $c=(s,t)=>s<255?t(s):"";function jc(s){var t=Bc(s)?Vc:Wc;return s?"#"+t(s.r)+t(s.g)+t(s.b)+$c(s.a,t):void 0}var Uc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ho(s,t,e){let i=t*Math.min(e,1-e),n=(r,o=(r+s/30)%12)=>e-i*Math.max(Math.min(o-3,9-o,1),-1);return[n(0),n(8),n(4)]}function Yc(s,t,e){let i=(n,r=(n+s/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function Zc(s,t,e){let i=ho(s,1,.5),n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)i[n]*=1-t-e,i[n]+=t;return i}function qc(s,t,e,i,n){return s===n?(t-e)/i+(t<e?6:0):t===n?(e-s)/i+2:(s-t)/i+4}function vn(s){let e=s.r/255,i=s.g/255,n=s.b/255,r=Math.max(e,i,n),o=Math.min(e,i,n),a=(r+o)/2,l,c,h;return r!==o&&(h=r-o,c=a>.5?h/(2-r-o):h/(r+o),l=qc(e,i,n,h,r),l=l*60+.5),[l|0,c||0,a]}function Sn(s,t,e,i){return(Array.isArray(t)?s(t[0],t[1],t[2]):s(t,e,i)).map(Kt)}function Mn(s,t,e){return Sn(ho,s,t,e)}function Gc(s,t,e){return Sn(Zc,s,t,e)}function Xc(s,t,e){return Sn(Yc,s,t,e)}function uo(s){return(s%360+360)%360}function Jc(s){let t=Uc.exec(s),e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?gs(+t[5]):Kt(+t[5]));let n=uo(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=Gc(n,r,o):t[1]==="hsv"?i=Xc(n,r,o):i=Mn(n,r,o),{r:i[0],g:i[1],b:i[2],a:e}}function Kc(s,t){var e=vn(s);e[0]=uo(e[0]+t),e=Mn(e),s.r=e[0],s.g=e[1],s.b=e[2]}function Qc(s){if(!s)return;let t=vn(s),e=t[0],i=oo(t[1]),n=oo(t[2]);return s.a<255?`hsla(${e}, ${i}%, ${n}%, ${Wt(s.a)})`:`hsl(${e}, ${i}%, ${n}%)`}var ao={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},lo={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};functionLine truncated
|
||||||
`)>-1?s.split(`
|
`)>-1?s.split(`
|
||||||
`):s}function Of(s,t){let{element:e,datasetIndex:i,index:n}=t,r=s.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(n);return{chart:s,label:o,parsed:r.getParsed(n),raw:s.data.datasets[i].data[n],formattedValue:a,dataset:r.getDataset(),dataIndex:n,datasetIndex:i,element:e}}function Ma(s,t){let e=s.chart.ctx,{body:i,footer:n,title:r}=s,{boxWidth:o,boxHeight:a}=t,l=X(t.bodyFont),c=X(t.titleFont),h=X(t.footerFont),u=r.length,d=n.length,f=i.length,g=st(t.padding),m=g.height,p=0,b=i.reduce((w,x)=>w+x.before.length+x.lines.length+x.after.length,0);if(b+=s.beforeBody.length+s.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){let w=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*w+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}d&&(m+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let y=0,_=function(w){p=Math.max(p,e.measureText(w).width+y)};return e.save(),e.font=c.string,N(s.title,_),e.font=l.string,N(s.beforeBody.concat(s.afterBody),_),y=t.displayColors?o+2+t.boxPadding:0,N(i,w=>{N(w.before,_),N(w.lines,_),N(w.after,_)}),y=0,e.font=h.string,N(s.footer,_),e.restore(),p+=g.width,{width:p,height:m}}function Df(s,t){let{y:e,height:i}=t;return e<i/2?"top":e>s.height-i/2?"bottom":"center"}function Cf(s,t,e,i){let{x:n,width:r}=i,o=e.caretSize+e.caretPadding;if(s==="left"&&n+r+o>t.width||s==="right"&&n-r-o<0)return!0}function Pf(s,t,e,i){let{x:n,width:r}=e,{width:o,chartArea:{left:a,right:l}}=s,c="center";return i==="center"?c=n<=(a+l)/2?"left":"right":n<=r/2?c="left":n>=o-r/2&&(c="right"),Cf(c,s,t,e)&&(c="center"),c}function Ta(s,t,e){let i=e.yAlign||t.yAlign||Df(s,e);return{xAlign:e.xAlign||t.xAlign||Pf(s,t,e,i),yAlign:i}}function Af(s,t){let{x:e,width:i}=s;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function If(s,t,e){let{y:i,height:n}=s;return t==="top"?i+=e:t==="bottom"?i-=n+e:i-=n/2,i}function Oa(s,t,e,i){let{caretSize:n,caretPadding:r,cornerRadius:o}=s,{xAlign:a,yAlign:l}=e,c=n+r,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:f}=jt(o),g=Af(t,a),m=If(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,d)+n:a==="right"&&(g+=Math.max(u,f)+n),{x:K(g,0,i.width-t.width),y:K(m,0,i.height-t.height)}}function $i(s,t,e){let i=st(e.padding);return t==="center"?s.x+s.width/2:t==="right"?s.x+s.width-i.right:s.x+i.left}function Da(s){return Rt([],Zt(s))}function Ef(s,t,e){return Ft(s,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Ca(s,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?s.override(e):s}var nl={beforeTitle:Ot,title(s){if(s.length>0){let t=s[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Ot,beforeBody:Ot,beforeLabel:Ot,label(s){if(this&&this.options&&this.options.mode==="dataset")return s.label+": "+s.formattedValue||s.formattedValue;let t=s.dataset.label||"";t&&(t+=": ");let e=s.formattedValue;return I(e)||(t+=e),t},labelColor(s){let e=s.chart.getDatasetMeta(s.datasetIndex).controller.getStyle(s.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(s){let e=s.chart.getDatasetMeta(s.datasetIndex).controller.getStyle(s.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Ot,afterBody:Ot,beforeFooter:Ot,footer:Ot,afterFooter:Ot};function lt(s,t,e,i){let n=s[t].call(e,i);return typeof n>"u"?nl[t].call(e,i):n}var $s=class extends ft{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,r=new Zi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Ef(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){let{callbacks:i}=e,n=lt(i,"beforeTitle",this,t),r=lt(i,"title",this,t),o=lt(i,"afterTitle",this,t),a=[];return a=Rt(a,Zt(n)),a=Rt(a,Zt(r)),a=Rt(a,Zt(o)),a}getBeforeBody(t,e){return Da(lt(e.callbacks,"beforeBody",this,t))}getBody(t,e){let{callbacks:i}=e,n=[];return N(t
Line truncated
|
`):s}function Df(s,t){let{element:e,datasetIndex:i,index:n}=t,r=s.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(n);return{chart:s,label:o,parsed:r.getParsed(n),raw:s.data.datasets[i].data[n],formattedValue:a,dataset:r.getDataset(),dataIndex:n,datasetIndex:i,element:e}}function Ta(s,t){let e=s.chart.ctx,{body:i,footer:n,title:r}=s,{boxWidth:o,boxHeight:a}=t,l=X(t.bodyFont),c=X(t.titleFont),h=X(t.footerFont),u=r.length,d=n.length,f=i.length,g=st(t.padding),m=g.height,p=0,b=i.reduce((w,x)=>w+x.before.length+x.lines.length+x.after.length,0);if(b+=s.beforeBody.length+s.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){let w=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*w+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}d&&(m+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let y=0,_=function(w){p=Math.max(p,e.measureText(w).width+y)};return e.save(),e.font=c.string,N(s.title,_),e.font=l.string,N(s.beforeBody.concat(s.afterBody),_),y=t.displayColors?o+2+t.boxPadding:0,N(i,w=>{N(w.before,_),N(w.lines,_),N(w.after,_)}),y=0,e.font=h.string,N(s.footer,_),e.restore(),p+=g.width,{width:p,height:m}}function Cf(s,t){let{y:e,height:i}=t;return e<i/2?"top":e>s.height-i/2?"bottom":"center"}function Pf(s,t,e,i){let{x:n,width:r}=i,o=e.caretSize+e.caretPadding;if(s==="left"&&n+r+o>t.width||s==="right"&&n-r-o<0)return!0}function Af(s,t,e,i){let{x:n,width:r}=e,{width:o,chartArea:{left:a,right:l}}=s,c="center";return i==="center"?c=n<=(a+l)/2?"left":"right":n<=r/2?c="left":n>=o-r/2&&(c="right"),Pf(c,s,t,e)&&(c="center"),c}function Oa(s,t,e){let i=e.yAlign||t.yAlign||Cf(s,e);return{xAlign:e.xAlign||t.xAlign||Af(s,t,e,i),yAlign:i}}function Ef(s,t){let{x:e,width:i}=s;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function If(s,t,e){let{y:i,height:n}=s;return t==="top"?i+=e:t==="bottom"?i-=n+e:i-=n/2,i}function Da(s,t,e,i){let{caretSize:n,caretPadding:r,cornerRadius:o}=s,{xAlign:a,yAlign:l}=e,c=n+r,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:f}=jt(o),g=Ef(t,a),m=If(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,d)+n:a==="right"&&(g+=Math.max(u,f)+n),{x:K(g,0,i.width-t.width),y:K(m,0,i.height-t.height)}}function $i(s,t,e){let i=st(e.padding);return t==="center"?s.x+s.width/2:t==="right"?s.x+s.width-i.right:s.x+i.left}function Ca(s){return Rt([],Zt(s))}function Lf(s,t,e){return Ft(s,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Pa(s,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?s.override(e):s}var rl={beforeTitle:Ot,title(s){if(s.length>0){let t=s[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Ot,beforeBody:Ot,beforeLabel:Ot,label(s){if(this&&this.options&&this.options.mode==="dataset")return s.label+": "+s.formattedValue||s.formattedValue;let t=s.dataset.label||"";t&&(t+=": ");let e=s.formattedValue;return E(e)||(t+=e),t},labelColor(s){let e=s.chart.getDatasetMeta(s.datasetIndex).controller.getStyle(s.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(s){let e=s.chart.getDatasetMeta(s.datasetIndex).controller.getStyle(s.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Ot,afterBody:Ot,beforeFooter:Ot,footer:Ot,afterFooter:Ot};function lt(s,t,e,i){let n=s[t].call(e,i);return typeof n>"u"?rl[t].call(e,i):n}var $s=class extends ft{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,r=new Zi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Lf(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){let{callbacks:i}=e,n=lt(i,"beforeTitle",this,t),r=lt(i,"title",this,t),o=lt(i,"afterTitle",this,t),a=[];return a=Rt(a,Zt(n)),a=Rt(a,Zt(r)),a=Rt(a,Zt(o)),a}getBeforeBody(t,e){return Ca(lt(e.callbacks,"beforeBody",this,t))}getBody(t,e){let{callbacks:i}=e,n=[];return N(t
Line truncated
|
||||||
/*! Bundled license information:
|
/*! Bundled license information:
|
||||||
|
|
||||||
@kurkle/color/dist/color.esm.js:
|
@kurkle/color/dist/color.esm.js:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var Zn=Object.defineProperty;var Qn=(i,t,e)=>t in i?Zn(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var v=(i,t,e)=>Qn(i,typeof t!="symbol"?t+"":t,e);function qt(i){return i+.5|0}var rt=(i,t,e)=>Math.max(Math.min(i,e),t);function Xt(i){return rt(qt(i*2.55),0,255)}function lt(i){return rt(qt(i*255),0,255)}function et(i){return rt(qt(i/2.55)/100,0,1)}function qi(i){return rt(qt(i*100),0,100)}var K={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ge=[..."0123456789ABCDEF"],to=i=>Ge[i&15],eo=i=>Ge[(i&240)>>4]+Ge[i&15],pe=i=>(i&240)>>4===(i&15),io=i=>pe(i.r)&&pe(i.g)&&pe(i.b)&&pe(i.a);function so(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&K[i[1]]*17,g:255&K[i[2]]*17,b:255&K[i[3]]*17,a:t===5?K[i[4]]*17:255}:(t===7||t===9)&&(e={r:K[i[1]]<<4|K[i[2]],g:K[i[3]]<<4|K[i[4]],b:K[i[5]]<<4|K[i[6]],a:t===9?K[i[7]]<<4|K[i[8]]:255})),e}var no=(i,t)=>i<255?t(i):"";function oo(i){var t=io(i)?to:eo;return i?"#"+t(i.r)+t(i.g)+t(i.b)+no(i.a,t):void 0}var ao=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Qi(i,t,e){let s=t*Math.min(e,1-e),n=(o,a=(o+i/30)%12)=>e-s*Math.max(Math.min(a-3,9-a,1),-1);return[n(0),n(8),n(4)]}function ro(i,t,e){let s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function lo(i,t,e){let s=Qi(i,1,.5),n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function co(i,t,e,s,n){return i===n?(t-e)/s+(t<e?6:0):t===n?(e-i)/s+2:(i-t)/s+4}function Je(i){let e=i.r/255,s=i.g/255,n=i.b/255,o=Math.max(e,s,n),a=Math.min(e,s,n),r=(o+a)/2,l,c,h;return o!==a&&(h=o-a,c=r>.5?h/(2-o-a):h/(o+a),l=co(e,s,n,h,o),l=l*60+.5),[l|0,c||0,r]}function Ze(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(lt)}function Qe(i,t,e){return Ze(Qi,i,t,e)}function ho(i,t,e){return Ze(lo,i,t,e)}function uo(i,t,e){return Ze(ro,i,t,e)}function ts(i){return(i%360+360)%360}function fo(i){let t=ao.exec(i),e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Xt(+t[5]):lt(+t[5]));let n=ts(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?s=ho(n,o,a):t[1]==="hsv"?s=uo(n,o,a):s=Qe(n,o,a),{r:s[0],g:s[1],b:s[2],a:e}}function go(i,t){var e=Je(i);e[0]=ts(e[0]+t),e=Qe(e),i.r=e[0],i.g=e[1],i.b=e[2]}function po(i){if(!i)return;let t=Je(i),e=t[0],s=qi(t[1]),n=qi(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${et(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}var Gi={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Ji={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function mo(){let i={Line truncated
|
var Qn=Object.defineProperty;var to=(i,t,e)=>t in i?Qn(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var v=(i,t,e)=>to(i,typeof t!="symbol"?t+"":t,e);function qt(i){return i+.5|0}var rt=(i,t,e)=>Math.max(Math.min(i,e),t);function Xt(i){return rt(qt(i*2.55),0,255)}function lt(i){return rt(qt(i*255),0,255)}function et(i){return rt(qt(i/2.55)/100,0,1)}function Gi(i){return rt(qt(i*100),0,100)}var K={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ge=[..."0123456789ABCDEF"],eo=i=>Ge[i&15],io=i=>Ge[(i&240)>>4]+Ge[i&15],pe=i=>(i&240)>>4===(i&15),so=i=>pe(i.r)&&pe(i.g)&&pe(i.b)&&pe(i.a);function no(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&K[i[1]]*17,g:255&K[i[2]]*17,b:255&K[i[3]]*17,a:t===5?K[i[4]]*17:255}:(t===7||t===9)&&(e={r:K[i[1]]<<4|K[i[2]],g:K[i[3]]<<4|K[i[4]],b:K[i[5]]<<4|K[i[6]],a:t===9?K[i[7]]<<4|K[i[8]]:255})),e}var oo=(i,t)=>i<255?t(i):"";function ao(i){var t=so(i)?eo:io;return i?"#"+t(i.r)+t(i.g)+t(i.b)+oo(i.a,t):void 0}var ro=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ts(i,t,e){let s=t*Math.min(e,1-e),n=(o,a=(o+i/30)%12)=>e-s*Math.max(Math.min(a-3,9-a,1),-1);return[n(0),n(8),n(4)]}function lo(i,t,e){let s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function co(i,t,e){let s=ts(i,1,.5),n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function ho(i,t,e,s,n){return i===n?(t-e)/s+(t<e?6:0):t===n?(e-i)/s+2:(i-t)/s+4}function Je(i){let e=i.r/255,s=i.g/255,n=i.b/255,o=Math.max(e,s,n),a=Math.min(e,s,n),r=(o+a)/2,l,c,h;return o!==a&&(h=o-a,c=r>.5?h/(2-o-a):h/(o+a),l=ho(e,s,n,h,o),l=l*60+.5),[l|0,c||0,r]}function Ze(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(lt)}function Qe(i,t,e){return Ze(ts,i,t,e)}function uo(i,t,e){return Ze(co,i,t,e)}function fo(i,t,e){return Ze(lo,i,t,e)}function es(i){return(i%360+360)%360}function go(i){let t=ro.exec(i),e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Xt(+t[5]):lt(+t[5]));let n=es(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?s=uo(n,o,a):t[1]==="hsv"?s=fo(n,o,a):s=Qe(n,o,a),{r:s[0],g:s[1],b:s[2],a:e}}function po(i,t){var e=Je(i);e[0]=es(e[0]+t),e=Qe(e),i.r=e[0],i.g=e[1],i.b=e[2]}function mo(i){if(!i)return;let t=Je(i),e=t[0],s=Gi(t[1]),n=Gi(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${et(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}var Ji={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Zi={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function bo(){let i={Line truncated
|
||||||
/*! Bundled license information:
|
/*! Bundled license information:
|
||||||
|
|
||||||
@kurkle/color/dist/color.esm.js:
|
@kurkle/color/dist/color.esm.js:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var ot=Object.create;var A1=Object.defineProperty;var st=Object.getOwnPropertyDescriptor;var lt=Object.getOwnPropertyNames;var ut=Object.getPrototypeOf,ct=Object.prototype.hasOwnProperty;var mt=($,k)=>()=>(k||$((k={exports:{}}).exports,k),k.exports),$t=($,k)=>{for(var v in k)A1($,v,{get:k[v],enumerable:!0})},gt=($,k,v,A)=>{if(k&&typeof k=="object"||typeof k=="function")for(let P of lt(k))!ct.call($,P)&&P!==v&&A1($,P,{get:()=>k[P],enumerable:!(A=st(k,P))||A.enumerable});return $};var ht=($,k,v)=>(v=$!=null?ot(ut($)):{},gt(k||!$||!$.__esModule?A1(v,"default",{value:$,enumerable:!0}):v,$));var zn=mt((R0,Ka)=>{(function($){typeof Ka=="object"&&Ka.exports?Ka.exports=$():window.intlTelInput=$()})(()=>{var $=(()=>{var k=Object.defineProperty,v=Object.getOwnPropertyDescriptor,A=Object.getOwnPropertyNames,P=Object.prototype.hasOwnProperty,ea=(s,n)=>{for(var i in n)k(s,i,{get:n[i],enumerable:!0})},na=(s,n,i,d)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of A(n))!P.call(s,r)&&r!==i&&k(s,r,{get:()=>n[r],enumerable:!(d=v(n,r))||d.enumerable});return s},Ca=s=>na(k({},"__esModule",{value:!0}),s),ga={};ea(ga,{default:()=>qi});var h1=[["af","93",0,null,"0"],["ax","358",1,["18","4"],"0"],["al","355",0,null,"0"],["dz","213",0,null,"0"],["as","1",5,["684"],"1"],["ad","376"],["ao","244"],["ai","1",6,["264"],"1"],["ag","1",7,["268"],"1"],["ar","54",0,null,"0"],["am","374",0,null,"0"],["aw","297"],["ac","247"],["au","61",0,["4"],"0"],["at","43",0,null,"0"],["az","994",0,null,"0"],["bs","1",8,["242"],"1"],["bh","973"],["bd","880",0,null,"0"],["bb","1",9,["246"],"1"],["by","375",0,null,"8"],["be","32",0,null,"0"],["bz","501"],["bj","229"],["bm","1",10,["441"],"1"],["bt","975"],["bo","591",0,null,"0"],["ba","387",0,null,"0"],["bw","267"],["br","55",0,null,"0"],["io","246"],["vg","1",11,["284"],"1"],["bn","673"],["bg","359",0,null,"0"],["bf","226"],["bi","257"],["kh","855",0,null,"0"],["cm","237"],["ca","1",1,["204","226","236","249","250","257","263","289","306","343","354","365","367","368","382","403","416","418","428","431","437","438","450","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","879","902","905","942"],"1"],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"],"1"],["cf","236"],["td","235"],["cl","56"],["cn","86",0,null,"0"],["cx","61",2,["4","89164"],"0"],["cc","61",1,["4","89162"],"0"],["co","57",0,null,"0"],["km","269"],["cg","242"],["cd","243",0,null,"0"],["ck","682"],["cr","506"],["ci","225"],["hr","385",0,null,"0"],["cu","53",0,null,"0"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"],"1"],["do","1",2,["809","829","849"],"1"],["ec","593",0,null,"0"],["eg","20",0,null,"0"],["sv","503"],["gq","240"],["er","291",0,null,"0"],["ee","372"],["sz","268"],["et","251",0,null,"0"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0,["4"],"0"],["fr","33",0,null,"0"],["gf","594",0,null,"0"],["pf","689"],["ga","241"],["gm","220"],["ge","995",0,null,"0"],["de","49",0,null,"0"],["gh","233",0,null,"0"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"],"1"],["gp","590",0,null,"0"],["gu","1",15,["671"],"1"],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36",0,null,"06"],["is","354"],["in","91",0,null,"0"],["id","62",0,null,"0"],["ir","98",0,null,"0"],["iq","964",0,null,"0"],["ie","353",0,null,"0"],["im","44",2,["1624","74576","7524","7624","7924"],"0"],["il","972",0,null,"0"],["it","39",0,["3"]],["jm","1",4,["658","876"],"1"],["jp","81",0,null,"0"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962",0,null,"0"],["kz","7",1,["33","7"],"8"],["ke","254",0,null,"0"],["ki","686",0,null,"0"],["xk","383",0,null,"0"],["kw","965"],["kg","996",0,null,"0"],["la","856",0,null,"0"],["lv","371"],["lb","961",0,null,"0"],["ls","266"],["lr","231",0,null,"0"],["ly","218",0,null,"0"],["li","423",0,null,"0"],["lt","370",0,null,"0"],["lu","352"],["mo","853"],["mg","261",0,null,"0"],["mw","265",0,null,"0"],["my","60",0,null,"0"],["mv","960"],["ml","223"],["mt","356"],["mh","692",0,null,"1"],["mq","596",0,null,"0"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373",0,null,"0"],["mc","377",0,null,"0"],["mn","976",0,null,"0"],["me","382",0,null,"0"],["ms","1",16,["664"],"1"],["ma","212",0,["6","7"],"0"],["mz","258"],["mm","95",0,null,"0"],["na","264",0,null,"0"],["nr","674"],["np","977",0,null,"0"],["nl","31",0,null,"0"],["nc","687"],["nz","64",0,null,"0"],["ni","505"],["ne","227"],["ng","234",0,null,"0"],["nu","683"],["nf","672"],["kp","850",0,null,"0"],["mk","389",0,null,"0"],["mp","1",17,["670"],"1"],["no","47",0,["4","9"]],["om","968"],["pk","92",0,null,"0"],["pw","680"],["ps","970",0,null,"0"],["pa","507"],["pg","675"],["py","595",0,null,"0"],["pe","51",0,null,"0"],["ph","63",0,null,"0"],["pl","48"Line truncated
|
var ot=Object.create;var A1=Object.defineProperty;var st=Object.getOwnPropertyDescriptor;var lt=Object.getOwnPropertyNames;var ut=Object.getPrototypeOf,ct=Object.prototype.hasOwnProperty;var mt=($,k)=>()=>(k||$((k={exports:{}}).exports,k),k.exports),$t=($,k)=>{for(var v in k)A1($,v,{get:k[v],enumerable:!0})},gt=($,k,v,A)=>{if(k&&typeof k=="object"||typeof k=="function")for(let P of lt(k))!ct.call($,P)&&P!==v&&A1($,P,{get:()=>k[P],enumerable:!(A=st(k,P))||A.enumerable});return $};var ht=($,k,v)=>(v=$!=null?ot(ut($)):{},gt(k||!$||!$.__esModule?A1(v,"default",{value:$,enumerable:!0}):v,$));var zn=mt((R0,Ka)=>{(function($){typeof Ka=="object"&&Ka.exports?Ka.exports=$():window.intlTelInput=$()})(()=>{var $=(()=>{var k=Object.defineProperty,v=Object.getOwnPropertyDescriptor,A=Object.getOwnPropertyNames,P=Object.prototype.hasOwnProperty,ea=(s,n)=>{for(var i in n)k(s,i,{get:n[i],enumerable:!0})},na=(s,n,i,d)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of A(n))!P.call(s,r)&&r!==i&&k(s,r,{get:()=>n[r],enumerable:!(d=v(n,r))||d.enumerable});return s},Ca=s=>na(k({},"__esModule",{value:!0}),s),ga={};ea(ga,{default:()=>qi});var h1=[["af","93",0,null,"0"],["ax","358",1,["18","4"],"0"],["al","355",0,null,"0"],["dz","213",0,null,"0"],["as","1",5,["684"],"1"],["ad","376"],["ao","244"],["ai","1",6,["264"],"1"],["ag","1",7,["268"],"1"],["ar","54",0,null,"0"],["am","374",0,null,"0"],["aw","297"],["ac","247"],["au","61",0,["4"],"0"],["at","43",0,null,"0"],["az","994",0,null,"0"],["bs","1",8,["242"],"1"],["bh","973"],["bd","880",0,null,"0"],["bb","1",9,["246"],"1"],["by","375",0,null,"8"],["be","32",0,null,"0"],["bz","501"],["bj","229"],["bm","1",10,["441"],"1"],["bt","975"],["bo","591",0,null,"0"],["ba","387",0,null,"0"],["bw","267"],["br","55",0,null,"0"],["io","246"],["vg","1",11,["284"],"1"],["bn","673"],["bg","359",0,null,"0"],["bf","226"],["bi","257"],["kh","855",0,null,"0"],["cm","237"],["ca","1",1,["204","226","236","249","250","257","263","289","306","343","354","365","367","368","382","403","416","418","428","431","437","438","450","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","879","902","905","942"],"1"],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"],"1"],["cf","236"],["td","235"],["cl","56"],["cn","86",0,null,"0"],["cx","61",2,["4","89164"],"0"],["cc","61",1,["4","89162"],"0"],["co","57",0,null,"0"],["km","269"],["cg","242"],["cd","243",0,null,"0"],["ck","682"],["cr","506"],["ci","225"],["hr","385",0,null,"0"],["cu","53",0,null,"0"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"],"1"],["do","1",2,["809","829","849"],"1"],["ec","593",0,null,"0"],["eg","20",0,null,"0"],["sv","503"],["gq","240"],["er","291",0,null,"0"],["ee","372"],["sz","268"],["et","251",0,null,"0"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0,["4"],"0"],["fr","33",0,null,"0"],["gf","594",0,null,"0"],["pf","689"],["ga","241"],["gm","220"],["ge","995",0,null,"0"],["de","49",0,null,"0"],["gh","233",0,null,"0"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"],"1"],["gp","590",0,null,"0"],["gu","1",15,["671"],"1"],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36",0,null,"06"],["is","354"],["in","91",0,null,"0"],["id","62",0,null,"0"],["ir","98",0,null,"0"],["iq","964",0,null,"0"],["ie","353",0,null,"0"],["im","44",2,["1624","74576","7524","7624","7924"],"0"],["il","972",0,null,"0"],["it","39",0,["3"]],["jm","1",4,["658","876"],"1"],["jp","81",0,null,"0"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962",0,null,"0"],["kz","7",1,["33","7"],"8"],["ke","254",0,null,"0"],["ki","686",0,null,"0"],["xk","383",0,null,"0"],["kw","965"],["kg","996",0,null,"0"],["la","856",0,null,"0"],["lv","371"],["lb","961",0,null,"0"],["ls","266"],["lr","231",0,null,"0"],["ly","218",0,null,"0"],["li","423",0,null,"0"],["lt","370",0,null,"0"],["lu","352"],["mo","853"],["mg","261",0,null,"0"],["mw","265",0,null,"0"],["my","60",0,null,"0"],["mv","960"],["ml","223"],["mt","356"],["mh","692",0,null,"1"],["mq","596",0,null,"0"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373",0,null,"0"],["mc","377",0,null,"0"],["mn","976",0,null,"0"],["me","382",0,null,"0"],["ms","1",16,["664"],"1"],["ma","212",0,["6","7"],"0"],["mz","258"],["mm","95",0,null,"0"],["na","264",0,null,"0"],["nr","674"],["np","977",0,null,"0"],["nl","31",0,null,"0"],["nc","687"],["nz","64",0,null,"0"],["ni","505"],["ne","227"],["ng","234",0,null,"0"],["nu","683"],["nf","672"],["kp","850",0,null,"0"],["mk","389",0,null,"0"],["mp","1",17,["670"],"1"],["no","47",0,["4","9"]],["om","968"],["pk","92",0,null,"0"],["pw","680"],["ps","970",0,null,"0"],["pa","507"],["pg","675"],["py","595",0,null,"0"],["pe","51",0,null,"0"],["ph","63",0,null,"0"],["pl","48"Line truncated
|
||||||
<svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${M.HIDDEN}="true">
|
<svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${M.HIDDEN}="true">
|
||||||
<circle cx="11" cy="11" r="7" />
|
<circle cx="11" cy="11" r="7" />
|
||||||
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
||||||
@@ -9,4 +9,4 @@ var ot=Object.create;var A1=Object.defineProperty;var st=Object.getOwnPropertyDe
|
|||||||
<path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
|
<path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
|
||||||
</mask>
|
</mask>
|
||||||
<circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${n})" />
|
<circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${n})" />
|
||||||
</svg>`},ji=class{constructor(s,n,i){this.highlightedItem=null,this.selectedItem=null,s.dataset.intlTelInputId=i.toString(),this.telInput=s,this.options=n,this.id=i,this.hadInitialPlaceholder=!!s.getAttribute("placeholder"),this.isRTL=!!this.telInput.closest("[dir=rtl]"),this.options.separateDialCode&&(this.originalPaddingLeft=this.telInput.style.paddingLeft)}generateMarkup(s){this.countries=s,this._prepareTelInput();let n=this._createWrapperAndInsert();this._maybeBuildCountryContainer(n),n.appendChild(this.telInput),this._maybeUpdateInputPaddingAndReveal(),this._maybeBuildHiddenInputs(n)}_prepareTelInput(){this.telInput.classList.add("iti__tel-input"),!this.telInput.hasAttribute("autocomplete")&&!this.telInput.form?.hasAttribute("autocomplete")&&this.telInput.setAttribute("autocomplete","off")}_createWrapperAndInsert(){let{allowDropdown:s,showFlags:n,containerClass:i,useFullscreenPopup:d}=this.options,r=v1({iti:!0,"iti--allow-dropdown":s,"iti--show-flags":n,"iti--inline-dropdown":!d,[i]:!!i}),g=I("div",{class:r});return this.isRTL&&g.setAttribute("dir","ltr"),this.telInput.before(g),g}_maybeBuildCountryContainer(s){let{allowDropdown:n,separateDialCode:i,showFlags:d}=this.options;if(n||d||i){this.countryContainer=I("div",{class:`iti__country-container ${w.V_HIDE}`},s),n?(this.selectedCountry=I("button",{type:"button",class:"iti__selected-country",[M.EXPANDED]:"false",[M.LABEL]:this.options.i18n.noCountrySelected,[M.HASPOPUP]:"dialog",[M.CONTROLS]:`iti-${this.id}__dropdown-content`},this.countryContainer),this.telInput.disabled&&this.selectedCountry.setAttribute("disabled","true")):this.selectedCountry=I("div",{class:"iti__selected-country"},this.countryContainer);let r=I("div",{class:"iti__selected-country-primary"},this.selectedCountry);this.selectedCountryInner=I("div",{class:w.FLAG},r),n&&(this.dropdownArrow=I("div",{class:"iti__arrow",[M.HIDDEN]:"true"},r)),i&&(this.selectedDialCode=I("div",{class:"iti__selected-dial-code"},this.selectedCountry)),n&&this._buildDropdownContent()}}_buildDropdownContent(){let{fixDropdownWidth:s,useFullscreenPopup:n,countrySearch:i,i18n:d,dropdownContainer:r,containerClass:g}=this.options,c=s?"":"iti--flexible-dropdown-width";if(this.dropdownContent=I("div",{id:`iti-${this.id}__dropdown-content`,class:`iti__dropdown-content ${w.HIDE} ${c}`,role:"dialog",[M.MODAL]:"true"}),this.isRTL&&this.dropdownContent.setAttribute("dir","rtl"),i&&this._buildSearchUI(),this.countryList=I("ul",{class:"iti__country-list",id:`iti-${this.id}__country-listbox`,role:"listbox",[M.LABEL]:d.countryListAriaLabel},this.dropdownContent),this._appendListItems(),i&&this.updateSearchResultsA11yText(),r){let p=v1({iti:!0,"iti--container":!0,"iti--fullscreen-popup":n,"iti--inline-dropdown":!n,[g]:!!g});this.dropdown=I("div",{class:p}),this.dropdown.appendChild(this.dropdownContent)}else this.countryContainer.appendChild(this.dropdownContent)}_buildSearchUI(){let{i18n:s}=this.options,n=I("div",{class:"iti__search-input-wrapper"},this.dropdownContent);this.searchIcon=I("span",{class:"iti__search-icon",[M.HIDDEN]:"true"},n),this.searchIcon.innerHTML=zi(),this.searchInput=I("input",{id:`iti-${this.id}__search-input`,type:"search",class:"iti__search-input",placeholder:s.searchPlaceholder,role:"combobox",[M.EXPANDED]:"true",[M.LABEL]:s.searchPlaceholder,[M.CONTROLS]:`iti-${this.id}__country-listbox`,[M.AUTOCOMPLETE]:"list",autocomplete:"off"},n),this.searchClearButton=I("button",{type:"button",class:`iti__search-clear ${w.HIDE}`,[M.LABEL]:s.clearSearchAriaLabel,tabindex:"-1"},n),this.searchClearButton.innerHTML=wi(this.id),this.searchResultsA11yText=I("span",{class:"iti__a11y-text"},this.dropdownContent),this.searchNoResults=I("div",{class:`iti__no-results ${w.HIDE}`,[M.HIDDEN]:"true"},this.dropdownContent),this.searchNoResults.textContent=s.zeroSearchResults}_maybeUpdateInputPaddingAndReveal(){this.countryContainer&&(this.updateInputPadding(),this.countryContainer.classList.remove(w.V_HIDE))}_maybeBuildHiddenInputs(s){let{hiddenInput:n}=this.options;if(n){let i=this.telInput.getAttribute("name")||"",d=n(i);if(d.phone){let r=this.telInput.form?.querySelector(`input[name="${d.phone}"]`);r?this.hiddenInput=r:(this.hiddenInput=I("input",{type:"hidden",name:d.phone}),s.appendChild(this.hiddenInput))}if(d.country){let r=this.telInput.form?.querySelector(`input[name="${d.country}"]`);r?this.hiddenInputCountry=r:(this.hiddenInputCountry=I("input",{type:"hidden",name:d.country}),s.appendChild(this.hiddenInputCountry))}}}_appendListItems(){let s=document.createDocumentFragment();for(let n=0;n<this.countries.length;n++){let i=this.countries[n],d=v1({[w.COUNTRY_ITEM]:!0}),r=I("li",{id:`iti-${this.id}__item-${i.iso2}`,class:d,tabindex:"-1",role:"option",[M.SELECTED]:"false"});r.dataset.dialCode=i.dialCode,r.dataset.countryCode=i.iso2,i.nodeById[this.id]=r,this.options.showFlags&&I("div",{class:`${w.FLAG} iti__${i.iso2}`},r);let g=I("span",{class:"iti__country-name"},r);g.textContent=i.name;let c=I("span",{class:"iti__Line truncated
|
</svg>`},ji=class{constructor(s,n,i){this.highlightedItem=null,this.selectedItem=null,s.dataset.intlTelInputId=i.toString(),this.telInput=s,this.options=n,this.id=i,this.hadInitialPlaceholder=!!s.getAttribute("placeholder"),this.isRTL=!!this.telInput.closest("[dir=rtl]"),this.options.separateDialCode&&(this.originalPaddingLeft=this.telInput.style.paddingLeft)}generateMarkup(s){this.countries=s,this._prepareTelInput();let n=this._createWrapperAndInsert();this._maybeBuildCountryContainer(n),n.appendChild(this.telInput),this._maybeUpdateInputPaddingAndReveal(),this._maybeBuildHiddenInputs(n)}_prepareTelInput(){this.telInput.classList.add("iti__tel-input"),!this.telInput.hasAttribute("autocomplete")&&!this.telInput.form?.hasAttribute("autocomplete")&&this.telInput.setAttribute("autocomplete","off")}_createWrapperAndInsert(){let{allowDropdown:s,showFlags:n,containerClass:i,useFullscreenPopup:d}=this.options,r=v1({iti:!0,"iti--allow-dropdown":s,"iti--show-flags":n,"iti--inline-dropdown":!d,[i]:!!i}),g=I("div",{class:r});return this.isRTL&&g.setAttribute("dir","ltr"),this.telInput.before(g),g}_maybeBuildCountryContainer(s){let{allowDropdown:n,separateDialCode:i,showFlags:d}=this.options;if(n||d||i){this.countryContainer=I("div",{class:`iti__country-container ${w.V_HIDE}`},s),n?(this.selectedCountry=I("button",{type:"button",class:"iti__selected-country",[M.EXPANDED]:"false",[M.LABEL]:this.options.i18n.noCountrySelected,[M.HASPOPUP]:"dialog",[M.CONTROLS]:`iti-${this.id}__dropdown-content`},this.countryContainer),this.telInput.disabled&&this.selectedCountry.setAttribute("disabled","true")):this.selectedCountry=I("div",{class:"iti__selected-country"},this.countryContainer);let r=I("div",{class:"iti__selected-country-primary"},this.selectedCountry);this.selectedCountryInner=I("div",{class:w.FLAG},r),n&&(this.dropdownArrow=I("div",{class:"iti__arrow",[M.HIDDEN]:"true"},r)),i&&(this.selectedDialCode=I("div",{class:"iti__selected-dial-code"},this.selectedCountry)),n&&this._buildDropdownContent()}}_buildDropdownContent(){let{fixDropdownWidth:s,useFullscreenPopup:n,countrySearch:i,i18n:d,dropdownContainer:r,containerClass:g}=this.options,c=s?"":"iti--flexible-dropdown-width";if(this.dropdownContent=I("div",{id:`iti-${this.id}__dropdown-content`,class:`iti__dropdown-content ${w.HIDE} ${c}`,role:"dialog",[M.MODAL]:"true"}),this.isRTL&&this.dropdownContent.setAttribute("dir","rtl"),i&&this._buildSearchUI(),this.countryList=I("ul",{class:"iti__country-list",id:`iti-${this.id}__country-listbox`,role:"listbox",[M.LABEL]:d.countryListAriaLabel},this.dropdownContent),this._appendListItems(),i&&this.updateSearchResultsA11yText(),r){let p=v1({iti:!0,"iti--container":!0,"iti--fullscreen-popup":n,"iti--inline-dropdown":!n,[g]:!!g});this.dropdown=I("div",{class:p}),this.dropdown.appendChild(this.dropdownContent)}else this.countryContainer.appendChild(this.dropdownContent)}_buildSearchUI(){let{i18n:s}=this.options,n=I("div",{class:"iti__search-input-wrapper"},this.dropdownContent);this.searchIcon=I("span",{class:"iti__search-icon",[M.HIDDEN]:"true"},n),this.searchIcon.innerHTML=zi(),this.searchInput=I("input",{id:`iti-${this.id}__search-input`,type:"search",class:"iti__search-input",placeholder:s.searchPlaceholder,role:"combobox",[M.EXPANDED]:"true",[M.LABEL]:s.searchPlaceholder,[M.CONTROLS]:`iti-${this.id}__country-listbox`,[M.AUTOCOMPLETE]:"list",autocomplete:"off"},n),this.searchClearButton=I("button",{type:"button",class:`iti__search-clear ${w.HIDE}`,[M.LABEL]:s.clearSearchAriaLabel,tabindex:"-1"},n),this.searchClearButton.innerHTML=wi(this.id),this.searchResultsA11yText=I("span",{class:"iti__a11y-text"},this.dropdownContent),this.searchNoResults=I("div",{class:`iti__no-results ${w.HIDE}`,[M.HIDDEN]:"true"},this.dropdownContent),this.searchNoResults.textContent=s.zeroSearchResults}_maybeUpdateInputPaddingAndReveal(){this.countryContainer&&(this.updateInputPadding(),this.countryContainer.classList.remove(w.V_HIDE))}_maybeBuildHiddenInputs(s){let{hiddenInput:n}=this.options;if(n){let i=this.telInput.getAttribute("name")||"",d=n(i);if(d.phone){let r=this.telInput.form?.querySelector(`input[name="${d.phone}"]`);r?this.hiddenInput=r:(this.hiddenInput=I("input",{type:"hidden",name:d.phone}),s.appendChild(this.hiddenInput))}if(d.country){let r=this.telInput.form?.querySelector(`input[name="${d.country}"]`);r?this.hiddenInputCountry=r:(this.hiddenInputCountry=I("input",{type:"hidden",name:d.country}),s.appendChild(this.hiddenInputCountry))}}}_appendListItems(){let s=document.createDocumentFragment();for(let n=0;n<this.countries.length;n++){let i=this.countries[n],d=v1({[w.COUNTRY_ITEM]:!0}),r=I("li",{id:`iti-${this.id}__item-${i.iso2}`,class:d,tabindex:"-1",role:"option",[M.SELECTED]:"false"});r.dataset.dialCode=i.dialCode,r.dataset.countryCode=i.iso2,i.nodeById[this.id]=r,this.options.showFlags&&I("div",{class:`${w.FLAG} iti__${i.iso2}`},r);let g=I("span",{class:"iti__country-name"},r);g.textContent=i.name;let c=I("span",{class:"iti__Line truncated
|
||||||
Reference in new issue
Block a user