From 70bfebcd7c9396c9d17757ec57a584371dce2e9f Mon Sep 17 00:00:00 2001 From: Sascha Date: Mon, 1 Jan 2024 21:58:49 +0100 Subject: [PATCH 01/79] Added Default Templates for Chapters --- .../Controllers/ChapterController.php | 14 ++++---- app/Entities/Controllers/PageController.php | 9 +++-- app/Entities/Models/Chapter.php | 11 ++++++ app/Entities/Repos/ChapterRepo.php | 34 +++++++++++++++++++ app/Entities/Repos/PageRepo.php | 8 ++++- app/Entities/Tools/TrashCan.php | 6 ++++ ...04542_add_default_template_to_chapters.php | 32 +++++++++++++++++ lang/en/entities.php | 3 ++ resources/views/chapters/parts/form.blade.php | 23 +++++++++++++ 9 files changed, 131 insertions(+), 9 deletions(-) create mode 100644 database/migrations/2024_01_01_104542_add_default_template_to_chapters.php diff --git a/app/Entities/Controllers/ChapterController.php b/app/Entities/Controllers/ChapterController.php index 28ad35fa4b3..00616888a70 100644 --- a/app/Entities/Controllers/ChapterController.php +++ b/app/Entities/Controllers/ChapterController.php @@ -49,9 +49,10 @@ public function create(string $bookSlug) public function store(Request $request, string $bookSlug) { $validated = $this->validate($request, [ - 'name' => ['required', 'string', 'max:255'], - 'description_html' => ['string', 'max:2000'], - 'tags' => ['array'], + 'name' => ['required', 'string', 'max:255'], + 'description_html' => ['string', 'max:2000'], + 'tags' => ['array'], + 'default_template_id' => ['nullable', 'integer'], ]); $book = Book::visible()->where('slug', '=', $bookSlug)->firstOrFail(); @@ -111,9 +112,10 @@ public function edit(string $bookSlug, string $chapterSlug) public function update(Request $request, string $bookSlug, string $chapterSlug) { $validated = $this->validate($request, [ - 'name' => ['required', 'string', 'max:255'], - 'description_html' => ['string', 'max:2000'], - 'tags' => ['array'], + 'name' => ['required', 'string', 'max:255'], + 'description_html' => ['string', 'max:2000'], + 'tags' => ['array'], + 'default_template_id' => ['nullable', 'integer'], ]); $chapter = $this->chapterRepo->getBySlug($bookSlug, $chapterSlug); diff --git a/app/Entities/Controllers/PageController.php b/app/Entities/Controllers/PageController.php index adafcdc7bd9..74dd4f531b4 100644 --- a/app/Entities/Controllers/PageController.php +++ b/app/Entities/Controllers/PageController.php @@ -6,6 +6,7 @@ use BookStack\Activity\Tools\CommentTree; use BookStack\Activity\Tools\UserEntityWatchOptions; use BookStack\Entities\Models\Book; +use BookStack\Entities\Models\Chapter; use BookStack\Entities\Models\Page; use BookStack\Entities\Repos\PageRepo; use BookStack\Entities\Tools\BookContents; @@ -259,7 +260,9 @@ public function showDelete(string $bookSlug, string $pageSlug) $page = $this->pageRepo->getBySlug($bookSlug, $pageSlug); $this->checkOwnablePermission('page-delete', $page); $this->setPageTitle(trans('entities.pages_delete_named', ['pageName' => $page->getShortName()])); - $usedAsTemplate = Book::query()->where('default_template_id', '=', $page->id)->count() > 0; + $usedAsTemplate = + Book::query()->where('default_template_id', '=', $page->id)->count() > 0 || + Chapter::query()->where('default_template_id', '=', $page->id)->count() > 0; return view('pages.delete', [ 'book' => $page->book, @@ -279,7 +282,9 @@ public function showDeleteDraft(string $bookSlug, int $pageId) $page = $this->pageRepo->getById($pageId); $this->checkOwnablePermission('page-update', $page); $this->setPageTitle(trans('entities.pages_delete_draft_named', ['pageName' => $page->getShortName()])); - $usedAsTemplate = Book::query()->where('default_template_id', '=', $page->id)->count() > 0; + $usedAsTemplate = + Book::query()->where('default_template_id', '=', $page->id)->count() > 0 || + Chapter::query()->where('default_template_id', '=', $page->id)->count() > 0; return view('pages.delete', [ 'book' => $page->book, diff --git a/app/Entities/Models/Chapter.php b/app/Entities/Models/Chapter.php index f30d77b5c5c..d3a7101116b 100644 --- a/app/Entities/Models/Chapter.php +++ b/app/Entities/Models/Chapter.php @@ -2,6 +2,7 @@ namespace BookStack\Entities\Models; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Support\Collection; @@ -11,6 +12,8 @@ * * @property Collection $pages * @property string $description + * @property ?int $default_template_id + * @property ?Page $defaultTemplate */ class Chapter extends BookChild { @@ -48,6 +51,14 @@ public function getUrl(string $path = ''): string return url('/' . implode('/', $parts)); } + /** + * Get the Page that is used as default template for newly created pages within this Chapter. + */ + public function defaultTemplate(): BelongsTo + { + return $this->belongsTo(Page::class, 'default_template_id'); + } + /** * Get the visible pages in this chapter. */ diff --git a/app/Entities/Repos/ChapterRepo.php b/app/Entities/Repos/ChapterRepo.php index 977193d85bb..9534a406082 100644 --- a/app/Entities/Repos/ChapterRepo.php +++ b/app/Entities/Repos/ChapterRepo.php @@ -4,6 +4,7 @@ use BookStack\Activity\ActivityType; use BookStack\Entities\Models\Book; +use BookStack\Entities\Models\Page; use BookStack\Entities\Models\Chapter; use BookStack\Entities\Models\Entity; use BookStack\Entities\Tools\BookContents; @@ -46,6 +47,7 @@ public function create(array $input, Book $parentBook): Chapter $chapter->book_id = $parentBook->id; $chapter->priority = (new BookContents($parentBook))->getLastPriority() + 1; $this->baseRepo->create($chapter, $input); + $this->updateChapterDefaultTemplate($chapter, intval($input['default_template_id'] ?? null)); Activity::add(ActivityType::CHAPTER_CREATE, $chapter); return $chapter; @@ -57,6 +59,11 @@ public function create(array $input, Book $parentBook): Chapter public function update(Chapter $chapter, array $input): Chapter { $this->baseRepo->update($chapter, $input); + + if (array_key_exists('default_template_id', $input)) { + $this->updateChapterDefaultTemplate($chapter, intval($input['default_template_id'])); + } + Activity::add(ActivityType::CHAPTER_UPDATE, $chapter); return $chapter; @@ -101,6 +108,33 @@ public function move(Chapter $chapter, string $parentIdentifier): Book return $parent; } + /** + * Update the default page template used for this chapter. + * Checks that, if changing, the provided value is a valid template and the user + * has visibility of the provided page template id. + */ + protected function updateChapterDefaultTemplate(Chapter $chapter, int $templateId): void + { + $changing = $templateId !== intval($chapter->default_template_id); + if (!$changing) { + return; + } + + if ($templateId === 0) { + $chapter->default_template_id = null; + $chapter->save(); + return; + } + + $templateExists = Page::query()->visible() + ->where('template', '=', true) + ->where('id', '=', $templateId) + ->exists(); + + $chapter->default_template_id = $templateExists ? $templateId : null; + $chapter->save(); + } + /** * Find a page parent entity via an identifier string in the format: * {type}:{id} diff --git a/app/Entities/Repos/PageRepo.php b/app/Entities/Repos/PageRepo.php index 7b14ea7d278..67c4b222547 100644 --- a/app/Entities/Repos/PageRepo.php +++ b/app/Entities/Repos/PageRepo.php @@ -136,7 +136,13 @@ public function getNewDraftPage(Entity $parent) $page->book_id = $parent->id; } - $defaultTemplate = $page->book->defaultTemplate; + // check for chapter + if ($page->chapter_id) { + $defaultTemplate = $page->chapter->defaultTemplate; + } else { + $defaultTemplate = $page->book->defaultTemplate; + } + if ($defaultTemplate && userCan('view', $defaultTemplate)) { $page->forceFill([ 'html' => $defaultTemplate->html, diff --git a/app/Entities/Tools/TrashCan.php b/app/Entities/Tools/TrashCan.php index b2510398541..e5bcfe71ac2 100644 --- a/app/Entities/Tools/TrashCan.php +++ b/app/Entities/Tools/TrashCan.php @@ -208,6 +208,12 @@ protected function destroyPage(Page $page): int $page->forceDelete(); + // Remove chapter template usages + Chapter::query()->where('default_template_id', '=', $page->id) + ->update(['default_template_id' => null]); + + $page->forceDelete(); + return 1; } diff --git a/database/migrations/2024_01_01_104542_add_default_template_to_chapters.php b/database/migrations/2024_01_01_104542_add_default_template_to_chapters.php new file mode 100644 index 00000000000..5e9ea1de311 --- /dev/null +++ b/database/migrations/2024_01_01_104542_add_default_template_to_chapters.php @@ -0,0 +1,32 @@ +integer('default_template_id')->nullable()->default(null); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('chapters', function (Blueprint $table) { + $table->dropColumn('default_template_id'); + }); + } +} diff --git a/lang/en/entities.php b/lang/en/entities.php index f1f915544d1..4ab9de47dfb 100644 --- a/lang/en/entities.php +++ b/lang/en/entities.php @@ -192,6 +192,9 @@ 'chapters_permissions_success' => 'Chapter Permissions Updated', 'chapters_search_this' => 'Search this chapter', 'chapter_sort_book' => 'Sort Book', + 'chapter_default_template' => 'Default Page Template', + 'chapter_default_template_explain' => 'Assign a page template that will be used as the default content for all new pages in this chapter. Keep in mind this will only be used if the page creator has view access to those chosen template page.', + 'chapter_default_template_select' => 'Select a template page', // Pages 'page' => 'Page', diff --git a/resources/views/chapters/parts/form.blade.php b/resources/views/chapters/parts/form.blade.php index c6052c93af4..ea7f84bc839 100644 --- a/resources/views/chapters/parts/form.blade.php +++ b/resources/views/chapters/parts/form.blade.php @@ -22,6 +22,29 @@ +
+ +
+
+

+ {{ trans('entities.chapter_default_template_explain') }} +

+ +
+ @include('form.page-picker', [ + 'name' => 'default_template_id', + 'placeholder' => trans('entities.chapter_default_template_select'), + 'value' => $chapter->default_template_id ?? null, + 'selectorEndpoint' => '/search/entity-selector-templates', + ]) +
+
+ +
+
+
{{ trans('common.cancel') }} From b4d9029dc301f73f0e87026b8eff78cf2cda6164 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sun, 7 Jan 2024 14:03:13 +0000 Subject: [PATCH 02/79] Range requests: Extracted stream output handling to new class --- app/Http/DownloadResponseFactory.php | 36 ++++-------- app/Http/RangeSupportedStream.php | 57 +++++++++++++++++++ app/Uploads/AttachmentService.php | 10 +++- .../Controllers/AttachmentController.php | 5 +- 4 files changed, 80 insertions(+), 28 deletions(-) create mode 100644 app/Http/RangeSupportedStream.php diff --git a/app/Http/DownloadResponseFactory.php b/app/Http/DownloadResponseFactory.php index 20032f52534..f8c10165c80 100644 --- a/app/Http/DownloadResponseFactory.php +++ b/app/Http/DownloadResponseFactory.php @@ -9,11 +9,9 @@ class DownloadResponseFactory { - protected Request $request; - - public function __construct(Request $request) - { - $this->request = $request; + public function __construct( + protected Request $request + ) { } /** @@ -27,19 +25,11 @@ public function directly(string $content, string $fileName): Response /** * Create a response that forces a download, from a given stream of content. */ - public function streamedDirectly($stream, string $fileName): StreamedResponse + public function streamedDirectly($stream, string $fileName, int $fileSize): StreamedResponse { - return response()->stream(function () use ($stream) { - - // End & flush the output buffer, if we're in one, otherwise we still use memory. - // Output buffer may or may not exist depending on PHP `output_buffering` setting. - // Ignore in testing since output buffers are used to gather a response. - if (!empty(ob_get_status()) && !app()->runningUnitTests()) { - ob_end_clean(); - } - - fpassthru($stream); - fclose($stream); + $rangeStream = new RangeSupportedStream($stream, $fileSize, $this->request->headers); + return response()->stream(function () use ($rangeStream) { + $rangeStream->outputAndClose(); }, 200, $this->getHeaders($fileName)); } @@ -48,15 +38,13 @@ public function streamedDirectly($stream, string $fileName): StreamedResponse * correct for the file, in a way so the browser can show the content in browser, * for a given content stream. */ - public function streamedInline($stream, string $fileName): StreamedResponse + public function streamedInline($stream, string $fileName, int $fileSize): StreamedResponse { - $sniffContent = fread($stream, 2000); - $mime = (new WebSafeMimeSniffer())->sniff($sniffContent); + $rangeStream = new RangeSupportedStream($stream, $fileSize, $this->request->headers); + $mime = $rangeStream->sniffMime(); - return response()->stream(function () use ($sniffContent, $stream) { - echo $sniffContent; - fpassthru($stream); - fclose($stream); + return response()->stream(function () use ($rangeStream) { + $rangeStream->outputAndClose(); }, 200, $this->getHeaders($fileName, $mime)); } diff --git a/app/Http/RangeSupportedStream.php b/app/Http/RangeSupportedStream.php new file mode 100644 index 00000000000..dc310503567 --- /dev/null +++ b/app/Http/RangeSupportedStream.php @@ -0,0 +1,57 @@ +fileSize); + $this->sniffContent = fread($this->stream, $offset); + + return (new WebSafeMimeSniffer())->sniff($this->sniffContent); + } + + /** + * Output the current stream to stdout before closing out the stream. + */ + public function outputAndClose(): void + { + // End & flush the output buffer, if we're in one, otherwise we still use memory. + // Output buffer may or may not exist depending on PHP `output_buffering` setting. + // Ignore in testing since output buffers are used to gather a response. + if (!empty(ob_get_status()) && !app()->runningUnitTests()) { + ob_end_clean(); + } + + $outStream = fopen('php://output', 'w'); + $offset = 0; + + if (!empty($this->sniffContent)) { + fwrite($outStream, $this->sniffContent); + $offset = strlen($this->sniffContent); + } + + $toWrite = $this->fileSize - $offset; + stream_copy_to_stream($this->stream, $outStream, $toWrite); + fpassthru($this->stream); + + fclose($this->stream); + fclose($outStream); + } +} diff --git a/app/Uploads/AttachmentService.php b/app/Uploads/AttachmentService.php index ddabec09f27..72f78e347bf 100644 --- a/app/Uploads/AttachmentService.php +++ b/app/Uploads/AttachmentService.php @@ -66,8 +66,6 @@ protected function adjustPathForStorageDisk(string $path): string /** * Stream an attachment from storage. * - * @throws FileNotFoundException - * * @return resource|null */ public function streamAttachmentFromStorage(Attachment $attachment) @@ -75,6 +73,14 @@ public function streamAttachmentFromStorage(Attachment $attachment) return $this->getStorageDisk()->readStream($this->adjustPathForStorageDisk($attachment->path)); } + /** + * Read the file size of an attachment from storage, in bytes. + */ + public function getAttachmentFileSize(Attachment $attachment): int + { + return $this->getStorageDisk()->size($this->adjustPathForStorageDisk($attachment->path)); + } + /** * Store a new attachment upon user upload. * diff --git a/app/Uploads/Controllers/AttachmentController.php b/app/Uploads/Controllers/AttachmentController.php index 92f23465d22..e61c1033884 100644 --- a/app/Uploads/Controllers/AttachmentController.php +++ b/app/Uploads/Controllers/AttachmentController.php @@ -226,12 +226,13 @@ public function get(Request $request, string $attachmentId) $fileName = $attachment->getFileName(); $attachmentStream = $this->attachmentService->streamAttachmentFromStorage($attachment); + $attachmentSize = $this->attachmentService->getAttachmentFileSize($attachment); if ($request->get('open') === 'true') { - return $this->download()->streamedInline($attachmentStream, $fileName); + return $this->download()->streamedInline($attachmentStream, $fileName, $attachmentSize); } - return $this->download()->streamedDirectly($attachmentStream, $fileName); + return $this->download()->streamedDirectly($attachmentStream, $fileName, $attachmentSize); } /** From d94762549a3ef364d4486a27f1585122f60c10ec Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sun, 7 Jan 2024 20:34:03 +0000 Subject: [PATCH 03/79] Range requests: Added basic HTTP range support --- app/Http/DownloadResponseFactory.php | 28 ++++---- app/Http/RangeSupportedStream.php | 95 +++++++++++++++++++++++++--- 2 files changed, 103 insertions(+), 20 deletions(-) diff --git a/app/Http/DownloadResponseFactory.php b/app/Http/DownloadResponseFactory.php index f8c10165c80..f29aaa2e45a 100644 --- a/app/Http/DownloadResponseFactory.php +++ b/app/Http/DownloadResponseFactory.php @@ -2,7 +2,6 @@ namespace BookStack\Http; -use BookStack\Util\WebSafeMimeSniffer; use Illuminate\Http\Request; use Illuminate\Http\Response; use Symfony\Component\HttpFoundation\StreamedResponse; @@ -19,7 +18,7 @@ public function __construct( */ public function directly(string $content, string $fileName): Response { - return response()->make($content, 200, $this->getHeaders($fileName)); + return response()->make($content, 200, $this->getHeaders($fileName, strlen($content))); } /** @@ -27,10 +26,13 @@ public function directly(string $content, string $fileName): Response */ public function streamedDirectly($stream, string $fileName, int $fileSize): StreamedResponse { - $rangeStream = new RangeSupportedStream($stream, $fileSize, $this->request->headers); - return response()->stream(function () use ($rangeStream) { - $rangeStream->outputAndClose(); - }, 200, $this->getHeaders($fileName)); + $rangeStream = new RangeSupportedStream($stream, $fileSize, $this->request); + $headers = array_merge($this->getHeaders($fileName, $fileSize), $rangeStream->getResponseHeaders()); + return response()->stream( + fn() => $rangeStream->outputAndClose(), + $rangeStream->getResponseStatus(), + $headers, + ); } /** @@ -40,24 +42,28 @@ public function streamedDirectly($stream, string $fileName, int $fileSize): Stre */ public function streamedInline($stream, string $fileName, int $fileSize): StreamedResponse { - $rangeStream = new RangeSupportedStream($stream, $fileSize, $this->request->headers); + $rangeStream = new RangeSupportedStream($stream, $fileSize, $this->request); $mime = $rangeStream->sniffMime(); + $headers = array_merge($this->getHeaders($fileName, $fileSize, $mime), $rangeStream->getResponseHeaders()); - return response()->stream(function () use ($rangeStream) { - $rangeStream->outputAndClose(); - }, 200, $this->getHeaders($fileName, $mime)); + return response()->stream( + fn() => $rangeStream->outputAndClose(), + $rangeStream->getResponseStatus(), + $headers, + ); } /** * Get the common headers to provide for a download response. */ - protected function getHeaders(string $fileName, string $mime = 'application/octet-stream'): array + protected function getHeaders(string $fileName, int $fileSize, string $mime = 'application/octet-stream'): array { $disposition = ($mime === 'application/octet-stream') ? 'attachment' : 'inline'; $downloadName = str_replace('"', '', $fileName); return [ 'Content-Type' => $mime, + 'Content-Length' => $fileSize, 'Content-Disposition' => "{$disposition}; filename=\"{$downloadName}\"", 'X-Content-Type-Options' => 'nosniff', ]; diff --git a/app/Http/RangeSupportedStream.php b/app/Http/RangeSupportedStream.php index dc310503567..b51d4a5498f 100644 --- a/app/Http/RangeSupportedStream.php +++ b/app/Http/RangeSupportedStream.php @@ -3,17 +3,30 @@ namespace BookStack\Http; use BookStack\Util\WebSafeMimeSniffer; -use Symfony\Component\HttpFoundation\HeaderBag; +use Illuminate\Http\Request; +/** + * Helper wrapper for range-based stream response handling. + * Much of this used symfony/http-foundation as a reference during build. + * URL: https://github.com/symfony/http-foundation/blob/v6.0.20/BinaryFileResponse.php + * License: MIT license, Copyright (c) Fabien Potencier. + */ class RangeSupportedStream { protected string $sniffContent; + protected array $responseHeaders; + protected int $responseStatus = 200; + + protected int $responseLength = 0; + protected int $responseOffset = 0; public function __construct( protected $stream, protected int $fileSize, - protected HeaderBag $requestHeaders, + Request $request, ) { + $this->responseLength = $this->fileSize; + $this->parseRequest($request); } /** @@ -40,18 +53,82 @@ public function outputAndClose(): void } $outStream = fopen('php://output', 'w'); - $offset = 0; + $sniffOffset = strlen($this->sniffContent); - if (!empty($this->sniffContent)) { - fwrite($outStream, $this->sniffContent); - $offset = strlen($this->sniffContent); + if (!empty($this->sniffContent) && $this->responseOffset < $sniffOffset) { + $sniffOutput = substr($this->sniffContent, $this->responseOffset, min($sniffOffset, $this->responseLength)); + fwrite($outStream, $sniffOutput); + } else if ($this->responseOffset !== 0) { + fseek($this->stream, $this->responseOffset); } - $toWrite = $this->fileSize - $offset; - stream_copy_to_stream($this->stream, $outStream, $toWrite); - fpassthru($this->stream); + stream_copy_to_stream($this->stream, $outStream, $this->responseLength); fclose($this->stream); fclose($outStream); } + + public function getResponseHeaders(): array + { + return $this->responseHeaders; + } + + public function getResponseStatus(): int + { + return $this->responseStatus; + } + + protected function parseRequest(Request $request): void + { + $this->responseHeaders['Accept-Ranges'] = $request->isMethodSafe() ? 'bytes' : 'none'; + + $range = $this->getRangeFromRequest($request); + if ($range) { + [$start, $end] = $range; + if ($start < 0 || $start > $end) { + $this->responseStatus = 416; + $this->responseHeaders['Content-Range'] = sprintf('bytes */%s', $this->fileSize); + } elseif ($end - $start < $this->fileSize - 1) { + $this->responseLength = $end < $this->fileSize ? $end - $start + 1 : -1; + $this->responseOffset = $start; + $this->responseStatus = 206; + $this->responseHeaders['Content-Range'] = sprintf('bytes %s-%s/%s', $start, $end, $this->fileSize); + $this->responseHeaders['Content-Length'] = $end - $start + 1; + } + } + + if ($request->isMethod('HEAD')) { + $this->responseLength = 0; + } + } + + protected function getRangeFromRequest(Request $request): ?array + { + $range = $request->headers->get('Range'); + if (!$range || !$request->isMethod('GET') || !str_starts_with($range, 'bytes=')) { + return null; + } + + if ($request->headers->has('If-Range')) { + return null; + } + + [$start, $end] = explode('-', substr($range, 6), 2) + [0]; + + $end = ('' === $end) ? $this->fileSize - 1 : (int) $end; + + if ('' === $start) { + $start = $this->fileSize - $end; + $end = $this->fileSize - 1; + } else { + $start = (int) $start; + } + + if ($start > $end) { + return null; + } + + $end = min($end, $this->fileSize - 1); + return [$start, $end]; + } } From 91d8d6eaaa5ae42fc9872901d6fcbcae8e19236e Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sun, 14 Jan 2024 15:50:00 +0000 Subject: [PATCH 04/79] Range requests: Added test cases to cover functionality Fixed some found issues in the process. --- app/Http/RangeSupportedStream.php | 20 +++--- tests/Uploads/AttachmentTest.php | 101 ++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+), 10 deletions(-) diff --git a/app/Http/RangeSupportedStream.php b/app/Http/RangeSupportedStream.php index b51d4a5498f..300f4488cf4 100644 --- a/app/Http/RangeSupportedStream.php +++ b/app/Http/RangeSupportedStream.php @@ -13,8 +13,8 @@ */ class RangeSupportedStream { - protected string $sniffContent; - protected array $responseHeaders; + protected string $sniffContent = ''; + protected array $responseHeaders = []; protected int $responseStatus = 200; protected int $responseLength = 0; @@ -53,16 +53,20 @@ public function outputAndClose(): void } $outStream = fopen('php://output', 'w'); - $sniffOffset = strlen($this->sniffContent); + $sniffLength = strlen($this->sniffContent); + $bytesToWrite = $this->responseLength; - if (!empty($this->sniffContent) && $this->responseOffset < $sniffOffset) { - $sniffOutput = substr($this->sniffContent, $this->responseOffset, min($sniffOffset, $this->responseLength)); + if ($sniffLength > 0 && $this->responseOffset < $sniffLength) { + $sniffEnd = min($sniffLength, $bytesToWrite + $this->responseOffset); + $sniffOutLength = $sniffEnd - $this->responseOffset; + $sniffOutput = substr($this->sniffContent, $this->responseOffset, $sniffOutLength); fwrite($outStream, $sniffOutput); + $bytesToWrite -= $sniffOutLength; } else if ($this->responseOffset !== 0) { fseek($this->stream, $this->responseOffset); } - stream_copy_to_stream($this->stream, $outStream, $this->responseLength); + stream_copy_to_stream($this->stream, $outStream, $bytesToWrite); fclose($this->stream); fclose($outStream); @@ -124,10 +128,6 @@ protected function getRangeFromRequest(Request $request): ?array $start = (int) $start; } - if ($start > $end) { - return null; - } - $end = min($end, $this->fileSize - 1); return [$start, $end]; } diff --git a/tests/Uploads/AttachmentTest.php b/tests/Uploads/AttachmentTest.php index bd03c339c43..2e1a7b3395a 100644 --- a/tests/Uploads/AttachmentTest.php +++ b/tests/Uploads/AttachmentTest.php @@ -316,4 +316,105 @@ public function test_file_upload_works_when_local_secure_restricted_is_in_use() $this->assertFileExists(storage_path($attachment->path)); $this->files->deleteAllAttachmentFiles(); } + + public function test_file_get_range_access() + { + $page = $this->entities->page(); + $this->asAdmin(); + $attachment = $this->files->uploadAttachmentDataToPage($this, $page, 'my_text.txt', 'abc123456', 'text/plain'); + + // Download access + $resp = $this->get($attachment->getUrl(), ['Range' => 'bytes=3-5']); + $resp->assertStatus(206); + $resp->assertStreamedContent('123'); + $resp->assertHeader('Content-Length', '3'); + $resp->assertHeader('Content-Range', 'bytes 3-5/9'); + + // Inline access + $resp = $this->get($attachment->getUrl(true), ['Range' => 'bytes=5-7']); + $resp->assertStatus(206); + $resp->assertStreamedContent('345'); + $resp->assertHeader('Content-Length', '3'); + $resp->assertHeader('Content-Range', 'bytes 5-7/9'); + + $this->files->deleteAllAttachmentFiles(); + } + + public function test_file_head_range_returns_no_content() + { + $page = $this->entities->page(); + $this->asAdmin(); + $attachment = $this->files->uploadAttachmentDataToPage($this, $page, 'my_text.txt', 'abc123456', 'text/plain'); + + $resp = $this->head($attachment->getUrl(), ['Range' => 'bytes=0-9']); + $resp->assertStreamedContent(''); + $resp->assertHeader('Content-Length', '9'); + $resp->assertStatus(200); + + $this->files->deleteAllAttachmentFiles(); + } + + public function test_file_head_range_edge_cases() + { + $page = $this->entities->page(); + $this->asAdmin(); + + // Mime-type "sniffing" happens on first 2k bytes, hence this content (2005 bytes) + $content = '01234' . str_repeat('a', 1990) . '0123456789'; + $attachment = $this->files->uploadAttachmentDataToPage($this, $page, 'my_text.txt', $content, 'text/plain'); + + // Test for both inline and download attachment serving + foreach ([true, false] as $isInline) { + // No end range + $resp = $this->get($attachment->getUrl($isInline), ['Range' => 'bytes=5-']); + $resp->assertStreamedContent(substr($content, 5)); + $resp->assertHeader('Content-Length', '2000'); + $resp->assertHeader('Content-Range', 'bytes 5-2004/2005'); + $resp->assertStatus(206); + + // End only range + $resp = $this->get($attachment->getUrl($isInline), ['Range' => 'bytes=-10']); + $resp->assertStreamedContent('0123456789'); + $resp->assertHeader('Content-Length', '10'); + $resp->assertHeader('Content-Range', 'bytes 1995-2004/2005'); + $resp->assertStatus(206); + + // Range across sniff point + $resp = $this->get($attachment->getUrl($isInline), ['Range' => 'bytes=1997-2002']); + $resp->assertStreamedContent('234567'); + $resp->assertHeader('Content-Length', '6'); + $resp->assertHeader('Content-Range', 'bytes 1997-2002/2005'); + $resp->assertStatus(206); + + // Range up to sniff point + $resp = $this->get($attachment->getUrl($isInline), ['Range' => 'bytes=0-1997']); + $resp->assertHeader('Content-Length', '1998'); + $resp->assertHeader('Content-Range', 'bytes 0-1997/2005'); + $resp->assertStreamedContent(substr($content, 0, 1998)); + $resp->assertStatus(206); + + // Range beyond sniff point + $resp = $this->get($attachment->getUrl($isInline), ['Range' => 'bytes=2001-2003']); + $resp->assertStreamedContent('678'); + $resp->assertHeader('Content-Length', '3'); + $resp->assertHeader('Content-Range', 'bytes 2001-2003/2005'); + $resp->assertStatus(206); + + // Range beyond content + $resp = $this->get($attachment->getUrl($isInline), ['Range' => 'bytes=0-2010']); + $resp->assertStreamedContent($content); + $resp->assertHeader('Content-Length', '2005'); + $resp->assertHeaderMissing('Content-Range'); + $resp->assertStatus(200); + + // Range start before end + $resp = $this->get($attachment->getUrl($isInline), ['Range' => 'bytes=50-10']); + $resp->assertStreamedContent($content); + $resp->assertHeader('Content-Length', '2005'); + $resp->assertHeader('Content-Range', 'bytes */2005'); + $resp->assertStatus(416); + } + + $this->files->deleteAllAttachmentFiles(); + } } From c1552fb799cda7fbb6de27ebcb01aa2580fd5330 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Mon, 15 Jan 2024 11:50:05 +0000 Subject: [PATCH 05/79] Attachments: Drag and drop video support Supports dragging and dropping video attahchments to embed them in the editor as HTML video tags. --- app/Uploads/Attachment.php | 19 +++++++++++++++++-- .../views/attachments/manager-list.blade.php | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/Uploads/Attachment.php b/app/Uploads/Attachment.php index 4fd6d4cdcb7..57d7cb3346c 100644 --- a/app/Uploads/Attachment.php +++ b/app/Uploads/Attachment.php @@ -77,7 +77,22 @@ public function getUrl($openInline = false): string } /** - * Generate a HTML link to this attachment. + * Get the representation of this attachment in a format suitable for the page editors. + * Detects and adapts video content to use an inline video embed. + */ + public function editorContent(): array + { + $videoExtensions = ['mp4', 'webm', 'mkv', 'ogg', 'avi']; + if (in_array(strtolower($this->extension), $videoExtensions)) { + $html = ''; + return ['text/html' => $html, 'text/plain' => $html]; + } + + return ['text/html' => $this->htmlLink(), 'text/plain' => $this->markdownLink()]; + } + + /** + * Generate the HTML link to this attachment. */ public function htmlLink(): string { @@ -85,7 +100,7 @@ public function htmlLink(): string } /** - * Generate a markdown link to this attachment. + * Generate a MarkDown link to this attachment. */ public function markdownLink(): string { diff --git a/resources/views/attachments/manager-list.blade.php b/resources/views/attachments/manager-list.blade.php index 342b46dcad7..0e841a042f7 100644 --- a/resources/views/attachments/manager-list.blade.php +++ b/resources/views/attachments/manager-list.blade.php @@ -4,7 +4,7 @@
@icon('grip')
From 2dc454d206b518804aecd0551a71d338cf889c08 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Mon, 15 Jan 2024 13:36:04 +0000 Subject: [PATCH 06/79] Uploads: Explicitly disabled s3 streaming in config This was the default option anyway, just adding here for better visibility of this being set. Can't enable without issues as the app will attempt to seek which does not work for these streams. Also have not tested on non-s3, s3-like systems. --- app/Config/filesystems.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Config/filesystems.php b/app/Config/filesystems.php index e6ae0fed364..1319c8886f6 100644 --- a/app/Config/filesystems.php +++ b/app/Config/filesystems.php @@ -58,6 +58,7 @@ 'endpoint' => env('STORAGE_S3_ENDPOINT', null), 'use_path_style_endpoint' => env('STORAGE_S3_ENDPOINT', null) !== null, 'throw' => true, + 'stream_reads' => false, ], ], From 655ae5ecaeba3eaea73bd20c970387f1fa993e6a Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Tue, 23 Jan 2024 12:31:44 +0000 Subject: [PATCH 07/79] Text: Tweaks to EN text for consistency/readability As suggested by Tim in discord chat. --- lang/en/activities.php | 6 +++--- lang/en/settings.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/en/activities.php b/lang/en/activities.php index d5b55c03dcb..092398ef0e1 100644 --- a/lang/en/activities.php +++ b/lang/en/activities.php @@ -93,11 +93,11 @@ 'user_delete_notification' => 'User successfully removed', // API Tokens - 'api_token_create' => 'created api token', + 'api_token_create' => 'created API token', 'api_token_create_notification' => 'API token successfully created', - 'api_token_update' => 'updated api token', + 'api_token_update' => 'updated API token', 'api_token_update_notification' => 'API token successfully updated', - 'api_token_delete' => 'deleted api token', + 'api_token_delete' => 'deleted API token', 'api_token_delete_notification' => 'API token successfully deleted', // Roles diff --git a/lang/en/settings.php b/lang/en/settings.php index 03e9bf462e2..7b7f5d2a2e3 100644 --- a/lang/en/settings.php +++ b/lang/en/settings.php @@ -109,7 +109,7 @@ 'recycle_bin_contents_empty' => 'The recycle bin is currently empty', 'recycle_bin_empty' => 'Empty Recycle Bin', 'recycle_bin_empty_confirm' => 'This will permanently destroy all items in the recycle bin including content contained within each item. Are you sure you want to empty the recycle bin?', - 'recycle_bin_destroy_confirm' => 'This action will permanently delete this item, along with any child elements listed below, from the system and you will not be able to restore this content. Are you sure you want to permanently delete this item?', + 'recycle_bin_destroy_confirm' => 'This action will permanently delete this item from the system, along with any child elements listed below, and you will not be able to restore this content. Are you sure you want to permanently delete this item?', 'recycle_bin_destroy_list' => 'Items to be Destroyed', 'recycle_bin_restore_list' => 'Items to be Restored', 'recycle_bin_restore_confirm' => 'This action will restore the deleted item, including any child elements, to their original location. If the original location has since been deleted, and is now in the recycle bin, the parent item will also need to be restored.', From 788327fffb044a03ccc490be0bcddd48e3551b01 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Tue, 23 Jan 2024 15:01:07 +0000 Subject: [PATCH 08/79] Attachment List: Fixed broken ctrl-click functionality Fixes #4782 --- resources/js/components/attachments-list.js | 8 ++++---- resources/views/attachments/list.blade.php | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/resources/js/components/attachments-list.js b/resources/js/components/attachments-list.js index 4db09977fec..665904f8616 100644 --- a/resources/js/components/attachments-list.js +++ b/resources/js/components/attachments-list.js @@ -9,6 +9,8 @@ export class AttachmentsList extends Component { setup() { this.container = this.$el; + this.fileLinks = this.$manyRefs.linkTypeFile; + this.setupListeners(); } @@ -27,8 +29,7 @@ export class AttachmentsList extends Component { } addOpenQueryToLinks() { - const links = this.container.querySelectorAll('a.attachment-file'); - for (const link of links) { + for (const link of this.fileLinks) { if (link.href.split('?')[1] !== 'open=true') { link.href += '?open=true'; link.setAttribute('target', '_blank'); @@ -37,8 +38,7 @@ export class AttachmentsList extends Component { } removeOpenQueryFromLinks() { - const links = this.container.querySelectorAll('a.attachment-file'); - for (const link of links) { + for (const link of this.fileLinks) { link.href = link.href.split('?')[0]; link.removeAttribute('target'); } diff --git a/resources/views/attachments/list.blade.php b/resources/views/attachments/list.blade.php index a6ffb709b4d..71197cc19c0 100644 --- a/resources/views/attachments/list.blade.php +++ b/resources/views/attachments/list.blade.php @@ -2,7 +2,9 @@ @foreach($attachments as $attachment)
- external) target="_blank" @endif> + external) target="_blank" @endif>
@icon($attachment->external ? 'export' : 'file')
{{ $attachment->name }}
From 69c8ff5c2d491d8674e2671a912a025cf16f86d3 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Tue, 23 Jan 2024 15:39:09 +0000 Subject: [PATCH 09/79] Entity selector: Fixed initial load overwriting initial search This changes how initial searches can be handled via config rather than specific action so they can be considered in how the initial data load is done, to prevent the default empty state loading and overwriting the search data if it lands later (which was commonly likely). For #4778 --- resources/js/components/entity-selector-popup.js | 7 +------ resources/js/components/entity-selector.js | 13 ++++++++----- resources/js/components/page-picker.js | 3 ++- resources/js/markdown/actions.js | 3 ++- resources/js/wysiwyg/config.js | 3 ++- resources/js/wysiwyg/shortcuts.js | 3 ++- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/resources/js/components/entity-selector-popup.js b/resources/js/components/entity-selector-popup.js index 6fb46196885..29c06e90951 100644 --- a/resources/js/components/entity-selector-popup.js +++ b/resources/js/components/entity-selector-popup.js @@ -18,18 +18,13 @@ export class EntitySelectorPopup extends Component { /** * Show the selector popup. * @param {Function} callback - * @param {String} searchText * @param {EntitySelectorSearchOptions} searchOptions */ - show(callback, searchText = '', searchOptions = {}) { + show(callback, searchOptions = {}) { this.callback = callback; this.getSelector().configureSearchOptions(searchOptions); this.getPopup().show(); - if (searchText) { - this.getSelector().searchText(searchText); - } - this.getSelector().focusSearch(); } diff --git a/resources/js/components/entity-selector.js b/resources/js/components/entity-selector.js index 5ad9914378e..561370d7a34 100644 --- a/resources/js/components/entity-selector.js +++ b/resources/js/components/entity-selector.js @@ -6,6 +6,7 @@ import {Component} from './component'; * @property entityTypes string * @property entityPermission string * @property searchEndpoint string + * @property initialValue string */ /** @@ -25,6 +26,7 @@ export class EntitySelector extends Component { entityTypes: this.$opts.entityTypes || 'page,book,chapter', entityPermission: this.$opts.entityPermission || 'view', searchEndpoint: this.$opts.searchEndpoint || '', + initialValue: this.searchInput.value || '', }; this.search = ''; @@ -44,6 +46,7 @@ export class EntitySelector extends Component { configureSearchOptions(options) { Object.assign(this.searchOptions, options); this.reset(); + this.searchInput.value = this.searchOptions.initialValue; } setupListeners() { @@ -108,11 +111,6 @@ export class EntitySelector extends Component { this.searchInput.focus(); } - searchText(queryText) { - this.searchInput.value = queryText; - this.searchEntities(queryText); - } - showLoading() { this.loading.style.display = 'block'; this.resultsContainer.style.display = 'none'; @@ -128,6 +126,11 @@ export class EntitySelector extends Component { throw new Error('Search endpoint not set for entity-selector load'); } + if (this.searchOptions.initialValue) { + this.searchEntities(this.searchOptions.initialValue); + return; + } + window.$http.get(this.searchUrl()).then(resp => { this.resultsContainer.innerHTML = resp.data; this.hideLoading(); diff --git a/resources/js/components/page-picker.js b/resources/js/components/page-picker.js index 39af6722993..5ab51159570 100644 --- a/resources/js/components/page-picker.js +++ b/resources/js/components/page-picker.js @@ -35,7 +35,8 @@ export class PagePicker extends Component { const selectorPopup = window.$components.first('entity-selector-popup'); selectorPopup.show(entity => { this.setValue(entity.id, entity.name); - }, '', { + }, { + initialValue: '', searchEndpoint: this.selectorEndpoint, entityTypes: 'page', entityPermission: 'view', diff --git a/resources/js/markdown/actions.js b/resources/js/markdown/actions.js index 511f1ebdae6..73040a57b1e 100644 --- a/resources/js/markdown/actions.js +++ b/resources/js/markdown/actions.js @@ -73,7 +73,8 @@ export class Actions { const selectedText = selectionText || entity.name; const newText = `[${selectedText}](${entity.link})`; this.#replaceSelection(newText, newText.length, selectionRange); - }, selectionText, { + }, { + initialValue: selectionText, searchEndpoint: '/search/entity-selector', entityTypes: 'page,book,chapter,bookshelf', entityPermission: 'view', diff --git a/resources/js/wysiwyg/config.js b/resources/js/wysiwyg/config.js index 963e2970d34..6c96e47e9c3 100644 --- a/resources/js/wysiwyg/config.js +++ b/resources/js/wysiwyg/config.js @@ -85,7 +85,8 @@ function filePickerCallback(callback, value, meta) { text: entity.name, title: entity.name, }); - }, selectionText, { + }, { + initialValue: selectionText, searchEndpoint: '/search/entity-selector', entityTypes: 'page,book,chapter,bookshelf', entityPermission: 'view', diff --git a/resources/js/wysiwyg/shortcuts.js b/resources/js/wysiwyg/shortcuts.js index da9e0227099..dbc725b1dcd 100644 --- a/resources/js/wysiwyg/shortcuts.js +++ b/resources/js/wysiwyg/shortcuts.js @@ -58,7 +58,8 @@ export function register(editor) { editor.selection.collapse(false); editor.focus(); - }, selectionText, { + }, { + initialValue: selectionText, searchEndpoint: '/search/entity-selector', entityTypes: 'page,book,chapter,bookshelf', entityPermission: 'view', From 8c6b1164724fffd1766792fb3d6fef4972ba1b9e Mon Sep 17 00:00:00 2001 From: Sascha Date: Tue, 23 Jan 2024 21:37:00 +0100 Subject: [PATCH 10/79] Update TrashCan.php remove duplicate call of $page->forceDelete(); --- app/Entities/Tools/TrashCan.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/Entities/Tools/TrashCan.php b/app/Entities/Tools/TrashCan.php index e5bcfe71ac2..8e9f010df0f 100644 --- a/app/Entities/Tools/TrashCan.php +++ b/app/Entities/Tools/TrashCan.php @@ -206,8 +206,6 @@ protected function destroyPage(Page $page): int Book::query()->where('default_template_id', '=', $page->id) ->update(['default_template_id' => null]); - $page->forceDelete(); - // Remove chapter template usages Chapter::query()->where('default_template_id', '=', $page->id) ->update(['default_template_id' => null]); From 0fc02a2532fd33c443838de77f5700df220b79c9 Mon Sep 17 00:00:00 2001 From: Sascha Date: Tue, 23 Jan 2024 22:37:15 +0100 Subject: [PATCH 11/79] fixed error from phpcs --- app/Entities/Controllers/PageController.php | 4 ++-- app/Entities/Repos/PageRepo.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Entities/Controllers/PageController.php b/app/Entities/Controllers/PageController.php index 74dd4f531b4..eaad3c0b79d 100644 --- a/app/Entities/Controllers/PageController.php +++ b/app/Entities/Controllers/PageController.php @@ -260,7 +260,7 @@ public function showDelete(string $bookSlug, string $pageSlug) $page = $this->pageRepo->getBySlug($bookSlug, $pageSlug); $this->checkOwnablePermission('page-delete', $page); $this->setPageTitle(trans('entities.pages_delete_named', ['pageName' => $page->getShortName()])); - $usedAsTemplate = + $usedAsTemplate = Book::query()->where('default_template_id', '=', $page->id)->count() > 0 || Chapter::query()->where('default_template_id', '=', $page->id)->count() > 0; @@ -282,7 +282,7 @@ public function showDeleteDraft(string $bookSlug, int $pageId) $page = $this->pageRepo->getById($pageId); $this->checkOwnablePermission('page-update', $page); $this->setPageTitle(trans('entities.pages_delete_draft_named', ['pageName' => $page->getShortName()])); - $usedAsTemplate = + $usedAsTemplate = Book::query()->where('default_template_id', '=', $page->id)->count() > 0 || Chapter::query()->where('default_template_id', '=', $page->id)->count() > 0; diff --git a/app/Entities/Repos/PageRepo.php b/app/Entities/Repos/PageRepo.php index 67c4b222547..d9bda019892 100644 --- a/app/Entities/Repos/PageRepo.php +++ b/app/Entities/Repos/PageRepo.php @@ -142,7 +142,7 @@ public function getNewDraftPage(Entity $parent) } else { $defaultTemplate = $page->book->defaultTemplate; } - + if ($defaultTemplate && userCan('view', $defaultTemplate)) { $page->forceFill([ 'html' => $defaultTemplate->html, From 14ecb19b054e6b915f8f37104793fb98cd962b13 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Wed, 24 Jan 2024 10:22:13 +0000 Subject: [PATCH 12/79] Merged l10n_development into v23-12 Squash merge Closes #4779 --- lang/cy/activities.php | 62 ++++++------ lang/cy/auth.php | 22 ++--- lang/cy/common.php | 98 +++++++++--------- lang/cy/components.php | 16 +-- lang/cy/editor.php | 76 +++++++------- lang/cy/notifications.php | 20 ++-- lang/cy/pagination.php | 4 +- lang/fr/entities.php | 12 +-- lang/fr/notifications.php | 2 +- lang/he/common.php | 4 +- lang/he/notifications.php | 34 +++---- lang/ko/activities.php | 102 +++++++++---------- lang/ko/auth.php | 2 +- lang/ko/common.php | 8 +- lang/ko/components.php | 18 ++-- lang/ko/editor.php | 6 +- lang/ko/entities.php | 202 +++++++++++++++++++------------------- lang/ko/errors.php | 100 +++++++++---------- lang/ko/notifications.php | 34 +++---- lang/ko/preferences.php | 58 +++++------ lang/ko/settings.php | 62 ++++++------ lang/ko/validation.php | 2 +- lang/lv/activities.php | 52 +++++----- lang/lv/components.php | 18 ++-- lang/lv/entities.php | 24 ++--- lang/lv/errors.php | 10 +- lang/lv/preferences.php | 42 ++++---- lang/lv/settings.php | 16 +-- lang/nl/activities.php | 78 +++++++-------- lang/nl/auth.php | 14 +-- lang/nl/entities.php | 122 +++++++++++------------ lang/nl/errors.php | 6 +- lang/nl/settings.php | 14 +-- lang/sq/activities.php | 170 ++++++++++++++++---------------- lang/sq/auth.php | 48 ++++----- 35 files changed, 779 insertions(+), 779 deletions(-) diff --git a/lang/cy/activities.php b/lang/cy/activities.php index 2c474c673ba..b3301d757b8 100644 --- a/lang/cy/activities.php +++ b/lang/cy/activities.php @@ -6,26 +6,26 @@ return [ // Pages - 'page_create' => 'tudalen wedi\'i chreu', + 'page_create' => 'creodd dudalen', 'page_create_notification' => 'Tudalen wedi\'i chreu\'n llwyddiannus', - 'page_update' => 'tudalen wedi\'i diweddaru', + 'page_update' => 'diweddarodd dudalen', 'page_update_notification' => 'Tudalen wedi\'i diweddaru\'n llwyddiannus', - 'page_delete' => 'tudalen wedi\'i dileu', - 'page_delete_notification' => 'Cafodd y dudalen ei dileu yn llwyddiannus', - 'page_restore' => 'tudalen wedi\'i hadfer', - 'page_restore_notification' => 'Cafodd y dudalen ei hadfer yn llwyddiannus', - 'page_move' => 'symwyd tudalen', - 'page_move_notification' => 'Page successfully moved', + 'page_delete' => 'dileodd dudalen', + 'page_delete_notification' => 'Tudalen wedi\'i dileu\'n llwyddiannus', + 'page_restore' => 'adferodd dudalen', + 'page_restore_notification' => 'Tudalen wedi\'i hadfer yn llwyddiannus', + 'page_move' => 'symydodd dudalen', + 'page_move_notification' => 'Tudalen wedi\'i symud yn llwyddianus', // Chapters - 'chapter_create' => 'pennod creu', + 'chapter_create' => 'creodd bennod', 'chapter_create_notification' => 'Pennod wedi\'i chreu\'n llwyddiannus', 'chapter_update' => 'pennod wedi diweddaru', 'chapter_update_notification' => 'Pennod wedi\'i diweddaru\'n llwyddiannus', 'chapter_delete' => 'pennod wedi dileu', 'chapter_delete_notification' => 'Pennod wedi\'i dileu\'n llwyddiannus', 'chapter_move' => 'pennod wedi symud', - 'chapter_move_notification' => 'Chapter successfully moved', + 'chapter_move_notification' => 'Pennod wedi\'i symud yn llwyddianus', // Books 'book_create' => 'llyfr wedi creu', @@ -40,14 +40,14 @@ 'book_sort_notification' => 'Ail-archebwyd y llyfr yn llwyddiannus', // Bookshelves - 'bookshelf_create' => 'created shelf', - 'bookshelf_create_notification' => 'Shelf successfully created', + 'bookshelf_create' => 'creodd silff', + 'bookshelf_create_notification' => 'Silff wedi\'i chreu\'n llwyddiannus', 'bookshelf_create_from_book' => 'converted book to shelf', 'bookshelf_create_from_book_notification' => 'Book successfully converted to a shelf', - 'bookshelf_update' => 'updated shelf', - 'bookshelf_update_notification' => 'Shelf successfully updated', - 'bookshelf_delete' => 'deleted shelf', - 'bookshelf_delete_notification' => 'Shelf successfully deleted', + 'bookshelf_update' => 'diweddarodd silff', + 'bookshelf_update_notification' => 'Silff wedi\'i diweddaru\'n llwyddiannus', + 'bookshelf_delete' => 'dileodd silff', + 'bookshelf_delete_notification' => 'Silff wedi\'i dileu\'n llwyddiannus', // Revisions 'revision_restore' => 'restored revision', @@ -62,7 +62,7 @@ 'watch_update_level_notification' => 'Watch preferences successfully updated', // Auth - 'auth_login' => 'logged in', + 'auth_login' => 'wedi\'u mewngofnodi', 'auth_register' => 'registered as new user', 'auth_password_reset_request' => 'requested user password reset', 'auth_password_reset_update' => 'reset user password', @@ -85,20 +85,20 @@ 'webhook_delete_notification' => 'Webhook wedi\'i dileu\'n llwyddiannus', // Users - 'user_create' => 'created user', - 'user_create_notification' => 'User successfully created', - 'user_update' => 'updated user', + 'user_create' => 'creodd ddefnyddiwr', + 'user_create_notification' => 'Defnyddiwr wedi\'i greu\'n llwyddiannus', + 'user_update' => 'diweddarodd ddefnyddiwr', 'user_update_notification' => 'Diweddarwyd y defnyddiwr yn llwyddiannus', - 'user_delete' => 'deleted user', + 'user_delete' => 'dileodd ddefnyddiwr', 'user_delete_notification' => 'Tynnwyd y defnyddiwr yn llwyddiannus', // API Tokens - 'api_token_create' => 'created api token', - 'api_token_create_notification' => 'API token successfully created', - 'api_token_update' => 'updated api token', - 'api_token_update_notification' => 'API token successfully updated', - 'api_token_delete' => 'deleted api token', - 'api_token_delete_notification' => 'API token successfully deleted', + 'api_token_create' => 'creodd tocyn api', + 'api_token_create_notification' => 'Tocyn API wedi\'i greu\'n llwyddiannus', + 'api_token_update' => 'diweddarodd docyn api', + 'api_token_update_notification' => 'Tocyn API wedi\'i ddiweddaru\'n llwyddiannus', + 'api_token_delete' => 'dileodd docyn api', + 'api_token_delete_notification' => 'Tocyn API wedi\'i ddileu\'n llwyddiannus', // Roles 'role_create' => 'created role', @@ -109,15 +109,15 @@ 'role_delete_notification' => 'Role successfully deleted', // Recycle Bin - 'recycle_bin_empty' => 'emptied recycle bin', + 'recycle_bin_empty' => 'gwagodd fin ailgylchu', 'recycle_bin_restore' => 'restored from recycle bin', 'recycle_bin_destroy' => 'removed from recycle bin', // Comments 'commented_on' => 'gwnaeth sylwadau ar', - 'comment_create' => 'added comment', - 'comment_update' => 'updated comment', - 'comment_delete' => 'deleted comment', + 'comment_create' => 'ychwanegodd sylw', + 'comment_update' => 'diweddarodd sylw', + 'comment_delete' => 'dileodd sylw', // Other 'permissions_update' => 'caniatadau wedi\'u diweddaru', diff --git a/lang/cy/auth.php b/lang/cy/auth.php index 6be96308076..94fc0b6b54b 100644 --- a/lang/cy/auth.php +++ b/lang/cy/auth.php @@ -54,30 +54,30 @@ 'email_reset_not_requested' => 'If you did not request a password reset, no further action is required.', // Email Confirmation - 'email_confirm_subject' => 'Confirm your email on :appName', - 'email_confirm_greeting' => 'Thanks for joining :appName!', - 'email_confirm_text' => 'Please confirm your email address by clicking the button below:', - 'email_confirm_action' => 'Confirm Email', + 'email_confirm_subject' => 'Cadarnhewch eich e-bost chi a :appName', + 'email_confirm_greeting' => 'Diolch am ymuno â :appName!', + 'email_confirm_text' => 'Os gwelwch yn dda cadarnhewch eich e-bost chi gan clicio ar y botwm isod:', + 'email_confirm_action' => 'Cadarnhau E-bost', 'email_confirm_send_error' => 'Email confirmation required but the system could not send the email. Contact the admin to ensure email is set up correctly.', 'email_confirm_success' => 'Your email has been confirmed! You should now be able to login using this email address.', 'email_confirm_resent' => 'Confirmation email resent, Please check your inbox.', - 'email_confirm_thanks' => 'Thanks for confirming!', + 'email_confirm_thanks' => 'Diolch am gadarnhau!', 'email_confirm_thanks_desc' => 'Please wait a moment while your confirmation is handled. If you are not redirected after 3 seconds press the "Continue" link below to proceed.', - 'email_not_confirmed' => 'Email Address Not Confirmed', - 'email_not_confirmed_text' => 'Your email address has not yet been confirmed.', + 'email_not_confirmed' => 'Cyfeiriad E-bost heb ei Gadarnhau', + 'email_not_confirmed_text' => 'Dyw eich cyfeiriad e-bost chi ddim wedi cael ei gadarnhau eto.', 'email_not_confirmed_click_link' => 'Please click the link in the email that was sent shortly after you registered.', 'email_not_confirmed_resend' => 'If you cannot find the email you can re-send the confirmation email by submitting the form below.', 'email_not_confirmed_resend_button' => 'Resend Confirmation Email', // User Invite 'user_invite_email_subject' => 'You have been invited to join :appName!', - 'user_invite_email_greeting' => 'An account has been created for you on :appName.', + 'user_invite_email_greeting' => 'Mae cyfrif wedi cae ei greu i chi ar :appName.', 'user_invite_email_text' => 'Click the button below to set an account password and gain access:', 'user_invite_email_action' => 'Set Account Password', - 'user_invite_page_welcome' => 'Welcome to :appName!', + 'user_invite_page_welcome' => 'Croeso i :appName!', 'user_invite_page_text' => 'To finalise your account and gain access you need to set a password which will be used to log-in to :appName on future visits.', - 'user_invite_page_confirm_button' => 'Confirm Password', + 'user_invite_page_confirm_button' => 'Cadarnhau cyfrinair', 'user_invite_success_login' => 'Password set, you should now be able to login using your set password to access :appName!', // Multi-factor Authentication @@ -88,7 +88,7 @@ 'mfa_setup_remove_confirmation' => 'Are you sure you want to remove this multi-factor authentication method?', 'mfa_setup_action' => 'Setup', 'mfa_backup_codes_usage_limit_warning' => 'You have less than 5 backup codes remaining, Please generate and store a new set before you run out of codes to prevent being locked out of your account.', - 'mfa_option_totp_title' => 'Mobile App', + 'mfa_option_totp_title' => 'Ap Ffôn Symudol', 'mfa_option_totp_desc' => 'To use multi-factor authentication you\'ll need a mobile application that supports TOTP such as Google Authenticator, Authy or Microsoft Authenticator.', 'mfa_option_backup_codes_title' => 'Backup Codes', 'mfa_option_backup_codes_desc' => 'Securely store a set of one-time-use backup codes which you can enter to verify your identity.', diff --git a/lang/cy/common.php b/lang/cy/common.php index 27037babec0..e359e8ba361 100644 --- a/lang/cy/common.php +++ b/lang/cy/common.php @@ -5,61 +5,61 @@ return [ // Buttons - 'cancel' => 'Cancel', - 'close' => 'Close', - 'confirm' => 'Confirm', - 'back' => 'Back', - 'save' => 'Save', - 'continue' => 'Continue', - 'select' => 'Select', + 'cancel' => 'Canslo', + 'close' => 'Cau', + 'confirm' => 'Cadarnhau', + 'back' => 'Yn ôl', + 'save' => 'Cadw', + 'continue' => 'Parhau', + 'select' => 'Dewis', 'toggle_all' => 'Toggle All', - 'more' => 'More', + 'more' => 'Mwy', // Form Labels - 'name' => 'Name', - 'description' => 'Description', + 'name' => 'Enw', + 'description' => 'Disgrifiad', 'role' => 'Role', 'cover_image' => 'Cover image', 'cover_image_description' => 'This image should be approx 440x250px.', // Actions - 'actions' => 'Actions', - 'view' => 'View', - 'view_all' => 'View All', - 'new' => 'New', - 'create' => 'Create', - 'update' => 'Update', - 'edit' => 'Edit', - 'sort' => 'Sort', - 'move' => 'Move', - 'copy' => 'Copy', - 'reply' => 'Reply', - 'delete' => 'Delete', - 'delete_confirm' => 'Confirm Deletion', - 'search' => 'Search', - 'search_clear' => 'Clear Search', - 'reset' => 'Reset', - 'remove' => 'Remove', - 'add' => 'Add', - 'configure' => 'Configure', - 'manage' => 'Manage', + 'actions' => 'Gweithredoedd', + 'view' => 'Gweld', + 'view_all' => 'Gweld popeth', + 'new' => 'Newydd', + 'create' => 'Creu', + 'update' => 'Diweddaru', + 'edit' => 'Golygu', + 'sort' => 'Trefnu', + 'move' => 'Symud', + 'copy' => 'Copïo', + 'reply' => 'Ateb', + 'delete' => 'Dileu', + 'delete_confirm' => 'Cadarnhau\'r dilead', + 'search' => 'Chwilio', + 'search_clear' => 'Clirio\'r chwiliad', + 'reset' => 'Ailosod', + 'remove' => 'Diddymu', + 'add' => 'Ychwanegu', + 'configure' => 'Ffurfweddu', + 'manage' => 'Rheoli', 'fullscreen' => 'Fullscreen', 'favourite' => 'Favourite', 'unfavourite' => 'Unfavourite', - 'next' => 'Next', - 'previous' => 'Previous', - 'filter_active' => 'Active Filter:', - 'filter_clear' => 'Clear Filter', - 'download' => 'Download', - 'open_in_tab' => 'Open in Tab', - 'open' => 'Open', + 'next' => 'Nesa', + 'previous' => 'Cynt', + 'filter_active' => 'Hidl weithredol:', + 'filter_clear' => 'Clirio\'r hidl', + 'download' => 'Llwytho i lawr', + 'open_in_tab' => 'Agor mewn Tab', + 'open' => 'Agor', // Sort Options - 'sort_options' => 'Sort Options', + 'sort_options' => 'Trefnu\'r opsiynau', 'sort_direction_toggle' => 'Sort Direction Toggle', - 'sort_ascending' => 'Sort Ascending', - 'sort_descending' => 'Sort Descending', - 'sort_name' => 'Name', + 'sort_ascending' => 'Trefnu\'n esgynnol', + 'sort_descending' => 'Trefnu\'n ddisgynnol', + 'sort_name' => 'Enw', 'sort_default' => 'Default', 'sort_created_at' => 'Created Date', 'sort_updated_at' => 'Updated Date', @@ -67,8 +67,8 @@ // Misc 'deleted_user' => 'Deleted User', 'no_activity' => 'No activity to show', - 'no_items' => 'No items available', - 'back_to_top' => 'Back to top', + 'no_items' => 'Dim eitemau ar gael', + 'back_to_top' => 'Yn ôl i\'r brig', 'skip_to_main_content' => 'Skip to main content', 'toggle_details' => 'Toggle Details', 'toggle_thumbnails' => 'Toggle Thumbnails', @@ -78,10 +78,10 @@ 'default' => 'Default', 'breadcrumb' => 'Breadcrumb', 'status' => 'Status', - 'status_active' => 'Active', - 'status_inactive' => 'Inactive', - 'never' => 'Never', - 'none' => 'None', + 'status_active' => 'Gweithredol', + 'status_inactive' => 'Anweithredol', + 'never' => 'Byth', + 'none' => 'Dim un', // Header 'homepage' => 'Homepage', @@ -94,9 +94,9 @@ 'global_search' => 'Global Search', // Layout tabs - 'tab_info' => 'Info', + 'tab_info' => 'Gwybodaeth', 'tab_info_label' => 'Tab: Show Secondary Information', - 'tab_content' => 'Content', + 'tab_content' => 'Cynnwys', 'tab_content_label' => 'Tab: Show Primary Content', // Email Content diff --git a/lang/cy/components.php b/lang/cy/components.php index c33b1d0b791..9286c456346 100644 --- a/lang/cy/components.php +++ b/lang/cy/components.php @@ -6,28 +6,28 @@ // Image Manager 'image_select' => 'Image Select', - 'image_list' => 'Image List', - 'image_details' => 'Image Details', + 'image_list' => 'Rhestr o Ddelweddau', + 'image_details' => 'Manylion Delwedd', 'image_upload' => 'Upload Image', 'image_intro' => 'Here you can select and manage images that have been previously uploaded to the system.', 'image_intro_upload' => 'Upload a new image by dragging an image file into this window, or by using the "Upload Image" button above.', - 'image_all' => 'All', - 'image_all_title' => 'View all images', + 'image_all' => 'Popeth', + 'image_all_title' => 'Gweld holl ddelweddau', 'image_book_title' => 'View images uploaded to this book', 'image_page_title' => 'View images uploaded to this page', - 'image_search_hint' => 'Search by image name', + 'image_search_hint' => 'Cwilio gan enw delwedd', 'image_uploaded' => 'Uploaded :uploadedDate', 'image_uploaded_by' => 'Uploaded by :userName', 'image_uploaded_to' => 'Uploaded to :pageLink', 'image_updated' => 'Updated :updateDate', 'image_load_more' => 'Load More', - 'image_image_name' => 'Image Name', + 'image_image_name' => 'Enw Delwedd', 'image_delete_used' => 'This image is used in the pages below.', - 'image_delete_confirm_text' => 'Are you sure you want to delete this image?', + 'image_delete_confirm_text' => 'Wyt ti\'n bendant eisiau dileu\'r ddelwedd hwn?', 'image_select_image' => 'Select Image', 'image_dropzone' => 'Drop images or click here to upload', 'image_dropzone_drop' => 'Drop images here to upload', - 'images_deleted' => 'Images Deleted', + 'images_deleted' => 'Delweddau wedi\'u Dileu', 'image_preview' => 'Image Preview', 'image_upload_success' => 'Image uploaded successfully', 'image_update_success' => 'Image details successfully updated', diff --git a/lang/cy/editor.php b/lang/cy/editor.php index 670c1c5e1ac..5ad569a8ed4 100644 --- a/lang/cy/editor.php +++ b/lang/cy/editor.php @@ -9,47 +9,47 @@ // General editor terms 'general' => 'General', 'advanced' => 'Advanced', - 'none' => 'None', - 'cancel' => 'Cancel', - 'save' => 'Save', - 'close' => 'Close', - 'undo' => 'Undo', - 'redo' => 'Redo', - 'left' => 'Left', - 'center' => 'Center', - 'right' => 'Right', - 'top' => 'Top', - 'middle' => 'Middle', - 'bottom' => 'Bottom', - 'width' => 'Width', - 'height' => 'Height', - 'More' => 'More', - 'select' => 'Select...', + 'none' => 'Dim un', + 'cancel' => 'Canslo', + 'save' => 'Cadw', + 'close' => 'Cau', + 'undo' => 'Dadwneud', + 'redo' => 'Ail-wneud', + 'left' => 'Chwith', + 'center' => 'Canol', + 'right' => 'Dde', + 'top' => 'Pen', + 'middle' => 'Canol', + 'bottom' => 'Gwaelod', + 'width' => 'Lled', + 'height' => 'Uchder', + 'More' => 'Mwy', + 'select' => 'Dewis...', // Toolbar - 'formats' => 'Formats', - 'header_large' => 'Large Header', - 'header_medium' => 'Medium Header', - 'header_small' => 'Small Header', - 'header_tiny' => 'Tiny Header', - 'paragraph' => 'Paragraph', + 'formats' => 'Fformatau', + 'header_large' => 'Pennyn Mawr', + 'header_medium' => 'Pennyn Canolig', + 'header_small' => 'Pennyn Bach', + 'header_tiny' => 'Pennyn Mân', + 'paragraph' => 'Paragraff', 'blockquote' => 'Blockquote', 'inline_code' => 'Inline code', 'callouts' => 'Callouts', - 'callout_information' => 'Information', - 'callout_success' => 'Success', - 'callout_warning' => 'Warning', - 'callout_danger' => 'Danger', - 'bold' => 'Bold', - 'italic' => 'Italic', + 'callout_information' => 'Gwybodaeth', + 'callout_success' => 'Llwyddiant', + 'callout_warning' => 'Rhybudd', + 'callout_danger' => 'Perygl', + 'bold' => 'Trwm', + 'italic' => 'Italig', 'underline' => 'Underline', 'strikethrough' => 'Strikethrough', 'superscript' => 'Superscript', 'subscript' => 'Subscript', - 'text_color' => 'Text color', - 'custom_color' => 'Custom color', + 'text_color' => 'Lliw testun', + 'custom_color' => 'Lliw addasu', 'remove_color' => 'Remove color', - 'background_color' => 'Background color', + 'background_color' => 'Lliw cefnder', 'align_left' => 'Align left', 'align_center' => 'Align center', 'align_right' => 'Align right', @@ -112,18 +112,18 @@ 'paste_row_before' => 'Paste row before', 'paste_row_after' => 'Paste row after', 'row_type' => 'Row type', - 'row_type_header' => 'Header', + 'row_type_header' => 'Pennyn', 'row_type_body' => 'Body', - 'row_type_footer' => 'Footer', - 'alignment' => 'Alignment', + 'row_type_footer' => 'Troedyn', + 'alignment' => 'Aliniad', 'cut_column' => 'Cut column', 'copy_column' => 'Copy column', 'paste_column_before' => 'Paste column before', 'paste_column_after' => 'Paste column after', 'cell_padding' => 'Cell padding', 'cell_spacing' => 'Cell spacing', - 'caption' => 'Caption', - 'show_caption' => 'Show caption', + 'caption' => 'Pennawd', + 'show_caption' => 'Dangos pennawd', 'constrain' => 'Constrain proportions', 'cell_border_solid' => 'Solid', 'cell_border_dotted' => 'Dotted', @@ -143,7 +143,7 @@ 'paste_embed' => 'Paste your embed code below:', 'url' => 'URL', 'text_to_display' => 'Text to display', - 'title' => 'Title', + 'title' => 'Teitl', 'open_link' => 'Open link', 'open_link_in' => 'Open link in...', 'open_link_current' => 'Current window', @@ -170,5 +170,5 @@ 'shortcuts_intro' => 'The following shortcuts are available in the editor:', 'windows_linux' => '(Windows/Linux)', 'mac' => '(Mac)', - 'description' => 'Description', + 'description' => 'Disgrifiad', ]; diff --git a/lang/cy/notifications.php b/lang/cy/notifications.php index 1afd23f1dc4..b9f58ac2576 100644 --- a/lang/cy/notifications.php +++ b/lang/cy/notifications.php @@ -4,23 +4,23 @@ */ return [ - 'new_comment_subject' => 'New comment on page: :pageName', - 'new_comment_intro' => 'A user has commented on a page in :appName:', - 'new_page_subject' => 'New page: :pageName', - 'new_page_intro' => 'A new page has been created in :appName:', - 'updated_page_subject' => 'Updated page: :pageName', - 'updated_page_intro' => 'A page has been updated in :appName:', + 'new_comment_subject' => 'Sylw newydd ar dudalen :pageName', + 'new_comment_intro' => 'Mae defnyddiwr wedi sylw ar dudalen yn :appName:', + 'new_page_subject' => 'Tudalen newydd :pageName', + 'new_page_intro' => 'Mae tudalen newydd wedi cael ei chreu yn :appName:', + 'updated_page_subject' => 'Tudalen wedi\'i diweddaru :pageName', + 'updated_page_intro' => 'Mae tudalen newydd wedi cael ei diweddaru yn :appName:', 'updated_page_debounce' => 'To prevent a mass of notifications, for a while you won\'t be sent notifications for further edits to this page by the same editor.', - 'detail_page_name' => 'Page Name:', + 'detail_page_name' => 'Enw\'r dudalen:', 'detail_page_path' => 'Page Path:', 'detail_commenter' => 'Commenter:', - 'detail_comment' => 'Comment:', + 'detail_comment' => 'Sylw:', 'detail_created_by' => 'Created By:', 'detail_updated_by' => 'Updated By:', - 'action_view_comment' => 'View Comment', - 'action_view_page' => 'View Page', + 'action_view_comment' => 'Gweld y sylw', + 'action_view_page' => 'Gweld y dudalen', 'footer_reason' => 'This notification was sent to you because :link cover this type of activity for this item.', 'footer_reason_link' => 'your notification preferences', diff --git a/lang/cy/pagination.php b/lang/cy/pagination.php index 85bd12fc319..9cd781925e9 100644 --- a/lang/cy/pagination.php +++ b/lang/cy/pagination.php @@ -6,7 +6,7 @@ */ return [ - 'previous' => '« Previous', - 'next' => 'Next »', + 'previous' => '« Cynt', + 'next' => 'Nesa »', ]; diff --git a/lang/fr/entities.php b/lang/fr/entities.php index e890c278762..32351548b0c 100644 --- a/lang/fr/entities.php +++ b/lang/fr/entities.php @@ -23,7 +23,7 @@ 'meta_updated' => 'Mis à jour :timeLength', 'meta_updated_name' => 'Mis à jour :timeLength par :user', 'meta_owned_name' => 'Appartient à :user', - 'meta_reference_count' => 'Referenced by :count item|Referenced by :count items', + 'meta_reference_count' => 'Référencé sur :count élément|Référencé sur :count éléments', 'entity_select' => 'Sélectionner l\'entité', 'entity_select_lack_permission' => 'Vous n\'avez pas les permissions requises pour sélectionner cet élément', 'images' => 'Images', @@ -132,9 +132,9 @@ 'books_edit_named' => 'Modifier le livre :bookName', 'books_form_book_name' => 'Nom du livre', 'books_save' => 'Enregistrer le livre', - 'books_default_template' => 'Default Page Template', - 'books_default_template_explain' => 'Assign a page template that will be used as the default content for all new pages in this book. Keep in mind this will only be used if the page creator has view access to those chosen template page.', - 'books_default_template_select' => 'Select a template page', + 'books_default_template' => 'Modèle de page par défaut', + 'books_default_template_explain' => 'Sélectionnez un modèle de page qui sera utilisé comme contenu par défaut pour les nouvelles pages créées dans ce livre. Gardez à l\'esprit que le modèle ne sera utilisé que si le créateur de la page a accès au modèle sélectionné.', + 'books_default_template_select' => 'Sélectionnez un modèle de page', 'books_permissions' => 'Permissions du livre', 'books_permissions_updated' => 'Permissions du livre mises à jour', 'books_empty_contents' => 'Aucune page ou chapitre n\'a été ajouté à ce livre.', @@ -207,7 +207,7 @@ 'pages_delete_draft' => 'Supprimer le brouillon', 'pages_delete_success' => 'Page supprimée', 'pages_delete_draft_success' => 'Brouillon supprimé', - 'pages_delete_warning_template' => 'This page is in active use as a book default page template. These books will no longer have a default page template assigned after this page is deleted.', + 'pages_delete_warning_template' => 'Cette page est utilisée comme modèle de page par défaut dans un livre. Ces livres n\'utiliseront plus ce modèle après la suppression de cette page.', 'pages_delete_confirm' => 'Êtes-vous sûr(e) de vouloir supprimer cette page ?', 'pages_delete_draft_confirm' => 'Êtes-vous sûr(e) de vouloir supprimer ce brouillon ?', 'pages_editing_named' => 'Modification de la page :pageName', @@ -409,7 +409,7 @@ // References 'references' => 'Références', 'references_none' => 'Il n\'y a pas de références suivies à cet élément.', - 'references_to_desc' => 'Listed below is all the known content in the system that links to this item.', + 'references_to_desc' => 'Vous trouverez ci-dessous le contenu connu du système qui a un lien vers cet élément.', // Watch Options 'watch' => 'Suivre', diff --git a/lang/fr/notifications.php b/lang/fr/notifications.php index eb97ddfda31..5d7ae88f72b 100644 --- a/lang/fr/notifications.php +++ b/lang/fr/notifications.php @@ -13,7 +13,7 @@ 'updated_page_debounce' => 'Pour éviter de nombreuses notifications, pendant un certain temps, vous ne recevrez pas de notifications pour d\'autres modifications de cette page par le même éditeur.', 'detail_page_name' => 'Nom de la page :', - 'detail_page_path' => 'Page Path:', + 'detail_page_path' => 'Chemin de la page :', 'detail_commenter' => 'Commenta·teur·trice :', 'detail_comment' => 'Commentaire :', 'detail_created_by' => 'Créé par :', diff --git a/lang/he/common.php b/lang/he/common.php index 75dbd44936d..dafafe6ed18 100644 --- a/lang/he/common.php +++ b/lang/he/common.php @@ -6,7 +6,7 @@ // Buttons 'cancel' => 'ביטול', - 'close' => 'Close', + 'close' => 'סגור', 'confirm' => 'אישור', 'back' => 'אחורה', 'save' => 'שמור', @@ -42,7 +42,7 @@ 'remove' => 'הסר', 'add' => 'הוסף', 'configure' => 'הגדרות', - 'manage' => 'Manage', + 'manage' => 'נהל', 'fullscreen' => 'מסך מלא', 'favourite' => 'מועדף', 'unfavourite' => 'בטל מועדף', diff --git a/lang/he/notifications.php b/lang/he/notifications.php index 1afd23f1dc4..8385c0a6da3 100644 --- a/lang/he/notifications.php +++ b/lang/he/notifications.php @@ -4,24 +4,24 @@ */ return [ - 'new_comment_subject' => 'New comment on page: :pageName', - 'new_comment_intro' => 'A user has commented on a page in :appName:', - 'new_page_subject' => 'New page: :pageName', - 'new_page_intro' => 'A new page has been created in :appName:', - 'updated_page_subject' => 'Updated page: :pageName', - 'updated_page_intro' => 'A page has been updated in :appName:', - 'updated_page_debounce' => 'To prevent a mass of notifications, for a while you won\'t be sent notifications for further edits to this page by the same editor.', + 'new_comment_subject' => 'תגובה חדשה בדף: :pageName', + 'new_comment_intro' => 'משתמש רשם על עמוד ב :appName:', + 'new_page_subject' => 'עמוד חדש: PageName', + 'new_page_intro' => 'עמוד חדש נפתח ב:appName:', + 'updated_page_subject' => 'עמוד עודכן :pageName', + 'updated_page_intro' => 'דף עודכן ב:appName:', + 'updated_page_debounce' => 'על מנת לעצור הצפת התראות, לזמן מסוים אתה לא תקבל התראות על שינויים עתידיים בדף זה על ידי אותו עורך.', - 'detail_page_name' => 'Page Name:', - 'detail_page_path' => 'Page Path:', - 'detail_commenter' => 'Commenter:', - 'detail_comment' => 'Comment:', - 'detail_created_by' => 'Created By:', - 'detail_updated_by' => 'Updated By:', + 'detail_page_name' => 'שם עמוד:', + 'detail_page_path' => 'נתיב לעמוד:', + 'detail_commenter' => 'יוצר התגובה:', + 'detail_comment' => 'תגובה:', + 'detail_created_by' => 'נוצר על ידי:', + 'detail_updated_by' => 'עודכן על ידי:', - 'action_view_comment' => 'View Comment', - 'action_view_page' => 'View Page', + 'action_view_comment' => 'צפה בתגובה', + 'action_view_page' => 'הצג דף', - 'footer_reason' => 'This notification was sent to you because :link cover this type of activity for this item.', - 'footer_reason_link' => 'your notification preferences', + 'footer_reason' => 'ההתראה נשלחה אליך בגלל :link לכסות סוג זה של פעילות עבור פריט זה.', + 'footer_reason_link' => 'העדפות ההתראות שלך', ]; diff --git a/lang/ko/activities.php b/lang/ko/activities.php index f9002431bc2..4cb03f90cc9 100644 --- a/lang/ko/activities.php +++ b/lang/ko/activities.php @@ -6,75 +6,75 @@ return [ // Pages - 'page_create' => '문서 만들기', - 'page_create_notification' => '페이지를 생성했습니다', - 'page_update' => '문서 수정', - 'page_update_notification' => '페이지를 수정했습니다', - 'page_delete' => '삭제 된 페이지', - 'page_delete_notification' => '페이지를 삭제했습니다', - 'page_restore' => '문서 복원', - 'page_restore_notification' => '페이지가 복원되었습니다', - 'page_move' => '문서 이동', - 'page_move_notification' => 'Page successfully moved', + 'page_create' => '생성된 페이지', + 'page_create_notification' => '페이지가 성공적으로 생성되었습니다.', + 'page_update' => '페이지 업데이트됨', + 'page_update_notification' => '페이지가 성공적으로 업데이트되었습니다.', + 'page_delete' => '삭제된 페이지', + 'page_delete_notification' => '페이지가 성공적으로 삭제되었습니다.', + 'page_restore' => '복구된 페이지', + 'page_restore_notification' => '페이지가 성공적으로 복원되었습니다.', + 'page_move' => '이동된 페이지', + 'page_move_notification' => '페이지가 성공적으로 이동되었습니다.', // Chapters 'chapter_create' => '챕터 만들기', - 'chapter_create_notification' => '챕터 생성함', - 'chapter_update' => '챕터 수정', - 'chapter_update_notification' => '챕터 수정함', + 'chapter_create_notification' => '챕터가 성공적으로 생성되었습니다.', + 'chapter_update' => '업데이트된 챕터', + 'chapter_update_notification' => '챕터가 성공적으로 업데이트되었습니다.', 'chapter_delete' => '삭제된 챕터', - 'chapter_delete_notification' => '챕터 삭제함', - 'chapter_move' => '챕터 이동된', - 'chapter_move_notification' => 'Chapter successfully moved', + 'chapter_delete_notification' => '챕터가 성공적으로 삭제되었습니다.', + 'chapter_move' => '이동된 챕터', + 'chapter_move_notification' => '챕터를 성공적으로 이동했습니다.', // Books - 'book_create' => '책자 만들기', - 'book_create_notification' => '책 생성함', + 'book_create' => '생성된 책', + 'book_create_notification' => '책이 성공적으로 생성되었습니다.', 'book_create_from_chapter' => '챕터를 책으로 변환', - 'book_create_from_chapter_notification' => '챕터를 책으로 변환했습니다.', - 'book_update' => '책 수정', - 'book_update_notification' => '책 수정함', - 'book_delete' => '책 지우기', - 'book_delete_notification' => '책 삭제함', - 'book_sort' => '책자 정렬', - 'book_sort_notification' => '책 정렬 바꿈', + 'book_create_from_chapter_notification' => '챕터가 책으로 성공적으로 변환되었습니다.', + 'book_update' => '업데이트된 책', + 'book_update_notification' => '책이 성공적으로 업데이트되었습니다.', + 'book_delete' => '삭제된 책', + 'book_delete_notification' => '책이 성공적으로 삭제되었습니다.', + 'book_sort' => '정렬된 책', + 'book_sort_notification' => '책이 성공적으로 재정렬되었습니다.', // Bookshelves - 'bookshelf_create' => '책꽃이 만들기', - 'bookshelf_create_notification' => '책꽃이 생성 완료', - 'bookshelf_create_from_book' => '책을 책꽃이로 변환', - 'bookshelf_create_from_book_notification' => '책을 책꽂이로 변환했습니다.', - 'bookshelf_update' => '책꽃이 업데이트', - 'bookshelf_update_notification' => '책꽃이가 업데이트되었습니다', - 'bookshelf_delete' => '선반 삭제', - 'bookshelf_delete_notification' => '책꽃이가 삭제되었습니다.', + 'bookshelf_create' => '책장 만들기', + 'bookshelf_create_notification' => '책장을 성공적으로 생성했습니다.', + 'bookshelf_create_from_book' => '책을 책장으로 변환함', + 'bookshelf_create_from_book_notification' => '책을 성공적으로 책장으로 변환하였습니다.', + 'bookshelf_update' => '책장 업데이트됨', + 'bookshelf_update_notification' => '책장이 성공적으로 업데이트 되었습니다.', + 'bookshelf_delete' => '삭제된 책장', + 'bookshelf_delete_notification' => '책장이 성공적으로 삭제되었습니다.', // Revisions - 'revision_restore' => '버전 복원', - 'revision_delete' => '버전 삭제', - 'revision_delete_notification' => '버전 삭제 성공', + 'revision_restore' => '복구된 리비전', + 'revision_delete' => '삭제된 리비전', + 'revision_delete_notification' => '리비전을 성공적으로 삭제하였습니다.', // Favourites - 'favourite_add_notification' => '":name" 북마크에 추가함', - 'favourite_remove_notification' => '":name" 북마크에서 삭제함', + 'favourite_add_notification' => '":name" 을 북마크에 추가하였습니다.', + 'favourite_remove_notification' => '":name" 가 북마크에서 삭제되었습니다.', // Watching - 'watch_update_level_notification' => 'Watch preferences successfully updated', + 'watch_update_level_notification' => '주시 환경설정이 성공적으로 업데이트되었습니다.', // Auth - 'auth_login' => 'logged in', + 'auth_login' => '로그인 됨', 'auth_register' => '신규 사용자 등록', 'auth_password_reset_request' => '사용자 비밀번호 초기화 요청', 'auth_password_reset_update' => '사용자 비밀번호 초기화', - 'mfa_setup_method' => 'configured MFA method', + 'mfa_setup_method' => '구성된 MFA 방법', 'mfa_setup_method_notification' => '다중 인증 설정함', - 'mfa_remove_method' => 'removed MFA method', + 'mfa_remove_method' => 'MFA 메서드 제거', 'mfa_remove_method_notification' => '다중 인증 해제함', // Settings 'settings_update' => '설정 변경', 'settings_update_notification' => '설졍 변경 성공', - 'maintenance_action_run' => 'ran maintenance action', + 'maintenance_action_run' => '유지 관리 작업 실행', // Webhooks 'webhook_create' => '웹 훅 만들기', @@ -94,11 +94,11 @@ // API Tokens 'api_token_create' => 'aPI 토큰 생성', - 'api_token_create_notification' => 'API token successfully created', - 'api_token_update' => 'updated api token', - 'api_token_update_notification' => 'API token successfully updated', - 'api_token_delete' => 'deleted api token', - 'api_token_delete_notification' => 'API token successfully deleted', + 'api_token_create_notification' => 'API 토큰이 성공적으로 생성되었습니다.', + 'api_token_update' => '업데이트된 API 토큰', + 'api_token_update_notification' => 'API 토큰이 성공적으로 업데이트되었습니다.', + 'api_token_delete' => '삭제된 API 토큰', + 'api_token_delete_notification' => 'API 토큰이 성공적으로 삭제되었습니다.', // Roles 'role_create' => '역활 생성', @@ -109,9 +109,9 @@ 'role_delete_notification' => '역할이 삭제되었습니다', // Recycle Bin - 'recycle_bin_empty' => 'emptied recycle bin', - 'recycle_bin_restore' => 'restored from recycle bin', - 'recycle_bin_destroy' => 'removed from recycle bin', + 'recycle_bin_empty' => '비운 휴지통', + 'recycle_bin_restore' => '휴지통에서 복원됨', + 'recycle_bin_destroy' => '휴지통에서 제거됨', // Comments 'commented_on' => '댓글 쓰기', diff --git a/lang/ko/auth.php b/lang/ko/auth.php index 60a54dabd64..a29f9b9ad96 100644 --- a/lang/ko/auth.php +++ b/lang/ko/auth.php @@ -29,7 +29,7 @@ 'already_have_account' => '계정이 있나요?', 'dont_have_account' => '계정이 없나요?', 'social_login' => '소셜 로그인', - 'social_registration' => '소셜 가입', + 'social_registration' => '소셜 계정으로 가입', 'social_registration_text' => '소셜 계정으로 가입하고 로그인합니다.', 'register_thanks' => '가입해 주셔서 감사합니다!', diff --git a/lang/ko/common.php b/lang/ko/common.php index 89ae78bd389..794fdc6cd3c 100644 --- a/lang/ko/common.php +++ b/lang/ko/common.php @@ -6,7 +6,7 @@ // Buttons 'cancel' => '취소', - 'close' => 'Close', + 'close' => '닫기', 'confirm' => '확인', 'back' => '뒤로', 'save' => '저장', @@ -26,7 +26,7 @@ 'actions' => '활동', 'view' => '보기', 'view_all' => '모두 보기', - 'new' => 'New', + 'new' => '신규', 'create' => '만들기', 'update' => '바꾸기', 'edit' => '수정', @@ -42,7 +42,7 @@ 'remove' => '제거', 'add' => '추가', 'configure' => '설정', - 'manage' => 'Manage', + 'manage' => '관리', 'fullscreen' => '전체화면', 'favourite' => '즐겨찾기', 'unfavourite' => '즐겨찾기 해제', @@ -52,7 +52,7 @@ 'filter_clear' => '모든 필터 해제', 'download' => '내려받기', 'open_in_tab' => '탭에서 열기', - 'open' => 'Open', + 'open' => '열기 ', // Sort Options 'sort_options' => '정렬 기준', diff --git a/lang/ko/components.php b/lang/ko/components.php index 66e1bde18b1..c81497e0308 100644 --- a/lang/ko/components.php +++ b/lang/ko/components.php @@ -9,18 +9,18 @@ 'image_list' => '이미지 목록', 'image_details' => '이미지 상세정보', 'image_upload' => '이미지 업로드', - 'image_intro' => 'Here you can select and manage images that have been previously uploaded to the system.', - 'image_intro_upload' => 'Upload a new image by dragging an image file into this window, or by using the "Upload Image" button above.', + 'image_intro' => '여기에서 이전에 시스템에 업로드한 이미지를 선택하고 관리할 수 있습니다.', + 'image_intro_upload' => '이미지 파일을 이 창으로 끌어다 놓거나 위의 \'이미지 업로드\' 버튼을 사용하여 새 이미지를 업로드합니다.', 'image_all' => '모든 이미지', 'image_all_title' => '모든 이미지', 'image_book_title' => '이 책에서 쓰고 있는 이미지', 'image_page_title' => '이 문서에서 쓰고 있는 이미지', 'image_search_hint' => '이미지 이름 검색', 'image_uploaded' => '올림 :uploadedDate', - 'image_uploaded_by' => '업로드:유저 닉네임', - 'image_uploaded_to' => '업로드:링크', - 'image_updated' => '갱신:갱신일', - 'image_load_more' => '더 로드하기', + 'image_uploaded_by' => '업로드 :userName', + 'image_uploaded_to' => ':pageLink 로 업로드됨', + 'image_updated' => '갱신일 :updateDate', + 'image_load_more' => '더 보기', 'image_image_name' => '이미지 이름', 'image_delete_used' => '이 이미지는 다음 문서들이 쓰고 있습니다.', 'image_delete_confirm_text' => '이 이미지를 지울 건가요?', @@ -33,9 +33,9 @@ 'image_update_success' => '이미지 정보 수정함', 'image_delete_success' => '이미지 삭제함', 'image_replace' => '이미지 교체', - 'image_replace_success' => 'Image file successfully updated', - 'image_rebuild_thumbs' => 'Regenerate Size Variations', - 'image_rebuild_thumbs_success' => 'Image size variations successfully rebuilt!', + 'image_replace_success' => '이미지 파일 업데이트 성공', + 'image_rebuild_thumbs' => '사이즈 변경 재생성하기', + 'image_rebuild_thumbs_success' => '이미지 크기 변경이 성공적으로 완료되었습니다!', // Code Editor 'code_editor' => '코드 수정', diff --git a/lang/ko/editor.php b/lang/ko/editor.php index 9764c7d356d..7959bc81dc0 100644 --- a/lang/ko/editor.php +++ b/lang/ko/editor.php @@ -150,7 +150,7 @@ 'open_link_new' => '새 창', 'remove_link' => '링크 제거', 'insert_collapsible' => '접을 수 있는 블록 삽입', - 'collapsible_unwrap' => 'Unwrap', + 'collapsible_unwrap' => '언래핑', 'edit_label' => '레이블 수정', 'toggle_open_closed' => '열림/닫힘 전환', 'collapsible_edit' => '접을 수 있는 블록 편집', @@ -163,8 +163,8 @@ 'editor_tiny_license' => '이 편집기는 MIT 라이선스에 따라 제공되는 :tinyLink를 사용하여 제작되었습니다.', 'editor_tiny_license_link' => 'TinyMCE의 저작권 및 라이선스 세부 정보는 여기에서 확인할 수 있습니다.', 'save_continue' => '저장하고 계속하기', - 'callouts_cycle' => '(Keep pressing to toggle through types)', - 'link_selector' => 'Link to content', + 'callouts_cycle' => '(계속 누르면 유형이 전환됩니다.)', + 'link_selector' => '콘텐츠에 연결', 'shortcuts' => '단축키', 'shortcut' => '단축키', 'shortcuts_intro' => '편집기에서 사용할 수 있는 바로 가기는 다음과 같습니다:', diff --git a/lang/ko/entities.php b/lang/ko/entities.php index cd56d3ed89f..934d7201e2b 100644 --- a/lang/ko/entities.php +++ b/lang/ko/entities.php @@ -11,7 +11,7 @@ 'recently_updated_pages' => '최근에 수정한 문서', 'recently_created_chapters' => '최근에 만든 챕터', 'recently_created_books' => '최근에 만든 책', - 'recently_created_shelves' => '최근에 만든 책꽂이', + 'recently_created_shelves' => '최근에 만든 책장', 'recently_update' => '최근에 수정함', 'recently_viewed' => '최근에 읽음', 'recent_activity' => '최근에 활동함', @@ -23,34 +23,34 @@ 'meta_updated' => '수정함 :timeLength', 'meta_updated_name' => '수정함 :timeLength, :user', 'meta_owned_name' => '소유함 :user', - 'meta_reference_count' => 'Referenced by :count item|Referenced by :count items', + 'meta_reference_count' => '참조 대상 :count item|참조 대상 :count items', 'entity_select' => '항목 선택', 'entity_select_lack_permission' => '이 항목을 선택하기 위해 필요한 권한이 없습니다', 'images' => '이미지', 'my_recent_drafts' => '내 최근의 초안 문서', 'my_recently_viewed' => '내가 읽은 문서', - 'my_most_viewed_favourites' => '많이 본 북마크', - 'my_favourites' => '북마크', - 'no_pages_viewed' => '문서 없음', - 'no_pages_recently_created' => '문서 없음', - 'no_pages_recently_updated' => '문서 없음', - 'export' => '파일로 받기', - 'export_html' => 'Contained Web(.html) 파일', + 'my_most_viewed_favourites' => '내가 가장 많이 본 즐겨찾기', + 'my_favourites' => '나의 즐겨찾기', + 'no_pages_viewed' => '본 페이지가 없습니다.', + 'no_pages_recently_created' => '최근에 생성된 페이지가 없습니다.', + 'no_pages_recently_updated' => '최근 업데이트된 페이지가 없습니다.', + 'export' => '내보내기', + 'export_html' => '포함된 웹 파일', 'export_pdf' => 'PDF 파일', - 'export_text' => 'Plain Text(.txt) 파일', - 'export_md' => 'Markdown(.md) 파일', + 'export_text' => '일반 텍스트 파일', + 'export_md' => '마크다운 파일', // Permissions and restrictions 'permissions' => '권한', - 'permissions_desc' => 'Set permissions here to override the default permissions provided by user roles.', - 'permissions_book_cascade' => 'Permissions set on books will automatically cascade to child chapters and pages, unless they have their own permissions defined.', - 'permissions_chapter_cascade' => 'Permissions set on chapters will automatically cascade to child pages, unless they have their own permissions defined.', + 'permissions_desc' => '여기에서 권한을 설정하여 사용자 역할에서 제공하는 기본 권한을 재정의합니다.', + 'permissions_book_cascade' => '책에 설정된 권한은 자체 권한이 정의되어 있지 않은 한 하위 챕터와 페이지에 자동으로 계단식으로 적용됩니다.', + 'permissions_chapter_cascade' => '챕터에 설정된 권한은 하위 페이지에 자체 권한이 정의되어 있지 않는 한 자동으로 계단식으로 적용됩니다.', 'permissions_save' => '권한 저장', 'permissions_owner' => '소유자', - 'permissions_role_everyone_else' => 'Everyone Else', - 'permissions_role_everyone_else_desc' => 'Set permissions for all roles not specifically overridden.', - 'permissions_role_override' => 'Override permissions for role', - 'permissions_inherit_defaults' => 'Inherit defaults', + 'permissions_role_everyone_else' => '그 외 모든 사용자', + 'permissions_role_everyone_else_desc' => '특별히 재정의되지 않은 모든 역할에 대한 권한을 설정.', + 'permissions_role_override' => '역할에 대한 권한 재정의하기', + 'permissions_inherit_defaults' => '기본값 상속', // Search 'search_results' => '검색 결과', @@ -96,21 +96,21 @@ 'shelves_drag_books' => '책을 이 책장에 추가하려면 아래로 드래그하세요', 'shelves_empty_contents' => '이 책꽂이에 책이 없습니다.', 'shelves_edit_and_assign' => '책꽂이 바꾸기로 책을 추가하세요.', - 'shelves_edit_named' => 'Edit Shelf :name', - 'shelves_edit' => 'Edit Shelf', - 'shelves_delete' => 'Delete Shelf', - 'shelves_delete_named' => 'Delete Shelf :name', - 'shelves_delete_explain' => "This will delete the shelf with the name ':name'. Contained books will not be deleted.", - 'shelves_delete_confirmation' => 'Are you sure you want to delete this shelf?', - 'shelves_permissions' => 'Shelf Permissions', - 'shelves_permissions_updated' => 'Shelf Permissions Updated', - 'shelves_permissions_active' => 'Shelf Permissions Active', - 'shelves_permissions_cascade_warning' => 'Permissions on shelves do not automatically cascade to contained books. This is because a book can exist on multiple shelves. Permissions can however be copied down to child books using the option found below.', - 'shelves_permissions_create' => 'Shelf create permissions are only used for copying permissions to child books using the action below. They do not control the ability to create books.', + 'shelves_edit_named' => '책꽂이 편집 :name', + 'shelves_edit' => '책꽂이 편집', + 'shelves_delete' => '책꽂이 삭제', + 'shelves_delete_named' => '책꽂이 삭제 :이름', + 'shelves_delete_explain' => "그러면 ':name'이라는 이름의 서가가 삭제됩니다. 포함된 책은 삭제되지 않습니다.", + 'shelves_delete_confirmation' => '이 책꽂이를 삭제하시겠습니까?', + 'shelves_permissions' => '책꽂이 권한', + 'shelves_permissions_updated' => '책꽂이 권한 업데이트됨', + 'shelves_permissions_active' => '책꽂이 권한 활성화', + 'shelves_permissions_cascade_warning' => '책꽂이에 대한 권한은 포함된 책에 자동으로 계단식으로 부여되지 않습니다. 한 권의 책이 여러 개의 책꽂이에 존재할 수 있기 때문입니다. 그러나 아래 옵션을 사용하여 권한을 하위 책으로 복사할 수 있습니다.', + 'shelves_permissions_create' => '책꽂이 만들기 권한은 아래 작업을 사용하여 하위 책에 대한 권한을 복사하는 데만 사용됩니다. 책을 만드는 기능은 제어하지 않습니다.', 'shelves_copy_permissions_to_books' => '권한 맞춤', 'shelves_copy_permissions' => '실행', - 'shelves_copy_permissions_explain' => 'This will apply the current permission settings of this shelf to all books contained within. Before activating, ensure any changes to the permissions of this shelf have been saved.', - 'shelves_copy_permission_success' => 'Shelf permissions copied to :count books', + 'shelves_copy_permissions_explain' => '그러면 이 책꽂이의 현재 권한 설정이 이 책꽂이에 포함된 모든 책에 적용됩니다. 활성화하기 전에 이 책꽂이의 권한에 대한 변경 사항이 모두 저장되었는지 확인하세요.', + 'shelves_copy_permission_success' => '책꽂이 권한이 복사됨 :count books', // Books 'book' => '책', @@ -132,9 +132,9 @@ 'books_edit_named' => ':bookName(을)를 바꿉니다.', 'books_form_book_name' => '책 이름', 'books_save' => '저장', - 'books_default_template' => 'Default Page Template', - 'books_default_template_explain' => 'Assign a page template that will be used as the default content for all new pages in this book. Keep in mind this will only be used if the page creator has view access to those chosen template page.', - 'books_default_template_select' => 'Select a template page', + 'books_default_template' => '기본 페이지 템플릿', + 'books_default_template_explain' => '이 책에 있는 모든 새 페이지의 기본 콘텐츠로 사용할 페이지 템플릿을 지정합니다. 페이지 작성자에게 선택한 템플릿 페이지에 대한 보기 액세스 권한이 있는 경우에만 이 템플릿이 사용된다는 점에 유의하세요.', + 'books_default_template_select' => '템플릿 페이지 선택', 'books_permissions' => '책 권한', 'books_permissions_updated' => '권한 저장함', 'books_empty_contents' => '이 책에 챕터나 문서가 없습니다.', @@ -145,7 +145,7 @@ 'books_search_this' => '이 책에서 검색', 'books_navigation' => '목차', 'books_sort' => '다른 책들', - 'books_sort_desc' => 'Move chapters and pages within a book to reorganise its contents. Other books can be added which allows easy moving of chapters and pages between books.', + 'books_sort_desc' => '책 내에서 챕터와 페이지를 이동하여 내용을 재구성할 수 있습니다. 다른 책을 추가하여 책 간에 챕터와 페이지를 쉽게 이동할 수 있습니다.', 'books_sort_named' => ':bookName 정렬', 'books_sort_name' => '제목', 'books_sort_created' => '만든 날짜', @@ -154,17 +154,17 @@ 'books_sort_chapters_last' => '문서 우선', 'books_sort_show_other' => '다른 책들', 'books_sort_save' => '적용', - 'books_sort_show_other_desc' => 'Add other books here to include them in the sort operation, and allow easy cross-book reorganisation.', - 'books_sort_move_up' => 'Move Up', - 'books_sort_move_down' => 'Move Down', - 'books_sort_move_prev_book' => 'Move to Previous Book', - 'books_sort_move_next_book' => 'Move to Next Book', - 'books_sort_move_prev_chapter' => 'Move Into Previous Chapter', - 'books_sort_move_next_chapter' => 'Move Into Next Chapter', - 'books_sort_move_book_start' => 'Move to Start of Book', - 'books_sort_move_book_end' => 'Move to End of Book', - 'books_sort_move_before_chapter' => 'Move to Before Chapter', - 'books_sort_move_after_chapter' => 'Move to After Chapter', + 'books_sort_show_other_desc' => '여기에 다른 책을 추가하여 정렬 작업에 포함시키고 책 간 재구성을 쉽게 할 수 있습니다.', + 'books_sort_move_up' => '위로 이동', + 'books_sort_move_down' => '아래로 이동', + 'books_sort_move_prev_book' => '이전 책으로 이동', + 'books_sort_move_next_book' => '다음 책으로 이동', + 'books_sort_move_prev_chapter' => '이전 챕터로 이동', + 'books_sort_move_next_chapter' => '다음 챕터로 이동', + 'books_sort_move_book_start' => '책 시작 부분으로 이동', + 'books_sort_move_book_end' => '책의 끝으로 이동', + 'books_sort_move_before_chapter' => '이전 챕터로 이동', + 'books_sort_move_after_chapter' => '챕터 뒤로 이동', 'books_copy' => '책 복사하기', 'books_copy_success' => '책 복사함', @@ -207,7 +207,7 @@ 'pages_delete_draft' => '초안 문서 삭제하기', 'pages_delete_success' => '문서 지움', 'pages_delete_draft_success' => '초안 문서 지움', - 'pages_delete_warning_template' => 'This page is in active use as a book default page template. These books will no longer have a default page template assigned after this page is deleted.', + 'pages_delete_warning_template' => '이 페이지는 책의 기본 페이지 템플릿으로 사용 중입니다. 이 페이지가 삭제된 후에는 이러한 책에 더 이상 기본 페이지 템플릿이 할당되지 않습니다.', 'pages_delete_confirm' => '이 문서를 지울 건가요?', 'pages_delete_draft_confirm' => '이 초안을 지울 건가요?', 'pages_editing_named' => ':pageName 수정', @@ -218,7 +218,7 @@ 'pages_editing_page' => '문서 수정', 'pages_edit_draft_save_at' => '보관함: ', 'pages_edit_delete_draft' => '초안 삭제', - 'pages_edit_delete_draft_confirm' => 'Are you sure you want to delete your draft page changes? All of your changes, since the last full save, will be lost and the editor will be updated with the latest page non-draft save state.', + 'pages_edit_delete_draft_confirm' => '초안 페이지 변경 내용을 삭제하시겠습니까? 마지막 전체 저장 이후의 모든 변경 내용이 손실되고 편집기가 최신 페이지의 초안 저장 상태가 아닌 상태로 업데이트됩니다.', 'pages_edit_discard_draft' => '폐기', 'pages_edit_switch_to_markdown' => '마크다운 편집기로 전환', 'pages_edit_switch_to_markdown_clean' => '(Clean Content)', @@ -230,9 +230,9 @@ 'pages_editor_switch_title' => '편집기 전환', 'pages_editor_switch_are_you_sure' => '이 페이지의 편집기를 변경하시겠어요?', 'pages_editor_switch_consider_following' => '편집기를 전환할 때에 다음 사항들을 고려하세요:', - 'pages_editor_switch_consideration_a' => 'Once saved, the new editor option will be used by any future editors, including those that may not be able to change editor type themselves.', - 'pages_editor_switch_consideration_b' => 'This can potentially lead to a loss of detail and syntax in certain circumstances.', - 'pages_editor_switch_consideration_c' => 'Tag or changelog changes, made since last save, won\'t persist across this change.', + 'pages_editor_switch_consideration_a' => '저장된 새 편집기 옵션은 편집기 유형을 직접 변경할 수 없는 편집자를 포함하여 향후 모든 편집자가 사용할 수 있습니다.', + 'pages_editor_switch_consideration_b' => '이로 인해 특정 상황에서는 디테일과 구문이 손실될 수 있습니다.', + 'pages_editor_switch_consideration_c' => '마지막 저장 이후 변경된 태그 또는 변경 로그 변경 사항은 이 변경 사항에서 유지되지 않습니다.', 'pages_save' => '저장', 'pages_title' => '문서 제목', 'pages_name' => '문서 이름', @@ -241,10 +241,10 @@ 'pages_md_insert_image' => '이미지 추가', 'pages_md_insert_link' => '내부 링크', 'pages_md_insert_drawing' => '드로잉 추가', - 'pages_md_show_preview' => 'Show preview', - 'pages_md_sync_scroll' => 'Sync preview scroll', - 'pages_drawing_unsaved' => 'Unsaved Drawing Found', - 'pages_drawing_unsaved_confirm' => 'Unsaved drawing data was found from a previous failed drawing save attempt. Would you like to restore and continue editing this unsaved drawing?', + 'pages_md_show_preview' => '미리보기 표시', + 'pages_md_sync_scroll' => '미리보기 스크롤 동기화', + 'pages_drawing_unsaved' => '저장되지 않은 드로잉 발견', + 'pages_drawing_unsaved_confirm' => '이전에 실패한 드로잉 저장 시도에서 저장되지 않은 드로잉 데이터가 발견되었습니다. 이 저장되지 않은 드로잉을 복원하고 계속 편집하시겠습니까?', 'pages_not_in_chapter' => '챕터에 있는 문서가 아닙니다.', 'pages_move' => '문서 이동하기', 'pages_copy' => '문서 복제', @@ -254,14 +254,14 @@ 'pages_permissions_success' => '문서 권한 바꿈', 'pages_revision' => '수정본', 'pages_revisions' => '문서 수정본', - 'pages_revisions_desc' => 'Listed below are all the past revisions of this page. You can look back upon, compare, and restore old page versions if permissions allow. The full history of the page may not be fully reflected here since, depending on system configuration, old revisions could be auto-deleted.', + 'pages_revisions_desc' => '아래는 이 페이지의 모든 과거 개정 버전입니다. 권한이 허용하는 경우 이전 페이지 버전을 되돌아보고, 비교하고, 복원할 수 있습니다. 시스템 구성에 따라 이전 수정본이 자동으로 삭제될 수 있으므로 페이지의 전체 기록이 여기에 완전히 반영되지 않을 수 있습니다.', 'pages_revisions_named' => ':pageName 수정본', 'pages_revision_named' => ':pageName 수정본', 'pages_revision_restored_from' => '#:id; :summary에서 복구함', 'pages_revisions_created_by' => '만든 사용자', 'pages_revisions_date' => '수정한 날짜', 'pages_revisions_number' => 'No.', - 'pages_revisions_sort_number' => 'Revision Number', + 'pages_revisions_sort_number' => '수정 번호', 'pages_revisions_numbered' => '수정본 :id', 'pages_revisions_numbered_changes' => '수정본 :id에서 바꾼 부분', 'pages_revisions_editor' => '편집기 유형', @@ -272,16 +272,16 @@ 'pages_revisions_restore' => '복원', 'pages_revisions_none' => '수정본이 없습니다.', 'pages_copy_link' => '주소 복사', - 'pages_edit_content_link' => 'Jump to section in editor', - 'pages_pointer_enter_mode' => 'Enter section select mode', - 'pages_pointer_label' => 'Page Section Options', - 'pages_pointer_permalink' => 'Page Section Permalink', - 'pages_pointer_include_tag' => 'Page Section Include Tag', - 'pages_pointer_toggle_link' => 'Permalink mode, Press to show include tag', - 'pages_pointer_toggle_include' => 'Include tag mode, Press to show permalink', + 'pages_edit_content_link' => '편집기의 섹션으로 이동', + 'pages_pointer_enter_mode' => '섹션 선택 모드로 들어가기', + 'pages_pointer_label' => '페이지 섹션 옵션', + 'pages_pointer_permalink' => '페이지 섹션 퍼머링크', + 'pages_pointer_include_tag' => '페이지 섹션 포함 태그 포함', + 'pages_pointer_toggle_link' => '퍼머링크 모드, 포함 태그를 표시하려면 누릅니다.', + 'pages_pointer_toggle_include' => '태그 포함 모드, 퍼머링크를 표시하려면 누릅니다.', 'pages_permissions_active' => '문서 권한 허용함', 'pages_initial_revision' => '처음 판본', - 'pages_references_update_revision' => 'System auto-update of internal links', + 'pages_references_update_revision' => '시스템에서 내부 링크 자동 업데이트', 'pages_initial_name' => '제목 없음', 'pages_editing_draft_notification' => ':timeDiff에 초안 문서입니다.', 'pages_draft_edited_notification' => '최근에 수정한 문서이기 때문에 초안 문서를 폐기하는 편이 좋습니다.', @@ -293,20 +293,20 @@ 'time_b' => '(:minCount분 전)', 'message' => ':start :time. 다른 사용자의 수정본을 덮어쓰지 않도록 주의하세요.', ], - 'pages_draft_discarded' => 'Draft discarded! The editor has been updated with the current page content', - 'pages_draft_deleted' => 'Draft deleted! The editor has been updated with the current page content', + 'pages_draft_discarded' => '초안 폐기! 편집기가 현재 페이지 콘텐츠로 업데이트되었습니다.', + 'pages_draft_deleted' => '초안이 삭제되었습니다! 편집기가 현재 페이지 콘텐츠로 업데이트되었습니다.', 'pages_specific' => '특정한 문서', 'pages_is_template' => '템플릿', // Editor Sidebar - 'toggle_sidebar' => 'Toggle Sidebar', + 'toggle_sidebar' => '사이드바 토글', 'page_tags' => '문서 꼬리표', 'chapter_tags' => '챕터 꼬리표', 'book_tags' => '책 꼬리표', 'shelf_tags' => '책꽂이 꼬리표', 'tag' => '꼬리표', 'tags' => '꼬리표', - 'tags_index_desc' => 'Tags can be applied to content within the system to apply a flexible form of categorization. Tags can have both a key and value, with the value being optional. Once applied, content can then be queried using the tag name and value.', + 'tags_index_desc' => '태그를 시스템 내의 콘텐츠에 적용하여 유연한 형태의 분류를 적용할 수 있습니다. 태그는 키와 값을 모두 가질 수 있으며 값은 선택 사항입니다. 태그가 적용되면 태그 이름과 값을 사용하여 콘텐츠를 쿼리할 수 있습니다.', 'tag_name' => '꼬리표 이름', 'tag_value' => '리스트 값 (선택 사항)', 'tags_explain' => "꼬리표로 문서를 분류하세요.", @@ -327,10 +327,10 @@ 'attachments_explain_instant_save' => '여기에서 바꾼 내용은 바로 적용합니다.', 'attachments_upload' => '파일 올리기', 'attachments_link' => '링크로 첨부', - 'attachments_upload_drop' => 'Alternatively you can drag and drop a file here to upload it as an attachment.', + 'attachments_upload_drop' => '또는 파일을 여기로 끌어다 놓아 첨부 파일로 업로드할 수도 있습니다.', 'attachments_set_link' => '링크 설정', 'attachments_delete' => '이 첨부 파일을 지울 건가요?', - 'attachments_dropzone' => 'Drop files here to upload', + 'attachments_dropzone' => '업로드할 파일을 여기에 놓아주세요.', 'attachments_no_files' => '올린 파일 없음', 'attachments_explain_link' => '파일을 올리지 않고 링크로 첨부할 수 있습니다.', 'attachments_link_name' => '링크 이름', @@ -373,13 +373,13 @@ 'comment_new' => '새로운 댓글', 'comment_created' => '댓글 등록함 :createDiff', 'comment_updated' => ':username(이)가 댓글 수정함 :updateDiff', - 'comment_updated_indicator' => 'Updated', + 'comment_updated_indicator' => '업데이트됨', 'comment_deleted_success' => '댓글 지움', 'comment_created_success' => '댓글 등록함', 'comment_updated_success' => '댓글 수정함', 'comment_delete_confirm' => '이 댓글을 지울 건가요?', 'comment_in_reply_to' => ':commentId(을)를 향한 답글', - 'comment_editor_explain' => 'Here are the comments that have been left on this page. Comments can be added & managed when viewing the saved page.', + 'comment_editor_explain' => '이 페이지에 남겨진 댓글은 다음과 같습니다. 저장된 페이지를 볼 때 댓글을 추가하고 관리할 수 있습니다.', // Revision 'revision_delete_confirm' => '이 수정본을 지울 건가요?', @@ -396,42 +396,42 @@ // Conversions 'convert_to_shelf' => '책장으로 변환', - 'convert_to_shelf_contents_desc' => 'You can convert this book to a new shelf with the same contents. Chapters contained within this book will be converted to new books. If this book contains any pages, that are not in a chapter, this book will be renamed and contain such pages, and this book will become part of the new shelf.', - 'convert_to_shelf_permissions_desc' => 'Any permissions set on this book will be copied to the new shelf and to all new child books that don\'t have their own permissions enforced. Note that permissions on shelves do not auto-cascade to content within, as they do for books.', + 'convert_to_shelf_contents_desc' => '이 책을 동일한 내용의 새 서가로 변환할 수 있습니다. 이 책에 포함된 챕터는 새 책으로 변환됩니다. 이 책에 챕터에 포함되지 않은 페이지가 포함되어 있는 경우, 이 책의 이름이 변경되어 해당 페이지가 포함되며 이 책은 새 서가의 일부가 됩니다.', + 'convert_to_shelf_permissions_desc' => '이 책에 설정된 모든 권한은 새 서가 및 자체 권한이 적용되지 않은 모든 새 책에 복사됩니다. 책에 대한 권한은 책에 대한 권한처럼 그 안의 콘텐츠로 자동 캐스케이드되지 않는다는 점에 유의하세요.', 'convert_book' => '책 변환', 'convert_book_confirm' => '이 책을 변환하시겠어요?', 'convert_undo_warning' => '이 작업은 되돌리기 어렵습니다.', 'convert_to_book' => '책으로 변환', - 'convert_to_book_desc' => 'You can convert this chapter to a new book with the same contents. Any permissions set on this chapter will be copied to the new book but any inherited permissions, from the parent book, will not be copied which could lead to a change of access control.', + 'convert_to_book_desc' => '이 챕터를 동일한 내용의 새 책으로 변환할 수 있습니다. 이 장에 설정된 모든 권한은 새 책에 복사되지만 상위 책에서 상속된 권한은 복사되지 않으므로 액세스 제어가 변경될 수 있습니다.', 'convert_chapter' => '챕터 변환', 'convert_chapter_confirm' => '이 챕터를 변환하시겠어요?', // References - 'references' => 'References', - 'references_none' => 'There are no tracked references to this item.', - 'references_to_desc' => 'Listed below is all the known content in the system that links to this item.', + 'references' => '참조', + 'references_none' => '이 항목에 대한 추적된 참조가 없습니다.', + 'references_to_desc' => '이 항목으로 연결되는 시스템에서 알려진 모든 콘텐츠가 아래에 나열되어 있습니다.', // Watch Options - 'watch' => 'Watch', - 'watch_title_default' => 'Default Preferences', - 'watch_desc_default' => 'Revert watching to just your default notification preferences.', - 'watch_title_ignore' => 'Ignore', - 'watch_desc_ignore' => 'Ignore all notifications, including those from user-level preferences.', - 'watch_title_new' => 'New Pages', - 'watch_desc_new' => 'Notify when any new page is created within this item.', - 'watch_title_updates' => 'All Page Updates', - 'watch_desc_updates' => 'Notify upon all new pages and page changes.', - 'watch_desc_updates_page' => 'Notify upon all page changes.', - 'watch_title_comments' => 'All Page Updates & Comments', - 'watch_desc_comments' => 'Notify upon all new pages, page changes and new comments.', - 'watch_desc_comments_page' => 'Notify upon page changes and new comments.', - 'watch_change_default' => 'Change default notification preferences', - 'watch_detail_ignore' => 'Ignoring notifications', - 'watch_detail_new' => 'Watching for new pages', - 'watch_detail_updates' => 'Watching new pages and updates', - 'watch_detail_comments' => 'Watching new pages, updates & comments', - 'watch_detail_parent_book' => 'Watching via parent book', - 'watch_detail_parent_book_ignore' => 'Ignoring via parent book', - 'watch_detail_parent_chapter' => 'Watching via parent chapter', - 'watch_detail_parent_chapter_ignore' => 'Ignoring via parent chapter', + 'watch' => '주시', + 'watch_title_default' => '기본 설정', + 'watch_desc_default' => '보기를 기본 알림 환경설정으로 되돌릴 수 있습니다.', + 'watch_title_ignore' => '무시', + 'watch_desc_ignore' => '사용자 수준 환경설정의 알림을 포함한 모든 알림을 무시합니다.', + 'watch_title_new' => '새로운 페이지', + 'watch_desc_new' => '이 항목에 새 페이지가 생성되면 알림을 받습니다.', + 'watch_title_updates' => '전체 페이지 업데이트', + 'watch_desc_updates' => '모든 새 페이지와 페이지 변경 시 알림을 보냅니다.', + 'watch_desc_updates_page' => '모든 페이지 변경 시 알림을 보냅니다.', + 'watch_title_comments' => '모든 페이지 업데이트 및 댓글', + 'watch_desc_comments' => '모든 새 페이지, 페이지 변경 및 새 댓글에 대해 알림을 보냅니다.', + 'watch_desc_comments_page' => '페이지 변경 및 새 댓글이 있을 때 알림을 보냅니다.', + 'watch_change_default' => '기본 알림 환경설정 변경하기', + 'watch_detail_ignore' => '알림 무시하기', + 'watch_detail_new' => '새 페이지 보기', + 'watch_detail_updates' => '새 페이지 및 업데이트 보기', + 'watch_detail_comments' => '새 페이지, 업데이트 및 댓글 보기', + 'watch_detail_parent_book' => '상위 책을 통해 보기', + 'watch_detail_parent_book_ignore' => '페어런트 북을 통한 무시하기', + 'watch_detail_parent_chapter' => '상위 챕터를 통해 보기', + 'watch_detail_parent_chapter_ignore' => '상위 챕터를 통해 무시하기', ]; diff --git a/lang/ko/errors.php b/lang/ko/errors.php index a652cc697ef..0ab6789cc0c 100644 --- a/lang/ko/errors.php +++ b/lang/ko/errors.php @@ -5,68 +5,68 @@ return [ // Permissions - 'permission' => '권한이 없습니다.', - 'permissionJson' => '권한이 없습니다.', + 'permission' => '요청된 페이지에 액세스할 수 있는 권한이 없습니다.', + 'permissionJson' => '요청된 작업을 수행할 수 있는 권한이 없습니다.', // Auth - 'error_user_exists_different_creds' => ':email(을)를 가진 다른 사용자가 있습니다.', - 'email_already_confirmed' => '확인이 끝난 메일 주소입니다. 로그인하세요.', - 'email_confirmation_invalid' => '이 링크는 더 이상 유효하지 않습니다. 다시 가입하세요.', - 'email_confirmation_expired' => '이 링크는 더 이상 유효하지 않습니다. 메일을 다시 보냈습니다.', - 'email_confirmation_awaiting' => '사용 중인 계정의 이메일 주소를 확인해 주어야 합니다.', - 'ldap_fail_anonymous' => '익명 정보로 LDAP 서버에 접근할 수 없습니다.', - 'ldap_fail_authed' => '이 정보로 LDAP 서버에 접근할 수 없습니다.', - 'ldap_extension_not_installed' => 'PHP에 LDAP 확장 도구를 설치하세요.', - 'ldap_cannot_connect' => 'LDAP 서버에 연결할 수 없습니다.', - 'saml_already_logged_in' => '로그인 중입니다.', - 'saml_no_email_address' => '인증 시스템이 제공한 메일 주소가 없습니다.', - 'saml_invalid_response_id' => '인증 시스템이 요청을 받지 못했습니다. 인증 후 이전 페이지로 돌아갈 때 발생할 수 있는 현상입니다.', - 'saml_fail_authed' => ':system에 로그인할 수 없습니다.', - 'oidc_already_logged_in' => '로그인 중입니다.', - 'oidc_user_not_registered' => ':name 사용자가 없습니다. 자동 가입 옵션이 비활성 상태입니다.', - 'oidc_no_email_address' => '인증 시스템이 제공한 메일 주소가 없습니다.', - 'oidc_fail_authed' => ':system에 로그인할 수 없습니다.', - 'social_no_action_defined' => '무슨 활동인지 알 수 없습니다.', - 'social_login_bad_response' => ":socialAccount에 로그인할 수 없습니다. : \\n:error", - 'social_account_in_use' => ':socialAccount(을)를 가진 사용자가 있습니다. :socialAccount로 로그인하세요.', - 'social_account_email_in_use' => ':email(을)를 가진 사용자가 있습니다. 쓰고 있는 계정을 :socialAccount에 연결하세요.', - 'social_account_existing' => ':socialAccount(와)과 연결 상태입니다.', - 'social_account_already_used_existing' => ':socialAccount(와)과 연결한 다른 계정이 있습니다.', - 'social_account_not_used' => ':socialAccount(와)과 연결한 계정이 없습니다. 쓰고 있는 계정을 연결하세요.', - 'social_account_register_instructions' => '계정이 없어도 :socialAccount로 가입할 수 있습니다.', - 'social_driver_not_found' => '가입할 수 없습니다.', - 'social_driver_not_configured' => ':socialAccount가 유효하지 않습니다.', - 'invite_token_expired' => '이 링크는 더 이상 유효하지 않습니다. 패스워드를 바꾸세요.', + 'error_user_exists_different_creds' => '이메일 :email 이 이미 존재하지만 다른 자격 증명을 가진 사용자입니다.', + 'email_already_confirmed' => '이메일이 이미 확인되었으니 로그인해 보세요.', + 'email_confirmation_invalid' => '이 확인 토큰이 유효하지 않거나 이미 사용되었습니다. 다시 등록해 주세요.', + 'email_confirmation_expired' => '확인 토큰이 만료되었습니다. 새 확인 이메일이 전송되었습니다.', + 'email_confirmation_awaiting' => '사용 중인 계정의 이메일 주소를 확인해야 합니다.', + 'ldap_fail_anonymous' => '익명 바인딩을 사용하여 LDAP 액세스에 실패했습니다.', + 'ldap_fail_authed' => '주어진 dn 및 암호 세부 정보를 사용하여 LDAP 액세스에 실패했습니다.', + 'ldap_extension_not_installed' => 'LDAP PHP 확장이 설치되지 않았습니다.', + 'ldap_cannot_connect' => 'LDAP 서버에 연결할 수 없음, 초기 연결 실패', + 'saml_already_logged_in' => '이미 로그인했습니다.', + 'saml_no_email_address' => '외부 인증 시스템에서 제공한 데이터에서 이 사용자의 이메일 주소를 찾을 수 없습니다.', + 'saml_invalid_response_id' => '이 애플리케이션에서 시작한 프로세스에서 외부 인증 시스템의 요청을 인식하지 못합니다. 로그인 후 다시 이동하면 이 문제가 발생할 수 있습니다.', + 'saml_fail_authed' => ':system 을 사용하여 로그인, 시스템이 성공적인 인증을 제공하지 않음', + 'oidc_already_logged_in' => '이미 로그인했습니다.', + 'oidc_user_not_registered' => '사용자 :name 이 등록되지 않았으며 자동 등록이 비활성화되었습니다.', + 'oidc_no_email_address' => '외부 인증 시스템에서 제공한 데이터에서 이 사용자의 이메일 주소를 찾을 수 없습니다.', + 'oidc_fail_authed' => ':system 을 사용하여 로그인, 시스템이 성공적인 인증을 제공하지 않음', + 'social_no_action_defined' => '정의된 동작 없음', + 'social_login_bad_response' => ":socialAccount 로 로그인 동안 에러가 발생했습니다: \n:error", + 'social_account_in_use' => ':socialAccount(을)를 가진 사용자가 있습니다. :socialAccount 옵션을 통해 로그인해 보세요.', + 'social_account_email_in_use' => '이메일 :email 은(는) 이미 사용 중입니다. 이미 계정이 있는 경우 프로필 설정에서 :socialAccount 계정을 연결할 수 있습니다.', + 'social_account_existing' => '이 :socialAccount 는 이미 프로필에 연결되어 있습니다.', + 'social_account_already_used_existing' => '이 :socialAccount 계정은 다른 사용자가 이미 사용하고 있습니다.', + 'social_account_not_used' => '이 :socialAccount 계정은 어떤 사용자와도 연결되어 있지 않습니다. 프로필 설정에서 첨부하세요. ', + 'social_account_register_instructions' => '아직 계정이 없는 경우 :socialAccount 옵션을 사용하여 계정을 등록할 수 있습니다.', + 'social_driver_not_found' => '소셜 드라이버를 찾을 수 없습니다.', + 'social_driver_not_configured' => '소셜 계정 :socialAccount 가(이) 올바르게 구성되지 않았습니다.', + 'invite_token_expired' => '이 초대 링크가 만료되었습니다. 대신 계정 비밀번호 재설정을 시도해 보세요.', // System - 'path_not_writable' => ':filePath에 쓰는 것을 서버에서 허용하지 않습니다.', - 'cannot_get_image_from_url' => ':url에서 이미지를 불러올 수 없습니다.', - 'cannot_create_thumbs' => '섬네일을 못 만들었습니다. PHP에 GD 확장 도구를 설치하세요.', - 'server_upload_limit' => '파일 크기가 서버에서 허용하는 수치를 넘습니다.', - 'server_post_limit' => 'The server cannot receive the provided amount of data. Try again with less data or a smaller file.', - 'uploaded' => '파일 크기가 서버에서 허용하는 수치를 넘습니다.', + 'path_not_writable' => '파일 경로 :filePath 에 업로드할 수 없습니다. 서버에 저장이 가능한지 확인하세요.', + 'cannot_get_image_from_url' => ':url 에서 이미지를 가져올 수 없습니다.', + 'cannot_create_thumbs' => '서버에서 썸네일을 만들 수 없습니다. GD PHP 확장이 설치되어 있는지 확인하세요.', + 'server_upload_limit' => '서버에서 이 크기의 업로드를 허용하지 않습니다. 더 작은 파일 크기를 시도해 보세요.', + 'server_post_limit' => '서버가 제공된 데이터 양을 수신할 수 없습니다. 더 적은 데이터 또는 더 작은 파일로 다시 시도하세요.', + 'uploaded' => '서버에서 이 크기의 업로드를 허용하지 않습니다. 더 작은 파일 크기를 시도해 보세요.', // Drawing & Images - 'image_upload_error' => '이미지를 올리다 문제가 생겼습니다.', - 'image_upload_type_error' => '유효하지 않은 이미지 형식입니다.', - 'image_upload_replace_type' => 'Image file replacements must be of the same type', - 'image_upload_memory_limit' => 'Failed to handle image upload and/or create thumbnails due to system resource limits.', - 'image_thumbnail_memory_limit' => 'Failed to create image size variations due to system resource limits.', - 'image_gallery_thumbnail_memory_limit' => 'Failed to create gallery thumbnails due to system resource limits.', - 'drawing_data_not_found' => 'Drawing data could not be loaded. The drawing file might no longer exist or you may not have permission to access it.', + 'image_upload_error' => '이미지를 업로드하는 동안 오류가 발생했습니다.', + 'image_upload_type_error' => '업로드 중인 이미지 유형이 유효하지 않습니다.', + 'image_upload_replace_type' => '이미지 파일 교체는 반드시 동일한 유형이어야 합니다.', + 'image_upload_memory_limit' => '시스템 리소스 제한으로 인해 이미지 업로드를 처리하거나 미리보기 이미지를 만들지 못했습니다.', + 'image_thumbnail_memory_limit' => '시스템 리소스 제한으로 인해 이미지 크기 변형을 만들지 못했습니다.', + 'image_gallery_thumbnail_memory_limit' => '시스템 리소스 제한으로 인해 갤러리 썸네일을 만들지 못했습니다.', + 'drawing_data_not_found' => '드로잉 데이터를 로드할 수 없습니다. 드로잉 파일이 더 이상 존재하지 않거나 해당 파일에 액세스할 수 있는 권한이 없을 수 있습니다.', // Attachments - 'attachment_not_found' => '첨부 파일이 없습니다.', - 'attachment_upload_error' => 'An error occurred uploading the attachment file', + 'attachment_not_found' => '첨부 파일을 찾을 수 없습니다.', + 'attachment_upload_error' => '첨부 파일을 업로드하는 동안 오류가 발생했습니다.', // Pages - 'page_draft_autosave_fail' => '초안 문서를 유실했습니다. 인터넷 연결 상태를 확인하세요.', - 'page_draft_delete_fail' => 'Failed to delete page draft and fetch current page saved content', - 'page_custom_home_deletion' => '처음 페이지는 지울 수 없습니다.', + 'page_draft_autosave_fail' => '초안을 저장하지 못했습니다. 이 페이지를 저장하기 전에 인터넷에 연결되어 있는지 확인하세요.', + 'page_draft_delete_fail' => '페이지 초안을 삭제하고 현재 페이지에 저장된 콘텐츠를 가져오지 못했습니다.', + 'page_custom_home_deletion' => '페이지가 홈페이지로 설정되어 있는 동안에는 삭제할 수 없습니다.', // Entities 'entity_not_found' => '항목이 없습니다.', - 'bookshelf_not_found' => 'Shelf not found', + 'bookshelf_not_found' => '책장을 찾을 수 없음', 'book_not_found' => '책이 없습니다.', 'page_not_found' => '문서가 없습니다.', 'chapter_not_found' => '챕터가 없습니다.', @@ -115,5 +115,5 @@ 'maintenance_test_email_failure' => '메일을 발송하는 도중 문제가 생겼습니다:', // HTTP errors - 'http_ssr_url_no_match' => 'The URL does not match the configured allowed SSR hosts', + 'http_ssr_url_no_match' => 'URL이 구성된 허용된 SSR 호스트와 일치하지 않습니다.', ]; diff --git a/lang/ko/notifications.php b/lang/ko/notifications.php index 1afd23f1dc4..b337fa86de2 100644 --- a/lang/ko/notifications.php +++ b/lang/ko/notifications.php @@ -4,24 +4,24 @@ */ return [ - 'new_comment_subject' => 'New comment on page: :pageName', - 'new_comment_intro' => 'A user has commented on a page in :appName:', - 'new_page_subject' => 'New page: :pageName', - 'new_page_intro' => 'A new page has been created in :appName:', - 'updated_page_subject' => 'Updated page: :pageName', - 'updated_page_intro' => 'A page has been updated in :appName:', - 'updated_page_debounce' => 'To prevent a mass of notifications, for a while you won\'t be sent notifications for further edits to this page by the same editor.', + 'new_comment_subject' => '페이지에 새 댓글이 추가되었습니다: :pageName', + 'new_comment_intro' => '사용자가 :appName: 의 페이지에 댓글을 달았습니다.', + 'new_page_subject' => '새로운 페이지: :pageName', + 'new_page_intro' => ':appName: 에 새 페이지가 생성되었습니다.', + 'updated_page_subject' => '페이지 업데이트됨: :pageName', + 'updated_page_intro' => ':appName: 에서 페이지가 업데이트되었습니다:', + 'updated_page_debounce' => '알림이 한꺼번에 몰리는 것을 방지하기 위해 당분간 동일한 편집자가 이 페이지를 추가로 편집할 경우 알림이 전송되지 않습니다.', - 'detail_page_name' => 'Page Name:', - 'detail_page_path' => 'Page Path:', - 'detail_commenter' => 'Commenter:', - 'detail_comment' => 'Comment:', - 'detail_created_by' => 'Created By:', - 'detail_updated_by' => 'Updated By:', + 'detail_page_name' => '페이지 이름:', + 'detail_page_path' => '페이지 경로:', + 'detail_commenter' => '댓글 작성자:', + 'detail_comment' => '댓글:', + 'detail_created_by' => '작성자:', + 'detail_updated_by' => '업데이트한 사람:', - 'action_view_comment' => 'View Comment', - 'action_view_page' => 'View Page', + 'action_view_comment' => '댓글 보기', + 'action_view_page' => '페이지 보기', - 'footer_reason' => 'This notification was sent to you because :link cover this type of activity for this item.', - 'footer_reason_link' => 'your notification preferences', + 'footer_reason' => '이 알림이 전송된 이유는 :link 가 이 항목의 이러한 유형의 활동에 해당하기 때문입니다.', + 'footer_reason_link' => '내 알림 환경설정', ]; diff --git a/lang/ko/preferences.php b/lang/ko/preferences.php index dec399112a5..ccc09e7a33f 100644 --- a/lang/ko/preferences.php +++ b/lang/ko/preferences.php @@ -5,10 +5,10 @@ */ return [ - 'my_account' => 'My Account', + 'my_account' => '내 계정', 'shortcuts' => '단축키', - 'shortcuts_interface' => 'UI Shortcut Preferences', + 'shortcuts_interface' => 'UI 바로 가기 환경설정', 'shortcuts_toggle_desc' => '여기에서 탐색과 행동에 사용될 수 있는 키보드 단축키를 활성화하거나 비활성화할 수 있습니다.', 'shortcuts_customize_desc' => '아래에서 각 단축키를 사용자 지정할 수 있습니다. 바로가기에 대한 입력을 선택한 후 원하는 키 조합을 누르기만 하면 됩니다.', 'shortcuts_toggle_label' => '키보드 단축키가 활성화되었습니다.', @@ -17,35 +17,35 @@ 'shortcuts_save' => '단축키 저장', 'shortcuts_overlay_desc' => '참고: 바로가기가 활성화된 경우 "?"를 누르면 현재 화면에 표시되는 작업에 대해 사용 가능한 바로가기를 강조 표시하는 도우미 오버레이를 사용할 수 있습니다.', 'shortcuts_update_success' => '단축키 설정이 수정되었습니다!', - 'shortcuts_overview_desc' => 'Manage keyboard shortcuts you can use to navigate the system user interface.', + 'shortcuts_overview_desc' => '시스템 사용자 인터페이스를 탐색하는 데 사용할 수 있는 키보드 단축키를 관리합니다.', - 'notifications' => 'Notification Preferences', - 'notifications_desc' => 'Control the email notifications you receive when certain activity is performed within the system.', - 'notifications_opt_own_page_changes' => 'Notify upon changes to pages I own', - 'notifications_opt_own_page_comments' => 'Notify upon comments on pages I own', - 'notifications_opt_comment_replies' => 'Notify upon replies to my comments', - 'notifications_save' => 'Save Preferences', - 'notifications_update_success' => 'Notification preferences have been updated!', - 'notifications_watched' => 'Watched & Ignored Items', - 'notifications_watched_desc' => ' Below are the items that have custom watch preferences applied. To update your preferences for these, view the item then find the watch options in the sidebar.', + 'notifications' => '알림 환경설정', + 'notifications_desc' => '시스템 내에서 특정 활동이 수행될 때 수신하는 이메일 알림을 제어합니다.', + 'notifications_opt_own_page_changes' => '내가 소유한 페이지가 변경되면 알림 받기', + 'notifications_opt_own_page_comments' => '내가 소유한 페이지에 댓글이 달렸을 때 알림 받기', + 'notifications_opt_comment_replies' => '내 댓글에 대한 답글 알림 받기', + 'notifications_save' => '환경설정 저장', + 'notifications_update_success' => '알림 환경설정이 업데이트되었습니다!', + 'notifications_watched' => '주시 및 무시한 항목', + 'notifications_watched_desc' => ' 아래는 사용자 지정 시계 환경설정이 적용된 항목입니다. 이러한 항목에 대한 환경설정을 업데이트하려면 해당 항목을 본 다음 사이드바에서 시계 옵션을 찾습니다.', - 'auth' => 'Access & Security', - 'auth_change_password' => 'Change Password', - 'auth_change_password_desc' => 'Change the password you use to log-in to the application. This must be at least 8 characters long.', - 'auth_change_password_success' => 'Password has been updated!', + 'auth' => '액세스 및 보안', + 'auth_change_password' => '패스워드 변경', + 'auth_change_password_desc' => '애플리케이션에 로그인할 때 사용하는 패스워드를 변경합니다. 패스워드는 8자 이상이어야 합니다.', + 'auth_change_password_success' => '패스워드가 업데이트되었습니다!', - 'profile' => 'Profile Details', - 'profile_desc' => 'Manage the details of your account which represents you to other users, in addition to details that are used for communication and system personalisation.', - 'profile_view_public' => 'View Public Profile', - 'profile_name_desc' => 'Configure your display name which will be visible to other users in the system through the activity you perform, and content you own.', - 'profile_email_desc' => 'This email will be used for notifications and, depending on active system authentication, system access.', - 'profile_email_no_permission' => 'Unfortunately you don\'t have permission to change your email address. If you want to change this, you\'d need to ask an administrator to change this for you.', - 'profile_avatar_desc' => 'Select an image which will be used to represent yourself to others in the system. Ideally this image should be square and about 256px in width and height.', - 'profile_admin_options' => 'Administrator Options', - 'profile_admin_options_desc' => 'Additional administrator-level options, like those to manage role assignments, can be found for your user account in the "Settings > Users" area of the application.', + 'profile' => '프로필 세부 정보', + 'profile_desc' => '커뮤니케이션 및 시스템 맞춤 설정에 사용되는 세부 정보 외에 다른 사용자에게 나를 나타내는 계정의 세부 정보를 관리합니다.', + 'profile_view_public' => '공개 프로필 보기', + 'profile_name_desc' => '내가 수행하는 활동과 내가 소유한 콘텐츠를 통해 시스템의 다른 사용자에게 표시되는 표시 이름을 구성합니다.', + 'profile_email_desc' => '이 이메일은 알림 및 활성 시스템 인증에 따라 시스템 액세스에 사용됩니다.', + 'profile_email_no_permission' => '안타깝게도 회원님에게는 이메일 주소를 변경할 수 있는 권한이 없습니다. 이메일 주소를 변경하려면 관리자에게 변경을 요청해야 합니다.', + 'profile_avatar_desc' => '시스템에서 다른 사람들에게 자신을 나타내는 데 사용할 이미지를 선택합니다. 이 이미지는 256 x 256픽셀인 정사각형이 가장 이상적입니다.', + 'profile_admin_options' => '관리자 옵션', + 'profile_admin_options_desc' => '역할 할당 관리와 같은 추가 관리자 수준 옵션은 애플리케이션의 "설정 > 사용자" 영역에서 사용자 계정에 대해 찾을 수 있습니다.', - 'delete_account' => 'Delete Account', - 'delete_my_account' => 'Delete My Account', - 'delete_my_account_desc' => 'This will fully delete your user account from the system. You will not be able to recover this account or revert this action. Content you\'ve created, such as created pages and uploaded images, will remain.', - 'delete_my_account_warning' => 'Are you sure you want to delete your account?', + 'delete_account' => '계정 삭제', + 'delete_my_account' => '내 계정 삭제', + 'delete_my_account_desc' => '이렇게 하면 시스템에서 사용자 계정이 완전히 삭제됩니다. 이 계정을 복구하거나 이 작업을 되돌릴 수 없습니다. 생성한 페이지와 업로드한 이미지 등 사용자가 만든 콘텐츠는 그대로 유지됩니다.', + 'delete_my_account_warning' => '정말 계정을 삭제하시겠습니까?', ]; diff --git a/lang/ko/settings.php b/lang/ko/settings.php index e60bb6646d9..fe6dd4c7e25 100644 --- a/lang/ko/settings.php +++ b/lang/ko/settings.php @@ -14,47 +14,47 @@ // App Settings 'app_customization' => '맞춤', - 'app_features_security' => '보안', - 'app_name' => '사이트 제목', - 'app_name_desc' => '메일을 보낼 때 이 제목을 씁니다.', - 'app_name_header' => '사이트 헤더 사용', + 'app_features_security' => '기능 및 보안', + 'app_name' => '애플리케이션 이름 (사이트 제목)', + 'app_name_desc' => '이 이름은 헤더와 시스템에서 보낸 모든 이메일에 표시됩니다.', + 'app_name_header' => '헤더에 이름 표시', 'app_public_access' => '사이트 공개', - 'app_public_access_desc' => '계정 없는 사용자가 문서를 볼 수 있습니다.', - 'app_public_access_desc_guest' => '이들의 권한은 사용자 이름이 Guest인 사용자로 관리할 수 있습니다.', - 'app_public_access_toggle' => '사이트 공개', - 'app_public_viewing' => '공개할 건가요?', - 'app_secure_images' => '이미지 주소 보호', - 'app_secure_images_toggle' => '이미지 주소 보호', - 'app_secure_images_desc' => '성능상의 문제로 이미지에 누구나 접근할 수 있기 때문에 이미지 주소를 무작위한 문자로 구성합니다. 폴더 색인을 끄세요.', + 'app_public_access_desc' => '이 옵션을 활성화하면 로그인하지 않은 방문자도 북스택 인스턴스의 콘텐츠에 액세스할 수 있습니다.', + 'app_public_access_desc_guest' => '일반 방문자의 액세스는 "Guest" 사용자를 통해 제어할 수 있습니다.', + 'app_public_access_toggle' => '공개 액세스 허용', + 'app_public_viewing' => '공개 열람을 허용할까요?', + 'app_secure_images' => '보안 강화된 이미지 업로드', + 'app_secure_images_toggle' => '보안 강화된 이미지 업로드 사용', + 'app_secure_images_desc' => '성능상의 이유로 모든 이미지는 공개됩니다. 이 옵션은 이미지 URL 앞에 추측하기 어려운 임의의 문자열을 추가합니다. 쉽게 액세스할 수 없도록 디렉토리 인덱스가 활성화되어 있지 않은지 확인하세요.', 'app_default_editor' => '기본 페이지 편집기', 'app_default_editor_desc' => '새 페이지를 편집할 때 기본으로 사용될 편집기를 선택합니다. 권한을 갖고 있다면 페이지마다 다르게 적용될 수 있습니다.', - 'app_custom_html' => '헤드 작성', - 'app_custom_html_desc' => '설정 페이지를 제외한 모든 페이지 head 태그 끝머리에 추가합니다.', - 'app_custom_html_disabled_notice' => '문제가 생겨도 설정 페이지에서 되돌릴 수 있어요.', - 'app_logo' => '사이트 로고', + 'app_custom_html' => '사용자 지정 HTML 헤드 콘텐츠', + 'app_custom_html_desc' => '여기에 추가된 모든 콘텐츠는 모든 페이지의 섹션 하단에 삽입됩니다. 스타일을 재정의하거나 분석 코드를 추가할 때 유용합니다.', + 'app_custom_html_disabled_notice' => '이 설정 페이지에서는 사용자 지정 HTML 헤드 콘텐츠가 비활성화되어 변경 사항을 되돌릴 수 있습니다.', + 'app_logo' => '애플리케이션 로고 (사이트 로고)', 'app_logo_desc' => '이 이미지는 애플리케이션 헤더 표시줄 등 여러 영역에서 사용됩니다. 이 이미지의 높이는 86픽셀이어야 합니다. 큰 이미지는 축소됩니다.', 'app_icon' => '애플리케이션 아이콘', 'app_icon_desc' => '이 아이콘은 브라우저 탭과 바로 가기 아이콘에 사용됩니다. 256픽셀의 정사각형 PNG 이미지여야 합니다.', - 'app_homepage' => '처음 페이지', - 'app_homepage_desc' => '고른 페이지에 설정한 권한은 무시합니다.', - 'app_homepage_select' => '문서 고르기', + 'app_homepage' => '애플리케이션 홈페이지', + 'app_homepage_desc' => '기본 보기 대신 홈페이지에 표시할 보기를 선택합니다. 선택한 페이지에 대한 페이지 권한은 무시됩니다.', + 'app_homepage_select' => '페이지를 선택하십시오', 'app_footer_links' => '바닥글 링크', - 'app_footer_links_desc' => '바닥글 링크는 로그인하지 않아도 보일 수 있습니다. "trans::" 레이블로 시스템에 있는 번역을 가져옵니다. trans::common.privacy_policy와 trans::common.terms_of_service를 쓸 수 있습니다.', + 'app_footer_links_desc' => '사이트 바닥글에 표시할 링크를 추가합니다. 이 링크는 로그인이 필요 없는 페이지를 포함하여 대부분의 페이지 하단에 표시됩니다. "trans::" 레이블을 사용하여 시스템 정의 번역을 사용할 수 있습니다. 예를 들면 다음과 같습니다: "trans::common.privacy_policy"를 사용하면 "개인정보처리방침"이라는 번역 텍스트가 제공되고 "trans::common.terms_of_service"를 사용하면 "서비스 약관"이라는 번역 텍스트가 제공됩니다.', 'app_footer_links_label' => '링크 레이블', 'app_footer_links_url' => '링크 URL', 'app_footer_links_add' => '바닥글 링크 추가', 'app_disable_comments' => '댓글 사용 안 함', 'app_disable_comments_toggle' => '댓글 사용 안 함', - 'app_disable_comments_desc' => '모든 페이지에서 댓글을 숨깁니다.', + 'app_disable_comments_desc' => '애플리케이션의 모든 페이지에서 코멘트를 비활성화합니다.
기존 댓글도 표시되지 않습니다.', // Color settings - 'color_scheme' => '애플리케이션 색상 스키마', - 'color_scheme_desc' => '애플리케이션 사용자 인터페이스에서 사용할 색상을 설정합니다. 테마에 가장 잘 맞으면서 가독성을 보장하기 위해 어두운 모드와 밝은 모드에 대해 색상을 개별적으로 구성할 수 있습니다.', + 'color_scheme' => '애플리케이션 색상 구성표', + 'color_scheme_desc' => '애플리케이션 사용자 인터페이스에서 사용할 색상을 설정합니다. 테마에 가장 잘 어울리고 가독성을 보장하기 위해 어두운 모드와 밝은 모드에 대해 색상을 별도로 구성할 수 있습니다.', 'ui_colors_desc' => '애플리케이션 기본 색상과 기본 링크 색상을 설정합니다. 기본 색상은 주로 헤더 배너, 버튼 및 인터페이스 장식에 사용됩니다. 기본 링크 색상은 작성된 콘텐츠와 애플리케이션 인터페이스 모두에서 텍스트 기반 링크 및 작업에 사용됩니다.', 'app_color' => '주 색상', 'link_color' => '기본 링크 색상', 'content_colors_desc' => '페이지 구성 계층 구조의 모든 요소에 대한 색상을 설정합니다. 가독성을 위해 기본 색상과 비슷한 밝기의 색상을 선택하는 것이 좋습니다.', - 'bookshelf_color' => '책꽂이 색상', + 'bookshelf_color' => '책장 색상', 'book_color' => '책 색상', 'chapter_color' => '챕터 색상', 'page_color' => '페이지 색상', @@ -62,7 +62,7 @@ // Registration Settings 'reg_settings' => '가입', - 'reg_enable' => '가입 받기', + 'reg_enable' => '가입 활성화', 'reg_enable_toggle' => '가입 받기', 'reg_enable_desc' => '가입한 사용자는 한 가지 권한을 가집니다.', 'reg_default_role' => '기본 권한', @@ -163,7 +163,7 @@ 'role_manage_settings' => '사이트 설정 관리', 'role_export_content' => '항목 내보내기', 'role_editor_change' => '페이지 편집기 변경', - 'role_notifications' => 'Receive & manage notifications', + 'role_notifications' => '알림 수신 및 관리', 'role_asset' => '권한 항목', 'roles_system_warning' => '위 세 권한은 자신의 권한이나 다른 유저의 권한을 바꿀 수 있습니다.', 'role_asset_desc' => '책, 챕터, 문서별 권한은 이 설정에 우선합니다.', @@ -193,8 +193,8 @@ 'users_send_invite_text' => '패스워드 설정을 권유하는 메일을 보내거나 내가 정할 수 있습니다.', 'users_send_invite_option' => '메일 보내기', 'users_external_auth_id' => '외부 인증 계정', - 'users_external_auth_id_desc' => 'When an external authentication system is in use (such as SAML2, OIDC or LDAP) this is the ID which links this BookStack user to the authentication system account. You can ignore this field if using the default email-based authentication.', - 'users_password_warning' => 'Only fill the below if you would like to change the password for this user.', + 'users_external_auth_id_desc' => '외부 인증 시스템(예: SAML2, OIDC 또는 LDAP)을 사용 중인 경우 이 BookStack 사용자를 인증 시스템 계정에 연결하는 ID입니다. 기본 이메일 기반 인증을 사용하는 경우 이 필드를 무시할 수 있습니다.', + 'users_password_warning' => '이 사용자의 비밀번호를 변경하려는 경우에만 아래 내용을 입력하세요.', 'users_system_public' => '계정 없는 모든 사용자에 할당한 사용자입니다. 이 사용자로 로그인할 수 없어요.', 'users_delete' => '사용자 삭제', 'users_delete_named' => ':userName 삭제', @@ -210,16 +210,16 @@ 'users_preferred_language' => '언어', 'users_preferred_language_desc' => '문서 내용에는 아무런 영향을 주지 않습니다.', 'users_social_accounts' => '소셜 계정', - 'users_social_accounts_desc' => 'View the status of the connected social accounts for this user. Social accounts can be used in addition to the primary authentication system for system access.', + 'users_social_accounts_desc' => '이 사용자에 대해 연결된 소셜 계정의 상태를 봅니다. 소셜 계정은 시스템 액세스를 위한 기본 인증 시스템과 함께 사용할 수 있습니다.', 'users_social_accounts_info' => '다른 계정으로 간단하게 로그인하세요. 여기에서 계정 연결을 끊는 것과 소셜 계정에서 접근 권한을 취소하는 것은 다릅니다.', 'users_social_connect' => '계정 연결', 'users_social_disconnect' => '계정 연결 끊기', - 'users_social_status_connected' => 'Connected', - 'users_social_status_disconnected' => 'Disconnected', + 'users_social_status_connected' => '연결됨', + 'users_social_status_disconnected' => '연결 해제됨', 'users_social_connected' => ':socialAccount(와)과 연결했습니다.', 'users_social_disconnected' => ':socialAccount(와)과의 연결을 끊었습니다.', 'users_api_tokens' => 'API 토큰', - 'users_api_tokens_desc' => 'Create and manage the access tokens used to authenticate with the BookStack REST API. Permissions for the API are managed via the user that the token belongs to.', + 'users_api_tokens_desc' => 'BookStack REST API로 인증하는 데 사용되는 액세스 토큰을 생성하고 관리합니다. API에 대한 권한은 토큰이 속한 사용자를 통해 관리됩니다.', 'users_api_tokens_none' => '이 사용자를 위해 생성된 API 토큰이 없습니다.', 'users_api_tokens_create' => '토큰 만들기', 'users_api_tokens_expires' => '만료', diff --git a/lang/ko/validation.php b/lang/ko/validation.php index 1a5de20f4c3..e533429ee1a 100644 --- a/lang/ko/validation.php +++ b/lang/ko/validation.php @@ -9,7 +9,7 @@ // Standard laravel validation lines 'accepted' => ':attribute(을)를 허용하세요.', - 'active_url' => ':attribute(을)를 유효한 주소로 구성하세요.', + 'active_url' => ':attribute이 유효한 URL이 아닙니다.', 'after' => ':attribute(을)를 :date 후로 설정하세요.', 'alpha' => ':attribute(을)를 문자로만 구성하세요.', 'alpha_dash' => ':attribute(을)를 문자, 숫자, -, _로만 구성하세요.', diff --git a/lang/lv/activities.php b/lang/lv/activities.php index 3441621547d..742288c98dc 100644 --- a/lang/lv/activities.php +++ b/lang/lv/activities.php @@ -64,17 +64,17 @@ // Auth 'auth_login' => 'logged in', 'auth_register' => 'registered as new user', - 'auth_password_reset_request' => 'requested user password reset', - 'auth_password_reset_update' => 'reset user password', - 'mfa_setup_method' => 'configured MFA method', + 'auth_password_reset_request' => 'pieprasīja lietotāja paroles atiestatīšanu', + 'auth_password_reset_update' => 'atiestatīja lietotāja paroli', + 'mfa_setup_method' => 'uzstādīja MFA metodi', 'mfa_setup_method_notification' => '2FA funkcija aktivizēta', - 'mfa_remove_method' => 'removed MFA method', + 'mfa_remove_method' => 'noņēma MFA metodi', 'mfa_remove_method_notification' => '2FA funkcija noņemta', // Settings - 'settings_update' => 'updated settings', - 'settings_update_notification' => 'Settings successfully updated', - 'maintenance_action_run' => 'ran maintenance action', + 'settings_update' => 'atjaunoja uzstādījumus', + 'settings_update_notification' => 'Uzstādījums veiksmīgi atjaunināts', + 'maintenance_action_run' => 'veica apkopes darbību', // Webhooks 'webhook_create' => 'izveidoja webhook', @@ -85,39 +85,39 @@ 'webhook_delete_notification' => 'Webhook veiksmīgi izdzēsts', // Users - 'user_create' => 'created user', - 'user_create_notification' => 'User successfully created', - 'user_update' => 'updated user', + 'user_create' => 'izveidoja lietotāju', + 'user_create_notification' => 'Lietotājs veiksmīgi izveidots', + 'user_update' => 'atjaunoja lietotāju', 'user_update_notification' => 'Lietotājs veiksmīgi atjaunināts', - 'user_delete' => 'deleted user', + 'user_delete' => 'dzēsa lietotāju', 'user_delete_notification' => 'Lietotājs veiksmīgi dzēsts', // API Tokens - 'api_token_create' => 'created api token', - 'api_token_create_notification' => 'API token successfully created', - 'api_token_update' => 'updated api token', - 'api_token_update_notification' => 'API token successfully updated', - 'api_token_delete' => 'deleted api token', - 'api_token_delete_notification' => 'API token successfully deleted', + 'api_token_create' => 'izveidoja API žetonu', + 'api_token_create_notification' => 'API žetons veiksmīgi izveidots', + 'api_token_update' => 'atjaunoja API žetonu', + 'api_token_update_notification' => 'API žetons veiksmīgi atjaunināts', + 'api_token_delete' => 'dzēsa API žetonu', + 'api_token_delete_notification' => 'API žetons veiksmīgi dzēsts', // Roles - 'role_create' => 'created role', + 'role_create' => 'izveidoja lomu', 'role_create_notification' => 'Loma veiksmīgi izveidota', - 'role_update' => 'updated role', + 'role_update' => 'atjaunoja lomu', 'role_update_notification' => 'Loma veiksmīgi atjaunināta', - 'role_delete' => 'deleted role', + 'role_delete' => 'dzēsa lomu', 'role_delete_notification' => 'Loma veiksmīgi dzēsta', // Recycle Bin - 'recycle_bin_empty' => 'emptied recycle bin', - 'recycle_bin_restore' => 'restored from recycle bin', - 'recycle_bin_destroy' => 'removed from recycle bin', + 'recycle_bin_empty' => 'iztukšoja atkritni', + 'recycle_bin_restore' => 'atjaunoja no atkritnes', + 'recycle_bin_destroy' => 'izdzēsa no atkritnes', // Comments 'commented_on' => 'komentēts', - 'comment_create' => 'added comment', - 'comment_update' => 'updated comment', - 'comment_delete' => 'deleted comment', + 'comment_create' => 'pievienoja komentāru', + 'comment_update' => 'atjaunoja komentārju', + 'comment_delete' => 'dzēsa komentāru', // Other 'permissions_update' => 'atjaunoja atļaujas', diff --git a/lang/lv/components.php b/lang/lv/components.php index 2b29b56253c..5a7197687cd 100644 --- a/lang/lv/components.php +++ b/lang/lv/components.php @@ -8,34 +8,34 @@ 'image_select' => 'Attēla izvēle', 'image_list' => 'Attēlu saraksts', 'image_details' => 'Attēla dati', - 'image_upload' => 'Augšuplādēt attēlu', + 'image_upload' => 'Augšupielādēt attēlu', 'image_intro' => 'Šeit jūs varat izvēlēties un pārvaldīt attēlus, kuri iepriekš tika aplugšupielādēti sistēmā.', - 'image_intro_upload' => 'Upload a new image by dragging an image file into this window, or by using the "Upload Image" button above.', + 'image_intro_upload' => 'Augšupielādējiet jaunu attēlu ievelkot attēla failu šajā logā vai izmantojot "Augšupielādēt attēlu" pogu augstāk.', 'image_all' => 'Visi', 'image_all_title' => 'Skatīt visus attēlus', 'image_book_title' => 'Apskatīt augšupielādētos attēlus šajā grāmatā', 'image_page_title' => 'Apskatīt augšupielādētos attēlus šajā lapā', 'image_search_hint' => 'Meklēt pēc attēla vārda', 'image_uploaded' => 'Augšupielādēts :uploadedDate', - 'image_uploaded_by' => 'Uploaded by :userName', - 'image_uploaded_to' => 'Uploaded to :pageLink', - 'image_updated' => 'Updated :updateDate', + 'image_uploaded_by' => 'Augšupielādēja :userName', + 'image_uploaded_to' => 'Augšupielādēja :pageLink', + 'image_updated' => 'Atjaunots :updateDate', 'image_load_more' => 'Ielādēt vairāk', 'image_image_name' => 'Attēla nosaukums', 'image_delete_used' => 'Šis attēls ir ievietots zemāk redzamajās lapās.', 'image_delete_confirm_text' => 'Vai tiešām vēlaties dzēst šo attēlu?', 'image_select_image' => 'Atlasīt attēlu', 'image_dropzone' => 'Ievilkt attēlu vai klikšķinat šeit, lai augšupielādētu', - 'image_dropzone_drop' => 'Drop images here to upload', + 'image_dropzone_drop' => 'Ievelciet attēlus šeit, lai augšupielādētu', 'images_deleted' => 'Dzēstie attēli', 'image_preview' => 'Attēla priekšskatījums', 'image_upload_success' => 'Attēls ir veiksmīgi augšupielādēts', 'image_update_success' => 'Attēlā informācija ir veiksmīgi atjunināta', 'image_delete_success' => 'Attēls veiksmīgi dzēsts', 'image_replace' => 'Nomainīt bildi', - 'image_replace_success' => 'Image file successfully updated', - 'image_rebuild_thumbs' => 'Regenerate Size Variations', - 'image_rebuild_thumbs_success' => 'Image size variations successfully rebuilt!', + 'image_replace_success' => 'Attēla fails veiksmīgi atjaunots', + 'image_rebuild_thumbs' => 'No jauna izveidot attēla dažādu izmēru variantus', + 'image_rebuild_thumbs_success' => 'Attēlu varianti veiksmīgi atjaunoti!', // Code Editor 'code_editor' => 'Rediģēt kodu', diff --git a/lang/lv/entities.php b/lang/lv/entities.php index 40115afff24..96d6b706a15 100644 --- a/lang/lv/entities.php +++ b/lang/lv/entities.php @@ -132,7 +132,7 @@ 'books_edit_named' => 'Labot grāmatu :bookName', 'books_form_book_name' => 'Grāmatas nosaukums', 'books_save' => 'Saglabāt grāmatu', - 'books_default_template' => 'Default Page Template', + 'books_default_template' => 'Noklusētā lapas sagatave', 'books_default_template_explain' => 'Assign a page template that will be used as the default content for all new pages in this book. Keep in mind this will only be used if the page creator has view access to those chosen template page.', 'books_default_template_select' => 'Select a template page', 'books_permissions' => 'Grāmatas atļaujas', @@ -272,11 +272,11 @@ 'pages_revisions_restore' => 'Atjaunot', 'pages_revisions_none' => 'Šai lapai nav revīziju', 'pages_copy_link' => 'Kopēt saiti', - 'pages_edit_content_link' => 'Jump to section in editor', + 'pages_edit_content_link' => 'Pārlekt uz sadaļu redaktorā', 'pages_pointer_enter_mode' => 'Enter section select mode', - 'pages_pointer_label' => 'Page Section Options', - 'pages_pointer_permalink' => 'Page Section Permalink', - 'pages_pointer_include_tag' => 'Page Section Include Tag', + 'pages_pointer_label' => 'Lapas sadaļas uzstādījumi', + 'pages_pointer_permalink' => 'Lapas sadaļas saite', + 'pages_pointer_include_tag' => 'Lapas sadaļas iekļaušanas tags', 'pages_pointer_toggle_link' => 'Permalink mode, Press to show include tag', 'pages_pointer_toggle_include' => 'Include tag mode, Press to show permalink', 'pages_permissions_active' => 'Lapas atļaujas ir aktīvas', @@ -373,7 +373,7 @@ 'comment_new' => 'Jauns komentārs', 'comment_created' => 'komentējis :createDiff', 'comment_updated' => ':username atjauninājis pirms :updateDiff', - 'comment_updated_indicator' => 'Updated', + 'comment_updated_indicator' => 'Atjaunots', 'comment_deleted_success' => 'Komentārs ir dzēsts', 'comment_created_success' => 'Komentārs ir pievienots', 'comment_updated_success' => 'Komentārs ir atjaunināts', @@ -412,21 +412,21 @@ 'references_to_desc' => 'Listed below is all the known content in the system that links to this item.', // Watch Options - 'watch' => 'Watch', + 'watch' => 'Vērot', 'watch_title_default' => 'Default Preferences', 'watch_desc_default' => 'Revert watching to just your default notification preferences.', - 'watch_title_ignore' => 'Ignore', + 'watch_title_ignore' => 'Ignorēt', 'watch_desc_ignore' => 'Ignore all notifications, including those from user-level preferences.', - 'watch_title_new' => 'New Pages', + 'watch_title_new' => 'Jaunas lapas', 'watch_desc_new' => 'Notify when any new page is created within this item.', - 'watch_title_updates' => 'All Page Updates', + 'watch_title_updates' => 'Visi lapu atjauninājumi', 'watch_desc_updates' => 'Notify upon all new pages and page changes.', 'watch_desc_updates_page' => 'Notify upon all page changes.', - 'watch_title_comments' => 'All Page Updates & Comments', + 'watch_title_comments' => 'Visi lapu atjauninājumi un komentāri', 'watch_desc_comments' => 'Notify upon all new pages, page changes and new comments.', 'watch_desc_comments_page' => 'Notify upon page changes and new comments.', 'watch_change_default' => 'Change default notification preferences', - 'watch_detail_ignore' => 'Ignoring notifications', + 'watch_detail_ignore' => 'Ignorēt paziņojumus', 'watch_detail_new' => 'Watching for new pages', 'watch_detail_updates' => 'Watching new pages and updates', 'watch_detail_comments' => 'Watching new pages, updates & comments', diff --git a/lang/lv/errors.php b/lang/lv/errors.php index 72abed6e62a..2a5777a0a7f 100644 --- a/lang/lv/errors.php +++ b/lang/lv/errors.php @@ -43,16 +43,16 @@ 'cannot_get_image_from_url' => 'Nevar iegūt bildi no :url', 'cannot_create_thumbs' => 'Serveris nevar izveidot samazinātus attēlus. Lūdzu pārbaudiet, vai ir uzstādīts PHP GD paplašinājums.', 'server_upload_limit' => 'Serveris neatļauj šāda izmēra failu ielādi. Lūdzu mēģiniet mazāka izmēra failu.', - 'server_post_limit' => 'The server cannot receive the provided amount of data. Try again with less data or a smaller file.', + 'server_post_limit' => 'Serveris nevar apstrādāt šāda izmēra datus. Lūdzu mēģiniet vēlreiz ar mazāku datu apjomu vai mazāku failu.', 'uploaded' => 'Serveris neatļauj šāda izmēra failu ielādi. Lūdzu mēģiniet mazāka izmēra failu.', // Drawing & Images 'image_upload_error' => 'Radās kļūda augšupielādējot attēlu', 'image_upload_type_error' => 'Ielādējamā attēla tips nav derīgs', 'image_upload_replace_type' => 'Aizvietojot attēlu tipiem ir jābūt vienādiem', - 'image_upload_memory_limit' => 'Failed to handle image upload and/or create thumbnails due to system resource limits.', - 'image_thumbnail_memory_limit' => 'Failed to create image size variations due to system resource limits.', - 'image_gallery_thumbnail_memory_limit' => 'Failed to create gallery thumbnails due to system resource limits.', + 'image_upload_memory_limit' => 'Neizdevās apstrādāt attēla ielādi vai izveidot attēlu variantus sistēmas resursu ierobežojumu dēļ.', + 'image_thumbnail_memory_limit' => 'Neizdevās izveidot attēla dažādu izmēru variantus sistēmas resursu ierobežojumu dēļ.', + 'image_gallery_thumbnail_memory_limit' => 'Neizdevās izveidot galerijas sīktēlus sistēmas resursu ierobežojumu dēļ.', 'drawing_data_not_found' => 'Attēla datus nevarēja ielādēt. Attēla fails, iespējams, vairs neeksistē, vai arī jums varētu nebūt piekļuves tiesības tam.', // Attachments @@ -115,5 +115,5 @@ 'maintenance_test_email_failure' => 'Radusies kļūda sūtot testa epastu:', // HTTP errors - 'http_ssr_url_no_match' => 'The URL does not match the configured allowed SSR hosts', + 'http_ssr_url_no_match' => 'Adrese (URL) nesakrīt ar atļautajām SSR adresēm', ]; diff --git a/lang/lv/preferences.php b/lang/lv/preferences.php index aea349b3b72..b45a063343b 100644 --- a/lang/lv/preferences.php +++ b/lang/lv/preferences.php @@ -5,47 +5,47 @@ */ return [ - 'my_account' => 'My Account', + 'my_account' => 'Mans konts', 'shortcuts' => 'Saīsnes', - 'shortcuts_interface' => 'UI Shortcut Preferences', + 'shortcuts_interface' => 'Saskarnes īsceļu iestatījumi', 'shortcuts_toggle_desc' => 'Here you can enable or disable keyboard system interface shortcuts, used for navigation and actions.', 'shortcuts_customize_desc' => 'You can customize each of the shortcuts below. Just press your desired key combination after selecting the input for a shortcut.', 'shortcuts_toggle_label' => 'Klaviatūras saīsnes ieslēgtas', 'shortcuts_section_navigation' => 'Navigācija', - 'shortcuts_section_actions' => 'Common Actions', + 'shortcuts_section_actions' => 'Biežākās darbības', 'shortcuts_save' => 'Saglabāt saīsnes', 'shortcuts_overlay_desc' => 'Note: When shortcuts are enabled a helper overlay is available via pressing "?" which will highlight the available shortcuts for actions currently visible on the screen.', 'shortcuts_update_success' => 'Saīsņu uzstādījumi ir saglabāt!', 'shortcuts_overview_desc' => 'Manage keyboard shortcuts you can use to navigate the system user interface.', - 'notifications' => 'Notification Preferences', + 'notifications' => 'Paziņojumu iestatījumi', 'notifications_desc' => 'Control the email notifications you receive when certain activity is performed within the system.', - 'notifications_opt_own_page_changes' => 'Notify upon changes to pages I own', - 'notifications_opt_own_page_comments' => 'Notify upon comments on pages I own', - 'notifications_opt_comment_replies' => 'Notify upon replies to my comments', - 'notifications_save' => 'Save Preferences', - 'notifications_update_success' => 'Notification preferences have been updated!', - 'notifications_watched' => 'Watched & Ignored Items', + 'notifications_opt_own_page_changes' => 'Paziņot par izmaiņām manās lapās', + 'notifications_opt_own_page_comments' => 'Paziņot par komentāriem manās lapās', + 'notifications_opt_comment_replies' => 'Paziņot par atbildēm uz maniem komentāriem', + 'notifications_save' => 'Saglabāt iestatījumus', + 'notifications_update_success' => 'Paziņojumu iestatījumi ir atjaunoti!', + 'notifications_watched' => 'Vērotie un ignorētie vienumi', 'notifications_watched_desc' => ' Below are the items that have custom watch preferences applied. To update your preferences for these, view the item then find the watch options in the sidebar.', - 'auth' => 'Access & Security', - 'auth_change_password' => 'Change Password', - 'auth_change_password_desc' => 'Change the password you use to log-in to the application. This must be at least 8 characters long.', - 'auth_change_password_success' => 'Password has been updated!', + 'auth' => 'Piekļuve un drošība', + 'auth_change_password' => 'Mainīt paroli', + 'auth_change_password_desc' => 'Mainīt paroli, ko izmantojat, lai piekļūtu aplikācijai. Tai jābūt vismaz 8 simbolus garai.', + 'auth_change_password_success' => 'Parole ir nomainīta!', - 'profile' => 'Profile Details', + 'profile' => 'Profila informācija', 'profile_desc' => 'Manage the details of your account which represents you to other users, in addition to details that are used for communication and system personalisation.', - 'profile_view_public' => 'View Public Profile', + 'profile_view_public' => 'Skatīt publisko profilu', 'profile_name_desc' => 'Configure your display name which will be visible to other users in the system through the activity you perform, and content you own.', - 'profile_email_desc' => 'This email will be used for notifications and, depending on active system authentication, system access.', - 'profile_email_no_permission' => 'Unfortunately you don\'t have permission to change your email address. If you want to change this, you\'d need to ask an administrator to change this for you.', + 'profile_email_desc' => 'Šis epasts tiks izmantots paziņojumiem un sistēmas piekļuvei, atkarībā no sistēmā uzstādītās autentifikācijas metodes.', + 'profile_email_no_permission' => 'Diemžēl jums nav tiesību mainīt savu epasta adresi. Ja vēlaties to mainīt, jums jāsazinās ar administratoru, lai tas nomaina šo adresi.', 'profile_avatar_desc' => 'Select an image which will be used to represent yourself to others in the system. Ideally this image should be square and about 256px in width and height.', 'profile_admin_options' => 'Administrator Options', 'profile_admin_options_desc' => 'Additional administrator-level options, like those to manage role assignments, can be found for your user account in the "Settings > Users" area of the application.', - 'delete_account' => 'Delete Account', - 'delete_my_account' => 'Delete My Account', + 'delete_account' => 'Dzēst kontu', + 'delete_my_account' => 'Izdzēst manu kontu', 'delete_my_account_desc' => 'This will fully delete your user account from the system. You will not be able to recover this account or revert this action. Content you\'ve created, such as created pages and uploaded images, will remain.', - 'delete_my_account_warning' => 'Are you sure you want to delete your account?', + 'delete_my_account_warning' => 'Vai tiešām vēlaties dzēst savu kontu?', ]; diff --git a/lang/lv/settings.php b/lang/lv/settings.php index a443d497732..5c07cfc1d18 100644 --- a/lang/lv/settings.php +++ b/lang/lv/settings.php @@ -49,8 +49,8 @@ // Color settings 'color_scheme' => 'Lietotnes krāsu shēma', - 'color_scheme_desc' => 'Set the colors to use in the application user interface. Colors can be configured separately for dark and light modes to best fit the theme and ensure legibility.', - 'ui_colors_desc' => 'Set the application primary color and default link color. The primary color is mainly used for the header banner, buttons and interface decorations. The default link color is used for text-based links and actions, both within written content and in the application interface.', + 'color_scheme_desc' => 'Uzstādiet krāsas, ko izmantot aplikācijas lietotātja saskarnē. Krāsas var uzstādīt atsevišķi gaišajam un tumšajam režīmam, lai labāk iederētos vizuālajā tēmā un nodrošinātu lasāmību.', + 'ui_colors_desc' => 'Uzstādiem aplikācijas primāro krāsu un noklusēto saišu krāsu. Primārā krāsa tiek izmantota galvenokārt lapas galvenē, uz pogām un saskarnes dekoratīvajos elementos. Noklusētā saišu krāsa tiek lietota teksta saitēm un darbībām gan izveidotajā saturā, gan aplikācijas saskarnē.', 'app_color' => 'Pamatkrāsa', 'link_color' => 'Noklusētā saišu krāsa', 'content_colors_desc' => 'Norādīt krāsas visiem lapas hierarhijas elementiem. Lasāmības labad ieteicams izvēlēties krāsas ar līdzīgu spilgtumu kā noklusētajām.', @@ -92,10 +92,10 @@ 'maint_send_test_email_mail_text' => 'Apsveicam! Tā kā jūs saņēmāt šo epasta paziņojumu, jūsu epasta uzstādījumi šķiet pareizi.', 'maint_recycle_bin_desc' => 'Dzēstie plaukti, grāmatas, nodaļas un lapas ir pārceltas uz miskasti, lai tos varētu atjaunot vai izdzēst pilnībā. Vecākas vienības miskastē var tikt automātiski dzēstas pēc kāda laika atkarībā no sistēmas uzstādījumiem.', 'maint_recycle_bin_open' => 'Atvērt miskasti', - 'maint_regen_references' => 'Regenerate References', - 'maint_regen_references_desc' => 'This action will rebuild the cross-item reference index within the database. This is usually handled automatically but this action can be useful to index old content or content added via unofficial methods.', - 'maint_regen_references_success' => 'Reference index has been regenerated!', - 'maint_timeout_command_note' => 'Note: This action can take time to run, which can lead to timeout issues in some web environments. As an alternative, this action be performed using a terminal command.', + 'maint_regen_references' => 'Atjaunot atsauces', + 'maint_regen_references_desc' => 'Šī darbība no jauna izveidos atsauču indeksu datubāzē. Tas parasti notiek automātiski, taču šī darbība var palīdzēt, lai indeksētu vecāku saturu vai saturu, kas pievienots, izmantojot nestandarta metodes.', + 'maint_regen_references_success' => 'Atsauču indekss ir izveidots!', + 'maint_timeout_command_note' => 'Piezīme: Šī darbība var prasīt ilgāku laiku, kas var radīt pieprasījuma laika kļūmes (timeout) pie noteiktiem interneta vietnes uzstādījumiem. Alternatīva var būt veikt šo darbību, izmantojot termināla komandu.', // Recycle Bin 'recycle_bin' => 'Miskaste', @@ -214,8 +214,8 @@ 'users_social_accounts_info' => 'Te jūs varat pieslēgt citus kontus ātrākai un ērtākai piekļuvei. Konta atvienošana no šejienes neatceļ šai aplikācijai dotās tiesības šī konta piekļuvei. Atvienojtiet piekļuvi arī no jūsu profila uzstādījumiem pievienotajā sociālajā kontā.', 'users_social_connect' => 'Pievienot kontu', 'users_social_disconnect' => 'Atvienot kontu', - 'users_social_status_connected' => 'Connected', - 'users_social_status_disconnected' => 'Disconnected', + 'users_social_status_connected' => 'Savienots', + 'users_social_status_disconnected' => 'Atvienots', 'users_social_connected' => ':socialAccount konts veiksmīgi pieslēgts jūsu profilam.', 'users_social_disconnected' => ':socialAccount konts veiksmīgi atslēgts no jūsu profila.', 'users_api_tokens' => 'API žetoni', diff --git a/lang/nl/activities.php b/lang/nl/activities.php index 633ac888ebc..261583cc3a9 100644 --- a/lang/nl/activities.php +++ b/lang/nl/activities.php @@ -15,7 +15,7 @@ 'page_restore' => 'herstelde pagina', 'page_restore_notification' => 'Pagina succesvol hersteld', 'page_move' => 'verplaatste pagina', - 'page_move_notification' => 'Pagina met succes verplaatst', + 'page_move_notification' => 'Pagina succesvol verplaatst', // Chapters 'chapter_create' => 'maakte hoofdstuk', @@ -25,13 +25,13 @@ 'chapter_delete' => 'verwijderde hoofdstuk', 'chapter_delete_notification' => 'Hoofdstuk succesvol verwijderd', 'chapter_move' => 'verplaatste hoofdstuk', - 'chapter_move_notification' => 'Hoofdstuk met succes verplaatst', + 'chapter_move_notification' => 'Hoofdstuk succesvol verplaatst', // Books 'book_create' => 'maakte boek', 'book_create_notification' => 'Boek succesvol aangemaakt', - 'book_create_from_chapter' => 'heeft hoofdstuk geconverteerd naar boek', - 'book_create_from_chapter_notification' => 'Hoofdstuk is succesvol geconverteerd naar boekenplank', + 'book_create_from_chapter' => 'converteerde hoofdstuk naar boek', + 'book_create_from_chapter_notification' => 'Hoofdstuk succesvol geconverteerd naar een boek', 'book_update' => 'wijzigde boek', 'book_update_notification' => 'Boek succesvol bijgewerkt', 'book_delete' => 'verwijderde boek', @@ -40,14 +40,14 @@ 'book_sort_notification' => 'Boek succesvol opnieuw gesorteerd', // Bookshelves - 'bookshelf_create' => 'heeft boekenplank aangemaakt', - 'bookshelf_create_notification' => 'Boekenplank is succesvol aangemaakt', - 'bookshelf_create_from_book' => 'heeft boek geconverteerd naar boekenplank', - 'bookshelf_create_from_book_notification' => 'Boek is succesvol geconverteerd naar boekenplank', - 'bookshelf_update' => 'heeft boekenplank bijgewerkt', - 'bookshelf_update_notification' => 'Boekenplank is succesvol bijgewerkt', - 'bookshelf_delete' => 'heeft boekenplank verwijderd', - 'bookshelf_delete_notification' => 'Boekenplank is succesvol verwijderd', + 'bookshelf_create' => 'maakte boekenplank aan', + 'bookshelf_create_notification' => 'Boekenplank succesvol aangemaakt', + 'bookshelf_create_from_book' => 'converteerde boek naar boekenplank', + 'bookshelf_create_from_book_notification' => 'Boek succesvol geconverteerd naar boekenplank', + 'bookshelf_update' => 'werkte boekenplank bij', + 'bookshelf_update_notification' => 'Boekenplank succesvol bijgewerkt', + 'bookshelf_delete' => 'verwijderde boekenplank', + 'bookshelf_delete_notification' => 'Boekenplank succesvol verwijderd', // Revisions 'revision_restore' => 'herstelde revisie', @@ -62,50 +62,50 @@ 'watch_update_level_notification' => 'Volg voorkeuren succesvol aangepast', // Auth - 'auth_login' => 'heeft ingelogd', - 'auth_register' => 'geregistreerd als nieuwe gebruiker', - 'auth_password_reset_request' => 'heeft een nieuw gebruikerswachtwoord aangevraagd', - 'auth_password_reset_update' => 'heeft zijn gebruikerswachtwoord opnieuw ingesteld', - 'mfa_setup_method' => 'heeft zijn meervoudige verificatie methode ingesteld', - 'mfa_setup_method_notification' => 'Meervoudige verificatie methode is succesvol geconfigureerd', - 'mfa_remove_method' => 'heeft zijn meervoudige verificatie methode verwijderd', + 'auth_login' => 'logde in', + 'auth_register' => 'registreerde als nieuwe gebruiker', + 'auth_password_reset_request' => 'vraagde een nieuw gebruikerswachtwoord aan', + 'auth_password_reset_update' => 'stelde gebruikerswachtwoord opnieuw in', + 'mfa_setup_method' => 'stelde MFA-methode in', + 'mfa_setup_method_notification' => 'Meervoudige verificatie methode succesvol geconfigureerd', + 'mfa_remove_method' => 'verwijderde MFA-methode', 'mfa_remove_method_notification' => 'Meervoudige verificatie methode is succesvol verwijderd', // Settings - 'settings_update' => 'heeft de instellingen bijgewerkt', + 'settings_update' => 'werkte instellingen bij', 'settings_update_notification' => 'Instellingen met succes bijgewerkt', - 'maintenance_action_run' => 'heeft onderhoud uitgevoerd', + 'maintenance_action_run' => 'voerde onderhoudsactie uit', // Webhooks - 'webhook_create' => 'webhook aangemaakt', + 'webhook_create' => 'maakte webhook aan', 'webhook_create_notification' => 'Webhook succesvol aangemaakt', - 'webhook_update' => 'webhook bijgewerkt', + 'webhook_update' => 'werkte webhook bij', 'webhook_update_notification' => 'Webhook succesvol bijgewerkt', - 'webhook_delete' => 'webhook verwijderd', + 'webhook_delete' => 'verwijderde webhook', 'webhook_delete_notification' => 'Webhook succesvol verwijderd', // Users - 'user_create' => 'heeft gebruiker aangemaakt', + 'user_create' => 'maakte gebruiker aan', 'user_create_notification' => 'Gebruiker met succes aangemaakt', - 'user_update' => 'heeft gebruiker bijgewerkt', + 'user_update' => 'werkte gebruiker bij', 'user_update_notification' => 'Gebruiker succesvol bijgewerkt', - 'user_delete' => 'heeft gebruiker verwijderd', + 'user_delete' => 'verwijderde gebruiker', 'user_delete_notification' => 'Gebruiker succesvol verwijderd', // API Tokens - 'api_token_create' => 'heeft API token aangemaakt', - 'api_token_create_notification' => 'API token met succes aangemaakt', - 'api_token_update' => 'heeft API token bijgewerkt', - 'api_token_update_notification' => 'API token met succes bijgewerkt', - 'api_token_delete' => 'heeft API token verwijderd', - 'api_token_delete_notification' => 'API token met succes verwijderd', + 'api_token_create' => 'maakte api token aan', + 'api_token_create_notification' => 'API-token met succes aangemaakt', + 'api_token_update' => 'werkte api token bij', + 'api_token_update_notification' => 'API-token met succes bijgewerkt', + 'api_token_delete' => 'verwijderde api token', + 'api_token_delete_notification' => 'API-token met succes verwijderd', // Roles - 'role_create' => 'heeft rol aangemaakt', + 'role_create' => 'maakte rol aan', 'role_create_notification' => 'Rol succesvol aangemaakt', - 'role_update' => 'heeft rol bijgewerkt', + 'role_update' => 'werkte rol bij', 'role_update_notification' => 'Rol succesvol bijgewerkt', - 'role_delete' => 'heeft rol verwijderd', + 'role_delete' => 'verwijderde rol', 'role_delete_notification' => 'Rol succesvol verwijderd', // Recycle Bin @@ -115,9 +115,9 @@ // Comments 'commented_on' => 'reageerde op', - 'comment_create' => 'heeft opmerking toegevoegd', - 'comment_update' => 'heeft opmerking aangepast', - 'comment_delete' => 'heeft opmerking verwijderd', + 'comment_create' => 'voegde opmerking toe', + 'comment_update' => 'paste opmerking aan', + 'comment_delete' => 'verwijderde opmerking', // Other 'permissions_update' => 'wijzigde machtigingen', diff --git a/lang/nl/auth.php b/lang/nl/auth.php index dab15caca2a..1b974647ade 100644 --- a/lang/nl/auth.php +++ b/lang/nl/auth.php @@ -7,14 +7,14 @@ return [ 'failed' => 'Deze inloggegevens zijn niet bij ons bekend.', - 'throttle' => 'Te veel login pogingen! Probeer het opnieuw na :seconds seconden.', + 'throttle' => 'Te veel inlogpogingen! Probeer het opnieuw na :seconds seconden.', // Login & Register - 'sign_up' => 'Registreren', - 'log_in' => 'Inloggen', - 'log_in_with' => 'Login met :socialDriver', + 'sign_up' => 'Registreer', + 'log_in' => 'Log in', + 'log_in_with' => 'Log in met :socialDriver', 'sign_up_with' => 'Registreer met :socialDriver', - 'logout' => 'Uitloggen', + 'logout' => 'Log uit', 'name' => 'Naam', 'username' => 'Gebruikersnaam', @@ -23,7 +23,7 @@ 'password_confirm' => 'Wachtwoord Bevestigen', 'password_hint' => 'Moet uit minstens 8 tekens bestaan', 'forgot_password' => 'Wachtwoord vergeten?', - 'remember_me' => 'Mij onthouden', + 'remember_me' => 'Onthoud Mij', 'ldap_email_hint' => 'Geef een e-mailadres op voor dit account.', 'create_account' => 'Account aanmaken', 'already_have_account' => 'Heb je al een account?', @@ -87,7 +87,7 @@ 'mfa_setup_reconfigure' => 'Herconfigureren', 'mfa_setup_remove_confirmation' => 'Weet je zeker dat je deze multi-factor authenticatie methode wilt verwijderen?', 'mfa_setup_action' => 'Instellen', - 'mfa_backup_codes_usage_limit_warning' => 'U heeft minder dan 5 back-upcodes resterend. Genereer en sla een nieuwe set op voordat je geen codes meer hebt om te voorkomen dat je buiten je account wordt gesloten.', + 'mfa_backup_codes_usage_limit_warning' => 'U heeft minder dan 5 back-upcodes over. Genereer en sla een nieuwe set op voordat je geen codes meer hebt om te voorkomen dat je buiten je account wordt gesloten.', 'mfa_option_totp_title' => 'Mobiele app', 'mfa_option_totp_desc' => 'Om multi-factor authenticatie te gebruiken heeft u een mobiele applicatie nodig die TOTP ondersteunt, zoals Google Authenticator, Authy of Microsoft Authenticator.', 'mfa_option_backup_codes_title' => 'Back-up Codes', diff --git a/lang/nl/entities.php b/lang/nl/entities.php index 48625edd6a5..ee13185f697 100644 --- a/lang/nl/entities.php +++ b/lang/nl/entities.php @@ -6,24 +6,24 @@ return [ // Shared - 'recently_created' => 'Recent aangemaakt', - 'recently_created_pages' => 'Recent aangemaakte pagina\'s', + 'recently_created' => 'Recent gemaakt', + 'recently_created_pages' => 'Recent gemaakte pagina\'s', 'recently_updated_pages' => 'Recent bijgewerkte pagina\'s', - 'recently_created_chapters' => 'Recent aangemaakte hoofdstukken', - 'recently_created_books' => 'Recent aangemaakte boeken', - 'recently_created_shelves' => 'Recent aangemaakte boekenplanken', + 'recently_created_chapters' => 'Recent gemaakte hoofdstukken', + 'recently_created_books' => 'Recent gemaakte boeken', + 'recently_created_shelves' => 'Recent gemaakte boekenplanken', 'recently_update' => 'Recent bijgewerkt', 'recently_viewed' => 'Recent bekeken', 'recent_activity' => 'Recente activiteit', 'create_now' => 'Maak er nu één', 'revisions' => 'Revisies', 'meta_revision' => 'Revisie #:revisionCount', - 'meta_created' => 'Aangemaakt :timeLength', - 'meta_created_name' => 'Aangemaakt: :timeLength door :user', + 'meta_created' => 'Gemaakt op: :timeLength', + 'meta_created_name' => 'Gemaakt op :timeLength door :user', 'meta_updated' => 'Bijgewerkt: :timeLength', 'meta_updated_name' => 'Bijgewerkt: :timeLength door :user', 'meta_owned_name' => 'Eigendom van :user', - 'meta_reference_count' => 'Referenced by :count item|Referenced by :count items', + 'meta_reference_count' => 'Gerefereerd door :count item|Gerefereerd door :count items', 'entity_select' => 'Entiteit selecteren', 'entity_select_lack_permission' => 'Je hebt niet de vereiste machtiging om dit item te selecteren', 'images' => 'Afbeeldingen', @@ -32,7 +32,7 @@ 'my_most_viewed_favourites' => 'Mijn meest bekeken favorieten', 'my_favourites' => 'Mijn favorieten', 'no_pages_viewed' => 'Je hebt nog geen pagina\'s bekeken', - 'no_pages_recently_created' => 'Er zijn geen recent aangemaakte pagina\'s', + 'no_pages_recently_created' => 'Er zijn geen recent gemaakte pagina\'s', 'no_pages_recently_updated' => 'Er zijn geen pagina\'s recent bijgewerkt', 'export' => 'Exporteer', 'export_html' => 'Ingesloten webbestand', @@ -43,26 +43,26 @@ // Permissions and restrictions 'permissions' => 'Machtigingen', 'permissions_desc' => 'Stel hier machtigingen in om de standaardmachtigingen van gebruikersrollen te overschrijven.', - 'permissions_book_cascade' => 'Machtigingen voor boeken worden automatisch doorgegeven aan hoofdstukken en pagina\'s, tenzij deze hun eigen machtigingen hebben.', - 'permissions_chapter_cascade' => 'Machtigingen ingesteld op hoofdstukken zullen automatisch worden doorgegeven aan onderliggende pagina\'s, tenzij deze hun eigen machtigingen hebben.', + 'permissions_book_cascade' => 'Machtigingen voor boeken worden automatisch doorgegeven aan hoofdstukken en pagina\'s, behalve als deze hun eigen machtigingen hebben.', + 'permissions_chapter_cascade' => 'Machtigingen ingesteld op hoofdstukken zullen automatisch worden doorgegeven aan onderliggende pagina\'s, behalve als deze hun eigen machtigingen hebben.', 'permissions_save' => 'Machtigingen opslaan', 'permissions_owner' => 'Eigenaar', 'permissions_role_everyone_else' => 'De rest', - 'permissions_role_everyone_else_desc' => 'Stel machtigingen in voor alle rollen die niet specifiek overschreven worden.', + 'permissions_role_everyone_else_desc' => 'Stel machtigingen in voor alle rollen die niet specifiek overschreven zijn.', 'permissions_role_override' => 'Overschrijf machtigingen voor rol', 'permissions_inherit_defaults' => 'Standaardwaarden overnemen', // Search 'search_results' => 'Zoekresultaten', - 'search_total_results_found' => ':count resultaten gevonden|:count totaal aantal resultaten gevonden', + 'search_total_results_found' => ':count resultaten gevonden|totaal :count resultaten gevonden', 'search_clear' => 'Zoekopdracht wissen', - 'search_no_pages' => 'Er zijn geen pagina\'s gevonden', + 'search_no_pages' => 'Geen pagina\'s gevonden die overeenkomen met deze zoekopdracht', 'search_for_term' => 'Zoeken op :term', 'search_more' => 'Meer resultaten', 'search_advanced' => 'Uitgebreid zoeken', 'search_terms' => 'Zoektermen', 'search_content_type' => 'Inhoudstype', - 'search_exact_matches' => 'Exacte matches', + 'search_exact_matches' => 'Exacte overeenkomsten', 'search_tags' => 'Label Zoekopdrachten', 'search_options' => 'Opties', 'search_viewed_by_me' => 'Bekeken door mij', @@ -74,8 +74,8 @@ 'search_date_options' => 'Datum opties', 'search_updated_before' => 'Bijgewerkt voor', 'search_updated_after' => 'Bijgewerkt na', - 'search_created_before' => 'Aangemaakt voor', - 'search_created_after' => 'Aangemaakt na', + 'search_created_before' => 'Gemaakt voor', + 'search_created_after' => 'Gemaakt na', 'search_set_date' => 'Stel datum in', 'search_update' => 'Update zoekresultaten', @@ -83,13 +83,13 @@ 'shelf' => 'Boekenplank', 'shelves' => 'Boekenplanken', 'x_shelves' => ':count Boekenplank|:count Boekenplanken', - 'shelves_empty' => 'Er zijn geen boekenplanken aangemaakt', + 'shelves_empty' => 'Er zijn geen boekenplanken gemaakt', 'shelves_create' => 'Nieuwe boekenplank maken', 'shelves_popular' => 'Populaire boekenplanken', 'shelves_new' => 'Nieuwe boekenplanken', 'shelves_new_action' => 'Nieuwe boekenplank', 'shelves_popular_empty' => 'De meest populaire boekenplanken worden hier weergegeven.', - 'shelves_new_empty' => 'De meest recent aangemaakte boekenplanken worden hier weergeven.', + 'shelves_new_empty' => 'De meest recent gemaakte boekenplanken worden hier weergeven.', 'shelves_save' => 'Boekenplank opslaan', 'shelves_books' => 'Boeken op deze plank', 'shelves_add_books' => 'Voeg boeken toe aan deze plank', @@ -106,23 +106,23 @@ 'shelves_permissions_updated' => 'Boekenplank Machtigingen Bijgewerkt', 'shelves_permissions_active' => 'Machtigingen op Boekenplank Actief', 'shelves_permissions_cascade_warning' => 'De ingestelde machtigingen op deze boekenplank worden niet automatisch toegepast op de boeken van deze boekenplank. Dit is omdat een boek toegekend kan worden op meerdere boekenplanken. De machtigingen van deze boekenplank kunnen echter wel gekopieerd worden naar de boeken van deze boekenplank via de optie hieronder.', - 'shelves_permissions_create' => '\'Maak boekenplank\' machtigingen worden enkel gebruikt om machtigingen te kopiëren naar boeken binnenin een boekenplank door gebruik te maken van onderstaande actie. Deze machtigingen laten niet toe om een nieuw boek aan te maken.', + 'shelves_permissions_create' => '\'Maak boekenplank\' machtigingen worden enkel gebruikt om machtigingen te kopiëren naar boeken binnenin een boekenplank door gebruik te maken van onderstaande actie. Deze machtigingen beheren het maken van boeken niet.', 'shelves_copy_permissions_to_books' => 'Kopieer Machtigingen naar Boeken', 'shelves_copy_permissions' => 'Kopieer Machtigingen', - 'shelves_copy_permissions_explain' => 'Met deze actie worden de machtigingen van deze boekenplank gekopieërd naar alle boeken van deze boekenplank. Voor je deze actie uitvoert, moet je ervoor zorgen dat alle wijzigingen in de machtigingen van deze boekenplank zijn opgeslagen.', - 'shelves_copy_permission_success' => 'Boekenplank machtingen gekopieerd naar :count boeken', + 'shelves_copy_permissions_explain' => 'Met deze actie worden de machtigingen van deze boekenplank gekopieerd naar alle boeken van deze boekenplank. Voor je deze actie uitvoert, moet je ervoor zorgen dat alle wijzigingen in de machtigingen van deze boekenplank zijn opgeslagen.', + 'shelves_copy_permission_success' => 'Boekenplank machtigingen gekopieerd naar :count boeken', // Books 'book' => 'Boek', 'books' => 'Boeken', 'x_books' => ':count Boek|:count Boeken', - 'books_empty' => 'Er zijn geen boeken aangemaakt', + 'books_empty' => 'Geen boeken gemaakt', 'books_popular' => 'Populaire boeken', 'books_recent' => 'Recente boeken', 'books_new' => 'Nieuwe boeken', 'books_new_action' => 'Nieuw boek', 'books_popular_empty' => 'De meest populaire boeken worden hier weergegeven.', - 'books_new_empty' => 'De meest recent aangemaakte boeken verschijnen hier.', + 'books_new_empty' => 'De meest recent gemaakte boeken verschijnen hier.', 'books_create' => 'Nieuw boek maken', 'books_delete' => 'Boek verwijderen', 'books_delete_named' => 'Verwijder boek :bookName', @@ -132,9 +132,9 @@ 'books_edit_named' => 'Bewerk boek :bookName', 'books_form_book_name' => 'Boek naam', 'books_save' => 'Boek opslaan', - 'books_default_template' => 'Default Page Template', - 'books_default_template_explain' => 'Assign a page template that will be used as the default content for all new pages in this book. Keep in mind this will only be used if the page creator has view access to those chosen template page.', - 'books_default_template_select' => 'Select a template page', + 'books_default_template' => 'Standaard Paginasjabloon', + 'books_default_template_explain' => 'Wijs een paginasjabloon toe die zal worden gebruikt als de standaardinhoud voor alle nieuwe pagina\'s in dit boek. Bedenk wel dat dit sjabloon alleen gebruikt wordt als de paginamaker machtiging heeft om die te bekijken.', + 'books_default_template_select' => 'Selecteer een sjabloonpagina', 'books_permissions' => 'Boek machtigingen', 'books_permissions_updated' => 'Boek Machtigingen Bijgewerkt', 'books_empty_contents' => 'Er zijn nog geen hoofdstukken en pagina\'s voor dit boek gemaakt.', @@ -145,7 +145,7 @@ 'books_search_this' => 'Zoeken in dit boek', 'books_navigation' => 'Boek navigatie', 'books_sort' => 'Inhoud van het boek sorteren', - 'books_sort_desc' => 'Verplaats hoofdstukken en pagina\'s binnen een boek om de inhoud ervan te reorganiseren. Andere boeken kunnen worden toegevoegd, zodat hoofdstukken en pagina\'s gemakkelijk tussen boeken kunnen worden verplaatst.', + 'books_sort_desc' => 'Verplaats hoofdstukken en pagina\'s binnen een boek om ze te organiseren. Andere boeken kunnen worden toegevoegd, zodat hoofdstukken en pagina\'s gemakkelijk tussen boeken kunnen worden verplaatst.', 'books_sort_named' => 'Sorteer boek :bookName', 'books_sort_name' => 'Sorteren op naam', 'books_sort_created' => 'Sorteren op datum van aanmaken', @@ -177,7 +177,7 @@ 'chapters_create' => 'Nieuw hoofdstuk maken', 'chapters_delete' => 'Hoofdstuk verwijderen', 'chapters_delete_named' => 'Verwijder hoofdstuk :chapterName', - 'chapters_delete_explain' => 'Dit verwijdert het hoofdstuk met de naam \':chapterName\'. Alle pagina\'s die binnen dit hoofdstuk staan, worden ook verwijderd.', + 'chapters_delete_explain' => 'Dit verwijdert het hoofdstuk met de naam \':chapterName\'. Alle pagina\'s in dit hoofdstuk zullen ook worden verwijderd.', 'chapters_delete_confirm' => 'Weet je zeker dat je dit hoofdstuk wilt verwijderen?', 'chapters_edit' => 'Hoofdstuk aanpassen', 'chapters_edit_named' => 'Hoofdstuk :chapterName aanpassen', @@ -187,10 +187,10 @@ 'chapters_copy' => 'Kopieer Hoofdstuk', 'chapters_copy_success' => 'Hoofdstuk succesvol gekopieerd', 'chapters_permissions' => 'Hoofdstuk Machtigingen', - 'chapters_empty' => 'Er zijn geen pagina\'s in dit hoofdstuk aangemaakt.', + 'chapters_empty' => 'Dit hoofdstuk heeft op dit moment geen pagina\'s.', 'chapters_permissions_active' => 'Hoofdstuk Machtigingen Actief', 'chapters_permissions_success' => 'Hoofdstuk Machtigingen Bijgewerkt', - 'chapters_search_this' => 'Doorzoek dit hoofdstuk', + 'chapters_search_this' => 'Zoek in dit hoofdstuk', 'chapter_sort_book' => 'Sorteer Boek', // Pages @@ -202,15 +202,15 @@ 'pages_attachments' => 'Bijlages', 'pages_navigation' => 'Pagina navigatie', 'pages_delete' => 'Pagina verwijderen', - 'pages_delete_named' => 'Verwijderd pagina :pageName', + 'pages_delete_named' => 'Verwijder pagina :pageName', 'pages_delete_draft_named' => 'Verwijder concept pagina :pageName', 'pages_delete_draft' => 'Verwijder concept pagina', 'pages_delete_success' => 'Pagina verwijderd', 'pages_delete_draft_success' => 'Concept verwijderd', - 'pages_delete_warning_template' => 'This page is in active use as a book default page template. These books will no longer have a default page template assigned after this page is deleted.', + 'pages_delete_warning_template' => 'Deze pagina is actief in gebruik als standaard paginasjabloon. Deze boeken zullen geen standaard paginasjabloon meer hebben als deze pagina verwijderd is.', 'pages_delete_confirm' => 'Weet je zeker dat je deze pagina wilt verwijderen?', 'pages_delete_draft_confirm' => 'Weet je zeker dat je dit concept wilt verwijderen?', - 'pages_editing_named' => 'Pagina :pageName bewerken', + 'pages_editing_named' => 'Pagina :pageName aan het bewerken', 'pages_edit_draft_options' => 'Concept opties', 'pages_edit_save_draft' => 'Concept opslaan', 'pages_edit_draft' => 'Paginaconcept bewerken', @@ -220,36 +220,36 @@ 'pages_edit_delete_draft' => 'Concept verwijderen', 'pages_edit_delete_draft_confirm' => 'Weet je zeker dat je de wijzigingen in je concept wilt verwijderen? Al je wijzigingen sinds de laatste succesvolle bewaring gaan verloren en de editor wordt bijgewerkt met de meest recente niet-concept versie van de pagina.', 'pages_edit_discard_draft' => 'Concept verwijderen', - 'pages_edit_switch_to_markdown' => 'Verander naar Markdown Bewerker', - 'pages_edit_switch_to_markdown_clean' => '(Schoongemaakte Inhoud)', + 'pages_edit_switch_to_markdown' => 'Schakel naar de Markdown Bewerker', + 'pages_edit_switch_to_markdown_clean' => '(Opgeschoonde Inhoud)', 'pages_edit_switch_to_markdown_stable' => '(Stabiele Inhoud)', - 'pages_edit_switch_to_wysiwyg' => 'Verander naar WYSIWYG Bewerker', - 'pages_edit_set_changelog' => 'Wijzigingslogboek instellen', + 'pages_edit_switch_to_wysiwyg' => 'Schakel naar de WYSIWYG Bewerker', + 'pages_edit_set_changelog' => 'Logboek instellen', 'pages_edit_enter_changelog_desc' => 'Geef een korte omschrijving van de wijzigingen die je gemaakt hebt', - 'pages_edit_enter_changelog' => 'Voeg toe aan wijzigingslogboek', - 'pages_editor_switch_title' => 'Wijzig Bewerker', + 'pages_edit_enter_changelog' => 'Voeg toe aan logboek', + 'pages_editor_switch_title' => 'Schakel Bewerker', 'pages_editor_switch_are_you_sure' => 'Weet u zeker dat u de bewerker voor deze pagina wilt wijzigen?', 'pages_editor_switch_consider_following' => 'Houd rekening met het volgende als u van bewerker verandert:', 'pages_editor_switch_consideration_a' => 'Eenmaal opgeslagen, zal de nieuwe bewerker keuze gebruikt worden door alle toekomstige gebruikers, ook diegene die zelf niet van bewerker type kunnen veranderen.', - 'pages_editor_switch_consideration_b' => 'Dit kan mogelijks tot een verlies van detail en syntax leiden in bepaalde omstandigheden.', - 'pages_editor_switch_consideration_c' => 'De veranderingen aan Labels of aan het wijzigingslogboek, sinds de laatste keer opslaan, zullen niet behouden blijven met deze wijziging.', + 'pages_editor_switch_consideration_b' => 'Dit kan mogelijk tot een verlies van detail en syntaxis leiden in bepaalde omstandigheden.', + 'pages_editor_switch_consideration_c' => 'De veranderingen aan Labels of aan het logboek, sinds de laatste keer opslaan, zullen niet behouden blijven met deze wijziging.', 'pages_save' => 'Pagina opslaan', 'pages_title' => 'Pagina titel', 'pages_name' => 'Pagina naam', 'pages_md_editor' => 'Bewerker', 'pages_md_preview' => 'Voorbeeld', 'pages_md_insert_image' => 'Afbeelding invoegen', - 'pages_md_insert_link' => 'Entity link invoegen', + 'pages_md_insert_link' => 'Entiteit link invoegen', 'pages_md_insert_drawing' => 'Tekening invoegen', - 'pages_md_show_preview' => 'Toon preview', - 'pages_md_sync_scroll' => 'Synchroniseer preview scroll', + 'pages_md_show_preview' => 'Toon voorbeeld', + 'pages_md_sync_scroll' => 'Synchroniseer scrollen van voorbeeld', 'pages_drawing_unsaved' => 'Niet-opgeslagen Tekening Gevonden', 'pages_drawing_unsaved_confirm' => 'Er zijn niet-opgeslagen tekeninggegevens gevonden van een eerdere mislukte poging om de tekening op te slaan. Wilt u deze niet-opgeslagen tekening herstellen en verder bewerken?', - 'pages_not_in_chapter' => 'Deze pagina staat niet in een hoofdstuk', + 'pages_not_in_chapter' => 'Pagina is niet in een hoofdstuk', 'pages_move' => 'Pagina verplaatsten', 'pages_copy' => 'Pagina kopiëren', 'pages_copy_desination' => 'Kopieër bestemming', - 'pages_copy_success' => 'Pagina succesvol gekopieërd', + 'pages_copy_success' => 'Pagina succesvol gekopieerd', 'pages_permissions' => 'Pagina Machtigingen', 'pages_permissions_success' => 'Pagina machtigingen bijgewerkt', 'pages_revision' => 'Revisie', @@ -258,21 +258,21 @@ 'pages_revisions_named' => 'Pagina revisies voor :pageName', 'pages_revision_named' => 'Pagina revisie voor :pageName', 'pages_revision_restored_from' => 'Hersteld van #:id; :samenvatting', - 'pages_revisions_created_by' => 'Aangemaakt door', + 'pages_revisions_created_by' => 'Gemaakt door', 'pages_revisions_date' => 'Revisiedatum', 'pages_revisions_number' => '#', 'pages_revisions_sort_number' => 'Versie Nummer', 'pages_revisions_numbered' => 'Revisie #:id', 'pages_revisions_numbered_changes' => 'Revisie #:id wijzigingen', 'pages_revisions_editor' => 'Bewerker Type', - 'pages_revisions_changelog' => 'Wijzigingsoverzicht', + 'pages_revisions_changelog' => 'Logboek', 'pages_revisions_changes' => 'Wijzigingen', 'pages_revisions_current' => 'Huidige versie', 'pages_revisions_preview' => 'Voorbeeld', 'pages_revisions_restore' => 'Herstellen', 'pages_revisions_none' => 'Deze pagina heeft geen revisies', 'pages_copy_link' => 'Link kopiëren', - 'pages_edit_content_link' => 'Spring naar sectie in editor', + 'pages_edit_content_link' => 'Ga naar sectie in bewerker', 'pages_pointer_enter_mode' => 'Open selectiemodus per onderdeel', 'pages_pointer_label' => 'Pagina Onderdeel Opties', 'pages_pointer_permalink' => 'Pagina Onderdeel Permalink', @@ -285,16 +285,16 @@ 'pages_initial_name' => 'Nieuwe pagina', 'pages_editing_draft_notification' => 'U bewerkt momenteel een concept dat voor het laatst is opgeslagen op :timeDiff.', 'pages_draft_edited_notification' => 'Deze pagina is sindsdien bijgewerkt. Het wordt aanbevolen dat u dit concept verwijderd.', - 'pages_draft_page_changed_since_creation' => 'Deze pagina is bijgewerkt sinds het aanmaken van dit concept. Het wordt aanbevolen dat u dit ontwerp verwijdert of ervoor zorgt dat u wijzigingen op de pagina niet overschrijft.', + 'pages_draft_page_changed_since_creation' => 'Deze pagina is bijgewerkt sinds het aanmaken van dit concept. Het wordt aanbevolen dat u dit concept verwijdert of ervoor zorgt dat u wijzigingen op de pagina niet overschrijft.', 'pages_draft_edit_active' => [ 'start_a' => ':count gebruikers zijn begonnen deze pagina te bewerken', 'start_b' => ':userName is begonnen met het bewerken van deze pagina', - 'time_a' => 'since the pages was last updated', + 'time_a' => 'sinds de laatste pagina-update', 'time_b' => 'in de laatste :minCount minuten', 'message' => ':start :time. Let op om elkaars updates niet te overschrijven!', ], - 'pages_draft_discarded' => 'Concept verwporpen! De editor is bijgewerkt met de huidige inhoud van de pagina', - 'pages_draft_deleted' => 'Concept verwijderd! De editor is bijgewerkt met de huidige inhoud van de pagina', + 'pages_draft_discarded' => 'Concept verworpen! De bewerker is bijgewerkt met de huidige inhoud van de pagina', + 'pages_draft_deleted' => 'Concept verwijderd! De bewerker is bijgewerkt met de huidige inhoud van de pagina', 'pages_specific' => 'Specifieke pagina', 'pages_is_template' => 'Paginasjabloon', @@ -312,7 +312,7 @@ 'tags_explain' => "Voeg enkele labels toe om uw inhoud beter te categoriseren. \nJe kunt een waarde aan een label toekennen voor een meer gedetailleerde organisatie.", 'tags_add' => 'Voeg nog een label toe', 'tags_remove' => 'Verwijder deze label', - 'tags_usages' => 'Totaal aantal gebruikte labels', + 'tags_usages' => 'Totaal aantal label-toepassingen', 'tags_assigned_pages' => 'Toegewezen aan pagina\'s', 'tags_assigned_chapters' => 'Toegewezen aan hoofdstukken', 'tags_assigned_books' => 'Toegewezen aan boeken', @@ -327,7 +327,7 @@ 'attachments_explain_instant_save' => 'Wijzigingen worden meteen opgeslagen.', 'attachments_upload' => 'Bestand uploaden', 'attachments_link' => 'Link toevoegen', - 'attachments_upload_drop' => 'Of je kan een bestand hiernaartoe slepen om het als bijlage te uploaden.', + 'attachments_upload_drop' => 'Je kan ook een bestand hiernaartoe slepen om het als bijlage to uploaden.', 'attachments_set_link' => 'Zet link', 'attachments_delete' => 'Weet u zeker dat u deze bijlage wilt verwijderen?', 'attachments_dropzone' => 'Sleep hier de bestanden naar toe', @@ -357,11 +357,11 @@ // Profile View 'profile_user_for_x' => 'Lid sinds :time', - 'profile_created_content' => 'Aangemaakte Inhoud', + 'profile_created_content' => 'Gemaakte Inhoud', 'profile_not_created_pages' => ':userName heeft geen pagina\'s gemaakt', 'profile_not_created_chapters' => ':userName heeft geen hoofdstukken gemaakt', 'profile_not_created_books' => ':userName heeft geen boeken gemaakt', - 'profile_not_created_shelves' => ':userName heeft nog geen boekenplanken gemaakt', + 'profile_not_created_shelves' => ':userName heeft geen boekenplanken gemaakt', // Comments 'comment' => 'Reactie', @@ -392,7 +392,7 @@ 'copy_consider_owner' => 'Je wordt de eigenaar van alle gekopieerde inhoud.', 'copy_consider_images' => 'Afbeeldingsbestanden worden niet gedupliceerd & de originele afbeeldingen behouden hun koppeling met de pagina waarop ze oorspronkelijk werden geüpload.', 'copy_consider_attachments' => 'Pagina bijlagen worden niet gekopieerd.', - 'copy_consider_access' => 'Een verandering van locatie, eigenaar of machtigingen kan ertoe leiden dat deze inhoud toegankelijk wordt voor personen die er voordien geen toegang tot hadden.', + 'copy_consider_access' => 'Een verandering van locatie, eigenaar of machtigingen kan ertoe leiden dat deze inhoud toegankelijk wordt voor personen die eerder geen toegang hadden.', // Conversions 'convert_to_shelf' => 'Converteer naar Boekenplank', @@ -408,8 +408,8 @@ // References 'references' => 'Verwijzingen', - 'references_none' => 'Er zijn geen verwijzingen naar dit artikel bijgehouden.', - 'references_to_desc' => 'Listed below is all the known content in the system that links to this item.', + 'references_none' => 'Er zijn geen verwijzingen naar dit item bijgehouden.', + 'references_to_desc' => 'Hieronder is alle inhoud in het systeem dat naar dit item linkt vermeld.', // Watch Options 'watch' => 'Volg', diff --git a/lang/nl/errors.php b/lang/nl/errors.php index 7a026615a16..3fa1d94f7e1 100644 --- a/lang/nl/errors.php +++ b/lang/nl/errors.php @@ -106,9 +106,9 @@ // API errors 'api_no_authorization_found' => 'Geen autorisatie token gevonden', 'api_bad_authorization_format' => 'Een autorisatie token is gevonden, maar het formaat schijnt onjuist te zijn', - 'api_user_token_not_found' => 'Er is geen overeenkomende API token gevonden voor de opgegeven autorisatie token', - 'api_incorrect_token_secret' => 'Het opgegeven geheim voor de API token is onjuist', - 'api_user_no_api_permission' => 'De eigenaar van de gebruikte API token heeft geen machtiging om API calls te maken', + 'api_user_token_not_found' => 'Er is geen overeenkomende API-token gevonden voor de opgegeven autorisatie token', + 'api_incorrect_token_secret' => 'Het opgegeven geheim voor de API-token is onjuist', + 'api_user_no_api_permission' => 'De eigenaar van de gebruikte API-token heeft geen machtiging om API calls te maken', 'api_user_token_expired' => 'De gebruikte autorisatie token is verlopen', // Settings & Maintenance diff --git a/lang/nl/settings.php b/lang/nl/settings.php index c6e2ad2aed5..014153e536c 100644 --- a/lang/nl/settings.php +++ b/lang/nl/settings.php @@ -109,7 +109,7 @@ 'recycle_bin_contents_empty' => 'De prullenbak is momenteel leeg', 'recycle_bin_empty' => 'Prullenbak legen', 'recycle_bin_empty_confirm' => 'Dit zal permanent alle items in de prullenbak vernietigen, inclusief de inhoud die in elk item zit. Weet u zeker dat u de prullenbak wilt legen?', - 'recycle_bin_destroy_confirm' => 'Deze actie zal dit item permanent verwijderen, samen met alle onderliggende elementen hieronder vanuit het systeem en u kunt deze inhoud niet herstellen. Weet u zeker dat u dit item permanent wilt verwijderen?', + 'recycle_bin_destroy_confirm' => 'Deze actie zal dit item permanent uit het systeem verwijderen, samen met alle onderliggende elementen, en u kunt deze inhoud niet herstellen. Weet u zeker dat u dit item permanent wil verwijderen?', 'recycle_bin_destroy_list' => 'Te vernietigen items', 'recycle_bin_restore_list' => 'Items te herstellen', 'recycle_bin_restore_confirm' => 'Deze actie herstelt het verwijderde item, inclusief alle onderliggende elementen, op hun oorspronkelijke locatie. Als de oorspronkelijke locatie sindsdien is verwijderd en zich nu in de prullenbak bevindt, zal ook het bovenliggende item moeten worden hersteld.', @@ -216,14 +216,14 @@ 'users_social_disconnect' => 'Account Ontkoppelen', 'users_social_status_connected' => 'Verbonden', 'users_social_status_disconnected' => 'Verbroken', - 'users_social_connected' => ':socialAccount account is succesvol aan je profiel gekoppeld.', - 'users_social_disconnected' => ':socialAccount account is succesvol ontkoppeld van je profiel.', - 'users_api_tokens' => 'API Tokens', + 'users_social_connected' => ':socialAccount account succesvol aan je profiel gekoppeld.', + 'users_social_disconnected' => ':socialAccount account succesvol ontkoppeld van je profiel.', + 'users_api_tokens' => 'API-Tokens', 'users_api_tokens_desc' => 'Creëer en beheer de toegangstokens die gebruikt worden om te authenticeren met de BookStack REST API. Machtigingen voor de API worden beheerd via de gebruiker waartoe het token behoort.', 'users_api_tokens_none' => 'Er zijn geen API-tokens gemaakt voor deze gebruiker', 'users_api_tokens_create' => 'Token aanmaken', 'users_api_tokens_expires' => 'Verloopt', - 'users_api_tokens_docs' => 'API Documentatie', + 'users_api_tokens_docs' => 'API-Documentatie', 'users_mfa' => 'Meervoudige Verificatie', 'users_mfa_desc' => 'Stel meervoudige verificatie in als extra beveiligingslaag voor uw gebruikersaccount.', 'users_mfa_x_methods' => ':count methode geconfigureerd|:count methoden geconfigureerd', @@ -236,11 +236,11 @@ 'user_api_token_expiry' => 'Vervaldatum', 'user_api_token_expiry_desc' => 'Stel een datum in waarop deze token verloopt. Na deze datum zullen aanvragen die met deze token zijn ingediend niet langer werken. Als dit veld leeg blijft, wordt een vervaldatum van 100 jaar in de toekomst ingesteld.', 'user_api_token_create_secret_message' => 'Onmiddellijk na het aanmaken van dit token zal een "Token ID" en "Token Geheim" worden gegenereerd en weergegeven. Het geheim zal slechts één keer getoond worden. Kopieer de waarde dus eerst op een veilige plaats voordat u doorgaat.', - 'user_api_token' => 'API Token', + 'user_api_token' => 'API-Token', 'user_api_token_id' => 'Token ID', 'user_api_token_id_desc' => 'Dit is een niet-wijzigbare, door het systeem gegenereerde identificatiecode voor dit token, die in API-verzoeken moet worden verstrekt.', 'user_api_token_secret' => 'Geheime token sleutel', - 'user_api_token_secret_desc' => 'Dit is een door het systeem gegenereerd geheim voor dit token dat in API verzoeken zal moeten worden verstrekt. Dit zal slechts één keer worden weergegeven, dus kopieer deze waarde naar een veilige plaats.', + 'user_api_token_secret_desc' => 'Dit is een door het systeem gegenereerd geheim voor dit token dat in API-verzoeken zal moeten worden verstrekt. Dit zal slechts één keer worden weergegeven, dus kopieer deze waarde naar een veilige plaats.', 'user_api_token_created' => 'Token :timeAgo geleden aangemaakt', 'user_api_token_updated' => 'Token :timeAgo geleden bijgewerkt', 'user_api_token_delete' => 'Token Verwijderen', diff --git a/lang/sq/activities.php b/lang/sq/activities.php index d5b55c03dcb..1c7a10310c1 100644 --- a/lang/sq/activities.php +++ b/lang/sq/activities.php @@ -6,119 +6,119 @@ return [ // Pages - 'page_create' => 'created page', - 'page_create_notification' => 'Page successfully created', - 'page_update' => 'updated page', - 'page_update_notification' => 'Page successfully updated', - 'page_delete' => 'deleted page', - 'page_delete_notification' => 'Page successfully deleted', - 'page_restore' => 'restored page', - 'page_restore_notification' => 'Page successfully restored', - 'page_move' => 'moved page', - 'page_move_notification' => 'Page successfully moved', + 'page_create' => 'krijoi faqe', + 'page_create_notification' => 'Faqja u krijua me sukses', + 'page_update' => 'përditësoi faqe', + 'page_update_notification' => 'Faqja u përditësua me sukses', + 'page_delete' => 'fshiu faqe', + 'page_delete_notification' => 'Faqja u fshi me sukses', + 'page_restore' => 'riktheu faqe', + 'page_restore_notification' => 'Faqja u rikthye me sukses', + 'page_move' => 'zhvendosi faqe', + 'page_move_notification' => 'Faqja u zhvendos me sukses', // Chapters - 'chapter_create' => 'created chapter', - 'chapter_create_notification' => 'Chapter successfully created', - 'chapter_update' => 'updated chapter', - 'chapter_update_notification' => 'Chapter successfully updated', - 'chapter_delete' => 'deleted chapter', - 'chapter_delete_notification' => 'Chapter successfully deleted', - 'chapter_move' => 'moved chapter', - 'chapter_move_notification' => 'Chapter successfully moved', + 'chapter_create' => 'krijoi kapitull', + 'chapter_create_notification' => 'Kapitulli u krijua me sukses', + 'chapter_update' => 'përditësoi kapitull', + 'chapter_update_notification' => 'Kapitulli u përditësua me sukses', + 'chapter_delete' => 'fshiu kapitull', + 'chapter_delete_notification' => 'Kapitulli u fshi me sukses', + 'chapter_move' => 'zhvendosi kapitull', + 'chapter_move_notification' => 'Kapitulli u zhvendos me sukses', // Books - 'book_create' => 'created book', - 'book_create_notification' => 'Book successfully created', - 'book_create_from_chapter' => 'converted chapter to book', - 'book_create_from_chapter_notification' => 'Chapter successfully converted to a book', - 'book_update' => 'updated book', - 'book_update_notification' => 'Book successfully updated', - 'book_delete' => 'deleted book', - 'book_delete_notification' => 'Book successfully deleted', - 'book_sort' => 'sorted book', - 'book_sort_notification' => 'Book successfully re-sorted', + 'book_create' => 'krijoi libër', + 'book_create_notification' => 'Libri u krijua me sukses', + 'book_create_from_chapter' => 'konvertoi kapitullin në libër', + 'book_create_from_chapter_notification' => 'Kapitulli u konvertua në libër me sukses', + 'book_update' => 'përditësoi libër', + 'book_update_notification' => 'Libri u përditësua me sukses', + 'book_delete' => 'fshiu libër', + 'book_delete_notification' => 'Libri u fshi me sukses', + 'book_sort' => 'renditi libër', + 'book_sort_notification' => 'Libri u rendit me sukses', // Bookshelves - 'bookshelf_create' => 'created shelf', - 'bookshelf_create_notification' => 'Shelf successfully created', - 'bookshelf_create_from_book' => 'converted book to shelf', - 'bookshelf_create_from_book_notification' => 'Book successfully converted to a shelf', - 'bookshelf_update' => 'updated shelf', - 'bookshelf_update_notification' => 'Shelf successfully updated', - 'bookshelf_delete' => 'deleted shelf', - 'bookshelf_delete_notification' => 'Shelf successfully deleted', + 'bookshelf_create' => 'krijoi raft', + 'bookshelf_create_notification' => 'Rafti u krijua me sukses', + 'bookshelf_create_from_book' => 'konvertoi librin në raft', + 'bookshelf_create_from_book_notification' => 'Libri u konvertua ne raft me sukses', + 'bookshelf_update' => 'përditësoi raftin', + 'bookshelf_update_notification' => 'Rafti u përditësua me sukses', + 'bookshelf_delete' => 'fshiu raftin', + 'bookshelf_delete_notification' => 'Rafti u fshi me sukses', // Revisions - 'revision_restore' => 'restored revision', - 'revision_delete' => 'deleted revision', - 'revision_delete_notification' => 'Revision successfully deleted', + 'revision_restore' => 'riktheu rishikimin', + 'revision_delete' => 'fshiu rishikimin', + 'revision_delete_notification' => 'Rishikimi u fshi me sukses', // Favourites - 'favourite_add_notification' => '":name" has been added to your favourites', - 'favourite_remove_notification' => '":name" has been removed from your favourites', + 'favourite_add_notification' => '":emri" është shtuar në listën tuaj të të preferuarve', + 'favourite_remove_notification' => '":emri" është hequr nga lista juaj e të preferuarve', // Watching - 'watch_update_level_notification' => 'Watch preferences successfully updated', + 'watch_update_level_notification' => 'Preferencat e orës u përditësuan me sukses', // Auth - 'auth_login' => 'logged in', - 'auth_register' => 'registered as new user', - 'auth_password_reset_request' => 'requested user password reset', - 'auth_password_reset_update' => 'reset user password', - 'mfa_setup_method' => 'configured MFA method', - 'mfa_setup_method_notification' => 'Multi-factor method successfully configured', - 'mfa_remove_method' => 'removed MFA method', - 'mfa_remove_method_notification' => 'Multi-factor method successfully removed', + 'auth_login' => 'loguar', + 'auth_register' => 'regjistruar si përdorues i ri', + 'auth_password_reset_request' => 'kërkoi rivendosjen e fjalëkalimit të përdoruesit', + 'auth_password_reset_update' => 'rivendos fjalëkalimin e përdoruesit', + 'mfa_setup_method' => 'konfiguroi metodën MFA', + 'mfa_setup_method_notification' => 'Metoda Multi-factor u konfigurua me sukses', + 'mfa_remove_method' => 'hoqi metodën MFA', + 'mfa_remove_method_notification' => 'Metoda Multi-factor u hoq me sukses', // Settings - 'settings_update' => 'updated settings', - 'settings_update_notification' => 'Settings successfully updated', - 'maintenance_action_run' => 'ran maintenance action', + 'settings_update' => 'përditësoi cilësimet', + 'settings_update_notification' => 'Cilësimet u përditësuan me sukses', + 'maintenance_action_run' => 'u zhvillua veprim i mirëmbajtjes', // Webhooks - 'webhook_create' => 'created webhook', - 'webhook_create_notification' => 'Webhook successfully created', - 'webhook_update' => 'updated webhook', - 'webhook_update_notification' => 'Webhook successfully updated', - 'webhook_delete' => 'deleted webhook', - 'webhook_delete_notification' => 'Webhook successfully deleted', + 'webhook_create' => 'u krijua uebhook', + 'webhook_create_notification' => 'Uebhook-u u krijua me sukses', + 'webhook_update' => 'përditësoi uebhook', + 'webhook_update_notification' => 'Uebhook-u u përditësua me sukses', + 'webhook_delete' => 'fshiu uebhook', + 'webhook_delete_notification' => 'Uebhook-u u fshi me sukses', // Users - 'user_create' => 'created user', - 'user_create_notification' => 'User successfully created', - 'user_update' => 'updated user', - 'user_update_notification' => 'User successfully updated', - 'user_delete' => 'deleted user', - 'user_delete_notification' => 'User successfully removed', + 'user_create' => 'krijoi përdorues', + 'user_create_notification' => 'Përdoruesi u krijua me sukses', + 'user_update' => 'përditësoi përdorues', + 'user_update_notification' => 'Përdoruesi u përditësua me sukses', + 'user_delete' => 'fshi përdorues', + 'user_delete_notification' => 'Përdoruesi u fshi me sukses', // API Tokens - 'api_token_create' => 'created api token', - 'api_token_create_notification' => 'API token successfully created', - 'api_token_update' => 'updated api token', - 'api_token_update_notification' => 'API token successfully updated', - 'api_token_delete' => 'deleted api token', - 'api_token_delete_notification' => 'API token successfully deleted', + 'api_token_create' => 'krijoi token api', + 'api_token_create_notification' => 'Token API u krijua me sukses', + 'api_token_update' => 'përditësoi token api', + 'api_token_update_notification' => 'Token API u përditësua me sukses', + 'api_token_delete' => 'fshiu token api', + 'api_token_delete_notification' => 'Token API u fshi me sukses', // Roles - 'role_create' => 'created role', - 'role_create_notification' => 'Role successfully created', - 'role_update' => 'updated role', - 'role_update_notification' => 'Role successfully updated', - 'role_delete' => 'deleted role', - 'role_delete_notification' => 'Role successfully deleted', + 'role_create' => 'krijoi rol', + 'role_create_notification' => 'Roli u krijua me sukses', + 'role_update' => 'përditësoi rol', + 'role_update_notification' => 'Roli u përditësua me sukses', + 'role_delete' => 'fshiu rol', + 'role_delete_notification' => 'Roli u fshi me sukses', // Recycle Bin - 'recycle_bin_empty' => 'emptied recycle bin', - 'recycle_bin_restore' => 'restored from recycle bin', - 'recycle_bin_destroy' => 'removed from recycle bin', + 'recycle_bin_empty' => 'boshatisi koshin e riciklimit', + 'recycle_bin_restore' => 'riktheu nga koshi i riciklimit', + 'recycle_bin_destroy' => 'fshiu nga koshi i riciklimit', // Comments - 'commented_on' => 'commented on', - 'comment_create' => 'added comment', - 'comment_update' => 'updated comment', - 'comment_delete' => 'deleted comment', + 'commented_on' => 'komentoi në', + 'comment_create' => 'shtoi koment', + 'comment_update' => 'përditësoi koment', + 'comment_delete' => 'fshiu koment', // Other - 'permissions_update' => 'updated permissions', + 'permissions_update' => 'përditësoi lejet', ]; diff --git a/lang/sq/auth.php b/lang/sq/auth.php index dc4b242a09e..08af155e88f 100644 --- a/lang/sq/auth.php +++ b/lang/sq/auth.php @@ -6,37 +6,37 @@ */ return [ - 'failed' => 'These credentials do not match our records.', - 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', + 'failed' => 'Këto kredenciale nuk përputhen me të dhënat tona.', + 'throttle' => 'Shumë përpjekje për hyrje. Ju lutemi provoni përsëri në :seconds sekonda.', // Login & Register - 'sign_up' => 'Sign up', - 'log_in' => 'Log in', - 'log_in_with' => 'Login with :socialDriver', - 'sign_up_with' => 'Sign up with :socialDriver', - 'logout' => 'Logout', + 'sign_up' => 'Regjistrohu', + 'log_in' => 'Logohu', + 'log_in_with' => 'Logohu me :socialDriver', + 'sign_up_with' => 'Regjistrohu me :socialDriver', + 'logout' => 'Shkyçu', - 'name' => 'Name', - 'username' => 'Username', + 'name' => 'Emri', + 'username' => 'Emri i përdoruesit', 'email' => 'Email', - 'password' => 'Password', - 'password_confirm' => 'Confirm Password', - 'password_hint' => 'Must be at least 8 characters', - 'forgot_password' => 'Forgot Password?', - 'remember_me' => 'Remember Me', - 'ldap_email_hint' => 'Please enter an email to use for this account.', - 'create_account' => 'Create Account', - 'already_have_account' => 'Already have an account?', - 'dont_have_account' => 'Don\'t have an account?', + 'password' => 'Fjalkalimi', + 'password_confirm' => 'Konfirmo fjalëkalimin', + 'password_hint' => 'Duhet të jetë të paktën 8 karaktere', + 'forgot_password' => 'Keni harruar fjalëkalimin?', + 'remember_me' => 'Më mbaj mend', + 'ldap_email_hint' => 'Ju lutem fusni një email që do përdorni për këtë llogari.', + 'create_account' => 'Krijo një llogari', + 'already_have_account' => 'Keni një llogari?', + 'dont_have_account' => 'Nuk keni akoma llogari?', 'social_login' => 'Social Login', 'social_registration' => 'Social Registration', - 'social_registration_text' => 'Register and sign in using another service.', + 'social_registration_text' => 'Regjistrohu dhe logohu duhet përdorur një shërbim tjetër.', - 'register_thanks' => 'Thanks for registering!', - 'register_confirm' => 'Please check your email and click the confirmation button to access :appName.', - 'registrations_disabled' => 'Registrations are currently disabled', - 'registration_email_domain_invalid' => 'That email domain does not have access to this application', - 'register_success' => 'Thanks for signing up! You are now registered and signed in.', + 'register_thanks' => 'Faleminderit që u regjistruat!', + 'register_confirm' => 'Ju lutem kontrolloni emai-in tuaj dhe klikoni te butoni i konfirmimit për të aksesuar :appName.', + 'registrations_disabled' => 'Regjistrimet janë të mbyllura', + 'registration_email_domain_invalid' => 'Ky domain email-i nuk ka akses te ky aplikacion', + 'register_success' => 'Faleminderit që u regjistruar! Ju tani jeni të regjistruar dhe të loguar.', // Login auto-initiation 'auto_init_starting' => 'Attempting Login', From eff7aa0f73a08c495f39c4eb4dc151201fa0cef2 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Wed, 24 Jan 2024 10:25:24 +0000 Subject: [PATCH 13/79] Updated translator attribution before v23.12.2 release --- .github/translators.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/translators.txt b/.github/translators.txt index ef16da25722..950c9d69598 100644 --- a/.github/translators.txt +++ b/.github/translators.txt @@ -388,3 +388,8 @@ diegobenitez :: Spanish Marc Hagen (MarcHagen) :: Dutch Kasper Alsøe (zeonos) :: Danish sultani :: Persian +renge :: Korean +TheGatesDev (thegatesdev) :: Dutch +Irdi (irdiOL) :: Albanian +KateBarber :: Welsh +Twister (theuncles75) :: Hebrew From 8fb9d9d4c2c2916430cd4ed7fa14840c4cc897cc Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Wed, 24 Jan 2024 10:27:09 +0000 Subject: [PATCH 14/79] Dependancies: Updated PHP deps via composer --- composer.lock | 268 ++++++++++++++++++++++++-------------------------- 1 file changed, 131 insertions(+), 137 deletions(-) diff --git a/composer.lock b/composer.lock index 56d33e78ebf..3bea1a66a26 100644 --- a/composer.lock +++ b/composer.lock @@ -62,16 +62,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.294.5", + "version": "3.296.8", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "2e34d45e970c77775e4c298e08732d64b647c41c" + "reference": "f84fe470709e5ab9515649a1a0891e279693d1b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/2e34d45e970c77775e4c298e08732d64b647c41c", - "reference": "2e34d45e970c77775e4c298e08732d64b647c41c", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/f84fe470709e5ab9515649a1a0891e279693d1b3", + "reference": "f84fe470709e5ab9515649a1a0891e279693d1b3", "shasum": "" }, "require": { @@ -151,9 +151,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.294.5" + "source": "https://github.com/aws/aws-sdk-php/tree/3.296.8" }, - "time": "2023-12-21T19:10:21+00:00" + "time": "2024-01-23T20:32:59+00:00" }, { "name": "bacon/bacon-qr-code", @@ -708,16 +708,16 @@ }, { "name": "doctrine/dbal", - "version": "3.7.2", + "version": "3.7.3", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "0ac3c270590e54910715e9a1a044cc368df282b2" + "reference": "ce594cbc39a4866c544f1a970d285ff0548221ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/0ac3c270590e54910715e9a1a044cc368df282b2", - "reference": "0ac3c270590e54910715e9a1a044cc368df282b2", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/ce594cbc39a4866c544f1a970d285ff0548221ad", + "reference": "ce594cbc39a4866c544f1a970d285ff0548221ad", "shasum": "" }, "require": { @@ -733,14 +733,14 @@ "doctrine/coding-standard": "12.0.0", "fig/log-test": "^1", "jetbrains/phpstorm-stubs": "2023.1", - "phpstan/phpstan": "1.10.42", + "phpstan/phpstan": "1.10.56", "phpstan/phpstan-strict-rules": "^1.5", - "phpunit/phpunit": "9.6.13", + "phpunit/phpunit": "9.6.15", "psalm/plugin-phpunit": "0.18.4", "slevomat/coding-standard": "8.13.1", - "squizlabs/php_codesniffer": "3.7.2", - "symfony/cache": "^5.4|^6.0", - "symfony/console": "^4.4|^5.4|^6.0", + "squizlabs/php_codesniffer": "3.8.1", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/console": "^4.4|^5.4|^6.0|^7.0", "vimeo/psalm": "4.30.0" }, "suggest": { @@ -801,7 +801,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.7.2" + "source": "https://github.com/doctrine/dbal/tree/3.7.3" }, "funding": [ { @@ -817,7 +817,7 @@ "type": "tidelift" } ], - "time": "2023-11-19T08:06:58+00:00" + "time": "2024-01-21T07:53:09+00:00" }, { "name": "doctrine/deprecations", @@ -960,16 +960,16 @@ }, { "name": "doctrine/inflector", - "version": "2.0.8", + "version": "2.0.9", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "f9301a5b2fb1216b2b08f02ba04dc45423db6bff" + "reference": "2930cd5ef353871c821d5c43ed030d39ac8cfe65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/f9301a5b2fb1216b2b08f02ba04dc45423db6bff", - "reference": "f9301a5b2fb1216b2b08f02ba04dc45423db6bff", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/2930cd5ef353871c821d5c43ed030d39ac8cfe65", + "reference": "2930cd5ef353871c821d5c43ed030d39ac8cfe65", "shasum": "" }, "require": { @@ -1031,7 +1031,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.8" + "source": "https://github.com/doctrine/inflector/tree/2.0.9" }, "funding": [ { @@ -1047,7 +1047,7 @@ "type": "tidelift" } ], - "time": "2023-06-16T13:40:37+00:00" + "time": "2024-01-15T18:05:13+00:00" }, { "name": "doctrine/lexer", @@ -2349,25 +2349,25 @@ }, { "name": "laravel/tinker", - "version": "v2.8.2", + "version": "v2.9.0", "source": { "type": "git", "url": "https://github.com/laravel/tinker.git", - "reference": "b936d415b252b499e8c3b1f795cd4fc20f57e1f3" + "reference": "502e0fe3f0415d06d5db1f83a472f0f3b754bafe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/tinker/zipball/b936d415b252b499e8c3b1f795cd4fc20f57e1f3", - "reference": "b936d415b252b499e8c3b1f795cd4fc20f57e1f3", + "url": "https://api.github.com/repos/laravel/tinker/zipball/502e0fe3f0415d06d5db1f83a472f0f3b754bafe", + "reference": "502e0fe3f0415d06d5db1f83a472f0f3b754bafe", "shasum": "" }, "require": { - "illuminate/console": "^6.0|^7.0|^8.0|^9.0|^10.0", - "illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0", - "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0", + "illuminate/console": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", "php": "^7.2.5|^8.0", - "psy/psysh": "^0.10.4|^0.11.1", - "symfony/var-dumper": "^4.3.4|^5.0|^6.0" + "psy/psysh": "^0.11.1|^0.12.0", + "symfony/var-dumper": "^4.3.4|^5.0|^6.0|^7.0" }, "require-dev": { "mockery/mockery": "~1.3.3|^1.4.2", @@ -2375,13 +2375,10 @@ "phpunit/phpunit": "^8.5.8|^9.3.3" }, "suggest": { - "illuminate/database": "The Illuminate Database package (^6.0|^7.0|^8.0|^9.0|^10.0)." + "illuminate/database": "The Illuminate Database package (^6.0|^7.0|^8.0|^9.0|^10.0|^11.0)." }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - }, "laravel": { "providers": [ "Laravel\\Tinker\\TinkerServiceProvider" @@ -2412,9 +2409,9 @@ ], "support": { "issues": "https://github.com/laravel/tinker/issues", - "source": "https://github.com/laravel/tinker/tree/v2.8.2" + "source": "https://github.com/laravel/tinker/tree/v2.9.0" }, - "time": "2023-08-15T14:27:00+00:00" + "time": "2024-01-04T16:10:04+00:00" }, { "name": "league/commonmark", @@ -3348,16 +3345,16 @@ }, { "name": "nesbot/carbon", - "version": "2.72.1", + "version": "2.72.2", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "2b3b3db0a2d0556a177392ff1a3bf5608fa09f78" + "reference": "3e7edc41b58d65509baeb0d4a14c8fa41d627130" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/2b3b3db0a2d0556a177392ff1a3bf5608fa09f78", - "reference": "2b3b3db0a2d0556a177392ff1a3bf5608fa09f78", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/3e7edc41b58d65509baeb0d4a14c8fa41d627130", + "reference": "3e7edc41b58d65509baeb0d4a14c8fa41d627130", "shasum": "" }, "require": { @@ -3451,7 +3448,7 @@ "type": "tidelift" } ], - "time": "2023-12-08T23:47:49+00:00" + "time": "2024-01-19T00:21:53+00:00" }, { "name": "nette/schema", @@ -3517,16 +3514,16 @@ }, { "name": "nette/utils", - "version": "v4.0.3", + "version": "v4.0.4", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "a9d127dd6a203ce6d255b2e2db49759f7506e015" + "reference": "d3ad0aa3b9f934602cb3e3902ebccf10be34d218" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/a9d127dd6a203ce6d255b2e2db49759f7506e015", - "reference": "a9d127dd6a203ce6d255b2e2db49759f7506e015", + "url": "https://api.github.com/repos/nette/utils/zipball/d3ad0aa3b9f934602cb3e3902ebccf10be34d218", + "reference": "d3ad0aa3b9f934602cb3e3902ebccf10be34d218", "shasum": "" }, "require": { @@ -3597,31 +3594,33 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v4.0.3" + "source": "https://github.com/nette/utils/tree/v4.0.4" }, - "time": "2023-10-29T21:02:13+00:00" + "time": "2024-01-17T16:50:36+00:00" }, { "name": "nikic/php-parser", - "version": "v4.18.0", + "version": "v5.0.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" + "reference": "4a21235f7e56e713259a6f76bf4b5ea08502b9dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4a21235f7e56e713259a6f76bf4b5ea08502b9dc", + "reference": "4a21235f7e56e713259a6f76bf4b5ea08502b9dc", "shasum": "" }, "require": { + "ext-ctype": "*", + "ext-json": "*", "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.4" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -3629,7 +3628,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -3653,9 +3652,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.18.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.0" }, - "time": "2023-12-10T21:03:43+00:00" + "time": "2024-01-07T17:17:35+00:00" }, { "name": "nunomaduro/termwind", @@ -3918,23 +3917,23 @@ }, { "name": "phenx/php-font-lib", - "version": "0.5.4", + "version": "0.5.5", "source": { "type": "git", "url": "https://github.com/dompdf/php-font-lib.git", - "reference": "dd448ad1ce34c63d09baccd05415e361300c35b4" + "reference": "671df0f3516252011aa94f9e8e3b3b66199339f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/dd448ad1ce34c63d09baccd05415e361300c35b4", - "reference": "dd448ad1ce34c63d09baccd05415e361300c35b4", + "url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/671df0f3516252011aa94f9e8e3b3b66199339f8", + "reference": "671df0f3516252011aa94f9e8e3b3b66199339f8", "shasum": "" }, "require": { "ext-mbstring": "*" }, "require-dev": { - "symfony/phpunit-bridge": "^3 || ^4 || ^5" + "symfony/phpunit-bridge": "^3 || ^4 || ^5 || ^6" }, "type": "library", "autoload": { @@ -3944,7 +3943,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0" + "LGPL-2.1-or-later" ], "authors": [ { @@ -3956,9 +3955,9 @@ "homepage": "https://github.com/PhenX/php-font-lib", "support": { "issues": "https://github.com/dompdf/php-font-lib/issues", - "source": "https://github.com/dompdf/php-font-lib/tree/0.5.4" + "source": "https://github.com/dompdf/php-font-lib/tree/0.5.5" }, - "time": "2021-12-17T19:44:54+00:00" + "time": "2024-01-07T18:13:29+00:00" }, { "name": "phenx/php-svg-lib", @@ -4083,16 +4082,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "3.0.34", + "version": "3.0.35", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "56c79f16a6ae17e42089c06a2144467acc35348a" + "reference": "4b1827beabce71953ca479485c0ae9c51287f2fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/56c79f16a6ae17e42089c06a2144467acc35348a", - "reference": "56c79f16a6ae17e42089c06a2144467acc35348a", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/4b1827beabce71953ca479485c0ae9c51287f2fe", + "reference": "4b1827beabce71953ca479485c0ae9c51287f2fe", "shasum": "" }, "require": { @@ -4173,7 +4172,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.34" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.35" }, "funding": [ { @@ -4189,7 +4188,7 @@ "type": "tidelift" } ], - "time": "2023-11-27T11:13:31+00:00" + "time": "2023-12-29T01:59:53+00:00" }, { "name": "pragmarx/google2fa", @@ -4767,25 +4766,25 @@ }, { "name": "psy/psysh", - "version": "v0.11.22", + "version": "v0.12.0", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "128fa1b608be651999ed9789c95e6e2a31b5802b" + "reference": "750bf031a48fd07c673dbe3f11f72362ea306d0d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/128fa1b608be651999ed9789c95e6e2a31b5802b", - "reference": "128fa1b608be651999ed9789c95e6e2a31b5802b", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/750bf031a48fd07c673dbe3f11f72362ea306d0d", + "reference": "750bf031a48fd07c673dbe3f11f72362ea306d0d", "shasum": "" }, "require": { "ext-json": "*", "ext-tokenizer": "*", - "nikic/php-parser": "^4.0 || ^3.1", - "php": "^8.0 || ^7.0.8", - "symfony/console": "^6.0 || ^5.0 || ^4.0 || ^3.4", - "symfony/var-dumper": "^6.0 || ^5.0 || ^4.0 || ^3.4" + "nikic/php-parser": "^5.0 || ^4.0", + "php": "^8.0 || ^7.4", + "symfony/console": "^7.0 || ^6.0 || ^5.0 || ^4.0 || ^3.4", + "symfony/var-dumper": "^7.0 || ^6.0 || ^5.0 || ^4.0 || ^3.4" }, "conflict": { "symfony/console": "4.4.37 || 5.3.14 || 5.3.15 || 5.4.3 || 5.4.4 || 6.0.3 || 6.0.4" @@ -4796,8 +4795,7 @@ "suggest": { "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", "ext-pdo-sqlite": "The doc command requires SQLite to work.", - "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", - "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history." + "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well." }, "bin": [ "bin/psysh" @@ -4805,7 +4803,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-0.11": "0.11.x-dev" + "dev-main": "0.12.x-dev" }, "bamarni-bin": { "bin-links": false, @@ -4841,9 +4839,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.11.22" + "source": "https://github.com/bobthecow/psysh/tree/v0.12.0" }, - "time": "2023-10-14T21:56:36+00:00" + "time": "2023-12-20T15:28:09+00:00" }, { "name": "ralouphie/getallheaders", @@ -8112,16 +8110,16 @@ }, { "name": "fakerphp/faker", - "version": "v1.23.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/FakerPHP/Faker.git", - "reference": "e3daa170d00fde61ea7719ef47bb09bb8f1d9b01" + "reference": "bfb4fe148adbf78eff521199619b93a52ae3554b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e3daa170d00fde61ea7719ef47bb09bb8f1d9b01", - "reference": "e3daa170d00fde61ea7719ef47bb09bb8f1d9b01", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/bfb4fe148adbf78eff521199619b93a52ae3554b", + "reference": "bfb4fe148adbf78eff521199619b93a52ae3554b", "shasum": "" }, "require": { @@ -8147,11 +8145,6 @@ "ext-mbstring": "Required for multibyte Unicode string functionality." }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "v1.21-dev" - } - }, "autoload": { "psr-4": { "Faker\\": "src/Faker/" @@ -8174,9 +8167,9 @@ ], "support": { "issues": "https://github.com/FakerPHP/Faker/issues", - "source": "https://github.com/FakerPHP/Faker/tree/v1.23.0" + "source": "https://github.com/FakerPHP/Faker/tree/v1.23.1" }, - "time": "2023-06-12T08:44:38+00:00" + "time": "2024-01-02T13:46:09+00:00" }, { "name": "filp/whoops", @@ -8370,36 +8363,36 @@ }, { "name": "larastan/larastan", - "version": "v2.7.0", + "version": "v2.8.1", "source": { "type": "git", "url": "https://github.com/larastan/larastan.git", - "reference": "a2610d46b9999cf558d9900ccb641962d1442f55" + "reference": "b7cc6a29c457a7d4f3de90466392ae9ad3e17022" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/larastan/larastan/zipball/a2610d46b9999cf558d9900ccb641962d1442f55", - "reference": "a2610d46b9999cf558d9900ccb641962d1442f55", + "url": "https://api.github.com/repos/larastan/larastan/zipball/b7cc6a29c457a7d4f3de90466392ae9ad3e17022", + "reference": "b7cc6a29c457a7d4f3de90466392ae9ad3e17022", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/console": "^9.52.16 || ^10.28.0", - "illuminate/container": "^9.52.16 || ^10.28.0", - "illuminate/contracts": "^9.52.16 || ^10.28.0", - "illuminate/database": "^9.52.16 || ^10.28.0", - "illuminate/http": "^9.52.16 || ^10.28.0", - "illuminate/pipeline": "^9.52.16 || ^10.28.0", - "illuminate/support": "^9.52.16 || ^10.28.0", + "illuminate/console": "^9.52.16 || ^10.28.0 || ^11.0", + "illuminate/container": "^9.52.16 || ^10.28.0 || ^11.0", + "illuminate/contracts": "^9.52.16 || ^10.28.0 || ^11.0", + "illuminate/database": "^9.52.16 || ^10.28.0 || ^11.0", + "illuminate/http": "^9.52.16 || ^10.28.0 || ^11.0", + "illuminate/pipeline": "^9.52.16 || ^10.28.0 || ^11.0", + "illuminate/support": "^9.52.16 || ^10.28.0 || ^11.0", "php": "^8.0.2", "phpmyadmin/sql-parser": "^5.8.2", - "phpstan/phpstan": "^1.10.41" + "phpstan/phpstan": "^1.10.50" }, "require-dev": { "nikic/php-parser": "^4.17.1", - "orchestra/canvas": "^7.11.1 || ^8.11.0", - "orchestra/testbench": "^7.33.0 || ^8.13.0", - "phpunit/phpunit": "^9.6.13" + "orchestra/canvas": "^7.11.1 || ^8.11.0 || ^9.0.0", + "orchestra/testbench": "^7.33.0 || ^8.13.0 || ^9.0.0", + "phpunit/phpunit": "^9.6.13 || ^10.5" }, "suggest": { "orchestra/testbench": "Using Larastan for analysing a package needs Testbench" @@ -8447,7 +8440,7 @@ ], "support": { "issues": "https://github.com/larastan/larastan/issues", - "source": "https://github.com/larastan/larastan/tree/v2.7.0" + "source": "https://github.com/larastan/larastan/tree/v2.8.1" }, "funding": [ { @@ -8467,7 +8460,7 @@ "type": "patreon" } ], - "time": "2023-12-04T19:21:38+00:00" + "time": "2024-01-08T09:11:17+00:00" }, { "name": "mockery/mockery", @@ -8812,16 +8805,16 @@ }, { "name": "phpmyadmin/sql-parser", - "version": "5.8.2", + "version": "5.9.0", "source": { "type": "git", "url": "https://github.com/phpmyadmin/sql-parser.git", - "reference": "f1720ae19abe6294cb5599594a8a57bc3c8cc287" + "reference": "011fa18a4e55591fac6545a821921dd1d61c6984" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/f1720ae19abe6294cb5599594a8a57bc3c8cc287", - "reference": "f1720ae19abe6294cb5599594a8a57bc3c8cc287", + "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/011fa18a4e55591fac6545a821921dd1d61c6984", + "reference": "011fa18a4e55591fac6545a821921dd1d61c6984", "shasum": "" }, "require": { @@ -8852,6 +8845,7 @@ "bin": [ "bin/highlight-query", "bin/lint-query", + "bin/sql-parser", "bin/tokenize-query" ], "type": "library", @@ -8895,20 +8889,20 @@ "type": "other" } ], - "time": "2023-09-19T12:34:29+00:00" + "time": "2024-01-20T20:34:02+00:00" }, { "name": "phpstan/phpstan", - "version": "1.10.50", + "version": "1.10.56", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "06a98513ac72c03e8366b5a0cb00750b487032e4" + "reference": "27816a01aea996191ee14d010f325434c0ee76fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/06a98513ac72c03e8366b5a0cb00750b487032e4", - "reference": "06a98513ac72c03e8366b5a0cb00750b487032e4", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/27816a01aea996191ee14d010f325434c0ee76fa", + "reference": "27816a01aea996191ee14d010f325434c0ee76fa", "shasum": "" }, "require": { @@ -8957,7 +8951,7 @@ "type": "tidelift" } ], - "time": "2023-12-13T10:59:42+00:00" + "time": "2024-01-15T10:43:00+00:00" }, { "name": "phpunit/php-code-coverage", @@ -9280,16 +9274,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.15", + "version": "9.6.16", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1" + "reference": "3767b2c56ce02d01e3491046f33466a1ae60a37f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/05017b80304e0eb3f31d90194a563fd53a6021f1", - "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3767b2c56ce02d01e3491046f33466a1ae60a37f", + "reference": "3767b2c56ce02d01e3491046f33466a1ae60a37f", "shasum": "" }, "require": { @@ -9363,7 +9357,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.15" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.16" }, "funding": [ { @@ -9379,7 +9373,7 @@ "type": "tidelift" } ], - "time": "2023-12-01T16:55:19+00:00" + "time": "2024-01-19T07:03:14+00:00" }, { "name": "sebastian/cli-parser", @@ -10347,16 +10341,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.8.0", + "version": "3.8.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7" + "reference": "14f5fff1e64118595db5408e946f3a22c75807f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/14f5fff1e64118595db5408e946f3a22c75807f7", + "reference": "14f5fff1e64118595db5408e946f3a22c75807f7", "shasum": "" }, "require": { @@ -10366,11 +10360,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -10423,7 +10417,7 @@ "type": "open_collective" } ], - "time": "2023-12-08T12:32:31+00:00" + "time": "2024-01-11T20:47:48+00:00" }, { "name": "ssddanbrown/asserthtml", From 9441e32c69acd80eeaef47b87dc6b0c1f9584215 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Wed, 24 Jan 2024 10:37:20 +0000 Subject: [PATCH 15/79] Updated version and assets for release v23.12.2 --- public/dist/app.js | 8 ++++---- version | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/public/dist/app.js b/public/dist/app.js index 25d1a612175..5009a25adeb 100644 --- a/public/dist/app.js +++ b/public/dist/app.js @@ -15,17 +15,17 @@ var Bu=Object.create;var _e=Object.defineProperty;var Pu=Object.getOwnPropertyDe `);return i};be.prototype.render=function(n,t,e){var i,r,o,s="",a=this.rules;for(i=0,r=n.length;i{"use strict";function Ct(){this.__rules__=[],this.__cache__=null}Ct.prototype.__find__=function(n){for(var t=0;t{"use strict";var Sd=/\r\n?|\n/g,Ad=/\0/g;ya.exports=function(t){var e;e=t.src.replace(Sd,` `),e=e.replace(Ad,"\uFFFD"),t.src=e}});var Ca=_((Qb,ka)=>{"use strict";ka.exports=function(t){var e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}});var _a=_((tv,Ea)=>{"use strict";Ea.exports=function(t){var e=t.tokens,i,r,o;for(r=0,o=e.length;r{"use strict";var Dd=N().arrayReplaceAt;function Ld(n){return/^\s]/i.test(n)}function Td(n){return/^<\/a\s*>/i.test(n)}Sa.exports=function(t){var e,i,r,o,s,a,l,c,u,h,d,f,p,m,w,v,b=t.tokens,k;if(t.md.options.linkify){for(i=0,r=b.length;i=0;e--){if(a=o[e],a.type==="link_close"){for(e--;o[e].level!==a.level&&o[e].type!=="link_open";)e--;continue}if(a.type==="html_inline"&&(Ld(a.content)&&p>0&&p--,Td(a.content)&&p++),!(p>0)&&a.type==="text"&&t.md.linkify.test(a.content)){for(u=a.content,k=t.md.linkify.match(u),l=[],f=a.level,d=0,k.length>0&&k[0].index===0&&e>0&&o[e-1].type==="text_special"&&(k=k.slice(1)),c=0;cd&&(s=new t.Token("text","",0),s.content=u.slice(d,h),s.level=f,l.push(s)),s=new t.Token("link_open","a",1),s.attrs=[["href",w]],s.level=f++,s.markup="linkify",s.info="auto",l.push(s),s=new t.Token("text","",0),s.content=v,s.level=f,l.push(s),s=new t.Token("link_close","a",-1),s.level=--f,s.markup="linkify",s.info="auto",l.push(s),d=k[c].lastIndex);d{"use strict";var Da=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,$d=/\((c|tm|r)\)/i,Id=/\((c|tm|r)\)/ig,Md={c:"\xA9",r:"\xAE",tm:"\u2122"};function Fd(n,t){return Md[t.toLowerCase()]}function qd(n){var t,e,i=0;for(t=n.length-1;t>=0;t--)e=n[t],e.type==="text"&&!i&&(e.content=e.content.replace(Id,Fd)),e.type==="link_open"&&e.info==="auto"&&i--,e.type==="link_close"&&e.info==="auto"&&i++}function Bd(n){var t,e,i=0;for(t=n.length-1;t>=0;t--)e=n[t],e.type==="text"&&!i&&Da.test(e.content)&&(e.content=e.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1\u2014").replace(/(^|\s)--(?=\s|$)/mg,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1\u2013")),e.type==="link_open"&&e.info==="auto"&&i--,e.type==="link_close"&&e.info==="auto"&&i++}La.exports=function(t){var e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&($d.test(t.tokens[e].content)&&qd(t.tokens[e].children),Da.test(t.tokens[e].content)&&Bd(t.tokens[e].children))}});var Pa=_((iv,Ba)=>{"use strict";var $a=N().isWhiteSpace,Ia=N().isPunctChar,Ma=N().isMdAsciiPunct,Pd=/['"]/,Fa=/['"]/g,qa="\u2019";function hi(n,t,e){return n.slice(0,t)+e+n.slice(t+1)}function Od(n,t){var e,i,r,o,s,a,l,c,u,h,d,f,p,m,w,v,b,k,x,E,y;for(x=[],e=0;e=0&&!(x[b].level<=l);b--);if(x.length=b+1,i.type==="text"){r=i.content,s=0,a=r.length;t:for(;s=0)u=r.charCodeAt(o.index-1);else for(b=e-1;b>=0&&!(n[b].type==="softbreak"||n[b].type==="hardbreak");b--)if(n[b].content){u=n[b].content.charCodeAt(n[b].content.length-1);break}if(h=32,s=48&&u<=57&&(v=w=!1),w&&v&&(w=d,v=f),!w&&!v){k&&(i.content=hi(i.content,o.index,qa));continue}if(v){for(b=x.length-1;b>=0&&(c=x[b],!(x[b].level=0;e--)t.tokens[e].type!=="inline"||!Pd.test(t.tokens[e].content)||Od(t.tokens[e].children,t)}});var Ra=_((rv,Oa)=>{"use strict";Oa.exports=function(t){var e,i,r,o,s,a,l=t.tokens;for(e=0,i=l.length;e{"use strict";function ve(n,t,e){this.type=n,this.tag=t,this.attrs=null,this.map=null,this.nesting=e,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}ve.prototype.attrIndex=function(t){var e,i,r;if(!this.attrs)return-1;for(e=this.attrs,i=0,r=e.length;i=0&&(i=this.attrs[e][1]),i};ve.prototype.attrJoin=function(t,e){var i=this.attrIndex(t);i<0?this.attrPush([t,e]):this.attrs[i][1]=this.attrs[i][1]+" "+e};Na.exports=ve});var Ua=_((sv,Ha)=>{"use strict";var Rd=di();function za(n,t,e){this.src=n,this.env=e,this.tokens=[],this.inlineMode=!1,this.md=t}za.prototype.Token=Rd;Ha.exports=za});var Va=_((av,ja)=>{"use strict";var Nd=ui(),Jr=[["normalize",xa()],["block",Ca()],["inline",_a()],["linkify",Aa()],["replacements",Ta()],["smartquotes",Pa()],["text_join",Ra()]];function Qr(){this.ruler=new Nd;for(var n=0;n{"use strict";var to=N().isSpace;function eo(n,t){var e=n.bMarks[t]+n.tShift[t],i=n.eMarks[t];return n.src.slice(e,i)}function Wa(n){var t=[],e=0,i=n.length,r,o=!1,s=0,a="";for(r=n.charCodeAt(e);ei||(u=e+1,t.sCount[u]=4||(a=t.bMarks[u]+t.tShift[u],a>=t.eMarks[u])||(E=t.src.charCodeAt(a++),E!==124&&E!==45&&E!==58)||a>=t.eMarks[u]||(y=t.src.charCodeAt(a++),y!==124&&y!==45&&y!==58&&!to(y))||E===45&&to(y))return!1;for(;a=4||(h=Wa(s),h.length&&h[0]===""&&h.shift(),h.length&&h[h.length-1]===""&&h.pop(),d=h.length,d===0||d!==p.length))return!1;if(r)return!0;for(b=t.parentType,t.parentType="table",x=t.md.block.ruler.getRules("blockquote"),f=t.push("table_open","table",1),f.map=w=[e,0],f=t.push("thead_open","thead",1),f.map=[e,e+1],f=t.push("tr_open","tr",1),f.map=[e,e+1],l=0;l=4)break;for(h=Wa(s),h.length&&h[0]===""&&h.shift(),h.length&&h[h.length-1]===""&&h.pop(),u===e+2&&(f=t.push("tbody_open","tbody",1),f.map=v=[e+2,0]),f=t.push("tr_open","tr",1),f.map=[u,u+1],l=0;l{"use strict";Za.exports=function(t,e,i){var r,o,s;if(t.sCount[e]-t.blkIndent<4)return!1;for(o=r=e+1;r=4){r++,o=r;continue}break}return t.line=o,s=t.push("code_block","code",0),s.content=t.getLines(e,o,4+t.blkIndent,!1)+` `,s.map=[e,t.line],!0}});var Ja=_((uv,Ya)=>{"use strict";Ya.exports=function(t,e,i,r){var o,s,a,l,c,u,h,d=!1,f=t.bMarks[e]+t.tShift[e],p=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||f+3>p||(o=t.src.charCodeAt(f),o!==126&&o!==96)||(c=f,f=t.skipChars(f,o),s=f-c,s<3)||(h=t.src.slice(c,f),a=t.src.slice(f,p),o===96&&a.indexOf(String.fromCharCode(o))>=0))return!1;if(r)return!0;for(l=e;l++,!(l>=i||(f=c=t.bMarks[l]+t.tShift[l],p=t.eMarks[l],f=4)&&(f=t.skipChars(f,o),!(f-c{"use strict";var zd=N().isSpace;Qa.exports=function(t,e,i,r){var o,s,a,l,c,u,h,d,f,p,m,w,v,b,k,x,E,y,A,D,M=t.lineMax,T=t.bMarks[e]+t.tShift[e],P=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(T)!==62)return!1;if(r)return!0;for(p=[],m=[],b=[],k=[],y=t.md.block.ruler.getRules("blockquote"),v=t.parentType,t.parentType="blockquote",d=e;d=P));d++){if(t.src.charCodeAt(T++)===62&&!D){for(l=t.sCount[d]+1,t.src.charCodeAt(T)===32?(T++,l++,o=!1,x=!0):t.src.charCodeAt(T)===9?(x=!0,(t.bsCount[d]+l)%4===3?(T++,l++,o=!1):o=!0):x=!1,f=l,p.push(t.bMarks[d]),t.bMarks[d]=T;T=P,m.push(t.bsCount[d]),t.bsCount[d]=t.sCount[d]+1+(x?1:0),b.push(t.sCount[d]),t.sCount[d]=f-l,k.push(t.tShift[d]),t.tShift[d]=T-t.bMarks[d];continue}if(u)break;for(E=!1,a=0,c=y.length;a",A.map=h=[e,0],t.md.block.tokenize(t,e,d),A=t.push("blockquote_close","blockquote",-1),A.markup=">",t.lineMax=M,t.parentType=v,h[1]=t.line,a=0;a{"use strict";var Hd=N().isSpace;el.exports=function(t,e,i,r){var o,s,a,l,c=t.bMarks[e]+t.tShift[e],u=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||(o=t.src.charCodeAt(c++),o!==42&&o!==45&&o!==95))return!1;for(s=1;c{"use strict";var ol=N().isSpace;function il(n,t){var e,i,r,o;return i=n.bMarks[t]+n.tShift[t],r=n.eMarks[t],e=n.src.charCodeAt(i++),e!==42&&e!==45&&e!==43||i=o||(e=n.src.charCodeAt(r++),e<48||e>57))return-1;for(;;){if(r>=o)return-1;if(e=n.src.charCodeAt(r++),e>=48&&e<=57){if(r-i>=10)return-1;continue}if(e===41||e===46)break;return-1}return r=4||t.listIndent>=0&&t.sCount[$]-t.listIndent>=4&&t.sCount[$]=t.blkIndent&&(Ot=!0),(T=rl(t,$))>=0){if(h=!0,H=t.bMarks[$]+t.tShift[$],v=Number(t.src.slice(H,T-1)),Ot&&v!==1)return!1}else if((T=il(t,$))>=0)h=!1;else return!1;if(Ot&&t.skipSpaces(T)>=t.eMarks[$])return!1;if(r)return!0;for(w=t.src.charCodeAt(T-1),m=t.tokens.length,h?(W=t.push("ordered_list_open","ol",1),v!==1&&(W.attrs=[["start",v]])):W=t.push("bullet_list_open","ul",1),W.map=p=[$,0],W.markup=String.fromCharCode(w),P=!1,et=t.md.block.ruler.getRules("list"),E=t.parentType,t.parentType="list";$=b?c=1:c=k-u,c>4&&(c=1),l=u+c,W=t.push("list_item_open","li",1),W.markup=String.fromCharCode(w),W.map=d=[$,0],h&&(W.info=t.src.slice(H,T-1)),D=t.tight,A=t.tShift[$],y=t.sCount[$],x=t.listIndent,t.listIndent=t.blkIndent,t.blkIndent=l,t.tight=!0,t.tShift[$]=s-t.bMarks[$],t.sCount[$]=k,s>=b&&t.isEmpty($+1)?t.line=Math.min(t.line+2,i):t.md.block.tokenize(t,$,i,!0),(!t.tight||P)&&(Rt=!1),P=t.line-$>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=x,t.tShift[$]=A,t.sCount[$]=y,t.tight=D,W=t.push("list_item_close","li",-1),W.markup=String.fromCharCode(w),$=t.line,d[1]=$,$>=i||t.sCount[$]=4)break;for(U=!1,a=0,f=et.length;a{"use strict";var jd=N().normalizeReference,pi=N().isSpace;ll.exports=function(t,e,i,r){var o,s,a,l,c,u,h,d,f,p,m,w,v,b,k,x,E=0,y=t.bMarks[e]+t.tShift[e],A=t.eMarks[e],D=e+1;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(y)!==91)return!1;for(;++y3)&&!(t.sCount[D]<0)){for(b=!1,u=0,h=k.length;u"u"&&(t.env.references={}),typeof t.env.references[d]>"u"&&(t.env.references[d]={title:x,href:c}),t.parentType=p,t.line=e+E+1),!0)}});var hl=_((mv,ul)=>{"use strict";ul.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]});var io=_((gv,no)=>{"use strict";var Vd="[a-zA-Z_:][a-zA-Z0-9:._-]*",Wd="[^\"'=<>`\\x00-\\x20]+",Gd="'[^']*'",Kd='"[^"]*"',Zd="(?:"+Wd+"|"+Gd+"|"+Kd+")",Xd="(?:\\s+"+Vd+"(?:\\s*=\\s*"+Zd+")?)",dl="<[A-Za-z][A-Za-z0-9\\-]*"+Xd+"*\\s*\\/?>",pl="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Yd="|",Jd="<[?][\\s\\S]*?[?]>",Qd="]*>",tp="",ep=new RegExp("^(?:"+dl+"|"+pl+"|"+Yd+"|"+Jd+"|"+Qd+"|"+tp+")"),np=new RegExp("^(?:"+dl+"|"+pl+")");no.exports.HTML_TAG_RE=ep;no.exports.HTML_OPEN_CLOSE_TAG_RE=np});var ml=_((bv,fl)=>{"use strict";var ip=hl(),rp=io().HTML_OPEN_CLOSE_TAG_RE,we=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(rp.source+"\\s*$"),/^$/,!1]];fl.exports=function(t,e,i,r){var o,s,a,l,c=t.bMarks[e]+t.tShift[e],u=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(c)!==60)return!1;for(l=t.src.slice(c,u),o=0;o{"use strict";var gl=N().isSpace;bl.exports=function(t,e,i,r){var o,s,a,l,c=t.bMarks[e]+t.tShift[e],u=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||(o=t.src.charCodeAt(c),o!==35||c>=u))return!1;for(s=1,o=t.src.charCodeAt(++c);o===35&&c6||cc&&gl(t.src.charCodeAt(a-1))&&(u=a),t.line=e+1,l=t.push("heading_open","h"+String(s),1),l.markup="########".slice(0,s),l.map=[e,t.line],l=t.push("inline","",0),l.content=t.src.slice(c,u).trim(),l.map=[e,t.line],l.children=[],l=t.push("heading_close","h"+String(s),-1),l.markup="########".slice(0,s)),!0)}});var yl=_((wv,wl)=>{"use strict";wl.exports=function(t,e,i){var r,o,s,a,l,c,u,h,d,f=e+1,p,m=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;for(p=t.parentType,t.parentType="paragraph";f3)){if(t.sCount[f]>=t.blkIndent&&(c=t.bMarks[f]+t.tShift[f],u=t.eMarks[f],c=u)))){h=d===61?1:2;break}if(!(t.sCount[f]<0)){for(o=!1,s=0,a=m.length;s{"use strict";xl.exports=function(t,e,i){var r,o,s,a,l,c,u=e+1,h=t.md.block.ruler.getRules("paragraph");for(c=t.parentType,t.parentType="paragraph";u3)&&!(t.sCount[u]<0)){for(o=!1,s=0,a=h.length;s{"use strict";var Cl=di(),fi=N().isSpace;function Lt(n,t,e,i){var r,o,s,a,l,c,u,h;for(this.src=n,this.md=t,this.env=e,this.tokens=i,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0,this.result="",o=this.src,h=!1,s=a=c=u=0,l=o.length;a0&&this.level++,this.tokens.push(i),i};Lt.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};Lt.prototype.skipEmptyLines=function(t){for(var e=this.lineMax;te;)if(!fi(this.src.charCodeAt(--t)))return t+1;return t};Lt.prototype.skipChars=function(t,e){for(var i=this.src.length;ti;)if(e!==this.src.charCodeAt(--t))return t+1;return t};Lt.prototype.getLines=function(t,e,i,r){var o,s,a,l,c,u,h,d=t;if(t>=e)return"";for(u=new Array(e-t),o=0;di?u[o]=new Array(s-i+1).join(" ")+this.src.slice(l,c):u[o]=this.src.slice(l,c)}return u.join("")};Lt.prototype.Token=Cl;El.exports=Lt});var Al=_((kv,Sl)=>{"use strict";var op=ui(),mi=[["table",Ka(),["paragraph","reference"]],["code",Xa()],["fence",Ja(),["paragraph","reference","blockquote","list"]],["blockquote",tl(),["paragraph","reference","blockquote","list"]],["hr",nl(),["paragraph","reference","blockquote","list"]],["list",al(),["paragraph","reference","blockquote"]],["reference",cl()],["html_block",ml(),["paragraph","reference","blockquote"]],["heading",vl(),["paragraph","reference","blockquote"]],["lheading",yl()],["paragraph",kl()]];function gi(){this.ruler=new op;for(var n=0;n=e||n.sCount[l]=u){n.line=e;break}for(o=n.line,r=0;r=n.line)throw new Error("block rule didn't increment state.line");break}if(!i)throw new Error("none of the block rules matched");n.tight=!c,n.isEmpty(n.line-1)&&(c=!0),l=n.line,l{"use strict";function sp(n){switch(n){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}Dl.exports=function(t,e){for(var i=t.pos;i{"use strict";var ap=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;Tl.exports=function(t,e){var i,r,o,s,a,l,c,u;return!t.md.options.linkify||t.linkLevel>0||(i=t.pos,r=t.posMax,i+3>r)||t.src.charCodeAt(i)!==58||t.src.charCodeAt(i+1)!==47||t.src.charCodeAt(i+2)!==47||(o=t.pending.match(ap),!o)||(s=o[1],a=t.md.linkify.matchAtStart(t.src.slice(i-s.length)),!a)||(l=a.url,l.length<=s.length)||(l=l.replace(/\*+$/,""),c=t.md.normalizeLink(l),!t.md.validateLink(c))?!1:(e||(t.pending=t.pending.slice(0,-s.length),u=t.push("link_open","a",1),u.attrs=[["href",c]],u.markup="linkify",u.info="auto",u=t.push("text","",0),u.content=t.md.normalizeLinkText(l),u=t.push("link_close","a",-1),u.markup="linkify",u.info="auto"),t.pos+=l.length-s.length,!0)}});var Ml=_((_v,Il)=>{"use strict";var lp=N().isSpace;Il.exports=function(t,e){var i,r,o,s=t.pos;if(t.src.charCodeAt(s)!==10)return!1;if(i=t.pending.length-1,r=t.posMax,!e)if(i>=0&&t.pending.charCodeAt(i)===32)if(i>=1&&t.pending.charCodeAt(i-1)===32){for(o=i-1;o>=1&&t.pending.charCodeAt(o-1)===32;)o--;t.pending=t.pending.slice(0,o),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(s++;s{"use strict";var cp=N().isSpace,oo=[];for(ro=0;ro<256;ro++)oo.push(0);var ro;"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(n){oo[n.charCodeAt(0)]=1});Fl.exports=function(t,e){var i,r,o,s,a,l=t.pos,c=t.posMax;if(t.src.charCodeAt(l)!==92||(l++,l>=c))return!1;if(i=t.src.charCodeAt(l),i===10){for(e||t.push("hardbreak","br",0),l++;l=55296&&i<=56319&&l+1=56320&&r<=57343&&(s+=t.src[l+1],l++)),o="\\"+s,e||(a=t.push("text_special","",0),i<256&&oo[i]!==0?a.content=s:a.content=o,a.markup=o,a.info="escape"),t.pos=l+1,!0}});var Pl=_((Av,Bl)=>{"use strict";Bl.exports=function(t,e){var i,r,o,s,a,l,c,u,h=t.pos,d=t.src.charCodeAt(h);if(d!==96)return!1;for(i=h,h++,r=t.posMax;h{"use strict";so.exports.tokenize=function(t,e){var i,r,o,s,a,l=t.pos,c=t.src.charCodeAt(l);if(e||c!==126||(r=t.scanDelims(t.pos,!0),s=r.length,a=String.fromCharCode(c),s<2))return!1;for(s%2&&(o=t.push("text","",0),o.content=a,s--),i=0;i{"use strict";lo.exports.tokenize=function(t,e){var i,r,o,s=t.pos,a=t.src.charCodeAt(s);if(e||a!==95&&a!==42)return!1;for(r=t.scanDelims(t.pos,a===42),i=0;i=0;e--)i=t[e],!(i.marker!==95&&i.marker!==42)&&i.end!==-1&&(r=t[i.end],a=e>0&&t[e-1].end===i.end+1&&t[e-1].marker===i.marker&&t[e-1].token===i.token-1&&t[i.end+1].token===r.token+1,s=String.fromCharCode(i.marker),o=n.tokens[i.token],o.type=a?"strong_open":"em_open",o.tag=a?"strong":"em",o.nesting=1,o.markup=a?s+s:s,o.content="",o=n.tokens[r.token],o.type=a?"strong_close":"em_close",o.tag=a?"strong":"em",o.nesting=-1,o.markup=a?s+s:s,o.content="",a&&(n.tokens[t[e-1].token].content="",n.tokens[t[i.end+1].token].content="",e--))}lo.exports.postProcess=function(t){var e,i=t.tokens_meta,r=t.tokens_meta.length;for(Rl(t,t.delimiters),e=0;e{"use strict";var up=N().normalizeReference,uo=N().isSpace;Nl.exports=function(t,e){var i,r,o,s,a,l,c,u,h,d="",f="",p=t.pos,m=t.posMax,w=t.pos,v=!0;if(t.src.charCodeAt(t.pos)!==91||(a=t.pos+1,s=t.md.helpers.parseLinkLabel(t,t.pos,!0),s<0))return!1;if(l=s+1,l=m)return!1;if(w=l,c=t.md.helpers.parseLinkDestination(t.src,l,t.posMax),c.ok){for(d=t.md.normalizeLink(c.str),t.md.validateLink(d)?l=c.pos:d="",w=l;l=m||t.src.charCodeAt(l)!==41)&&(v=!0),l++}if(v){if(typeof t.env.references>"u")return!1;if(l=0?o=t.src.slice(w,l++):l=s+1):l=s+1,o||(o=t.src.slice(a,s)),u=t.env.references[up(o)],!u)return t.pos=p,!1;d=u.href,f=u.title}return e||(t.pos=a,t.posMax=s,h=t.push("link_open","a",1),h.attrs=i=[["href",d]],f&&i.push(["title",f]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,h=t.push("link_close","a",-1)),t.pos=l,t.posMax=m,!0}});var Ul=_(($v,Hl)=>{"use strict";var hp=N().normalizeReference,ho=N().isSpace;Hl.exports=function(t,e){var i,r,o,s,a,l,c,u,h,d,f,p,m,w="",v=t.pos,b=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91||(l=t.pos+2,a=t.md.helpers.parseLinkLabel(t,t.pos+1,!1),a<0))return!1;if(c=a+1,c=b)return!1;for(m=c,h=t.md.helpers.parseLinkDestination(t.src,c,t.posMax),h.ok&&(w=t.md.normalizeLink(h.str),t.md.validateLink(w)?c=h.pos:w=""),m=c;c=b||t.src.charCodeAt(c)!==41)return t.pos=v,!1;c++}else{if(typeof t.env.references>"u")return!1;if(c=0?s=t.src.slice(m,c++):c=a+1):c=a+1,s||(s=t.src.slice(l,a)),u=t.env.references[hp(s)],!u)return t.pos=v,!1;w=u.href,d=u.title}return e||(o=t.src.slice(l,a),t.md.inline.parse(o,t.md,t.env,p=[]),f=t.push("image","img",0),f.attrs=i=[["src",w],["alt",""]],f.children=p,f.content=o,d&&i.push(["title",d])),t.pos=c,t.posMax=b,!0}});var Vl=_((Iv,jl)=>{"use strict";var dp=/^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,pp=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/;jl.exports=function(t,e){var i,r,o,s,a,l,c=t.pos;if(t.src.charCodeAt(c)!==60)return!1;for(a=t.pos,l=t.posMax;;){if(++c>=l||(s=t.src.charCodeAt(c),s===60))return!1;if(s===62)break}return i=t.src.slice(a+1,c),pp.test(i)?(r=t.md.normalizeLink(i),t.md.validateLink(r)?(e||(o=t.push("link_open","a",1),o.attrs=[["href",r]],o.markup="autolink",o.info="auto",o=t.push("text","",0),o.content=t.md.normalizeLinkText(i),o=t.push("link_close","a",-1),o.markup="autolink",o.info="auto"),t.pos+=i.length+2,!0):!1):dp.test(i)?(r=t.md.normalizeLink("mailto:"+i),t.md.validateLink(r)?(e||(o=t.push("link_open","a",1),o.attrs=[["href",r]],o.markup="autolink",o.info="auto",o=t.push("text","",0),o.content=t.md.normalizeLinkText(i),o=t.push("link_close","a",-1),o.markup="autolink",o.info="auto"),t.pos+=i.length+2,!0):!1):!1}});var Gl=_((Mv,Wl)=>{"use strict";var fp=io().HTML_TAG_RE;function mp(n){return/^\s]/i.test(n)}function gp(n){return/^<\/a\s*>/i.test(n)}function bp(n){var t=n|32;return t>=97&&t<=122}Wl.exports=function(t,e){var i,r,o,s,a=t.pos;return!t.md.options.html||(o=t.posMax,t.src.charCodeAt(a)!==60||a+2>=o)||(i=t.src.charCodeAt(a+1),i!==33&&i!==63&&i!==47&&!bp(i))||(r=t.src.slice(a).match(fp),!r)?!1:(e||(s=t.push("html_inline","",0),s.content=r[0],mp(s.content)&&t.linkLevel++,gp(s.content)&&t.linkLevel--),t.pos+=r[0].length,!0)}});var Yl=_((Fv,Xl)=>{"use strict";var Kl=Gr(),vp=N().has,wp=N().isValidEntityCode,Zl=N().fromCodePoint,yp=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,xp=/^&([a-z][a-z0-9]{1,31});/i;Xl.exports=function(t,e){var i,r,o,s,a=t.pos,l=t.posMax;if(t.src.charCodeAt(a)!==38||a+1>=l)return!1;if(i=t.src.charCodeAt(a+1),i===35){if(o=t.src.slice(a).match(yp),o)return e||(r=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),s=t.push("text_special","",0),s.content=wp(r)?Zl(r):Zl(65533),s.markup=o[0],s.info="entity"),t.pos+=o[0].length,!0}else if(o=t.src.slice(a).match(xp),o&&vp(Kl,o[1]))return e||(s=t.push("text_special","",0),s.content=Kl[o[1]],s.markup=o[0],s.info="entity"),t.pos+=o[0].length,!0;return!1}});var tc=_((qv,Ql)=>{"use strict";function Jl(n){var t,e,i,r,o,s,a,l,c={},u=n.length;if(u){var h=0,d=-2,f=[];for(t=0;to;e-=f[e]+1)if(r=n[e],r.marker===i.marker&&r.open&&r.end<0&&(a=!1,(r.close||i.open)&&(r.length+i.length)%3===0&&(r.length%3!==0||i.length%3!==0)&&(a=!0),!a)){l=e>0&&!n[e-1].open?f[e-1]+1:0,f[t]=t-e+l,f[e]=l,i.open=!1,r.end=t,r.close=!1,s=-1,d=-2;break}s!==-1&&(c[i.marker][(i.open?3:0)+(i.length||0)%3]=s)}}}Ql.exports=function(t){var e,i=t.tokens_meta,r=t.tokens_meta.length;for(Jl(t.delimiters),e=0;e{"use strict";ec.exports=function(t){var e,i,r=0,o=t.tokens,s=t.tokens.length;for(e=i=0;e0&&r++,o[e].type==="text"&&e+1{"use strict";var po=di(),ic=N().isWhiteSpace,rc=N().isPunctChar,oc=N().isMdAsciiPunct;function Ze(n,t,e,i){this.src=n,this.env=e,this.md=t,this.tokens=i,this.tokens_meta=Array(i.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Ze.prototype.pushPending=function(){var n=new po("text","",0);return n.content=this.pending,n.level=this.pendingLevel,this.tokens.push(n),this.pending="",n};Ze.prototype.push=function(n,t,e){this.pending&&this.pushPending();var i=new po(n,t,e),r=null;return e<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,e>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(r),i};Ze.prototype.scanDelims=function(n,t){var e=n,i,r,o,s,a,l,c,u,h,d=!0,f=!0,p=this.posMax,m=this.src.charCodeAt(n);for(i=n>0?this.src.charCodeAt(n-1):32;e{"use strict";var lc=ui(),fo=[["text",Ll()],["linkify",$l()],["newline",Ml()],["escape",ql()],["backticks",Pl()],["strikethrough",ao().tokenize],["emphasis",co().tokenize],["link",zl()],["image",Ul()],["autolink",Vl()],["html_inline",Gl()],["entity",Yl()]],mo=[["balance_pairs",tc()],["strikethrough",ao().postProcess],["emphasis",co().postProcess],["fragments_join",nc()]];function Xe(){var n;for(this.ruler=new lc,n=0;n=n.pos)throw new Error("inline rule didn't increment state.pos");break}}else n.pos=n.posMax;t||n.pos++,a[i]=n.pos};Xe.prototype.tokenize=function(n){for(var t,e,i,r=this.ruler.getRules(""),o=r.length,s=n.posMax,a=n.md.options.maxNesting;n.pos=n.pos)throw new Error("inline rule didn't increment state.pos");break}}if(t){if(n.pos>=s)break;continue}n.pending+=n.src[n.pos++]}n.pending&&n.pushPending()};Xe.prototype.parse=function(n,t,e,i){var r,o,s,a=new this.State(n,t,e,i);for(this.tokenize(a),o=this.ruler2.getRules(""),s=o.length,r=0;r{"use strict";hc.exports=function(n){var t={};n=n||{},t.src_Any=Zr().source,t.src_Cc=Xr().source,t.src_Z=Yr().source,t.src_P=oi().source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");var e="[><\uFF5C]";return t.src_pseudo_letter="(?:(?!"+e+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+e+"|"+t.src_ZPCc+")(?!"+(n["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+e+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(n["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+e+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+t.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+t.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}});var bc=_((Nv,gc)=>{"use strict";function go(n){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(e){e&&Object.keys(e).forEach(function(i){n[i]=e[i]})}),n}function vi(n){return Object.prototype.toString.call(n)}function kp(n){return vi(n)==="[object String]"}function Cp(n){return vi(n)==="[object Object]"}function Ep(n){return vi(n)==="[object RegExp]"}function pc(n){return vi(n)==="[object Function]"}function _p(n){return n.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var mc={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Sp(n){return Object.keys(n||{}).reduce(function(t,e){return t||mc.hasOwnProperty(e)},!1)}var Ap={"http:":{validate:function(n,t,e){var i=n.slice(t);return e.re.http||(e.re.http=new RegExp("^\\/\\/"+e.re.src_auth+e.re.src_host_port_strict+e.re.src_path,"i")),e.re.http.test(i)?i.match(e.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(n,t,e){var i=n.slice(t);return e.re.no_http||(e.re.no_http=new RegExp("^"+e.re.src_auth+"(?:localhost|(?:(?:"+e.re.src_domain+")\\.)+"+e.re.src_domain_root+")"+e.re.src_port+e.re.src_host_terminator+e.re.src_path,"i")),e.re.no_http.test(i)?t>=3&&n[t-3]===":"||t>=3&&n[t-3]==="/"?0:i.match(e.re.no_http)[0].length:0}},"mailto:":{validate:function(n,t,e){var i=n.slice(t);return e.re.mailto||(e.re.mailto=new RegExp("^"+e.re.src_email_name+"@"+e.re.src_host_strict,"i")),e.re.mailto.test(i)?i.match(e.re.mailto)[0].length:0}}},Dp="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",Lp="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function Tp(n){n.__index__=-1,n.__text_cache__=""}function $p(n){return function(t,e){var i=t.slice(e);return n.test(i)?i.match(n)[0].length:0}}function fc(){return function(n,t){t.normalize(n)}}function bi(n){var t=n.re=dc()(n.__opts__),e=n.__tlds__.slice();n.onCompile(),n.__tlds_replaced__||e.push(Dp),e.push(t.src_xn),t.src_tlds=e.join("|");function i(a){return a.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(i(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(i(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(i(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(i(t.tpl_host_fuzzy_test),"i");var r=[];n.__compiled__={};function o(a,l){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+l)}Object.keys(n.__schemas__).forEach(function(a){var l=n.__schemas__[a];if(l!==null){var c={validate:null,link:null};if(n.__compiled__[a]=c,Cp(l)){Ep(l.validate)?c.validate=$p(l.validate):pc(l.validate)?c.validate=l.validate:o(a,l),pc(l.normalize)?c.normalize=l.normalize:l.normalize?o(a,l):c.normalize=fc();return}if(kp(l)){r.push(a);return}o(a,l)}}),r.forEach(function(a){n.__compiled__[n.__schemas__[a]]&&(n.__compiled__[a].validate=n.__compiled__[n.__schemas__[a]].validate,n.__compiled__[a].normalize=n.__compiled__[n.__schemas__[a]].normalize)}),n.__compiled__[""]={validate:null,normalize:fc()};var s=Object.keys(n.__compiled__).filter(function(a){return a.length>0&&n.__compiled__[a]}).map(_p).join("|");n.re.schema_test=RegExp("(^|(?!_)(?:[><\uFF5C]|"+t.src_ZPCc+"))("+s+")","i"),n.re.schema_search=RegExp("(^|(?!_)(?:[><\uFF5C]|"+t.src_ZPCc+"))("+s+")","ig"),n.re.schema_at_start=RegExp("^"+n.re.schema_search.source,"i"),n.re.pretest=RegExp("("+n.re.schema_test.source+")|("+n.re.host_fuzzy_test.source+")|@","i"),Tp(n)}function Ip(n,t){var e=n.__index__,i=n.__last_index__,r=n.__text_cache__.slice(e,i);this.schema=n.__schema__.toLowerCase(),this.index=e+t,this.lastIndex=i+t,this.raw=r,this.text=r,this.url=r}function bo(n,t){var e=new Ip(n,t);return n.__compiled__[e.schema].normalize(e,n),e}function gt(n,t){if(!(this instanceof gt))return new gt(n,t);t||Sp(n)&&(t=n,n={}),this.__opts__=go({},mc,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=go({},Ap,n),this.__compiled__={},this.__tlds__=Lp,this.__tlds_replaced__=!1,this.re={},bi(this)}gt.prototype.add=function(t,e){return this.__schemas__[t]=e,bi(this),this};gt.prototype.set=function(t){return this.__opts__=go(this.__opts__,t),this};gt.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;var e,i,r,o,s,a,l,c,u;if(this.re.schema_test.test(t)){for(l=this.re.schema_search,l.lastIndex=0;(e=l.exec(t))!==null;)if(o=this.testSchemaAt(t,e[2],l.lastIndex),o){this.__schema__=e[2],this.__index__=e.index+e[1].length,this.__last_index__=e.index+e[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c=0&&(r=t.match(this.re.email_fuzzy))!==null&&(s=r.index+r[1].length,a=r.index+r[0].length,(this.__index__<0||sthis.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=a))),this.__index__>=0};gt.prototype.pretest=function(t){return this.re.pretest.test(t)};gt.prototype.testSchemaAt=function(t,e,i){return this.__compiled__[e.toLowerCase()]?this.__compiled__[e.toLowerCase()].validate(t,i,this):0};gt.prototype.match=function(t){var e=0,i=[];this.__index__>=0&&this.__text_cache__===t&&(i.push(bo(this,e)),e=this.__last_index__);for(var r=e?t.slice(e):t;this.test(r);)i.push(bo(this,e)),r=r.slice(this.__last_index__),e+=this.__last_index__;return i.length?i:null};gt.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;var e=this.re.schema_at_start.exec(t);if(!e)return null;var i=this.testSchemaAt(t,e[2],e[0].length);return i?(this.__schema__=e[2],this.__index__=e.index+e[1].length,this.__last_index__=e.index+e[0].length+i,bo(this,0)):null};gt.prototype.tlds=function(t,e){return t=Array.isArray(t)?t:[t],e?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(i,r,o){return i!==o[r-1]}).reverse(),bi(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,bi(this),this)};gt.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};gt.prototype.onCompile=function(){};gc.exports=gt});var _c={};Se(_c,{decode:()=>xo,default:()=>Np,encode:()=>ko,toASCII:()=>Ec,toUnicode:()=>Cc,ucs2decode:()=>yo,ucs2encode:()=>xc});function Vt(n){throw new RangeError(Bp[n])}function Pp(n,t){let e=[],i=n.length;for(;i--;)e[i]=t(n[i]);return e}function yc(n,t){let e=n.split("@"),i="";e.length>1&&(i=e[0]+"@",n=e[1]),n=n.replace(qp,".");let r=n.split("."),o=Pp(r,t).join(".");return i+o}function yo(n){let t=[],e=0,i=n.length;for(;e=55296&&r<=56319&&e{"use strict";wc="-",Mp=/^xn--/,Fp=/[^\0-\x7F]/,qp=/[\x2E\u3002\uFF0E\uFF61]/g,Bp={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},vo=36-1,Tt=Math.floor,wo=String.fromCharCode;xc=n=>String.fromCodePoint(...n),Op=function(n){return n>=48&&n<58?26+(n-48):n>=65&&n<91?n-65:n>=97&&n<123?n-97:36},vc=function(n,t){return n+22+75*(n<26)-((t!=0)<<5)},kc=function(n,t,e){let i=0;for(n=e?Tt(n/700):n>>1,n+=Tt(n/t);n>vo*26>>1;i+=36)n=Tt(n/vo);return Tt(i+(vo+1)*n/(n+38))},xo=function(n){let t=[],e=n.length,i=0,r=128,o=72,s=n.lastIndexOf(wc);s<0&&(s=0);for(let a=0;a=128&&Vt("not-basic"),t.push(n.charCodeAt(a));for(let a=s>0?s+1:0;a=e&&Vt("invalid-input");let d=Op(n.charCodeAt(a++));d>=36&&Vt("invalid-input"),d>Tt((2147483647-i)/u)&&Vt("overflow"),i+=d*u;let f=h<=o?1:h>=o+26?26:h-o;if(dTt(2147483647/p)&&Vt("overflow"),u*=p}let c=t.length+1;o=kc(i-l,c,l==0),Tt(i/c)>2147483647-r&&Vt("overflow"),r+=Tt(i/c),i%=c,t.splice(i++,0,r)}return String.fromCodePoint(...t)},ko=function(n){let t=[];n=yo(n);let e=n.length,i=128,r=0,o=72;for(let l of n)l<128&&t.push(wo(l));let s=t.length,a=s;for(s&&t.push(wc);a=i&&uTt((2147483647-r)/c)&&Vt("overflow"),r+=(l-i)*c,i=l;for(let u of n)if(u2147483647&&Vt("overflow"),u===i){let h=r;for(let d=36;;d+=36){let f=d<=o?1:d>=o+26?26:d-o;if(h{"use strict";Ac.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}});var Tc=_((Hv,Lc)=>{"use strict";Lc.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}}});var Ic=_((Uv,$c)=>{"use strict";$c.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}});var Bc=_((jv,qc)=>{"use strict";var Ye=N(),zp=ga(),Hp=va(),Up=Va(),jp=Al(),Vp=uc(),Wp=bc(),Qt=Kr(),Mc=(Sc(),Uu(_c)),Gp={default:Dc(),zero:Tc(),commonmark:Ic()},Kp=/^(vbscript|javascript|file|data):/,Zp=/^data:image\/(gif|png|jpeg|webp);/;function Xp(n){var t=n.trim().toLowerCase();return Kp.test(t)?!!Zp.test(t):!0}var Fc=["http:","https:","mailto:"];function Yp(n){var t=Qt.parse(n,!0);if(t.hostname&&(!t.protocol||Fc.indexOf(t.protocol)>=0))try{t.hostname=Mc.toASCII(t.hostname)}catch{}return Qt.encode(Qt.format(t))}function Jp(n){var t=Qt.parse(n,!0);if(t.hostname&&(!t.protocol||Fc.indexOf(t.protocol)>=0))try{t.hostname=Mc.toUnicode(t.hostname)}catch{}return Qt.decode(Qt.format(t),Qt.decode.defaultChars+"%")}function bt(n,t){if(!(this instanceof bt))return new bt(n,t);t||Ye.isString(n)||(t=n||{},n="default"),this.inline=new Vp,this.block=new jp,this.core=new Up,this.renderer=new Hp,this.linkify=new Wp,this.validateLink=Xp,this.normalizeLink=Yp,this.normalizeLinkText=Jp,this.utils=Ye,this.helpers=Ye.assign({},zp),this.options={},this.configure(n),t&&this.set(t)}bt.prototype.set=function(n){return Ye.assign(this.options,n),this};bt.prototype.configure=function(n){var t=this,e;if(Ye.isString(n)&&(e=n,n=Gp[e],!n))throw new Error('Wrong `markdown-it` preset "'+e+'", check name');if(!n)throw new Error("Wrong `markdown-it` preset, can't be empty");return n.options&&t.set(n.options),n.components&&Object.keys(n.components).forEach(function(i){n.components[i].rules&&t[i].ruler.enableOnly(n.components[i].rules),n.components[i].rules2&&t[i].ruler2.enableOnly(n.components[i].rules2)}),this};bt.prototype.enable=function(n,t){var e=[];Array.isArray(n)||(n=[n]),["core","block","inline"].forEach(function(r){e=e.concat(this[r].ruler.enable(n,!0))},this),e=e.concat(this.inline.ruler2.enable(n,!0));var i=n.filter(function(r){return e.indexOf(r)<0});if(i.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+i);return this};bt.prototype.disable=function(n,t){var e=[];Array.isArray(n)||(n=[n]),["core","block","inline"].forEach(function(r){e=e.concat(this[r].ruler.disable(n,!0))},this),e=e.concat(this.inline.ruler2.disable(n,!0));var i=n.filter(function(r){return e.indexOf(r)<0});if(i.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+i);return this};bt.prototype.use=function(n){var t=[this].concat(Array.prototype.slice.call(arguments,1));return n.apply(n,t),this};bt.prototype.parse=function(n,t){if(typeof n!="string")throw new Error("Input data should be a String");var e=new this.core.State(n,this,t);return this.core.process(e),e.tokens};bt.prototype.render=function(n,t){return t=t||{},this.renderer.render(this.parse(n,t),this.options,t)};bt.prototype.parseInline=function(n,t){var e=new this.core.State(n,this,t);return e.inlineMode=!0,this.core.process(e),e.tokens};bt.prototype.renderInline=function(n,t){return t=t||{},this.renderer.render(this.parseInline(n,t),this.options,t)};qc.exports=bt});var Oc=_((Vv,Pc)=>{"use strict";Pc.exports=Bc()});var Uc=_((Wv,Hc)=>{var Co=!0,Nc=!1,zc=!1;Hc.exports=function(n,t){t&&(Co=!t.enabled,Nc=!!t.label,zc=!!t.labelAfter),n.core.ruler.after("inline","github-task-lists",function(e){for(var i=e.tokens,r=2;r=0;i--)if(n[i].level===e)return i;return-1}function tf(n,t){return af(n[t])&&lf(n[t-1])&&cf(n[t-2])&&uf(n[t])}function ef(n,t){if(n.children.unshift(nf(n,t)),n.children[1].content=n.children[1].content.slice(3),n.content=n.content.slice(3),Nc)if(zc){n.children.pop();var e="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);n.children[0].content=n.children[0].content.slice(0,-1)+' id="'+e+'">',n.children.push(sf(n.content,e,t))}else n.children.unshift(rf(t)),n.children.push(of(t))}function nf(n,t){var e=new t("html_inline","",0),i=Co?' disabled="" ':"";return n.content.indexOf("[ ] ")===0?e.content='':(n.content.indexOf("[x] ")===0||n.content.indexOf("[X] ")===0)&&(e.content=''),e}function rf(n){var t=new n("html_inline","",0);return t.content="",t}function sf(n,t,e){var i=new e("html_inline","",0);return i.content='",i.attrs=[{for:t}],i}function af(n){return n.type==="inline"}function lf(n){return n.type==="paragraph_open"}function cf(n){return n.type==="list_item_open"}function uf(n){return n.content.indexOf("[ ] ")===0||n.content.indexOf("[x] ")===0||n.content.indexOf("[X] ")===0}});var pr={};Se(pr,{emit:()=>hr,emitPublic:()=>Gu,error:()=>dr,listen:()=>Wu,showResponseError:()=>Xu,showValidationErrors:()=>Zu,success:()=>Ku});var on={},Vu=[];function hr(n,t){Vu.push({name:n,data:t});let e=on[n]||[];for(let i of e)i(t)}function Wu(n,t){typeof on[n]>"u"&&(on[n]=[]),on[n].push(t)}function Gu(n,t,e){let i=new CustomEvent(t,{detail:e,bubbles:!0});n.dispatchEvent(i)}function Ku(n){hr("success",n)}function dr(n){hr("error",n)}function Zu(n){if(n.status&&n.status===422&&n.data){let t=Object.values(n.data).flat().join(` -`);dr(t)}}function Xu(n){n.status&&n.status>=400&&n.data&&n.data.message&&dr(n.data.message)}var fr={};Se(fr,{HttpError:()=>sn,createXMLHttpRequest:()=>Ju,delete:()=>ih,get:()=>Qu,patch:()=>nh,post:()=>th,put:()=>eh});async function Yu(n){if(n.status===204)return null;let e=(n.headers.get("Content-Type")||"").split(";")[0].split("/").pop();return e==="javascript"||e==="json"?n.json():n.text()}var sn=class extends Error{constructor(t,e){super(t.statusText),this.data=e,this.headers=t.headers,this.redirected=t.redirected,this.status=t.status,this.statusText=t.statusText,this.url=t.url,this.original=t}};function Ju(n,t,e={}){let i=document.querySelector("meta[name=token]").getAttribute("content"),r=new XMLHttpRequest;for(let[o,s]of Object.entries(e))r.addEventListener(o,s.bind(r));return r.open(n,t),r.withCredentials=!0,r.setRequestHeader("X-CSRF-TOKEN",i),r}async function Ko(n,t={}){let e=n;if(e.startsWith("http")||(e=window.baseUrl(e)),t.params){let l=new URL(e);for(let c of Object.keys(t.params)){let u=t.params[c];typeof u<"u"&&u!==null&&l.searchParams.set(c,u)}e=l.toString()}let i=document.querySelector("meta[name=token]").getAttribute("content"),r={...t,credentials:"same-origin"};r.headers={...r.headers||{},baseURL:window.baseUrl(""),"X-CSRF-TOKEN":i};let o=await fetch(e,r),s=await Yu(o),a={data:s,headers:o.headers,redirected:o.redirected,status:o.status,statusText:o.statusText,url:o.url,original:o};if(!o.ok)throw new sn(o,s);return a}async function an(n,t,e=null){let i={method:n,body:e};return typeof e=="object"&&!(e instanceof FormData)&&(i.headers={"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},i.body=JSON.stringify(e)),e instanceof FormData&&n!=="post"&&(e.append("_method",n),i.method="post"),Ko(t,i)}async function Qu(n,t={}){return Ko(n,{method:"GET",params:t})}async function th(n,t=null){return an("POST",n,t)}async function eh(n,t=null){return an("PUT",n,t)}async function nh(n,t=null){return an("PATCH",n,t)}async function ih(n,t=null){return an("DELETE",n,t)}var mr=class{constructor(){this.store=new Map,this.parseTranslations()}parseTranslations(){let t=document.querySelectorAll('meta[name="translation"]');for(let e of t){let i=e.getAttribute("key"),r=e.getAttribute("value");this.store.set(i,r)}}get(t,e){let i=this.getTransText(t);return this.performReplacements(i,e)}getPlural(t,e,i){let r=this.getTransText(t);return this.parsePlural(r,e,i)}parsePlural(t,e,i){let r=t.split("|"),o=/^{([0-9]+)}/,s=/^\[([0-9]+),([0-9*]+)]/,a=null;for(let l of r){let c=l.match(o);if(c!==null&&Number(c[1])===e){a=l.replace(o,"").trim();break}let u=l.match(s);if(u!==null&&Number(u[1])<=e&&(u[2]==="*"||Number(u[2])>=e)){a=l.replace(s,"").trim();break}}return a===null&&r.length>1&&(a=e===1?r[0]:r[1]),a===null&&(a=r[0]),this.performReplacements(a,i)}getTransText(t){let e=this.store.get(t);return e===void 0&&console.warn(`Translation with key "${t}" does not exist`),e}performReplacements(t,e){if(!e)return t;let i=t.match(/:(\S+)/g);if(i===null)return t;let r=t;return i.forEach(o=>{let s=o.substring(1);typeof e[s]>"u"||(r=r.replace(o,e[s]))}),r}},Zo=mr;var yr={};Se(yr,{first:()=>ah,firstOnElement:()=>ch,get:()=>lh,init:()=>vr,register:()=>wr});function gr(n){let t=i=>i.slice(0,1).toUpperCase()+i.slice(1),e=n.split("-");return e[0]+e.slice(1).map(t).join("")}function Xo(n){return n.replace(/[A-Z]/g,(t,e)=>(e>0?"-":"")+t.toLowerCase())}var Ae={},Yo={},br=new WeakMap;function rh(n,t){let e={},i={},r=`${n}@`,o=`[refs*="${r}"]`,s=[...t.querySelectorAll(o)];t.matches(o)&&s.push(t);for(let a of s){let l=a.getAttribute("refs").split(" ").filter(c=>c.startsWith(r)).map(c=>c.replace(r,"")).map(gr);for(let c of l)e[c]=a,typeof i[c]>"u"&&(i[c]=[]),i[c].push(a)}return{refs:e,manyRefs:i}}function oh(n,t){let e={},i=`option:${n}:`;for(let{name:r,value:o}of t.attributes)if(r.startsWith(i)){let s=r.replace(i,"");e[gr(s)]=o||""}return e}function sh(n,t){let e=Yo[n];if(e===void 0)return;let i;try{i=new e,i.$name=n,i.$el=t;let o=rh(n,t);i.$refs=o.refs,i.$manyRefs=o.manyRefs,i.$opts=oh(n,t),i.setup()}catch(o){console.error("Failed to create component",o,n,t)}typeof Ae[n]>"u"&&(Ae[n]=[]),Ae[n].push(i);let r=br.get(t)||{};r[n]=i,br.set(t,r)}function vr(n=document){let t=n.querySelectorAll("[component],[components]");for(let e of t){let i=`${e.getAttribute("component")||""} ${e.getAttribute("components")}`.toLowerCase().split(" ").filter(Boolean);for(let r of i)sh(r,e)}}function wr(n){let t=Object.keys(n);for(let e of t)Yo[Xo(e)]=n[e]}function ah(n){return(Ae[n]||[null])[0]}function lh(n){return Ae[n]||[]}function ch(n,t){return(br.get(n)||{})[t]||null}var jo={};Se(jo,{AddRemoveRows:()=>cn,AjaxDeleteRow:()=>un,AjaxForm:()=>hn,Attachments:()=>dn,AttachmentsList:()=>pn,AutoSubmit:()=>mn,AutoSuggest:()=>fn,BackToTop:()=>gn,BookSort:()=>Fn,ChapterContents:()=>Bn,CodeEditor:()=>Pn,CodeHighlighter:()=>On,CodeTextarea:()=>Rn,Collapsible:()=>Nn,ConfirmDialog:()=>zn,CustomCheckbox:()=>Hn,DetailsHighlighter:()=>Un,Dropdown:()=>jn,DropdownSearch:()=>Vn,Dropzone:()=>Wn,EditorToolbox:()=>Gn,EntityPermissions:()=>Kn,EntitySearch:()=>Zn,EntitySelector:()=>Xn,EntitySelectorPopup:()=>Yn,EventEmitSelect:()=>Jn,ExpandToggle:()=>Qn,GlobalSearch:()=>ti,HeaderMobileToggle:()=>ei,ImageManager:()=>ni,ImagePicker:()=>ii,ListSortControl:()=>ri,MarkdownEditor:()=>Mi,NewUserPassword:()=>Fi,Notification:()=>qi,OptionalInput:()=>Bi,PageComment:()=>Pi,PageComments:()=>Oi,PageDisplay:()=>Ri,PageEditor:()=>Ni,PagePicker:()=>Hi,PermissionsTable:()=>Ui,Pointer:()=>ji,Popup:()=>Vi,SettingAppColorScheme:()=>Wi,SettingColorPicker:()=>Gi,SettingHomepageControl:()=>Ki,ShelfSort:()=>Zi,ShortcutInput:()=>Yi,Shortcuts:()=>Xi,SortableList:()=>Ji,SubmitOnChange:()=>Qi,Tabs:()=>tr,TagManager:()=>er,TemplateManager:()=>nr,ToggleSwitch:()=>ir,TriLayout:()=>rr,UserSelect:()=>or,WebhookEvents:()=>sr,WysiwygEditor:()=>cr,WysiwygInput:()=>ur});function Et(n,t={},e=[]){let i=document.createElement(n);for(let[r,o]of Object.entries(t))o===null?i.removeAttribute(r):i.setAttribute(r,o);for(let r of e)typeof r=="string"?i.append(document.createTextNode(r)):i.append(r);return i}function xr(n,t){let e=document.querySelectorAll(n);for(let i of e)t(i)}function ln(n,t,e){for(let i of t)n.addEventListener(i,e)}function R(n,t){Array.isArray(n)||(n=[n]);for(let e of n)e.addEventListener("click",t),e.addEventListener("keydown",i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),t(i))})}function Jo(n,t,e){Array.isArray(t)||(t=[t]);let i=r=>{r.key===n&&e(r)};t.forEach(r=>r.addEventListener("keydown",i))}function se(n,t){Jo("Enter",n,t)}function Qo(n,t){Jo("Escape",n,t)}function K(n,t,e,i){n.addEventListener(e,r=>{let o=r.target.closest(t);o&&i.call(o,r,o)})}function ts(n,t){let e=document.querySelectorAll(n);t=t.toLowerCase();for(let i of e)if(i.textContent.toLowerCase().includes(t))return i;return null}function De(n){n.innerHTML='
'}function ae(){let n=document.createElement("div");return n.classList.add("loading-container"),n.innerHTML="
",n}function Le(n){let t=n.querySelectorAll(".loading-container");for(let e of t)e.remove()}function _t(n){let t=document.createElement("div");return t.innerHTML=n,window.$components.init(t),t.children[0]}function Nt(n,t,e){let i;return function(...o){let s=this,a=function(){i=null,e||n.apply(s,o)},l=e&&!i;clearTimeout(i),i=setTimeout(a,t),l&&n.apply(s,o)}}function Cr(n){if(!n)return;let t=n.closest("details");t&&!t.open&&(t.open=!0),n.scrollIntoView({behavior:"smooth"});let e=getComputedStyle(document.body).getPropertyValue("--color-link");n.style.outline=`2px dashed ${e}`,n.style.outlineOffset="5px",n.style.transition=null,setTimeout(()=>{n.style.transition="outline linear 3s",n.style.outline="2px dashed rgba(0, 0, 0, 0)";let i=()=>{n.removeEventListener("transitionend",i),n.style.transition=null,n.style.outline=null,n.style.outlineOffset=null};n.addEventListener("transitionend",i)},1e3)}function es(n){return n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function ns(){let n=()=>((1+Math.random())*65536|0).toString(16).substring(1);return`${n()+n()}-${n()}-${n()}-${n()}-${n()}${n()}${n()}`}function is(n){return new Promise(t=>{setTimeout(t,n)})}var g=class{constructor(){at(this,"$name","");at(this,"$el",null);at(this,"$refs",{});at(this,"$manyRefs",{});at(this,"$opts",{})}setup(){}$emit(t,e={}){e.from=this;let i=this.$name,r=new CustomEvent(`${i}-${t}`,{bubbles:!0,detail:e});this.$el.dispatchEvent(r)}};var cn=class extends g{setup(){this.modelRow=this.$refs.model,this.addButton=this.$refs.add,this.removeSelector=this.$opts.removeSelector,this.rowSelector=this.$opts.rowSelector,this.setupListeners()}setupListeners(){this.addButton.addEventListener("click",this.add.bind(this)),K(this.$el,this.removeSelector,"click",t=>{t.target.closest(this.rowSelector).remove()})}add(){let t=this.modelRow.cloneNode(!0);t.classList.remove("hidden"),this.setClonedInputNames(t),this.modelRow.parentNode.insertBefore(t,this.modelRow),window.$components.init(t)}setClonedInputNames(t){let e=ns(),i=t.querySelectorAll('[name*="randrowid"]');for(let r of i)r.name=r.name.split("randrowid").join(e)}};var un=class extends g{setup(){this.row=this.$el,this.url=this.$opts.url,this.deleteButtons=this.$manyRefs.delete,R(this.deleteButtons,this.runDelete.bind(this))}runDelete(){this.row.style.opacity="0.7",this.row.style.pointerEvents="none",window.$http.delete(this.url).then(t=>{typeof t.data=="object"&&t.data.message&&window.$events.emit("success",t.data.message),this.row.remove()}).catch(()=>{this.row.style.opacity=null,this.row.style.pointerEvents=null})}};var hn=class extends g{setup(){this.container=this.$el,this.responseContainer=this.container,this.url=this.$opts.url,this.method=this.$opts.method||"post",this.successMessage=this.$opts.successMessage,this.submitButtons=this.$manyRefs.submit||[],this.$opts.responseContainer&&(this.responseContainer=this.container.closest(this.$opts.responseContainer)),this.setupListeners()}setupListeners(){if(this.container.tagName==="FORM"){this.container.addEventListener("submit",this.submitRealForm.bind(this));return}se(this.container,t=>{this.submitFakeForm(),t.preventDefault()}),this.submitButtons.forEach(t=>R(t,this.submitFakeForm.bind(this)))}submitFakeForm(){let t=new FormData,e=this.container.querySelectorAll("[name]");for(let i of e)t.append(i.getAttribute("name"),i.value);this.submit(t)}submitRealForm(t){t.preventDefault();let e=new FormData(this.container);this.submit(e)}async submit(t){this.responseContainer.style.opacity="0.7",this.responseContainer.style.pointerEvents="none";try{let e=await window.$http[this.method.toLowerCase()](this.url,t);this.$emit("success",{formData:t}),this.responseContainer.innerHTML=e.data,this.successMessage&&window.$events.emit("success",this.successMessage)}catch(e){this.responseContainer.innerHTML=e.data}window.$components.init(this.responseContainer),this.responseContainer.style.opacity=null,this.responseContainer.style.pointerEvents=null}};var dn=class extends g{setup(){this.container=this.$el,this.pageId=this.$opts.pageId,this.editContainer=this.$refs.editContainer,this.listContainer=this.$refs.listContainer,this.linksContainer=this.$refs.linksContainer,this.listPanel=this.$refs.listPanel,this.attachLinkButton=this.$refs.attachLinkButton,this.setupListeners()}setupListeners(){let t=this.reloadList.bind(this);this.container.addEventListener("dropzone-upload-success",t),this.container.addEventListener("ajax-form-success",t),this.container.addEventListener("sortable-list-sort",e=>{this.updateOrder(e.detail.ids)}),this.container.addEventListener("event-emit-select-edit",e=>{this.startEdit(e.detail.id)}),this.container.addEventListener("event-emit-select-edit-back",()=>{this.stopEdit()}),this.container.addEventListener("event-emit-select-insert",e=>{let i=e.target.closest("[data-drag-content]").getAttribute("data-drag-content"),r=JSON.parse(i);window.$events.emit("editor::insert",{html:r["text/html"],markdown:r["text/plain"]})}),this.attachLinkButton.addEventListener("click",()=>{this.showSection("links")})}showSection(t){let e={links:this.linksContainer,edit:this.editContainer,list:this.listContainer};for(let[i,r]of Object.entries(e))r.toggleAttribute("hidden",i!==t)}reloadList(){this.stopEdit(),window.$http.get(`/attachments/get/page/${this.pageId}`).then(t=>{this.listPanel.innerHTML=t.data,window.$components.init(this.listPanel)})}updateOrder(t){window.$http.put(`/attachments/sort/page/${this.pageId}`,{order:t}).then(e=>{window.$events.emit("success",e.data.message)})}async startEdit(t){this.showSection("edit"),De(this.editContainer);let e=await window.$http.get(`/attachments/edit/${t}`);this.editContainer.innerHTML=e.data,window.$components.init(this.editContainer)}stopEdit(){this.showSection("list")}};var pn=class extends g{setup(){this.container=this.$el,this.setupListeners()}setupListeners(){let t=e=>e.key==="Control"||e.key==="Meta";window.addEventListener("keydown",e=>{t(e)&&this.addOpenQueryToLinks()},{passive:!0}),window.addEventListener("keyup",e=>{t(e)&&this.removeOpenQueryFromLinks()},{passive:!0})}addOpenQueryToLinks(){let t=this.container.querySelectorAll("a.attachment-file");for(let e of t)e.href.split("?")[1]!=="open=true"&&(e.href+="?open=true",e.setAttribute("target","_blank"))}removeOpenQueryFromLinks(){let t=this.container.querySelectorAll("a.attachment-file");for(let e of t)e.href=e.href.split("?")[0],e.removeAttribute("target")}};var Te,Er,$e,_r,zt=class{constructor(t,e=null,i=null){ot(this,Te);ot(this,$e);this.containers=[t],this.onEscape=e,this.onEnter=i,t.addEventListener("keydown",L(this,Te,Er).bind(this))}shareHandlingToEl(t){this.containers.push(t),t.addEventListener("keydown",L(this,Te,Er).bind(this))}focusNext(){let t=L(this,$e,_r).call(this),i=t.indexOf(document.activeElement)+1;i>=t.length&&(i=0),t[i].focus()}focusPrevious(){let t=L(this,$e,_r).call(this),i=t.indexOf(document.activeElement)-1;i<0&&(i=t.length-1),t[i].focus()}};Te=new WeakSet,Er=function(t){t.target.matches("input")&&(t.key==="ArrowRight"||t.key==="ArrowLeft")||(t.key==="ArrowDown"||t.key==="ArrowRight"?(this.focusNext(),t.preventDefault()):t.key==="ArrowUp"||t.key==="ArrowLeft"?(this.focusPrevious(),t.preventDefault()):t.key==="Escape"?this.onEscape?this.onEscape(t):document.activeElement&&document.activeElement.blur():t.key==="Enter"&&this.onEnter&&this.onEnter(t))},$e=new WeakSet,_r=function(){let t=[],e='[tabindex]:not([tabindex="-1"]),[href],button:not([tabindex="-1"],[disabled]),input:not([type=hidden])';for(let i of this.containers)t.push(...i.querySelectorAll(e));return t};var Sr={},fn=class extends g{setup(){this.parent=this.$el.parentElement,this.container=this.$el,this.type=this.$opts.type,this.url=this.$opts.url,this.input=this.$refs.input,this.list=this.$refs.list,this.lastPopulated=0,this.setupListeners()}setupListeners(){new zt(this.list,()=>{this.input.focus(),setTimeout(()=>this.hideSuggestions(),1)},e=>{e.preventDefault();let i=e.target.textContent;i&&this.selectSuggestion(i)}).shareHandlingToEl(this.input),K(this.list,".text-item","click",(e,i)=>{this.selectSuggestion(i.textContent)}),this.input.addEventListener("input",this.requestSuggestions.bind(this)),this.input.addEventListener("focus",this.requestSuggestions.bind(this)),this.input.addEventListener("blur",this.hideSuggestionsIfFocusedLost.bind(this)),this.input.addEventListener("keydown",e=>{e.key==="Tab"&&this.hideSuggestions()})}selectSuggestion(t){this.input.value=t,this.lastPopulated=Date.now(),this.input.focus(),this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.input.dispatchEvent(new Event("change",{bubbles:!0})),this.hideSuggestions()}async requestSuggestions(){if(Date.now()-this.lastPopulated<50)return;let t=this.getNameFilterIfNeeded(),e=this.input.value.toLowerCase(),r=(await this.loadSuggestions(e,t)).filter(o=>e===""||o.toLowerCase().startsWith(e)).slice(0,10);this.displaySuggestions(r)}getNameFilterIfNeeded(){return this.type!=="value"?null:this.parent.querySelector("input").value}async loadSuggestions(t,e=null){t=t.slice(0,4);let i={search:t,name:e},r=`${this.url}:${JSON.stringify(i)}`;if(Sr[r])return Sr[r];let o=await window.$http.get(this.url,i);return Sr[r]=o.data,o.data}displaySuggestions(t){if(t.length===0){this.hideSuggestions();return}this.list.innerHTML=t.map(e=>`
  • ${es(e)}
  • `).join(""),this.list.style.display="block";for(let e of this.list.querySelectorAll(".text-item"))e.addEventListener("blur",this.hideSuggestionsIfFocusedLost.bind(this))}hideSuggestions(){this.list.style.display="none"}hideSuggestionsIfFocusedLost(t){this.container.contains(t.relatedTarget)||this.hideSuggestions()}};var mn=class extends g{setup(){this.form=this.$el,this.form.submit()}};var gn=class extends g{setup(){if(this.button=this.$el,this.targetElem=document.getElementById("header"),this.showing=!1,this.breakPoint=1200,document.body.classList.contains("flexbox")){this.button.style.display="none";return}this.button.addEventListener("click",this.scrollToTop.bind(this)),window.addEventListener("scroll",this.onPageScroll.bind(this))}onPageScroll(){let t=document.documentElement.scrollTop||document.body.scrollTop||0;!this.showing&&t>this.breakPoint?(this.button.style.display="block",this.showing=!0,setTimeout(()=>{this.button.style.opacity=.4},1)):this.showing&&t{this.button.style.display="none"},500))}scrollToTop(){let t=this.targetElem.getBoundingClientRect().top,e=document.documentElement.scrollTop?document.documentElement:document.body,i=300,r=Date.now(),o=this.targetElem.getBoundingClientRect().top;function s(){let a=1-(Date.now()-r)/i,l=Math.abs(a*o);a>0?(e.scrollTop=l,requestAnimationFrame(s.bind(this))):e.scrollTop=t}requestAnimationFrame(s.bind(this))}};function rs(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),e.push.apply(e,i)}return e}function At(n){for(var t=1;t=0)&&(e[r]=n[r]);return e}function dh(n,t){if(n==null)return{};var e=hh(n,t),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(e[i]=n[i])}return e}function ph(n){return fh(n)||mh(n)||gh(n)||bh()}function fh(n){if(Array.isArray(n))return Pr(n)}function mh(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function gh(n,t){if(n){if(typeof n=="string")return Pr(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);if(e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set")return Array.from(n);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Pr(n,t)}}function Pr(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e"&&(t=t.substring(1)),n)try{if(n.matches)return n.matches(t);if(n.msMatchesSelector)return n.msMatchesSelector(t);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(t)}catch{return!1}return!1}}function wh(n){return n.host&&n!==document&&n.host.nodeType?n.host:n.parentNode}function xt(n,t,e,i){if(n){e=e||document;do{if(t!=null&&(t[0]===">"?n.parentNode===e&&Dn(n,t):Dn(n,t))||i&&n===e)return n;if(n===e)break}while(n=wh(n))}return null}var ss=/\s+/g;function Y(n,t,e){if(n&&t)if(n.classList)n.classList[e?"add":"remove"](t);else{var i=(" "+n.className+" ").replace(ss," ").replace(" "+t+" "," ");n.className=(i+(e?" "+t:"")).replace(ss," ")}}function S(n,t,e){var i=n&&n.style;if(i){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(e=n.currentStyle),t===void 0?e:e[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=e+(typeof e=="string"?"":"px")}}function Xt(n,t){var e="";if(typeof n=="string")e=n;else do{var i=S(n,"transform");i&&i!=="none"&&(e=i+" "+e)}while(!t&&(n=n.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(e)}function vs(n,t,e){if(n){var i=n.getElementsByTagName(t),r=0,o=i.length;if(e)for(;r=o:s=r<=o,!s)return i;if(i===St())break;i=jt(i,!1)}return!1}function pe(n,t,e,i){for(var r=0,o=0,s=n.children;o2&&arguments[2]!==void 0?arguments[2]:{},r=i.evt,o=dh(i,Sh);Ve.pluginEvent.bind(I)(t,e,At({dragEl:C,parentEl:Z,ghostEl:q,rootEl:V,nextEl:Zt,lastDownEl:En,cloneEl:G,cloneHidden:Ut,dragStarted:Be,putSortable:tt,activeSortable:I.active,originalEvent:r,oldIndex:de,oldDraggableIndex:ze,newIndex:mt,newDraggableIndex:Ht,hideGhostForTarget:_s,unhideGhostForTarget:Ss,cloneNowHidden:function(){Ut=!0},cloneNowShown:function(){Ut=!1},dispatchSortableEvent:function(a){st({sortable:e,name:a,originalEvent:r})}},o))};function st(n){qe(At({putSortable:tt,cloneEl:G,targetEl:C,rootEl:V,oldIndex:de,oldDraggableIndex:ze,newIndex:mt,newDraggableIndex:Ht},n))}var C,Z,q,V,Zt,En,G,Ut,de,mt,ze,Ht,bn,tt,he=!1,Ln=!1,Tn=[],Gt,wt,Tr,$r,us,hs,Be,ce,He,Ue=!1,vn=!1,_n,nt,Ir=[],Or=!1,$n=[],Mn=typeof document<"u",wn=ms,ds=je||Mt?"cssFloat":"float",Ah=Mn&&!gs&&!ms&&"draggable"in document.createElement("div"),ks=function(){if(Mn){if(Mt)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}}(),Cs=function(t,e){var i=S(t),r=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),o=pe(t,0,e),s=pe(t,1,e),a=o&&S(o),l=s&&S(s),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+j(o).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+j(s).width;if(i.display==="flex")return i.flexDirection==="column"||i.flexDirection==="column-reverse"?"vertical":"horizontal";if(i.display==="grid")return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&a.float&&a.float!=="none"){var h=a.float==="left"?"left":"right";return s&&(l.clear==="both"||l.clear===h)?"vertical":"horizontal"}return o&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=r&&i[ds]==="none"||s&&i[ds]==="none"&&c+u>r)?"vertical":"horizontal"},Dh=function(t,e,i){var r=i?t.left:t.top,o=i?t.right:t.bottom,s=i?t.width:t.height,a=i?e.left:e.top,l=i?e.right:e.bottom,c=i?e.width:e.height;return r===a||o===l||r+s/2===a+c/2},Lh=function(t,e){var i;return Tn.some(function(r){var o=r[it].options.emptyInsertThreshold;if(!(!o||Hr(r))){var s=j(r),a=t>=s.left-o&&t<=s.right+o,l=e>=s.top-o&&e<=s.bottom+o;if(a&&l)return i=r}}),i},Es=function(t){function e(o,s){return function(a,l,c,u){var h=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(o==null&&(s||h))return!0;if(o==null||o===!1)return!1;if(s&&o==="clone")return o;if(typeof o=="function")return e(o(a,l,c,u),s)(a,l,c,u);var d=(s?a:l).options.group.name;return o===!0||typeof o=="string"&&o===d||o.join&&o.indexOf(d)>-1}}var i={},r=t.group;(!r||Cn(r)!="object")&&(r={name:r}),i.name=r.name,i.checkPull=e(r.pull,!0),i.checkPut=e(r.put),i.revertClone=r.revertClone,t.group=i},_s=function(){!ks&&q&&S(q,"display","none")},Ss=function(){!ks&&q&&S(q,"display","")};Mn&&!gs&&document.addEventListener("click",function(n){if(Ln)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),Ln=!1,!1},!0);var Kt=function(t){if(C){t=t.touches?t.touches[0]:t;var e=Lh(t.clientX,t.clientY);if(e){var i={};for(var r in t)t.hasOwnProperty(r)&&(i[r]=t[r]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[it]._onDragOver(i)}}},Th=function(t){C&&C.parentNode[it]._isOutsideThisEl(t.target)};function I(n,t){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=t=kt({},t),n[it]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Cs(n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,a){s.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:I.supportPointer!==!1&&"PointerEvent"in window&&!Re,emptyInsertThreshold:5};Ve.initializePlugins(this,n,e);for(var i in e)!(i in t)&&(t[i]=e[i]);Es(t);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=t.forceFallback?!1:Ah,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?O(n,"pointerdown",this._onTapStart):(O(n,"mousedown",this._onTapStart),O(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(O(n,"dragover",this),O(n,"dragenter",this)),Tn.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),kt(this,Ch())}I.prototype={constructor:I,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(ce=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,C):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,i=this.el,r=this.options,o=r.preventOnFilter,s=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,u=r.filter;if(Oh(i),!C&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Re&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=xt(l,r.draggable,i,!1),!(l&&l.animated)&&En!==l)){if(de=J(l),ze=J(l,r.draggable),typeof u=="function"){if(u.call(this,t,l,this)){st({sortable:e,rootEl:c,name:"filter",targetEl:l,toEl:i,fromEl:i}),lt("filter",e,{evt:t}),o&&t.cancelable&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(h){if(h=xt(c,h.trim(),i,!1),h)return st({sortable:e,rootEl:h,name:"filter",targetEl:l,fromEl:i,toEl:i}),lt("filter",e,{evt:t}),!0}),u)){o&&t.cancelable&&t.preventDefault();return}r.handle&&!xt(c,r.handle,i,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,i){var r=this,o=r.el,s=r.options,a=o.ownerDocument,l;if(i&&!C&&i.parentNode===o){var c=j(i);if(V=o,C=i,Z=C.parentNode,Zt=C.nextSibling,En=i,bn=s.group,I.dragged=C,Gt={target:C,clientX:(e||t).clientX,clientY:(e||t).clientY},us=Gt.clientX-c.left,hs=Gt.clientY-c.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,C.style["will-change"]="all",l=function(){if(lt("delayEnded",r,{evt:t}),I.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!os&&r.nativeDraggable&&(C.draggable=!0),r._triggerDragStart(t,e),st({sortable:r,name:"choose",originalEvent:t}),Y(C,s.chosenClass,!0)},s.ignore.split(",").forEach(function(u){vs(C,u.trim(),Mr)}),O(a,"dragover",Kt),O(a,"mousemove",Kt),O(a,"touchmove",Kt),O(a,"mouseup",r._onDrop),O(a,"touchend",r._onDrop),O(a,"touchcancel",r._onDrop),os&&this.nativeDraggable&&(this.options.touchStartThreshold=4,C.draggable=!0),lt("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(je||Mt))){if(I.eventCanceled){this._onDrop();return}O(a,"mouseup",r._disableDelayedDrag),O(a,"touchend",r._disableDelayedDrag),O(a,"touchcancel",r._disableDelayedDrag),O(a,"mousemove",r._delayedDragTouchMoveHandler),O(a,"touchmove",r._delayedDragTouchMoveHandler),s.supportPointer&&O(a,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(l,s.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){C&&Mr(C),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;B(t,"mouseup",this._disableDelayedDrag),B(t,"touchend",this._disableDelayedDrag),B(t,"touchcancel",this._disableDelayedDrag),B(t,"mousemove",this._delayedDragTouchMoveHandler),B(t,"touchmove",this._delayedDragTouchMoveHandler),B(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?O(document,"pointermove",this._onTouchMove):e?O(document,"touchmove",this._onTouchMove):O(document,"mousemove",this._onTouchMove):(O(C,"dragend",this),O(V,"dragstart",this._onDragStart));try{document.selection?Sn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(he=!1,V&&C){lt("dragStarted",this,{evt:e}),this.nativeDraggable&&O(document,"dragover",Th);var i=this.options;!t&&Y(C,i.dragClass,!1),Y(C,i.ghostClass,!0),I.active=this,t&&this._appendGhost(),st({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(wt){this._lastX=wt.clientX,this._lastY=wt.clientY,_s();for(var t=document.elementFromPoint(wt.clientX,wt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(wt.clientX,wt.clientY),t!==e);)e=t;if(C.parentNode[it]._isOutsideThisEl(t),e)do{if(e[it]){var i=void 0;if(i=e[it]._onDragOver({clientX:wt.clientX,clientY:wt.clientY,target:t,rootEl:e}),i&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Ss()}},_onTouchMove:function(t){if(Gt){var e=this.options,i=e.fallbackTolerance,r=e.fallbackOffset,o=t.touches?t.touches[0]:t,s=q&&Xt(q,!0),a=q&&s&&s.a,l=q&&s&&s.d,c=wn&&nt&&ls(nt),u=(o.clientX-Gt.clientX+r.x)/(a||1)+(c?c[0]-Ir[0]:0)/(a||1),h=(o.clientY-Gt.clientY+r.y)/(l||1)+(c?c[1]-Ir[1]:0)/(l||1);if(!I.active&&!he){if(i&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))=0&&(st({rootEl:Z,name:"add",toEl:Z,fromEl:V,originalEvent:t}),st({sortable:this,name:"remove",toEl:Z,originalEvent:t}),st({rootEl:Z,name:"sort",toEl:Z,fromEl:V,originalEvent:t}),st({sortable:this,name:"sort",toEl:Z,originalEvent:t})),tt&&tt.save()):mt!==de&&mt>=0&&(st({sortable:this,name:"update",toEl:Z,originalEvent:t}),st({sortable:this,name:"sort",toEl:Z,originalEvent:t})),I.active&&((mt==null||mt===-1)&&(mt=de,Ht=ze),st({sortable:this,name:"end",toEl:Z,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){lt("nulling",this),V=C=Z=q=Zt=G=En=Ut=Gt=wt=Be=mt=Ht=de=ze=ce=He=tt=bn=I.dragged=I.ghost=I.clone=I.active=null,$n.forEach(function(t){t.checked=!0}),$n.length=Tr=$r=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":C&&(this._onDragOver(t),$h(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,i=this.el.children,r=0,o=i.length,s=this.options;rr.right+o||n.clientY>i.bottom&&n.clientX>i.left:n.clientY>r.bottom+o||n.clientX>i.right&&n.clientY>i.top}function qh(n,t,e,i,r,o,s,a){var l=i?n.clientY:n.clientX,c=i?e.height:e.width,u=i?e.top:e.left,h=i?e.bottom:e.right,d=!1;if(!s){if(a&&_nu+c*o/2:lh-_n)return-He}else if(l>u+c*(1-r)/2&&lh-c*o/2)?l>u+c/2?1:-1:0}function Bh(n){return J(C)1&&(F.forEach(function(a){o.addAnimationState({target:a,rect:ct?j(a):s}),Dr(a),a.fromRect=s,i.removeAnimationState(a)}),ct=!1,Nh(!this.options.removeCloneOnHide,r))},dragOverCompleted:function(e){var i=e.sortable,r=e.isOwner,o=e.insertion,s=e.activeSortable,a=e.parentEl,l=e.putSortable,c=this.options;if(o){if(r&&s._hideClone(),Me=!1,c.animation&&F.length>1&&(ct||!r&&!s.options.sort&&!l)){var u=j(z,!1,!0,!0);F.forEach(function(d){d!==z&&(cs(d,u),a.appendChild(d))}),ct=!0}if(!r)if(ct||kn(),F.length>1){var h=xn;s._showClone(i),s.options.animation&&!xn&&h&&ft.forEach(function(d){s.addAnimationState({target:d,rect:Fe}),d.fromRect=Fe,d.thisAnimationDuration=null})}else s._showClone(i)}},dragOverAnimationCapture:function(e){var i=e.dragRect,r=e.isOwner,o=e.activeSortable;if(F.forEach(function(a){a.thisAnimationDuration=null}),o.options.animation&&!r&&o.multiDrag.isMultiDrag){Fe=kt({},i);var s=Xt(z,!0);Fe.top-=s.f,Fe.left-=s.e}},dragOverAnimationComplete:function(){ct&&(ct=!1,kn())},drop:function(e){var i=e.originalEvent,r=e.rootEl,o=e.parentEl,s=e.sortable,a=e.dispatchSortableEvent,l=e.oldIndex,c=e.putSortable,u=c||this.sortable;if(i){var h=this.options,d=o.children;if(!ue)if(h.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),Y(z,h.selectedClass,!~F.indexOf(z)),~F.indexOf(z))F.splice(F.indexOf(z),1),Ie=null,qe({sortable:s,rootEl:r,name:"deselect",targetEl:z,originalEvent:i});else{if(F.push(z),qe({sortable:s,rootEl:r,name:"select",targetEl:z,originalEvent:i}),i.shiftKey&&Ie&&s.el.contains(Ie)){var f=J(Ie),p=J(z);if(~f&&~p&&f!==p){var m,w;for(p>f?(w=f,m=p):(w=p,m=f+1);w1){var v=j(z),b=J(z,":not(."+this.options.selectedClass+")");if(!Me&&h.animation&&(z.thisAnimationDuration=null),u.captureAnimationState(),!Me&&(h.animation&&(z.fromRect=v,F.forEach(function(x){if(x.thisAnimationDuration=null,x!==z){var E=ct?j(x):v;x.fromRect=E,u.addAnimationState({target:x,rect:E})}})),kn(),F.forEach(function(x){d[b]?o.insertBefore(x,d[b]):o.appendChild(x),b++}),l===J(z))){var k=!1;F.forEach(function(x){if(x.sortableIndex!==J(x)){k=!0;return}}),k&&(a("update"),a("sort"))}F.forEach(function(x){Dr(x)}),u.animateAll()}yt=u}(r===o||c&&c.lastPutMode!=="clone")&&ft.forEach(function(x){x.parentNode&&x.parentNode.removeChild(x)})}},nullingGlobal:function(){this.isMultiDrag=ue=!1,ft.length=0},destroyGlobal:function(){this._deselectMultiDrag(),B(document,"pointerup",this._deselectMultiDrag),B(document,"mouseup",this._deselectMultiDrag),B(document,"touchend",this._deselectMultiDrag),B(document,"keydown",this._checkKeyDown),B(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(typeof ue<"u"&&ue)&&yt===this.sortable&&!(e&&xt(e.target,this.options.draggable,this.sortable.el,!1))&&!(e&&e.button!==0))for(;F.length;){var i=F[0];Y(i,this.options.selectedClass,!1),F.shift(),qe({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:i,originalEvent:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},kt(n,{pluginName:"multiDrag",utils:{select:function(e){var i=e.parentNode[it];!i||!i.options.multiDrag||~F.indexOf(e)||(yt&&yt!==i&&(yt.multiDrag._deselectMultiDrag(),yt=i),Y(e,i.options.selectedClass,!0),F.push(e))},deselect:function(e){var i=e.parentNode[it],r=F.indexOf(e);!i||!i.options.multiDrag||!~r||(Y(e,i.options.selectedClass,!1),F.splice(r,1))}},eventProperties:function(){var e=this,i=[],r=[];return F.forEach(function(o){i.push({multiDragElement:o,index:o.sortableIndex});var s;ct&&o!==z?s=-1:ct?s=J(o,":not(."+e.options.selectedClass+")"):s=J(o),r.push({multiDragElement:o,index:s})}),{items:ph(F),clones:[].concat(ft),oldIndicies:i,newIndicies:r}},optionListeners:{multiDragKey:function(e){return e=e.toLowerCase(),e==="ctrl"?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}function Nh(n,t){F.forEach(function(e,i){var r=t.children[e.sortableIndex+(n?Number(i):0)];r?t.insertBefore(e,r):t.appendChild(e)})}function fs(n,t){ft.forEach(function(e,i){var r=t.children[e.sortableIndex+(n?Number(i):0)];r?t.insertBefore(e,r):t.appendChild(e)})}function kn(){F.forEach(function(n){n!==z&&n.parentNode&&n.parentNode.removeChild(n)})}I.mount(new Rh);I.mount(Vr,jr);var Yt=I;var Ls={name(n,t){let e=n.getAttribute("data-name").trim().toLowerCase(),i=t.getAttribute("data-name").trim().toLowerCase();return e.localeCompare(i)},created(n,t){let e=Number(n.getAttribute("data-created"));return Number(t.getAttribute("data-created"))-e},updated(n,t){let e=Number(n.getAttribute("data-updated"));return Number(t.getAttribute("data-updated"))-e},chaptersFirst(n,t){let e=n.getAttribute("data-type"),i=t.getAttribute("data-type");return e===i?0:e==="chapter"?-1:1},chaptersLast(n,t){let e=n.getAttribute("data-type"),i=t.getAttribute("data-type");return e===i?0:e==="chapter"?1:-1}},Ts={up:{active(n,t){return!(n.previousElementSibling===null&&!t)},run(n,t){(n.previousElementSibling||t).insertAdjacentElement("beforebegin",n)}},down:{active(n,t){return!(n.nextElementSibling===null&&!t)},run(n,t){(n.nextElementSibling||t).insertAdjacentElement("afterend",n)}},next_book:{active(n,t,e){return e.nextElementSibling!==null},run(n,t,e){e.nextElementSibling.querySelector("ul").prepend(n)}},prev_book:{active(n,t,e){return e.previousElementSibling!==null},run(n,t,e){e.previousElementSibling.querySelector("ul").appendChild(n)}},next_chapter:{active(n,t){return n.dataset.type==="page"&&this.getNextChapter(n,t)},run(n,t){this.getNextChapter(n,t).querySelector("ul").prepend(n)},getNextChapter(n,t){let e=t||n,i=Array.from(e.parentElement.children),r=i.indexOf(e);return i.slice(r+1).find(o=>o.dataset.type==="chapter")}},prev_chapter:{active(n,t){return n.dataset.type==="page"&&this.getPrevChapter(n,t)},run(n,t){this.getPrevChapter(n,t).querySelector("ul").append(n)},getPrevChapter(n,t){let e=t||n,i=Array.from(e.parentElement.children),r=i.indexOf(e);return i.slice(0,r).reverse().find(o=>o.dataset.type==="chapter")}},book_end:{active(n,t){return t||t===null&&n.nextElementSibling},run(n,t,e){e.querySelector("ul").append(n)}},book_start:{active(n,t){return t||t===null&&n.previousElementSibling},run(n,t,e){e.querySelector("ul").prepend(n)}},before_chapter:{active(n,t){return t},run(n,t){t.insertAdjacentElement("beforebegin",n)}},after_chapter:{active(n,t){return t},run(n,t){t.insertAdjacentElement("afterend",n)}}},Fn=class extends g{setup(){this.container=this.$el,this.sortContainer=this.$refs.sortContainer,this.input=this.$refs.input,Yt.mount(new Ds);let t=this.container.querySelector(".sort-box");this.setupBookSortable(t),this.setupSortPresets(),this.setupMoveActions(),window.$events.listen("entity-select-change",this.bookSelect.bind(this))}setupMoveActions(){this.container.addEventListener("click",t=>{if(t.target.matches("[data-move]")){let e=t.target.getAttribute("data-move"),i=t.target.closest("[data-id]");this.runSortAction(i,e)}}),this.updateMoveActionStateForAll()}setupSortPresets(){let t="",e=!1,i=["name","created","updated"];this.sortContainer.addEventListener("click",r=>{let o=r.target.closest(".sort-box-options [data-sort]");if(!o)return;r.preventDefault();let s=o.closest(".sort-box").querySelectorAll("ul"),a=o.getAttribute("data-sort");e=t===a?!e:!1;let l=Ls[a];e&&i.includes(a)&&(l=function(u,h){return 0-Ls[a](u,h)});for(let c of s)Array.from(c.children).filter(h=>h.matches("li")).sort(l).forEach(h=>{c.appendChild(h)});t=a,this.updateMapInput()})}bookSelect(t){if(this.container.querySelector(`[data-type="book"][data-id="${t.id}"]`)!==null)return;let i=`${t.link}/sort-item`;window.$http.get(i).then(r=>{let o=_t(r.data);this.sortContainer.append(o),this.setupBookSortable(o),this.updateMoveActionStateForAll(),o.querySelector("summary").focus()})}setupBookSortable(t){let e=Array.from(t.querySelectorAll(".sort-list, .sortable-page-sublist")),i={name:"book",pull:["book","chapter"],put:["book","chapter"]},r={name:"chapter",pull:["book","chapter"],put(o,s,a){return a.getAttribute("data-type")==="page"}};for(let o of e)Yt.create(o,{group:o.classList.contains("sort-list")?i:r,animation:150,fallbackOnBody:!0,swapThreshold:.65,onSort:()=>{this.ensureNoNestedChapters(),this.updateMapInput(),this.updateMoveActionStateForAll()},dragClass:"bg-white",ghostClass:"primary-background-light",multiDrag:!0,multiDragKey:"Control",selectedClass:"sortable-selected"})}ensureNoNestedChapters(){let t=this.container.querySelectorAll('[data-type="chapter"] [data-type="chapter"]');for(let e of t)e.parentElement.closest('[data-type="chapter"]').insertAdjacentElement("afterend",e)}updateMapInput(){let t=this.buildEntityMap();this.input.value=JSON.stringify(t)}buildEntityMap(){let t=[],e=this.container.querySelectorAll(".sort-list");for(let i of e){let r=i.closest('[data-type="book"]').getAttribute("data-id"),o=Array.from(i.children).filter(s=>s.matches('[data-type="page"], [data-type="chapter"]'));for(let s=0;s{for(let s of r)n.style[s]=null;n.style.transition=null,n.removeEventListener("transitionend",o),qn.delete(n),i&&i()};setTimeout(()=>{n.style.transition=`all ease-in-out ${e}ms`;for(let s of r)n.style[s]=t[s][1];n.addEventListener("transitionend",o),qn.set(n,o)},15)}function Ge(n){qn.has(n)&&qn.get(n)()}function $s(n,t=400,e=null){Ge(n),n.style.display="block",We(n,{opacity:["0","1"]},t,()=>{e&&e()})}function Is(n,t=400,e=null){Ge(n),We(n,{opacity:["1","0"]},t,()=>{n.style.display="none",e&&e()})}function fe(n,t=400){Ge(n);let e=n.getBoundingClientRect().height,i=getComputedStyle(n),r=i.getPropertyValue("padding-top"),o=i.getPropertyValue("padding-bottom"),s={maxHeight:[`${e}px`,"0px"],overflow:["hidden","hidden"],paddingTop:[r,"0px"],paddingBottom:[o,"0px"]};We(n,s,t,()=>{n.style.display="none"})}function me(n,t=400){Ge(n),n.style.display="block";let e=n.getBoundingClientRect().height,i=getComputedStyle(n),r=i.getPropertyValue("padding-top"),o=i.getPropertyValue("padding-bottom"),s={maxHeight:["0px",`${e}px`],overflow:["hidden","hidden"],paddingTop:["0px",r],paddingBottom:["0px",o]};We(n,s,t)}function Ms(n,t=400){let e=n.getBoundingClientRect().height,i=getComputedStyle(n),r=i.getPropertyValue("padding-top"),o=i.getPropertyValue("padding-bottom");return()=>{Ge(n);let s=n.getBoundingClientRect().height,a=getComputedStyle(n),l=a.getPropertyValue("padding-top"),c=a.getPropertyValue("padding-bottom"),u={height:[`${e}px`,`${s}px`],overflow:["hidden","hidden"],paddingTop:[r,l],paddingBottom:[o,c]};We(n,u,t)}}var Bn=class extends g{setup(){this.list=this.$refs.list,this.toggle=this.$refs.toggle,this.isOpen=this.toggle.classList.contains("open"),this.toggle.addEventListener("click",this.click.bind(this))}open(){this.toggle.classList.add("open"),this.toggle.setAttribute("aria-expanded","true"),me(this.list,180),this.isOpen=!0}close(){this.toggle.classList.remove("open"),this.toggle.setAttribute("aria-expanded","false"),fe(this.list,180),this.isOpen=!1}click(t){t.preventDefault(),this.isOpen?this.close():this.open()}};var Pn=class extends g{constructor(){super(...arguments);at(this,"editor",null);at(this,"saveCallback",null);at(this,"cancelCallback",null);at(this,"history",{});at(this,"historyKey","code_history")}setup(){this.container=this.$refs.container,this.popup=this.$el,this.editorInput=this.$refs.editor,this.languageButtons=this.$manyRefs.languageButton,this.languageOptionsContainer=this.$refs.languageOptionsContainer,this.saveButton=this.$refs.saveButton,this.languageInput=this.$refs.languageInput,this.historyDropDown=this.$refs.historyDropDown,this.historyList=this.$refs.historyList,this.favourites=new Set(this.$opts.favourites.split(",")),this.setupListeners(),this.setupFavourites()}setupListeners(){this.container.addEventListener("keydown",e=>{e.ctrlKey&&e.key==="Enter"&&this.save()}),R(this.languageButtons,e=>{let i=e.target.dataset.lang;this.languageInput.value=i,this.languageInputChange(i)}),se(this.languageInput,()=>this.save()),this.languageInput.addEventListener("input",()=>this.languageInputChange(this.languageInput.value)),R(this.saveButton,()=>this.save()),K(this.historyList,"button","click",(e,i)=>{e.preventDefault();let r=i.dataset.time;this.editor&&this.editor.setContent(this.history[r])})}setupFavourites(){for(let e of this.languageButtons)this.setupFavouritesForButton(e);this.sortLanguageList()}setupFavouritesForButton(e){let i=e.dataset.lang,r=this.favourites.has(i);e.setAttribute("data-favourite",r?"true":"false"),K(e.parentElement,".lang-option-favorite-toggle","click",()=>{r=!r,r?this.favourites.add(i):this.favourites.delete(i),e.setAttribute("data-favourite",r?"true":"false"),window.$http.patch("/preferences/update-code-language-favourite",{language:i,active:r}),this.sortLanguageList(),r&&e.scrollIntoView({block:"center",behavior:"smooth"})})}sortLanguageList(){let e=this.languageButtons.sort((i,r)=>{let o=i.dataset.favourite==="true",s=r.dataset.favourite==="true";return o&&!s?-1:s&&!o||i.dataset.lang>r.dataset.lang?1:-1}).map(i=>i.parentElement);for(let i of e)this.languageOptionsContainer.append(i)}save(){this.saveCallback&&this.saveCallback(this.editor.getContent(),this.languageInput.value),this.hide()}async open(e,i,r,o){this.languageInput.value=i,this.saveCallback=r,this.cancelCallback=o,await this.show(),this.languageInputChange(i),this.editor.setContent(e)}async show(){let e=await window.importVersioned("code");this.editor||(this.editor=e.popupEditor(this.editorInput,this.languageInput.value)),this.loadHistory(),this.getPopup().show(()=>{this.editor.focus()},()=>{this.addHistory(),this.cancelCallback&&this.cancelCallback()})}hide(){this.getPopup().hide(),this.addHistory()}getPopup(){return window.$components.firstOnElement(this.popup,"popup")}async updateEditorMode(e){this.editor.setMode(e,this.editor.getContent())}languageInputChange(e){this.updateEditorMode(e);let i=e.toLowerCase();for(let r of this.languageButtons){let o=r.dataset.lang.toLowerCase().trim(),s=i===o;r.classList.toggle("active",s),s&&r.scrollIntoView({block:"center",behavior:"smooth"})}}loadHistory(){this.history=JSON.parse(window.sessionStorage.getItem(this.historyKey)||"{}");let e=Object.keys(this.history).reverse();this.historyDropDown.classList.toggle("hidden",e.length===0),this.historyList.innerHTML=e.map(i=>{let r=new Date(parseInt(i,10)).toLocaleTimeString();return`
  • `}).join("")}addHistory(){if(!this.editor)return;let e=this.editor.getContent();if(!e)return;let i=Object.keys(this.history).pop();if(this.history[i]===e)return;this.history[String(Date.now())]=e;let r=JSON.stringify(this.history);window.sessionStorage.setItem(this.historyKey,r)}};var On=class extends g{setup(){let t=this.$el;t.querySelectorAll("pre").length>0&&window.importVersioned("code").then(i=>{i.highlightWithin(t)})}};var Rn=class extends g{async setup(){let{mode:t}=this.$opts;(await window.importVersioned("code")).inlineEditor(this.$el,t)}};var Nn=class extends g{setup(){this.container=this.$el,this.trigger=this.$refs.trigger,this.content=this.$refs.content,this.trigger&&(this.trigger.addEventListener("click",this.toggle.bind(this)),this.openIfContainsError())}open(){this.container.classList.add("open"),this.trigger.setAttribute("aria-expanded","true"),me(this.content,300)}close(){this.container.classList.remove("open"),this.trigger.setAttribute("aria-expanded","false"),fe(this.content,300)}toggle(){this.container.classList.contains("open")?this.close():this.open()}openIfContainsError(){this.content.querySelector(".text-neg.text-small")&&this.open()}};var zn=class extends g{setup(){this.container=this.$el,this.confirmButton=this.$refs.confirm,this.res=null,R(this.confirmButton,()=>{this.sendResult(!0),this.getPopup().hide()})}show(){return this.getPopup().show(null,()=>{this.sendResult(!1)}),new Promise(t=>{this.res=t})}getPopup(){return window.$components.firstOnElement(this.container,"popup")}sendResult(t){this.res&&(this.res(t),this.res=null)}};var Hn=class extends g{setup(){this.container=this.$el,this.checkbox=this.container.querySelector("input[type=checkbox]"),this.display=this.container.querySelector('[role="checkbox"]'),this.checkbox.addEventListener("change",this.stateChange.bind(this)),this.container.addEventListener("keydown",this.onKeyDown.bind(this))}onKeyDown(t){(t.key===" "||t.key==="Enter")&&(t.preventDefault(),this.toggle())}toggle(){this.checkbox.checked=!this.checkbox.checked,this.checkbox.dispatchEvent(new Event("change")),this.stateChange()}stateChange(){let t=this.checkbox.checked?"true":"false";this.display.setAttribute("aria-checked",t)}};var Un=class extends g{setup(){this.container=this.$el,this.dealtWith=!1,this.container.addEventListener("toggle",this.onToggle.bind(this))}onToggle(){this.dealtWith||(this.container.querySelector("pre")&&window.importVersioned("code").then(t=>{t.highlightWithin(this.container)}),this.dealtWith=!0)}};var jn=class extends g{setup(){this.container=this.$el,this.menu=this.$refs.menu,this.toggle=this.$refs.toggle,this.moveMenu=this.$opts.moveMenu,this.bubbleEscapes=this.$opts.bubbleEscapes==="true",this.direction=document.dir==="rtl"?"right":"left",this.body=document.body,this.showing=!1,this.hide=this.hide.bind(this),this.setupListeners()}show(t=null){this.hideAll(),this.menu.style.display="block",this.menu.classList.add("anim","menuIn"),this.toggle.setAttribute("aria-expanded","true");let e=this.menu.getBoundingClientRect(),i=0,r=this.toggle.getBoundingClientRect().height,o=e.bottom>window.innerHeight,s=this.container.getBoundingClientRect();if(this.moveMenu&&(this.body.appendChild(this.menu),this.menu.style.position="fixed",this.menu.style.width=`${e.width}px`,this.menu.style.left=`${e.left}px`,o?i=window.innerHeight-e.top-r/2:i=e.top),o){this.menu.style.top="initial",this.menu.style.bottom=`${i}px`;let c=window.innerHeight-40-(window.innerHeight-s.bottom);this.menu.style.maxHeight=`${Math.floor(c)}px`}else{this.menu.style.top=`${i}px`,this.menu.style.bottom="initial";let c=window.innerHeight-40-s.top;this.menu.style.maxHeight=`${Math.floor(c)}px`}this.menu.addEventListener("mouseleave",this.hide),window.addEventListener("click",c=>{this.menu.contains(c.target)||this.hide()});let a=this.menu.querySelector("input");a!==null&&a.focus(),this.showing=!0;let l=new Event("show");this.container.dispatchEvent(l),t&&t.stopPropagation()}hideAll(){for(let t of window.$components.get("dropdown"))t.hide()}hide(){this.menu.style.display="none",this.menu.classList.remove("anim","menuIn"),this.toggle.setAttribute("aria-expanded","false"),this.menu.style.top="",this.menu.style.bottom="",this.menu.style.maxHeight="",this.moveMenu&&(this.menu.style.position="",this.menu.style[this.direction]="",this.menu.style.width="",this.menu.style.left="",this.container.appendChild(this.menu)),this.showing=!1}setupListeners(){let t=new zt(this.container,e=>{this.hide(),this.toggle.focus(),this.bubbleEscapes||e.stopPropagation()},e=>{e.target.nodeName==="INPUT"&&(e.preventDefault(),e.stopPropagation()),this.hide()});this.moveMenu&&t.shareHandlingToEl(this.menu),this.container.addEventListener("click",e=>{Array.from(this.menu.querySelectorAll("a")).includes(e.target)&&this.hide()}),R(this.toggle,e=>{e.stopPropagation(),e.preventDefault(),this.show(e),e instanceof KeyboardEvent&&t.focusNext()})}};var Vn=class extends g{setup(){this.elem=this.$el,this.searchInput=this.$refs.searchInput,this.loadingElem=this.$refs.loading,this.listContainerElem=this.$refs.listContainer,this.localSearchSelector=this.$opts.localSearchSelector,this.url=this.$opts.url,this.elem.addEventListener("show",this.onShow.bind(this)),this.searchInput.addEventListener("input",this.onSearch.bind(this)),this.runAjaxSearch=Nt(this.runAjaxSearch,300,!1)}onShow(){this.loadList()}onSearch(){let t=this.searchInput.value.toLowerCase().trim();this.localSearchSelector?this.runLocalSearch(t):(this.toggleLoading(!0),this.listContainerElem.innerHTML="",this.runAjaxSearch(t))}runAjaxSearch(t){this.loadList(t)}runLocalSearch(t){let e=this.listContainerElem.querySelectorAll(this.localSearchSelector);for(let i of e){let r=!t||i.textContent.toLowerCase().includes(t);i.style.display=r?"flex":"none",i.classList.toggle("hidden",!r)}}async loadList(t=""){this.listContainerElem.innerHTML="",this.toggleLoading(!0);try{let e=await window.$http.get(this.getAjaxUrl(t)),i=Ms(this.listContainerElem,80);this.listContainerElem.innerHTML=e.data,i()}catch(e){console.error(e)}this.toggleLoading(!1),this.localSearchSelector&&this.onSearch()}getAjaxUrl(t=null){if(!t)return this.url;let e=this.url.includes("?")?"&":"?";return`${this.url}${e}search=${encodeURIComponent(t)}`}toggleLoading(t=!1){this.loadingElem.style.display=t?"block":"none"}};var Ft=class{constructor(t){this.data=t}hasItems(){return!!this.data&&!!this.data.types&&this.data.types.length>0}containsTabularData(){let t=this.data.getData("text/rtf");return t&&t.includes("\\trowd")}getImages(){let{types:t}=this.data,e=[];for(let r of t)if(r.includes("image")){let o=this.data.getData(r);e.push(o.getAsFile())}let i=this.getFiles().filter(r=>r.type.includes("image"));return e.push(...i),e}getFiles(){let{files:t}=this.data;return[...t]}};async function Wr(n){if(window.isSecureContext&&navigator.clipboard){await navigator.clipboard.writeText(n);return}let t=document.createElement("textarea");t.style="position: absolute; left: -1000px; top: -1000px;",t.value=n,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}var Wn=class extends g{setup(){this.container=this.$el,this.statusArea=this.$refs.statusArea,this.dropTarget=this.$refs.dropTarget,this.selectButtons=this.$manyRefs.selectButton||[],this.isActive=!0,this.url=this.$opts.url,this.method=(this.$opts.method||"post").toUpperCase(),this.successMessage=this.$opts.successMessage,this.errorMessage=this.$opts.errorMessage,this.uploadLimitMb=Number(this.$opts.uploadLimit),this.uploadLimitMessage=this.$opts.uploadLimitMessage,this.zoneText=this.$opts.zoneText,this.fileAcceptTypes=this.$opts.fileAccept,this.allowMultiple=this.$opts.allowMultiple==="true",this.setupListeners()}toggleActive(t){this.isActive=t}setupListeners(){R(this.selectButtons,this.manualSelectHandler.bind(this)),this.setupDropTargetHandlers()}setupDropTargetHandlers(){let t=0,e=()=>{this.hideOverlay(),t=0};this.dropTarget.addEventListener("dragenter",i=>{i.preventDefault(),t+=1,t===1&&this.isActive&&this.showOverlay()}),this.dropTarget.addEventListener("dragover",i=>{i.preventDefault()}),this.dropTarget.addEventListener("dragend",e),this.dropTarget.addEventListener("dragleave",()=>{t-=1,t===0&&e()}),this.dropTarget.addEventListener("drop",i=>{if(i.preventDefault(),e(),!this.isActive)return;let o=new Ft(i.dataTransfer).getFiles();for(let s of o)this.createUploadFromFile(s)})}manualSelectHandler(){let t=Et("input",{type:"file",style:"left: -400px; visibility: hidden; position: fixed;",accept:this.fileAcceptTypes,multiple:this.allowMultiple?"":null});this.container.append(t),t.click(),t.addEventListener("change",()=>{for(let e of t.files)this.createUploadFromFile(e);t.remove()})}showOverlay(){if(!this.dropTarget.querySelector(".dropzone-overlay")){let e=Et("div",{class:"dropzone-overlay"},[this.zoneText]);this.dropTarget.append(e)}}hideOverlay(){let t=this.dropTarget.querySelector(".dropzone-overlay");t&&t.remove()}createUploadFromFile(t){let{dom:e,status:i,progress:r,dismiss:o}=this.createDomForFile(t);this.statusArea.append(e);let s=this,a={file:t,dom:e,updateProgress(l){r.textContent=`${l}%`,r.style.width=`${l}%`},markError(l){i.setAttribute("data-status","error"),i.textContent=l,Le(e),this.updateProgress(100)},markSuccess(l){i.setAttribute("data-status","success"),i.textContent=l,Le(e),setTimeout(o,2400),s.$emit("upload-success",{name:t.name})}};return t.size>this.uploadLimitMb*1e6?(a.markError(this.uploadLimitMessage),a):(this.startXhrForUpload(a),a)}startXhrForUpload(t){let e=new FormData;e.append("file",t.file,t.file.name),this.method!=="POST"&&e.append("_method",this.method);let i=this,r=window.$http.createXMLHttpRequest("POST",this.url,{error(){t.markError(i.errorMessage)},readystatechange(){if(this.readyState===XMLHttpRequest.DONE&&this.status===200)t.markSuccess(i.successMessage);else if(this.readyState===XMLHttpRequest.DONE&&this.status>=400){let o=this.responseText,s=o.startsWith("{")?JSON.parse(o):{message:o},a=s?.message||s?.error||o;t.markError(a)}}});r.upload.addEventListener("progress",o=>{let s=Math.min(Math.ceil(o.loaded/o.total*100),100);t.updateProgress(s)}),r.setRequestHeader("Accept","application/json"),r.send(e)}createDomForFile(t){let e=Et("img",{src:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.224 7.373a.924.924 0 0 0-.92.925l-.006 7.404c0 .509.412.925.921.925h5.557a.928.928 0 0 0 .926-.925v-5.553l-2.777-2.776Zm3.239 3.239V8.067l2.545 2.545z' style='fill:%23000;fill-opacity:.75'/%3E%3C/svg%3E"}),i=Et("div",{class:"dropzone-file-item-status"},[]),r=Et("div",{class:"dropzone-file-item-progress"}),o=Et("div",{class:"dropzone-file-item-image-wrap"},[e]),s=Et("div",{class:"dropzone-file-item"},[o,Et("div",{class:"dropzone-file-item-text-wrap"},[Et("div",{class:"dropzone-file-item-label"},[t.name]),ae(),i]),r]);t.type.startsWith("image/")&&(e.src=URL.createObjectURL(t));let a=()=>{s.classList.add("dismiss"),s.addEventListener("animationend",()=>{s.remove()})};return s.addEventListener("click",a),{dom:s,progress:r,status:i,dismiss:a}}};var Gn=class extends g{setup(){this.container=this.$el,this.buttons=this.$manyRefs.tabButton,this.contentElements=this.$manyRefs.tabContent,this.toggleButton=this.$refs.toggle,this.editorWrapEl=this.container.closest(".page-editor"),this.setupListeners(),this.setActiveTab(this.contentElements[0].dataset.tabContent)}setupListeners(){this.toggleButton.addEventListener("click",()=>this.toggle()),this.container.addEventListener("click",t=>{let e=t.target.closest("button");if(this.buttons.includes(e)){let i=e.dataset.tab;this.setActiveTab(i,!0)}})}toggle(){this.container.classList.toggle("open");let t=this.container.classList.contains("open");this.toggleButton.setAttribute("aria-expanded",t?"true":"false"),this.editorWrapEl.classList.toggle("toolbox-open",t)}setActiveTab(t,e=!1){for(let i of this.buttons)i.classList.remove("active"),i.dataset.tab===t&&i.classList.add("active");for(let i of this.contentElements)i.style.display="none",i.dataset.tabContent===t&&(i.style.display="block");e&&!this.container.classList.contains("open")&&this.toggle()}};var Kn=class extends g{setup(){this.container=this.$el,this.entityType=this.$opts.entityType,this.everyoneInheritToggle=this.$refs.everyoneInherit,this.roleSelect=this.$refs.roleSelect,this.roleContainer=this.$refs.roleContainer,this.setupListeners()}setupListeners(){this.everyoneInheritToggle.addEventListener("change",t=>{let e=t.target.checked,i=document.querySelectorAll('input[name^="permissions[0]["]');for(let r of i)r.disabled=e,r.checked=!1}),this.container.addEventListener("click",t=>{let e=t.target.closest("button");e&&e.dataset.roleId&&this.removeRowOnButtonClick(e)}),this.roleSelect.addEventListener("change",()=>{let t=this.roleSelect.value;t&&this.addRoleRow(t)})}async addRoleRow(t){this.roleSelect.disabled=!0;let e=this.roleSelect.querySelector(`option[value="${t}"]`);e&&e.remove();let i=await window.$http.get(`/permissions/form-row/${this.entityType}/${t}`),r=_t(i.data);this.roleContainer.append(r),this.roleSelect.disabled=!1}removeRowOnButtonClick(t){let e=t.closest(".item-list-row"),{roleId:i}=t.dataset,{roleName:r}=t.dataset,o=document.createElement("option");o.value=i,o.textContent=r,this.roleSelect.append(o),e.remove()}};var Zn=class extends g{setup(){this.entityId=this.$opts.entityId,this.entityType=this.$opts.entityType,this.contentView=this.$refs.contentView,this.searchView=this.$refs.searchView,this.searchResults=this.$refs.searchResults,this.searchInput=this.$refs.searchInput,this.searchForm=this.$refs.searchForm,this.clearButton=this.$refs.clearButton,this.loadingBlock=this.$refs.loadingBlock,this.setupListeners()}setupListeners(){this.searchInput.addEventListener("change",this.runSearch.bind(this)),this.searchForm.addEventListener("submit",t=>{t.preventDefault(),this.runSearch()}),R(this.clearButton,this.clearSearch.bind(this))}runSearch(){let t=this.searchInput.value.trim();if(t.length===0){this.clearSearch();return}this.searchView.classList.remove("hidden"),this.contentView.classList.add("hidden"),this.loadingBlock.classList.remove("hidden");let e=window.baseUrl(`/search/${this.entityType}/${this.entityId}`);window.$http.get(e,{term:t}).then(i=>{this.searchResults.innerHTML=i.data}).catch(console.error).then(()=>{this.loadingBlock.classList.add("hidden")})}clearSearch(){this.searchView.classList.add("hidden"),this.contentView.classList.remove("hidden"),this.loadingBlock.classList.add("hidden"),this.searchInput.value=""}};var Xn=class extends g{setup(){this.elem=this.$el,this.input=this.$refs.input,this.searchInput=this.$refs.search,this.loading=this.$refs.loading,this.resultsContainer=this.$refs.results,this.searchOptions={entityTypes:this.$opts.entityTypes||"page,book,chapter",entityPermission:this.$opts.entityPermission||"view",searchEndpoint:this.$opts.searchEndpoint||""},this.search="",this.lastClick=0,this.setupListeners(),this.showLoading(),this.searchOptions.searchEndpoint&&this.initialLoad()}configureSearchOptions(t){Object.assign(this.searchOptions,t),this.reset()}setupListeners(){this.elem.addEventListener("click",this.onClick.bind(this));let t=0;this.searchInput.addEventListener("input",()=>{t=Date.now(),this.showLoading(),setTimeout(()=>{Date.now()-t<199||this.searchEntities(this.searchInput.value)},200)}),this.searchInput.addEventListener("keydown",e=>{e.keyCode===13&&e.preventDefault()}),K(this.$el,"[data-entity-type]","keydown",e=>{if(e.ctrlKey&&e.code==="Enter"){let i=this.$el.closest("form");if(i){i.submit(),e.preventDefault();return}}e.code==="ArrowDown"&&this.focusAdjacent(!0),e.code==="ArrowUp"&&this.focusAdjacent(!1)}),this.searchInput.addEventListener("keydown",e=>{e.code==="ArrowDown"&&this.focusAdjacent(!0)})}focusAdjacent(t=!0){let e=Array.from(this.resultsContainer.querySelectorAll("[data-entity-type]")),i=e.indexOf(document.activeElement),r=e[i+(t?1:-1)]||e[0];r&&r.focus()}reset(){this.searchInput.value="",this.showLoading(),this.initialLoad()}focusSearch(){this.searchInput.focus()}searchText(t){this.searchInput.value=t,this.searchEntities(t)}showLoading(){this.loading.style.display="block",this.resultsContainer.style.display="none"}hideLoading(){this.loading.style.display="none",this.resultsContainer.style.display="block"}initialLoad(){if(!this.searchOptions.searchEndpoint)throw new Error("Search endpoint not set for entity-selector load");window.$http.get(this.searchUrl()).then(t=>{this.resultsContainer.innerHTML=t.data,this.hideLoading()})}searchUrl(){let t=`types=${encodeURIComponent(this.searchOptions.entityTypes)}&permission=${encodeURIComponent(this.searchOptions.entityPermission)}`;return`${this.searchOptions.searchEndpoint}?${t}`}searchEntities(t){if(!this.searchOptions.searchEndpoint)throw new Error("Search endpoint not set for entity-selector load");this.input.value="";let e=`${this.searchUrl()}&term=${encodeURIComponent(t)}`;window.$http.get(e).then(i=>{this.resultsContainer.innerHTML=i.data,this.hideLoading()})}isDoubleClick(){let t=Date.now(),e=t-this.lastClick<300;return this.lastClick=t,e}onClick(t){let e=t.target.closest("[data-entity-type]");e&&(t.preventDefault(),t.stopPropagation(),this.selectItem(e))}selectItem(t){let e=this.isDoubleClick(),i=t.getAttribute("data-entity-type"),r=t.getAttribute("data-entity-id"),o=!t.classList.contains("selected")||e;this.unselectAll(),this.input.value=o?`${i}:${r}`:"";let s=t.getAttribute("href"),a=t.querySelector(".entity-list-item-name").textContent,l={id:Number(r),name:a,link:s};o?t.classList.add("selected"):window.$events.emit("entity-select-change",null),!(!e&&!o)&&(e&&this.confirmSelection(l),o&&window.$events.emit("entity-select-change",l))}confirmSelection(t){window.$events.emit("entity-select-confirm",t)}unselectAll(){let t=this.elem.querySelectorAll(".selected");for(let e of t)e.classList.remove("selected","primary-background")}};var Yn=class extends g{setup(){this.container=this.$el,this.selectButton=this.$refs.select,this.selectorEl=this.$refs.selector,this.callback=null,this.selection=null,this.selectButton.addEventListener("click",this.onSelectButtonClick.bind(this)),window.$events.listen("entity-select-change",this.onSelectionChange.bind(this)),window.$events.listen("entity-select-confirm",this.handleConfirmedSelection.bind(this))}show(t,e="",i={}){this.callback=t,this.getSelector().configureSearchOptions(i),this.getPopup().show(),e&&this.getSelector().searchText(e),this.getSelector().focusSearch()}hide(){this.getPopup().hide()}getPopup(){return window.$components.firstOnElement(this.container,"popup")}getSelector(){return window.$components.firstOnElement(this.selectorEl,"entity-selector")}onSelectButtonClick(){this.handleConfirmedSelection(this.selection)}onSelectionChange(t){this.selection=t,t===null?this.selectButton.setAttribute("disabled","true"):this.selectButton.removeAttribute("disabled")}handleConfirmedSelection(t){this.hide(),this.getSelector().reset(),this.callback&&t&&this.callback(t)}};var Jn=class extends g{setup(){this.container=this.$el,this.name=this.$opts.name,R(this.$el,()=>{this.$emit(this.name,this.$opts)})}};var Qn=class extends g{setup(){this.targetSelector=this.$opts.targetSelector,this.isOpen=this.$opts.isOpen==="true",this.updateEndpoint=this.$opts.updateEndpoint,this.$el.addEventListener("click",this.click.bind(this))}open(t){me(t,200)}close(t){fe(t,200)}click(t){t.preventDefault();let e=document.querySelectorAll(this.targetSelector);for(let i of e)(this.isOpen?this.close:this.open)(i);this.isOpen=!this.isOpen,this.updateSystemAjax(this.isOpen)}updateSystemAjax(t){window.$http.patch(this.updateEndpoint,{expand:t?"true":"false"})}};var ti=class extends g{setup(){this.container=this.$el,this.input=this.$refs.input,this.suggestions=this.$refs.suggestions,this.suggestionResultsWrap=this.$refs.suggestionResults,this.loadingWrap=this.$refs.loading,this.button=this.$refs.button,this.setupListeners()}setupListeners(){let t=Nt(this.updateSuggestions.bind(this),200,!1);this.input.addEventListener("input",()=>{let{value:e}=this.input;e.length>0?(this.loadingWrap.style.display="block",this.suggestionResultsWrap.style.opacity="0.5",t(e)):this.hideSuggestions()}),this.input.addEventListener("dblclick",()=>{this.input.setAttribute("autocomplete","on"),this.button.focus(),this.input.focus()}),new zt(this.container,()=>{this.hideSuggestions()})}async updateSuggestions(t){let{data:e}=await window.$http.get("/search/suggest",{term:t});if(!this.input.value)return;let i=_t(e);this.suggestionResultsWrap.innerHTML="",this.suggestionResultsWrap.style.opacity="1",this.loadingWrap.style.display="none",this.suggestionResultsWrap.append(i),this.container.classList.contains("search-active")||this.showSuggestions()}showSuggestions(){this.container.classList.add("search-active"),window.requestAnimationFrame(()=>{this.suggestions.classList.add("search-suggestions-animation")})}hideSuggestions(){this.container.classList.remove("search-active"),this.suggestions.classList.remove("search-suggestions-animation"),this.suggestionResultsWrap.innerHTML=""}};var ei=class extends g{setup(){this.elem=this.$el,this.toggleButton=this.$refs.toggle,this.menu=this.$refs.menu,this.open=!1,this.toggleButton.addEventListener("click",this.onToggle.bind(this)),this.onWindowClick=this.onWindowClick.bind(this),this.onKeyDown=this.onKeyDown.bind(this)}onToggle(t){this.open=!this.open,this.menu.classList.toggle("show",this.open),this.toggleButton.setAttribute("aria-expanded",this.open?"true":"false"),this.open?(this.elem.addEventListener("keydown",this.onKeyDown),window.addEventListener("click",this.onWindowClick)):(this.elem.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("click",this.onWindowClick)),t.stopPropagation()}onKeyDown(t){t.code==="Escape"&&this.onToggle(t)}onWindowClick(t){this.onToggle(t)}};var ni=class extends g{setup(){this.uploadedTo=this.$opts.uploadedTo,this.container=this.$el,this.popupEl=this.$refs.popup,this.searchForm=this.$refs.searchForm,this.searchInput=this.$refs.searchInput,this.cancelSearch=this.$refs.cancelSearch,this.listContainer=this.$refs.listContainer,this.filterTabs=this.$manyRefs.filterTabs,this.selectButton=this.$refs.selectButton,this.uploadButton=this.$refs.uploadButton,this.uploadHint=this.$refs.uploadHint,this.formContainer=this.$refs.formContainer,this.formContainerPlaceholder=this.$refs.formContainerPlaceholder,this.dropzoneContainer=this.$refs.dropzoneContainer,this.loadMore=this.$refs.loadMore,this.type="gallery",this.lastSelected={},this.lastSelectedTime=0,this.callback=null,this.resetState=()=>{this.hasData=!1,this.page=1,this.filter="all"},this.resetState(),this.setupListeners()}setupListeners(){R(this.filterTabs,i=>{this.resetAll(),this.filter=i.target.dataset.filter,this.setActiveFilterTab(this.filter),this.loadGallery()}),this.searchForm.addEventListener("submit",i=>{this.resetListView(),this.loadGallery(),this.cancelSearch.toggleAttribute("hidden",!this.searchInput.value),i.preventDefault()}),R(this.cancelSearch,()=>{this.resetListView(),this.resetSearchView(),this.loadGallery()}),K(this.container,".load-more button","click",this.runLoadMore.bind(this)),this.listContainer.addEventListener("event-emit-select-image",this.onImageSelectEvent.bind(this)),this.listContainer.addEventListener("error",i=>{i.target.src=window.baseUrl("loading_error.png")},!0),R(this.selectButton,()=>{this.callback&&this.callback(this.lastSelected),this.hide()}),K(this.formContainer,"#image-manager-delete","click",()=>{this.lastSelected&&this.loadImageEditForm(this.lastSelected.id,!0)}),K(this.formContainer,"#image-manager-rebuild-thumbs","click",async(i,r)=>{r.disabled=!0,this.lastSelected&&await this.rebuildThumbnails(this.lastSelected.id),r.disabled=!1}),this.formContainer.addEventListener("ajax-form-success",()=>{this.refreshGallery(),this.resetEditForm()}),this.container.addEventListener("dropzone-upload-success",this.refreshGallery.bind(this));let t=this.listContainer.parentElement,e=[];t.addEventListener("wheel",i=>{if(!(Math.ceil(t.scrollHeight-t.scrollTop)===t.clientHeight)||i.deltaY<1)return;let s=Date.now()-1e3;e.push(Date.now()),e=e.filter(a=>a>=s),e.length>5&&this.canLoadMore()&&this.runLoadMore()})}show(t,e="gallery"){this.resetAll(),this.callback=t,this.type=e,this.getPopup().show();let i=e!=="gallery";this.dropzoneContainer.classList.toggle("hidden",i),this.uploadButton.classList.toggle("hidden",i),this.uploadHint.classList.toggle("hidden",i),window.$components.firstOnElement(this.container,"dropzone").toggleActive(!i),this.hasData||(this.loadGallery(),this.hasData=!0)}hide(){this.getPopup().hide()}getPopup(){return window.$components.firstOnElement(this.popupEl,"popup")}async loadGallery(){let t={page:this.page,search:this.searchInput.value||null,uploaded_to:this.uploadedTo,filter_type:this.filter==="all"?null:this.filter},{data:e}=await window.$http.get(`images/${this.type}`,t);t.page===1&&(this.listContainer.innerHTML=""),this.addReturnedHtmlElementsToList(e),Le(this.listContainer)}addReturnedHtmlElementsToList(t){let e=document.createElement("div");e.innerHTML=t;let i=e.querySelector(".load-more");i&&(i.remove(),this.loadMore.innerHTML=i.innerHTML),this.loadMore.toggleAttribute("hidden",!i),window.$components.init(e);for(let r of[...e.children])this.listContainer.appendChild(r)}setActiveFilterTab(t){for(let e of this.filterTabs){let i=e.dataset.filter===t;e.setAttribute("aria-selected",i?"true":"false")}}resetAll(){this.resetState(),this.resetListView(),this.resetSearchView(),this.resetEditForm(),this.setActiveFilterTab("all"),this.selectButton.classList.add("hidden")}resetSearchView(){this.searchInput.value="",this.cancelSearch.toggleAttribute("hidden",!0)}resetEditForm(){this.formContainer.innerHTML="",this.formContainerPlaceholder.removeAttribute("hidden")}resetListView(){De(this.listContainer),this.page=1}refreshGallery(){this.resetListView(),this.loadGallery()}async onImageSelectEvent(t){let e=JSON.parse(t.detail.data),i=e&&e.id===this.lastSelected.id&&Date.now()-this.lastSelectedTime<400,r=t.target.classList.contains("selected");[...this.listContainer.querySelectorAll(".selected")].forEach(o=>{o.classList.remove("selected")}),!r&&!i?(t.target.classList.add("selected"),e=await this.loadImageEditForm(e.id)):i?i&&(e=this.lastSelected):this.resetEditForm(),this.selectButton.classList.toggle("hidden",r),i&&this.callback&&(this.callback(e),this.hide()),this.lastSelected=e,this.lastSelectedTime=Date.now()}async loadImageEditForm(t,e=!1){e||(this.formContainer.innerHTML="");let i=e?{delete:!0}:{},{data:r}=await window.$http.get(`/images/edit/${t}`,i);this.formContainer.innerHTML=r,this.formContainerPlaceholder.setAttribute("hidden",""),window.$components.init(this.formContainer);let o=this.formContainer.querySelector("#image-manager-form-image-data");return JSON.parse(o.text)}runLoadMore(){De(this.loadMore),this.page+=1,this.loadGallery()}canLoadMore(){return this.loadMore.querySelector("button")&&!this.loadMore.hasAttribute("hidden")}async rebuildThumbnails(t){try{let e=await window.$http.put(`/images/${t}/rebuild-thumbnails`);window.$events.success(e.data),this.refreshGallery()}catch(e){window.$events.showResponseError(e)}}};var ii=class extends g{setup(){this.imageElem=this.$refs.image,this.imageInput=this.$refs.imageInput,this.resetInput=this.$refs.resetInput,this.removeInput=this.$refs.removeInput,this.resetButton=this.$refs.resetButton,this.removeButton=this.$refs.removeButton||null,this.defaultImage=this.$opts.defaultImage,this.setupListeners()}setupListeners(){this.resetButton.addEventListener("click",this.reset.bind(this)),this.removeButton&&this.removeButton.addEventListener("click",this.removeImage.bind(this)),this.imageInput.addEventListener("change",this.fileInputChange.bind(this))}fileInputChange(){this.resetInput.setAttribute("disabled","disabled"),this.removeInput&&this.removeInput.setAttribute("disabled","disabled");for(let t of this.imageInput.files)this.imageElem.src=window.URL.createObjectURL(t);this.imageElem.classList.remove("none")}reset(){this.imageInput.value="",this.imageElem.src=this.defaultImage,this.resetInput.removeAttribute("disabled"),this.removeInput&&this.removeInput.setAttribute("disabled","disabled"),this.imageElem.classList.remove("none")}removeImage(){this.imageInput.value="",this.imageElem.classList.add("none"),this.removeInput.removeAttribute("disabled"),this.resetInput.setAttribute("disabled","disabled")}};var ri=class extends g{setup(){this.elem=this.$el,this.menu=this.$refs.menu,this.sortInput=this.$refs.sort,this.orderInput=this.$refs.order,this.form=this.$refs.form,this.setupListeners()}setupListeners(){this.menu.addEventListener("click",t=>{t.target.closest("[data-sort-value]")!==null&&this.sortOptionClick(t)}),this.elem.addEventListener("click",t=>{t.target.closest("[data-sort-dir]")!==null&&this.sortDirectionClick(t)})}sortOptionClick(t){let e=t.target.closest("[data-sort-value]");this.sortInput.value=e.getAttribute("data-sort-value"),t.preventDefault(),this.form.submit()}sortDirectionClick(t){let e=this.orderInput.value;this.orderInput.value=e==="asc"?"desc":"asc",t.preventDefault(),this.form.submit()}};var jc=Go(Oc()),Vc=Go(Uc()),wi=class{constructor(){this.renderer=new jc.default({html:!0}),this.renderer.use(Vc.default,{label:!0})}getRenderer(){return this.renderer}render(t){return this.renderer.render(t)}};function hf(n,t){return document.createElement(n,t)}function df(n,t,e){return document.createElementNS(n,t,e)}function pf(){return te(document.createDocumentFragment())}function ff(n){return document.createTextNode(n)}function mf(n){return document.createComment(n)}function gf(n,t,e){if(qt(n)){let i=n;for(;i&&qt(i);)i=te(i).parent;n=i??n}qt(t)&&(t=te(t,n)),e&&qt(e)&&(e=te(e).firstChildNode),n.insertBefore(t,e)}function bf(n,t){n.removeChild(t)}function vf(n,t){qt(t)&&(t=te(t,n)),n.appendChild(t)}function Wc(n){if(qt(n)){for(;n&&qt(n);)n=te(n).parent;return n??null}return n.parentNode}function wf(n){var t;if(qt(n)){let e=te(n),i=Wc(e);if(i&&e.lastChildNode){let r=Array.from(i.childNodes),o=r.indexOf(e.lastChildNode);return(t=r[o+1])!==null&&t!==void 0?t:null}return null}return n.nextSibling}function yf(n){return n.tagName}function xf(n,t){n.textContent=t}function kf(n){return n.textContent}function Cf(n){return n.nodeType===1}function Ef(n){return n.nodeType===3}function _f(n){return n.nodeType===8}function qt(n){return n.nodeType===11}function te(n,t){var e,i,r;let o=n;return(e=o.parent)!==null&&e!==void 0||(o.parent=t??null),(i=o.firstChildNode)!==null&&i!==void 0||(o.firstChildNode=n.firstChild),(r=o.lastChildNode)!==null&&r!==void 0||(o.lastChildNode=n.lastChild),o}var yi={createElement:hf,createElementNS:df,createTextNode:ff,createDocumentFragment:pf,createComment:mf,insertBefore:gf,removeChild:bf,appendChild:vf,parentNode:Wc,nextSibling:wf,tagName:yf,setTextContent:xf,getTextContent:kf,isElement:Cf,isText:Ef,isComment:_f,isDocumentFragment:qt};function Bt(n,t,e,i,r){let o=t===void 0?void 0:t.key;return{sel:n,data:t,children:e,text:i,elm:r,key:o}}var Gc=Array.isArray;function Kc(n){return typeof n=="string"||typeof n=="number"||n instanceof String||n instanceof Number}function Eo(n){return n===void 0}function ut(n){return n!==void 0}var _o=Bt("",{},[],void 0,void 0);function Je(n,t){var e,i;let r=n.key===t.key,o=((e=n.data)===null||e===void 0?void 0:e.is)===((i=t.data)===null||i===void 0?void 0:i.is),s=n.sel===t.sel,a=!n.sel&&n.sel===t.sel?typeof n.text==typeof t.text:!0;return s&&r&&o&&a}function Af(){throw new Error("The document fragment is not supported on this platform.")}function Df(n,t){return n.isElement(t)}function Lf(n,t){return n.isDocumentFragment(t)}function Tf(n,t,e){var i;let r={};for(let o=t;o<=e;++o){let s=(i=n[o])===null||i===void 0?void 0:i.key;s!==void 0&&(r[s]=o)}return r}var $f=["create","update","remove","destroy","pre","post"];function So(n,t,e){let i={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},r=t!==void 0?t:yi;for(let p of $f)for(let m of n){let w=m[p];w!==void 0&&i[p].push(w)}function o(p){let m=p.id?"#"+p.id:"",w=p.getAttribute("class"),v=w?"."+w.split(" ").join("."):"";return Bt(r.tagName(p).toLowerCase()+m+v,{},[],void 0,p)}function s(p){return Bt(void 0,{},[],void 0,p)}function a(p,m){return function(){if(--m===0){let v=r.parentNode(p);r.removeChild(v,p)}}}function l(p,m){var w,v,b,k;let x,E=p.data;if(E!==void 0){let D=(w=E.hook)===null||w===void 0?void 0:w.init;ut(D)&&(D(p),E=p.data)}let y=p.children,A=p.sel;if(A==="!")Eo(p.text)&&(p.text=""),p.elm=r.createComment(p.text);else if(A!==void 0){let D=A.indexOf("#"),M=A.indexOf(".",D),T=D>0?D:A.length,P=M>0?M:A.length,H=D!==-1||M!==-1?A.slice(0,Math.min(T,P)):A,U=p.elm=ut(E)&&ut(x=E.ns)?r.createElementNS(x,H,E):r.createElement(H,E);for(T0&&U.setAttribute("class",A.slice(P+1).replace(/\./g," ")),x=0;x0&&(u.attrs=l),Object.keys(c).length>0&&(u.dataset=c),a[0]==="s"&&a[1]==="v"&&a[2]==="g"&&(a.length===3||a[3]==="."||a[3]==="#")&&Ao(u,h,a),Bt(a,u,h,void 0,n)}else return e.isText(n)?(i=e.getTextContent(n),Bt(void 0,void 0,void 0,i,n)):e.isComment(n)?(i=e.getTextContent(n),Bt("!",{},[],i,n)):Bt("",{},[],void 0,n)}var If="http://www.w3.org/1999/xlink",Mf="http://www.w3.org/XML/1998/namespace";function Zc(n,t){let e,i=t.elm,r=n.data.attrs,o=t.data.attrs;if(!(!r&&!o)&&r!==o){r=r||{},o=o||{};for(e in o){let s=o[e];r[e]!==s&&(s===!0?i.setAttribute(e,""):s===!1?i.removeAttribute(e):e.charCodeAt(0)!==120?i.setAttribute(e,s):e.charCodeAt(3)===58?i.setAttributeNS(Mf,e,s):e.charCodeAt(5)===58?i.setAttributeNS(If,e,s):i.setAttribute(e,s))}for(e in r)e in o||i.removeAttribute(e)}}var Do={create:Zc,update:Zc};var xi;function Ff(){return xi||(xi=So([Do]),xi)}function Xc(n,t){let e=document.createElement("div");e.innerHTML=t,Ff()(Qe(n),Qe(e))}var ki=class{constructor(t){this.editor=t,this.container=t.config.displayEl,this.doc=null,this.lastDisplayClick=0,this.container.contentDocument.readyState==="complete"?this.onLoad():this.container.addEventListener("load",this.onLoad.bind(this)),this.updateVisibility(t.settings.get("showPreview")),t.settings.onChange("showPreview",e=>this.updateVisibility(e))}updateVisibility(t){let e=this.container.closest(".markdown-editor-wrap");e.style.display=t?null:"none"}onLoad(){this.doc=this.container.contentDocument,this.loadStylesIntoDisplay(),this.doc.body.className="page-content",this.doc.addEventListener("click",this.onDisplayClick.bind(this))}onDisplayClick(t){let e=Date.now()-this.lastDisplayClick<300,i=t.target.closest("a");if(i!==null){t.preventDefault(),window.open(i.getAttribute("href"));return}let r=t.target.closest("[drawio-diagram]");if(r!==null&&e){this.editor.actions.editDrawing(r);return}this.lastDisplayClick=Date.now()}loadStylesIntoDisplay(){this.doc.documentElement.classList.add("markdown-editor-display"),document.documentElement.classList.contains("dark-mode")&&(this.doc.documentElement.style.backgroundColor="#222",this.doc.documentElement.classList.add("dark-mode")),this.doc.head.innerHTML="";let t=document.head.querySelectorAll("style,link[rel=stylesheet]");for(let e of t){let i=e.cloneNode(!0);this.doc.head.appendChild(i)}}patchWithHtml(t){let{body:e}=this.doc;if(e.children.length===0){let r=document.createElement("div");this.doc.body.append(r)}let i=e.children[0];Xc(i,t)}scrollToIndex(t){let e=this.doc.body?.children[0]?.children;if(e&&e.length<=t)return;(t===-1?e[e.length-1]:e[t]).scrollIntoView({block:"start",inline:"nearest",behavior:"smooth"})}};function Ci(n){return new Promise((t,e)=>{n.oncomplete=n.onsuccess=()=>t(n.result),n.onabort=n.onerror=()=>e(n.error)})}function qf(n,t){let e=indexedDB.open(n);e.onupgradeneeded=()=>e.result.createObjectStore(t);let i=Ci(e);return(r,o)=>i.then(s=>o(s.transaction(t,r).objectStore(t)))}var Lo;function To(){return Lo||(Lo=qf("keyval-store","keyval")),Lo}function $o(n,t=To()){return t("readonly",e=>Ci(e.get(n)))}function Io(n,t,e=To()){return e("readwrite",i=>(i.put(t,n),Ci(i.transaction)))}function Mo(n,t=To()){return t("readwrite",e=>(e.delete(n),Ci(e.transaction)))}var $t=null,Bo,Ei,Fo,qo="last-drawing-save";function Po(n){$t.contentWindow.postMessage(JSON.stringify(n),Bo)}function Pf(n){Io(qo,n.data),Fo&&Fo(n.data).then(()=>{Mo(qo)})}function Of(n){Po({action:"export",format:"xmlpng",xml:n.xml,spin:"Updating drawing"})}function Rf(){Ei&&Ei().then(n=>{Po({action:"load",autosave:1,xml:n})})}function Nf(){let n={};window.$events.emitPublic($t,"editor-drawio::configure",{config:n}),Po({action:"configure",config:n})}function Yc(){window.removeEventListener("message",Jc),$t&&document.body.removeChild($t)}function Jc(n){if(!n.data||n.data.length<1||n.origin!==Bo)return;let t=JSON.parse(n.data);t.event==="init"?Rf():t.event==="exit"?Yc():t.event==="save"?Of(t):t.event==="export"?Pf(t):t.event==="configure"&&Nf()}async function zf(){let n=await $o(qo),t=document.getElementById("unsaved-drawing-dialog");t||console.error("Missing expected unsaved-drawing dialog"),n&&await window.$components.firstOnElement(t,"confirm-dialog").show()&&(Ei=async()=>n)}async function tn(n,t,e){Ei=t,Fo=e,await zf(),$t=document.createElement("iframe"),$t.setAttribute("frameborder","0"),window.addEventListener("message",Jc),$t.setAttribute("src",n),$t.setAttribute("class","fullscreen"),$t.style.backgroundColor="#FFFFFF",document.body.appendChild($t),Bo=new URL(n).origin}async function Oo(n,t){let e={image:n,uploaded_to:t};return(await window.$http.post(window.baseUrl("/images/drawio"),e)).data}function ee(){Yc()}async function _i(n){try{return`data:image/png;base64,${(await window.$http.get(window.baseUrl(`/images/drawio/base64/${n}`))).data.content}`}catch(t){throw t instanceof window.$http.HttpError&&window.$events.showResponseError(t),ee(),t}}var en,Ro,xe,Si,ke,Ai,Pt,ne,Wt,ye,rt,ht,nn,No,rn,zo,Ce,Di,dt,vt,Ti,tu,Li=class{constructor(t){ot(this,en);ot(this,xe);ot(this,ke);ot(this,Pt);ot(this,Wt);ot(this,rt);ot(this,nn);ot(this,rn);ot(this,Ce);ot(this,dt);ot(this,Ti);this.editor=t,this.lastContent={html:"",markdown:""}}updateAndRender(){let t=L(this,xe,Si).call(this);this.editor.config.inputEl.value=t;let e=this.editor.markdown.render(t);window.$events.emit("editor-html-change",""),window.$events.emit("editor-markdown-change",""),this.lastContent.html=e,this.lastContent.markdown=t,this.editor.display.patchWithHtml(e)}getContent(){return this.lastContent}showImageInsert(){window.$components.first("image-manager").show(e=>{let i=e.thumbs?.display||e.url,o=`[![${L(this,Wt,ye).call(this)||e.name}](${i})](${e.url})`;L(this,Pt,ne).call(this,o,o.length)},"gallery")}insertImage(){let t=`![${L(this,Wt,ye).call(this)}](http://)`;L(this,Pt,ne).call(this,t,t.length-1)}insertLink(){let t=L(this,Wt,ye).call(this),e=`[${t}]()`,i=t===""?-3:-1;L(this,Pt,ne).call(this,e,e.length+i)}showImageManager(){let t=L(this,rt,ht).call(this);window.$components.first("image-manager").show(i=>{L(this,en,Ro).call(this,i,t)},"drawio")}showLinkSelector(){let t=L(this,rt,ht).call(this),e=window.$components.first("entity-selector-popup"),i=L(this,Wt,ye).call(this,t);e.show(r=>{let s=`[${i||r.name}](${r.link})`;L(this,Pt,ne).call(this,s,s.length,t)},i,{searchEndpoint:"/search/entity-selector",entityTypes:"page,book,chapter,bookshelf",entityPermission:"view"})}startDrawing(){let t=this.editor.config.drawioUrl;if(!t)return;let e=L(this,rt,ht).call(this);tn(t,()=>Promise.resolve(""),async i=>{let r={image:i,uploaded_to:Number(this.editor.config.pageId)};try{let o=await window.$http.post("/images/drawio",r);L(this,en,Ro).call(this,o.data,e),ee()}catch(o){throw this.handleDrawingUploadError(o),new Error(`Failed to save image with error: ${o}`)}})}editDrawing(t){let{drawioUrl:e}=this.editor.config;if(!e)return;let i=L(this,rt,ht).call(this),r=t.getAttribute("drawio-diagram");tn(e,()=>_i(r),async o=>{let s={image:o,uploaded_to:Number(this.editor.config.pageId)};try{let a=await window.$http.post("/images/drawio",s),l=`
    `,c=L(this,xe,Si).call(this).split(` +`);dr(t)}}function Xu(n){n.status&&n.status>=400&&n.data&&n.data.message&&dr(n.data.message)}var fr={};Se(fr,{HttpError:()=>sn,createXMLHttpRequest:()=>Ju,delete:()=>ih,get:()=>Qu,patch:()=>nh,post:()=>th,put:()=>eh});async function Yu(n){if(n.status===204)return null;let e=(n.headers.get("Content-Type")||"").split(";")[0].split("/").pop();return e==="javascript"||e==="json"?n.json():n.text()}var sn=class extends Error{constructor(t,e){super(t.statusText),this.data=e,this.headers=t.headers,this.redirected=t.redirected,this.status=t.status,this.statusText=t.statusText,this.url=t.url,this.original=t}};function Ju(n,t,e={}){let i=document.querySelector("meta[name=token]").getAttribute("content"),r=new XMLHttpRequest;for(let[o,s]of Object.entries(e))r.addEventListener(o,s.bind(r));return r.open(n,t),r.withCredentials=!0,r.setRequestHeader("X-CSRF-TOKEN",i),r}async function Ko(n,t={}){let e=n;if(e.startsWith("http")||(e=window.baseUrl(e)),t.params){let l=new URL(e);for(let c of Object.keys(t.params)){let u=t.params[c];typeof u<"u"&&u!==null&&l.searchParams.set(c,u)}e=l.toString()}let i=document.querySelector("meta[name=token]").getAttribute("content"),r={...t,credentials:"same-origin"};r.headers={...r.headers||{},baseURL:window.baseUrl(""),"X-CSRF-TOKEN":i};let o=await fetch(e,r),s=await Yu(o),a={data:s,headers:o.headers,redirected:o.redirected,status:o.status,statusText:o.statusText,url:o.url,original:o};if(!o.ok)throw new sn(o,s);return a}async function an(n,t,e=null){let i={method:n,body:e};return typeof e=="object"&&!(e instanceof FormData)&&(i.headers={"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},i.body=JSON.stringify(e)),e instanceof FormData&&n!=="post"&&(e.append("_method",n),i.method="post"),Ko(t,i)}async function Qu(n,t={}){return Ko(n,{method:"GET",params:t})}async function th(n,t=null){return an("POST",n,t)}async function eh(n,t=null){return an("PUT",n,t)}async function nh(n,t=null){return an("PATCH",n,t)}async function ih(n,t=null){return an("DELETE",n,t)}var mr=class{constructor(){this.store=new Map,this.parseTranslations()}parseTranslations(){let t=document.querySelectorAll('meta[name="translation"]');for(let e of t){let i=e.getAttribute("key"),r=e.getAttribute("value");this.store.set(i,r)}}get(t,e){let i=this.getTransText(t);return this.performReplacements(i,e)}getPlural(t,e,i){let r=this.getTransText(t);return this.parsePlural(r,e,i)}parsePlural(t,e,i){let r=t.split("|"),o=/^{([0-9]+)}/,s=/^\[([0-9]+),([0-9*]+)]/,a=null;for(let l of r){let c=l.match(o);if(c!==null&&Number(c[1])===e){a=l.replace(o,"").trim();break}let u=l.match(s);if(u!==null&&Number(u[1])<=e&&(u[2]==="*"||Number(u[2])>=e)){a=l.replace(s,"").trim();break}}return a===null&&r.length>1&&(a=e===1?r[0]:r[1]),a===null&&(a=r[0]),this.performReplacements(a,i)}getTransText(t){let e=this.store.get(t);return e===void 0&&console.warn(`Translation with key "${t}" does not exist`),e}performReplacements(t,e){if(!e)return t;let i=t.match(/:(\S+)/g);if(i===null)return t;let r=t;return i.forEach(o=>{let s=o.substring(1);typeof e[s]>"u"||(r=r.replace(o,e[s]))}),r}},Zo=mr;var yr={};Se(yr,{first:()=>ah,firstOnElement:()=>ch,get:()=>lh,init:()=>vr,register:()=>wr});function gr(n){let t=i=>i.slice(0,1).toUpperCase()+i.slice(1),e=n.split("-");return e[0]+e.slice(1).map(t).join("")}function Xo(n){return n.replace(/[A-Z]/g,(t,e)=>(e>0?"-":"")+t.toLowerCase())}var Ae={},Yo={},br=new WeakMap;function rh(n,t){let e={},i={},r=`${n}@`,o=`[refs*="${r}"]`,s=[...t.querySelectorAll(o)];t.matches(o)&&s.push(t);for(let a of s){let l=a.getAttribute("refs").split(" ").filter(c=>c.startsWith(r)).map(c=>c.replace(r,"")).map(gr);for(let c of l)e[c]=a,typeof i[c]>"u"&&(i[c]=[]),i[c].push(a)}return{refs:e,manyRefs:i}}function oh(n,t){let e={},i=`option:${n}:`;for(let{name:r,value:o}of t.attributes)if(r.startsWith(i)){let s=r.replace(i,"");e[gr(s)]=o||""}return e}function sh(n,t){let e=Yo[n];if(e===void 0)return;let i;try{i=new e,i.$name=n,i.$el=t;let o=rh(n,t);i.$refs=o.refs,i.$manyRefs=o.manyRefs,i.$opts=oh(n,t),i.setup()}catch(o){console.error("Failed to create component",o,n,t)}typeof Ae[n]>"u"&&(Ae[n]=[]),Ae[n].push(i);let r=br.get(t)||{};r[n]=i,br.set(t,r)}function vr(n=document){let t=n.querySelectorAll("[component],[components]");for(let e of t){let i=`${e.getAttribute("component")||""} ${e.getAttribute("components")}`.toLowerCase().split(" ").filter(Boolean);for(let r of i)sh(r,e)}}function wr(n){let t=Object.keys(n);for(let e of t)Yo[Xo(e)]=n[e]}function ah(n){return(Ae[n]||[null])[0]}function lh(n){return Ae[n]||[]}function ch(n,t){return(br.get(n)||{})[t]||null}var jo={};Se(jo,{AddRemoveRows:()=>cn,AjaxDeleteRow:()=>un,AjaxForm:()=>hn,Attachments:()=>dn,AttachmentsList:()=>pn,AutoSubmit:()=>mn,AutoSuggest:()=>fn,BackToTop:()=>gn,BookSort:()=>Fn,ChapterContents:()=>Bn,CodeEditor:()=>Pn,CodeHighlighter:()=>On,CodeTextarea:()=>Rn,Collapsible:()=>Nn,ConfirmDialog:()=>zn,CustomCheckbox:()=>Hn,DetailsHighlighter:()=>Un,Dropdown:()=>jn,DropdownSearch:()=>Vn,Dropzone:()=>Wn,EditorToolbox:()=>Gn,EntityPermissions:()=>Kn,EntitySearch:()=>Zn,EntitySelector:()=>Xn,EntitySelectorPopup:()=>Yn,EventEmitSelect:()=>Jn,ExpandToggle:()=>Qn,GlobalSearch:()=>ti,HeaderMobileToggle:()=>ei,ImageManager:()=>ni,ImagePicker:()=>ii,ListSortControl:()=>ri,MarkdownEditor:()=>Mi,NewUserPassword:()=>Fi,Notification:()=>qi,OptionalInput:()=>Bi,PageComment:()=>Pi,PageComments:()=>Oi,PageDisplay:()=>Ri,PageEditor:()=>Ni,PagePicker:()=>Hi,PermissionsTable:()=>Ui,Pointer:()=>ji,Popup:()=>Vi,SettingAppColorScheme:()=>Wi,SettingColorPicker:()=>Gi,SettingHomepageControl:()=>Ki,ShelfSort:()=>Zi,ShortcutInput:()=>Yi,Shortcuts:()=>Xi,SortableList:()=>Ji,SubmitOnChange:()=>Qi,Tabs:()=>tr,TagManager:()=>er,TemplateManager:()=>nr,ToggleSwitch:()=>ir,TriLayout:()=>rr,UserSelect:()=>or,WebhookEvents:()=>sr,WysiwygEditor:()=>cr,WysiwygInput:()=>ur});function Et(n,t={},e=[]){let i=document.createElement(n);for(let[r,o]of Object.entries(t))o===null?i.removeAttribute(r):i.setAttribute(r,o);for(let r of e)typeof r=="string"?i.append(document.createTextNode(r)):i.append(r);return i}function xr(n,t){let e=document.querySelectorAll(n);for(let i of e)t(i)}function ln(n,t,e){for(let i of t)n.addEventListener(i,e)}function R(n,t){Array.isArray(n)||(n=[n]);for(let e of n)e.addEventListener("click",t),e.addEventListener("keydown",i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),t(i))})}function Jo(n,t,e){Array.isArray(t)||(t=[t]);let i=r=>{r.key===n&&e(r)};t.forEach(r=>r.addEventListener("keydown",i))}function se(n,t){Jo("Enter",n,t)}function Qo(n,t){Jo("Escape",n,t)}function K(n,t,e,i){n.addEventListener(e,r=>{let o=r.target.closest(t);o&&i.call(o,r,o)})}function ts(n,t){let e=document.querySelectorAll(n);t=t.toLowerCase();for(let i of e)if(i.textContent.toLowerCase().includes(t))return i;return null}function De(n){n.innerHTML='
    '}function ae(){let n=document.createElement("div");return n.classList.add("loading-container"),n.innerHTML="
    ",n}function Le(n){let t=n.querySelectorAll(".loading-container");for(let e of t)e.remove()}function _t(n){let t=document.createElement("div");return t.innerHTML=n,window.$components.init(t),t.children[0]}function Nt(n,t,e){let i;return function(...o){let s=this,a=function(){i=null,e||n.apply(s,o)},l=e&&!i;clearTimeout(i),i=setTimeout(a,t),l&&n.apply(s,o)}}function Cr(n){if(!n)return;let t=n.closest("details");t&&!t.open&&(t.open=!0),n.scrollIntoView({behavior:"smooth"});let e=getComputedStyle(document.body).getPropertyValue("--color-link");n.style.outline=`2px dashed ${e}`,n.style.outlineOffset="5px",n.style.transition=null,setTimeout(()=>{n.style.transition="outline linear 3s",n.style.outline="2px dashed rgba(0, 0, 0, 0)";let i=()=>{n.removeEventListener("transitionend",i),n.style.transition=null,n.style.outline=null,n.style.outlineOffset=null};n.addEventListener("transitionend",i)},1e3)}function es(n){return n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function ns(){let n=()=>((1+Math.random())*65536|0).toString(16).substring(1);return`${n()+n()}-${n()}-${n()}-${n()}-${n()}${n()}${n()}`}function is(n){return new Promise(t=>{setTimeout(t,n)})}var g=class{constructor(){at(this,"$name","");at(this,"$el",null);at(this,"$refs",{});at(this,"$manyRefs",{});at(this,"$opts",{})}setup(){}$emit(t,e={}){e.from=this;let i=this.$name,r=new CustomEvent(`${i}-${t}`,{bubbles:!0,detail:e});this.$el.dispatchEvent(r)}};var cn=class extends g{setup(){this.modelRow=this.$refs.model,this.addButton=this.$refs.add,this.removeSelector=this.$opts.removeSelector,this.rowSelector=this.$opts.rowSelector,this.setupListeners()}setupListeners(){this.addButton.addEventListener("click",this.add.bind(this)),K(this.$el,this.removeSelector,"click",t=>{t.target.closest(this.rowSelector).remove()})}add(){let t=this.modelRow.cloneNode(!0);t.classList.remove("hidden"),this.setClonedInputNames(t),this.modelRow.parentNode.insertBefore(t,this.modelRow),window.$components.init(t)}setClonedInputNames(t){let e=ns(),i=t.querySelectorAll('[name*="randrowid"]');for(let r of i)r.name=r.name.split("randrowid").join(e)}};var un=class extends g{setup(){this.row=this.$el,this.url=this.$opts.url,this.deleteButtons=this.$manyRefs.delete,R(this.deleteButtons,this.runDelete.bind(this))}runDelete(){this.row.style.opacity="0.7",this.row.style.pointerEvents="none",window.$http.delete(this.url).then(t=>{typeof t.data=="object"&&t.data.message&&window.$events.emit("success",t.data.message),this.row.remove()}).catch(()=>{this.row.style.opacity=null,this.row.style.pointerEvents=null})}};var hn=class extends g{setup(){this.container=this.$el,this.responseContainer=this.container,this.url=this.$opts.url,this.method=this.$opts.method||"post",this.successMessage=this.$opts.successMessage,this.submitButtons=this.$manyRefs.submit||[],this.$opts.responseContainer&&(this.responseContainer=this.container.closest(this.$opts.responseContainer)),this.setupListeners()}setupListeners(){if(this.container.tagName==="FORM"){this.container.addEventListener("submit",this.submitRealForm.bind(this));return}se(this.container,t=>{this.submitFakeForm(),t.preventDefault()}),this.submitButtons.forEach(t=>R(t,this.submitFakeForm.bind(this)))}submitFakeForm(){let t=new FormData,e=this.container.querySelectorAll("[name]");for(let i of e)t.append(i.getAttribute("name"),i.value);this.submit(t)}submitRealForm(t){t.preventDefault();let e=new FormData(this.container);this.submit(e)}async submit(t){this.responseContainer.style.opacity="0.7",this.responseContainer.style.pointerEvents="none";try{let e=await window.$http[this.method.toLowerCase()](this.url,t);this.$emit("success",{formData:t}),this.responseContainer.innerHTML=e.data,this.successMessage&&window.$events.emit("success",this.successMessage)}catch(e){this.responseContainer.innerHTML=e.data}window.$components.init(this.responseContainer),this.responseContainer.style.opacity=null,this.responseContainer.style.pointerEvents=null}};var dn=class extends g{setup(){this.container=this.$el,this.pageId=this.$opts.pageId,this.editContainer=this.$refs.editContainer,this.listContainer=this.$refs.listContainer,this.linksContainer=this.$refs.linksContainer,this.listPanel=this.$refs.listPanel,this.attachLinkButton=this.$refs.attachLinkButton,this.setupListeners()}setupListeners(){let t=this.reloadList.bind(this);this.container.addEventListener("dropzone-upload-success",t),this.container.addEventListener("ajax-form-success",t),this.container.addEventListener("sortable-list-sort",e=>{this.updateOrder(e.detail.ids)}),this.container.addEventListener("event-emit-select-edit",e=>{this.startEdit(e.detail.id)}),this.container.addEventListener("event-emit-select-edit-back",()=>{this.stopEdit()}),this.container.addEventListener("event-emit-select-insert",e=>{let i=e.target.closest("[data-drag-content]").getAttribute("data-drag-content"),r=JSON.parse(i);window.$events.emit("editor::insert",{html:r["text/html"],markdown:r["text/plain"]})}),this.attachLinkButton.addEventListener("click",()=>{this.showSection("links")})}showSection(t){let e={links:this.linksContainer,edit:this.editContainer,list:this.listContainer};for(let[i,r]of Object.entries(e))r.toggleAttribute("hidden",i!==t)}reloadList(){this.stopEdit(),window.$http.get(`/attachments/get/page/${this.pageId}`).then(t=>{this.listPanel.innerHTML=t.data,window.$components.init(this.listPanel)})}updateOrder(t){window.$http.put(`/attachments/sort/page/${this.pageId}`,{order:t}).then(e=>{window.$events.emit("success",e.data.message)})}async startEdit(t){this.showSection("edit"),De(this.editContainer);let e=await window.$http.get(`/attachments/edit/${t}`);this.editContainer.innerHTML=e.data,window.$components.init(this.editContainer)}stopEdit(){this.showSection("list")}};var pn=class extends g{setup(){this.container=this.$el,this.fileLinks=this.$manyRefs.linkTypeFile,this.setupListeners()}setupListeners(){let t=e=>e.key==="Control"||e.key==="Meta";window.addEventListener("keydown",e=>{t(e)&&this.addOpenQueryToLinks()},{passive:!0}),window.addEventListener("keyup",e=>{t(e)&&this.removeOpenQueryFromLinks()},{passive:!0})}addOpenQueryToLinks(){for(let t of this.fileLinks)t.href.split("?")[1]!=="open=true"&&(t.href+="?open=true",t.setAttribute("target","_blank"))}removeOpenQueryFromLinks(){for(let t of this.fileLinks)t.href=t.href.split("?")[0],t.removeAttribute("target")}};var Te,Er,$e,_r,zt=class{constructor(t,e=null,i=null){ot(this,Te);ot(this,$e);this.containers=[t],this.onEscape=e,this.onEnter=i,t.addEventListener("keydown",L(this,Te,Er).bind(this))}shareHandlingToEl(t){this.containers.push(t),t.addEventListener("keydown",L(this,Te,Er).bind(this))}focusNext(){let t=L(this,$e,_r).call(this),i=t.indexOf(document.activeElement)+1;i>=t.length&&(i=0),t[i].focus()}focusPrevious(){let t=L(this,$e,_r).call(this),i=t.indexOf(document.activeElement)-1;i<0&&(i=t.length-1),t[i].focus()}};Te=new WeakSet,Er=function(t){t.target.matches("input")&&(t.key==="ArrowRight"||t.key==="ArrowLeft")||(t.key==="ArrowDown"||t.key==="ArrowRight"?(this.focusNext(),t.preventDefault()):t.key==="ArrowUp"||t.key==="ArrowLeft"?(this.focusPrevious(),t.preventDefault()):t.key==="Escape"?this.onEscape?this.onEscape(t):document.activeElement&&document.activeElement.blur():t.key==="Enter"&&this.onEnter&&this.onEnter(t))},$e=new WeakSet,_r=function(){let t=[],e='[tabindex]:not([tabindex="-1"]),[href],button:not([tabindex="-1"],[disabled]),input:not([type=hidden])';for(let i of this.containers)t.push(...i.querySelectorAll(e));return t};var Sr={},fn=class extends g{setup(){this.parent=this.$el.parentElement,this.container=this.$el,this.type=this.$opts.type,this.url=this.$opts.url,this.input=this.$refs.input,this.list=this.$refs.list,this.lastPopulated=0,this.setupListeners()}setupListeners(){new zt(this.list,()=>{this.input.focus(),setTimeout(()=>this.hideSuggestions(),1)},e=>{e.preventDefault();let i=e.target.textContent;i&&this.selectSuggestion(i)}).shareHandlingToEl(this.input),K(this.list,".text-item","click",(e,i)=>{this.selectSuggestion(i.textContent)}),this.input.addEventListener("input",this.requestSuggestions.bind(this)),this.input.addEventListener("focus",this.requestSuggestions.bind(this)),this.input.addEventListener("blur",this.hideSuggestionsIfFocusedLost.bind(this)),this.input.addEventListener("keydown",e=>{e.key==="Tab"&&this.hideSuggestions()})}selectSuggestion(t){this.input.value=t,this.lastPopulated=Date.now(),this.input.focus(),this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.input.dispatchEvent(new Event("change",{bubbles:!0})),this.hideSuggestions()}async requestSuggestions(){if(Date.now()-this.lastPopulated<50)return;let t=this.getNameFilterIfNeeded(),e=this.input.value.toLowerCase(),r=(await this.loadSuggestions(e,t)).filter(o=>e===""||o.toLowerCase().startsWith(e)).slice(0,10);this.displaySuggestions(r)}getNameFilterIfNeeded(){return this.type!=="value"?null:this.parent.querySelector("input").value}async loadSuggestions(t,e=null){t=t.slice(0,4);let i={search:t,name:e},r=`${this.url}:${JSON.stringify(i)}`;if(Sr[r])return Sr[r];let o=await window.$http.get(this.url,i);return Sr[r]=o.data,o.data}displaySuggestions(t){if(t.length===0){this.hideSuggestions();return}this.list.innerHTML=t.map(e=>`
  • ${es(e)}
  • `).join(""),this.list.style.display="block";for(let e of this.list.querySelectorAll(".text-item"))e.addEventListener("blur",this.hideSuggestionsIfFocusedLost.bind(this))}hideSuggestions(){this.list.style.display="none"}hideSuggestionsIfFocusedLost(t){this.container.contains(t.relatedTarget)||this.hideSuggestions()}};var mn=class extends g{setup(){this.form=this.$el,this.form.submit()}};var gn=class extends g{setup(){if(this.button=this.$el,this.targetElem=document.getElementById("header"),this.showing=!1,this.breakPoint=1200,document.body.classList.contains("flexbox")){this.button.style.display="none";return}this.button.addEventListener("click",this.scrollToTop.bind(this)),window.addEventListener("scroll",this.onPageScroll.bind(this))}onPageScroll(){let t=document.documentElement.scrollTop||document.body.scrollTop||0;!this.showing&&t>this.breakPoint?(this.button.style.display="block",this.showing=!0,setTimeout(()=>{this.button.style.opacity=.4},1)):this.showing&&t{this.button.style.display="none"},500))}scrollToTop(){let t=this.targetElem.getBoundingClientRect().top,e=document.documentElement.scrollTop?document.documentElement:document.body,i=300,r=Date.now(),o=this.targetElem.getBoundingClientRect().top;function s(){let a=1-(Date.now()-r)/i,l=Math.abs(a*o);a>0?(e.scrollTop=l,requestAnimationFrame(s.bind(this))):e.scrollTop=t}requestAnimationFrame(s.bind(this))}};function rs(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),e.push.apply(e,i)}return e}function At(n){for(var t=1;t=0)&&(e[r]=n[r]);return e}function dh(n,t){if(n==null)return{};var e=hh(n,t),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(e[i]=n[i])}return e}function ph(n){return fh(n)||mh(n)||gh(n)||bh()}function fh(n){if(Array.isArray(n))return Pr(n)}function mh(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function gh(n,t){if(n){if(typeof n=="string")return Pr(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);if(e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set")return Array.from(n);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Pr(n,t)}}function Pr(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e"&&(t=t.substring(1)),n)try{if(n.matches)return n.matches(t);if(n.msMatchesSelector)return n.msMatchesSelector(t);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(t)}catch{return!1}return!1}}function wh(n){return n.host&&n!==document&&n.host.nodeType?n.host:n.parentNode}function xt(n,t,e,i){if(n){e=e||document;do{if(t!=null&&(t[0]===">"?n.parentNode===e&&Dn(n,t):Dn(n,t))||i&&n===e)return n;if(n===e)break}while(n=wh(n))}return null}var ss=/\s+/g;function Y(n,t,e){if(n&&t)if(n.classList)n.classList[e?"add":"remove"](t);else{var i=(" "+n.className+" ").replace(ss," ").replace(" "+t+" "," ");n.className=(i+(e?" "+t:"")).replace(ss," ")}}function S(n,t,e){var i=n&&n.style;if(i){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(e=n.currentStyle),t===void 0?e:e[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=e+(typeof e=="string"?"":"px")}}function Xt(n,t){var e="";if(typeof n=="string")e=n;else do{var i=S(n,"transform");i&&i!=="none"&&(e=i+" "+e)}while(!t&&(n=n.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(e)}function vs(n,t,e){if(n){var i=n.getElementsByTagName(t),r=0,o=i.length;if(e)for(;r=o:s=r<=o,!s)return i;if(i===St())break;i=jt(i,!1)}return!1}function pe(n,t,e,i){for(var r=0,o=0,s=n.children;o2&&arguments[2]!==void 0?arguments[2]:{},r=i.evt,o=dh(i,Sh);Ve.pluginEvent.bind(I)(t,e,At({dragEl:C,parentEl:Z,ghostEl:q,rootEl:V,nextEl:Zt,lastDownEl:En,cloneEl:G,cloneHidden:Ut,dragStarted:Be,putSortable:tt,activeSortable:I.active,originalEvent:r,oldIndex:de,oldDraggableIndex:ze,newIndex:mt,newDraggableIndex:Ht,hideGhostForTarget:_s,unhideGhostForTarget:Ss,cloneNowHidden:function(){Ut=!0},cloneNowShown:function(){Ut=!1},dispatchSortableEvent:function(a){st({sortable:e,name:a,originalEvent:r})}},o))};function st(n){qe(At({putSortable:tt,cloneEl:G,targetEl:C,rootEl:V,oldIndex:de,oldDraggableIndex:ze,newIndex:mt,newDraggableIndex:Ht},n))}var C,Z,q,V,Zt,En,G,Ut,de,mt,ze,Ht,bn,tt,he=!1,Ln=!1,Tn=[],Gt,wt,Tr,$r,us,hs,Be,ce,He,Ue=!1,vn=!1,_n,nt,Ir=[],Or=!1,$n=[],Mn=typeof document<"u",wn=ms,ds=je||Mt?"cssFloat":"float",Ah=Mn&&!gs&&!ms&&"draggable"in document.createElement("div"),ks=function(){if(Mn){if(Mt)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}}(),Cs=function(t,e){var i=S(t),r=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),o=pe(t,0,e),s=pe(t,1,e),a=o&&S(o),l=s&&S(s),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+j(o).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+j(s).width;if(i.display==="flex")return i.flexDirection==="column"||i.flexDirection==="column-reverse"?"vertical":"horizontal";if(i.display==="grid")return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&a.float&&a.float!=="none"){var h=a.float==="left"?"left":"right";return s&&(l.clear==="both"||l.clear===h)?"vertical":"horizontal"}return o&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=r&&i[ds]==="none"||s&&i[ds]==="none"&&c+u>r)?"vertical":"horizontal"},Dh=function(t,e,i){var r=i?t.left:t.top,o=i?t.right:t.bottom,s=i?t.width:t.height,a=i?e.left:e.top,l=i?e.right:e.bottom,c=i?e.width:e.height;return r===a||o===l||r+s/2===a+c/2},Lh=function(t,e){var i;return Tn.some(function(r){var o=r[it].options.emptyInsertThreshold;if(!(!o||Hr(r))){var s=j(r),a=t>=s.left-o&&t<=s.right+o,l=e>=s.top-o&&e<=s.bottom+o;if(a&&l)return i=r}}),i},Es=function(t){function e(o,s){return function(a,l,c,u){var h=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(o==null&&(s||h))return!0;if(o==null||o===!1)return!1;if(s&&o==="clone")return o;if(typeof o=="function")return e(o(a,l,c,u),s)(a,l,c,u);var d=(s?a:l).options.group.name;return o===!0||typeof o=="string"&&o===d||o.join&&o.indexOf(d)>-1}}var i={},r=t.group;(!r||Cn(r)!="object")&&(r={name:r}),i.name=r.name,i.checkPull=e(r.pull,!0),i.checkPut=e(r.put),i.revertClone=r.revertClone,t.group=i},_s=function(){!ks&&q&&S(q,"display","none")},Ss=function(){!ks&&q&&S(q,"display","")};Mn&&!gs&&document.addEventListener("click",function(n){if(Ln)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),Ln=!1,!1},!0);var Kt=function(t){if(C){t=t.touches?t.touches[0]:t;var e=Lh(t.clientX,t.clientY);if(e){var i={};for(var r in t)t.hasOwnProperty(r)&&(i[r]=t[r]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[it]._onDragOver(i)}}},Th=function(t){C&&C.parentNode[it]._isOutsideThisEl(t.target)};function I(n,t){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=t=kt({},t),n[it]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Cs(n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,a){s.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:I.supportPointer!==!1&&"PointerEvent"in window&&!Re,emptyInsertThreshold:5};Ve.initializePlugins(this,n,e);for(var i in e)!(i in t)&&(t[i]=e[i]);Es(t);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=t.forceFallback?!1:Ah,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?O(n,"pointerdown",this._onTapStart):(O(n,"mousedown",this._onTapStart),O(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(O(n,"dragover",this),O(n,"dragenter",this)),Tn.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),kt(this,Ch())}I.prototype={constructor:I,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(ce=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,C):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,i=this.el,r=this.options,o=r.preventOnFilter,s=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,u=r.filter;if(Oh(i),!C&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Re&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=xt(l,r.draggable,i,!1),!(l&&l.animated)&&En!==l)){if(de=J(l),ze=J(l,r.draggable),typeof u=="function"){if(u.call(this,t,l,this)){st({sortable:e,rootEl:c,name:"filter",targetEl:l,toEl:i,fromEl:i}),lt("filter",e,{evt:t}),o&&t.cancelable&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(h){if(h=xt(c,h.trim(),i,!1),h)return st({sortable:e,rootEl:h,name:"filter",targetEl:l,fromEl:i,toEl:i}),lt("filter",e,{evt:t}),!0}),u)){o&&t.cancelable&&t.preventDefault();return}r.handle&&!xt(c,r.handle,i,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,i){var r=this,o=r.el,s=r.options,a=o.ownerDocument,l;if(i&&!C&&i.parentNode===o){var c=j(i);if(V=o,C=i,Z=C.parentNode,Zt=C.nextSibling,En=i,bn=s.group,I.dragged=C,Gt={target:C,clientX:(e||t).clientX,clientY:(e||t).clientY},us=Gt.clientX-c.left,hs=Gt.clientY-c.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,C.style["will-change"]="all",l=function(){if(lt("delayEnded",r,{evt:t}),I.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!os&&r.nativeDraggable&&(C.draggable=!0),r._triggerDragStart(t,e),st({sortable:r,name:"choose",originalEvent:t}),Y(C,s.chosenClass,!0)},s.ignore.split(",").forEach(function(u){vs(C,u.trim(),Mr)}),O(a,"dragover",Kt),O(a,"mousemove",Kt),O(a,"touchmove",Kt),O(a,"mouseup",r._onDrop),O(a,"touchend",r._onDrop),O(a,"touchcancel",r._onDrop),os&&this.nativeDraggable&&(this.options.touchStartThreshold=4,C.draggable=!0),lt("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(je||Mt))){if(I.eventCanceled){this._onDrop();return}O(a,"mouseup",r._disableDelayedDrag),O(a,"touchend",r._disableDelayedDrag),O(a,"touchcancel",r._disableDelayedDrag),O(a,"mousemove",r._delayedDragTouchMoveHandler),O(a,"touchmove",r._delayedDragTouchMoveHandler),s.supportPointer&&O(a,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(l,s.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){C&&Mr(C),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;B(t,"mouseup",this._disableDelayedDrag),B(t,"touchend",this._disableDelayedDrag),B(t,"touchcancel",this._disableDelayedDrag),B(t,"mousemove",this._delayedDragTouchMoveHandler),B(t,"touchmove",this._delayedDragTouchMoveHandler),B(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?O(document,"pointermove",this._onTouchMove):e?O(document,"touchmove",this._onTouchMove):O(document,"mousemove",this._onTouchMove):(O(C,"dragend",this),O(V,"dragstart",this._onDragStart));try{document.selection?Sn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(he=!1,V&&C){lt("dragStarted",this,{evt:e}),this.nativeDraggable&&O(document,"dragover",Th);var i=this.options;!t&&Y(C,i.dragClass,!1),Y(C,i.ghostClass,!0),I.active=this,t&&this._appendGhost(),st({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(wt){this._lastX=wt.clientX,this._lastY=wt.clientY,_s();for(var t=document.elementFromPoint(wt.clientX,wt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(wt.clientX,wt.clientY),t!==e);)e=t;if(C.parentNode[it]._isOutsideThisEl(t),e)do{if(e[it]){var i=void 0;if(i=e[it]._onDragOver({clientX:wt.clientX,clientY:wt.clientY,target:t,rootEl:e}),i&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Ss()}},_onTouchMove:function(t){if(Gt){var e=this.options,i=e.fallbackTolerance,r=e.fallbackOffset,o=t.touches?t.touches[0]:t,s=q&&Xt(q,!0),a=q&&s&&s.a,l=q&&s&&s.d,c=wn&&nt&&ls(nt),u=(o.clientX-Gt.clientX+r.x)/(a||1)+(c?c[0]-Ir[0]:0)/(a||1),h=(o.clientY-Gt.clientY+r.y)/(l||1)+(c?c[1]-Ir[1]:0)/(l||1);if(!I.active&&!he){if(i&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))=0&&(st({rootEl:Z,name:"add",toEl:Z,fromEl:V,originalEvent:t}),st({sortable:this,name:"remove",toEl:Z,originalEvent:t}),st({rootEl:Z,name:"sort",toEl:Z,fromEl:V,originalEvent:t}),st({sortable:this,name:"sort",toEl:Z,originalEvent:t})),tt&&tt.save()):mt!==de&&mt>=0&&(st({sortable:this,name:"update",toEl:Z,originalEvent:t}),st({sortable:this,name:"sort",toEl:Z,originalEvent:t})),I.active&&((mt==null||mt===-1)&&(mt=de,Ht=ze),st({sortable:this,name:"end",toEl:Z,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){lt("nulling",this),V=C=Z=q=Zt=G=En=Ut=Gt=wt=Be=mt=Ht=de=ze=ce=He=tt=bn=I.dragged=I.ghost=I.clone=I.active=null,$n.forEach(function(t){t.checked=!0}),$n.length=Tr=$r=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":C&&(this._onDragOver(t),$h(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,i=this.el.children,r=0,o=i.length,s=this.options;rr.right+o||n.clientY>i.bottom&&n.clientX>i.left:n.clientY>r.bottom+o||n.clientX>i.right&&n.clientY>i.top}function qh(n,t,e,i,r,o,s,a){var l=i?n.clientY:n.clientX,c=i?e.height:e.width,u=i?e.top:e.left,h=i?e.bottom:e.right,d=!1;if(!s){if(a&&_nu+c*o/2:lh-_n)return-He}else if(l>u+c*(1-r)/2&&lh-c*o/2)?l>u+c/2?1:-1:0}function Bh(n){return J(C)1&&(F.forEach(function(a){o.addAnimationState({target:a,rect:ct?j(a):s}),Dr(a),a.fromRect=s,i.removeAnimationState(a)}),ct=!1,Nh(!this.options.removeCloneOnHide,r))},dragOverCompleted:function(e){var i=e.sortable,r=e.isOwner,o=e.insertion,s=e.activeSortable,a=e.parentEl,l=e.putSortable,c=this.options;if(o){if(r&&s._hideClone(),Me=!1,c.animation&&F.length>1&&(ct||!r&&!s.options.sort&&!l)){var u=j(z,!1,!0,!0);F.forEach(function(d){d!==z&&(cs(d,u),a.appendChild(d))}),ct=!0}if(!r)if(ct||kn(),F.length>1){var h=xn;s._showClone(i),s.options.animation&&!xn&&h&&ft.forEach(function(d){s.addAnimationState({target:d,rect:Fe}),d.fromRect=Fe,d.thisAnimationDuration=null})}else s._showClone(i)}},dragOverAnimationCapture:function(e){var i=e.dragRect,r=e.isOwner,o=e.activeSortable;if(F.forEach(function(a){a.thisAnimationDuration=null}),o.options.animation&&!r&&o.multiDrag.isMultiDrag){Fe=kt({},i);var s=Xt(z,!0);Fe.top-=s.f,Fe.left-=s.e}},dragOverAnimationComplete:function(){ct&&(ct=!1,kn())},drop:function(e){var i=e.originalEvent,r=e.rootEl,o=e.parentEl,s=e.sortable,a=e.dispatchSortableEvent,l=e.oldIndex,c=e.putSortable,u=c||this.sortable;if(i){var h=this.options,d=o.children;if(!ue)if(h.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),Y(z,h.selectedClass,!~F.indexOf(z)),~F.indexOf(z))F.splice(F.indexOf(z),1),Ie=null,qe({sortable:s,rootEl:r,name:"deselect",targetEl:z,originalEvent:i});else{if(F.push(z),qe({sortable:s,rootEl:r,name:"select",targetEl:z,originalEvent:i}),i.shiftKey&&Ie&&s.el.contains(Ie)){var f=J(Ie),p=J(z);if(~f&&~p&&f!==p){var m,w;for(p>f?(w=f,m=p):(w=p,m=f+1);w1){var v=j(z),b=J(z,":not(."+this.options.selectedClass+")");if(!Me&&h.animation&&(z.thisAnimationDuration=null),u.captureAnimationState(),!Me&&(h.animation&&(z.fromRect=v,F.forEach(function(x){if(x.thisAnimationDuration=null,x!==z){var E=ct?j(x):v;x.fromRect=E,u.addAnimationState({target:x,rect:E})}})),kn(),F.forEach(function(x){d[b]?o.insertBefore(x,d[b]):o.appendChild(x),b++}),l===J(z))){var k=!1;F.forEach(function(x){if(x.sortableIndex!==J(x)){k=!0;return}}),k&&(a("update"),a("sort"))}F.forEach(function(x){Dr(x)}),u.animateAll()}yt=u}(r===o||c&&c.lastPutMode!=="clone")&&ft.forEach(function(x){x.parentNode&&x.parentNode.removeChild(x)})}},nullingGlobal:function(){this.isMultiDrag=ue=!1,ft.length=0},destroyGlobal:function(){this._deselectMultiDrag(),B(document,"pointerup",this._deselectMultiDrag),B(document,"mouseup",this._deselectMultiDrag),B(document,"touchend",this._deselectMultiDrag),B(document,"keydown",this._checkKeyDown),B(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(typeof ue<"u"&&ue)&&yt===this.sortable&&!(e&&xt(e.target,this.options.draggable,this.sortable.el,!1))&&!(e&&e.button!==0))for(;F.length;){var i=F[0];Y(i,this.options.selectedClass,!1),F.shift(),qe({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:i,originalEvent:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},kt(n,{pluginName:"multiDrag",utils:{select:function(e){var i=e.parentNode[it];!i||!i.options.multiDrag||~F.indexOf(e)||(yt&&yt!==i&&(yt.multiDrag._deselectMultiDrag(),yt=i),Y(e,i.options.selectedClass,!0),F.push(e))},deselect:function(e){var i=e.parentNode[it],r=F.indexOf(e);!i||!i.options.multiDrag||!~r||(Y(e,i.options.selectedClass,!1),F.splice(r,1))}},eventProperties:function(){var e=this,i=[],r=[];return F.forEach(function(o){i.push({multiDragElement:o,index:o.sortableIndex});var s;ct&&o!==z?s=-1:ct?s=J(o,":not(."+e.options.selectedClass+")"):s=J(o),r.push({multiDragElement:o,index:s})}),{items:ph(F),clones:[].concat(ft),oldIndicies:i,newIndicies:r}},optionListeners:{multiDragKey:function(e){return e=e.toLowerCase(),e==="ctrl"?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}function Nh(n,t){F.forEach(function(e,i){var r=t.children[e.sortableIndex+(n?Number(i):0)];r?t.insertBefore(e,r):t.appendChild(e)})}function fs(n,t){ft.forEach(function(e,i){var r=t.children[e.sortableIndex+(n?Number(i):0)];r?t.insertBefore(e,r):t.appendChild(e)})}function kn(){F.forEach(function(n){n!==z&&n.parentNode&&n.parentNode.removeChild(n)})}I.mount(new Rh);I.mount(Vr,jr);var Yt=I;var Ls={name(n,t){let e=n.getAttribute("data-name").trim().toLowerCase(),i=t.getAttribute("data-name").trim().toLowerCase();return e.localeCompare(i)},created(n,t){let e=Number(n.getAttribute("data-created"));return Number(t.getAttribute("data-created"))-e},updated(n,t){let e=Number(n.getAttribute("data-updated"));return Number(t.getAttribute("data-updated"))-e},chaptersFirst(n,t){let e=n.getAttribute("data-type"),i=t.getAttribute("data-type");return e===i?0:e==="chapter"?-1:1},chaptersLast(n,t){let e=n.getAttribute("data-type"),i=t.getAttribute("data-type");return e===i?0:e==="chapter"?1:-1}},Ts={up:{active(n,t){return!(n.previousElementSibling===null&&!t)},run(n,t){(n.previousElementSibling||t).insertAdjacentElement("beforebegin",n)}},down:{active(n,t){return!(n.nextElementSibling===null&&!t)},run(n,t){(n.nextElementSibling||t).insertAdjacentElement("afterend",n)}},next_book:{active(n,t,e){return e.nextElementSibling!==null},run(n,t,e){e.nextElementSibling.querySelector("ul").prepend(n)}},prev_book:{active(n,t,e){return e.previousElementSibling!==null},run(n,t,e){e.previousElementSibling.querySelector("ul").appendChild(n)}},next_chapter:{active(n,t){return n.dataset.type==="page"&&this.getNextChapter(n,t)},run(n,t){this.getNextChapter(n,t).querySelector("ul").prepend(n)},getNextChapter(n,t){let e=t||n,i=Array.from(e.parentElement.children),r=i.indexOf(e);return i.slice(r+1).find(o=>o.dataset.type==="chapter")}},prev_chapter:{active(n,t){return n.dataset.type==="page"&&this.getPrevChapter(n,t)},run(n,t){this.getPrevChapter(n,t).querySelector("ul").append(n)},getPrevChapter(n,t){let e=t||n,i=Array.from(e.parentElement.children),r=i.indexOf(e);return i.slice(0,r).reverse().find(o=>o.dataset.type==="chapter")}},book_end:{active(n,t){return t||t===null&&n.nextElementSibling},run(n,t,e){e.querySelector("ul").append(n)}},book_start:{active(n,t){return t||t===null&&n.previousElementSibling},run(n,t,e){e.querySelector("ul").prepend(n)}},before_chapter:{active(n,t){return t},run(n,t){t.insertAdjacentElement("beforebegin",n)}},after_chapter:{active(n,t){return t},run(n,t){t.insertAdjacentElement("afterend",n)}}},Fn=class extends g{setup(){this.container=this.$el,this.sortContainer=this.$refs.sortContainer,this.input=this.$refs.input,Yt.mount(new Ds);let t=this.container.querySelector(".sort-box");this.setupBookSortable(t),this.setupSortPresets(),this.setupMoveActions(),window.$events.listen("entity-select-change",this.bookSelect.bind(this))}setupMoveActions(){this.container.addEventListener("click",t=>{if(t.target.matches("[data-move]")){let e=t.target.getAttribute("data-move"),i=t.target.closest("[data-id]");this.runSortAction(i,e)}}),this.updateMoveActionStateForAll()}setupSortPresets(){let t="",e=!1,i=["name","created","updated"];this.sortContainer.addEventListener("click",r=>{let o=r.target.closest(".sort-box-options [data-sort]");if(!o)return;r.preventDefault();let s=o.closest(".sort-box").querySelectorAll("ul"),a=o.getAttribute("data-sort");e=t===a?!e:!1;let l=Ls[a];e&&i.includes(a)&&(l=function(u,h){return 0-Ls[a](u,h)});for(let c of s)Array.from(c.children).filter(h=>h.matches("li")).sort(l).forEach(h=>{c.appendChild(h)});t=a,this.updateMapInput()})}bookSelect(t){if(this.container.querySelector(`[data-type="book"][data-id="${t.id}"]`)!==null)return;let i=`${t.link}/sort-item`;window.$http.get(i).then(r=>{let o=_t(r.data);this.sortContainer.append(o),this.setupBookSortable(o),this.updateMoveActionStateForAll(),o.querySelector("summary").focus()})}setupBookSortable(t){let e=Array.from(t.querySelectorAll(".sort-list, .sortable-page-sublist")),i={name:"book",pull:["book","chapter"],put:["book","chapter"]},r={name:"chapter",pull:["book","chapter"],put(o,s,a){return a.getAttribute("data-type")==="page"}};for(let o of e)Yt.create(o,{group:o.classList.contains("sort-list")?i:r,animation:150,fallbackOnBody:!0,swapThreshold:.65,onSort:()=>{this.ensureNoNestedChapters(),this.updateMapInput(),this.updateMoveActionStateForAll()},dragClass:"bg-white",ghostClass:"primary-background-light",multiDrag:!0,multiDragKey:"Control",selectedClass:"sortable-selected"})}ensureNoNestedChapters(){let t=this.container.querySelectorAll('[data-type="chapter"] [data-type="chapter"]');for(let e of t)e.parentElement.closest('[data-type="chapter"]').insertAdjacentElement("afterend",e)}updateMapInput(){let t=this.buildEntityMap();this.input.value=JSON.stringify(t)}buildEntityMap(){let t=[],e=this.container.querySelectorAll(".sort-list");for(let i of e){let r=i.closest('[data-type="book"]').getAttribute("data-id"),o=Array.from(i.children).filter(s=>s.matches('[data-type="page"], [data-type="chapter"]'));for(let s=0;s{for(let s of r)n.style[s]=null;n.style.transition=null,n.removeEventListener("transitionend",o),qn.delete(n),i&&i()};setTimeout(()=>{n.style.transition=`all ease-in-out ${e}ms`;for(let s of r)n.style[s]=t[s][1];n.addEventListener("transitionend",o),qn.set(n,o)},15)}function Ge(n){qn.has(n)&&qn.get(n)()}function $s(n,t=400,e=null){Ge(n),n.style.display="block",We(n,{opacity:["0","1"]},t,()=>{e&&e()})}function Is(n,t=400,e=null){Ge(n),We(n,{opacity:["1","0"]},t,()=>{n.style.display="none",e&&e()})}function fe(n,t=400){Ge(n);let e=n.getBoundingClientRect().height,i=getComputedStyle(n),r=i.getPropertyValue("padding-top"),o=i.getPropertyValue("padding-bottom"),s={maxHeight:[`${e}px`,"0px"],overflow:["hidden","hidden"],paddingTop:[r,"0px"],paddingBottom:[o,"0px"]};We(n,s,t,()=>{n.style.display="none"})}function me(n,t=400){Ge(n),n.style.display="block";let e=n.getBoundingClientRect().height,i=getComputedStyle(n),r=i.getPropertyValue("padding-top"),o=i.getPropertyValue("padding-bottom"),s={maxHeight:["0px",`${e}px`],overflow:["hidden","hidden"],paddingTop:["0px",r],paddingBottom:["0px",o]};We(n,s,t)}function Ms(n,t=400){let e=n.getBoundingClientRect().height,i=getComputedStyle(n),r=i.getPropertyValue("padding-top"),o=i.getPropertyValue("padding-bottom");return()=>{Ge(n);let s=n.getBoundingClientRect().height,a=getComputedStyle(n),l=a.getPropertyValue("padding-top"),c=a.getPropertyValue("padding-bottom"),u={height:[`${e}px`,`${s}px`],overflow:["hidden","hidden"],paddingTop:[r,l],paddingBottom:[o,c]};We(n,u,t)}}var Bn=class extends g{setup(){this.list=this.$refs.list,this.toggle=this.$refs.toggle,this.isOpen=this.toggle.classList.contains("open"),this.toggle.addEventListener("click",this.click.bind(this))}open(){this.toggle.classList.add("open"),this.toggle.setAttribute("aria-expanded","true"),me(this.list,180),this.isOpen=!0}close(){this.toggle.classList.remove("open"),this.toggle.setAttribute("aria-expanded","false"),fe(this.list,180),this.isOpen=!1}click(t){t.preventDefault(),this.isOpen?this.close():this.open()}};var Pn=class extends g{constructor(){super(...arguments);at(this,"editor",null);at(this,"saveCallback",null);at(this,"cancelCallback",null);at(this,"history",{});at(this,"historyKey","code_history")}setup(){this.container=this.$refs.container,this.popup=this.$el,this.editorInput=this.$refs.editor,this.languageButtons=this.$manyRefs.languageButton,this.languageOptionsContainer=this.$refs.languageOptionsContainer,this.saveButton=this.$refs.saveButton,this.languageInput=this.$refs.languageInput,this.historyDropDown=this.$refs.historyDropDown,this.historyList=this.$refs.historyList,this.favourites=new Set(this.$opts.favourites.split(",")),this.setupListeners(),this.setupFavourites()}setupListeners(){this.container.addEventListener("keydown",e=>{e.ctrlKey&&e.key==="Enter"&&this.save()}),R(this.languageButtons,e=>{let i=e.target.dataset.lang;this.languageInput.value=i,this.languageInputChange(i)}),se(this.languageInput,()=>this.save()),this.languageInput.addEventListener("input",()=>this.languageInputChange(this.languageInput.value)),R(this.saveButton,()=>this.save()),K(this.historyList,"button","click",(e,i)=>{e.preventDefault();let r=i.dataset.time;this.editor&&this.editor.setContent(this.history[r])})}setupFavourites(){for(let e of this.languageButtons)this.setupFavouritesForButton(e);this.sortLanguageList()}setupFavouritesForButton(e){let i=e.dataset.lang,r=this.favourites.has(i);e.setAttribute("data-favourite",r?"true":"false"),K(e.parentElement,".lang-option-favorite-toggle","click",()=>{r=!r,r?this.favourites.add(i):this.favourites.delete(i),e.setAttribute("data-favourite",r?"true":"false"),window.$http.patch("/preferences/update-code-language-favourite",{language:i,active:r}),this.sortLanguageList(),r&&e.scrollIntoView({block:"center",behavior:"smooth"})})}sortLanguageList(){let e=this.languageButtons.sort((i,r)=>{let o=i.dataset.favourite==="true",s=r.dataset.favourite==="true";return o&&!s?-1:s&&!o||i.dataset.lang>r.dataset.lang?1:-1}).map(i=>i.parentElement);for(let i of e)this.languageOptionsContainer.append(i)}save(){this.saveCallback&&this.saveCallback(this.editor.getContent(),this.languageInput.value),this.hide()}async open(e,i,r,o){this.languageInput.value=i,this.saveCallback=r,this.cancelCallback=o,await this.show(),this.languageInputChange(i),this.editor.setContent(e)}async show(){let e=await window.importVersioned("code");this.editor||(this.editor=e.popupEditor(this.editorInput,this.languageInput.value)),this.loadHistory(),this.getPopup().show(()=>{this.editor.focus()},()=>{this.addHistory(),this.cancelCallback&&this.cancelCallback()})}hide(){this.getPopup().hide(),this.addHistory()}getPopup(){return window.$components.firstOnElement(this.popup,"popup")}async updateEditorMode(e){this.editor.setMode(e,this.editor.getContent())}languageInputChange(e){this.updateEditorMode(e);let i=e.toLowerCase();for(let r of this.languageButtons){let o=r.dataset.lang.toLowerCase().trim(),s=i===o;r.classList.toggle("active",s),s&&r.scrollIntoView({block:"center",behavior:"smooth"})}}loadHistory(){this.history=JSON.parse(window.sessionStorage.getItem(this.historyKey)||"{}");let e=Object.keys(this.history).reverse();this.historyDropDown.classList.toggle("hidden",e.length===0),this.historyList.innerHTML=e.map(i=>{let r=new Date(parseInt(i,10)).toLocaleTimeString();return`
  • `}).join("")}addHistory(){if(!this.editor)return;let e=this.editor.getContent();if(!e)return;let i=Object.keys(this.history).pop();if(this.history[i]===e)return;this.history[String(Date.now())]=e;let r=JSON.stringify(this.history);window.sessionStorage.setItem(this.historyKey,r)}};var On=class extends g{setup(){let t=this.$el;t.querySelectorAll("pre").length>0&&window.importVersioned("code").then(i=>{i.highlightWithin(t)})}};var Rn=class extends g{async setup(){let{mode:t}=this.$opts;(await window.importVersioned("code")).inlineEditor(this.$el,t)}};var Nn=class extends g{setup(){this.container=this.$el,this.trigger=this.$refs.trigger,this.content=this.$refs.content,this.trigger&&(this.trigger.addEventListener("click",this.toggle.bind(this)),this.openIfContainsError())}open(){this.container.classList.add("open"),this.trigger.setAttribute("aria-expanded","true"),me(this.content,300)}close(){this.container.classList.remove("open"),this.trigger.setAttribute("aria-expanded","false"),fe(this.content,300)}toggle(){this.container.classList.contains("open")?this.close():this.open()}openIfContainsError(){this.content.querySelector(".text-neg.text-small")&&this.open()}};var zn=class extends g{setup(){this.container=this.$el,this.confirmButton=this.$refs.confirm,this.res=null,R(this.confirmButton,()=>{this.sendResult(!0),this.getPopup().hide()})}show(){return this.getPopup().show(null,()=>{this.sendResult(!1)}),new Promise(t=>{this.res=t})}getPopup(){return window.$components.firstOnElement(this.container,"popup")}sendResult(t){this.res&&(this.res(t),this.res=null)}};var Hn=class extends g{setup(){this.container=this.$el,this.checkbox=this.container.querySelector("input[type=checkbox]"),this.display=this.container.querySelector('[role="checkbox"]'),this.checkbox.addEventListener("change",this.stateChange.bind(this)),this.container.addEventListener("keydown",this.onKeyDown.bind(this))}onKeyDown(t){(t.key===" "||t.key==="Enter")&&(t.preventDefault(),this.toggle())}toggle(){this.checkbox.checked=!this.checkbox.checked,this.checkbox.dispatchEvent(new Event("change")),this.stateChange()}stateChange(){let t=this.checkbox.checked?"true":"false";this.display.setAttribute("aria-checked",t)}};var Un=class extends g{setup(){this.container=this.$el,this.dealtWith=!1,this.container.addEventListener("toggle",this.onToggle.bind(this))}onToggle(){this.dealtWith||(this.container.querySelector("pre")&&window.importVersioned("code").then(t=>{t.highlightWithin(this.container)}),this.dealtWith=!0)}};var jn=class extends g{setup(){this.container=this.$el,this.menu=this.$refs.menu,this.toggle=this.$refs.toggle,this.moveMenu=this.$opts.moveMenu,this.bubbleEscapes=this.$opts.bubbleEscapes==="true",this.direction=document.dir==="rtl"?"right":"left",this.body=document.body,this.showing=!1,this.hide=this.hide.bind(this),this.setupListeners()}show(t=null){this.hideAll(),this.menu.style.display="block",this.menu.classList.add("anim","menuIn"),this.toggle.setAttribute("aria-expanded","true");let e=this.menu.getBoundingClientRect(),i=0,r=this.toggle.getBoundingClientRect().height,o=e.bottom>window.innerHeight,s=this.container.getBoundingClientRect();if(this.moveMenu&&(this.body.appendChild(this.menu),this.menu.style.position="fixed",this.menu.style.width=`${e.width}px`,this.menu.style.left=`${e.left}px`,o?i=window.innerHeight-e.top-r/2:i=e.top),o){this.menu.style.top="initial",this.menu.style.bottom=`${i}px`;let c=window.innerHeight-40-(window.innerHeight-s.bottom);this.menu.style.maxHeight=`${Math.floor(c)}px`}else{this.menu.style.top=`${i}px`,this.menu.style.bottom="initial";let c=window.innerHeight-40-s.top;this.menu.style.maxHeight=`${Math.floor(c)}px`}this.menu.addEventListener("mouseleave",this.hide),window.addEventListener("click",c=>{this.menu.contains(c.target)||this.hide()});let a=this.menu.querySelector("input");a!==null&&a.focus(),this.showing=!0;let l=new Event("show");this.container.dispatchEvent(l),t&&t.stopPropagation()}hideAll(){for(let t of window.$components.get("dropdown"))t.hide()}hide(){this.menu.style.display="none",this.menu.classList.remove("anim","menuIn"),this.toggle.setAttribute("aria-expanded","false"),this.menu.style.top="",this.menu.style.bottom="",this.menu.style.maxHeight="",this.moveMenu&&(this.menu.style.position="",this.menu.style[this.direction]="",this.menu.style.width="",this.menu.style.left="",this.container.appendChild(this.menu)),this.showing=!1}setupListeners(){let t=new zt(this.container,e=>{this.hide(),this.toggle.focus(),this.bubbleEscapes||e.stopPropagation()},e=>{e.target.nodeName==="INPUT"&&(e.preventDefault(),e.stopPropagation()),this.hide()});this.moveMenu&&t.shareHandlingToEl(this.menu),this.container.addEventListener("click",e=>{Array.from(this.menu.querySelectorAll("a")).includes(e.target)&&this.hide()}),R(this.toggle,e=>{e.stopPropagation(),e.preventDefault(),this.show(e),e instanceof KeyboardEvent&&t.focusNext()})}};var Vn=class extends g{setup(){this.elem=this.$el,this.searchInput=this.$refs.searchInput,this.loadingElem=this.$refs.loading,this.listContainerElem=this.$refs.listContainer,this.localSearchSelector=this.$opts.localSearchSelector,this.url=this.$opts.url,this.elem.addEventListener("show",this.onShow.bind(this)),this.searchInput.addEventListener("input",this.onSearch.bind(this)),this.runAjaxSearch=Nt(this.runAjaxSearch,300,!1)}onShow(){this.loadList()}onSearch(){let t=this.searchInput.value.toLowerCase().trim();this.localSearchSelector?this.runLocalSearch(t):(this.toggleLoading(!0),this.listContainerElem.innerHTML="",this.runAjaxSearch(t))}runAjaxSearch(t){this.loadList(t)}runLocalSearch(t){let e=this.listContainerElem.querySelectorAll(this.localSearchSelector);for(let i of e){let r=!t||i.textContent.toLowerCase().includes(t);i.style.display=r?"flex":"none",i.classList.toggle("hidden",!r)}}async loadList(t=""){this.listContainerElem.innerHTML="",this.toggleLoading(!0);try{let e=await window.$http.get(this.getAjaxUrl(t)),i=Ms(this.listContainerElem,80);this.listContainerElem.innerHTML=e.data,i()}catch(e){console.error(e)}this.toggleLoading(!1),this.localSearchSelector&&this.onSearch()}getAjaxUrl(t=null){if(!t)return this.url;let e=this.url.includes("?")?"&":"?";return`${this.url}${e}search=${encodeURIComponent(t)}`}toggleLoading(t=!1){this.loadingElem.style.display=t?"block":"none"}};var Ft=class{constructor(t){this.data=t}hasItems(){return!!this.data&&!!this.data.types&&this.data.types.length>0}containsTabularData(){let t=this.data.getData("text/rtf");return t&&t.includes("\\trowd")}getImages(){let{types:t}=this.data,e=[];for(let r of t)if(r.includes("image")){let o=this.data.getData(r);e.push(o.getAsFile())}let i=this.getFiles().filter(r=>r.type.includes("image"));return e.push(...i),e}getFiles(){let{files:t}=this.data;return[...t]}};async function Wr(n){if(window.isSecureContext&&navigator.clipboard){await navigator.clipboard.writeText(n);return}let t=document.createElement("textarea");t.style="position: absolute; left: -1000px; top: -1000px;",t.value=n,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}var Wn=class extends g{setup(){this.container=this.$el,this.statusArea=this.$refs.statusArea,this.dropTarget=this.$refs.dropTarget,this.selectButtons=this.$manyRefs.selectButton||[],this.isActive=!0,this.url=this.$opts.url,this.method=(this.$opts.method||"post").toUpperCase(),this.successMessage=this.$opts.successMessage,this.errorMessage=this.$opts.errorMessage,this.uploadLimitMb=Number(this.$opts.uploadLimit),this.uploadLimitMessage=this.$opts.uploadLimitMessage,this.zoneText=this.$opts.zoneText,this.fileAcceptTypes=this.$opts.fileAccept,this.allowMultiple=this.$opts.allowMultiple==="true",this.setupListeners()}toggleActive(t){this.isActive=t}setupListeners(){R(this.selectButtons,this.manualSelectHandler.bind(this)),this.setupDropTargetHandlers()}setupDropTargetHandlers(){let t=0,e=()=>{this.hideOverlay(),t=0};this.dropTarget.addEventListener("dragenter",i=>{i.preventDefault(),t+=1,t===1&&this.isActive&&this.showOverlay()}),this.dropTarget.addEventListener("dragover",i=>{i.preventDefault()}),this.dropTarget.addEventListener("dragend",e),this.dropTarget.addEventListener("dragleave",()=>{t-=1,t===0&&e()}),this.dropTarget.addEventListener("drop",i=>{if(i.preventDefault(),e(),!this.isActive)return;let o=new Ft(i.dataTransfer).getFiles();for(let s of o)this.createUploadFromFile(s)})}manualSelectHandler(){let t=Et("input",{type:"file",style:"left: -400px; visibility: hidden; position: fixed;",accept:this.fileAcceptTypes,multiple:this.allowMultiple?"":null});this.container.append(t),t.click(),t.addEventListener("change",()=>{for(let e of t.files)this.createUploadFromFile(e);t.remove()})}showOverlay(){if(!this.dropTarget.querySelector(".dropzone-overlay")){let e=Et("div",{class:"dropzone-overlay"},[this.zoneText]);this.dropTarget.append(e)}}hideOverlay(){let t=this.dropTarget.querySelector(".dropzone-overlay");t&&t.remove()}createUploadFromFile(t){let{dom:e,status:i,progress:r,dismiss:o}=this.createDomForFile(t);this.statusArea.append(e);let s=this,a={file:t,dom:e,updateProgress(l){r.textContent=`${l}%`,r.style.width=`${l}%`},markError(l){i.setAttribute("data-status","error"),i.textContent=l,Le(e),this.updateProgress(100)},markSuccess(l){i.setAttribute("data-status","success"),i.textContent=l,Le(e),setTimeout(o,2400),s.$emit("upload-success",{name:t.name})}};return t.size>this.uploadLimitMb*1e6?(a.markError(this.uploadLimitMessage),a):(this.startXhrForUpload(a),a)}startXhrForUpload(t){let e=new FormData;e.append("file",t.file,t.file.name),this.method!=="POST"&&e.append("_method",this.method);let i=this,r=window.$http.createXMLHttpRequest("POST",this.url,{error(){t.markError(i.errorMessage)},readystatechange(){if(this.readyState===XMLHttpRequest.DONE&&this.status===200)t.markSuccess(i.successMessage);else if(this.readyState===XMLHttpRequest.DONE&&this.status>=400){let o=this.responseText,s=o.startsWith("{")?JSON.parse(o):{message:o},a=s?.message||s?.error||o;t.markError(a)}}});r.upload.addEventListener("progress",o=>{let s=Math.min(Math.ceil(o.loaded/o.total*100),100);t.updateProgress(s)}),r.setRequestHeader("Accept","application/json"),r.send(e)}createDomForFile(t){let e=Et("img",{src:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.224 7.373a.924.924 0 0 0-.92.925l-.006 7.404c0 .509.412.925.921.925h5.557a.928.928 0 0 0 .926-.925v-5.553l-2.777-2.776Zm3.239 3.239V8.067l2.545 2.545z' style='fill:%23000;fill-opacity:.75'/%3E%3C/svg%3E"}),i=Et("div",{class:"dropzone-file-item-status"},[]),r=Et("div",{class:"dropzone-file-item-progress"}),o=Et("div",{class:"dropzone-file-item-image-wrap"},[e]),s=Et("div",{class:"dropzone-file-item"},[o,Et("div",{class:"dropzone-file-item-text-wrap"},[Et("div",{class:"dropzone-file-item-label"},[t.name]),ae(),i]),r]);t.type.startsWith("image/")&&(e.src=URL.createObjectURL(t));let a=()=>{s.classList.add("dismiss"),s.addEventListener("animationend",()=>{s.remove()})};return s.addEventListener("click",a),{dom:s,progress:r,status:i,dismiss:a}}};var Gn=class extends g{setup(){this.container=this.$el,this.buttons=this.$manyRefs.tabButton,this.contentElements=this.$manyRefs.tabContent,this.toggleButton=this.$refs.toggle,this.editorWrapEl=this.container.closest(".page-editor"),this.setupListeners(),this.setActiveTab(this.contentElements[0].dataset.tabContent)}setupListeners(){this.toggleButton.addEventListener("click",()=>this.toggle()),this.container.addEventListener("click",t=>{let e=t.target.closest("button");if(this.buttons.includes(e)){let i=e.dataset.tab;this.setActiveTab(i,!0)}})}toggle(){this.container.classList.toggle("open");let t=this.container.classList.contains("open");this.toggleButton.setAttribute("aria-expanded",t?"true":"false"),this.editorWrapEl.classList.toggle("toolbox-open",t)}setActiveTab(t,e=!1){for(let i of this.buttons)i.classList.remove("active"),i.dataset.tab===t&&i.classList.add("active");for(let i of this.contentElements)i.style.display="none",i.dataset.tabContent===t&&(i.style.display="block");e&&!this.container.classList.contains("open")&&this.toggle()}};var Kn=class extends g{setup(){this.container=this.$el,this.entityType=this.$opts.entityType,this.everyoneInheritToggle=this.$refs.everyoneInherit,this.roleSelect=this.$refs.roleSelect,this.roleContainer=this.$refs.roleContainer,this.setupListeners()}setupListeners(){this.everyoneInheritToggle.addEventListener("change",t=>{let e=t.target.checked,i=document.querySelectorAll('input[name^="permissions[0]["]');for(let r of i)r.disabled=e,r.checked=!1}),this.container.addEventListener("click",t=>{let e=t.target.closest("button");e&&e.dataset.roleId&&this.removeRowOnButtonClick(e)}),this.roleSelect.addEventListener("change",()=>{let t=this.roleSelect.value;t&&this.addRoleRow(t)})}async addRoleRow(t){this.roleSelect.disabled=!0;let e=this.roleSelect.querySelector(`option[value="${t}"]`);e&&e.remove();let i=await window.$http.get(`/permissions/form-row/${this.entityType}/${t}`),r=_t(i.data);this.roleContainer.append(r),this.roleSelect.disabled=!1}removeRowOnButtonClick(t){let e=t.closest(".item-list-row"),{roleId:i}=t.dataset,{roleName:r}=t.dataset,o=document.createElement("option");o.value=i,o.textContent=r,this.roleSelect.append(o),e.remove()}};var Zn=class extends g{setup(){this.entityId=this.$opts.entityId,this.entityType=this.$opts.entityType,this.contentView=this.$refs.contentView,this.searchView=this.$refs.searchView,this.searchResults=this.$refs.searchResults,this.searchInput=this.$refs.searchInput,this.searchForm=this.$refs.searchForm,this.clearButton=this.$refs.clearButton,this.loadingBlock=this.$refs.loadingBlock,this.setupListeners()}setupListeners(){this.searchInput.addEventListener("change",this.runSearch.bind(this)),this.searchForm.addEventListener("submit",t=>{t.preventDefault(),this.runSearch()}),R(this.clearButton,this.clearSearch.bind(this))}runSearch(){let t=this.searchInput.value.trim();if(t.length===0){this.clearSearch();return}this.searchView.classList.remove("hidden"),this.contentView.classList.add("hidden"),this.loadingBlock.classList.remove("hidden");let e=window.baseUrl(`/search/${this.entityType}/${this.entityId}`);window.$http.get(e,{term:t}).then(i=>{this.searchResults.innerHTML=i.data}).catch(console.error).then(()=>{this.loadingBlock.classList.add("hidden")})}clearSearch(){this.searchView.classList.add("hidden"),this.contentView.classList.remove("hidden"),this.loadingBlock.classList.add("hidden"),this.searchInput.value=""}};var Xn=class extends g{setup(){this.elem=this.$el,this.input=this.$refs.input,this.searchInput=this.$refs.search,this.loading=this.$refs.loading,this.resultsContainer=this.$refs.results,this.searchOptions={entityTypes:this.$opts.entityTypes||"page,book,chapter",entityPermission:this.$opts.entityPermission||"view",searchEndpoint:this.$opts.searchEndpoint||"",initialValue:this.searchInput.value||""},this.search="",this.lastClick=0,this.setupListeners(),this.showLoading(),this.searchOptions.searchEndpoint&&this.initialLoad()}configureSearchOptions(t){Object.assign(this.searchOptions,t),this.reset(),this.searchInput.value=this.searchOptions.initialValue}setupListeners(){this.elem.addEventListener("click",this.onClick.bind(this));let t=0;this.searchInput.addEventListener("input",()=>{t=Date.now(),this.showLoading(),setTimeout(()=>{Date.now()-t<199||this.searchEntities(this.searchInput.value)},200)}),this.searchInput.addEventListener("keydown",e=>{e.keyCode===13&&e.preventDefault()}),K(this.$el,"[data-entity-type]","keydown",e=>{if(e.ctrlKey&&e.code==="Enter"){let i=this.$el.closest("form");if(i){i.submit(),e.preventDefault();return}}e.code==="ArrowDown"&&this.focusAdjacent(!0),e.code==="ArrowUp"&&this.focusAdjacent(!1)}),this.searchInput.addEventListener("keydown",e=>{e.code==="ArrowDown"&&this.focusAdjacent(!0)})}focusAdjacent(t=!0){let e=Array.from(this.resultsContainer.querySelectorAll("[data-entity-type]")),i=e.indexOf(document.activeElement),r=e[i+(t?1:-1)]||e[0];r&&r.focus()}reset(){this.searchInput.value="",this.showLoading(),this.initialLoad()}focusSearch(){this.searchInput.focus()}showLoading(){this.loading.style.display="block",this.resultsContainer.style.display="none"}hideLoading(){this.loading.style.display="none",this.resultsContainer.style.display="block"}initialLoad(){if(!this.searchOptions.searchEndpoint)throw new Error("Search endpoint not set for entity-selector load");if(this.searchOptions.initialValue){this.searchEntities(this.searchOptions.initialValue);return}window.$http.get(this.searchUrl()).then(t=>{this.resultsContainer.innerHTML=t.data,this.hideLoading()})}searchUrl(){let t=`types=${encodeURIComponent(this.searchOptions.entityTypes)}&permission=${encodeURIComponent(this.searchOptions.entityPermission)}`;return`${this.searchOptions.searchEndpoint}?${t}`}searchEntities(t){if(!this.searchOptions.searchEndpoint)throw new Error("Search endpoint not set for entity-selector load");this.input.value="";let e=`${this.searchUrl()}&term=${encodeURIComponent(t)}`;window.$http.get(e).then(i=>{this.resultsContainer.innerHTML=i.data,this.hideLoading()})}isDoubleClick(){let t=Date.now(),e=t-this.lastClick<300;return this.lastClick=t,e}onClick(t){let e=t.target.closest("[data-entity-type]");e&&(t.preventDefault(),t.stopPropagation(),this.selectItem(e))}selectItem(t){let e=this.isDoubleClick(),i=t.getAttribute("data-entity-type"),r=t.getAttribute("data-entity-id"),o=!t.classList.contains("selected")||e;this.unselectAll(),this.input.value=o?`${i}:${r}`:"";let s=t.getAttribute("href"),a=t.querySelector(".entity-list-item-name").textContent,l={id:Number(r),name:a,link:s};o?t.classList.add("selected"):window.$events.emit("entity-select-change",null),!(!e&&!o)&&(e&&this.confirmSelection(l),o&&window.$events.emit("entity-select-change",l))}confirmSelection(t){window.$events.emit("entity-select-confirm",t)}unselectAll(){let t=this.elem.querySelectorAll(".selected");for(let e of t)e.classList.remove("selected","primary-background")}};var Yn=class extends g{setup(){this.container=this.$el,this.selectButton=this.$refs.select,this.selectorEl=this.$refs.selector,this.callback=null,this.selection=null,this.selectButton.addEventListener("click",this.onSelectButtonClick.bind(this)),window.$events.listen("entity-select-change",this.onSelectionChange.bind(this)),window.$events.listen("entity-select-confirm",this.handleConfirmedSelection.bind(this))}show(t,e={}){this.callback=t,this.getSelector().configureSearchOptions(e),this.getPopup().show(),this.getSelector().focusSearch()}hide(){this.getPopup().hide()}getPopup(){return window.$components.firstOnElement(this.container,"popup")}getSelector(){return window.$components.firstOnElement(this.selectorEl,"entity-selector")}onSelectButtonClick(){this.handleConfirmedSelection(this.selection)}onSelectionChange(t){this.selection=t,t===null?this.selectButton.setAttribute("disabled","true"):this.selectButton.removeAttribute("disabled")}handleConfirmedSelection(t){this.hide(),this.getSelector().reset(),this.callback&&t&&this.callback(t)}};var Jn=class extends g{setup(){this.container=this.$el,this.name=this.$opts.name,R(this.$el,()=>{this.$emit(this.name,this.$opts)})}};var Qn=class extends g{setup(){this.targetSelector=this.$opts.targetSelector,this.isOpen=this.$opts.isOpen==="true",this.updateEndpoint=this.$opts.updateEndpoint,this.$el.addEventListener("click",this.click.bind(this))}open(t){me(t,200)}close(t){fe(t,200)}click(t){t.preventDefault();let e=document.querySelectorAll(this.targetSelector);for(let i of e)(this.isOpen?this.close:this.open)(i);this.isOpen=!this.isOpen,this.updateSystemAjax(this.isOpen)}updateSystemAjax(t){window.$http.patch(this.updateEndpoint,{expand:t?"true":"false"})}};var ti=class extends g{setup(){this.container=this.$el,this.input=this.$refs.input,this.suggestions=this.$refs.suggestions,this.suggestionResultsWrap=this.$refs.suggestionResults,this.loadingWrap=this.$refs.loading,this.button=this.$refs.button,this.setupListeners()}setupListeners(){let t=Nt(this.updateSuggestions.bind(this),200,!1);this.input.addEventListener("input",()=>{let{value:e}=this.input;e.length>0?(this.loadingWrap.style.display="block",this.suggestionResultsWrap.style.opacity="0.5",t(e)):this.hideSuggestions()}),this.input.addEventListener("dblclick",()=>{this.input.setAttribute("autocomplete","on"),this.button.focus(),this.input.focus()}),new zt(this.container,()=>{this.hideSuggestions()})}async updateSuggestions(t){let{data:e}=await window.$http.get("/search/suggest",{term:t});if(!this.input.value)return;let i=_t(e);this.suggestionResultsWrap.innerHTML="",this.suggestionResultsWrap.style.opacity="1",this.loadingWrap.style.display="none",this.suggestionResultsWrap.append(i),this.container.classList.contains("search-active")||this.showSuggestions()}showSuggestions(){this.container.classList.add("search-active"),window.requestAnimationFrame(()=>{this.suggestions.classList.add("search-suggestions-animation")})}hideSuggestions(){this.container.classList.remove("search-active"),this.suggestions.classList.remove("search-suggestions-animation"),this.suggestionResultsWrap.innerHTML=""}};var ei=class extends g{setup(){this.elem=this.$el,this.toggleButton=this.$refs.toggle,this.menu=this.$refs.menu,this.open=!1,this.toggleButton.addEventListener("click",this.onToggle.bind(this)),this.onWindowClick=this.onWindowClick.bind(this),this.onKeyDown=this.onKeyDown.bind(this)}onToggle(t){this.open=!this.open,this.menu.classList.toggle("show",this.open),this.toggleButton.setAttribute("aria-expanded",this.open?"true":"false"),this.open?(this.elem.addEventListener("keydown",this.onKeyDown),window.addEventListener("click",this.onWindowClick)):(this.elem.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("click",this.onWindowClick)),t.stopPropagation()}onKeyDown(t){t.code==="Escape"&&this.onToggle(t)}onWindowClick(t){this.onToggle(t)}};var ni=class extends g{setup(){this.uploadedTo=this.$opts.uploadedTo,this.container=this.$el,this.popupEl=this.$refs.popup,this.searchForm=this.$refs.searchForm,this.searchInput=this.$refs.searchInput,this.cancelSearch=this.$refs.cancelSearch,this.listContainer=this.$refs.listContainer,this.filterTabs=this.$manyRefs.filterTabs,this.selectButton=this.$refs.selectButton,this.uploadButton=this.$refs.uploadButton,this.uploadHint=this.$refs.uploadHint,this.formContainer=this.$refs.formContainer,this.formContainerPlaceholder=this.$refs.formContainerPlaceholder,this.dropzoneContainer=this.$refs.dropzoneContainer,this.loadMore=this.$refs.loadMore,this.type="gallery",this.lastSelected={},this.lastSelectedTime=0,this.callback=null,this.resetState=()=>{this.hasData=!1,this.page=1,this.filter="all"},this.resetState(),this.setupListeners()}setupListeners(){R(this.filterTabs,i=>{this.resetAll(),this.filter=i.target.dataset.filter,this.setActiveFilterTab(this.filter),this.loadGallery()}),this.searchForm.addEventListener("submit",i=>{this.resetListView(),this.loadGallery(),this.cancelSearch.toggleAttribute("hidden",!this.searchInput.value),i.preventDefault()}),R(this.cancelSearch,()=>{this.resetListView(),this.resetSearchView(),this.loadGallery()}),K(this.container,".load-more button","click",this.runLoadMore.bind(this)),this.listContainer.addEventListener("event-emit-select-image",this.onImageSelectEvent.bind(this)),this.listContainer.addEventListener("error",i=>{i.target.src=window.baseUrl("loading_error.png")},!0),R(this.selectButton,()=>{this.callback&&this.callback(this.lastSelected),this.hide()}),K(this.formContainer,"#image-manager-delete","click",()=>{this.lastSelected&&this.loadImageEditForm(this.lastSelected.id,!0)}),K(this.formContainer,"#image-manager-rebuild-thumbs","click",async(i,r)=>{r.disabled=!0,this.lastSelected&&await this.rebuildThumbnails(this.lastSelected.id),r.disabled=!1}),this.formContainer.addEventListener("ajax-form-success",()=>{this.refreshGallery(),this.resetEditForm()}),this.container.addEventListener("dropzone-upload-success",this.refreshGallery.bind(this));let t=this.listContainer.parentElement,e=[];t.addEventListener("wheel",i=>{if(!(Math.ceil(t.scrollHeight-t.scrollTop)===t.clientHeight)||i.deltaY<1)return;let s=Date.now()-1e3;e.push(Date.now()),e=e.filter(a=>a>=s),e.length>5&&this.canLoadMore()&&this.runLoadMore()})}show(t,e="gallery"){this.resetAll(),this.callback=t,this.type=e,this.getPopup().show();let i=e!=="gallery";this.dropzoneContainer.classList.toggle("hidden",i),this.uploadButton.classList.toggle("hidden",i),this.uploadHint.classList.toggle("hidden",i),window.$components.firstOnElement(this.container,"dropzone").toggleActive(!i),this.hasData||(this.loadGallery(),this.hasData=!0)}hide(){this.getPopup().hide()}getPopup(){return window.$components.firstOnElement(this.popupEl,"popup")}async loadGallery(){let t={page:this.page,search:this.searchInput.value||null,uploaded_to:this.uploadedTo,filter_type:this.filter==="all"?null:this.filter},{data:e}=await window.$http.get(`images/${this.type}`,t);t.page===1&&(this.listContainer.innerHTML=""),this.addReturnedHtmlElementsToList(e),Le(this.listContainer)}addReturnedHtmlElementsToList(t){let e=document.createElement("div");e.innerHTML=t;let i=e.querySelector(".load-more");i&&(i.remove(),this.loadMore.innerHTML=i.innerHTML),this.loadMore.toggleAttribute("hidden",!i),window.$components.init(e);for(let r of[...e.children])this.listContainer.appendChild(r)}setActiveFilterTab(t){for(let e of this.filterTabs){let i=e.dataset.filter===t;e.setAttribute("aria-selected",i?"true":"false")}}resetAll(){this.resetState(),this.resetListView(),this.resetSearchView(),this.resetEditForm(),this.setActiveFilterTab("all"),this.selectButton.classList.add("hidden")}resetSearchView(){this.searchInput.value="",this.cancelSearch.toggleAttribute("hidden",!0)}resetEditForm(){this.formContainer.innerHTML="",this.formContainerPlaceholder.removeAttribute("hidden")}resetListView(){De(this.listContainer),this.page=1}refreshGallery(){this.resetListView(),this.loadGallery()}async onImageSelectEvent(t){let e=JSON.parse(t.detail.data),i=e&&e.id===this.lastSelected.id&&Date.now()-this.lastSelectedTime<400,r=t.target.classList.contains("selected");[...this.listContainer.querySelectorAll(".selected")].forEach(o=>{o.classList.remove("selected")}),!r&&!i?(t.target.classList.add("selected"),e=await this.loadImageEditForm(e.id)):i?i&&(e=this.lastSelected):this.resetEditForm(),this.selectButton.classList.toggle("hidden",r),i&&this.callback&&(this.callback(e),this.hide()),this.lastSelected=e,this.lastSelectedTime=Date.now()}async loadImageEditForm(t,e=!1){e||(this.formContainer.innerHTML="");let i=e?{delete:!0}:{},{data:r}=await window.$http.get(`/images/edit/${t}`,i);this.formContainer.innerHTML=r,this.formContainerPlaceholder.setAttribute("hidden",""),window.$components.init(this.formContainer);let o=this.formContainer.querySelector("#image-manager-form-image-data");return JSON.parse(o.text)}runLoadMore(){De(this.loadMore),this.page+=1,this.loadGallery()}canLoadMore(){return this.loadMore.querySelector("button")&&!this.loadMore.hasAttribute("hidden")}async rebuildThumbnails(t){try{let e=await window.$http.put(`/images/${t}/rebuild-thumbnails`);window.$events.success(e.data),this.refreshGallery()}catch(e){window.$events.showResponseError(e)}}};var ii=class extends g{setup(){this.imageElem=this.$refs.image,this.imageInput=this.$refs.imageInput,this.resetInput=this.$refs.resetInput,this.removeInput=this.$refs.removeInput,this.resetButton=this.$refs.resetButton,this.removeButton=this.$refs.removeButton||null,this.defaultImage=this.$opts.defaultImage,this.setupListeners()}setupListeners(){this.resetButton.addEventListener("click",this.reset.bind(this)),this.removeButton&&this.removeButton.addEventListener("click",this.removeImage.bind(this)),this.imageInput.addEventListener("change",this.fileInputChange.bind(this))}fileInputChange(){this.resetInput.setAttribute("disabled","disabled"),this.removeInput&&this.removeInput.setAttribute("disabled","disabled");for(let t of this.imageInput.files)this.imageElem.src=window.URL.createObjectURL(t);this.imageElem.classList.remove("none")}reset(){this.imageInput.value="",this.imageElem.src=this.defaultImage,this.resetInput.removeAttribute("disabled"),this.removeInput&&this.removeInput.setAttribute("disabled","disabled"),this.imageElem.classList.remove("none")}removeImage(){this.imageInput.value="",this.imageElem.classList.add("none"),this.removeInput.removeAttribute("disabled"),this.resetInput.setAttribute("disabled","disabled")}};var ri=class extends g{setup(){this.elem=this.$el,this.menu=this.$refs.menu,this.sortInput=this.$refs.sort,this.orderInput=this.$refs.order,this.form=this.$refs.form,this.setupListeners()}setupListeners(){this.menu.addEventListener("click",t=>{t.target.closest("[data-sort-value]")!==null&&this.sortOptionClick(t)}),this.elem.addEventListener("click",t=>{t.target.closest("[data-sort-dir]")!==null&&this.sortDirectionClick(t)})}sortOptionClick(t){let e=t.target.closest("[data-sort-value]");this.sortInput.value=e.getAttribute("data-sort-value"),t.preventDefault(),this.form.submit()}sortDirectionClick(t){let e=this.orderInput.value;this.orderInput.value=e==="asc"?"desc":"asc",t.preventDefault(),this.form.submit()}};var jc=Go(Oc()),Vc=Go(Uc()),wi=class{constructor(){this.renderer=new jc.default({html:!0}),this.renderer.use(Vc.default,{label:!0})}getRenderer(){return this.renderer}render(t){return this.renderer.render(t)}};function hf(n,t){return document.createElement(n,t)}function df(n,t,e){return document.createElementNS(n,t,e)}function pf(){return te(document.createDocumentFragment())}function ff(n){return document.createTextNode(n)}function mf(n){return document.createComment(n)}function gf(n,t,e){if(qt(n)){let i=n;for(;i&&qt(i);)i=te(i).parent;n=i??n}qt(t)&&(t=te(t,n)),e&&qt(e)&&(e=te(e).firstChildNode),n.insertBefore(t,e)}function bf(n,t){n.removeChild(t)}function vf(n,t){qt(t)&&(t=te(t,n)),n.appendChild(t)}function Wc(n){if(qt(n)){for(;n&&qt(n);)n=te(n).parent;return n??null}return n.parentNode}function wf(n){var t;if(qt(n)){let e=te(n),i=Wc(e);if(i&&e.lastChildNode){let r=Array.from(i.childNodes),o=r.indexOf(e.lastChildNode);return(t=r[o+1])!==null&&t!==void 0?t:null}return null}return n.nextSibling}function yf(n){return n.tagName}function xf(n,t){n.textContent=t}function kf(n){return n.textContent}function Cf(n){return n.nodeType===1}function Ef(n){return n.nodeType===3}function _f(n){return n.nodeType===8}function qt(n){return n.nodeType===11}function te(n,t){var e,i,r;let o=n;return(e=o.parent)!==null&&e!==void 0||(o.parent=t??null),(i=o.firstChildNode)!==null&&i!==void 0||(o.firstChildNode=n.firstChild),(r=o.lastChildNode)!==null&&r!==void 0||(o.lastChildNode=n.lastChild),o}var yi={createElement:hf,createElementNS:df,createTextNode:ff,createDocumentFragment:pf,createComment:mf,insertBefore:gf,removeChild:bf,appendChild:vf,parentNode:Wc,nextSibling:wf,tagName:yf,setTextContent:xf,getTextContent:kf,isElement:Cf,isText:Ef,isComment:_f,isDocumentFragment:qt};function Bt(n,t,e,i,r){let o=t===void 0?void 0:t.key;return{sel:n,data:t,children:e,text:i,elm:r,key:o}}var Gc=Array.isArray;function Kc(n){return typeof n=="string"||typeof n=="number"||n instanceof String||n instanceof Number}function Eo(n){return n===void 0}function ut(n){return n!==void 0}var _o=Bt("",{},[],void 0,void 0);function Je(n,t){var e,i;let r=n.key===t.key,o=((e=n.data)===null||e===void 0?void 0:e.is)===((i=t.data)===null||i===void 0?void 0:i.is),s=n.sel===t.sel,a=!n.sel&&n.sel===t.sel?typeof n.text==typeof t.text:!0;return s&&r&&o&&a}function Af(){throw new Error("The document fragment is not supported on this platform.")}function Df(n,t){return n.isElement(t)}function Lf(n,t){return n.isDocumentFragment(t)}function Tf(n,t,e){var i;let r={};for(let o=t;o<=e;++o){let s=(i=n[o])===null||i===void 0?void 0:i.key;s!==void 0&&(r[s]=o)}return r}var $f=["create","update","remove","destroy","pre","post"];function So(n,t,e){let i={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},r=t!==void 0?t:yi;for(let p of $f)for(let m of n){let w=m[p];w!==void 0&&i[p].push(w)}function o(p){let m=p.id?"#"+p.id:"",w=p.getAttribute("class"),v=w?"."+w.split(" ").join("."):"";return Bt(r.tagName(p).toLowerCase()+m+v,{},[],void 0,p)}function s(p){return Bt(void 0,{},[],void 0,p)}function a(p,m){return function(){if(--m===0){let v=r.parentNode(p);r.removeChild(v,p)}}}function l(p,m){var w,v,b,k;let x,E=p.data;if(E!==void 0){let D=(w=E.hook)===null||w===void 0?void 0:w.init;ut(D)&&(D(p),E=p.data)}let y=p.children,A=p.sel;if(A==="!")Eo(p.text)&&(p.text=""),p.elm=r.createComment(p.text);else if(A!==void 0){let D=A.indexOf("#"),M=A.indexOf(".",D),T=D>0?D:A.length,P=M>0?M:A.length,H=D!==-1||M!==-1?A.slice(0,Math.min(T,P)):A,U=p.elm=ut(E)&&ut(x=E.ns)?r.createElementNS(x,H,E):r.createElement(H,E);for(T0&&U.setAttribute("class",A.slice(P+1).replace(/\./g," ")),x=0;x0&&(u.attrs=l),Object.keys(c).length>0&&(u.dataset=c),a[0]==="s"&&a[1]==="v"&&a[2]==="g"&&(a.length===3||a[3]==="."||a[3]==="#")&&Ao(u,h,a),Bt(a,u,h,void 0,n)}else return e.isText(n)?(i=e.getTextContent(n),Bt(void 0,void 0,void 0,i,n)):e.isComment(n)?(i=e.getTextContent(n),Bt("!",{},[],i,n)):Bt("",{},[],void 0,n)}var If="http://www.w3.org/1999/xlink",Mf="http://www.w3.org/XML/1998/namespace";function Zc(n,t){let e,i=t.elm,r=n.data.attrs,o=t.data.attrs;if(!(!r&&!o)&&r!==o){r=r||{},o=o||{};for(e in o){let s=o[e];r[e]!==s&&(s===!0?i.setAttribute(e,""):s===!1?i.removeAttribute(e):e.charCodeAt(0)!==120?i.setAttribute(e,s):e.charCodeAt(3)===58?i.setAttributeNS(Mf,e,s):e.charCodeAt(5)===58?i.setAttributeNS(If,e,s):i.setAttribute(e,s))}for(e in r)e in o||i.removeAttribute(e)}}var Do={create:Zc,update:Zc};var xi;function Ff(){return xi||(xi=So([Do]),xi)}function Xc(n,t){let e=document.createElement("div");e.innerHTML=t,Ff()(Qe(n),Qe(e))}var ki=class{constructor(t){this.editor=t,this.container=t.config.displayEl,this.doc=null,this.lastDisplayClick=0,this.container.contentDocument.readyState==="complete"?this.onLoad():this.container.addEventListener("load",this.onLoad.bind(this)),this.updateVisibility(t.settings.get("showPreview")),t.settings.onChange("showPreview",e=>this.updateVisibility(e))}updateVisibility(t){let e=this.container.closest(".markdown-editor-wrap");e.style.display=t?null:"none"}onLoad(){this.doc=this.container.contentDocument,this.loadStylesIntoDisplay(),this.doc.body.className="page-content",this.doc.addEventListener("click",this.onDisplayClick.bind(this))}onDisplayClick(t){let e=Date.now()-this.lastDisplayClick<300,i=t.target.closest("a");if(i!==null){t.preventDefault(),window.open(i.getAttribute("href"));return}let r=t.target.closest("[drawio-diagram]");if(r!==null&&e){this.editor.actions.editDrawing(r);return}this.lastDisplayClick=Date.now()}loadStylesIntoDisplay(){this.doc.documentElement.classList.add("markdown-editor-display"),document.documentElement.classList.contains("dark-mode")&&(this.doc.documentElement.style.backgroundColor="#222",this.doc.documentElement.classList.add("dark-mode")),this.doc.head.innerHTML="";let t=document.head.querySelectorAll("style,link[rel=stylesheet]");for(let e of t){let i=e.cloneNode(!0);this.doc.head.appendChild(i)}}patchWithHtml(t){let{body:e}=this.doc;if(e.children.length===0){let r=document.createElement("div");this.doc.body.append(r)}let i=e.children[0];Xc(i,t)}scrollToIndex(t){let e=this.doc.body?.children[0]?.children;if(e&&e.length<=t)return;(t===-1?e[e.length-1]:e[t]).scrollIntoView({block:"start",inline:"nearest",behavior:"smooth"})}};function Ci(n){return new Promise((t,e)=>{n.oncomplete=n.onsuccess=()=>t(n.result),n.onabort=n.onerror=()=>e(n.error)})}function qf(n,t){let e=indexedDB.open(n);e.onupgradeneeded=()=>e.result.createObjectStore(t);let i=Ci(e);return(r,o)=>i.then(s=>o(s.transaction(t,r).objectStore(t)))}var Lo;function To(){return Lo||(Lo=qf("keyval-store","keyval")),Lo}function $o(n,t=To()){return t("readonly",e=>Ci(e.get(n)))}function Io(n,t,e=To()){return e("readwrite",i=>(i.put(t,n),Ci(i.transaction)))}function Mo(n,t=To()){return t("readwrite",e=>(e.delete(n),Ci(e.transaction)))}var $t=null,Bo,Ei,Fo,qo="last-drawing-save";function Po(n){$t.contentWindow.postMessage(JSON.stringify(n),Bo)}function Pf(n){Io(qo,n.data),Fo&&Fo(n.data).then(()=>{Mo(qo)})}function Of(n){Po({action:"export",format:"xmlpng",xml:n.xml,spin:"Updating drawing"})}function Rf(){Ei&&Ei().then(n=>{Po({action:"load",autosave:1,xml:n})})}function Nf(){let n={};window.$events.emitPublic($t,"editor-drawio::configure",{config:n}),Po({action:"configure",config:n})}function Yc(){window.removeEventListener("message",Jc),$t&&document.body.removeChild($t)}function Jc(n){if(!n.data||n.data.length<1||n.origin!==Bo)return;let t=JSON.parse(n.data);t.event==="init"?Rf():t.event==="exit"?Yc():t.event==="save"?Of(t):t.event==="export"?Pf(t):t.event==="configure"&&Nf()}async function zf(){let n=await $o(qo),t=document.getElementById("unsaved-drawing-dialog");t||console.error("Missing expected unsaved-drawing dialog"),n&&await window.$components.firstOnElement(t,"confirm-dialog").show()&&(Ei=async()=>n)}async function tn(n,t,e){Ei=t,Fo=e,await zf(),$t=document.createElement("iframe"),$t.setAttribute("frameborder","0"),window.addEventListener("message",Jc),$t.setAttribute("src",n),$t.setAttribute("class","fullscreen"),$t.style.backgroundColor="#FFFFFF",document.body.appendChild($t),Bo=new URL(n).origin}async function Oo(n,t){let e={image:n,uploaded_to:t};return(await window.$http.post(window.baseUrl("/images/drawio"),e)).data}function ee(){Yc()}async function _i(n){try{return`data:image/png;base64,${(await window.$http.get(window.baseUrl(`/images/drawio/base64/${n}`))).data.content}`}catch(t){throw t instanceof window.$http.HttpError&&window.$events.showResponseError(t),ee(),t}}var en,Ro,xe,Si,ke,Ai,Pt,ne,Wt,ye,rt,ht,nn,No,rn,zo,Ce,Di,dt,vt,Ti,tu,Li=class{constructor(t){ot(this,en);ot(this,xe);ot(this,ke);ot(this,Pt);ot(this,Wt);ot(this,rt);ot(this,nn);ot(this,rn);ot(this,Ce);ot(this,dt);ot(this,Ti);this.editor=t,this.lastContent={html:"",markdown:""}}updateAndRender(){let t=L(this,xe,Si).call(this);this.editor.config.inputEl.value=t;let e=this.editor.markdown.render(t);window.$events.emit("editor-html-change",""),window.$events.emit("editor-markdown-change",""),this.lastContent.html=e,this.lastContent.markdown=t,this.editor.display.patchWithHtml(e)}getContent(){return this.lastContent}showImageInsert(){window.$components.first("image-manager").show(e=>{let i=e.thumbs?.display||e.url,o=`[![${L(this,Wt,ye).call(this)||e.name}](${i})](${e.url})`;L(this,Pt,ne).call(this,o,o.length)},"gallery")}insertImage(){let t=`![${L(this,Wt,ye).call(this)}](http://)`;L(this,Pt,ne).call(this,t,t.length-1)}insertLink(){let t=L(this,Wt,ye).call(this),e=`[${t}]()`,i=t===""?-3:-1;L(this,Pt,ne).call(this,e,e.length+i)}showImageManager(){let t=L(this,rt,ht).call(this);window.$components.first("image-manager").show(i=>{L(this,en,Ro).call(this,i,t)},"drawio")}showLinkSelector(){let t=L(this,rt,ht).call(this),e=window.$components.first("entity-selector-popup"),i=L(this,Wt,ye).call(this,t);e.show(r=>{let s=`[${i||r.name}](${r.link})`;L(this,Pt,ne).call(this,s,s.length,t)},{initialValue:i,searchEndpoint:"/search/entity-selector",entityTypes:"page,book,chapter,bookshelf",entityPermission:"view"})}startDrawing(){let t=this.editor.config.drawioUrl;if(!t)return;let e=L(this,rt,ht).call(this);tn(t,()=>Promise.resolve(""),async i=>{let r={image:i,uploaded_to:Number(this.editor.config.pageId)};try{let o=await window.$http.post("/images/drawio",r);L(this,en,Ro).call(this,o.data,e),ee()}catch(o){throw this.handleDrawingUploadError(o),new Error(`Failed to save image with error: ${o}`)}})}editDrawing(t){let{drawioUrl:e}=this.editor.config;if(!e)return;let i=L(this,rt,ht).call(this),r=t.getAttribute("drawio-diagram");tn(e,()=>_i(r),async o=>{let s={image:o,uploaded_to:Number(this.editor.config.pageId)};try{let a=await window.$http.post("/images/drawio",s),l=`
    `,c=L(this,xe,Si).call(this).split(` `).map(u=>u.indexOf(`drawio-diagram="${r}"`)!==-1?l:u).join(` `);L(this,ke,Ai).call(this,c,i),ee()}catch(a){throw this.handleDrawingUploadError(a),new Error(`Failed to save image with error: ${a}`)}})}handleDrawingUploadError(t){t.status===413?window.$events.emit("error",this.editor.config.text.serverUploadLimit):window.$events.emit("error",this.editor.config.text.imageUploadError),console.error(t)}fullScreen(){let{container:t}=this.editor.config,e=t.classList.contains("fullscreen");t.classList.toggle("fullscreen",!e),document.body.classList.toggle("markdown-fullscreen",!e)}scrollToText(t){if(!t)return;let e=this.editor.cm.state.doc,i=1,r=-1;for(let s of e.iterLines()){if(s.includes(t)){r=i;break}i+=1}if(r===-1)return;let o=e.line(r);L(this,Ti,tu).call(this,o.from,o.to,!0),this.focus()}focus(){this.editor.cm.hasFocus||this.editor.cm.focus()}insertContent(t){L(this,Pt,ne).call(this,t,t.length)}prependContent(t){t=L(this,nn,No).call(this,t);let i=L(this,rt,ht).call(this).from+t.length+1;L(this,dt,vt).call(this,0,0,`${t} `,i),this.focus()}appendContent(t){t=L(this,nn,No).call(this,t),L(this,dt,vt).call(this,this.editor.cm.state.doc.length,` ${t}`),this.focus()}replaceContent(t){L(this,ke,Ai).call(this,t)}replaceLineStart(t){let e=L(this,rt,ht).call(this),i=this.editor.cm.state.doc.lineAt(e.from),r=i.text,o=r.split(" ")[0];if(o===t){let c=r.replace(`${t} `,""),u=e.from+(c.length-r.length);L(this,dt,vt).call(this,i.from,i.to,c,u);return}let s=r;/^[#>`]/.test(o)?s=r.replace(o,t).trim():t!==""&&(s=`${t} ${r}`);let l=e.from+(s.length-r.length);L(this,dt,vt).call(this,i.from,i.to,s,l)}wrapSelection(t,e){let i=L(this,rt,ht).call(this),r=L(this,Wt,ye).call(this,i);if(!r){L(this,Ce,Di).call(this,t,e);return}let o=r,s;r.startsWith(t)&&r.endsWith(e)?(o=r.slice(t.length,r.length-e.length),s=i.extend(i.from,i.to-(t.length+e.length))):(o=`${t}${r}${e}`,s=i.extend(i.from,i.to+(t.length+e.length))),L(this,dt,vt).call(this,i.from,i.to,o,s.anchor,s.head)}replaceLineStartForOrderedList(){let t=L(this,rt,ht).call(this),e=this.editor.cm.state.doc.lineAt(t.from),r=this.editor.cm.state.doc.line(e.number-1).text.match(/^(\s*)(\d)([).])\s/)||[],o=(Number(r[2])||0)+1,s=r[1]||"",a=r[3]||".",l=`${s}${o}${a}`;return this.replaceLineStart(l)}cycleCalloutTypeAtSelection(){let t=L(this,rt,ht).call(this),e=this.editor.cm.state.doc.lineAt(t.from),i=["info","success","warning","danger"],r=i.join("|"),s=new RegExp(`class="((${r})\\s+callout|callout\\s+(${r}))"`,"i").exec(e.text),a=(s?s[2]||s[3]:"").toLowerCase();if(a===i[i.length-1])L(this,Ce,Di).call(this,`

    `,"

    ");else if(a==="")L(this,Ce,Di).call(this,'

    ',"

    ");else{let l=i.indexOf(a)+1,c=i[l],u=e.text.replace(s[0],s[0].replace(a,c)),h=u.length-e.text.length;L(this,dt,vt).call(this,e.from,e.to,u,t.anchor+h,t.head+h)}}syncDisplayPosition(t){let e=t.target;if(Math.abs(e.scrollHeight-e.clientHeight-e.scrollTop)<1){this.editor.display.scrollToIndex(-1);return}let r=this.editor.cm.lineBlockAtHeight(e.scrollTop),o=this.editor.cm.state.sliceDoc(0,r.from),l=new DOMParser().parseFromString(this.editor.markdown.render(o),"text/html").documentElement.querySelectorAll("body > *");this.editor.display.scrollToIndex(l.length)}async insertTemplate(t,e,i){let r=this.editor.cm.posAtCoords({x:e,y:i},!1),{data:o}=await window.$http.get(`/templates/${t}`),s=o.markdown||o.html;L(this,dt,vt).call(this,r,r,s,r)}insertClipboardImages(t,e,i){let r=this.editor.cm.posAtCoords({x:e,y:i},!1);for(let o of t)this.uploadImage(o,r)}async uploadImage(t,e=null){if(t===null||t.type.indexOf("image")!==0)return;let i="png";if(e===null&&(e=L(this,rt,ht).call(this).from),t.name){let c=t.name.match(/\.(.+)$/);c.length>1&&(i=c[1])}let r=`image-${Math.random().toString(16).slice(2)}`,s=`![](${window.baseUrl(`/loading.gif#upload${r}`)})`;L(this,dt,vt).call(this,e,e,s,e);let a=`image-${Date.now()}.${i}`,l=new FormData;l.append("file",t,a),l.append("uploaded_to",this.editor.config.pageId);try{let{data:c}=await window.$http.post("/images/gallery",l),u=`[![](${c.thumbs.display})](${c.url})`;L(this,rn,zo).call(this,s,u)}catch(c){window.$events.error(c?.data?.message||this.editor.config.text.imageUploadError),L(this,rn,zo).call(this,s,""),console.error(c)}}};en=new WeakSet,Ro=function(t,e){let i=`
    `;L(this,Pt,ne).call(this,i,i.length,e)},xe=new WeakSet,Si=function(){return this.editor.cm.state.doc.toString()},ke=new WeakSet,Ai=function(t,e=null){e=e||L(this,rt,ht).call(this);let i=this.editor.cm.state.toText(t),r=Math.min(e.from,i.length);L(this,dt,vt).call(this,0,this.editor.cm.state.doc.length,t,r),this.focus()},Pt=new WeakSet,ne=function(t,e=0,i=null){i=i||this.editor.cm.state.selection.main;let r=i.from+e;L(this,dt,vt).call(this,i.from,i.to,t,r),this.focus()},Wt=new WeakSet,ye=function(t=null){return t=t||L(this,rt,ht).call(this),this.editor.cm.state.sliceDoc(t.from,t.to)},rt=new WeakSet,ht=function(){return this.editor.cm.state.selection.main},nn=new WeakSet,No=function(t){return t.replace(/\r\n|\r/g,` `)},rn=new WeakSet,zo=function(t,e){let i=L(this,xe,Si).call(this).replace(t,e);L(this,ke,Ai).call(this,i)},Ce=new WeakSet,Di=function(t,e){let i=L(this,rt,ht).call(this),r=this.editor.cm.state.doc.lineAt(i.from),o=r.text,s,a=0;o.startsWith(t)&&o.endsWith(e)?(s=o.slice(t.length,o.length-e.length),a=-t.length):(s=`${t}${o}${e}`,a=t.length),L(this,dt,vt).call(this,r.from,r.to,s,i.from+a)},dt=new WeakSet,vt=function(t,e=null,i=null,r=null,o=null){let s={changes:{from:t,to:e,insert:i}};r&&(s.selection={anchor:r},o&&(s.selection.head=o)),this.editor.cm.dispatch(s)},Ti=new WeakSet,tu=function(t,e,i=!1){this.editor.cm.dispatch({selection:{anchor:t,head:e},scrollIntoView:i})};var $i=class{constructor(t){this.settingMap={scrollSync:!0,showPreview:!0,editorWidth:50},this.changeListeners={},this.loadFromLocalStorage(),this.applyToInputs(t),this.listenToInputChanges(t)}applyToInputs(t){for(let e of t){let i=e.getAttribute("name").replace("md-","");e.checked=this.settingMap[i]}}listenToInputChanges(t){for(let e of t)e.addEventListener("change",()=>{let i=e.getAttribute("name").replace("md-","");this.set(i,e.checked)})}loadFromLocalStorage(){let t=window.localStorage.getItem("md-editor-settings");if(!t)return;let e=JSON.parse(t);for(let[i,r]of Object.entries(e))r!==null&&this.settingMap[i]!==void 0&&(this.settingMap[i]=r)}set(t,e){this.settingMap[t]=e,window.localStorage.setItem("md-editor-settings",JSON.stringify(this.settingMap));for(let i of this.changeListeners[t]||[])i(e)}get(t){return this.settingMap[t]||null}onChange(t,e){let i=this.changeListeners[t]||[];i.push(e),this.changeListeners[t]=i}};function Ii({html:n,markdown:t}){return t||n}function eu(n){window.$events.listen("editor::replace",t=>{let e=Ii(t);n.actions.replaceContent(e)}),window.$events.listen("editor::append",t=>{let e=Ii(t);n.actions.appendContent(e)}),window.$events.listen("editor::prepend",t=>{let e=Ii(t);n.actions.prependContent(e)}),window.$events.listen("editor::insert",t=>{let e=Ii(t);n.actions.insertContent(e)}),window.$events.listen("editor::focus",()=>{n.actions.focus()})}function Hf(n){let t={};return t["Shift-Mod-i"]=()=>n.actions.insertImage(),t["Mod-s"]=()=>window.$events.emit("editor-save-draft"),t["Mod-Enter"]=()=>window.$events.emit("editor-save-page"),t["Shift-Mod-k"]=()=>n.actions.showLinkSelector(),t["Mod-k"]=()=>n.actions.insertLink(),t["Mod-1"]=()=>n.actions.replaceLineStart("##"),t["Mod-2"]=()=>n.actions.replaceLineStart("###"),t["Mod-3"]=()=>n.actions.replaceLineStart("####"),t["Mod-4"]=()=>n.actions.replaceLineStart("#####"),t["Mod-5"]=()=>n.actions.replaceLineStart(""),t["Mod-d"]=()=>n.actions.replaceLineStart(""),t["Mod-6"]=()=>n.actions.replaceLineStart(">"),t["Mod-q"]=()=>n.actions.replaceLineStart(">"),t["Mod-7"]=()=>n.actions.wrapSelection("\n```\n","\n```"),t["Mod-8"]=()=>n.actions.wrapSelection("`","`"),t["Shift-Mod-e"]=()=>n.actions.wrapSelection("`","`"),t["Mod-9"]=()=>n.actions.cycleCalloutTypeAtSelection(),t["Mod-p"]=()=>n.actions.replaceLineStart("-"),t["Mod-o"]=()=>n.actions.replaceLineStartForOrderedList(),t}function nu(n){let t=Hf(n),e=[],i=r=>()=>(r(),!0);for(let[r,o]of Object.entries(t))e.push({key:r,run:i(o),preventDefault:!0});return e}async function iu(n){let t=await window.importVersioned("code");function e(a){a.docChanged&&n.actions.updateAndRender()}let i=Nt(n.actions.syncDisplayPosition.bind(n.actions),100,!1),r=n.settings.get("scrollSync");n.settings.onChange("scrollSync",a=>{r=a});let o={scroll:a=>r&&i(a),drop:a=>{let l=a.dataTransfer.getData("bookstack/template");l&&(a.preventDefault(),n.actions.insertTemplate(l,a.pageX,a.pageY));let u=new Ft(a.dataTransfer).getImages();u.length>0&&(a.stopPropagation(),a.preventDefault(),n.actions.insertClipboardImages(u,a.pageX,a.pageY))},paste:a=>{let l=new Ft(a.clipboardData||a.dataTransfer);if(!l.hasItems()||l.containsTabularData())return;let c=l.getImages();for(let u of c)n.actions.uploadImage(u)}},s=t.markdownEditor(n.config.inputEl,e,o,nu(n));return window.mdEditorView=s,s}async function ru(n){let t={config:n,markdown:new wi,settings:new $i(n.settingInputs)};return t.actions=new Li(t),t.display=new ki(t),t.cm=await iu(t),eu(t),t}var Mi=class extends g{setup(){this.elem=this.$el,this.pageId=this.$opts.pageId,this.textDirection=this.$opts.textDirection,this.imageUploadErrorText=this.$opts.imageUploadErrorText,this.serverUploadLimitText=this.$opts.serverUploadLimitText,this.display=this.$refs.display,this.input=this.$refs.input,this.divider=this.$refs.divider,this.displayWrap=this.$refs.displayWrap;let{settingContainer:t}=this.$refs,e=t.querySelectorAll('input[type="checkbox"]');this.editor=null,ru({pageId:this.pageId,container:this.elem,displayEl:this.display,inputEl:this.input,drawioUrl:this.getDrawioUrl(),settingInputs:Array.from(e),text:{serverUploadLimit:this.serverUploadLimitText,imageUploadError:this.imageUploadErrorText}}).then(i=>{this.editor=i,this.setupListeners(),this.emitEditorEvents(),this.scrollToTextIfNeeded(),this.editor.actions.updateAndRender()})}emitEditorEvents(){window.$events.emitPublic(this.elem,"editor-markdown::setup",{markdownIt:this.editor.markdown.getRenderer(),displayEl:this.display,cmEditorView:this.editor.cm})}setupListeners(){this.elem.addEventListener("click",t=>{let e=t.target.closest("button[data-action]");if(e===null)return;let i=e.getAttribute("data-action");if(i==="insertImage"&&this.editor.actions.showImageInsert(),i==="insertLink"&&this.editor.actions.showLinkSelector(),i==="insertDrawing"&&(t.ctrlKey||t.metaKey)){this.editor.actions.showImageManager();return}i==="insertDrawing"&&this.editor.actions.startDrawing(),i==="fullscreen"&&this.editor.actions.fullScreen()}),this.elem.addEventListener("click",t=>{let e=t.target.closest(".editor-toolbar-label");if(!e)return;let i=this.elem.querySelectorAll(".markdown-editor-wrap");for(let r of i)r.classList.remove("active");e.closest(".markdown-editor-wrap").classList.add("active")}),this.handleDividerDrag()}handleDividerDrag(){this.divider.addEventListener("pointerdown",()=>{let e=this.elem.getBoundingClientRect(),i=o=>{let s=o.pageX-e.left,a=Math.min(Math.max(20,Math.floor(s/e.width*100)),80);this.displayWrap.style.flexBasis=`${100-a}%`,this.editor.settings.set("editorWidth",a)},r=()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",r),this.display.style.pointerEvents=null,document.body.style.userSelect=null};this.display.style.pointerEvents="none",document.body.style.userSelect="none",window.addEventListener("pointermove",i),window.addEventListener("pointerup",r)});let t=this.editor.settings.get("editorWidth");t&&(this.displayWrap.style.flexBasis=`${100-t}%`)}scrollToTextIfNeeded(){let e=new URL(window.location).searchParams.get("content-text");e&&this.editor.actions.scrollToText(e)}getDrawioUrl(){let t=document.querySelector("[drawio-url]");return t&&t.getAttribute("drawio-url")||""}getContent(){return this.editor.actions.getContent()}};var Fi=class extends g{setup(){this.container=this.$el,this.inputContainer=this.$refs.inputContainer,this.inviteOption=this.container.querySelector("input[name=send_invite]"),this.inviteOption&&(this.inviteOption.addEventListener("change",this.inviteOptionChange.bind(this)),this.inviteOptionChange())}inviteOptionChange(){let t=this.inviteOption.value==="true",e=this.container.querySelectorAll("input[type=password]");for(let i of e)i.disabled=t;this.inputContainer.style.display=t?"none":"block"}};var qi=class extends g{setup(){this.container=this.$el,this.type=this.$opts.type,this.textElem=this.container.querySelector("span"),this.autoHide=this.$opts.autoHide==="true",this.initialShow=this.$opts.show==="true",this.container.style.display="grid",window.$events.listen(this.type,t=>{this.show(t)}),this.container.addEventListener("click",this.hide.bind(this)),this.initialShow&&setTimeout(()=>this.show(this.textElem.textContent),100),this.hideCleanup=this.hideCleanup.bind(this)}show(t=""){if(this.container.removeEventListener("transitionend",this.hideCleanup),this.textElem.textContent=t,this.container.style.display="grid",setTimeout(()=>{this.container.classList.add("showing")},1),this.autoHide){let e=t.split(" ").length,i=Math.max(2e3,1e3+250*e);setTimeout(this.hide.bind(this),i)}}hide(){this.container.classList.remove("showing"),this.container.addEventListener("transitionend",this.hideCleanup)}hideCleanup(){this.container.style.display="none",this.container.removeEventListener("transitionend",this.hideCleanup)}};var Bi=class extends g{setup(){this.removeButton=this.$refs.remove,this.showButton=this.$refs.show,this.input=this.$refs.input,this.setupListeners()}setupListeners(){R(this.removeButton,()=>{this.input.value="",this.input.classList.add("hidden"),this.removeButton.classList.add("hidden"),this.showButton.classList.remove("hidden")}),R(this.showButton,()=>{this.input.classList.remove("hidden"),this.removeButton.classList.remove("hidden"),this.showButton.classList.add("hidden")})}};var Pi=class extends g{setup(){this.commentId=this.$opts.commentId,this.commentLocalId=this.$opts.commentLocalId,this.commentParentId=this.$opts.commentParentId,this.deletedText=this.$opts.deletedText,this.updatedText=this.$opts.updatedText,this.container=this.$el,this.contentContainer=this.$refs.contentContainer,this.form=this.$refs.form,this.formCancel=this.$refs.formCancel,this.editButton=this.$refs.editButton,this.deleteButton=this.$refs.deleteButton,this.replyButton=this.$refs.replyButton,this.input=this.$refs.input,this.setupListeners()}setupListeners(){this.replyButton&&this.replyButton.addEventListener("click",()=>this.$emit("reply",{id:this.commentLocalId,element:this.container})),this.editButton&&(this.editButton.addEventListener("click",this.startEdit.bind(this)),this.form.addEventListener("submit",this.update.bind(this)),this.formCancel.addEventListener("click",()=>this.toggleEditMode(!1))),this.deleteButton&&this.deleteButton.addEventListener("click",this.delete.bind(this))}toggleEditMode(t){this.contentContainer.toggleAttribute("hidden",t),this.form.toggleAttribute("hidden",!t)}startEdit(){this.toggleEditMode(!0);let t=this.$refs.input.value.split(` -`).length;this.$refs.input.style.height=`${t*20+40}px`}async update(t){t.preventDefault();let e=this.showLoading();this.form.toggleAttribute("hidden",!0);let i={text:this.input.value,parent_id:this.parentId||null};try{let r=await window.$http.put(`/comment/${this.commentId}`,i),o=_t(r.data);this.container.replaceWith(o),window.$events.success(this.updatedText)}catch(r){console.error(r),window.$events.showValidationErrors(r),this.form.toggleAttribute("hidden",!1),e.remove()}}async delete(){this.showLoading(),await window.$http.delete(`/comment/${this.commentId}`),this.container.closest(".comment-branch").remove(),window.$events.success(this.deletedText),this.$emit("delete")}showLoading(){let t=ae();return t.classList.add("px-l"),this.container.append(t),t}};var Oi=class extends g{setup(){this.elem=this.$el,this.pageId=Number(this.$opts.pageId),this.container=this.$refs.commentContainer,this.commentCountBar=this.$refs.commentCountBar,this.commentsTitle=this.$refs.commentsTitle,this.addButtonContainer=this.$refs.addButtonContainer,this.replyToRow=this.$refs.replyToRow,this.formContainer=this.$refs.formContainer,this.form=this.$refs.form,this.formInput=this.$refs.formInput,this.formReplyLink=this.$refs.formReplyLink,this.addCommentButton=this.$refs.addCommentButton,this.hideFormButton=this.$refs.hideFormButton,this.removeReplyToButton=this.$refs.removeReplyToButton,this.createdText=this.$opts.createdText,this.countText=this.$opts.countText,this.parentId=null,this.formReplyText=this.formReplyLink?.textContent||"",this.setupListeners()}setupListeners(){this.elem.addEventListener("page-comment-delete",()=>{this.updateCount(),this.hideForm()}),this.elem.addEventListener("page-comment-reply",t=>{this.setReply(t.detail.id,t.detail.element)}),this.form&&(this.removeReplyToButton.addEventListener("click",this.removeReplyTo.bind(this)),this.hideFormButton.addEventListener("click",this.hideForm.bind(this)),this.addCommentButton.addEventListener("click",this.showForm.bind(this)),this.form.addEventListener("submit",this.saveComment.bind(this)))}saveComment(t){t.preventDefault(),t.stopPropagation();let e=ae();e.classList.add("px-l"),this.form.after(e),this.form.toggleAttribute("hidden",!0);let r={text:this.formInput.value,parent_id:this.parentId||null};window.$http.post(`/comment/${this.pageId}`,r).then(o=>{let s=_t(o.data);this.formContainer.after(s),window.$events.success(this.createdText),this.hideForm(),this.updateCount()}).catch(o=>{this.form.toggleAttribute("hidden",!1),window.$events.showValidationErrors(o)}),this.form.toggleAttribute("hidden",!1),e.remove()}updateCount(){let t=this.getCommentCount();this.commentsTitle.textContent=window.trans_plural(this.countText,t,{count:t})}resetForm(){this.formInput.value="",this.parentId=null,this.replyToRow.toggleAttribute("hidden",!0),this.container.append(this.formContainer)}showForm(){this.formContainer.toggleAttribute("hidden",!1),this.addButtonContainer.toggleAttribute("hidden",!0),this.formContainer.scrollIntoView({behavior:"smooth",block:"nearest"}),setTimeout(()=>{this.formInput.focus()},100)}hideForm(){this.resetForm(),this.formContainer.toggleAttribute("hidden",!0),this.getCommentCount()>0?this.elem.append(this.addButtonContainer):this.commentCountBar.append(this.addButtonContainer),this.addButtonContainer.toggleAttribute("hidden",!1)}getCommentCount(){return this.container.querySelectorAll('[component="page-comment"]').length}setReply(t,e){e.closest(".comment-branch").querySelector(".comment-branch-children").append(this.formContainer),this.showForm(),this.parentId=t,this.replyToRow.toggleAttribute("hidden",!1),this.formReplyLink.textContent=this.formReplyText.replace("1234",this.parentId),this.formReplyLink.href=`#comment${this.parentId}`}removeReplyTo(){this.parentId=null,this.replyToRow.toggleAttribute("hidden",!0),this.container.append(this.formContainer),this.showForm()}};function Uf(n,t){xr(`#page-navigation a[href="#${n}"]`,e=>{e.closest("li").classList.toggle("current-heading",t)})}function jf(n){for(let t of n){let e=t.intersectionRatio===1;Uf(t.target.id,e)}}function Vf(n){let t={rootMargin:"0px 0px 0px 0px",threshold:1},e=new IntersectionObserver(jf,t);for(let i of n)e.observe(i)}var Ri=class extends g{setup(){if(this.container=this.$el,this.pageId=this.$opts.pageId,window.importVersioned("code").then(e=>e.highlight()),this.setupNavHighlighting(),window.location.hash){let e=window.location.hash.replace(/%20/g," ").substring(1);this.goToText(e)}let t=document.querySelector(".sidebar-page-nav");t&&K(t,"a","click",(e,i)=>{e.preventDefault(),window.$components.first("tri-layout").showContent();let r=i.getAttribute("href").substr(1);this.goToText(r),window.history.pushState(null,null,`#${r}`)})}goToText(t){let e=document.getElementById(t);if(xr(".page-content [data-highlighted]",i=>{i.removeAttribute("data-highlighted"),i.style.backgroundColor=null}),e!==null)Cr(e);else{let i=ts(".page-content > div > *",t);i&&Cr(i)}}setupNavHighlighting(){let t=document.querySelector(".sidebar-page-nav"),e=document.querySelector(".page-content").querySelectorAll("h1, h2, h3, h4, h5, h6");e.length>0&&t!==null&&Vf(e)}};function ou(n){let t=new Date(n*1e3),e=t.getHours(),i=t.getMinutes();return`${(e>9?"":"0")+e}:${(i>9?"":"0")+i}`}var Ni=class extends g{setup(){this.draftsEnabled=this.$opts.draftsEnabled==="true",this.editorType=this.$opts.editorType,this.pageId=Number(this.$opts.pageId),this.isNewDraft=this.$opts.pageNewDraft==="true",this.hasDefaultTitle=this.$opts.hasDefaultTitle||!1,this.container=this.$el,this.titleElem=this.$refs.titleContainer.querySelector("input"),this.saveDraftButton=this.$refs.saveDraft,this.discardDraftButton=this.$refs.discardDraft,this.discardDraftWrap=this.$refs.discardDraftWrap,this.deleteDraftButton=this.$refs.deleteDraft,this.deleteDraftWrap=this.$refs.deleteDraftWrap,this.draftDisplay=this.$refs.draftDisplay,this.draftDisplayIcon=this.$refs.draftDisplayIcon,this.changelogInput=this.$refs.changelogInput,this.changelogDisplay=this.$refs.changelogDisplay,this.changeEditorButtons=this.$manyRefs.changeEditor||[],this.switchDialogContainer=this.$refs.switchDialog,this.deleteDraftDialogContainer=this.$refs.deleteDraftDialog,this.draftText=this.$opts.draftText,this.autosaveFailText=this.$opts.autosaveFailText,this.editingPageText=this.$opts.editingPageText,this.draftDiscardedText=this.$opts.draftDiscardedText,this.draftDeleteText=this.$opts.draftDeleteText,this.draftDeleteFailText=this.$opts.draftDeleteFailText,this.setChangelogText=this.$opts.setChangelogText,this.autoSave={interval:null,frequency:3e4,last:0,pendingChange:!1},this.shownWarningsCache=new Set,this.pageId!==0&&this.draftsEnabled&&window.setTimeout(()=>{this.startAutoSave()},1e3),this.draftDisplay.innerHTML=this.draftText,this.setupListeners(),this.setInitialFocus()}setupListeners(){window.$events.listen("editor-save-draft",this.saveDraft.bind(this)),window.$events.listen("editor-save-page",this.savePage.bind(this));let t=()=>{this.autoSave.pendingChange=!0};window.$events.listen("editor-html-change",t),window.$events.listen("editor-markdown-change",t),this.titleElem.addEventListener("input",t);let e=Nt(this.updateChangelogDisplay.bind(this),300,!1);this.changelogInput.addEventListener("input",e),R(this.saveDraftButton,this.saveDraft.bind(this)),R(this.discardDraftButton,this.discardDraft.bind(this)),R(this.deleteDraftButton,this.deleteDraft.bind(this)),R(this.changeEditorButtons,this.changeEditor.bind(this))}setInitialFocus(){if(this.hasDefaultTitle){this.titleElem.select();return}window.setTimeout(()=>{window.$events.emit("editor::focus","")},500)}startAutoSave(){this.autoSave.interval=window.setInterval(this.runAutoSave.bind(this),this.autoSave.frequency)}runAutoSave(){Date.now()-this.autoSave.last{this.draftDisplayIcon.classList.remove("visible")},2e3)}async discardDraft(t=!0){let e;try{e=await window.$http.get(`/ajax/page/${this.pageId}`)}catch(i){console.error(i);return}this.autoSave.interval&&window.clearInterval(this.autoSave.interval),this.draftDisplay.innerText=this.editingPageText,this.discardDraftWrap.toggleAttribute("hidden",!0),window.$events.emit("editor::replace",{html:e.data.html,markdown:e.data.markdown}),this.titleElem.value=e.data.name,window.setTimeout(()=>{this.startAutoSave()},1e3),t&&window.$events.success(this.draftDiscardedText)}async deleteDraft(){if(await window.$components.firstOnElement(this.deleteDraftDialogContainer,"confirm-dialog").show())try{let i=this.discardDraft(!1),r=window.$http.delete(`/page-revisions/user-drafts/${this.pageId}`);await Promise.all([i,r]),window.$events.success(this.draftDeleteText),this.deleteDraftWrap.toggleAttribute("hidden",!0)}catch(i){console.error(i),window.$events.error(this.draftDeleteFailText)}}updateChangelogDisplay(){let t=this.changelogInput.value.trim();t.length===0?t=this.setChangelogText:t.length>16&&(t=`${t.slice(0,16)}...`),this.changelogDisplay.innerText=t}async changeEditor(t){t.preventDefault();let e=t.target.closest("a").href,i=window.$components.firstOnElement(this.switchDialogContainer,"confirm-dialog"),[r,o]=await Promise.all([this.saveDraft(),i.show()]);r&&o&&(window.location=e)}getEditorComponent(){return window.$components.first("markdown-editor")||window.$components.first("wysiwyg-editor")}};function zi(n,t){n.toggleAttribute("hidden",!t)}var Hi=class extends g{setup(){this.input=this.$refs.input,this.resetButton=this.$refs.resetButton,this.selectButton=this.$refs.selectButton,this.display=this.$refs.display,this.defaultDisplay=this.$refs.defaultDisplay,this.buttonSep=this.$refs.buttonSeperator,this.selectorEndpoint=this.$opts.selectorEndpoint,this.value=this.input.value,this.setupListeners()}setupListeners(){this.selectButton.addEventListener("click",this.showPopup.bind(this)),this.display.parentElement.addEventListener("click",this.showPopup.bind(this)),this.display.addEventListener("click",t=>t.stopPropagation()),this.resetButton.addEventListener("click",()=>{this.setValue("","")})}showPopup(){window.$components.first("entity-selector-popup").show(e=>{this.setValue(e.id,e.name)},"",{searchEndpoint:this.selectorEndpoint,entityTypes:"page",entityPermission:"view"})}setValue(t,e){this.value=t,this.input.value=t,this.controlView(e)}controlView(t){let e=this.value&&this.value!==0;if(zi(this.resetButton,e),zi(this.buttonSep,e),zi(this.defaultDisplay,!e),zi(this.display,e),e){let i=this.getAssetIdFromVal();this.display.textContent=`#${i}, ${t}`,this.display.href=window.baseUrl(`/link/${i}`)}}getAssetIdFromVal(){return Number(this.value)}};var Ui=class extends g{setup(){this.container=this.$el,this.cellSelector=this.$opts.cellSelector||"td,th",this.rowSelector=this.$opts.rowSelector||"tr";for(let t of this.$manyRefs.toggleAll||[])t.addEventListener("click",this.toggleAllClick.bind(this));for(let t of this.$manyRefs.toggleRow||[])t.addEventListener("click",this.toggleRowClick.bind(this));for(let t of this.$manyRefs.toggleColumn||[])t.addEventListener("click",this.toggleColumnClick.bind(this))}toggleAllClick(t){t.preventDefault(),this.toggleAllInElement(this.container)}toggleRowClick(t){t.preventDefault(),this.toggleAllInElement(t.target.closest(this.rowSelector))}toggleColumnClick(t){t.preventDefault();let e=t.target.closest(this.cellSelector),i=Array.from(e.parentElement.children).indexOf(e),r=this.container.querySelectorAll(this.rowSelector),o=[];for(let s of r){let a=s.children[i];a&&o.push(...a.querySelectorAll("input[type=checkbox]"))}this.toggleAllInputs(o)}toggleAllInElement(t){let e=t.querySelectorAll("input[type=checkbox]");this.toggleAllInputs(e)}toggleAllInputs(t){let e=t.length>0?t[0].checked:!1;for(let i of t)i.checked=!e,i.dispatchEvent(new Event("change"))}};var ji=class extends g{setup(){this.container=this.$el,this.pointer=this.$refs.pointer,this.linkInput=this.$refs.linkInput,this.linkButton=this.$refs.linkButton,this.includeInput=this.$refs.includeInput,this.includeButton=this.$refs.includeButton,this.sectionModeButton=this.$refs.sectionModeButton,this.modeToggles=this.$manyRefs.modeToggle,this.modeSections=this.$manyRefs.modeSection,this.pageId=this.$opts.pageId,this.showing=!1,this.isSelection=!1,this.setupListeners()}setupListeners(){this.includeButton.addEventListener("click",()=>Wr(this.includeInput.value)),this.linkButton.addEventListener("click",()=>Wr(this.linkInput.value)),R([this.includeInput,this.linkInput],e=>{e.target.select(),e.stopPropagation()}),ln(this.pointer,["click","focus"],e=>{e.stopPropagation()}),ln(document.body,["click","focus"],()=>{!this.showing||this.isSelection||this.hidePointer()}),Qo(this.pointer,this.hidePointer.bind(this));let t=document.querySelector(".page-content");ln(t,["mouseup","keyup"],e=>{e.stopPropagation();let i=e.target.closest('[id^="bkmrk"]');i&&window.getSelection().toString().length>0&&this.showPointerAtTarget(i,e.pageX,!1)}),R(this.sectionModeButton,this.enterSectionSelectMode.bind(this)),R(this.modeToggles,e=>{for(let i of this.modeSections){let r=!i.contains(e.target);i.toggleAttribute("hidden",!r)}this.modeToggles.find(i=>i!==e.target).focus()})}hidePointer(){this.pointer.style.display=null,this.showing=!1}showPointerAtTarget(t,e,i){this.updateForTarget(t),this.pointer.style.display="block";let r=t.getBoundingClientRect(),o=this.pointer.getBoundingClientRect(),a=Math.min(Math.max(e,r.left),r.right)-o.width/2,l=r.top-o.height-16;this.pointer.style.left=`${a}px`,this.pointer.style.top=`${l}px`,this.showing=!0,this.isSelection=!0,setTimeout(()=>{this.isSelection=!1},100);let c=()=>{this.hidePointer(),window.removeEventListener("scroll",c,{passive:!0})};t.parentElement.insertBefore(this.pointer,t),i||window.addEventListener("scroll",c,{passive:!0})}updateForTarget(t){let e=window.baseUrl(`/link/${this.pageId}#${t.id}`),i=`{{@${this.pageId}#${t.id}}}`;this.linkInput.value=e,this.includeInput.value=i;let r=this.pointer.querySelector("#pointer-edit");if(r&&t){let{editHref:o}=r.dataset,s=t.id,a=t.textContent&&t.textContent.substring(0,50);r.href=`${o}?content-id=${s}&content-text=${encodeURIComponent(a)}`}}enterSectionSelectMode(){let t=Array.from(document.querySelectorAll('.page-content [id^="bkmrk"]'));for(let e of t)e.setAttribute("tabindex","0");t[0].focus(),se(t,e=>{this.showPointerAtTarget(e.target,0,!0),this.pointer.focus()})}};var Vi=class extends g{setup(){this.container=this.$el,this.hideButtons=this.$manyRefs.hide||[],this.onkeyup=null,this.onHide=null,this.setupListeners()}setupListeners(){let t=null;this.container.addEventListener("mousedown",e=>{t=e.target}),this.container.addEventListener("click",e=>{e.target===this.container&&t===this.container&&this.hide()}),R(this.hideButtons,()=>this.hide())}hide(t=null){Is(this.container,120,t),this.onkeyup&&(window.removeEventListener("keyup",this.onkeyup),this.onkeyup=null),this.onHide&&this.onHide()}show(t=null,e=null){$s(this.container,120,t),this.onkeyup=i=>{i.key==="Escape"&&this.hide()},window.addEventListener("keyup",this.onkeyup),this.onHide=e}};var Wi=class extends g{setup(){this.container=this.$el,this.mode=this.$opts.mode,this.lightContainer=this.$refs.lightContainer,this.darkContainer=this.$refs.darkContainer,this.container.addEventListener("tabs-change",e=>{let r=e.detail.showing==="color-scheme-panel-light"?"light":"dark";this.handleModeChange(r)});let t=e=>{this.updateAppColorsFromInputs(),e.target.name.startsWith("setting-app-color")&&this.updateLightForInput(e.target)};this.container.addEventListener("change",t),this.container.addEventListener("input",t)}handleModeChange(t){this.mode=t;let e=t==="dark";document.documentElement.classList.toggle("dark-mode",e),this.updateAppColorsFromInputs()}updateAppColorsFromInputs(){let e=(this.mode==="dark"?this.darkContainer:this.lightContainer).querySelectorAll('input[type="color"]');for(let i of e){let r=i.name.split("-"),o=r.indexOf("color"),s=r.slice(1,o).join("-");s==="app"&&(s="primary");let a=`--color-${s}`;document.body.style.setProperty(a,i.value)}}updateLightForInput(t){let e=t.name.replace("-color","-color-light"),i=t.value,r=this.hexToRgb(i),o=`rgba(${[r.r,r.g,r.b,"0.15"].join(",")})`,s=this.container.querySelector(`input[name="${e}"][type="hidden"]`);s.value=o}hexToRgb(t){let e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return{r:e?parseInt(e[1],16):0,g:e?parseInt(e[2],16):0,b:e?parseInt(e[3],16):0}}};var Gi=class extends g{setup(){this.colorInput=this.$refs.input,this.resetButton=this.$refs.resetButton,this.defaultButton=this.$refs.defaultButton,this.currentColor=this.$opts.current,this.defaultColor=this.$opts.default,this.resetButton.addEventListener("click",()=>this.setValue(this.currentColor)),this.defaultButton.addEventListener("click",()=>this.setValue(this.defaultColor))}setValue(t){this.colorInput.value=t,this.colorInput.dispatchEvent(new Event("change",{bubbles:!0}))}};var Ki=class extends g{setup(){this.typeControl=this.$refs.typeControl,this.pagePickerContainer=this.$refs.pagePickerContainer,this.typeControl.addEventListener("change",this.controlPagePickerVisibility.bind(this)),this.controlPagePickerVisibility()}controlPagePickerVisibility(){let t=this.typeControl.value==="page";this.pagePickerContainer.style.display=t?"block":"none"}};var Gf={move_up(n){let t=n.parentNode,e=Array.from(t.children).indexOf(n),i=Math.max(e-1,0);t.insertBefore(n,t.children[i]||null)},move_down(n){let t=n.parentNode,e=Array.from(t.children).indexOf(n),i=Math.min(e+2,t.children.length);t.insertBefore(n,t.children[i]||null)},remove(n,t,e){e.appendChild(n)},add(n,t){t.appendChild(n)}},Zi=class extends g{setup(){this.elem=this.$el,this.input=this.$refs.input,this.shelfBookList=this.$refs.shelfBookList,this.allBookList=this.$refs.allBookList,this.bookSearchInput=this.$refs.bookSearch,this.sortButtonContainer=this.$refs.sortButtonContainer,this.lastSort=null,this.initSortable(),this.setupListeners()}initSortable(){let t=this.elem.querySelectorAll(".scroll-box");for(let e of t)new Yt(e,{group:"shelf-books",ghostClass:"primary-background-light",handle:".handle",animation:150,onSort:this.onChange.bind(this)})}setupListeners(){this.elem.addEventListener("click",t=>{let e=t.target.closest(".scroll-box-item button[data-action]");e&&this.sortItemActionClick(e)}),this.bookSearchInput.addEventListener("input",()=>{this.filterBooksByName(this.bookSearchInput.value)}),this.sortButtonContainer.addEventListener("click",t=>{let e=t.target.closest("button[data-sort]");e&&this.sortShelfBooks(e.dataset.sort)})}filterBooksByName(t){this.allBookList.style.height||(this.allBookList.style.height=`${this.allBookList.getBoundingClientRect().height}px`);let e=this.allBookList.children,i=t.trim().toLowerCase();for(let r of e){let o=!t||r.textContent.toLowerCase().includes(i);r.style.display=o?null:"none"}}sortItemActionClick(t){let e=t.closest(".scroll-box-item"),{action:i}=t.dataset,r=Gf[i];r(e,this.shelfBookList,this.allBookList),this.onChange()}onChange(){let t=Array.from(this.shelfBookList.querySelectorAll("[data-id]"));this.input.value=t.map(e=>e.getAttribute("data-id")).join(",")}sortShelfBooks(t){let e=Array.from(this.shelfBookList.children),i=t===this.lastSort;e.sort((r,o)=>{let s=r.dataset[t].toLowerCase(),a=o.dataset[t].toLowerCase();return i?a.localeCompare(s):s.localeCompare(a)});for(let r of e)this.shelfBookList.append(r);this.lastSort=this.lastSort===t?null:t,this.onChange()}};function Kf(n){let t={};for(let[e,i]of Object.entries(n))t[i]=e;return t}var Xi=class extends g{setup(){this.container=this.$el,this.mapById=JSON.parse(this.$opts.keyMap),this.mapByShortcut=Kf(this.mapById),this.hintsShowing=!1,this.hideHints=this.hideHints.bind(this),this.hintAbortController=null,this.setupListeners()}setupListeners(){window.addEventListener("keydown",t=>{if(!t.target.closest("input, select, textarea, .cm-editor")){if(t.key==="?"){this.hintsShowing?this.hideHints():this.showHints();return}this.handleShortcutPress(t)}})}handleShortcutPress(t){let i=[t.ctrlKey?"Ctrl":"",t.metaKey?"Cmd":"",t.key].filter(o=>!!o).join(" + "),r=this.mapByShortcut[i];r&&this.runShortcut(r)&&t.preventDefault()}runShortcut(t){let e=this.container.querySelector(`[data-shortcut="${t}"]`);return e?e.matches("input, textarea, select")?(e.focus(),!0):e.matches("a, button")?(e.click(),!0):e.matches("div[tabindex]")?(e.click(),e.focus(),!0):(console.error("Shortcut attempted to be ran for element type that does not have handling setup",e),!1):!1}showHints(){let t=document.createElement("div");t.classList.add("shortcut-container"),this.container.append(t);let e=this.container.querySelectorAll("[data-shortcut]"),i=new Set;for(let o of e){let s=o.getAttribute("data-shortcut");if(i.has(s))continue;let a=this.mapById[s];this.showHintLabel(o,a,t),i.add(s)}this.hintAbortController=new AbortController;let r=this.hintAbortController.signal;window.addEventListener("scroll",this.hideHints,{signal:r}),window.addEventListener("focus",this.hideHints,{signal:r}),window.addEventListener("blur",this.hideHints,{signal:r}),window.addEventListener("click",this.hideHints,{signal:r}),this.hintsShowing=!0}showHintLabel(t,e,i){let r=t.getBoundingClientRect(),o=document.createElement("div");o.classList.add("shortcut-hint"),o.textContent=e;let s=document.createElement("div");s.classList.add("shortcut-linkage"),s.style.left=`${r.x}px`,s.style.top=`${r.y}px`,s.style.width=`${r.width}px`,s.style.height=`${r.height}px`,i.append(o,s);let a=o.getBoundingClientRect();o.style.insetInlineStart=`${r.x+r.width-(a.width+6)}px`,o.style.insetBlockStart=`${r.y+(r.height-a.height)/2}px`}hideHints(){this.container.querySelector(".shortcut-container").remove(),this.hintAbortController?.abort(),this.hintsShowing=!1}};var Zf=["Control","Alt","Shift","Meta","Super"," ","+","Tab","Escape"],Yi=class extends g{setup(){this.input=this.$el,this.setupListeners()}setupListeners(){this.listenerRecordKey=this.listenerRecordKey.bind(this),this.input.addEventListener("focus",()=>{this.startListeningForInput()}),this.input.addEventListener("blur",()=>{this.stopListeningForInput()})}startListeningForInput(){this.input.addEventListener("keydown",this.listenerRecordKey)}listenerRecordKey(t){if(Zf.includes(t.key))return;let e=[t.ctrlKey?"Ctrl":"",t.metaKey?"Cmd":"",t.key];this.input.value=e.filter(i=>!!i).join(" + ")}stopListeningForInput(){this.input.removeEventListener("keydown",this.listenerRecordKey)}};var Ji=class extends g{setup(){this.container=this.$el,this.handleSelector=this.$opts.handleSelector;let t=new Yt(this.container,{handle:this.handleSelector,animation:150,onSort:()=>{this.$emit("sort",{ids:t.toArray()})},setData(e,i){let r=i.getAttribute("data-drag-content");if(r){let o=JSON.parse(r);for(let[s,a]of Object.entries(o))e.setData(s,a)}},revertOnSpill:!0,dropBubble:!0,dragoverBubble:!1})}};var Qi=class extends g{setup(){this.filter=this.$opts.filter,this.$el.addEventListener("change",t=>{if(this.filter&&!t.target.matches(this.filter))return;let e=this.$el.closest("form");e&&e.submit()})}};var tr=class extends g{setup(){this.container=this.$el,this.tabList=this.container.querySelector('[role="tablist"]'),this.tabs=Array.from(this.tabList.querySelectorAll('[role="tab"]')),this.panels=Array.from(this.container.querySelectorAll(':scope > [role="tabpanel"], :scope > * > [role="tabpanel"]')),this.activeUnder=this.$opts.activeUnder?Number(this.$opts.activeUnder):1e4,this.active=null,this.container.addEventListener("click",t=>{let e=t.target.closest('[role="tab"]');e&&this.tabs.includes(e)&&this.show(e.getAttribute("aria-controls"))}),window.addEventListener("resize",this.updateActiveState.bind(this),{passive:!0}),this.updateActiveState()}show(t){for(let e of this.panels)e.toggleAttribute("hidden",e.id!==t);for(let e of this.tabs){let r=e.getAttribute("aria-controls")===t;e.setAttribute("aria-selected",r?"true":"false")}this.$emit("change",{showing:t})}updateActiveState(){let t=window.innerWidth!e.hasAttribute("hidden"))||this.panels[0];this.show(t.id),this.tabList.toggleAttribute("hidden",!1)}deactivate(){for(let t of this.panels)t.removeAttribute("hidden");for(let t of this.tabs)t.setAttribute("aria-selected","false");this.tabList.toggleAttribute("hidden",!0)}};var er=class extends g{setup(){this.addRemoveComponentEl=this.$refs.addRemove,this.container=this.$el,this.rowSelector=this.$opts.rowSelector,this.setupListeners()}setupListeners(){this.container.addEventListener("input",t=>{let e=window.$components.firstOnElement(this.addRemoveComponentEl,"add-remove-rows");!this.hasEmptyRows()&&t.target.value&&e.add()})}hasEmptyRows(){return[...this.container.querySelectorAll(this.rowSelector)].find(i=>[...i.querySelectorAll("input")].filter(r=>r.value).length===0)!==void 0}};var nr=class extends g{setup(){this.container=this.$el,this.list=this.$refs.list,this.searchInput=this.$refs.searchInput,this.searchButton=this.$refs.searchButton,this.searchCancel=this.$refs.searchCancel,this.setupListeners()}setupListeners(){K(this.container,"[template-action]","click",this.handleTemplateActionClick.bind(this)),K(this.container,".pagination a","click",this.handlePaginationClick.bind(this)),K(this.container,".template-item-content","click",this.handleTemplateItemClick.bind(this)),K(this.container,".template-item","dragstart",this.handleTemplateItemDragStart.bind(this)),this.searchInput.addEventListener("keypress",t=>{t.key==="Enter"&&(t.preventDefault(),this.performSearch())}),this.searchButton.addEventListener("click",()=>this.performSearch()),this.searchCancel.addEventListener("click",()=>{this.searchInput.value="",this.performSearch()})}handleTemplateItemClick(t,e){let i=e.closest("[template-id]").getAttribute("template-id");this.insertTemplate(i,"replace")}handleTemplateItemDragStart(t,e){let i=e.closest("[template-id]").getAttribute("template-id");t.dataTransfer.setData("bookstack/template",i),t.dataTransfer.setData("text/plain",i)}handleTemplateActionClick(t,e){t.stopPropagation();let i=e.getAttribute("template-action"),r=e.closest("[template-id]").getAttribute("template-id");this.insertTemplate(r,i)}async insertTemplate(t,e="replace"){let i=await window.$http.get(`/templates/${t}`),r=`editor::${e}`;window.$events.emit(r,i.data)}async handlePaginationClick(t,e){t.preventDefault();let i=e.getAttribute("href"),r=await window.$http.get(i);this.list.innerHTML=r.data}async performSearch(){let t=this.searchInput.value,e=await window.$http.get("/templates",{search:t});this.searchCancel.style.display=t?"block":"none",this.list.innerHTML=e.data}};var ir=class extends g{setup(){this.input=this.$el.querySelector("input[type=hidden]"),this.checkbox=this.$el.querySelector("input[type=checkbox]"),this.checkbox.addEventListener("change",this.stateChange.bind(this))}stateChange(){this.input.value=this.checkbox.checked?"true":"false";let t=new Event("change");this.input.dispatchEvent(t)}};var rr=class extends g{setup(){this.container=this.$refs.container,this.tabs=this.$manyRefs.tab,this.lastLayoutType="none",this.onDestroy=null,this.scrollCache={content:0,info:0},this.lastTabShown="content",this.mobileTabClick=this.mobileTabClick.bind(this),this.updateLayout(),window.addEventListener("resize",()=>{this.updateLayout()},{passive:!0})}updateLayout(){let t="tablet";window.innerWidth<=1e3&&(t="mobile"),window.innerWidth>=1400&&(t="desktop"),t!==this.lastLayoutType&&(this.onDestroy&&(this.onDestroy(),this.onDestroy=null),t==="desktop"?this.setupDesktop():t==="mobile"&&this.setupMobile(),this.lastLayoutType=t)}setupMobile(){for(let t of this.tabs)t.addEventListener("click",this.mobileTabClick);this.onDestroy=()=>{for(let t of this.tabs)t.removeEventListener("click",this.mobileTabClick)}}setupDesktop(){}mobileTabClick(t){let{tab:e}=t.target.dataset;this.showTab(e)}showContent(){this.showTab("content",!1)}showTab(t,e=!0){this.scrollCache[this.lastTabShown]=document.documentElement.scrollTop;for(let r of this.tabs){let o=r.dataset.tab===t;r.setAttribute("aria-selected",o?"true":"false")}let i=t==="info";if(this.container.classList.toggle("show-info",i),e){let o=document.querySelector("header").getBoundingClientRect().bottom;document.documentElement.scrollTop=this.scrollCache[t]||o,setTimeout(()=>{document.documentElement.scrollTop=this.scrollCache[t]||o},50)}this.lastTabShown=t}};var or=class extends g{setup(){this.container=this.$el,this.input=this.$refs.input,this.userInfoContainer=this.$refs.userInfo,K(this.container,"a.dropdown-search-item","click",this.selectUser.bind(this))}selectUser(t,e){t.preventDefault(),this.input.value=e.getAttribute("data-id"),this.userInfoContainer.innerHTML=e.innerHTML,this.input.dispatchEvent(new Event("change",{bubbles:!0})),this.hide()}hide(){window.$components.firstOnElement(this.container,"dropdown").hide()}};var sr=class extends g{setup(){this.checkboxes=this.$el.querySelectorAll('input[type="checkbox"]'),this.allCheckbox=this.$el.querySelector('input[type="checkbox"][value="all"]'),this.$el.addEventListener("change",t=>{t.target.checked&&t.target===this.allCheckbox?this.deselectIndividualEvents():t.target.checked&&(this.allCheckbox.checked=!1)})}deselectIndividualEvents(){for(let t of this.checkboxes)t!==this.allCheckbox&&(t.checked=!1)}};function su(n){for(let t=1;t<5;t++)n.shortcuts.add(`meta+${t}`,"",["FormatBlock",!1,`h${t+1}`]);n.shortcuts.add("meta+5","",["FormatBlock",!1,"p"]),n.shortcuts.add("meta+d","",["FormatBlock",!1,"p"]),n.shortcuts.add("meta+6","",["FormatBlock",!1,"blockquote"]),n.shortcuts.add("meta+q","",["FormatBlock",!1,"blockquote"]),n.shortcuts.add("meta+7","",["codeeditor",!1,"pre"]),n.shortcuts.add("meta+e","",["codeeditor",!1,"pre"]),n.shortcuts.add("meta+8","",["FormatBlock",!1,"code"]),n.shortcuts.add("meta+shift+E","",["FormatBlock",!1,"code"]),n.shortcuts.add("meta+o","","InsertOrderedList"),n.shortcuts.add("meta+p","","InsertUnorderedList"),n.shortcuts.add("meta+S","",()=>{window.$events.emit("editor-save-draft")}),n.shortcuts.add("meta+13","",()=>{window.$events.emit("editor-save-page")}),n.shortcuts.add("meta+9","",()=>{let t=n.selection.getNode(),e=t?t.closest(".callout"):null,i=["info","success","warning","danger"],o=(i.findIndex(a=>e&&e.classList.contains(a))+1)%i.length,s=i[o];n.formatter.apply(`callout${s}`)}),n.shortcuts.add("meta+shift+K","",()=>{let t=window.$components.first("entity-selector-popup"),e=n.selection.getContent({format:"text"}).trim();t.show(i=>{n.selection.isCollapsed()?n.insertContent(n.dom.createHTML("a",{href:i.link},n.dom.encode(i.name))):n.formatter.apply("link",{href:i.link}),n.selection.collapse(!1),n.focus()},e,{searchEndpoint:"/search/entity-selector",entityTypes:"page,book,chapter,bookshelf",entityPermission:"view"})})}function au(n){window.$events.listen("editor::replace",({html:t})=>{n.setContent(t)}),window.$events.listen("editor::append",({html:t})=>{let e=n.getContent()+t;n.setContent(e)}),window.$events.listen("editor::prepend",({html:t})=>{let e=t+n.getContent();n.setContent(e)}),window.$events.listen("editor::insert",({html:t})=>{n.insertContent(t)}),window.$events.listen("editor::focus",()=>{n.initialized&&n.focus()})}function Xf(n,t){let e=n.dom.get(encodeURIComponent(t).replace(/!/g,"%21"));e&&(e.scrollIntoView(),n.selection.select(e,!0),n.selection.collapse(!1),n.focus())}function lu(n){let e=new URL(window.location).searchParams.get("content-id");e&&Xf(n,e)}var ie,ar;function Yf(n){return n&&!!(n.textContent||n.innerText)}async function Jf(n,t){if(n===null||n.type.indexOf("image")!==0)throw new Error("Not an image file");let e=n.name||`image-${Date.now()}.png`,i=new FormData;return i.append("file",n,e),i.append("uploaded_to",t),(await window.$http.post(window.baseUrl("/images/gallery"),i)).data}function cu(n,t,e){let i=new Ft(e.clipboardData||e.dataTransfer);if(!i.hasItems()||i.containsTabularData())return;let r=i.getImages();for(let o of r){let s=`image-${Math.random().toString(16).slice(2)}`,a=window.baseUrl("/loading.gif");e.preventDefault(),setTimeout(()=>{n.insertContent(`

    `),Jf(o,t.pageId).then(l=>{let c=l.name.replace(/"/g,""),u=`${c}`,h=n.dom.create("a",{target:"_blank",href:l.url},u);n.dom.replace(h,s)}).catch(l=>{n.dom.remove(s),window.$events.error(l?.data?.message||t.translations.imageUploadErrorText),console.error(l)})},10)}}function Qf(n){let t=n.selection.getNode();t.nodeName==="IMG"&&(ie=n.dom.getParent(t,".mceTemp"),!ie&&t.parentNode.nodeName==="A"&&!Yf(t.parentNode)&&(ie=t.parentNode)),t.hasAttribute("contenteditable")&&t.getAttribute("contenteditable")==="false"&&(ar=t)}function tm(n,t,e){let{dom:i}=n,r=window.tinymce.dom.RangeUtils.getCaretRangeFromPoint(e.clientX,e.clientY,n.getDoc()),o=e.dataTransfer&&e.dataTransfer.getData("bookstack/template");o&&(e.preventDefault(),window.$http.get(`/templates/${o}`).then(s=>{n.selection.setRng(r),n.undoManager.transact(()=>{n.execCommand("mceInsertContent",!1,s.data.html)})})),i.getParent(r.startContainer,".mceTemp")?e.preventDefault():ie&&(e.preventDefault(),n.undoManager.transact(()=>{n.selection.setRng(r),n.selection.setNode(ie),i.remove(ie)})),!e.isDefaultPrevented()&&ar&&(e.preventDefault(),n.undoManager.transact(()=>{let s=n.selection.getNode(),a=n.selection.getRng(),l=s.closest("body > *");a.startOffset>a.startContainer.length/2?l.after(ar):l.before(ar)})),e.isDefaultPrevented()||cu(n,t,e),ie=null}function uu(n,t){n.on("dragstart",()=>Qf(n)),n.on("drop",e=>tm(n,t,e)),n.on("paste",e=>cu(n,t,e))}function hu(n){return["undo redo","styles","bold italic underline forecolor backcolor formatoverflow","alignleft aligncenter alignright alignjustify","bullist numlist listoverflow",n.textDirection==="rtl"?"ltr rtl":"","link table imagemanager-insert insertoverflow","code about fullscreen"].filter(i=>!!i).join(" | ")}function em(n){n.ui.registry.addGroupToolbarButton("formatoverflow",{icon:"more-drawer",tooltip:"More",items:"strikethrough superscript subscript inlinecode removeformat"}),n.ui.registry.addGroupToolbarButton("listoverflow",{icon:"more-drawer",tooltip:"More",items:"tasklist outdent indent"}),n.ui.registry.addGroupToolbarButton("insertoverflow",{icon:"more-drawer",tooltip:"More",items:"customhr codeeditor drawio media details"})}function nm(n){n.ui.registry.addContextToolbar("linkcontexttoolbar",{predicate(t){return t.closest("a")!==null},position:"node",scope:"node",items:"link unlink openlink"})}function im(n){n.ui.registry.addContextToolbar("imagecontexttoolbar",{predicate(t){return t.closest("img")!==null},position:"node",scope:"node",items:"image"})}function du(n){em(n),nm(n),im(n)}var rm={"table-delete-column":'',"table-delete-row":'',"table-insert-column-after":'',"table-insert-column-before":'',"table-insert-row-above":'',"table-insert-row-after":'',table:'',"table-delete-table":''};function pu(n){for(let[t,e]of Object.entries(rm))n.ui.registry.addIcon(t,e)}function om(n){n.serializer.addNodeFilter("br",t=>{for(let e of t)if(e.parent&&e.parent.name==="code"){let i=window.tinymce.html.Node.create("#text");i.value=` +`).length;this.$refs.input.style.height=`${t*20+40}px`}async update(t){t.preventDefault();let e=this.showLoading();this.form.toggleAttribute("hidden",!0);let i={text:this.input.value,parent_id:this.parentId||null};try{let r=await window.$http.put(`/comment/${this.commentId}`,i),o=_t(r.data);this.container.replaceWith(o),window.$events.success(this.updatedText)}catch(r){console.error(r),window.$events.showValidationErrors(r),this.form.toggleAttribute("hidden",!1),e.remove()}}async delete(){this.showLoading(),await window.$http.delete(`/comment/${this.commentId}`),this.container.closest(".comment-branch").remove(),window.$events.success(this.deletedText),this.$emit("delete")}showLoading(){let t=ae();return t.classList.add("px-l"),this.container.append(t),t}};var Oi=class extends g{setup(){this.elem=this.$el,this.pageId=Number(this.$opts.pageId),this.container=this.$refs.commentContainer,this.commentCountBar=this.$refs.commentCountBar,this.commentsTitle=this.$refs.commentsTitle,this.addButtonContainer=this.$refs.addButtonContainer,this.replyToRow=this.$refs.replyToRow,this.formContainer=this.$refs.formContainer,this.form=this.$refs.form,this.formInput=this.$refs.formInput,this.formReplyLink=this.$refs.formReplyLink,this.addCommentButton=this.$refs.addCommentButton,this.hideFormButton=this.$refs.hideFormButton,this.removeReplyToButton=this.$refs.removeReplyToButton,this.createdText=this.$opts.createdText,this.countText=this.$opts.countText,this.parentId=null,this.formReplyText=this.formReplyLink?.textContent||"",this.setupListeners()}setupListeners(){this.elem.addEventListener("page-comment-delete",()=>{this.updateCount(),this.hideForm()}),this.elem.addEventListener("page-comment-reply",t=>{this.setReply(t.detail.id,t.detail.element)}),this.form&&(this.removeReplyToButton.addEventListener("click",this.removeReplyTo.bind(this)),this.hideFormButton.addEventListener("click",this.hideForm.bind(this)),this.addCommentButton.addEventListener("click",this.showForm.bind(this)),this.form.addEventListener("submit",this.saveComment.bind(this)))}saveComment(t){t.preventDefault(),t.stopPropagation();let e=ae();e.classList.add("px-l"),this.form.after(e),this.form.toggleAttribute("hidden",!0);let r={text:this.formInput.value,parent_id:this.parentId||null};window.$http.post(`/comment/${this.pageId}`,r).then(o=>{let s=_t(o.data);this.formContainer.after(s),window.$events.success(this.createdText),this.hideForm(),this.updateCount()}).catch(o=>{this.form.toggleAttribute("hidden",!1),window.$events.showValidationErrors(o)}),this.form.toggleAttribute("hidden",!1),e.remove()}updateCount(){let t=this.getCommentCount();this.commentsTitle.textContent=window.trans_plural(this.countText,t,{count:t})}resetForm(){this.formInput.value="",this.parentId=null,this.replyToRow.toggleAttribute("hidden",!0),this.container.append(this.formContainer)}showForm(){this.formContainer.toggleAttribute("hidden",!1),this.addButtonContainer.toggleAttribute("hidden",!0),this.formContainer.scrollIntoView({behavior:"smooth",block:"nearest"}),setTimeout(()=>{this.formInput.focus()},100)}hideForm(){this.resetForm(),this.formContainer.toggleAttribute("hidden",!0),this.getCommentCount()>0?this.elem.append(this.addButtonContainer):this.commentCountBar.append(this.addButtonContainer),this.addButtonContainer.toggleAttribute("hidden",!1)}getCommentCount(){return this.container.querySelectorAll('[component="page-comment"]').length}setReply(t,e){e.closest(".comment-branch").querySelector(".comment-branch-children").append(this.formContainer),this.showForm(),this.parentId=t,this.replyToRow.toggleAttribute("hidden",!1),this.formReplyLink.textContent=this.formReplyText.replace("1234",this.parentId),this.formReplyLink.href=`#comment${this.parentId}`}removeReplyTo(){this.parentId=null,this.replyToRow.toggleAttribute("hidden",!0),this.container.append(this.formContainer),this.showForm()}};function Uf(n,t){xr(`#page-navigation a[href="#${n}"]`,e=>{e.closest("li").classList.toggle("current-heading",t)})}function jf(n){for(let t of n){let e=t.intersectionRatio===1;Uf(t.target.id,e)}}function Vf(n){let t={rootMargin:"0px 0px 0px 0px",threshold:1},e=new IntersectionObserver(jf,t);for(let i of n)e.observe(i)}var Ri=class extends g{setup(){if(this.container=this.$el,this.pageId=this.$opts.pageId,window.importVersioned("code").then(e=>e.highlight()),this.setupNavHighlighting(),window.location.hash){let e=window.location.hash.replace(/%20/g," ").substring(1);this.goToText(e)}let t=document.querySelector(".sidebar-page-nav");t&&K(t,"a","click",(e,i)=>{e.preventDefault(),window.$components.first("tri-layout").showContent();let r=i.getAttribute("href").substr(1);this.goToText(r),window.history.pushState(null,null,`#${r}`)})}goToText(t){let e=document.getElementById(t);if(xr(".page-content [data-highlighted]",i=>{i.removeAttribute("data-highlighted"),i.style.backgroundColor=null}),e!==null)Cr(e);else{let i=ts(".page-content > div > *",t);i&&Cr(i)}}setupNavHighlighting(){let t=document.querySelector(".sidebar-page-nav"),e=document.querySelector(".page-content").querySelectorAll("h1, h2, h3, h4, h5, h6");e.length>0&&t!==null&&Vf(e)}};function ou(n){let t=new Date(n*1e3),e=t.getHours(),i=t.getMinutes();return`${(e>9?"":"0")+e}:${(i>9?"":"0")+i}`}var Ni=class extends g{setup(){this.draftsEnabled=this.$opts.draftsEnabled==="true",this.editorType=this.$opts.editorType,this.pageId=Number(this.$opts.pageId),this.isNewDraft=this.$opts.pageNewDraft==="true",this.hasDefaultTitle=this.$opts.hasDefaultTitle||!1,this.container=this.$el,this.titleElem=this.$refs.titleContainer.querySelector("input"),this.saveDraftButton=this.$refs.saveDraft,this.discardDraftButton=this.$refs.discardDraft,this.discardDraftWrap=this.$refs.discardDraftWrap,this.deleteDraftButton=this.$refs.deleteDraft,this.deleteDraftWrap=this.$refs.deleteDraftWrap,this.draftDisplay=this.$refs.draftDisplay,this.draftDisplayIcon=this.$refs.draftDisplayIcon,this.changelogInput=this.$refs.changelogInput,this.changelogDisplay=this.$refs.changelogDisplay,this.changeEditorButtons=this.$manyRefs.changeEditor||[],this.switchDialogContainer=this.$refs.switchDialog,this.deleteDraftDialogContainer=this.$refs.deleteDraftDialog,this.draftText=this.$opts.draftText,this.autosaveFailText=this.$opts.autosaveFailText,this.editingPageText=this.$opts.editingPageText,this.draftDiscardedText=this.$opts.draftDiscardedText,this.draftDeleteText=this.$opts.draftDeleteText,this.draftDeleteFailText=this.$opts.draftDeleteFailText,this.setChangelogText=this.$opts.setChangelogText,this.autoSave={interval:null,frequency:3e4,last:0,pendingChange:!1},this.shownWarningsCache=new Set,this.pageId!==0&&this.draftsEnabled&&window.setTimeout(()=>{this.startAutoSave()},1e3),this.draftDisplay.innerHTML=this.draftText,this.setupListeners(),this.setInitialFocus()}setupListeners(){window.$events.listen("editor-save-draft",this.saveDraft.bind(this)),window.$events.listen("editor-save-page",this.savePage.bind(this));let t=()=>{this.autoSave.pendingChange=!0};window.$events.listen("editor-html-change",t),window.$events.listen("editor-markdown-change",t),this.titleElem.addEventListener("input",t);let e=Nt(this.updateChangelogDisplay.bind(this),300,!1);this.changelogInput.addEventListener("input",e),R(this.saveDraftButton,this.saveDraft.bind(this)),R(this.discardDraftButton,this.discardDraft.bind(this)),R(this.deleteDraftButton,this.deleteDraft.bind(this)),R(this.changeEditorButtons,this.changeEditor.bind(this))}setInitialFocus(){if(this.hasDefaultTitle){this.titleElem.select();return}window.setTimeout(()=>{window.$events.emit("editor::focus","")},500)}startAutoSave(){this.autoSave.interval=window.setInterval(this.runAutoSave.bind(this),this.autoSave.frequency)}runAutoSave(){Date.now()-this.autoSave.last{this.draftDisplayIcon.classList.remove("visible")},2e3)}async discardDraft(t=!0){let e;try{e=await window.$http.get(`/ajax/page/${this.pageId}`)}catch(i){console.error(i);return}this.autoSave.interval&&window.clearInterval(this.autoSave.interval),this.draftDisplay.innerText=this.editingPageText,this.discardDraftWrap.toggleAttribute("hidden",!0),window.$events.emit("editor::replace",{html:e.data.html,markdown:e.data.markdown}),this.titleElem.value=e.data.name,window.setTimeout(()=>{this.startAutoSave()},1e3),t&&window.$events.success(this.draftDiscardedText)}async deleteDraft(){if(await window.$components.firstOnElement(this.deleteDraftDialogContainer,"confirm-dialog").show())try{let i=this.discardDraft(!1),r=window.$http.delete(`/page-revisions/user-drafts/${this.pageId}`);await Promise.all([i,r]),window.$events.success(this.draftDeleteText),this.deleteDraftWrap.toggleAttribute("hidden",!0)}catch(i){console.error(i),window.$events.error(this.draftDeleteFailText)}}updateChangelogDisplay(){let t=this.changelogInput.value.trim();t.length===0?t=this.setChangelogText:t.length>16&&(t=`${t.slice(0,16)}...`),this.changelogDisplay.innerText=t}async changeEditor(t){t.preventDefault();let e=t.target.closest("a").href,i=window.$components.firstOnElement(this.switchDialogContainer,"confirm-dialog"),[r,o]=await Promise.all([this.saveDraft(),i.show()]);r&&o&&(window.location=e)}getEditorComponent(){return window.$components.first("markdown-editor")||window.$components.first("wysiwyg-editor")}};function zi(n,t){n.toggleAttribute("hidden",!t)}var Hi=class extends g{setup(){this.input=this.$refs.input,this.resetButton=this.$refs.resetButton,this.selectButton=this.$refs.selectButton,this.display=this.$refs.display,this.defaultDisplay=this.$refs.defaultDisplay,this.buttonSep=this.$refs.buttonSeperator,this.selectorEndpoint=this.$opts.selectorEndpoint,this.value=this.input.value,this.setupListeners()}setupListeners(){this.selectButton.addEventListener("click",this.showPopup.bind(this)),this.display.parentElement.addEventListener("click",this.showPopup.bind(this)),this.display.addEventListener("click",t=>t.stopPropagation()),this.resetButton.addEventListener("click",()=>{this.setValue("","")})}showPopup(){window.$components.first("entity-selector-popup").show(e=>{this.setValue(e.id,e.name)},{initialValue:"",searchEndpoint:this.selectorEndpoint,entityTypes:"page",entityPermission:"view"})}setValue(t,e){this.value=t,this.input.value=t,this.controlView(e)}controlView(t){let e=this.value&&this.value!==0;if(zi(this.resetButton,e),zi(this.buttonSep,e),zi(this.defaultDisplay,!e),zi(this.display,e),e){let i=this.getAssetIdFromVal();this.display.textContent=`#${i}, ${t}`,this.display.href=window.baseUrl(`/link/${i}`)}}getAssetIdFromVal(){return Number(this.value)}};var Ui=class extends g{setup(){this.container=this.$el,this.cellSelector=this.$opts.cellSelector||"td,th",this.rowSelector=this.$opts.rowSelector||"tr";for(let t of this.$manyRefs.toggleAll||[])t.addEventListener("click",this.toggleAllClick.bind(this));for(let t of this.$manyRefs.toggleRow||[])t.addEventListener("click",this.toggleRowClick.bind(this));for(let t of this.$manyRefs.toggleColumn||[])t.addEventListener("click",this.toggleColumnClick.bind(this))}toggleAllClick(t){t.preventDefault(),this.toggleAllInElement(this.container)}toggleRowClick(t){t.preventDefault(),this.toggleAllInElement(t.target.closest(this.rowSelector))}toggleColumnClick(t){t.preventDefault();let e=t.target.closest(this.cellSelector),i=Array.from(e.parentElement.children).indexOf(e),r=this.container.querySelectorAll(this.rowSelector),o=[];for(let s of r){let a=s.children[i];a&&o.push(...a.querySelectorAll("input[type=checkbox]"))}this.toggleAllInputs(o)}toggleAllInElement(t){let e=t.querySelectorAll("input[type=checkbox]");this.toggleAllInputs(e)}toggleAllInputs(t){let e=t.length>0?t[0].checked:!1;for(let i of t)i.checked=!e,i.dispatchEvent(new Event("change"))}};var ji=class extends g{setup(){this.container=this.$el,this.pointer=this.$refs.pointer,this.linkInput=this.$refs.linkInput,this.linkButton=this.$refs.linkButton,this.includeInput=this.$refs.includeInput,this.includeButton=this.$refs.includeButton,this.sectionModeButton=this.$refs.sectionModeButton,this.modeToggles=this.$manyRefs.modeToggle,this.modeSections=this.$manyRefs.modeSection,this.pageId=this.$opts.pageId,this.showing=!1,this.isSelection=!1,this.setupListeners()}setupListeners(){this.includeButton.addEventListener("click",()=>Wr(this.includeInput.value)),this.linkButton.addEventListener("click",()=>Wr(this.linkInput.value)),R([this.includeInput,this.linkInput],e=>{e.target.select(),e.stopPropagation()}),ln(this.pointer,["click","focus"],e=>{e.stopPropagation()}),ln(document.body,["click","focus"],()=>{!this.showing||this.isSelection||this.hidePointer()}),Qo(this.pointer,this.hidePointer.bind(this));let t=document.querySelector(".page-content");ln(t,["mouseup","keyup"],e=>{e.stopPropagation();let i=e.target.closest('[id^="bkmrk"]');i&&window.getSelection().toString().length>0&&this.showPointerAtTarget(i,e.pageX,!1)}),R(this.sectionModeButton,this.enterSectionSelectMode.bind(this)),R(this.modeToggles,e=>{for(let i of this.modeSections){let r=!i.contains(e.target);i.toggleAttribute("hidden",!r)}this.modeToggles.find(i=>i!==e.target).focus()})}hidePointer(){this.pointer.style.display=null,this.showing=!1}showPointerAtTarget(t,e,i){this.updateForTarget(t),this.pointer.style.display="block";let r=t.getBoundingClientRect(),o=this.pointer.getBoundingClientRect(),a=Math.min(Math.max(e,r.left),r.right)-o.width/2,l=r.top-o.height-16;this.pointer.style.left=`${a}px`,this.pointer.style.top=`${l}px`,this.showing=!0,this.isSelection=!0,setTimeout(()=>{this.isSelection=!1},100);let c=()=>{this.hidePointer(),window.removeEventListener("scroll",c,{passive:!0})};t.parentElement.insertBefore(this.pointer,t),i||window.addEventListener("scroll",c,{passive:!0})}updateForTarget(t){let e=window.baseUrl(`/link/${this.pageId}#${t.id}`),i=`{{@${this.pageId}#${t.id}}}`;this.linkInput.value=e,this.includeInput.value=i;let r=this.pointer.querySelector("#pointer-edit");if(r&&t){let{editHref:o}=r.dataset,s=t.id,a=t.textContent&&t.textContent.substring(0,50);r.href=`${o}?content-id=${s}&content-text=${encodeURIComponent(a)}`}}enterSectionSelectMode(){let t=Array.from(document.querySelectorAll('.page-content [id^="bkmrk"]'));for(let e of t)e.setAttribute("tabindex","0");t[0].focus(),se(t,e=>{this.showPointerAtTarget(e.target,0,!0),this.pointer.focus()})}};var Vi=class extends g{setup(){this.container=this.$el,this.hideButtons=this.$manyRefs.hide||[],this.onkeyup=null,this.onHide=null,this.setupListeners()}setupListeners(){let t=null;this.container.addEventListener("mousedown",e=>{t=e.target}),this.container.addEventListener("click",e=>{e.target===this.container&&t===this.container&&this.hide()}),R(this.hideButtons,()=>this.hide())}hide(t=null){Is(this.container,120,t),this.onkeyup&&(window.removeEventListener("keyup",this.onkeyup),this.onkeyup=null),this.onHide&&this.onHide()}show(t=null,e=null){$s(this.container,120,t),this.onkeyup=i=>{i.key==="Escape"&&this.hide()},window.addEventListener("keyup",this.onkeyup),this.onHide=e}};var Wi=class extends g{setup(){this.container=this.$el,this.mode=this.$opts.mode,this.lightContainer=this.$refs.lightContainer,this.darkContainer=this.$refs.darkContainer,this.container.addEventListener("tabs-change",e=>{let r=e.detail.showing==="color-scheme-panel-light"?"light":"dark";this.handleModeChange(r)});let t=e=>{this.updateAppColorsFromInputs(),e.target.name.startsWith("setting-app-color")&&this.updateLightForInput(e.target)};this.container.addEventListener("change",t),this.container.addEventListener("input",t)}handleModeChange(t){this.mode=t;let e=t==="dark";document.documentElement.classList.toggle("dark-mode",e),this.updateAppColorsFromInputs()}updateAppColorsFromInputs(){let e=(this.mode==="dark"?this.darkContainer:this.lightContainer).querySelectorAll('input[type="color"]');for(let i of e){let r=i.name.split("-"),o=r.indexOf("color"),s=r.slice(1,o).join("-");s==="app"&&(s="primary");let a=`--color-${s}`;document.body.style.setProperty(a,i.value)}}updateLightForInput(t){let e=t.name.replace("-color","-color-light"),i=t.value,r=this.hexToRgb(i),o=`rgba(${[r.r,r.g,r.b,"0.15"].join(",")})`,s=this.container.querySelector(`input[name="${e}"][type="hidden"]`);s.value=o}hexToRgb(t){let e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return{r:e?parseInt(e[1],16):0,g:e?parseInt(e[2],16):0,b:e?parseInt(e[3],16):0}}};var Gi=class extends g{setup(){this.colorInput=this.$refs.input,this.resetButton=this.$refs.resetButton,this.defaultButton=this.$refs.defaultButton,this.currentColor=this.$opts.current,this.defaultColor=this.$opts.default,this.resetButton.addEventListener("click",()=>this.setValue(this.currentColor)),this.defaultButton.addEventListener("click",()=>this.setValue(this.defaultColor))}setValue(t){this.colorInput.value=t,this.colorInput.dispatchEvent(new Event("change",{bubbles:!0}))}};var Ki=class extends g{setup(){this.typeControl=this.$refs.typeControl,this.pagePickerContainer=this.$refs.pagePickerContainer,this.typeControl.addEventListener("change",this.controlPagePickerVisibility.bind(this)),this.controlPagePickerVisibility()}controlPagePickerVisibility(){let t=this.typeControl.value==="page";this.pagePickerContainer.style.display=t?"block":"none"}};var Gf={move_up(n){let t=n.parentNode,e=Array.from(t.children).indexOf(n),i=Math.max(e-1,0);t.insertBefore(n,t.children[i]||null)},move_down(n){let t=n.parentNode,e=Array.from(t.children).indexOf(n),i=Math.min(e+2,t.children.length);t.insertBefore(n,t.children[i]||null)},remove(n,t,e){e.appendChild(n)},add(n,t){t.appendChild(n)}},Zi=class extends g{setup(){this.elem=this.$el,this.input=this.$refs.input,this.shelfBookList=this.$refs.shelfBookList,this.allBookList=this.$refs.allBookList,this.bookSearchInput=this.$refs.bookSearch,this.sortButtonContainer=this.$refs.sortButtonContainer,this.lastSort=null,this.initSortable(),this.setupListeners()}initSortable(){let t=this.elem.querySelectorAll(".scroll-box");for(let e of t)new Yt(e,{group:"shelf-books",ghostClass:"primary-background-light",handle:".handle",animation:150,onSort:this.onChange.bind(this)})}setupListeners(){this.elem.addEventListener("click",t=>{let e=t.target.closest(".scroll-box-item button[data-action]");e&&this.sortItemActionClick(e)}),this.bookSearchInput.addEventListener("input",()=>{this.filterBooksByName(this.bookSearchInput.value)}),this.sortButtonContainer.addEventListener("click",t=>{let e=t.target.closest("button[data-sort]");e&&this.sortShelfBooks(e.dataset.sort)})}filterBooksByName(t){this.allBookList.style.height||(this.allBookList.style.height=`${this.allBookList.getBoundingClientRect().height}px`);let e=this.allBookList.children,i=t.trim().toLowerCase();for(let r of e){let o=!t||r.textContent.toLowerCase().includes(i);r.style.display=o?null:"none"}}sortItemActionClick(t){let e=t.closest(".scroll-box-item"),{action:i}=t.dataset,r=Gf[i];r(e,this.shelfBookList,this.allBookList),this.onChange()}onChange(){let t=Array.from(this.shelfBookList.querySelectorAll("[data-id]"));this.input.value=t.map(e=>e.getAttribute("data-id")).join(",")}sortShelfBooks(t){let e=Array.from(this.shelfBookList.children),i=t===this.lastSort;e.sort((r,o)=>{let s=r.dataset[t].toLowerCase(),a=o.dataset[t].toLowerCase();return i?a.localeCompare(s):s.localeCompare(a)});for(let r of e)this.shelfBookList.append(r);this.lastSort=this.lastSort===t?null:t,this.onChange()}};function Kf(n){let t={};for(let[e,i]of Object.entries(n))t[i]=e;return t}var Xi=class extends g{setup(){this.container=this.$el,this.mapById=JSON.parse(this.$opts.keyMap),this.mapByShortcut=Kf(this.mapById),this.hintsShowing=!1,this.hideHints=this.hideHints.bind(this),this.hintAbortController=null,this.setupListeners()}setupListeners(){window.addEventListener("keydown",t=>{if(!t.target.closest("input, select, textarea, .cm-editor")){if(t.key==="?"){this.hintsShowing?this.hideHints():this.showHints();return}this.handleShortcutPress(t)}})}handleShortcutPress(t){let i=[t.ctrlKey?"Ctrl":"",t.metaKey?"Cmd":"",t.key].filter(o=>!!o).join(" + "),r=this.mapByShortcut[i];r&&this.runShortcut(r)&&t.preventDefault()}runShortcut(t){let e=this.container.querySelector(`[data-shortcut="${t}"]`);return e?e.matches("input, textarea, select")?(e.focus(),!0):e.matches("a, button")?(e.click(),!0):e.matches("div[tabindex]")?(e.click(),e.focus(),!0):(console.error("Shortcut attempted to be ran for element type that does not have handling setup",e),!1):!1}showHints(){let t=document.createElement("div");t.classList.add("shortcut-container"),this.container.append(t);let e=this.container.querySelectorAll("[data-shortcut]"),i=new Set;for(let o of e){let s=o.getAttribute("data-shortcut");if(i.has(s))continue;let a=this.mapById[s];this.showHintLabel(o,a,t),i.add(s)}this.hintAbortController=new AbortController;let r=this.hintAbortController.signal;window.addEventListener("scroll",this.hideHints,{signal:r}),window.addEventListener("focus",this.hideHints,{signal:r}),window.addEventListener("blur",this.hideHints,{signal:r}),window.addEventListener("click",this.hideHints,{signal:r}),this.hintsShowing=!0}showHintLabel(t,e,i){let r=t.getBoundingClientRect(),o=document.createElement("div");o.classList.add("shortcut-hint"),o.textContent=e;let s=document.createElement("div");s.classList.add("shortcut-linkage"),s.style.left=`${r.x}px`,s.style.top=`${r.y}px`,s.style.width=`${r.width}px`,s.style.height=`${r.height}px`,i.append(o,s);let a=o.getBoundingClientRect();o.style.insetInlineStart=`${r.x+r.width-(a.width+6)}px`,o.style.insetBlockStart=`${r.y+(r.height-a.height)/2}px`}hideHints(){this.container.querySelector(".shortcut-container").remove(),this.hintAbortController?.abort(),this.hintsShowing=!1}};var Zf=["Control","Alt","Shift","Meta","Super"," ","+","Tab","Escape"],Yi=class extends g{setup(){this.input=this.$el,this.setupListeners()}setupListeners(){this.listenerRecordKey=this.listenerRecordKey.bind(this),this.input.addEventListener("focus",()=>{this.startListeningForInput()}),this.input.addEventListener("blur",()=>{this.stopListeningForInput()})}startListeningForInput(){this.input.addEventListener("keydown",this.listenerRecordKey)}listenerRecordKey(t){if(Zf.includes(t.key))return;let e=[t.ctrlKey?"Ctrl":"",t.metaKey?"Cmd":"",t.key];this.input.value=e.filter(i=>!!i).join(" + ")}stopListeningForInput(){this.input.removeEventListener("keydown",this.listenerRecordKey)}};var Ji=class extends g{setup(){this.container=this.$el,this.handleSelector=this.$opts.handleSelector;let t=new Yt(this.container,{handle:this.handleSelector,animation:150,onSort:()=>{this.$emit("sort",{ids:t.toArray()})},setData(e,i){let r=i.getAttribute("data-drag-content");if(r){let o=JSON.parse(r);for(let[s,a]of Object.entries(o))e.setData(s,a)}},revertOnSpill:!0,dropBubble:!0,dragoverBubble:!1})}};var Qi=class extends g{setup(){this.filter=this.$opts.filter,this.$el.addEventListener("change",t=>{if(this.filter&&!t.target.matches(this.filter))return;let e=this.$el.closest("form");e&&e.submit()})}};var tr=class extends g{setup(){this.container=this.$el,this.tabList=this.container.querySelector('[role="tablist"]'),this.tabs=Array.from(this.tabList.querySelectorAll('[role="tab"]')),this.panels=Array.from(this.container.querySelectorAll(':scope > [role="tabpanel"], :scope > * > [role="tabpanel"]')),this.activeUnder=this.$opts.activeUnder?Number(this.$opts.activeUnder):1e4,this.active=null,this.container.addEventListener("click",t=>{let e=t.target.closest('[role="tab"]');e&&this.tabs.includes(e)&&this.show(e.getAttribute("aria-controls"))}),window.addEventListener("resize",this.updateActiveState.bind(this),{passive:!0}),this.updateActiveState()}show(t){for(let e of this.panels)e.toggleAttribute("hidden",e.id!==t);for(let e of this.tabs){let r=e.getAttribute("aria-controls")===t;e.setAttribute("aria-selected",r?"true":"false")}this.$emit("change",{showing:t})}updateActiveState(){let t=window.innerWidth!e.hasAttribute("hidden"))||this.panels[0];this.show(t.id),this.tabList.toggleAttribute("hidden",!1)}deactivate(){for(let t of this.panels)t.removeAttribute("hidden");for(let t of this.tabs)t.setAttribute("aria-selected","false");this.tabList.toggleAttribute("hidden",!0)}};var er=class extends g{setup(){this.addRemoveComponentEl=this.$refs.addRemove,this.container=this.$el,this.rowSelector=this.$opts.rowSelector,this.setupListeners()}setupListeners(){this.container.addEventListener("input",t=>{let e=window.$components.firstOnElement(this.addRemoveComponentEl,"add-remove-rows");!this.hasEmptyRows()&&t.target.value&&e.add()})}hasEmptyRows(){return[...this.container.querySelectorAll(this.rowSelector)].find(i=>[...i.querySelectorAll("input")].filter(r=>r.value).length===0)!==void 0}};var nr=class extends g{setup(){this.container=this.$el,this.list=this.$refs.list,this.searchInput=this.$refs.searchInput,this.searchButton=this.$refs.searchButton,this.searchCancel=this.$refs.searchCancel,this.setupListeners()}setupListeners(){K(this.container,"[template-action]","click",this.handleTemplateActionClick.bind(this)),K(this.container,".pagination a","click",this.handlePaginationClick.bind(this)),K(this.container,".template-item-content","click",this.handleTemplateItemClick.bind(this)),K(this.container,".template-item","dragstart",this.handleTemplateItemDragStart.bind(this)),this.searchInput.addEventListener("keypress",t=>{t.key==="Enter"&&(t.preventDefault(),this.performSearch())}),this.searchButton.addEventListener("click",()=>this.performSearch()),this.searchCancel.addEventListener("click",()=>{this.searchInput.value="",this.performSearch()})}handleTemplateItemClick(t,e){let i=e.closest("[template-id]").getAttribute("template-id");this.insertTemplate(i,"replace")}handleTemplateItemDragStart(t,e){let i=e.closest("[template-id]").getAttribute("template-id");t.dataTransfer.setData("bookstack/template",i),t.dataTransfer.setData("text/plain",i)}handleTemplateActionClick(t,e){t.stopPropagation();let i=e.getAttribute("template-action"),r=e.closest("[template-id]").getAttribute("template-id");this.insertTemplate(r,i)}async insertTemplate(t,e="replace"){let i=await window.$http.get(`/templates/${t}`),r=`editor::${e}`;window.$events.emit(r,i.data)}async handlePaginationClick(t,e){t.preventDefault();let i=e.getAttribute("href"),r=await window.$http.get(i);this.list.innerHTML=r.data}async performSearch(){let t=this.searchInput.value,e=await window.$http.get("/templates",{search:t});this.searchCancel.style.display=t?"block":"none",this.list.innerHTML=e.data}};var ir=class extends g{setup(){this.input=this.$el.querySelector("input[type=hidden]"),this.checkbox=this.$el.querySelector("input[type=checkbox]"),this.checkbox.addEventListener("change",this.stateChange.bind(this))}stateChange(){this.input.value=this.checkbox.checked?"true":"false";let t=new Event("change");this.input.dispatchEvent(t)}};var rr=class extends g{setup(){this.container=this.$refs.container,this.tabs=this.$manyRefs.tab,this.lastLayoutType="none",this.onDestroy=null,this.scrollCache={content:0,info:0},this.lastTabShown="content",this.mobileTabClick=this.mobileTabClick.bind(this),this.updateLayout(),window.addEventListener("resize",()=>{this.updateLayout()},{passive:!0})}updateLayout(){let t="tablet";window.innerWidth<=1e3&&(t="mobile"),window.innerWidth>=1400&&(t="desktop"),t!==this.lastLayoutType&&(this.onDestroy&&(this.onDestroy(),this.onDestroy=null),t==="desktop"?this.setupDesktop():t==="mobile"&&this.setupMobile(),this.lastLayoutType=t)}setupMobile(){for(let t of this.tabs)t.addEventListener("click",this.mobileTabClick);this.onDestroy=()=>{for(let t of this.tabs)t.removeEventListener("click",this.mobileTabClick)}}setupDesktop(){}mobileTabClick(t){let{tab:e}=t.target.dataset;this.showTab(e)}showContent(){this.showTab("content",!1)}showTab(t,e=!0){this.scrollCache[this.lastTabShown]=document.documentElement.scrollTop;for(let r of this.tabs){let o=r.dataset.tab===t;r.setAttribute("aria-selected",o?"true":"false")}let i=t==="info";if(this.container.classList.toggle("show-info",i),e){let o=document.querySelector("header").getBoundingClientRect().bottom;document.documentElement.scrollTop=this.scrollCache[t]||o,setTimeout(()=>{document.documentElement.scrollTop=this.scrollCache[t]||o},50)}this.lastTabShown=t}};var or=class extends g{setup(){this.container=this.$el,this.input=this.$refs.input,this.userInfoContainer=this.$refs.userInfo,K(this.container,"a.dropdown-search-item","click",this.selectUser.bind(this))}selectUser(t,e){t.preventDefault(),this.input.value=e.getAttribute("data-id"),this.userInfoContainer.innerHTML=e.innerHTML,this.input.dispatchEvent(new Event("change",{bubbles:!0})),this.hide()}hide(){window.$components.firstOnElement(this.container,"dropdown").hide()}};var sr=class extends g{setup(){this.checkboxes=this.$el.querySelectorAll('input[type="checkbox"]'),this.allCheckbox=this.$el.querySelector('input[type="checkbox"][value="all"]'),this.$el.addEventListener("change",t=>{t.target.checked&&t.target===this.allCheckbox?this.deselectIndividualEvents():t.target.checked&&(this.allCheckbox.checked=!1)})}deselectIndividualEvents(){for(let t of this.checkboxes)t!==this.allCheckbox&&(t.checked=!1)}};function su(n){for(let t=1;t<5;t++)n.shortcuts.add(`meta+${t}`,"",["FormatBlock",!1,`h${t+1}`]);n.shortcuts.add("meta+5","",["FormatBlock",!1,"p"]),n.shortcuts.add("meta+d","",["FormatBlock",!1,"p"]),n.shortcuts.add("meta+6","",["FormatBlock",!1,"blockquote"]),n.shortcuts.add("meta+q","",["FormatBlock",!1,"blockquote"]),n.shortcuts.add("meta+7","",["codeeditor",!1,"pre"]),n.shortcuts.add("meta+e","",["codeeditor",!1,"pre"]),n.shortcuts.add("meta+8","",["FormatBlock",!1,"code"]),n.shortcuts.add("meta+shift+E","",["FormatBlock",!1,"code"]),n.shortcuts.add("meta+o","","InsertOrderedList"),n.shortcuts.add("meta+p","","InsertUnorderedList"),n.shortcuts.add("meta+S","",()=>{window.$events.emit("editor-save-draft")}),n.shortcuts.add("meta+13","",()=>{window.$events.emit("editor-save-page")}),n.shortcuts.add("meta+9","",()=>{let t=n.selection.getNode(),e=t?t.closest(".callout"):null,i=["info","success","warning","danger"],o=(i.findIndex(a=>e&&e.classList.contains(a))+1)%i.length,s=i[o];n.formatter.apply(`callout${s}`)}),n.shortcuts.add("meta+shift+K","",()=>{let t=window.$components.first("entity-selector-popup"),e=n.selection.getContent({format:"text"}).trim();t.show(i=>{n.selection.isCollapsed()?n.insertContent(n.dom.createHTML("a",{href:i.link},n.dom.encode(i.name))):n.formatter.apply("link",{href:i.link}),n.selection.collapse(!1),n.focus()},{initialValue:e,searchEndpoint:"/search/entity-selector",entityTypes:"page,book,chapter,bookshelf",entityPermission:"view"})})}function au(n){window.$events.listen("editor::replace",({html:t})=>{n.setContent(t)}),window.$events.listen("editor::append",({html:t})=>{let e=n.getContent()+t;n.setContent(e)}),window.$events.listen("editor::prepend",({html:t})=>{let e=t+n.getContent();n.setContent(e)}),window.$events.listen("editor::insert",({html:t})=>{n.insertContent(t)}),window.$events.listen("editor::focus",()=>{n.initialized&&n.focus()})}function Xf(n,t){let e=n.dom.get(encodeURIComponent(t).replace(/!/g,"%21"));e&&(e.scrollIntoView(),n.selection.select(e,!0),n.selection.collapse(!1),n.focus())}function lu(n){let e=new URL(window.location).searchParams.get("content-id");e&&Xf(n,e)}var ie,ar;function Yf(n){return n&&!!(n.textContent||n.innerText)}async function Jf(n,t){if(n===null||n.type.indexOf("image")!==0)throw new Error("Not an image file");let e=n.name||`image-${Date.now()}.png`,i=new FormData;return i.append("file",n,e),i.append("uploaded_to",t),(await window.$http.post(window.baseUrl("/images/gallery"),i)).data}function cu(n,t,e){let i=new Ft(e.clipboardData||e.dataTransfer);if(!i.hasItems()||i.containsTabularData())return;let r=i.getImages();for(let o of r){let s=`image-${Math.random().toString(16).slice(2)}`,a=window.baseUrl("/loading.gif");e.preventDefault(),setTimeout(()=>{n.insertContent(`

    `),Jf(o,t.pageId).then(l=>{let c=l.name.replace(/"/g,""),u=`${c}`,h=n.dom.create("a",{target:"_blank",href:l.url},u);n.dom.replace(h,s)}).catch(l=>{n.dom.remove(s),window.$events.error(l?.data?.message||t.translations.imageUploadErrorText),console.error(l)})},10)}}function Qf(n){let t=n.selection.getNode();t.nodeName==="IMG"&&(ie=n.dom.getParent(t,".mceTemp"),!ie&&t.parentNode.nodeName==="A"&&!Yf(t.parentNode)&&(ie=t.parentNode)),t.hasAttribute("contenteditable")&&t.getAttribute("contenteditable")==="false"&&(ar=t)}function tm(n,t,e){let{dom:i}=n,r=window.tinymce.dom.RangeUtils.getCaretRangeFromPoint(e.clientX,e.clientY,n.getDoc()),o=e.dataTransfer&&e.dataTransfer.getData("bookstack/template");o&&(e.preventDefault(),window.$http.get(`/templates/${o}`).then(s=>{n.selection.setRng(r),n.undoManager.transact(()=>{n.execCommand("mceInsertContent",!1,s.data.html)})})),i.getParent(r.startContainer,".mceTemp")?e.preventDefault():ie&&(e.preventDefault(),n.undoManager.transact(()=>{n.selection.setRng(r),n.selection.setNode(ie),i.remove(ie)})),!e.isDefaultPrevented()&&ar&&(e.preventDefault(),n.undoManager.transact(()=>{let s=n.selection.getNode(),a=n.selection.getRng(),l=s.closest("body > *");a.startOffset>a.startContainer.length/2?l.after(ar):l.before(ar)})),e.isDefaultPrevented()||cu(n,t,e),ie=null}function uu(n,t){n.on("dragstart",()=>Qf(n)),n.on("drop",e=>tm(n,t,e)),n.on("paste",e=>cu(n,t,e))}function hu(n){return["undo redo","styles","bold italic underline forecolor backcolor formatoverflow","alignleft aligncenter alignright alignjustify","bullist numlist listoverflow",n.textDirection==="rtl"?"ltr rtl":"","link table imagemanager-insert insertoverflow","code about fullscreen"].filter(i=>!!i).join(" | ")}function em(n){n.ui.registry.addGroupToolbarButton("formatoverflow",{icon:"more-drawer",tooltip:"More",items:"strikethrough superscript subscript inlinecode removeformat"}),n.ui.registry.addGroupToolbarButton("listoverflow",{icon:"more-drawer",tooltip:"More",items:"tasklist outdent indent"}),n.ui.registry.addGroupToolbarButton("insertoverflow",{icon:"more-drawer",tooltip:"More",items:"customhr codeeditor drawio media details"})}function nm(n){n.ui.registry.addContextToolbar("linkcontexttoolbar",{predicate(t){return t.closest("a")!==null},position:"node",scope:"node",items:"link unlink openlink"})}function im(n){n.ui.registry.addContextToolbar("imagecontexttoolbar",{predicate(t){return t.closest("img")!==null},position:"node",scope:"node",items:"image"})}function du(n){em(n),nm(n),im(n)}var rm={"table-delete-column":'',"table-delete-row":'',"table-insert-column-after":'',"table-insert-column-before":'',"table-insert-row-above":'',"table-insert-row-after":'',table:'',"table-delete-table":''};function pu(n){for(let[t,e]of Object.entries(rm))n.ui.registry.addIcon(t,e)}function om(n){n.serializer.addNodeFilter("br",t=>{for(let e of t)if(e.parent&&e.parent.name==="code"){let i=window.tinymce.html.Node.create("#text");i.value=` `,e.replace(i)}})}function sm(n){n.parser.addNodeFilter("div",t=>{for(let e of t){let i=e.attr("id")||"",r=e.attr("class")||"";(i==="pointer"||r.includes("pointer"))&&e.remove()}})}function fu(n){om(n),sm(n)}function mu(n){return n.tagName.toLowerCase()==="code-block"}function bu(n,t,e,i){let r=window.$components.first("code-editor"),o=n.selection.getBookmark();r.open(t,e,(s,a)=>{i(s,a),n.focus(),n.selection.moveToBookmark(o)},()=>{n.focus(),n.selection.moveToBookmark(o)})}function gu(n,t){bu(n,t.getContent(),t.getLanguage(),(e,i)=>{t.setContent(e,i)})}function am(n){let t=n.getDoc(),e=t.defaultView;class i extends e.HTMLElement{constructor(){super();at(this,"editor",null);this.attachShadow({mode:"open"});let s=document.head.querySelectorAll('link[rel="stylesheet"]:not([media="print"]),style'),a=Array.from(s).map(c=>c.cloneNode(!0)),l=document.createElement("div");l.style.pointerEvents="none",l.contentEditable="false",l.classList.add("CodeMirrorContainer"),l.classList.toggle("dark-mode",document.documentElement.classList.contains("dark-mode")),this.shadowRoot.append(...a,l)}getLanguage(){let s=c=>(c.split(" ").filter(h=>h.startsWith("language-"))[0]||"").replace("language-",""),a=this.querySelector("code"),l=this.querySelector("pre");return s(l.className)||a&&s(a.className)||""}setContent(s,a){this.editor&&(this.editor.setContent(s),this.editor.setMode(a,s));let l=this.querySelector("pre");l||(l=t.createElement("pre"),this.append(l)),l.innerHTML="";let c=t.createElement("code");l.append(c),c.innerText=s,c.className=`language-${a}`}getContent(){let s=this.querySelector("code")||this.querySelector("pre"),a=document.createElement("pre");a.innerHTML=s.innerHTML.replace(/\ufeff/g,"");let l=a.querySelectorAll("br");for(let c of l)c.replaceWith(` `);return a.textContent}connectedCallback(){let s=Date.now();if(this.editor)return;this.cleanChildContent();let a=this.getContent(),c=a.split(` -`).length*19.2+18+24;this.style.height=`${c}px`;let u=this.shadowRoot.querySelector(".CodeMirrorContainer"),h=d=>{this.editor=d.wysiwygView(u,this.shadowRoot,a,this.getLanguage()),setTimeout(()=>{this.style.height=null},12)};window.importVersioned("code").then(d=>{let f=Date.now()-s<20?20:0;setTimeout(()=>h(d),f)})}cleanChildContent(){let s=this.querySelector("pre");if(s)for(let a of s.childNodes)a.nodeName==="#text"&&a.textContent==="\uFEFF"&&a.remove()}}e.customElements.define("code-block",i)}function lm(n){n.ui.registry.addIcon("codeblock",''),n.ui.registry.addButton("codeeditor",{tooltip:"Insert code block",icon:"codeblock",onAction(){n.execCommand("codeeditor")}}),n.ui.registry.addButton("editcodeeditor",{tooltip:"Edit code block",icon:"edit-block",onAction(){n.execCommand("codeeditor")}}),n.addCommand("codeeditor",()=>{let t=n.selection.getNode(),e=t.ownerDocument;if(mu(t))gu(n,t);else{let i=n.selection.getContent({format:"text"});bu(n,i,"",(r,o)=>{let s=e.createElement("pre"),a=e.createElement("code");a.classList.add(`language-${o}`),a.innerText=r,s.append(a),n.insertContent(s.outerHTML)})}}),n.on("dblclick",()=>{let t=n.selection.getNode();mu(t)&&gu(n,t)}),n.on("PreInit",()=>{n.parser.addNodeFilter("pre",t=>{for(let e of t){let i=window.tinymce.html.Node.create("code-block",{contenteditable:"false"}),r=e.getAll("span");for(let o of r)o.unwrap();e.attr("style",null),e.wrap(i)}}),n.parser.addNodeFilter("code-block",t=>{for(let e of t)e.attr("contenteditable","false")}),n.serializer.addNodeFilter("code-block",t=>{for(let e of t)e.unwrap()})}),n.ui.registry.addContextToolbar("codeeditor",{predicate(t){return t.nodeName.toLowerCase()==="code-block"},items:"editcodeeditor",position:"node",scope:"node"}),n.on("PreInit",()=>{am(n)})}function vu(){return lm}var pt=null,oe=null,re={};function Ho(n){return n.hasAttribute("drawio-diagram")}function cm(n,t=null){pt=n,oe=t,window.$components.first("image-manager").show(i=>{if(t){let r=t.querySelector("img");pt.undoManager.transact(()=>{pt.dom.setAttrib(r,"src",i.url),pt.dom.setAttrib(t,"drawio-diagram",i.id)})}else{let r=`
    `;pt.insertContent(r)}},"drawio")}async function um(n){let t=window.baseUrl("/loading.gif"),e=o=>{o.status===413?window.$events.emit("error",re.translations.serverUploadLimitText):window.$events.emit("error",re.translations.imageUploadErrorText),console.error(o)};if(oe){ee();let o=oe.querySelector("img");try{let s=await Oo(n,re.pageId);pt.undoManager.transact(()=>{pt.dom.setAttrib(o,"src",s.url),pt.dom.setAttrib(oe,"drawio-diagram",s.id)})}catch(s){throw e(s),new Error(`Failed to save image with error: ${s}`)}return}await is(5);let i=`drawing-${Math.random().toString(16).slice(2)}`,r=`drawing-wrap-${Math.random().toString(16).slice(2)}`;pt.insertContent(`
    `),ee();try{let o=await Oo(n,re.pageId);pt.undoManager.transact(()=>{pt.dom.setAttrib(i,"src",o.url),pt.dom.setAttrib(r,"drawio-diagram",o.id)})}catch(o){throw pt.dom.remove(r),e(o),new Error(`Failed to save image with error: ${o}`)}}function hm(){if(!oe)return Promise.resolve("");let n=oe.getAttribute("drawio-diagram");return _i(n)}function wu(n,t=null){pt=n,oe=t,tn(re.drawioUrl,hm,um)}function dm(n){n.addCommand("drawio",()=>{let t=n.selection.getNode();wu(n,Ho(t)?t:null)}),n.ui.registry.addIcon("diagram",``),n.ui.registry.addSplitButton("drawio",{tooltip:"Insert/edit drawing",icon:"diagram",onAction(){n.execCommand("drawio"),window.document.body.dispatchEvent(new Event("mousedown",{bubbles:!0}))},fetch(t){t([{type:"choiceitem",text:"Drawing manager",value:"drawing-manager"}])},onItemAction(t,e){if(e==="drawing-manager"){let i=n.selection.getNode();cm(n,Ho(i)?i:null)}}}),n.on("dblclick",()=>{let t=n.selection.getNode();Ho(t)&&wu(n,t)}),n.on("SetContent",()=>{let t=n.dom.select("body > div[drawio-diagram]");t.length&&n.undoManager.transact(()=>{for(let e of t)e.setAttribute("contenteditable","false")})})}function yu(n){return re=n,dm}function pm(n){n.addCommand("InsertHorizontalRule",()=>{let t=document.createElement("hr"),e=n.selection.getNode(),{parentNode:i}=e;i.insertBefore(t,e)}),n.ui.registry.addButton("customhr",{icon:"horizontal-rule",tooltip:"Insert horizontal line",onAction(){n.execCommand("InsertHorizontalRule")}})}function xu(){return pm}function fm(n){n.ui.registry.addButton("imagemanager-insert",{title:"Insert image",icon:"image",tooltip:"Insert image",onAction(){window.$components.first("image-manager").show(e=>{let i=e.thumbs?.display||e.url,r=``;r+=`${e.name}`,r+="",n.execCommand("mceInsertContent",!1,r)},"gallery")}})}function ku(){return fm}function mm(n){let t={title:"About the WYSIWYG Editor",url:window.baseUrl("/help/wysiwyg")};n.ui.registry.addButton("about",{icon:"help",tooltip:"About the editor",onAction(){window.tinymce.activeEditor.windowManager.openUrl(t)}})}function Cu(){return mm}var Eu=["p","h1","h2","h3","h4","h5","h6","div","blockquote","pre","code-block","details","ul","ol","table","hr"];function lr(n){return n.selection.getNode().closest("details")}function gm(n,t){let e=lr(n);e&&n.undoManager.transact(()=>{let i=e.querySelector("summary");i||(i=document.createElement("summary"),e.prepend(i)),i.textContent=t})}function bm(n){return{title:"Edit collapsible block",body:{type:"panel",items:[{type:"input",name:"summary",label:"Toggle label"}]},buttons:[{type:"cancel",text:"Cancel"},{type:"submit",text:"Save",primary:!0}],onSubmit(t){let{summary:e}=t.getData();gm(n,e),t.close()}}}function vm(n){let t=n.querySelector("summary");return t?t.textContent:""}function _u(n){let t=lr(n);n.windowManager.open(bm(n)).setData({summary:vm(t)})}function wm(n){let t=n.selection.getNode().closest("details"),e=n.selection.getBookmark();if(t){let i=t.querySelectorAll("details > *:not(summary, doc-root), doc-root > *");n.undoManager.transact(()=>{for(let r of i)t.parentNode.insertBefore(r,t);t.remove()})}n.focus(),n.selection.moveToBookmark(e)}function Uo(n){n.attr("contenteditable",null);let t=!1;for(let e of n.children())e.name==="doc-root"&&(e.unwrap(),t=!0);t&&Uo(n)}function ym(n){Uo(n),n.attr("contenteditable","false");let t=window.tinymce.html.Node.create("doc-root",{contenteditable:"true"}),e=null;for(let i of n.children()){if(i.name==="summary")continue;Eu.includes(i.name)?(t.append(i),e=null):(e||(e=window.tinymce.html.Node.create("p"),t.append(e)),e.append(i))}n.append(t)}function xm(n){n.parser.addNodeFilter("details",t=>{for(let e of t)ym(e)}),n.serializer.addNodeFilter("details",t=>{for(let e of t)Uo(e),e.attr("open",null)}),n.serializer.addNodeFilter("doc-root",t=>{for(let e of t)e.unwrap()})}function km(n){n.ui.registry.addIcon("details",''),n.ui.registry.addIcon("togglefold",''),n.ui.registry.addIcon("togglelabel",''),n.ui.registry.addButton("details",{icon:"details",tooltip:"Insert collapsible block",onAction(){n.execCommand("InsertDetailsBlock")}}),n.ui.registry.addButton("removedetails",{icon:"table-delete-table",tooltip:"Unwrap",onAction(){wm(n)}}),n.ui.registry.addButton("editdetials",{icon:"togglelabel",tooltip:"Edit label",onAction(){_u(n)}}),n.on("dblclick",t=>{!lr(n)||t.target.closest("doc-root")||_u(n)}),n.ui.registry.addButton("toggledetails",{icon:"togglefold",tooltip:"Toggle open/closed",onAction(){lr(n).toggleAttribute("open"),n.focus()}}),n.addCommand("InsertDetailsBlock",()=>{let t=n.selection.getContent({format:"html"}),e=document.createElement("details"),i=document.createElement("summary"),r=`details-${Date.now()}`;e.setAttribute("data-id",r),e.appendChild(i),t||(t="


    "),e.innerHTML+=t,n.insertContent(e.outerHTML),n.focus();let o=n.dom.select(`[data-id="${r}"]`)[0]||null;if(o){let s=o.querySelector("doc-root > *");s&&s.focus(),o.removeAttribute("data-id")}}),n.ui.registry.addContextToolbar("details",{predicate(t){return t.nodeName.toLowerCase()==="details"},items:"editdetials toggledetails removedetails",position:"node",scope:"node"}),n.on("PreInit",()=>{xm(n)})}function Su(){return km}function Cm(n){let t=n.closest("li");return t&&t.parentNode.nodeName==="UL"&&t.classList.contains("task-list-item")}function Em(n,t,e){let i=t.getBoundingClientRect();n.clientX<=i.right&&n.clientX>=i.left&&n.clientY>=i.top&&n.clientY<=i.bottom||e.undoManager.transact(()=>{t.hasAttribute("checked")?t.removeAttribute("checked"):t.setAttribute("checked","checked")})}function _m(n){n.attr("class","task-list-item");for(let t of n.children())t.name==="input"&&(t.attr("checked")==="checked"&&n.attr("checked","checked"),t.remove())}function Sm(n){let t=n.attr("checked")==="checked";n.attr("checked",null);let e={type:"checkbox",disabled:"disabled"};t&&(e.checked="checked");let i=window.tinymce.html.Node.create("input",e);i.shortEnded=!0,n.firstChild?n.insert(i,n.firstChild,!0):n.append(i)}function Am(n){n.ui.registry.addIcon("tasklist",''),n.ui.registry.addToggleButton("tasklist",{tooltip:"Task list",icon:"tasklist",active:!1,onAction(i){i.isActive()?n.execCommand("RemoveList"):n.execCommand("InsertUnorderedList",null,{"list-item-attributes":{class:"task-list-item"},"list-style-type":"tasklist"})},onSetup(i){n.on("NodeChange",r=>{let o=r.parents.find(a=>a.nodeName==="LI"),s=o&&o.classList.contains("task-list-item");i.setActive(!!s)})}});let t=n.ui.registry.getAll().buttons.bullist;t.onSetup=function(r){n.on("NodeChange",o=>{let s=o.parents.find(c=>c.nodeName==="LI"),a=s&&s.classList.contains("task-list-item"),l=s&&s.parentNode.nodeName==="UL";r.setActive(!!(l&&!a))})},t.onAction=function(){Cm(n.selection.getNode())&&n.execCommand("InsertOrderedList",null,{"list-item-attributes":{class:null}}),n.execCommand("InsertUnorderedList",null,{"list-item-attributes":{class:null}})};let e=n.ui.registry.getAll().buttons.numlist;e.onAction=function(){n.execCommand("InsertOrderedList",null,{"list-item-attributes":{class:null}})},n.on("PreInit",()=>{n.parser.addNodeFilter("li",i=>{for(let r of i)r.attributes.map.class==="task-list-item"&&_m(r)}),n.serializer.addNodeFilter("li",i=>{for(let r of i)r.attributes.map.class==="task-list-item"&&Sm(r)})}),n.on("click",i=>{let r=i.target;r.nodeName==="LI"&&r.classList.contains("task-list-item")&&(Em(i,r,n),i.preventDefault())})}function Au(){return Am}function Du(n){function t(e){let i=e.querySelector("iframe, video");if(!i)return;let r=[...i.classList.values()].filter(s=>s.startsWith("align-")),o=[...e.classList.values()].filter(s=>s.startsWith("align-"));e.classList.remove(...o),e.classList.add(...r)}n.on("SetContent",()=>{let e=n.dom.select("span.mce-preview-object");for(let i of e)t(i)}),n.on("FormatApply",e=>{let i=e.format.startsWith("align");if(!e.node||!e.node.matches(".mce-preview-object"))return;let r=e.node.querySelector("iframe, video");if(i&&r){let o=(n.formatter.get(e.format)[0]?.classes||[])[0],s=!r.classList.contains(o),l=(e.node.getAttribute("data-mce-p-class")||"").split(" ").filter(u=>!u.startsWith("align-"));s&&l.push(o);let c=l.join(" ");e.node.setAttribute("data-mce-p-class",c),r.setAttribute("class",c),n.formatter.apply(e.format,{},r),t(e.node)}})}var Dm=[{title:"Large Header",format:"h2",preview:"color: blue;"},{title:"Medium Header",format:"h3"},{title:"Small Header",format:"h4"},{title:"Tiny Header",format:"h5"},{title:"Paragraph",format:"p",exact:!0,classes:""},{title:"Blockquote",format:"blockquote"},{title:"Callouts",items:[{title:"Information",format:"calloutinfo"},{title:"Success",format:"calloutsuccess"},{title:"Warning",format:"calloutwarning"},{title:"Danger",format:"calloutdanger"}]}],Lm={alignleft:{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img,iframe,video,span",classes:"align-left"},aligncenter:{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img,iframe,video,span",classes:"align-center"},alignright:{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img,iframe,video,span",classes:"align-right"},calloutsuccess:{block:"p",exact:!0,attributes:{class:"callout success"}},calloutinfo:{block:"p",exact:!0,attributes:{class:"callout info"}},calloutwarning:{block:"p",exact:!0,attributes:{class:"callout warning"}},calloutdanger:{block:"p",exact:!0,attributes:{class:"callout danger"}}},Tm=["#BFEDD2","","#FBEEB8","","#F8CAC6","","#ECCAFA","","#C2E0F4","","#2DC26B","","#F1C40F","","#E03E2D","","#B96AD9","","#3598DB","","#169179","","#E67E23","","#BA372A","","#843FA1","","#236FA1","","#ECF0F1","","#CED4D9","","#95A5A6","","#7E8C8D","","#34495E","","#000000","","#ffffff",""];function Lu(n,t,e){if(e.filetype==="file"){let i=window.$components.first("entity-selector-popup"),r=this.selection.getContent({format:"text"}).trim();i.show(o=>{n(o.link,{text:o.name,title:o.name})},r,{searchEndpoint:"/search/entity-selector",entityTypes:"page,book,chapter,bookshelf",entityPermission:"view"})}e.filetype==="image"&&window.$components.first("image-manager").show(r=>{n(r.url,{alt:r.name})},"gallery")}function $m(n){let t=["image","table","link","autolink","fullscreen","code","customhr","autosave","lists","codeeditor","media","imagemanager","about","details","tasklist",n.textDirection==="rtl"?"directionality":""];return window.tinymce.PluginManager.add("codeeditor",vu()),window.tinymce.PluginManager.add("customhr",xu()),window.tinymce.PluginManager.add("imagemanager",ku()),window.tinymce.PluginManager.add("about",Cu()),window.tinymce.PluginManager.add("details",Su()),window.tinymce.PluginManager.add("tasklist",Au()),n.drawioUrl&&(window.tinymce.PluginManager.add("drawio",yu(n)),t.push("drawio")),t.filter(e=>!!e)}function Tu(){let n=document.head.innerHTML.split(` +`).length*19.2+18+24;this.style.height=`${c}px`;let u=this.shadowRoot.querySelector(".CodeMirrorContainer"),h=d=>{this.editor=d.wysiwygView(u,this.shadowRoot,a,this.getLanguage()),setTimeout(()=>{this.style.height=null},12)};window.importVersioned("code").then(d=>{let f=Date.now()-s<20?20:0;setTimeout(()=>h(d),f)})}cleanChildContent(){let s=this.querySelector("pre");if(s)for(let a of s.childNodes)a.nodeName==="#text"&&a.textContent==="\uFEFF"&&a.remove()}}e.customElements.define("code-block",i)}function lm(n){n.ui.registry.addIcon("codeblock",''),n.ui.registry.addButton("codeeditor",{tooltip:"Insert code block",icon:"codeblock",onAction(){n.execCommand("codeeditor")}}),n.ui.registry.addButton("editcodeeditor",{tooltip:"Edit code block",icon:"edit-block",onAction(){n.execCommand("codeeditor")}}),n.addCommand("codeeditor",()=>{let t=n.selection.getNode(),e=t.ownerDocument;if(mu(t))gu(n,t);else{let i=n.selection.getContent({format:"text"});bu(n,i,"",(r,o)=>{let s=e.createElement("pre"),a=e.createElement("code");a.classList.add(`language-${o}`),a.innerText=r,s.append(a),n.insertContent(s.outerHTML)})}}),n.on("dblclick",()=>{let t=n.selection.getNode();mu(t)&&gu(n,t)}),n.on("PreInit",()=>{n.parser.addNodeFilter("pre",t=>{for(let e of t){let i=window.tinymce.html.Node.create("code-block",{contenteditable:"false"}),r=e.getAll("span");for(let o of r)o.unwrap();e.attr("style",null),e.wrap(i)}}),n.parser.addNodeFilter("code-block",t=>{for(let e of t)e.attr("contenteditable","false")}),n.serializer.addNodeFilter("code-block",t=>{for(let e of t)e.unwrap()})}),n.ui.registry.addContextToolbar("codeeditor",{predicate(t){return t.nodeName.toLowerCase()==="code-block"},items:"editcodeeditor",position:"node",scope:"node"}),n.on("PreInit",()=>{am(n)})}function vu(){return lm}var pt=null,oe=null,re={};function Ho(n){return n.hasAttribute("drawio-diagram")}function cm(n,t=null){pt=n,oe=t,window.$components.first("image-manager").show(i=>{if(t){let r=t.querySelector("img");pt.undoManager.transact(()=>{pt.dom.setAttrib(r,"src",i.url),pt.dom.setAttrib(t,"drawio-diagram",i.id)})}else{let r=`
    `;pt.insertContent(r)}},"drawio")}async function um(n){let t=window.baseUrl("/loading.gif"),e=o=>{o.status===413?window.$events.emit("error",re.translations.serverUploadLimitText):window.$events.emit("error",re.translations.imageUploadErrorText),console.error(o)};if(oe){ee();let o=oe.querySelector("img");try{let s=await Oo(n,re.pageId);pt.undoManager.transact(()=>{pt.dom.setAttrib(o,"src",s.url),pt.dom.setAttrib(oe,"drawio-diagram",s.id)})}catch(s){throw e(s),new Error(`Failed to save image with error: ${s}`)}return}await is(5);let i=`drawing-${Math.random().toString(16).slice(2)}`,r=`drawing-wrap-${Math.random().toString(16).slice(2)}`;pt.insertContent(`
    `),ee();try{let o=await Oo(n,re.pageId);pt.undoManager.transact(()=>{pt.dom.setAttrib(i,"src",o.url),pt.dom.setAttrib(r,"drawio-diagram",o.id)})}catch(o){throw pt.dom.remove(r),e(o),new Error(`Failed to save image with error: ${o}`)}}function hm(){if(!oe)return Promise.resolve("");let n=oe.getAttribute("drawio-diagram");return _i(n)}function wu(n,t=null){pt=n,oe=t,tn(re.drawioUrl,hm,um)}function dm(n){n.addCommand("drawio",()=>{let t=n.selection.getNode();wu(n,Ho(t)?t:null)}),n.ui.registry.addIcon("diagram",``),n.ui.registry.addSplitButton("drawio",{tooltip:"Insert/edit drawing",icon:"diagram",onAction(){n.execCommand("drawio"),window.document.body.dispatchEvent(new Event("mousedown",{bubbles:!0}))},fetch(t){t([{type:"choiceitem",text:"Drawing manager",value:"drawing-manager"}])},onItemAction(t,e){if(e==="drawing-manager"){let i=n.selection.getNode();cm(n,Ho(i)?i:null)}}}),n.on("dblclick",()=>{let t=n.selection.getNode();Ho(t)&&wu(n,t)}),n.on("SetContent",()=>{let t=n.dom.select("body > div[drawio-diagram]");t.length&&n.undoManager.transact(()=>{for(let e of t)e.setAttribute("contenteditable","false")})})}function yu(n){return re=n,dm}function pm(n){n.addCommand("InsertHorizontalRule",()=>{let t=document.createElement("hr"),e=n.selection.getNode(),{parentNode:i}=e;i.insertBefore(t,e)}),n.ui.registry.addButton("customhr",{icon:"horizontal-rule",tooltip:"Insert horizontal line",onAction(){n.execCommand("InsertHorizontalRule")}})}function xu(){return pm}function fm(n){n.ui.registry.addButton("imagemanager-insert",{title:"Insert image",icon:"image",tooltip:"Insert image",onAction(){window.$components.first("image-manager").show(e=>{let i=e.thumbs?.display||e.url,r=``;r+=`${e.name}`,r+="",n.execCommand("mceInsertContent",!1,r)},"gallery")}})}function ku(){return fm}function mm(n){let t={title:"About the WYSIWYG Editor",url:window.baseUrl("/help/wysiwyg")};n.ui.registry.addButton("about",{icon:"help",tooltip:"About the editor",onAction(){window.tinymce.activeEditor.windowManager.openUrl(t)}})}function Cu(){return mm}var Eu=["p","h1","h2","h3","h4","h5","h6","div","blockquote","pre","code-block","details","ul","ol","table","hr"];function lr(n){return n.selection.getNode().closest("details")}function gm(n,t){let e=lr(n);e&&n.undoManager.transact(()=>{let i=e.querySelector("summary");i||(i=document.createElement("summary"),e.prepend(i)),i.textContent=t})}function bm(n){return{title:"Edit collapsible block",body:{type:"panel",items:[{type:"input",name:"summary",label:"Toggle label"}]},buttons:[{type:"cancel",text:"Cancel"},{type:"submit",text:"Save",primary:!0}],onSubmit(t){let{summary:e}=t.getData();gm(n,e),t.close()}}}function vm(n){let t=n.querySelector("summary");return t?t.textContent:""}function _u(n){let t=lr(n);n.windowManager.open(bm(n)).setData({summary:vm(t)})}function wm(n){let t=n.selection.getNode().closest("details"),e=n.selection.getBookmark();if(t){let i=t.querySelectorAll("details > *:not(summary, doc-root), doc-root > *");n.undoManager.transact(()=>{for(let r of i)t.parentNode.insertBefore(r,t);t.remove()})}n.focus(),n.selection.moveToBookmark(e)}function Uo(n){n.attr("contenteditable",null);let t=!1;for(let e of n.children())e.name==="doc-root"&&(e.unwrap(),t=!0);t&&Uo(n)}function ym(n){Uo(n),n.attr("contenteditable","false");let t=window.tinymce.html.Node.create("doc-root",{contenteditable:"true"}),e=null;for(let i of n.children()){if(i.name==="summary")continue;Eu.includes(i.name)?(t.append(i),e=null):(e||(e=window.tinymce.html.Node.create("p"),t.append(e)),e.append(i))}n.append(t)}function xm(n){n.parser.addNodeFilter("details",t=>{for(let e of t)ym(e)}),n.serializer.addNodeFilter("details",t=>{for(let e of t)Uo(e),e.attr("open",null)}),n.serializer.addNodeFilter("doc-root",t=>{for(let e of t)e.unwrap()})}function km(n){n.ui.registry.addIcon("details",''),n.ui.registry.addIcon("togglefold",''),n.ui.registry.addIcon("togglelabel",''),n.ui.registry.addButton("details",{icon:"details",tooltip:"Insert collapsible block",onAction(){n.execCommand("InsertDetailsBlock")}}),n.ui.registry.addButton("removedetails",{icon:"table-delete-table",tooltip:"Unwrap",onAction(){wm(n)}}),n.ui.registry.addButton("editdetials",{icon:"togglelabel",tooltip:"Edit label",onAction(){_u(n)}}),n.on("dblclick",t=>{!lr(n)||t.target.closest("doc-root")||_u(n)}),n.ui.registry.addButton("toggledetails",{icon:"togglefold",tooltip:"Toggle open/closed",onAction(){lr(n).toggleAttribute("open"),n.focus()}}),n.addCommand("InsertDetailsBlock",()=>{let t=n.selection.getContent({format:"html"}),e=document.createElement("details"),i=document.createElement("summary"),r=`details-${Date.now()}`;e.setAttribute("data-id",r),e.appendChild(i),t||(t="


    "),e.innerHTML+=t,n.insertContent(e.outerHTML),n.focus();let o=n.dom.select(`[data-id="${r}"]`)[0]||null;if(o){let s=o.querySelector("doc-root > *");s&&s.focus(),o.removeAttribute("data-id")}}),n.ui.registry.addContextToolbar("details",{predicate(t){return t.nodeName.toLowerCase()==="details"},items:"editdetials toggledetails removedetails",position:"node",scope:"node"}),n.on("PreInit",()=>{xm(n)})}function Su(){return km}function Cm(n){let t=n.closest("li");return t&&t.parentNode.nodeName==="UL"&&t.classList.contains("task-list-item")}function Em(n,t,e){let i=t.getBoundingClientRect();n.clientX<=i.right&&n.clientX>=i.left&&n.clientY>=i.top&&n.clientY<=i.bottom||e.undoManager.transact(()=>{t.hasAttribute("checked")?t.removeAttribute("checked"):t.setAttribute("checked","checked")})}function _m(n){n.attr("class","task-list-item");for(let t of n.children())t.name==="input"&&(t.attr("checked")==="checked"&&n.attr("checked","checked"),t.remove())}function Sm(n){let t=n.attr("checked")==="checked";n.attr("checked",null);let e={type:"checkbox",disabled:"disabled"};t&&(e.checked="checked");let i=window.tinymce.html.Node.create("input",e);i.shortEnded=!0,n.firstChild?n.insert(i,n.firstChild,!0):n.append(i)}function Am(n){n.ui.registry.addIcon("tasklist",''),n.ui.registry.addToggleButton("tasklist",{tooltip:"Task list",icon:"tasklist",active:!1,onAction(i){i.isActive()?n.execCommand("RemoveList"):n.execCommand("InsertUnorderedList",null,{"list-item-attributes":{class:"task-list-item"},"list-style-type":"tasklist"})},onSetup(i){n.on("NodeChange",r=>{let o=r.parents.find(a=>a.nodeName==="LI"),s=o&&o.classList.contains("task-list-item");i.setActive(!!s)})}});let t=n.ui.registry.getAll().buttons.bullist;t.onSetup=function(r){n.on("NodeChange",o=>{let s=o.parents.find(c=>c.nodeName==="LI"),a=s&&s.classList.contains("task-list-item"),l=s&&s.parentNode.nodeName==="UL";r.setActive(!!(l&&!a))})},t.onAction=function(){Cm(n.selection.getNode())&&n.execCommand("InsertOrderedList",null,{"list-item-attributes":{class:null}}),n.execCommand("InsertUnorderedList",null,{"list-item-attributes":{class:null}})};let e=n.ui.registry.getAll().buttons.numlist;e.onAction=function(){n.execCommand("InsertOrderedList",null,{"list-item-attributes":{class:null}})},n.on("PreInit",()=>{n.parser.addNodeFilter("li",i=>{for(let r of i)r.attributes.map.class==="task-list-item"&&_m(r)}),n.serializer.addNodeFilter("li",i=>{for(let r of i)r.attributes.map.class==="task-list-item"&&Sm(r)})}),n.on("click",i=>{let r=i.target;r.nodeName==="LI"&&r.classList.contains("task-list-item")&&(Em(i,r,n),i.preventDefault())})}function Au(){return Am}function Du(n){function t(e){let i=e.querySelector("iframe, video");if(!i)return;let r=[...i.classList.values()].filter(s=>s.startsWith("align-")),o=[...e.classList.values()].filter(s=>s.startsWith("align-"));e.classList.remove(...o),e.classList.add(...r)}n.on("SetContent",()=>{let e=n.dom.select("span.mce-preview-object");for(let i of e)t(i)}),n.on("FormatApply",e=>{let i=e.format.startsWith("align");if(!e.node||!e.node.matches(".mce-preview-object"))return;let r=e.node.querySelector("iframe, video");if(i&&r){let o=(n.formatter.get(e.format)[0]?.classes||[])[0],s=!r.classList.contains(o),l=(e.node.getAttribute("data-mce-p-class")||"").split(" ").filter(u=>!u.startsWith("align-"));s&&l.push(o);let c=l.join(" ");e.node.setAttribute("data-mce-p-class",c),r.setAttribute("class",c),n.formatter.apply(e.format,{},r),t(e.node)}})}var Dm=[{title:"Large Header",format:"h2",preview:"color: blue;"},{title:"Medium Header",format:"h3"},{title:"Small Header",format:"h4"},{title:"Tiny Header",format:"h5"},{title:"Paragraph",format:"p",exact:!0,classes:""},{title:"Blockquote",format:"blockquote"},{title:"Callouts",items:[{title:"Information",format:"calloutinfo"},{title:"Success",format:"calloutsuccess"},{title:"Warning",format:"calloutwarning"},{title:"Danger",format:"calloutdanger"}]}],Lm={alignleft:{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img,iframe,video,span",classes:"align-left"},aligncenter:{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img,iframe,video,span",classes:"align-center"},alignright:{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img,iframe,video,span",classes:"align-right"},calloutsuccess:{block:"p",exact:!0,attributes:{class:"callout success"}},calloutinfo:{block:"p",exact:!0,attributes:{class:"callout info"}},calloutwarning:{block:"p",exact:!0,attributes:{class:"callout warning"}},calloutdanger:{block:"p",exact:!0,attributes:{class:"callout danger"}}},Tm=["#BFEDD2","","#FBEEB8","","#F8CAC6","","#ECCAFA","","#C2E0F4","","#2DC26B","","#F1C40F","","#E03E2D","","#B96AD9","","#3598DB","","#169179","","#E67E23","","#BA372A","","#843FA1","","#236FA1","","#ECF0F1","","#CED4D9","","#95A5A6","","#7E8C8D","","#34495E","","#000000","","#ffffff",""];function Lu(n,t,e){if(e.filetype==="file"){let i=window.$components.first("entity-selector-popup"),r=this.selection.getContent({format:"text"}).trim();i.show(o=>{n(o.link,{text:o.name,title:o.name})},{initialValue:r,searchEndpoint:"/search/entity-selector",entityTypes:"page,book,chapter,bookshelf",entityPermission:"view"})}e.filetype==="image"&&window.$components.first("image-manager").show(r=>{n(r.url,{alt:r.name})},"gallery")}function $m(n){let t=["image","table","link","autolink","fullscreen","code","customhr","autosave","lists","codeeditor","media","imagemanager","about","details","tasklist",n.textDirection==="rtl"?"directionality":""];return window.tinymce.PluginManager.add("codeeditor",vu()),window.tinymce.PluginManager.add("customhr",xu()),window.tinymce.PluginManager.add("imagemanager",ku()),window.tinymce.PluginManager.add("about",Cu()),window.tinymce.PluginManager.add("details",Su()),window.tinymce.PluginManager.add("tasklist",Au()),n.drawioUrl&&(window.tinymce.PluginManager.add("drawio",yu(n)),t.push("drawio")),t.filter(e=>!!e)}function Tu(){let n=document.head.innerHTML.split(` `),t=n.findIndex(i=>i.trim()===""),e=n.findIndex(i=>i.trim()==="");return t===-1||e===-1?"":n.slice(t+1,e).join(` `)}function Im(n){return function(e){function i(){n.darkMode&&e.contentDocument.documentElement.classList.add("dark-mode"),window.$events.emit("editor-html-change","")}e.on("ExecCommand change input NodeChange ObjectResized",i),au(e),uu(e,n),e.on("init",()=>{i(),lu(e),window.editor=e,su(e)}),e.on("PreInit",()=>{fu(e)}),Du(e),window.$events.emitPublic(n.containerElement,"editor-tinymce::setup",{editor:e}),e.ui.registry.addButton("inlinecode",{tooltip:"Inline code",icon:"sourcecode",onAction(){e.execCommand("mceToggleFormat",!1,"code")}})}}function $u(n){return` html, body, html.dark-mode { diff --git a/version b/version index 6a54901b092..524938b53c6 100644 --- a/version +++ b/version @@ -1 +1 @@ -v23.12.1 +v23.12.2 From 3e9e196cdada5a6c515d5bbab971c80a90d333ab Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Thu, 25 Jan 2024 14:24:46 +0000 Subject: [PATCH 16/79] OIDC: Added PKCE functionality Related to #4734. Uses core logic from League AbstractProvider. --- app/Access/Oidc/OidcOAuthProvider.php | 31 +++++++++++---------------- app/Access/Oidc/OidcService.php | 12 ++++++++++- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/app/Access/Oidc/OidcOAuthProvider.php b/app/Access/Oidc/OidcOAuthProvider.php index d2dc829b729..371bfcecb54 100644 --- a/app/Access/Oidc/OidcOAuthProvider.php +++ b/app/Access/Oidc/OidcOAuthProvider.php @@ -83,15 +83,9 @@ protected function getScopeSeparator(): string /** * Checks a provider response for errors. - * - * @param ResponseInterface $response - * @param array|string $data Parsed response data - * * @throws IdentityProviderException - * - * @return void */ - protected function checkResponse(ResponseInterface $response, $data) + protected function checkResponse(ResponseInterface $response, $data): void { if ($response->getStatusCode() >= 400 || isset($data['error'])) { throw new IdentityProviderException( @@ -105,13 +99,8 @@ protected function checkResponse(ResponseInterface $response, $data) /** * Generates a resource owner object from a successful resource owner * details request. - * - * @param array $response - * @param AccessToken $token - * - * @return ResourceOwnerInterface */ - protected function createResourceOwner(array $response, AccessToken $token) + protected function createResourceOwner(array $response, AccessToken $token): ResourceOwnerInterface { return new GenericResourceOwner($response, ''); } @@ -121,14 +110,18 @@ protected function createResourceOwner(array $response, AccessToken $token) * * The grant that was used to fetch the response can be used to provide * additional context. - * - * @param array $response - * @param AbstractGrant $grant - * - * @return OidcAccessToken */ - protected function createAccessToken(array $response, AbstractGrant $grant) + protected function createAccessToken(array $response, AbstractGrant $grant): OidcAccessToken { return new OidcAccessToken($response); } + + /** + * Get the method used for PKCE code verifier hashing, which is passed + * in the "code_challenge_method" parameter in the authorization request. + */ + protected function getPkceMethod(): string + { + return static::PKCE_METHOD_S256; + } } diff --git a/app/Access/Oidc/OidcService.php b/app/Access/Oidc/OidcService.php index f1e5b25af14..036c9fc47ef 100644 --- a/app/Access/Oidc/OidcService.php +++ b/app/Access/Oidc/OidcService.php @@ -33,6 +33,8 @@ public function __construct( /** * Initiate an authorization flow. + * Provides back an authorize redirect URL, in addition to other + * details which may be required for the auth flow. * * @throws OidcException * @@ -42,8 +44,12 @@ public function login(): array { $settings = $this->getProviderSettings(); $provider = $this->getProvider($settings); + + $url = $provider->getAuthorizationUrl(); + session()->put('oidc_pkce_code', $provider->getPkceCode() ?? ''); + return [ - 'url' => $provider->getAuthorizationUrl(), + 'url' => $url, 'state' => $provider->getState(), ]; } @@ -63,6 +69,10 @@ public function processAuthorizeResponse(?string $authorizationCode): User $settings = $this->getProviderSettings(); $provider = $this->getProvider($settings); + // Set PKCE code flashed at login + $pkceCode = session()->pull('oidc_pkce_code', ''); + $provider->setPkceCode($pkceCode); + // Try to exchange authorization code for access token $accessToken = $provider->getAccessToken('authorization_code', [ 'code' => $authorizationCode, From 1dc094ffafc216e15c8355b400b21524137de5e4 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sat, 27 Jan 2024 16:41:15 +0000 Subject: [PATCH 17/79] OIDC: Added testing of PKCE flow Also compared full flow to RFC spec during this process --- tests/Auth/OidcTest.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/Auth/OidcTest.php b/tests/Auth/OidcTest.php index dbf26f1bd30..345d1dc780b 100644 --- a/tests/Auth/OidcTest.php +++ b/tests/Auth/OidcTest.php @@ -655,6 +655,34 @@ public function test_oidc_id_token_pre_validate_theme_event_with_return() ]); } + public function test_pkce_used_on_authorize_and_access() + { + // Start auth + $resp = $this->post('/oidc/login'); + $state = session()->get('oidc_state'); + + $pkceCode = session()->get('oidc_pkce_code'); + $this->assertGreaterThan(30, strlen($pkceCode)); + + $expectedCodeChallenge = trim(strtr(base64_encode(hash('sha256', $pkceCode, true)), '+/', '-_'), '='); + $redirect = $resp->headers->get('Location'); + $redirectParams = []; + parse_str(parse_url($redirect, PHP_URL_QUERY), $redirectParams); + $this->assertEquals($expectedCodeChallenge, $redirectParams['code_challenge']); + $this->assertEquals('S256', $redirectParams['code_challenge_method']); + + $transactions = $this->mockHttpClient([$this->getMockAuthorizationResponse([ + 'email' => 'benny@example.com', + 'sub' => 'benny1010101', + ])]); + + $this->get('/oidc/callback?code=SplxlOBeZQQYbYS6WxSbIA&state=' . $state); + $tokenRequest = $transactions->latestRequest(); + $bodyParams = []; + parse_str($tokenRequest->getBody(), $bodyParams); + $this->assertEquals($pkceCode, $bodyParams['code_verifier']); + } + protected function withAutodiscovery() { config()->set([ From 2a849894bee6ac7846261938c9606fb18a4a1761 Mon Sep 17 00:00:00 2001 From: Sascha Date: Mon, 29 Jan 2024 19:37:59 +0100 Subject: [PATCH 18/79] Update entities.php changed text of `pages_delete_warning_template` to include chapters --- lang/en/entities.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/en/entities.php b/lang/en/entities.php index 4ab9de47dfb..21ef93fed3c 100644 --- a/lang/en/entities.php +++ b/lang/en/entities.php @@ -210,7 +210,7 @@ 'pages_delete_draft' => 'Delete Draft Page', 'pages_delete_success' => 'Page deleted', 'pages_delete_draft_success' => 'Draft page deleted', - 'pages_delete_warning_template' => 'This page is in active use as a book default page template. These books will no longer have a default page template assigned after this page is deleted.', + 'pages_delete_warning_template' => 'This page is in active use as a book or chapter default page template. These books or chapters will no longer have a default page template assigned after this page is deleted.', 'pages_delete_confirm' => 'Are you sure you want to delete this page?', 'pages_delete_draft_confirm' => 'Are you sure you want to delete this draft page?', 'pages_editing_named' => 'Editing Page :pageName', From 64c783c6f8efb351dd73a1cfb4b5f214a731bd57 Mon Sep 17 00:00:00 2001 From: Sascha Date: Mon, 29 Jan 2024 19:55:39 +0100 Subject: [PATCH 19/79] extraded template form to own file and changed translations --- lang/en/entities.php | 9 +++------ resources/views/books/parts/form.blade.php | 18 ++---------------- resources/views/chapters/parts/form.blade.php | 18 ++---------------- .../views/entities/template-selector.blade.php | 14 ++++++++++++++ 4 files changed, 21 insertions(+), 38 deletions(-) create mode 100644 resources/views/entities/template-selector.blade.php diff --git a/lang/en/entities.php b/lang/en/entities.php index 21ef93fed3c..8860e243e77 100644 --- a/lang/en/entities.php +++ b/lang/en/entities.php @@ -39,6 +39,9 @@ 'export_pdf' => 'PDF File', 'export_text' => 'Plain Text File', 'export_md' => 'Markdown File', + 'default_template' => 'Default Page Template', + 'default_template_explain' => 'Assign a page template that will be used as the default content for all new pages in this book/chapter. Keep in mind this will only be used if the page creator has view access to those chosen template page.', + 'default_template_select' => 'Select a template page', // Permissions and restrictions 'permissions' => 'Permissions', @@ -132,9 +135,6 @@ 'books_edit_named' => 'Edit Book :bookName', 'books_form_book_name' => 'Book Name', 'books_save' => 'Save Book', - 'books_default_template' => 'Default Page Template', - 'books_default_template_explain' => 'Assign a page template that will be used as the default content for all new pages in this book. Keep in mind this will only be used if the page creator has view access to those chosen template page.', - 'books_default_template_select' => 'Select a template page', 'books_permissions' => 'Book Permissions', 'books_permissions_updated' => 'Book Permissions Updated', 'books_empty_contents' => 'No pages or chapters have been created for this book.', @@ -192,9 +192,6 @@ 'chapters_permissions_success' => 'Chapter Permissions Updated', 'chapters_search_this' => 'Search this chapter', 'chapter_sort_book' => 'Sort Book', - 'chapter_default_template' => 'Default Page Template', - 'chapter_default_template_explain' => 'Assign a page template that will be used as the default content for all new pages in this chapter. Keep in mind this will only be used if the page creator has view access to those chosen template page.', - 'chapter_default_template_select' => 'Select a template page', // Pages 'page' => 'Page', diff --git a/resources/views/books/parts/form.blade.php b/resources/views/books/parts/form.blade.php index fa8f16e52f4..ee261e72d4a 100644 --- a/resources/views/books/parts/form.blade.php +++ b/resources/views/books/parts/form.blade.php @@ -40,24 +40,10 @@
    -
    -

    - {{ trans('entities.books_default_template_explain') }} -

    - -
    - @include('form.page-picker', [ - 'name' => 'default_template_id', - 'placeholder' => trans('entities.books_default_template_select'), - 'value' => $book->default_template_id ?? null, - 'selectorEndpoint' => '/search/entity-selector-templates', - ]) -
    -
    - + @include('entities.template-selector', ['entity' => $book ?? null])
    diff --git a/resources/views/chapters/parts/form.blade.php b/resources/views/chapters/parts/form.blade.php index ea7f84bc839..602693916ea 100644 --- a/resources/views/chapters/parts/form.blade.php +++ b/resources/views/chapters/parts/form.blade.php @@ -24,24 +24,10 @@
    -
    -

    - {{ trans('entities.chapter_default_template_explain') }} -

    - -
    - @include('form.page-picker', [ - 'name' => 'default_template_id', - 'placeholder' => trans('entities.chapter_default_template_select'), - 'value' => $chapter->default_template_id ?? null, - 'selectorEndpoint' => '/search/entity-selector-templates', - ]) -
    -
    - + @include('entities.template-selector', ['entity' => $chapter ?? null])
    diff --git a/resources/views/entities/template-selector.blade.php b/resources/views/entities/template-selector.blade.php new file mode 100644 index 00000000000..80b2f49b2b9 --- /dev/null +++ b/resources/views/entities/template-selector.blade.php @@ -0,0 +1,14 @@ +
    +

    + {{ trans('entities.default_template_explain') }} +

    + +
    + @include('form.page-picker', [ + 'name' => 'default_template_id', + 'placeholder' => trans('entities.default_template_select'), + 'value' => $entity->default_template_id ?? null, + 'selectorEndpoint' => '/search/entity-selector-templates', + ]) +
    +
    \ No newline at end of file From 4a8f70240fd01f28980dfd4031c7df2b1db4949a Mon Sep 17 00:00:00 2001 From: Sascha Date: Mon, 29 Jan 2024 19:59:03 +0100 Subject: [PATCH 20/79] added template to chapter API controller --- .../Controllers/ChapterApiController.php | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/app/Entities/Controllers/ChapterApiController.php b/app/Entities/Controllers/ChapterApiController.php index c2132326200..27b8206592d 100644 --- a/app/Entities/Controllers/ChapterApiController.php +++ b/app/Entities/Controllers/ChapterApiController.php @@ -15,20 +15,22 @@ class ChapterApiController extends ApiController { protected $rules = [ 'create' => [ - 'book_id' => ['required', 'integer'], - 'name' => ['required', 'string', 'max:255'], - 'description' => ['string', 'max:1900'], - 'description_html' => ['string', 'max:2000'], - 'tags' => ['array'], - 'priority' => ['integer'], + 'book_id' => ['required', 'integer'], + 'name' => ['required', 'string', 'max:255'], + 'description' => ['string', 'max:1900'], + 'description_html' => ['string', 'max:2000'], + 'tags' => ['array'], + 'priority' => ['integer'], + 'default_template_id' => ['nullable', 'integer'], ], 'update' => [ - 'book_id' => ['integer'], - 'name' => ['string', 'min:1', 'max:255'], - 'description' => ['string', 'max:1900'], - 'description_html' => ['string', 'max:2000'], - 'tags' => ['array'], - 'priority' => ['integer'], + 'book_id' => ['integer'], + 'name' => ['string', 'min:1', 'max:255'], + 'description' => ['string', 'max:1900'], + 'description_html' => ['string', 'max:2000'], + 'tags' => ['array'], + 'priority' => ['integer'], + 'default_template_id' => ['nullable', 'integer'], ], ]; From 24e6dc4b37f857ffe6f8eab85ca177ed290bb38a Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Tue, 30 Jan 2024 11:38:47 +0000 Subject: [PATCH 21/79] WYSIWYG: Altered how custom head added to editors Updated to parse and add as DOM nodes instead of innerHTML to avoid triggering an update of all head content, which would throw warnings in chromium in regard to setting the base URI. For #4814 --- resources/js/wysiwyg/config.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/resources/js/wysiwyg/config.js b/resources/js/wysiwyg/config.js index 6c96e47e9c3..36d78b32515 100644 --- a/resources/js/wysiwyg/config.js +++ b/resources/js/wysiwyg/config.js @@ -143,16 +143,23 @@ function gatherPlugins(options) { } /** - * Fetch custom HTML head content from the parent page head into the editor. + * Fetch custom HTML head content nodes from the outer page head + * and add them to the given editor document. + * @param {Document} editorDoc */ -function fetchCustomHeadContent() { +function addCustomHeadContent(editorDoc) { const headContentLines = document.head.innerHTML.split('\n'); const startLineIndex = headContentLines.findIndex(line => line.trim() === ''); const endLineIndex = headContentLines.findIndex(line => line.trim() === ''); if (startLineIndex === -1 || endLineIndex === -1) { - return ''; + return; } - return headContentLines.slice(startLineIndex + 1, endLineIndex).join('\n'); + + const customHeadHtml = headContentLines.slice(startLineIndex + 1, endLineIndex).join('\n'); + const el = editorDoc.createElement('div'); + el.innerHTML = customHeadHtml; + + editorDoc.head.append(...el.children); } /** @@ -284,8 +291,7 @@ export function buildForEditor(options) { } }, init_instance_callback(editor) { - const head = editor.getDoc().querySelector('head'); - head.innerHTML += fetchCustomHeadContent(); + addCustomHeadContent(editor.getDoc()); }, setup(editor) { registerCustomIcons(editor); @@ -335,8 +341,7 @@ export function buildForInput(options) { file_picker_types: 'file', file_picker_callback: filePickerCallback, init_instance_callback(editor) { - const head = editor.getDoc().querySelector('head'); - head.innerHTML += fetchCustomHeadContent(); + addCustomHeadContent(editor.getDoc()); editor.contentDocument.documentElement.classList.toggle('dark-mode', options.darkMode); }, From 5c92b72fdd419ccb6f77bfdf0a1cb1358c51a9d8 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Tue, 30 Jan 2024 14:27:09 +0000 Subject: [PATCH 22/79] Comments: Added input wysiwyg for creating/updating comments Not supporting old content, existing HTML or updating yet. --- app/Activity/Tools/CommentTree.php | 11 ++++++++ resources/js/components/page-comment.js | 27 ++++++++++++++++--- resources/js/components/page-comments.js | 30 ++++++++++++++++++--- resources/js/components/wysiwyg-input.js | 7 ++--- resources/sass/_tinymce.scss | 7 +++++ resources/views/comments/comment.blade.php | 2 ++ resources/views/comments/comments.blade.php | 10 ++++++- resources/views/layouts/base.blade.php | 3 +++ 8 files changed, 85 insertions(+), 12 deletions(-) diff --git a/app/Activity/Tools/CommentTree.php b/app/Activity/Tools/CommentTree.php index 3303add39b8..16f6804ea42 100644 --- a/app/Activity/Tools/CommentTree.php +++ b/app/Activity/Tools/CommentTree.php @@ -41,6 +41,17 @@ public function get(): array return $this->tree; } + public function canUpdateAny(): bool + { + foreach ($this->comments as $comment) { + if (userCan('comment-update', $comment)) { + return true; + } + } + + return false; + } + /** * @param Comment[] $comments */ diff --git a/resources/js/components/page-comment.js b/resources/js/components/page-comment.js index 8284d7f20d8..dc6ca826425 100644 --- a/resources/js/components/page-comment.js +++ b/resources/js/components/page-comment.js @@ -1,5 +1,6 @@ import {Component} from './component'; import {getLoading, htmlToDom} from '../services/dom'; +import {buildForInput} from "../wysiwyg/config"; export class PageComment extends Component { @@ -11,7 +12,12 @@ export class PageComment extends Component { this.deletedText = this.$opts.deletedText; this.updatedText = this.$opts.updatedText; - // Element References + // Editor reference and text options + this.wysiwygEditor = null; + this.wysiwygLanguage = this.$opts.wysiwygLanguage; + this.wysiwygTextDirection = this.$opts.wysiwygTextDirection; + + // Element references this.container = this.$el; this.contentContainer = this.$refs.contentContainer; this.form = this.$refs.form; @@ -50,8 +56,23 @@ export class PageComment extends Component { startEdit() { this.toggleEditMode(true); - const lineCount = this.$refs.input.value.split('\n').length; - this.$refs.input.style.height = `${(lineCount * 20) + 40}px`; + + if (this.wysiwygEditor) { + return; + } + + const config = buildForInput({ + language: this.wysiwygLanguage, + containerElement: this.input, + darkMode: document.documentElement.classList.contains('dark-mode'), + textDirection: this.wysiwygTextDirection, + translations: {}, + translationMap: window.editor_translations, + }); + + window.tinymce.init(config).then(editors => { + this.wysiwygEditor = editors[0]; + }); } async update(event) { diff --git a/resources/js/components/page-comments.js b/resources/js/components/page-comments.js index e2911afc6a0..ebcc95f07f4 100644 --- a/resources/js/components/page-comments.js +++ b/resources/js/components/page-comments.js @@ -1,5 +1,6 @@ import {Component} from './component'; import {getLoading, htmlToDom} from '../services/dom'; +import {buildForInput} from "../wysiwyg/config"; export class PageComments extends Component { @@ -21,6 +22,11 @@ export class PageComments extends Component { this.hideFormButton = this.$refs.hideFormButton; this.removeReplyToButton = this.$refs.removeReplyToButton; + // WYSIWYG options + this.wysiwygLanguage = this.$opts.wysiwygLanguage; + this.wysiwygTextDirection = this.$opts.wysiwygTextDirection; + this.wysiwygEditor = null; + // Translations this.createdText = this.$opts.createdText; this.countText = this.$opts.countText; @@ -96,9 +102,7 @@ export class PageComments extends Component { this.formContainer.toggleAttribute('hidden', false); this.addButtonContainer.toggleAttribute('hidden', true); this.formContainer.scrollIntoView({behavior: 'smooth', block: 'nearest'}); - setTimeout(() => { - this.formInput.focus(); - }, 100); + this.loadEditor(); } hideForm() { @@ -112,6 +116,26 @@ export class PageComments extends Component { this.addButtonContainer.toggleAttribute('hidden', false); } + loadEditor() { + if (this.wysiwygEditor) { + return; + } + + const config = buildForInput({ + language: this.wysiwygLanguage, + containerElement: this.formInput, + darkMode: document.documentElement.classList.contains('dark-mode'), + textDirection: this.wysiwygTextDirection, + translations: {}, + translationMap: window.editor_translations, + }); + + window.tinymce.init(config).then(editors => { + this.wysiwygEditor = editors[0]; + this.wysiwygEditor.focus(); + }); + } + getCommentCount() { return this.container.querySelectorAll('[component="page-comment"]').length; } diff --git a/resources/js/components/wysiwyg-input.js b/resources/js/components/wysiwyg-input.js index 88c06a334c6..ad964aed2c4 100644 --- a/resources/js/components/wysiwyg-input.js +++ b/resources/js/components/wysiwyg-input.js @@ -10,11 +10,8 @@ export class WysiwygInput extends Component { language: this.$opts.language, containerElement: this.elem, darkMode: document.documentElement.classList.contains('dark-mode'), - textDirection: this.textDirection, - translations: { - imageUploadErrorText: this.$opts.imageUploadErrorText, - serverUploadLimitText: this.$opts.serverUploadLimitText, - }, + textDirection: this.$opts.textDirection, + translations: {}, translationMap: window.editor_translations, }); diff --git a/resources/sass/_tinymce.scss b/resources/sass/_tinymce.scss index c4336da7cb7..fb5ea7e6ffe 100644 --- a/resources/sass/_tinymce.scss +++ b/resources/sass/_tinymce.scss @@ -30,6 +30,13 @@ display: block; } +.wysiwyg-input.mce-content-body:before { + padding: 1rem; + top: 4px; + font-style: italic; + color: rgba(34,47,62,.5) +} + // Default styles for our custom root nodes .page-content.mce-content-body doc-root { display: block; diff --git a/resources/views/comments/comment.blade.php b/resources/views/comments/comment.blade.php index 1cb70916087..4340cfdf5c4 100644 --- a/resources/views/comments/comment.blade.php +++ b/resources/views/comments/comment.blade.php @@ -4,6 +4,8 @@ option:page-comment:comment-parent-id="{{ $comment->parent_id }}" option:page-comment:updated-text="{{ trans('entities.comment_updated_success') }}" option:page-comment:deleted-text="{{ trans('entities.comment_deleted_success') }}" + option:page-comment:wysiwyg-language="{{ $locale->htmlLang() }}" + option:page-comment:wysiwyg-text-direction="{{ $locale->htmlDirection() }}" id="comment{{$comment->local_id}}" class="comment-box">
    diff --git a/resources/views/comments/comments.blade.php b/resources/views/comments/comments.blade.php index 26d286290c2..2c314864bc2 100644 --- a/resources/views/comments/comments.blade.php +++ b/resources/views/comments/comments.blade.php @@ -2,6 +2,8 @@ option:page-comments:page-id="{{ $page->id }}" option:page-comments:created-text="{{ trans('entities.comment_created_success') }}" option:page-comments:count-text="{{ trans('entities.comment_count') }}" + option:page-comments:wysiwyg-language="{{ $locale->htmlLang() }}" + option:page-comments:wysiwyg-text-direction="{{ $locale->htmlDirection() }}" class="comments-list" aria-label="{{ trans('entities.comments') }}"> @@ -24,7 +26,6 @@ class="button outline">{{ trans('entities.comment_add') }} @if(userCan('comment-create-all')) @include('comments.create') - @if (!$commentTree->empty())
    @endif @endif + @if(userCan('comment-create-all') || $commentTree->canUpdateAny()) + @push('post-app-scripts') + + @include('form.editor-translations') + @endpush + @endif + \ No newline at end of file diff --git a/resources/views/layouts/base.blade.php b/resources/views/layouts/base.blade.php index cf15e5426b8..43cca6b14c5 100644 --- a/resources/views/layouts/base.blade.php +++ b/resources/views/layouts/base.blade.php @@ -68,10 +68,13 @@ class="@stack('body-class')">
    @yield('bottom') + + @if($cspNonce ?? false) @endif @yield('scripts') + @stack('post-app-scripts') @include('layouts.parts.base-body-end') From adf0baebb9ffc61cc944c0572ec6dbb12a5b41a0 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Tue, 30 Jan 2024 15:16:58 +0000 Subject: [PATCH 23/79] Comments: Added back-end HTML support, fixed editor focus Also fixed handling of editors when moved in DOM, to properly remove then re-init before & after move to avoid issues. --- app/Activity/CommentRepo.php | 26 ++++--------------- .../Controllers/CommentController.php | 17 +++++++----- resources/js/components/page-comment.js | 6 +++-- resources/js/components/page-comments.js | 17 +++++++++--- resources/views/comments/comment.blade.php | 2 +- resources/views/comments/create.blade.php | 2 +- 6 files changed, 34 insertions(+), 36 deletions(-) diff --git a/app/Activity/CommentRepo.php b/app/Activity/CommentRepo.php index ce2950e4d79..3336e17e988 100644 --- a/app/Activity/CommentRepo.php +++ b/app/Activity/CommentRepo.php @@ -5,7 +5,7 @@ use BookStack\Activity\Models\Comment; use BookStack\Entities\Models\Entity; use BookStack\Facades\Activity as ActivityService; -use League\CommonMark\CommonMarkConverter; +use BookStack\Util\HtmlDescriptionFilter; class CommentRepo { @@ -20,13 +20,12 @@ public function getById(int $id): Comment /** * Create a new comment on an entity. */ - public function create(Entity $entity, string $text, ?int $parent_id): Comment + public function create(Entity $entity, string $html, ?int $parent_id): Comment { $userId = user()->id; $comment = new Comment(); - $comment->text = $text; - $comment->html = $this->commentToHtml($text); + $comment->html = HtmlDescriptionFilter::filterFromString($html); $comment->created_by = $userId; $comment->updated_by = $userId; $comment->local_id = $this->getNextLocalId($entity); @@ -42,11 +41,10 @@ public function create(Entity $entity, string $text, ?int $parent_id): Comment /** * Update an existing comment. */ - public function update(Comment $comment, string $text): Comment + public function update(Comment $comment, string $html): Comment { $comment->updated_by = user()->id; - $comment->text = $text; - $comment->html = $this->commentToHtml($text); + $comment->html = HtmlDescriptionFilter::filterFromString($html); $comment->save(); ActivityService::add(ActivityType::COMMENT_UPDATE, $comment); @@ -64,20 +62,6 @@ public function delete(Comment $comment): void ActivityService::add(ActivityType::COMMENT_DELETE, $comment); } - /** - * Convert the given comment Markdown to HTML. - */ - public function commentToHtml(string $commentText): string - { - $converter = new CommonMarkConverter([ - 'html_input' => 'strip', - 'max_nesting_level' => 10, - 'allow_unsafe_links' => false, - ]); - - return $converter->convert($commentText); - } - /** * Get the next local ID relative to the linked entity. */ diff --git a/app/Activity/Controllers/CommentController.php b/app/Activity/Controllers/CommentController.php index 516bcac759a..340524cd069 100644 --- a/app/Activity/Controllers/CommentController.php +++ b/app/Activity/Controllers/CommentController.php @@ -22,8 +22,8 @@ public function __construct( */ public function savePageComment(Request $request, int $pageId) { - $this->validate($request, [ - 'text' => ['required', 'string'], + $input = $this->validate($request, [ + 'html' => ['required', 'string'], 'parent_id' => ['nullable', 'integer'], ]); @@ -39,7 +39,7 @@ public function savePageComment(Request $request, int $pageId) // Create a new comment. $this->checkPermission('comment-create-all'); - $comment = $this->commentRepo->create($page, $request->get('text'), $request->get('parent_id')); + $comment = $this->commentRepo->create($page, $input['html'], $input['parent_id'] ?? null); return view('comments.comment-branch', [ 'readOnly' => false, @@ -57,17 +57,20 @@ public function savePageComment(Request $request, int $pageId) */ public function update(Request $request, int $commentId) { - $this->validate($request, [ - 'text' => ['required', 'string'], + $input = $this->validate($request, [ + 'html' => ['required', 'string'], ]); $comment = $this->commentRepo->getById($commentId); $this->checkOwnablePermission('page-view', $comment->entity); $this->checkOwnablePermission('comment-update', $comment); - $comment = $this->commentRepo->update($comment, $request->get('text')); + $comment = $this->commentRepo->update($comment, $input['html']); - return view('comments.comment', ['comment' => $comment, 'readOnly' => false]); + return view('comments.comment', [ + 'comment' => $comment, + 'readOnly' => false, + ]); } /** diff --git a/resources/js/components/page-comment.js b/resources/js/components/page-comment.js index dc6ca826425..79c9d3c2c67 100644 --- a/resources/js/components/page-comment.js +++ b/resources/js/components/page-comment.js @@ -1,6 +1,6 @@ import {Component} from './component'; import {getLoading, htmlToDom} from '../services/dom'; -import {buildForInput} from "../wysiwyg/config"; +import {buildForInput} from '../wysiwyg/config'; export class PageComment extends Component { @@ -58,6 +58,7 @@ export class PageComment extends Component { this.toggleEditMode(true); if (this.wysiwygEditor) { + this.wysiwygEditor.focus(); return; } @@ -72,6 +73,7 @@ export class PageComment extends Component { window.tinymce.init(config).then(editors => { this.wysiwygEditor = editors[0]; + setTimeout(() => this.wysiwygEditor.focus(), 50); }); } @@ -81,7 +83,7 @@ export class PageComment extends Component { this.form.toggleAttribute('hidden', true); const reqData = { - text: this.input.value, + html: this.wysiwygEditor.getContent(), parent_id: this.parentId || null, }; diff --git a/resources/js/components/page-comments.js b/resources/js/components/page-comments.js index ebcc95f07f4..cfb0634a904 100644 --- a/resources/js/components/page-comments.js +++ b/resources/js/components/page-comments.js @@ -1,6 +1,6 @@ import {Component} from './component'; import {getLoading, htmlToDom} from '../services/dom'; -import {buildForInput} from "../wysiwyg/config"; +import {buildForInput} from '../wysiwyg/config'; export class PageComments extends Component { @@ -65,9 +65,8 @@ export class PageComments extends Component { this.form.after(loading); this.form.toggleAttribute('hidden', true); - const text = this.formInput.value; const reqData = { - text, + html: this.wysiwygEditor.getContent(), parent_id: this.parentId || null, }; @@ -92,6 +91,7 @@ export class PageComments extends Component { } resetForm() { + this.removeEditor(); this.formInput.value = ''; this.parentId = null; this.replyToRow.toggleAttribute('hidden', true); @@ -99,6 +99,7 @@ export class PageComments extends Component { } showForm() { + this.removeEditor(); this.formContainer.toggleAttribute('hidden', false); this.addButtonContainer.toggleAttribute('hidden', true); this.formContainer.scrollIntoView({behavior: 'smooth', block: 'nearest'}); @@ -118,6 +119,7 @@ export class PageComments extends Component { loadEditor() { if (this.wysiwygEditor) { + this.wysiwygEditor.focus(); return; } @@ -132,10 +134,17 @@ export class PageComments extends Component { window.tinymce.init(config).then(editors => { this.wysiwygEditor = editors[0]; - this.wysiwygEditor.focus(); + setTimeout(() => this.wysiwygEditor.focus(), 50); }); } + removeEditor() { + if (this.wysiwygEditor) { + this.wysiwygEditor.remove(); + this.wysiwygEditor = null; + } + } + getCommentCount() { return this.container.querySelectorAll('[component="page-comment"]').length; } diff --git a/resources/views/comments/comment.blade.php b/resources/views/comments/comment.blade.php index 4340cfdf5c4..e00307f0fbc 100644 --- a/resources/views/comments/comment.blade.php +++ b/resources/views/comments/comment.blade.php @@ -77,7 +77,7 @@ class="comment-box"> @if(!$readOnly && userCan('comment-update', $comment))