diff --git a/apps/dav/lib/Capabilities.php b/apps/dav/lib/Capabilities.php index 988c704f1fa8c..d88df0920fc41 100644 --- a/apps/dav/lib/Capabilities.php +++ b/apps/dav/lib/Capabilities.php @@ -18,7 +18,7 @@ public function __construct( } /** - * @return array{dav: array{chunking: string, public_shares_chunking: bool, search_supports_creation_time: bool, search_supports_upload_time: bool, bulkupload?: string, absence-supported?: bool, absence-replacement?: bool}} + * @return array{dav: array{chunking: string, public_shares_chunking: bool, search_supports_creation_time: bool, search_supports_upload_time: bool, search_supports_last_activity: bool, bulkupload?: string, absence-supported?: bool, absence-replacement?: bool}} */ public function getCapabilities() { $capabilities = [ @@ -27,6 +27,7 @@ public function getCapabilities() { 'public_shares_chunking' => true, 'search_supports_creation_time' => true, 'search_supports_upload_time' => true, + 'search_supports_last_activity' => true, ] ]; if ($this->config->getSystemValueBool('bulkupload.enabled', true)) { diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index eed57ee0be8eb..ec3081fff059f 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -66,6 +66,7 @@ class FilesPlugin extends ServerPlugin { public const METADATA_ETAG_PROPERTYNAME = '{http://nextcloud.org/ns}metadata_etag'; public const UPLOAD_TIME_PROPERTYNAME = '{http://nextcloud.org/ns}upload_time'; public const CREATION_TIME_PROPERTYNAME = '{http://nextcloud.org/ns}creation_time'; + public const LAST_ACTIVITY_PROPERTYNAME = '{http://nextcloud.org/ns}last_activity'; public const SHARE_NOTE = '{http://nextcloud.org/ns}note'; public const SHARE_HIDE_DOWNLOAD_PROPERTYNAME = '{http://nextcloud.org/ns}hide-download'; public const SUBFOLDER_COUNT_PROPERTYNAME = '{http://nextcloud.org/ns}contained-folder-count'; @@ -444,6 +445,10 @@ public function handleGetProperties(PropFind $propFind, \Sabre\DAV\INode $node) return $node->getFileInfo()->getCreationTime(); }); + $propFind->handle(self::LAST_ACTIVITY_PROPERTYNAME, function () use ($node) { + return $node->getFileInfo()->getLastActivity(); + }); + foreach ($node->getFileInfo()->getMetadata() as $metadataKey => $metadataValue) { $propFind->handle(self::FILE_METADATA_PREFIX . $metadataKey, $metadataValue); } diff --git a/apps/dav/lib/Files/FileSearchBackend.php b/apps/dav/lib/Files/FileSearchBackend.php index 45888f1eac101..16e6e6eb0d2cf 100644 --- a/apps/dav/lib/Files/FileSearchBackend.php +++ b/apps/dav/lib/Files/FileSearchBackend.php @@ -88,6 +88,7 @@ public function getPropertyDefinitionsForScope(string $href, ?string $path): arr new SearchPropertyDefinition('{DAV:}getlastmodified', true, true, true, SearchPropertyDefinition::DATATYPE_DATETIME), new SearchPropertyDefinition('{DAV:}creationdate', true, true, true, SearchPropertyDefinition::DATATYPE_DATETIME), new SearchPropertyDefinition('{http://nextcloud.org/ns}upload_time', true, true, true, SearchPropertyDefinition::DATATYPE_DATETIME), + new SearchPropertyDefinition('{http://nextcloud.org/ns}last_activity', true, false, true, SearchPropertyDefinition::DATATYPE_DATETIME), new SearchPropertyDefinition(FilesPlugin::SIZE_PROPERTYNAME, true, true, true, SearchPropertyDefinition::DATATYPE_NONNEGATIVE_INTEGER), new SearchPropertyDefinition(TagsPlugin::FAVORITE_PROPERTYNAME, true, true, true, SearchPropertyDefinition::DATATYPE_BOOLEAN), new SearchPropertyDefinition(FilesPlugin::INTERNAL_FILEID_PROPERTYNAME, true, true, false, SearchPropertyDefinition::DATATYPE_NONNEGATIVE_INTEGER), @@ -304,6 +305,8 @@ private function getSearchResultProperty(SearchResult $result, SearchPropertyDef return $node->getNode()->getCreationTime(); case '{http://nextcloud.org/ns}upload_time': return $node->getNode()->getUploadTime(); + case '{http://nextcloud.org/ns}last_activity': + return $node->getNode()->getLastActivity(); case FilesPlugin::SIZE_PROPERTYNAME: return $node->getSize(); case FilesPlugin::INTERNAL_FILEID_PROPERTYNAME: @@ -332,6 +335,8 @@ private function transformQuery(Query $query, ?SearchBinaryOperator $scopeOperat $direction = $order->order === Order::ASC ? ISearchOrder::DIRECTION_ASCENDING : ISearchOrder::DIRECTION_DESCENDING; if (str_starts_with($order->property->name, FilesPlugin::FILE_METADATA_PREFIX)) { return new SearchOrder($direction, substr($order->property->name, strlen(FilesPlugin::FILE_METADATA_PREFIX)), IMetadataQuery::EXTRA); + } elseif ($order->property->name === FilesPlugin::LAST_ACTIVITY_PROPERTYNAME) { + return new SearchOrder($direction, 'last_activity'); } else { return new SearchOrder($direction, $this->mapPropertyNameToColumn($order->property)); } diff --git a/apps/dav/openapi.json b/apps/dav/openapi.json index c6ad08730c512..344d37815318c 100644 --- a/apps/dav/openapi.json +++ b/apps/dav/openapi.json @@ -32,7 +32,8 @@ "chunking", "public_shares_chunking", "search_supports_creation_time", - "search_supports_upload_time" + "search_supports_upload_time", + "search_supports_last_activity" ], "properties": { "chunking": { @@ -47,6 +48,9 @@ "search_supports_upload_time": { "type": "boolean" }, + "search_supports_last_activity": { + "type": "boolean" + }, "bulkupload": { "type": "string" }, diff --git a/apps/dav/tests/unit/CapabilitiesTest.php b/apps/dav/tests/unit/CapabilitiesTest.php index 24297936a6447..cfbcb2155fd9d 100644 --- a/apps/dav/tests/unit/CapabilitiesTest.php +++ b/apps/dav/tests/unit/CapabilitiesTest.php @@ -33,6 +33,7 @@ public function testGetCapabilities(): void { 'public_shares_chunking' => true, 'search_supports_creation_time' => true, 'search_supports_upload_time' => true, + 'search_supports_last_activity' => true, ], ]; $this->assertSame($expected, $capabilities->getCapabilities()); @@ -55,6 +56,7 @@ public function testGetCapabilitiesWithBulkUpload(): void { 'public_shares_chunking' => true, 'search_supports_creation_time' => true, 'search_supports_upload_time' => true, + 'search_supports_last_activity' => true, 'bulkupload' => '1.0', ], ]; @@ -78,6 +80,7 @@ public function testGetCapabilitiesWithAbsence(): void { 'public_shares_chunking' => true, 'search_supports_creation_time' => true, 'search_supports_upload_time' => true, + 'search_supports_last_activity' => true, 'absence-supported' => true, 'absence-replacement' => true, ], diff --git a/apps/files/lib/ConfigLexicon.php b/apps/files/lib/ConfigLexicon.php index a715b30b8958a..30ecb21ca7b72 100644 --- a/apps/files/lib/ConfigLexicon.php +++ b/apps/files/lib/ConfigLexicon.php @@ -22,6 +22,7 @@ */ class ConfigLexicon implements ILexicon { public const OVERWRITES_HOME_FOLDERS = 'overwrites_home_folders'; + public const RECENT_LIMIT = 'recent_limit'; public function getStrictness(): Strictness { return Strictness::IGNORE; @@ -37,6 +38,13 @@ public function getAppConfigs(): array { lazy: false, note: 'It will be populated with app IDs of mount providers that overwrite home folders. Currently, only files_external and groupfolders.', ), + new Entry( + self::RECENT_LIMIT, + ValueType::INT, + defaultRaw: 100, + definition: 'Maximum number of files to display on recent files view', + lazy: false, + ), ]; } diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php index ecf21cef313ac..f642ebb0c2fc9 100644 --- a/apps/files/lib/Controller/ViewController.php +++ b/apps/files/lib/Controller/ViewController.php @@ -10,6 +10,7 @@ use OC\Files\FilenameValidator; use OC\Files\Filesystem; use OCA\Files\AppInfo\Application; +use OCA\Files\ConfigLexicon; use OCA\Files\Event\LoadAdditionalScriptsEvent; use OCA\Files\Event\LoadSearchPlugins; use OCA\Files\Event\LoadSidebar; @@ -25,6 +26,7 @@ use OCP\AppFramework\Http\RedirectResponse; use OCP\AppFramework\Http\Response; use OCP\AppFramework\Http\TemplateResponse; +use OCP\AppFramework\Services\IAppConfig; use OCP\AppFramework\Services\IInitialState; use OCP\Authentication\TwoFactorAuth\IRegistry; use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent as ResourcesLoadAdditionalScriptsEvent; @@ -62,6 +64,7 @@ public function __construct( private ViewConfig $viewConfig, private FilenameValidator $filenameValidator, private IRegistry $twoFactorRegistry, + private IAppConfig $appConfig, ) { parent::__construct($appName, $request); } @@ -174,6 +177,7 @@ public function index($dir = '', $view = '', $fileid = null) { $this->initialState->provideInitialState('storageStats', $storageInfo); $this->initialState->provideInitialState('config', $this->userConfig->getConfigs()); $this->initialState->provideInitialState('viewConfigs', $this->viewConfig->getConfigs()); + $this->initialState->provideInitialState('recent_limit', $this->appConfig->getAppValueInt(ConfigLexicon::RECENT_LIMIT, 100)); // File sorting user config $filesSortingConfig = json_decode($this->config->getUserValue($userId, 'files', 'files_sorting_configs', '{}'), true); diff --git a/apps/files/src/services/Recent.ts b/apps/files/src/services/Recent.ts index d0ca285b05c50..0e88744033c14 100644 --- a/apps/files/src/services/Recent.ts +++ b/apps/files/src/services/Recent.ts @@ -7,6 +7,7 @@ import type { FileStat, ResponseDataDetailed, SearchResult } from 'webdav' import { getCurrentUser } from '@nextcloud/auth' import { Folder, Permission, davGetRecentSearch, davRootPath, davRemoteURL, davResultToNode } from '@nextcloud/files' +import { loadState } from '@nextcloud/initial-state' import { CancelablePromise } from 'cancelable-promise' import { useUserConfigStore } from '../store/userconfig.ts' import { getPinia } from '../store/index.ts' @@ -14,6 +15,7 @@ import { client } from './WebdavClient.ts' import { getBaseUrl } from '@nextcloud/router' const lastTwoWeeksTimestamp = Math.round((Date.now() / 1000) - (60 * 60 * 24 * 14)) +const recentLimit = loadState('files', 'recent_limit', 100) /** * Helper to map a WebDAV result to a Nextcloud node @@ -48,7 +50,7 @@ export const getContents = (path = '/'): CancelablePromise => const contentsResponse = await client.search('/', { signal: controller.signal, details: true, - data: davGetRecentSearch(lastTwoWeeksTimestamp), + data: davGetRecentSearch(lastTwoWeeksTimestamp, recentLimit), }) as ResponseDataDetailed const contents = contentsResponse.data.results diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php index e1a62a9336c31..ee52a31f57d1e 100644 --- a/apps/files/tests/Controller/ViewControllerTest.php +++ b/apps/files/tests/Controller/ViewControllerTest.php @@ -18,6 +18,7 @@ use OCP\AppFramework\Http\ContentSecurityPolicy; use OCP\AppFramework\Http\RedirectResponse; use OCP\AppFramework\Http\TemplateResponse; +use OCP\AppFramework\Services\IAppConfig; use OCP\AppFramework\Services\IInitialState; use OCP\Authentication\TwoFactorAuth\IRegistry; use OCP\Diagnostics\IEventLogger; @@ -48,6 +49,7 @@ class ViewControllerTest extends TestCase { private ContainerInterface&MockObject $container; private IAppManager&MockObject $appManager; + private IAppConfig&MockObject $appConfig; private ICacheFactory&MockObject $cacheFactory; private IConfig&MockObject $config; private IEventDispatcher $eventDispatcher; @@ -71,6 +73,7 @@ class ViewControllerTest extends TestCase { protected function setUp(): void { parent::setUp(); $this->appManager = $this->createMock(IAppManager::class); + $this->appConfig = $this->createMock(IAppConfig::class); $this->config = $this->createMock(IConfig::class); $this->eventDispatcher = $this->createMock(IEventDispatcher::class); $this->initialState = $this->createMock(IInitialState::class); @@ -142,6 +145,7 @@ protected function setUp(): void { $this->viewConfig, $filenameValidator, $this->twoFactorRegistry, + $this->appConfig, ]) ->onlyMethods([ 'getStorageInfo', @@ -298,11 +302,11 @@ public function testTwoFactorAuthEnabled(): void { 'backup_codes' => true, ]); - $invokedCountProvideInitialState = $this->exactly(9); + $invokedCountProvideInitialState = $this->exactly(10); $this->initialState->expects($invokedCountProvideInitialState) ->method('provideInitialState') ->willReturnCallback(function ($key, $data) use ($invokedCountProvideInitialState): void { - if ($invokedCountProvideInitialState->numberOfInvocations() === 9) { + if ($invokedCountProvideInitialState->numberOfInvocations() === 10) { $this->assertEquals('isTwoFactorEnabled', $key); $this->assertTrue($data); } diff --git a/apps/files_trashbin/lib/Trash/TrashItem.php b/apps/files_trashbin/lib/Trash/TrashItem.php index 70d5164747f0b..120d08bcd7c58 100644 --- a/apps/files_trashbin/lib/Trash/TrashItem.php +++ b/apps/files_trashbin/lib/Trash/TrashItem.php @@ -154,6 +154,10 @@ public function getUploadTime(): int { return $this->fileInfo->getUploadTime(); } + public function getLastActivity(): int { + return $this->fileInfo->getLastActivity(); + } + public function getParentId(): int { return $this->fileInfo->getParentId(); } diff --git a/dist/files-init.js b/dist/files-init.js index 5074df070cf83..a74671a161f8b 100644 --- a/dist/files-init.js +++ b/dist/files-init.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e,s,t,n={9165(e,s,t){t.d(s,{Brj:()=>u,DvY:()=>d,EYN:()=>g,IyB:()=>i,K5o:()=>a,NZC:()=>r,VR:()=>p,WBH:()=>f,ZL5:()=>h,bFE:()=>m,bTm:()=>w,dgQ:()=>n,fEr:()=>c,hyP:()=>l,u4v:()=>o});var n="M12,5A3.5,3.5 0 0,0 8.5,8.5A3.5,3.5 0 0,0 12,12A3.5,3.5 0 0,0 15.5,8.5A3.5,3.5 0 0,0 12,5M12,7A1.5,1.5 0 0,1 13.5,8.5A1.5,1.5 0 0,1 12,10A1.5,1.5 0 0,1 10.5,8.5A1.5,1.5 0 0,1 12,7M5.5,8A2.5,2.5 0 0,0 3,10.5C3,11.44 3.53,12.25 4.29,12.68C4.65,12.88 5.06,13 5.5,13C5.94,13 6.35,12.88 6.71,12.68C7.08,12.47 7.39,12.17 7.62,11.81C6.89,10.86 6.5,9.7 6.5,8.5C6.5,8.41 6.5,8.31 6.5,8.22C6.2,8.08 5.86,8 5.5,8M18.5,8C18.14,8 17.8,8.08 17.5,8.22C17.5,8.31 17.5,8.41 17.5,8.5C17.5,9.7 17.11,10.86 16.38,11.81C16.5,12 16.63,12.15 16.78,12.3C16.94,12.45 17.1,12.58 17.29,12.68C17.65,12.88 18.06,13 18.5,13C18.94,13 19.35,12.88 19.71,12.68C20.47,12.25 21,11.44 21,10.5A2.5,2.5 0 0,0 18.5,8M12,14C9.66,14 5,15.17 5,17.5V19H19V17.5C19,15.17 14.34,14 12,14M4.71,14.55C2.78,14.78 0,15.76 0,17.5V19H3V17.07C3,16.06 3.69,15.22 4.71,14.55M19.29,14.55C20.31,15.22 21,16.06 21,17.07V19H24V17.5C24,15.76 21.22,14.78 19.29,14.55M12,16C13.53,16 15.24,16.5 16.23,17H7.77C8.76,16.5 10.47,16 12,16Z",i="M15,14C12.33,14 7,15.33 7,18V20H23V18C23,15.33 17.67,14 15,14M6,10V7H4V10H1V12H4V15H6V12H9V10M15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12Z",a="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z",o="M7 11H9V13H7V11M21 5V19C21 20.11 20.11 21 19 21H5C3.89 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H6V1H8V3H16V1H18V3H19C20.11 3 21 3.9 21 5M5 7H19V5H5V7M19 19V9H5V19H19M15 13H17V11H15V13M11 13H13V11H11V13Z",r="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M16.2,16.2L11,13V7H12.5V12.2L17,14.9L16.2,16.2Z",l="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",d="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z",m="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z",c="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",g="M7 14C5.9 14 5 13.1 5 12S5.9 10 7 10 9 10.9 9 12 8.1 14 7 14M12.6 10C11.8 7.7 9.6 6 7 6C3.7 6 1 8.7 1 12S3.7 18 7 18C9.6 18 11.8 16.3 12.6 14H16V18H20V14H23V10H12.6Z",u="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z",f="M9,2A7,7 0 0,1 16,9C16,10.5 15.5,12 14.61,13.19L15.41,14H16L22,20L20,22L14,16V15.41L13.19,14.61C12,15.5 10.5,16 9,16A7,7 0 0,1 2,9A7,7 0 0,1 9,2M11.12,5.46L9,7.59L6.88,5.46L5.46,6.88L7.59,9L5.46,11.12L6.88,12.54L9,10.41L11.12,12.54L12.54,11.12L10.41,9L12.54,6.88L11.12,5.46Z",p="M15,20A1,1 0 0,0 14,19H13V17H17A2,2 0 0,0 19,15V5A2,2 0 0,0 17,3H7A2,2 0 0,0 5,5V15A2,2 0 0,0 7,17H11V19H10A1,1 0 0,0 9,20H2V22H9A1,1 0 0,0 10,23H14A1,1 0 0,0 15,22H22V20H15M7,15V5H17V15H7Z",h="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z",w="M21.41 11.58L12.41 2.58A2 2 0 0 0 11 2H4A2 2 0 0 0 2 4V11A2 2 0 0 0 2.59 12.42L11.59 21.42A2 2 0 0 0 13 22A2 2 0 0 0 14.41 21.41L21.41 14.41A2 2 0 0 0 22 13A2 2 0 0 0 21.41 11.58M13 20L4 11V4H11L20 13M6.5 5A1.5 1.5 0 1 1 5 6.5A1.5 1.5 0 0 1 6.5 5Z"},11112(e,s,t){var n=t(35810),i=t(81222),a=t(49264),o=t(5655),r=t(3153),l=t(53334),d=t(21777),m=t(71225),c=t(85471),g=t(77764);const u=new n.VP({id:"files_trashbin--original-location",title:(0,l.t)("files_trashbin","Original location"),render(e){const s=h(e),t=document.createElement("span");return t.title=s,t.textContent=s,t},sort(e,s){const t=h(e),n=h(s);return t.localeCompare(n,[(0,l.Z0)(),(0,l.lO)()],{numeric:!0,usage:"sort"})}}),f=new n.VP({id:"files_trashbin--deleted-by",title:(0,l.t)("files_trashbin","Deleted by"),render(e){const{userId:s,displayName:t,label:n}=w(e);if(n){const e=document.createElement("span");return e.textContent=n,e}return new(c.Ay.extend(g.A))({propsData:{size:32,user:s??void 0,displayName:t??s}}).$mount().$el},sort(e,s){const t=w(e),n=t.label??t.displayName??t.userId,i=w(s),a=i.label??i.displayName??i.userId;return n.localeCompare(a,[(0,l.Z0)(),(0,l.lO)()],{numeric:!0,usage:"sort"})}}),p=new n.VP({id:"files_trashbin--deleted",title:(0,l.t)("files_trashbin","Deleted"),render(e){const s=e.attributes?.["trashbin-deletion-time"]||(e?.mtime?.getTime()??0)/1e3,t=document.createElement("span");if(s){const e=Intl.DateTimeFormat([(0,l.lO)()],{dateStyle:"long",timeStyle:"short"}),n=new Date(1e3*s);return t.title=e.format(n),t.textContent=(0,l.fw)(n,{ignoreSeconds:(0,l.t)("files","few seconds ago")}),t}return t.textContent=(0,l.t)("files_trashbin","A long time ago"),t},sort(e,s){const t=e.attributes?.["trashbin-deletion-time"]||(e?.mtime?.getTime()??0)/1e3;return(s.attributes?.["trashbin-deletion-time"]||(s?.mtime?.getTime()??0)/1e3)-t}});function h(e){const s=v(e.attributes?.["trashbin-original-location"]);if(!s)return(0,l.t)("files_trashbin","Unknown");const t=(0,m.pD)(s);return t===s?(0,l.t)("files_trashbin","All files"):t.replace(/^\//,"")}function w(e){const s=v(e.attributes?.["trashbin-deleted-by-id"]),t=v(e.attributes?.["trashbin-deleted-by-display-name"]);let n;const i=(0,d.HW)()?.uid;return s===i&&(n=(0,l.t)("files_trashbin","You")),s||t||(n=(0,l.t)("files_trashbin","Unknown")),{userId:s,displayName:t,label:n}}function v(e){return e?String(e):null}const b=`/trashbin/${(0,d.HW)()?.uid}/trash`,k=(0,n.H4)();var y=t(63814);const T=`\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t${(0,n.VX)()}\n\t\n`,x=e=>{const s=(0,n.Al)(e,b);return s.attributes.previewUrl=(0,y.Jv)("/apps/files_trashbin/preview?fileId={fileid}&x=32&y=32",{fileid:s.fileid}),s},C="trashbin";new n.Ss({id:C,name:(0,l.t)("files_trashbin","Deleted files"),caption:(0,l.t)("files_trashbin","List of files that have been deleted."),emptyTitle:(0,l.t)("files_trashbin","No deleted files"),emptyCaption:(0,l.t)("files_trashbin","Files and folders you have deleted will show up here"),icon:r,order:50,sticky:!0,defaultSortKey:"deleted",columns:[u,f,p],getContents:async(e="/")=>{const s=(await k.getDirectoryContents(`${b}${e}`,{details:!0,data:T,includeSelf:!0})).data.map(x),[t]=s.splice(s.findIndex(s=>s.path===e),1);return{folder:t,contents:s}}});var S=t(61338),L=t(87485),U=t(19051),_=t(65899);const N=(0,i.C)("files","config",{crop_image_previews:!0,default_view:"files",folder_tree:!0,grid_view:!1,show_files_extensions:!0,show_hidden:!1,show_mime_column:!0,sort_favorites_first:!0,sort_folders_first:!0,show_dialog_deletion:!1,show_dialog_file_extension:!0}),A=(0,_.nY)("userconfig",()=>{const e=(0,c.KR)({...N});return(0,S.B1)("files:config:updated",({key:s,value:t})=>function(s,t){(0,c.hZ)(e.value,s,t)}(s,t)),{userConfig:e,update:async function(e,s){null!==(0,d.HW)()&&await U.Ay.put((0,y.Jv)("/apps/files/api/v1/config/{key}",{key:e}),{value:s}),(0,S.Ic)("files:config:updated",{key:e,value:s})}}});var F=t(4114);const E=()=>!0===(0,L.F)()?.files?.undelete,P=e=>e.every(e=>!0===e.attributes["is-mount-root"]&&"shared"===e.attributes["mount-type"]),I=e=>e.every(e=>!0===e.attributes["is-mount-root"]&&"external"===e.attributes["mount-type"]),R=(e,s)=>P(e)?1===e.length?(0,l.t)("files","Leave this share"):(0,l.t)("files","Leave these shares"):I(e)?1===e.length?(0,l.t)("files","Disconnect storage"):(0,l.t)("files","Disconnect storages"):"trashbin"!==s.id&&E()?(e=>{if(1===e.length)return!1;const s=e.some(e=>P([e])),t=e.some(e=>!P([e]));return s&&t})(e)?(0,l.t)("files","Delete and unshare"):(e=>!e.some(e=>e.type!==n.pt.File))(e)?1===e.length?(0,l.t)("files","Delete file"):(0,l.t)("files","Delete files"):(e=>!e.some(e=>e.type!==n.pt.Folder))(e)?1===e.length?(0,l.t)("files","Delete folder"):(0,l.t)("files","Delete folders"):(0,l.t)("files","Delete"):(0,l.t)("files","Delete permanently"),O=()=>!1!==A((0,F.u)()).userConfig.show_dialog_deletion,z=async(e,s)=>{const t="trashbin"!==s.id&&E()?(0,l.n)("files","You are about to delete {count} item","You are about to delete {count} items",e.length,{count:e.length}):(0,l.n)("files","You are about to permanently delete {count} item","You are about to permanently delete {count} items",e.length,{count:e.length});return new Promise(n=>{window.OC.dialogs.confirmDestructive(t,(0,l.t)("files","Confirm deletion"),{type:window.OC.dialogs.YES_NO_BUTTONS,confirm:R(e,s),confirmClasses:"error",cancel:(0,l.t)("files","Cancel")},e=>{n(e)})})},j=async e=>{await U.Ay.delete(e.encodedSource),(0,S.Ic)("files:node:deleted",e)};var B=t(9558);const D=new a.A({concurrency:5}),M=new n.hY({id:"delete",displayName:R,iconSvgInline:e=>P(e)?o:I(e)?'':r,enabled:(e,s)=>(s.id!==C||!1!==(0,i.C)("files_trashbin","config",{allow_delete:!0}).allow_delete)&&(e.length>0&&e.map(e=>e.permissions).every(e=>0!==(e&n.aX.DELETE))),async exec(e,s){try{let t=!0;const n=((new Error).stack||"").toLocaleLowerCase().includes("keydown");return(O()||n)&&(t=await z([e],s)),!1===t?null:(await j(e),!0)}catch(s){return B.A.error("Error while deleting a file",{error:s,source:e.source,node:e}),!1}},async execBatch(e,s){let t=!0;if((O()||e.length>=5&&!P(e)&&!I(e))&&(t=await z(e,s)),!1===t)return Promise.all(e.map(()=>null));const n=e.map(e=>new Promise(s=>{D.add(async()=>{try{await j(e),s(!0)}catch(t){B.A.error("Error while deleting a file",{error:t,source:e.source,node:e}),s(!1)}})}));return Promise.all(n)},destructive:!0,order:100,hotkey:{description:(0,l.t)("files","Delete"),key:"Delete"}});var V=t(85168);function H(e){if(0===(e.permissions&n.aX.READ))return!1;if(!0===e.attributes["hide-download"]||"true"===e.attributes["hide-download"])return!1;if(e.attributes["share-attributes"]){const s=JSON.parse(e.attributes["share-attributes"]||"[]").find(({scope:e,key:s})=>"permissions"===e&&"download"===s);if(void 0!==s)return!0===s.value}return!0}var W=t(45238),Y=t(89761);async function $(e,s){await U.Ay.head(e);const t=document.createElement("a");t.download=s??"",t.href=e,t.click()}function q(e,s){const t=e.split("/").filter(Boolean),n=s.split("/").filter(Boolean);let i="";for(const[e,a]of t.entries()){if(e>=s.length)break;if(a!==n[e])break;i=`${i}${""===i?"":"/"}${a}`}return i}async function G(e){let s;if(1===e.length){if(e[0].type===n.pt.File)return void await $(e[0].encodedSource,e[0].displayname);s=new URL(e[0].encodedSource),s.searchParams.append("accept","zip")}else{s=new URL(e[0].encodedSource);let t=s.pathname;for(const s of e.slice(1))t=q(t,new URL(s.encodedSource).pathname);s.pathname=t;const n=e.map(e=>decodeURIComponent(e.encodedSource.slice(s.href.length+1)));s.searchParams.append("accept","zip"),s.searchParams.append("files",JSON.stringify(n))}"/"!==s.pathname.at(-1)&&(s.pathname=`${s.pathname}/`),await $(s.href)}const K=new n.hY({id:"download",default:n.m9.DEFAULT,displayName:()=>(0,l.t)("files","Download"),iconSvgInline:()=>'',enabled:(e,s)=>0!==e.length&&!e.some(e=>!e.isDavResource)&&!(e.length>1&&"trashbin"===s.id)&&e.every(H),async exec(e){try{await G([e])}catch(s){(0,V.Qg)((0,l.t)("files","The requested file is not available.")),(0,S.Ic)("files:node:deleted",e)}return null},async execBatch(e,s,t){try{await G(e)}catch(e){(0,V.Qg)((0,l.t)("files","The requested files are not available."));const n=function(e,s){const t=(0,Y._)((0,F.u)()),n=(0,W.B)((0,F.u)());if(!e?.id)return null;if("/"===s)return t.getRoot(e.id)||null;const i=n.getPath(e.id,s);return t.getNode(i)||null}(s,t);(0,S.Ic)("files:node:updated",n)}return new Array(e.length).fill(null)},order:30});var X=t(32505);const J=new n.hY({id:"edit-locally",displayName:()=>(0,l.Tl)("files","Open locally"),iconSvgInline:()=>'',enabled(e){return 1===e.length&&!(0,X.f)()&&!!(s=e[0]).isDavResource&&0!==(s.permissions&n.aX.UPDATE)&&H(s);var s},exec:async e=>(await async function(e){await Z(e);const s=await async function(){let e=!1;const s=(new V.ik).setName((0,l.Tl)("files","Open file locally")).setText((0,l.Tl)("files","The file should now open on your device. If it doesn't, please check that you have the desktop app installed.")).setButtons([{label:(0,l.Tl)("files","Retry and close"),type:"secondary",callback:()=>{e="local"}},{label:(0,l.Tl)("files","Open online"),icon:'',type:"primary",callback:()=>{e="online"}}]).build();return await s.show(),e}();"local"===s?await Z(e):"online"===s&&window.OCA.Viewer.open({path:e})}(e.path),null),order:25});async function Z(e){const s=(0,y.KT)("apps/files/api/v1")+"/openlocaleditor?format=json";try{const t=await U.Ay.post(s,{path:e}),n=(0,d.HW)()?.uid;let i=`nc://open/${n}@`+window.location.host+(0,m.O0)(e);i+="?token="+t.data.ocs.data.token,window.open(i,"_self")}catch(e){(0,V.Qg)((0,l.Tl)("files","Failed to redirect to client"))}}var Q=t(63006),ee=t(11459);const se=new a.A({concurrency:5}),te=e=>e.some(e=>1!==e.attributes.favorite),ne=async(e,s,t)=>{try{const n=(0,y.Jv)("/apps/files/api/v1/files")+(0,m.O0)(e.path);return await U.Ay.post(n,{tags:t?[window.OC.TAG_FAVORITE]:[]}),"favorites"!==s.id||t||"/"!==e.dirname||(0,S.Ic)("files:node:deleted",e),c.Ay.set(e.attributes,"favorite",t?1:0),t?(0,S.Ic)("files:favorites:added",e):(0,S.Ic)("files:favorites:removed",e),!0}catch(s){const n=t?"adding a file to favourites":"removing a file from favourites";return B.A.error("Error while "+n,{error:s,source:e.source,node:e}),!1}},ie=new n.hY({id:"favorite",displayName:e=>te(e)?(0,l.Tl)("files","Add to favorites"):(0,l.Tl)("files","Remove from favorites"),iconSvgInline:e=>te(e)?Q:ee,enabled:e=>!(0,X.f)()&&e.every(e=>e.root?.startsWith?.("/files"))&&e.every(e=>e.permissions!==n.aX.NONE),async exec(e,s){const t=te([e]);return await ne(e,s,t)},async execBatch(e,s){const t=te(e),n=e.map(e=>new Promise(n=>{se.add(async()=>{try{await ne(e,s,t),n(!0)}catch(s){B.A.error("Error while adding file to favorite",{error:s,source:e.source,node:e}),n(!1)}})}));return Promise.all(n)},order:-50,hotkey:{description:(0,l.Tl)("files","Add or remove favorite"),key:"S"}});var ae=t(77815),oe=t(66860),re=t(43627),le=t(21363);const de='',me=(0,i.C)("files_sharing","sharePermissions",n.aX.NONE);let ce;var ge;!function(e){e.MOVE="Move",e.COPY="Copy",e.MOVE_OR_COPY="move-or-copy"}(ge||(ge={}));const ue=e=>{const s=e.reduce((e,s)=>Math.min(e,s.permissions),n.aX.ALL);return Boolean(s&n.aX.DELETE)},fe=e=>!!(e=>e.every(e=>!JSON.parse(e.attributes?.["share-attributes"]??"[]").some(e=>"permissions"===e.scope&&!1===e.value&&"download"===e.key)))(e)&&!e.some(e=>e.permissions===n.aX.NONE)&&(!(0,X.f)()||Boolean(me&n.aX.CREATE));var pe=t(16954);class he extends Error{}const we=new n.hY({id:"move-copy",order:15,displayName(e){switch(ve(e)){case ge.MOVE:return(0,l.t)("files","Move");case ge.COPY:return(0,l.t)("files","Copy");case ge.MOVE_OR_COPY:return(0,l.t)("files","Move or copy")}},iconSvgInline:()=>de,enabled:(e,s)=>"public-file-share"!==s.id&&!!e.every(e=>e.root?.startsWith("/files/"))&&e.length>0&&(ue(e)||fe(e)),async exec(e,s,t){return(await this.execBatch([e],s,t))[0]},async execBatch(e,s,t){const i=ve(e),o=await async function(e,s="/",t){const{resolve:i,reject:a,promise:o}=Promise.withResolvers(),r=t.map(e=>e.fileid).filter(Boolean),d=(0,V.a1)((0,l.t)("files","Choose destination")).allowDirectories(!0).setFilter(e=>!r.includes(e.fileid)).setCanPick(e=>(e.permissions&n.aX.CREATE)===n.aX.CREATE).setMimeTypeFilter([]).setMultiSelect(!1).startAt(s).setButtonFactory((s,a)=>{const o=[],r=(0,re.basename)(a),d=t.map(e=>e.dirname),m=t.map(e=>e.path);return e!==ge.COPY&&e!==ge.MOVE_OR_COPY||o.push({label:r?(0,l.t)("files","Copy to {target}",{target:r},void 0,{escape:!1,sanitize:!1}):(0,l.t)("files","Copy"),type:"primary",icon:le,async callback(e){i({destination:e[0],action:ge.COPY})}}),d.includes(a)||m.includes(a)||s.some(e=>0===(e.permissions&n.aX.CREATE))||e!==ge.MOVE&&e!==ge.MOVE_OR_COPY||o.push({label:r?(0,l.t)("files","Move to {target}",{target:r},void 0,{escape:!1,sanitize:!1}):(0,l.t)("files","Move"),type:e===ge.MOVE?"primary":"secondary",icon:de,async callback(e){i({destination:e[0],action:ge.MOVE})}}),o}).build();return d.pick().catch(e=>{B.A.debug(e),e instanceof V.vT?i(!1):a(new Error((0,l.t)("files","Move or copy operation failed")))}),o}(i,t,e);if(!1===o)return e.map(()=>null);try{const s=await Array.fromAsync(async function*(e,s,t,i=!1){if(!s)return;if(s.type!==n.pt.Folder)throw new Error((0,l.t)("files","Destination is not a folder"));if(t===ge.MOVE&&e.some(e=>e.dirname===s.path))throw new Error((0,l.t)("files","This file/folder is already in that directory"));if(e.some(e=>`${s.path}/`.startsWith(`${e.path}/`)))throw new Error((0,l.t)("files","You cannot move a file/folder onto itself or into a subfolder of itself"));const o=new Map;if(!i){const i=(await(0,pe.hE)(s.path)).contents,a=(0,oe.e)(e,i),r=[];if(a.length>0){if(t===ge.MOVE){const t=i.filter(e=>a.some(s=>s.basename===e.basename)),n=await(0,V.VA)(s.path,a,t);if(!n)return;e=e.filter(e=>!n.skipped.includes(e)),r.push(...n.renamed)}else r.push(...a);const l=[...i,...e.filter(e=>!a.includes(e))].map(e=>e.basename);for(const e of r){const s=(0,n.E6)(e.basename,l,{ignoreFileExtension:e.type===n.pt.Folder});o.set(e.source,s),l.push(s)}}}const r=function(e,s,t){const n=e===ge.MOVE?1===s.length?(0,l.t)("files",'Moving "{source}" to "{destination}" …',{source:s[0],destination:t}):(0,l.t)("files",'Moving {count} files to "{destination}" …',{count:s.length,destination:t}):1===s.length?(0,l.t)("files",'Copying "{source}" to "{destination}" …',{source:s[0],destination:t}):(0,l.t)("files",'Copying {count} files to "{destination}" …',{count:s.length,destination:t}),i=(0,V.Cs)(n);return()=>i&&i.hideToast()}(t,e.map(e=>e.basename),s.path),d=(ce||(ce=new a.A({concurrency:5})),ce);try{for(const i of e)c.Ay.set(i,"status",n.zI.LOADING),yield d.add(async()=>{try{const e=(0,ae.KU)(),n=(0,re.join)(ae.VA,i.path),a=(0,re.join)(ae.VA,s.path,o.get(i.source)??i.basename);if(t===ge.COPY){if(await e.copyFile(n,a),i.dirname===s.path){const{data:s}=await e.stat(a,{details:!0,data:(0,ae.aN)()});(0,S.Ic)("files:node:created",(0,ae.pO)(s))}}else await e.moveFile(n,a),(0,S.Ic)("files:node:deleted",i)}catch(e){if(B.A.debug(`Error while trying to ${t===ge.COPY?"copy":"move"} node`,{node:i,error:e}),(0,U.F0)(e)){if(412===e.response?.status)throw new he((0,l.t)("files","A file or folder with that name already exists in this folder"));if(423===e.response?.status)throw new he((0,l.t)("files","The files are locked"));if(404===e.response?.status)throw new he((0,l.t)("files","The file does not exist anymore"));if("response"in e&&e.response){const s=new DOMParser,t=await e.response.text(),n=s.parseFromString(t??"","text/xml").querySelector("message")?.textContent;if(n)throw new he(n)}}throw e}finally{c.Ay.set(i,"status",void 0)}})}finally{r()}}(e,o.destination,o.action));return s.map(()=>!0)}catch(s){return B.A.error(`Failed to ${o.action} node`,{nodes:e,error:s}),s instanceof he&&s.message?((0,V.Qg)(s.message),e.map(()=>null)):e.map(()=>!1)}}}),ve=e=>ue(e)?fe(e)?ge.MOVE_OR_COPY:ge.MOVE:ge.COPY,be='',ke=new n.hY({id:"open-folder",displayName(e){const s=e[0].displayname;return(0,l.Tl)("files","Open folder {displayName}",{displayName:s})},iconSvgInline:()=>be,enabled(e){if(1!==e.length)return!1;const s=e[0];return!!s.isDavRessource&&s.type===n.pt.Folder&&0!==(s.permissions&n.aX.READ)},exec:async(e,s)=>!(!e||e.type!==n.pt.Folder)&&(window.OCP.Files.Router.goToRoute(null,{view:s.id,fileid:String(e.fileid)},{dir:e.path}),null),default:n.m9.HIDDEN,order:-100});var ye=t(53775);const Te=new n.hY({id:"open-in-files",displayName:()=>(0,l.t)("files","Open in Files"),iconSvgInline:()=>"",enabled:(e,s)=>"recent"===s.id||s.id===ye.w,async exec(e){let s=e.dirname;return e.type===n.pt.Folder&&(s=s+"/"+e.basename),window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:String(e.fileid)},{dir:s,openfile:"true"}),null},order:-1e3,default:n.m9.HIDDEN});var xe=t(38225);const Ce=new n.hY({id:"rename",displayName:()=>(0,l.Tl)("files","Rename"),iconSvgInline:()=>xe,enabled:(e,s)=>{if(0===e.length)return!1;if("public-file-share"===s.id)return!1;const t=e[0],i=(0,Y._)((0,F.u)()),a="/"===t.dirname?i.getRoot(s.id):i.getNode((0,re.dirname)(t.source)),o=a?.permissions||n.aX.NONE;return Boolean(t.permissions&n.aX.DELETE)&&Boolean(o&n.aX.CREATE)},exec:async e=>((0,S.Ic)("files:node:rename",e),null),order:10,hotkey:{description:(0,l.Tl)("files","Rename"),key:"F2"}});var Se=t(61780);const Le=new n.hY({id:"details",displayName:()=>(0,l.Tl)("files","Details"),iconSvgInline:()=>Se,enabled:e=>!(0,X.f)()&&1===e.length&&!!e[0]&&!!window?.OCA?.Files?.Sidebar&&((e[0].root?.startsWith("/files/")&&e[0].permissions!==n.aX.NONE)??!1),async exec(e,s,t){try{return window.OCA.Files?.Sidebar?.file===e.path?(B.A.debug("Sidebar already open for this file",{node:e}),null):(window.OCA.Files?.Sidebar?.setActiveTab("sharing"),await(window.OCA.Files?.Sidebar?.open(e.path)),window.OCP?.Files?.Router?.goToRoute(null,{view:s.id,fileid:String(e.fileid)},{...window.OCP.Files.Router.query,dir:t,opendetails:"true",openfile:"false"},!0),null)}catch(e){return B.A.error("Error while opening sidebar",{error:e}),!1}},order:-50}),Ue=new n.hY({id:"view-in-folder",displayName:()=>(0,l.t)("files","View in folder"),iconSvgInline:()=>de,enabled(e,s){if((0,X.f)())return!1;if("files"===s.id)return!1;if(1!==e.length)return!1;const t=e[0];return!!t.isDavRessource&&!!t.root?.startsWith("/files")&&t.permissions!==n.aX.NONE&&t.type===n.pt.File},exec:async e=>!(!e||e.type!==n.pt.File)&&(window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:String(e.fileid)},{dir:e.dirname}),null),order:80});class _e extends n.L3{constructor(){var e,s,t;super("files:hidden",0),e=this,t=void 0,(s=function(e){var s=function(e){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var t=s.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof s?s:s+""}(s="showHidden"))in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,this.showHidden=(0,i.C)("files","config",{show_hidden:!1}).show_hidden,(0,S.B1)("files:config:updated",({key:e,value:s})=>{"show_hidden"===e&&(this.showHidden=Boolean(s),this.filterUpdated())})}filter(e){return this.showHidden?e:e.filter(e=>!0!==e.attributes.hidden&&!e.basename.startsWith("."))}}var Ne=t(9165),Ae=t(57505),Fe=t(6695),Ee=t(24764),Pe=t(15502);const Ie=(0,c.pM)({__name:"FileListFilter",props:{isActive:{type:Boolean},filterName:null},emits:["reset-filter"],setup:e=>({__sfc:!0,t:l.t,NcActions:Ee.A,NcActionButton:Ae.A,NcActionSeparator:Pe.A})});var Re=t(85072),Oe=t.n(Re),ze=t(97825),je=t.n(ze),Be=t(77659),De=t.n(Be),Me=t(55056),Ve=t.n(Me),He=t(10540),We=t.n(He),Ye=t(41113),$e=t.n(Ye),qe=t(30610),Ge={};Ge.styleTagTransform=$e(),Ge.setAttributes=Ve(),Ge.insert=De().bind(null,"head"),Ge.domAPI=je(),Ge.insertStyleElement=We(),Oe()(qe.A,Ge),qe.A&&qe.A.locals&&qe.A.locals;var Ke=t(14486);const Xe=(0,Ke.A)(Ie,function(){var e=this,s=e._self._c,t=e._self._setupProxy;return s(t.NcActions,{attrs:{"force-menu":"",type:e.isActive?"secondary":"tertiary","menu-name":e.filterName},scopedSlots:e._u([{key:"icon",fn:function(){return[e._t("icon")]},proxy:!0}],null,!0)},[e._v(" "),e._t("default"),e._v(" "),e.isActive?[s(t.NcActionSeparator),e._v(" "),s(t.NcActionButton,{staticClass:"files-list-filter__clear-button",attrs:{"close-after-click":""},on:{click:function(s){return e.$emit("reset-filter")}}},[e._v("\n\t\t\t"+e._s(t.t("files","Clear filter"))+"\n\t\t")])]:e._e()],2)},[],!1,null,"21c6ff6c",null).exports,Je=(0,c.pM)({name:"FileListFilterType",components:{FileListFilter:Xe,NcActionButton:Ae.A,NcIconSvgWrapper:Fe.A},props:{presets:{type:Array,default:()=>[]},typePresets:{type:Array,required:!0}},setup:()=>({mdiFileOutline:Ne.bFE,t:l.Tl}),data:()=>({selectedOptions:[]}),computed:{isActive(){return this.selectedOptions.length>0}},watch:{presets(){this.selectedOptions=this.presets??[]},selectedOptions(e,s){0===this.selectedOptions.length?0!==s.length&&this.$emit("update:presets"):this.$emit("update:presets",this.selectedOptions)}},mounted(){this.selectedOptions=this.presets??[]},methods:{resetFilter(){this.selectedOptions=[]},toggleOption(e){const s=this.selectedOptions.indexOf(e);-1!==s?this.selectedOptions.splice(s,1):this.selectedOptions.push(e)}}});var Ze=t(73470),Qe={};Qe.styleTagTransform=$e(),Qe.setAttributes=Ve(),Qe.insert=De().bind(null,"head"),Qe.domAPI=je(),Qe.insertStyleElement=We(),Oe()(Ze.A,Qe),Ze.A&&Ze.A.locals&&Ze.A.locals;const es=(0,Ke.A)(Je,function(){var e=this,s=e._self._c;return e._self._setupProxy,s("FileListFilter",{staticClass:"file-list-filter-type",attrs:{"is-active":e.isActive,"filter-name":e.t("files","Type")},on:{"reset-filter":e.resetFilter},scopedSlots:e._u([{key:"icon",fn:function(){return[s("NcIconSvgWrapper",{attrs:{path:e.mdiFileOutline}})]},proxy:!0}])},[e._v(" "),e._l(e.typePresets,function(t){return s("NcActionButton",{key:t.id,attrs:{type:"checkbox","model-value":e.selectedOptions.includes(t)},on:{click:function(s){return e.toggleOption(t)}},scopedSlots:e._u([{key:"icon",fn:function(){return[s("NcIconSvgWrapper",{attrs:{svg:t.icon}})]},proxy:!0}],null,!0)},[e._v("\n\t\t"+e._s(t.label)+"\n\t")])})],2)},[],!1,null,null,null).exports;function ss(e,s,t){return(s=function(e){var s=function(e){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var t=s.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof s?s:s+""}(s))in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}const ts=(e,s)=>e.replace("[{id:"document",label:(0,l.t)("files","Documents"),icon:ts('',"#49abea"),mime:["x-office/document"]},{id:"spreadsheet",label:(0,l.t)("files","Spreadsheets"),icon:ts('',"#9abd4e"),mime:["x-office/spreadsheet"]},{id:"presentation",label:(0,l.t)("files","Presentations"),icon:ts('',"#f0965f"),mime:["x-office/presentation"]},{id:"pdf",label:(0,l.t)("files","PDFs"),icon:ts('',"#dc5047"),mime:["application/pdf"]},{id:"folder",label:(0,l.t)("files","Folders"),icon:ts(be,window.getComputedStyle(document.body).getPropertyValue("--color-primary-element")),mime:["httpd/unix-directory"]},{id:"audio",label:(0,l.t)("files","Audio"),icon:'',mime:["audio"]},{id:"image",label:(0,l.t)("files","Images"),icon:'',mime:["image"]},{id:"video",label:(0,l.t)("files","Videos"),icon:'',mime:["video"]}])()),this.currentInstance&&(this.currentInstance.$destroy(),delete this.currentInstance);const s=c.Ay.extend(es);this.currentInstance=new s({propsData:{presets:this.currentPresets,typePresets:this.allPresets},el:e}).$on("update:presets",this.setPresets.bind(this)).$mount()}filter(e){if(!this.currentPresets||0===this.currentPresets.length)return e;const s=this.currentPresets.reduce((e,s)=>[...e,...s.mime],[]);return e.filter(e=>{if(!e.mime)return!1;const t=e.mime.toLowerCase();return!!s.includes(t)||!!s.includes(window.OC.MimeTypeList.aliases[t])||!!s.includes(t.split("/")[0])})}reset(){this.setPresets()}setPresets(e){this.currentPresets=e??[],void 0!==this.currentInstance&&(this.currentInstance.$props.presets=e),this.filterUpdated();const s=[];if(e&&e.length>0)for(const t of e)s.push({icon:t.icon,text:t.label,onclick:()=>this.removeFilterPreset(t.id)});else this.currentInstance?.resetFilter();this.updateChips(s)}removeFilterPreset(e){const s=this.currentPresets.filter(({id:s})=>s!==e);this.setPresets(s)}}const is=(0,c.pM)({components:{FileListFilter:Xe,NcActionButton:Ae.A,NcIconSvgWrapper:Fe.A},props:{timePresets:{type:Array,required:!0}},setup:()=>({mdiCalendarRangeOutline:Ne.u4v}),data:()=>({selectedOption:null,timeRangeEnd:null,timeRangeStart:null}),computed:{isActive(){return null!==this.selectedOption},currentPreset(){return this.timePresets.find(({id:e})=>e===this.selectedOption)??null}},watch:{selectedOption(){if(null===this.selectedOption)this.$emit("update:preset");else{const e=this.currentPreset;this.$emit("update:preset",e)}}},methods:{t:l.Tl,resetFilter(){this.selectedOption=null,this.timeRangeEnd=null,this.timeRangeStart=null}}});var as=t(31891),os={};os.styleTagTransform=$e(),os.setAttributes=Ve(),os.insert=De().bind(null,"head"),os.domAPI=je(),os.insertStyleElement=We(),Oe()(as.A,os),as.A&&as.A.locals&&as.A.locals;const rs=(0,Ke.A)(is,function(){var e=this,s=e._self._c;return e._self._setupProxy,s("FileListFilter",{attrs:{"is-active":e.isActive,"filter-name":e.t("files","Modified")},on:{"reset-filter":e.resetFilter},scopedSlots:e._u([{key:"icon",fn:function(){return[s("NcIconSvgWrapper",{attrs:{path:e.mdiCalendarRangeOutline}})]},proxy:!0}])},[e._v(" "),e._l(e.timePresets,function(t){return s("NcActionButton",{key:t.id,attrs:{type:"radio","close-after-click":"","model-value":e.selectedOption,value:t.id},on:{"update:modelValue":function(s){e.selectedOption=s},"update:model-value":function(s){e.selectedOption=s}}},[e._v("\n\t\t"+e._s(t.label)+"\n\t")])})],2)},[],!1,null,"35fd0c81",null).exports;function ls(e,s,t){return(s=function(e){var s=function(e){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var t=s.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof s?s:s+""}(s))in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}const ds=()=>(new Date).setHours(0,0,0,0),ms=[{id:"today",label:(0,l.t)("files","Today"),filter:e=>e>ds()},{id:"last-7",label:(0,l.t)("files","Last 7 days"),filter:e=>e>ds()-6048e5},{id:"last-30",label:(0,l.t)("files","Last 30 days"),filter:e=>e>ds()-2592e6},{id:"this-year",label:(0,l.t)("files","This year ({year})",{year:(new Date).getFullYear()}),filter:e=>e>new Date(ds()).setMonth(0,1)},{id:"last-year",label:(0,l.t)("files","Last year ({year})",{year:(new Date).getFullYear()-1}),filter:e=>e>new Date(ds()).setFullYear((new Date).getFullYear()-1,0,1)&&evoid 0===e.mtime||this.currentPreset.filter(e.mtime.getTime())):e}reset(){this.setPreset()}setPreset(e){this.currentPreset=e,this.filterUpdated();const s=[];e?s.push({icon:'',text:e.label,onclick:()=>this.setPreset()}):this.currentInstance?.resetFilter(),this.updateChips(s)}}var gs=t(98469),us=t(74095),fs=t(94219),ps=t(82182),hs=t(371);const ws=(0,c.pM)({__name:"NewNodeDialog",props:{defaultName:{type:String,default:(0,l.t)("files","New folder")},otherNames:{type:Array,default:()=>[]},open:{type:Boolean,default:!0},name:{type:String,default:(0,l.t)("files","Create new folder")},label:{type:String,default:(0,l.t)("files","Folder name")}},emits:["close"],setup(e,{emit:s}){const t=e,i=(0,c.KR)(t.defaultName),a=(0,c.KR)(),o=(0,c.KR)(),r=(0,c.KR)(""),d=(0,c.EW)(()=>i.value.trim().startsWith("."));function m(){(0,c.dY)(()=>{const e=a.value?.$el.querySelector("input");if(!t.open||!e)return;const s=i.value.length-(0,re.extname)(i.value).length;e.focus(),e.setSelectionRange(0,s)})}return(0,c.wB)(()=>[t.defaultName,t.otherNames],()=>{i.value=(0,n.E6)(t.defaultName,t.otherNames).trim()}),(0,c.nT)(()=>{t.otherNames.includes(i.value.trim())?r.value=(0,l.t)("files","This name is already in use."):r.value=function(e,s=!1){if(""===e.trim())return(0,l.t)("files","Filename must not be empty.");try{return(0,n.KT)(e),""}catch(e){if(!(e instanceof n.di))throw e;switch(e.reason){case n.nF.Character:return(0,l.t)("files",'"{char}" is not allowed inside a filename.',{char:e.segment},void 0,{escape:s});case n.nF.ReservedName:return(0,l.t)("files",'"{segment}" is a reserved name and not allowed for filenames.',{segment:e.segment},void 0,{escape:!1});case n.nF.Extension:return e.segment.match(/\.[a-z]/i)?(0,l.t)("files",'"{extension}" is not an allowed filetype.',{extension:e.segment},void 0,{escape:!1}):(0,l.t)("files",'Filenames must not end with "{extension}".',{extension:e.segment},void 0,{escape:!1});default:return(0,l.t)("files","Invalid filename.")}}}(i.value.trim());const e=a.value?.$el.querySelector("input");e&&(e.setCustomValidity(r.value),e.reportValidity())}),(0,c.wB)(()=>t.open,()=>{(0,c.dY)(()=>{m()})}),(0,c.sV)(()=>{i.value=(0,n.E6)(i.value,t.otherNames).trim(),(0,c.dY)(()=>m())}),{__sfc:!0,props:t,emit:s,localDefaultName:i,nameInput:a,formElement:o,validity:r,isHiddenFileName:d,focusInput:m,submit:function(){o.value?.requestSubmit()},t:l.t,NcButton:us.A,NcDialog:fs.A,NcTextField:ps.A,NcNoteCard:hs.A}}});var vs=t(96102),bs={};bs.styleTagTransform=$e(),bs.setAttributes=Ve(),bs.insert=De().bind(null,"head"),bs.domAPI=je(),bs.insertStyleElement=We(),Oe()(vs.A,bs),vs.A&&vs.A.locals&&vs.A.locals;const ks=(0,Ke.A)(ws,function(){var e=this,s=e._self._c,t=e._self._setupProxy;return s(t.NcDialog,{attrs:{"data-cy-files-new-node-dialog":"",name:e.name,open:e.open,"close-on-click-outside":"","out-transition":""},on:{"update:open":function(e){return t.emit("close",null)}},scopedSlots:e._u([{key:"actions",fn:function(){return[s(t.NcButton,{attrs:{"data-cy-files-new-node-dialog-submit":"",type:"primary",disabled:""!==t.validity},on:{click:t.submit}},[e._v("\n\t\t\t"+e._s(t.t("files","Create"))+"\n\t\t")])]},proxy:!0}])},[e._v(" "),s("form",{ref:"formElement",staticClass:"new-node-dialog__form",on:{submit:function(e){return e.preventDefault(),t.emit("close",t.localDefaultName)}}},[s(t.NcTextField,{ref:"nameInput",attrs:{"data-cy-files-new-node-dialog-input":"",error:""!==t.validity,"helper-text":t.validity,label:e.label,value:t.localDefaultName},on:{"update:value":function(e){t.localDefaultName=e}}}),e._v(" "),t.isHiddenFileName?s(t.NcNoteCard,{attrs:{type:"warning",text:t.t("files","Files starting with a dot are hidden by default")}}):e._e()],1)])},[],!1,null,"04462327",null).exports;function ys(e,s,t={}){const n=s.map(e=>e.basename);return new Promise(s=>{(0,gs.S)(ks,{...t,defaultName:e,otherNames:n},e=>{s(e)})})}const Ts={id:"newFolder",displayName:(0,l.Tl)("files","New folder"),enabled:e=>Boolean(e.permissions&n.aX.CREATE)&&Boolean(e.permissions&n.aX.READ),iconSvgInline:''.replace(/viewBox/gi,'style="color: var(--color-primary-element)" viewBox'),order:0,async handler(e,s){const t=await ys((0,l.Tl)("files","New folder"),s);if(null!==t)try{const{fileid:s,source:i}=await(async(e,s)=>{const t=e.source+"/"+s,n=e.encodedSource+"/"+encodeURIComponent(s),i=await(0,U.Ay)({method:"MKCOL",url:n,headers:{Overwrite:"F"}});return{fileid:parseInt(i.headers["oc-fileid"]),source:t}})(e,t.trim()),a=new n.vd({source:i,id:s,mtime:new Date,owner:e.owner,permissions:n.aX.ALL,root:e?.root||"/files/"+(0,d.HW)()?.uid,attributes:{"mount-type":e.attributes?.["mount-type"],"owner-id":e.attributes?.["owner-id"],"owner-display-name":e.attributes?.["owner-display-name"]}});(0,S.Ic)("files:node:created",a),(0,V.Te)((0,l.Tl)("files",'Created new folder "{name}"',{name:(0,re.basename)(i)})),B.A.debug("Created new folder",{folder:a,source:i}),window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:String(s)},{dir:e.path})}catch(e){B.A.error("Creating new folder failed",{error:e}),(0,V.Qg)("Creating new folder failed")}}},xs=(0,i.C)("files","templates_enabled",!0);let Cs=(0,i.C)("files","templates_path",!1);B.A.debug("Templates folder enabled",{templatesEnabled:xs}),B.A.debug("Initial templates folder",{templatesPath:Cs});const Ss={id:"template-picker",displayName:(0,l.Tl)("files","Create templates folder"),iconSvgInline:'',order:30,enabled:e=>!(!xs||Cs)&&e.owner===(0,d.HW)()?.uid&&0!==(e.permissions&n.aX.CREATE),async handler(e,s){const t=await ys((0,l.Tl)("files","Templates"),s,{name:(0,l.Tl)("files","New template folder")});null!==t&&(async function(e,s){const t=(0,re.join)(e.path,s);try{B.A.debug("Initializing the templates directory",{templatePath:t});const{data:e}=await U.Ay.post((0,y.KT)("apps/files/api/v1/templates/path"),{templatePath:t,copySystemTemplates:!0});window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:void 0},{dir:t}),B.A.info("Created new templates folder",{...e.ocs.data}),Cs=e.ocs.data.templates_path}catch(e){B.A.error("Unable to initialize the templates directory"),(0,V.Qg)((0,l.Tl)("files","Unable to initialize the templates directory"))}}(e,t),(0,n.gj)("template-picker"))}},Ls=(0,c.$V)(()=>Promise.all([t.e(4208),t.e(3973)]).then(t.bind(t,93973)));let Us=null;const _s=async e=>{if(null===Us){const s=document.createElement("div");s.id="template-picker",document.body.appendChild(s),Us=new c.Ay({render:s=>s(Ls,{ref:"picker",props:{parent:e}}),methods:{open(...e){this.$refs.picker.open(...e)}},el:s})}return Us};var Ns=t(43690),As=t(56908),Fs=t(36117);const Es=(e="/")=>"/"!==e?(0,pe.hE)(e):new Fs.CancelablePromise((e,s,t)=>{const i=(0,n.Q$)(As.S).catch(s).then(t=>{t?e({contents:t,folder:new n.vd({id:0,source:`${n.PY}${n.lJ}`,root:n.lJ,owner:(0,d.HW)()?.uid||null,permissions:n.aX.READ})}):s()});t(()=>i.cancel())}),Ps=function(e,s=0){return new n.Ss({id:Is(e.path),name:e.displayname,icon:Ns,order:s,params:{dir:e.path,fileid:String(e.fileid),view:"favorites"},parent:"favorites",columns:[],getContents:Es})},Is=function(e){return`favorite-${function(e){let s=0;for(let t=0;t>>0}(e)}`},Rs=Math.round(Date.now()/1e3-1209600),Os=e=>(0,n.Al)(e,n.lJ,(0,y.$_)()),zs=(0,d.HW)()?.uid,js=function(e){const s=e.attributes["mount-type"];return zs===e.owner&&!["group","shared"].includes(s)},Bs=(e="/")=>(0,pe.hE)(e).then(e=>(e.contents=e.contents.filter(js),e));var Ds=t(4735);const Ms="personal";var Vs=t(25682);const Hs="folders",Ws=`${n.PY}/files/${(0,d.HW)()?.uid}`,Ys=Intl.Collator([(0,l.Z0)(),(0,l.lO)()],{numeric:!0,usage:"sort"}),$s=(e,s)=>Ys.compare(e.displayName??e.basename,s.displayName??s.basename),qs=(e,s="/",t=[])=>{const n=e.toSorted($s);for(const{id:e,basename:i,displayName:a,children:o}of n){const n=(0,m.HS)(s,i),r=`${Ws}${n}`,l={source:r,encodedSource:Ks(r),path:n,fileid:e,basename:i};a&&(l.displayName=a),t.push(l),o.length>0&&qs(o,n,t)}return t},Gs=e=>(0,pe.hE)(e),Ks=e=>{const{origin:s}=new URL(e);return s+(0,m.O0)(e.slice(s.length))},Xs=e=>{const s=(0,m.pD)(e);return s===Ws?Hs:Ks(s)},Js=(0,i.C)("files","config",{folder_tree:!0}).folder_tree;let Zs=(0,i.C)("files","config",{show_hidden:!1}).show_hidden;const Qs=(0,n.bh)(),et=new a.A({concurrency:5,intervalCap:5,interval:200}),st=new a.A({concurrency:5,intervalCap:5,interval:200}),tt=async(e="/")=>{await et.add(async()=>{const s=await(async(e="/",s=1)=>{const{data:t}=await U.Ay.get((0,y.KT)("/apps/files/api/v1/folder-tree"),{params:new URLSearchParams({path:e,depth:String(s)})});return qs(t,e)})(e),t=s.map(e=>st.add(()=>it(e)));await Promise.allSettled(t)})},nt=e=>async s=>{s.loading||s.loaded||(s.loading=!0,await tt(e.path),s.loading=!1,s.loaded=!0,(0,S.Ic)("files:navigation:updated"),(0,S.Ic)("files:folder-tree:expanded"))},it=e=>{const s=Qs.views.find(s=>s.id===e.encodedSource);s&&Qs.remove(s.id),!Zs&&e.basename.startsWith(".")||Qs.register(new n.Ss({id:e.encodedSource,parent:Xs(e.source),name:e.displayName??e.displayname??e.basename,icon:Ns,getContents:Gs,loadChildViews:nt(e),params:{view:Hs,fileid:String(e.fileid),dir:e.path}}))},at=e=>{e.type===n.pt.Folder&&it(e)},ot=e=>{e.type===n.pt.Folder&&(e=>{const s=e.encodedSource;Qs.remove(s)})(e)},rt=({node:e,oldSource:s})=>{if(e.type!==n.pt.Folder)return;var t;t=s,Qs.remove(t),it(e);const i=e.source.replace(Ws,""),a=s.replace(Ws,""),o=Qs.views.filter(e=>!!e.params?.dir&&!(0,m.ys)(e.params.dir,a)&&e.params.dir.startsWith(a));for(const s of o)s.parent=Xs(e.source),s.params.dir=s.params.dir.replace(a,i)},lt=async({key:e,value:s})=>{"show_hidden"===e&&(Zs=s,await tt(),(0,S.Ic)("files:folder-tree:initialized"))},dt=new a.A({concurrency:5}),mt=function(e,s){return U.Ay.post((0,y.KT)("/apps/files/api/v1/convert"),{fileId:e,targetMimeType:s})},ct="convert";var gt=t(82736);class ut extends n.L3{constructor(){var e,s,t;super("files:filename",5),e=this,t="",(s=function(e){var s=function(e){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var t=s.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof s?s:s+""}(s="searchQuery"))in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,(0,S.B1)("files:search:updated",({query:e,scope:s})=>{"filter"===s&&this.updateQuery(e)})}filter(e){const s=this.searchQuery.toLocaleLowerCase().split(" ").filter(Boolean);return e.filter(e=>{const t=e.displayname.toLocaleLowerCase();return s.every(e=>t.includes(e))})}reset(){this.updateQuery("")}updateQuery(e){if((e=(e||"").trim())!==this.searchQuery){this.searchQuery=e,this.filterUpdated();const s=[];if(""!==e)s.push({text:e,onclick:()=>{this.updateQuery("")}});else{const e=(0,gt.j)((0,F.u)());"filter"===e.scope&&(e.query="")}this.updateChips(s)}}}const ft=(0,c.pM)({__name:"FileListFilterToSearch",setup(e,{expose:s}){const t=(0,c.KR)(!1);function n(){t.value=!1}function i(){t.value=!0}return s({hideButton:n,showButton:i}),{__sfc:!0,isVisible:t,hideButton:n,showButton:i,onClick:function(){(0,gt.j)((0,F.u)()).scope="globally"},t:l.t,NcButton:us.A}}}),pt=(0,Ke.A)(ft,function(){var e=this,s=e._self._c,t=e._self._setupProxy;return s(t.NcButton,{directives:[{name:"show",rawName:"v-show",value:t.isVisible,expression:"isVisible"}],on:{click:t.onClick}},[e._v("\n\t"+e._s(t.t("files","Search everywhere"))+"\n")])},[],!1,null,null,null).exports;class ht extends n.L3{constructor(){var e,s,t;super("files:filter-to-search",999),e=this,t=void 0,(s=function(e){var s=function(e){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var t=s.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof s?s:s+""}(s="currentInstance"))in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,(0,S.B1)("files:search:updated",({query:e,scope:s})=>{e&&"filter"===s?this.currentInstance?.showButton():this.currentInstance?.hideButton()})}mount(e){this.currentInstance&&this.currentInstance.$destroy();const s=c.Ay.extend(pt);this.currentInstance=(new s).$mount(e)}filter(e){return e}}(()=>{const e=((0,L.F)()?.files?.file_conversions??[]).map(({to:e,from:s,displayName:t})=>new n.hY({id:`convert-${s}-${e}`,displayName:()=>(0,l.t)("files","Save as {displayName}",{displayName:t}),iconSvgInline:()=>{return s=e,`\n\t\t\n\t`;var s},enabled:e=>e.every(e=>s===e.mime),exec:async s=>(async function(e,s){const t=(0,V.Cs)((0,l.t)("files","Converting file …"));try{const t=await dt.add(()=>mt(e,s));(0,V.Te)((0,l.t)("files","File successfully converted"));const n=await(0,As.t)(t.data.ocs.data.path);(0,S.Ic)("files:node:created",n);const i=t.data.ocs.data.fileId;window.OCP.Files.Router.goToRoute(null,{...window.OCP.Files.Router.params,fileid:i.toString()},window.OCP.Files.Router.query)}catch(t){if((0,U.F0)(t)&&t.response?.data?.ocs?.meta?.message)return void(0,V.Qg)((0,l.t)("files","Failed to convert file: {message}",{message:t.response.data.ocs.meta.message}));B.A.error("Failed to convert file",{fileId:e,targetMimeType:s,error:t}),(0,V.Qg)((0,l.t)("files","Failed to convert file"))}finally{t.hideToast()}}(s.fileid,e),null),execBatch:async s=>(async function(e,s){const t=e.map(e=>dt.add(()=>mt(e,s))),n=(0,V.Cs)((0,l.t)("files","Converting files …"));try{const n=await Promise.allSettled(t),i=n.filter(e=>"rejected"===e.status);if(i.length>0){const t=i.map(e=>e.reason?.response?.data?.ocs?.meta?.message);return B.A.error("Failed to convert files",{fileIds:e,targetMimeType:s,messages:t}),1===new Set(t).size&&"string"==typeof t[0]?void(0,V.Qg)((0,l.t)("files","Failed to convert files: {message}",{message:t[0]})):i.length===e.length?void(0,V.Qg)((0,l.t)("files","All files failed to be converted")):1===i.length&&t[0]?void(0,V.Qg)((0,l.t)("files","One file could not be converted: {message}",{message:t[0]})):((0,V.Qg)((0,l.n)("files","%n file could not be converted","%n files could not be converted",i.length)),void(0,V.Te)((0,l.n)("files","%n file converted","%n files converted",e.length-i.length)))}(0,V.Te)((0,l.t)("files","Files converted"));const a=window.OCP.Files.Router.query.dir,o=n.filter(e=>"fulfilled"===e.status).map(e=>e.value.data.ocs.data.path).filter(e=>e.startsWith(a));B.A.debug("Files to fetch",{newPaths:o}),(await Promise.all(o.map(e=>(0,As.t)(e)))).forEach(e=>(0,S.Ic)("files:node:created",e));const r=n[0].value.data.ocs.data.fileId;window.OCP.Files.Router.goToRoute(null,{...window.OCP.Files.Router.params,fileid:r.toString()},window.OCP.Files.Router.query)}catch(t){(0,V.Qg)((0,l.t)("files","Failed to convert files")),B.A.error("Failed to convert files",{fileIds:e,targetMimeType:s,error:t})}finally{n.hideToast()}}(s.map(e=>e.fileid).filter(Boolean),e),Array(s.length).fill(null)),parent:ct}));(0,n.Gg)(new n.hY({id:ct,displayName:()=>(0,l.t)("files","Save as …"),iconSvgInline:()=>'',enabled:(s,t)=>e.some(e=>e.enabled(s,t)),exec:async()=>null,order:25})),e.forEach(n.Gg)})(),(0,n.Gg)(M),(0,n.Gg)(K),(0,n.Gg)(J),(0,n.Gg)(ie),(0,n.Gg)(we),(0,n.Gg)(ke),(0,n.Gg)(Te),(0,n.Gg)(Ce),(0,n.Gg)(Le),(0,n.Gg)(Ue),(0,n.zj)(Ts),(0,n.zj)(Ss),function(){let e;e=(0,X.f)()?(0,i.C)("files_sharing","templates",[]):(0,i.C)("files","templates",[]),e.forEach((e,s)=>{(0,n.zj)({id:`template-new-${e.app}-${s}`,displayName:e.label,iconClass:e.iconClass||"icon-file",iconSvgInline:e.iconSvgInline,enabled:e=>0!==(e.permissions&n.aX.CREATE),order:11,async handler(s,t){const n=_s(s),i=await ys(`${e.label}${e.extension}`,t,{label:(0,l.Tl)("files","Filename"),name:e.label});null!==i&&(await n).open(i.trim(),e)}})})}(),!1===(0,X.f)()&&((async()=>{const e=(0,n.bh)();e.register(new n.Ss({id:"favorites",name:(0,l.t)("files","Favorites"),caption:(0,l.t)("files","List of favorite files and folders."),emptyTitle:(0,l.t)("files","No favorites yet"),emptyCaption:(0,l.t)("files","Files and folders you mark as favorite will show up here"),icon:Q,order:15,columns:[],getContents:Es}));const s=(await(0,ae.Q$)(As.S)).filter(e=>e.type===n.pt.Folder),t=s.map((e,s)=>Ps(e,s));B.A.debug("Generating favorites view",{favoriteFolders:s}),t.forEach(s=>e.register(s)),(0,S.B1)("files:favorites:added",e=>{e.type===n.pt.Folder&&(null!==e.path&&e.root?.startsWith("/files")?a(e):B.A.error("Favorite folder is not within user files root",{node:e}))}),(0,S.B1)("files:favorites:removed",e=>{e.type===n.pt.Folder&&(null!==e.path&&e.root?.startsWith("/files")?o(e.path):B.A.error("Favorite folder is not within user files root",{node:e}))}),(0,S.B1)("files:node:renamed",e=>{e.type===n.pt.Folder&&1===e.attributes.favorite&&r(e)});const i=function(){s.sort((e,s)=>e.basename.localeCompare(s.basename,[(0,l.Z0)(),(0,l.lO)()],{ignorePunctuation:!0,numeric:!0,usage:"sort"})),s.forEach((e,s)=>{const n=t.find(s=>s.id===Is(e.path));n&&(n.order=s)})},a=function(n){const a=Ps(n);s.find(e=>e.path===n.path)||(s.push(n),t.push(a),i(),e.register(a))},o=function(n){const a=Is(n),o=s.findIndex(e=>e.path===n);-1!==o&&(s.splice(o,1),t.splice(o,1),e.remove(a),i())},r=function(e){const t=s.find(s=>s.fileid===e.fileid);void 0!==t&&(o(t.path),a(e))};i()})(),(0,Vs.g)(),(0,Ds.L)()&&(0,n.bh)().register(new n.Ss({id:Ms,name:(0,l.t)("files","Personal files"),caption:(0,l.t)("files","List of your files and folders that are not shared."),emptyTitle:(0,l.t)("files","No personal files found"),emptyCaption:(0,l.t)("files","Files that are not shared will show up here."),icon:'',order:(0,Ds.P)()===Ms?0:5,getContents:Bs})),(0,n.bh)().register(new n.Ss({id:"recent",name:(0,l.Tl)("files","Recent"),caption:(0,l.Tl)("files","List of recently modified files and folders."),emptyTitle:(0,l.Tl)("files","No recently modified files"),emptyCaption:(0,l.Tl)("files","Files and folders you recently modified will show up here."),icon:'',order:10,defaultSortKey:"mtime",getContents:(e="/")=>{const s=A((0,F.u)()),t=t=>"/"!==e||s.userConfig.show_hidden||!t.dirname.split("/").some(e=>e.startsWith(".")),i=new AbortController;return new Fs.CancelablePromise(async(e,s,a)=>{a(()=>i.abort()),e((async()=>{const e=(await As.S.search("/",{signal:i.signal,details:!0,data:(0,n.R3)(Rs)})).data.results.map(Os).filter(t);return{folder:new n.vd({id:0,source:`${n.PY}${n.lJ}`,root:n.lJ,owner:(0,d.HW)()?.uid||null,permissions:n.aX.READ}),contents:e}})())})}})),(0,ye.d)(),(async()=>{Js&&(Qs.register(new n.Ss({id:Hs,name:(0,l.Tl)("files","Folder tree"),caption:(0,l.Tl)("files","List of your files and folders."),icon:le,order:50,getContents:Gs})),await tt(),(0,S.B1)("files:node:created",at),(0,S.B1)("files:node:deleted",ot),(0,S.B1)("files:node:moved",rt),(0,S.B1)("files:config:updated",lt),(0,S.Ic)("files:folder-tree:initialized"))})()),(0,n.cZ)(new _e),(0,n.cZ)(new ns),(0,n.cZ)(new cs),(0,n.cZ)(new ut),(0,n.cZ)(new ht),"serviceWorker"in navigator?window.addEventListener("load",async()=>{try{const e=(0,y.Jv)("/apps/files/preview-service-worker.js",{},{noRewrite:!0});let s=(0,y.aU)();""===s&&(s="/");const t=await navigator.serviceWorker.register(e,{scope:s});B.A.debug("SW registered: ",{registration:t})}catch(e){B.A.error("SW registration failed: ",{error:e})}}):B.A.debug("Service Worker is not enabled on this browser."),(0,n.Yc)("nc:hidden",{nc:"http://nextcloud.org/ns"}),(0,n.Yc)("nc:is-mount-root",{nc:"http://nextcloud.org/ns"}),(0,n.Yc)("nc:metadata-blurhash",{nc:"http://nextcloud.org/ns"}),(0,n.Yc)("nc:metadata-files-live-photo",{nc:"http://nextcloud.org/ns"})},9558(e,s,t){t.d(s,{A:()=>n});const n=(0,t(35947).YK)().setApp("files").detectUser().build()},16954(e,s,t){t.d(s,{hE:()=>u});var n=t(77815),i=t(36117),a=t(43627),o=t(56908),r=t(21976),l=t(4114),d=t(89761),m=t(82736),c=t(9558);const g=e=>(0,n.pO)(e);function u(e="/"){const s=new AbortController,t=(0,m.j)((0,l.u)());return t.query.length>=3?new i.CancelablePromise((i,m,c)=>{c(()=>s.abort()),async function(e,s,t){let i=(0,d._)((0,l.u)()).getDirectoryByPath("files",e);if(!i){const s=(0,a.join)(n.VA,e),t=await o.S.stat(s,{details:!0});i=g(t.data)}return{folder:i,contents:await(0,r.E)(s,{dir:e,signal:t})}}(e,t.query,s.signal).then(i).catch(m)}):function(e){e=(0,a.join)(n.VA,e);const s=new AbortController,t=(0,n.aN)();return new i.CancelablePromise(async(n,i,a)=>{a(()=>s.abort());try{const i=await o.S.getDirectoryContents(e,{details:!0,data:t,includeSelf:!0,signal:s.signal}),a=i.data[0],r=i.data.slice(1);if(a.filename!==e&&`${a.filename}/`!==e)throw c.A.debug(`Exepected "${e}" but got filename "${a.filename}" instead.`),new Error("Root node does not match requested path");n({folder:g(a),contents:r.map(e=>{try{return g(e)}catch(s){return c.A.error(`Invalid node detected '${e.basename}'`,{error:s}),null}}).filter(Boolean)})}catch(e){i(e)}})}(e)}},21976(e,s,t){t.d(s,{E:()=>l});var n=t(21777),i=t(77815),a=t(63814),o=t(56908),r=t(9558);async function l(e,{dir:s,signal:t}){const l=(0,n.HW)();if(!l)return[];if((e=e.trim()).length<3)return[];s&&!s.startsWith("/")&&(s=`/${s}`),r.A.debug("Searching for nodes",{query:e,dir:s});const{data:d}=await o.S.search("/",{details:!0,signal:t,data:`\n\n\t \n\t\t \n\t\t\t \n\t\t\t ${(0,i.VX)()}\n\t\t\t \n\t\t \n\t\t \n\t\t\t \n\t\t\t\t /files/${l.uid}${s||""}\n\t\t\t\t infinity\n\t\t\t \n\t\t \n\t\t \n\t\t\t \n\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t \n\t\t\t\t %${e.replace("%","")}%\n\t\t\t \n\t\t \n\t\t \n\t\n`});return t?.aborted?[]:d.results.map(e=>(0,i.pO)(e,i.VA,(0,a.$_)()))}},56908(e,s,t){t.d(s,{S:()=>i,t:()=>a});var n=t(77815);const i=(0,n.KU)(),a=async e=>{const s=(0,n.aN)(),t=await i.stat(`${(0,n.ei)()}${e}`,{details:!0,data:s});return(0,n.pO)(t.data)}},49542(e,s,t){t.d(s,{F:()=>l});var n=t(61338),i=t(35810),a=t(65899),o=t(85471),r=t(9558);const l=(0,a.nY)("active",()=>{const e=(0,o.KR)(),s=(0,o.KR)(),t=(0,o.KR)(),a=(0,o.KR)();function l(e){t.value&&t.value.source===e.source&&(t.value=void 0)}function d(e=null){r.A.debug("Setting active view",{view:e}),a.value=e??void 0,t.value=void 0}return function(){const e=(0,i.bh)();(0,n.B1)("files:node:deleted",l),d(e.active),e.addEventListener("updateActive",e=>{d(e.detail)})}(),{activeAction:e,activeFolder:s,activeNode:t,activeView:a}})},89761(e,s,t){t.d(s,{_:()=>d});var n=t(65899),i=t(61338),a=t(9558),o=t(85471),r=t(56908),l=t(45238);const d=function(...e){const s=(0,n.nY)("files",{state:()=>({files:{},roots:{}}),getters:{getNode:e=>s=>e.files[s],getNodes:e=>s=>s.map(s=>e.files[s]).filter(Boolean),getNodesById:e=>s=>Object.values(e.files).filter(e=>e.fileid===s),getRoot:e=>s=>e.roots[s]},actions:{getDirectoryByPath(e,s){const t=(0,l.B)();let n;if(s&&"/"!==s){const i=t.getPath(e,s);i&&(n=this.getNode(i))}else n=this.getRoot(e);return n},getNodesByPath(e,s){const t=this.getDirectoryByPath(e,s);return(t?._children??[]).map(e=>this.getNode(e)).filter(Boolean)},updateNodes(e){const s=e.reduce((e,s)=>s.fileid?(e[s.source]=s,e):(a.A.error("Trying to update/set a node without fileid",{node:s}),e),{});o.Ay.set(this,"files",{...this.files,...s})},deleteNodes(e){e.forEach(e=>{e.source&&o.Ay.delete(this.files,e.source)})},setRoot({service:e,root:s}){o.Ay.set(this.roots,e,s)},onDeletedNode(e){this.deleteNodes([e])},onCreatedNode(e){this.updateNodes([e])},onMovedNode({node:e,oldSource:s}){e.fileid?(o.Ay.delete(this.files,s),this.updateNodes([e])):a.A.error("Trying to update/set a node without fileid",{node:e})},async onUpdatedNode(e){if(!e.fileid)return void a.A.error("Trying to update/set a node without fileid",{node:e});const s=this.getNodesById(e.fileid);if(s.length>1)return await Promise.all(s.map(e=>(0,r.t)(e.path))).then(this.updateNodes),void a.A.debug(s.length+" nodes updated in store",{fileid:e.fileid});1!==s.length||e.source!==s[0].source?(0,r.t)(e.path).then(e=>this.updateNodes([e])):this.updateNodes([e])},onAddFavorite(e){const s=this.getNode(e.source);s&&o.Ay.set(s.attributes,"favorite",1)},onRemoveFavorite(e){const s=this.getNode(e.source);s&&o.Ay.set(s.attributes,"favorite",0)}}})(...e);return s._initialized||((0,i.B1)("files:node:created",s.onCreatedNode),(0,i.B1)("files:node:deleted",s.onDeletedNode),(0,i.B1)("files:node:updated",s.onUpdatedNode),(0,i.B1)("files:node:moved",s.onMovedNode),(0,i.B1)("files:favorites:added",s.onAddFavorite),(0,i.B1)("files:favorites:removed",s.onRemoveFavorite),s._initialized=!0),s}},4114(e,s,t){t.d(s,{u:()=>i});var n=t(65899);const i=()=>(window._nc_files_pinia||(window._nc_files_pinia=(0,n.Ey)()),window._nc_files_pinia)},45238(e,s,t){t.d(s,{B:()=>m});var n=t(65899),i=t(71225),a=t(35810),o=t(61338),r=t(85471),l=t(9558),d=t(89761);const m=function(...e){const s=(0,d._)(...e),t=(0,n.nY)("paths",{state:()=>({paths:{}}),getters:{getPath:e=>(s,t)=>{if(e.paths[s])return e.paths[s][t]}},actions:{addPath(e){this.paths[e.service]||r.Ay.set(this.paths,e.service,{}),r.Ay.set(this.paths[e.service],e.path,e.source)},deletePath(e,s){this.paths[e]&&r.Ay.delete(this.paths[e],s)},onCreatedNode(e){const s=(0,a.bh)()?.active?.id||"files";e.fileid?(e.type===a.pt.Folder&&this.addPath({service:s,path:e.path,source:e.source}),this.addNodeToParentChildren(e)):l.A.error("Node has no fileid",{node:e})},onDeletedNode(e){const s=(0,a.bh)()?.active?.id||"files";e.type===a.pt.Folder&&this.deletePath(s,e.path),this.deleteNodeFromParentChildren(e)},onMovedNode({node:e,oldSource:s}){const t=(0,a.bh)()?.active?.id||"files";if(e.type===a.pt.Folder){const n=Object.entries(this.paths[t]).find(([,e])=>e===s);n?.[0]&&this.deletePath(t,n[0]),this.addPath({service:t,path:e.path,source:e.source})}const n=new a.ZH({source:s,owner:e.owner,mime:e.mime});this.deleteNodeFromParentChildren(n),this.addNodeToParentChildren(e)},deleteNodeFromParentChildren(e){const t=(0,a.bh)()?.active?.id||"files",n=(0,i.pD)(e.source),o="/"===e.dirname?s.getRoot(t):s.getNode(n);if(o){const s=new Set(o._children??[]);return s.delete(e.source),r.Ay.set(o,"_children",[...s.values()]),void l.A.debug("Children updated",{parent:o,node:e,children:o._children})}l.A.debug("Parent path does not exists, skipping children update",{node:e})},addNodeToParentChildren(e){const t=(0,a.bh)()?.active?.id||"files",n=(0,i.pD)(e.source),o="/"===e.dirname?s.getRoot(t):s.getNode(n);if(o){const s=new Set(o._children??[]);return s.add(e.source),r.Ay.set(o,"_children",[...s.values()]),void l.A.debug("Children updated",{parent:o,node:e,children:o._children})}l.A.debug("Parent path does not exists, skipping children update",{node:e})}}})(...e);return t._initialized||((0,o.B1)("files:node:created",t.onCreatedNode),(0,o.B1)("files:node:deleted",t.onDeletedNode),(0,o.B1)("files:node:moved",t.onMovedNode),t._initialized=!0),t}},82736(e,s,t){t.d(s,{j:()=>m});var n=t(61338),i=t(17334),a=t.n(i),o=t(65899),r=t(85471),l=t(53775),d=t(9558);const m=(0,o.nY)("search",()=>{const e=(0,r.KR)(""),s=(0,r.KR)("filter");(0,r.wB)(s,i),(0,r.wB)(e,(e,s)=>{e.trim()!==s.trim()&&i()}),function(){(0,n.B1)("files:navigation:changed",o);const t=window.OCP.Files.Router;t.params.view===l.w&&(e.value=[t.query.query].flat()[0]??"",e.value?(s.value="globally",d.A.debug("Directly navigated to search view",{query:e.value})):(d.A.info("Directly navigated to search view without any query, redirect to files view."),t.goToRoute(void 0,{...t.params,view:"files"},{...t.query,query:void 0},!0)))}();const t=a()(s=>{window.OCP.Files.Router.goToRoute(void 0,{view:l.w},{query:e.value},s)});function i(){(0,n.Ic)("files:search:updated",{query:e.value,scope:s.value});const i=window.OCP.Files.Router;if(i.params.view===l.w&&(""===e.value||"filter"===s.value))return s.value="filter",i.goToRoute(void 0,{view:"files"},{...i.query,query:void 0});if("filter"===s.value||!e.value)return;const a=i.params.view===l.w;d.A.debug("Update route for updated search query",{query:e.value,isSearch:a}),t(a)}function o(t){t.id!==l.w&&(e.value="",s.value="filter")}return{query:e,scope:s}})},4735(e,s,t){t.d(s,{L:()=>i,P:()=>a});var n=t(81222);function i(){return 0!==(0,n.C)("files","storageStats",{quota:-1}).quota}function a(){const{default_view:e}=(0,n.C)("files","config",{default_view:"files"});return"personal"!==e||i()?e:"files"}},25682(e,s,t){t.d(s,{g:()=>c,w:()=>m});var n=t(61338),i=t(35810),a=t(53334),o=t(16954),r=t(49542),l=t(4735),d=t(43690);const m="files";function c(){let e="";const s=(0,i.bh)();s.register(new i.Ss({id:m,name:(0,a.t)("files","All files"),caption:(0,a.t)("files","List of your files and folders."),icon:d,order:(0,l.P)()===m?0:5,getContents:o.hE})),(0,n.B1)("files:search:updated",({scope:t,query:i})=>{if("globally"===t)return;if(s.active?.id!==m)return;if(e.length<3&&i.length<3)return;const a=(0,r.F)();a.activeFolder&&(e=i,(0,n.Ic)("files:node:updated",a.activeFolder))})}},53775(e,s,t){t.d(s,{w:()=>p,d:()=>h});var n=t(35810),i=t(53334),a=t(21777),o=t(77815),r=t(36117),l=t(21976),d=t(9558),m=t(82736),c=t(4114);function g(){const e=new AbortController,s=(0,m.j)((0,c.u)());return new r.CancelablePromise(async(t,i,r)=>{r(()=>e.abort());try{t({contents:await(0,l.E)(s.query,{signal:e.signal}),folder:new n.vd({id:0,source:`${o.Xn}#search`,owner:(0,a.HW)().uid,permissions:n.aX.READ})})}catch(e){d.A.error("Failed to fetch search results",{error:e}),i(e)}})}var u=t(25682),f=t(85471);const p="search";function h(){let e,s;(0,n.bh)().register(new n.Ss({id:p,name:(0,i.t)("files","Search"),caption:(0,i.t)("files","Search results within your files."),async emptyView(n){s?e.$destroy():s=(await Promise.all([t.e(4208),t.e(9165),t.e(7457)]).then(t.bind(t,37457))).default,e=new f.Ay(s),e.$mount(n)},icon:'',order:10,parent:u.w,expanded:!0,hidden:!0,getContents:g}))}},31891(e,s,t){t.d(s,{A:()=>r});var n=t(71354),i=t.n(n),a=t(76314),o=t.n(a)()(i());o.push([e.id,".files-list-filter-time__clear-button[data-v-35fd0c81] .action-button__text{color:var(--color-error-text)}","",{version:3,sources:["webpack://./apps/files/src/components/FileListFilter/FileListFilterModified.vue"],names:[],mappings:"AAEC,4EACC,6BAAA",sourcesContent:["\n.files-list-filter-time {\n\t&__clear-button :deep(.action-button__text) {\n\t\tcolor: var(--color-error-text);\n\t}\n}\n"],sourceRoot:""}]);const r=o},30610(e,s,t){t.d(s,{A:()=>r});var n=t(71354),i=t.n(n),a=t(76314),o=t.n(a)()(i());o.push([e.id,"\n.files-list-filter__clear-button[data-v-21c6ff6c] .action-button__text {\n\tcolor: var(--color-text-error, var(--color-error-text));\n}\n[data-v-21c6ff6c] .button-vue {\n\tfont-weight: normal !important;\n*[data-v-21c6ff6c] {\n\t\tfont-weight: normal !important;\n}\n}\n","",{version:3,sources:["webpack://./apps/files/src/components/FileListFilter/FileListFilter.vue"],names:[],mappings:";AAyCA;CACA,uDAAA;AACA;AAEA;CACA,8BAAA;AAEA;EACA,8BAAA;AACA;AACA",sourcesContent:["\x3c!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n--\x3e\n\n\n\\n\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `\n.file-list-filter-type {\n\tmax-width: 220px;\n}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files/src/components/FileListFilter/FileListFilterType.vue\"],\"names\":[],\"mappings\":\";AAsHA;CACA,gBAAA;AACA\",\"sourcesContent\":[\"\\n\\n\\n\\n\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `\n.new-node-dialog__form[data-v-04462327] {\n\t/* Ensure the dialog does not jump when there is a validity error */\n\tmin-height: calc(2 * var(--default-clickable-area));\n}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files/src/components/NewNodeDialog.vue\"],\"names\":[],\"mappings\":\";AAmKA;CACA,mEAAA;CACA,mDAAA;AACA\",\"sourcesContent\":[\"\\n\\n\\n\\n\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","import { o as logger, F as FileType } from \"./chunks/dav-Rt1kTtvI.mjs\";\nimport { q, s, N, t, P, c, l, m, n, a, g, p, b, r, d, h, f, k, j, e, i } from \"./chunks/dav-Rt1kTtvI.mjs\";\nimport { TypedEventTarget } from \"typescript-event-target\";\nimport require$$1 from \"string_decoder\";\nimport { getCapabilities } from \"@nextcloud/capabilities\";\nimport { extname, basename } from \"@nextcloud/paths\";\nimport { getCanonicalLocale, getLanguage } from \"@nextcloud/l10n\";\nvar DefaultType = /* @__PURE__ */ ((DefaultType2) => {\n DefaultType2[\"DEFAULT\"] = \"default\";\n DefaultType2[\"HIDDEN\"] = \"hidden\";\n return DefaultType2;\n})(DefaultType || {});\nclass FileAction {\n _action;\n constructor(action) {\n this.validateAction(action);\n this._action = action;\n }\n get id() {\n return this._action.id;\n }\n get displayName() {\n return this._action.displayName;\n }\n get title() {\n return this._action.title;\n }\n get iconSvgInline() {\n return this._action.iconSvgInline;\n }\n get enabled() {\n return this._action.enabled;\n }\n get exec() {\n return this._action.exec;\n }\n get execBatch() {\n return this._action.execBatch;\n }\n get hotkey() {\n return this._action.hotkey;\n }\n get order() {\n return this._action.order;\n }\n get parent() {\n return this._action.parent;\n }\n get default() {\n return this._action.default;\n }\n get destructive() {\n return this._action.destructive;\n }\n get inline() {\n return this._action.inline;\n }\n get renderInline() {\n return this._action.renderInline;\n }\n validateAction(action) {\n if (!action.id || typeof action.id !== \"string\") {\n throw new Error(\"Invalid id\");\n }\n if (!action.displayName || typeof action.displayName !== \"function\") {\n throw new Error(\"Invalid displayName function\");\n }\n if (\"title\" in action && typeof action.title !== \"function\") {\n throw new Error(\"Invalid title function\");\n }\n if (!action.iconSvgInline || typeof action.iconSvgInline !== \"function\") {\n throw new Error(\"Invalid iconSvgInline function\");\n }\n if (!action.exec || typeof action.exec !== \"function\") {\n throw new Error(\"Invalid exec function\");\n }\n if (\"enabled\" in action && typeof action.enabled !== \"function\") {\n throw new Error(\"Invalid enabled function\");\n }\n if (\"execBatch\" in action && typeof action.execBatch !== \"function\") {\n throw new Error(\"Invalid execBatch function\");\n }\n if (\"order\" in action && typeof action.order !== \"number\") {\n throw new Error(\"Invalid order\");\n }\n if (action.destructive !== void 0 && typeof action.destructive !== \"boolean\") {\n throw new Error(\"Invalid destructive flag\");\n }\n if (\"parent\" in action && typeof action.parent !== \"string\") {\n throw new Error(\"Invalid parent\");\n }\n if (action.default && !Object.values(DefaultType).includes(action.default)) {\n throw new Error(\"Invalid default\");\n }\n if (\"inline\" in action && typeof action.inline !== \"function\") {\n throw new Error(\"Invalid inline function\");\n }\n if (\"renderInline\" in action && typeof action.renderInline !== \"function\") {\n throw new Error(\"Invalid renderInline function\");\n }\n if (\"hotkey\" in action && action.hotkey !== void 0) {\n if (typeof action.hotkey !== \"object\") {\n throw new Error(\"Invalid hotkey configuration\");\n }\n if (typeof action.hotkey.key !== \"string\" || !action.hotkey.key) {\n throw new Error(\"Missing or invalid hotkey key\");\n }\n if (typeof action.hotkey.description !== \"string\" || !action.hotkey.description) {\n throw new Error(\"Missing or invalid hotkey description\");\n }\n }\n }\n}\nconst registerFileAction = function(action) {\n if (typeof window._nc_fileactions === \"undefined\") {\n window._nc_fileactions = [];\n logger.debug(\"FileActions initialized\");\n }\n if (window._nc_fileactions.find((search) => search.id === action.id)) {\n logger.error(`FileAction ${action.id} already registered`, { action });\n return;\n }\n window._nc_fileactions.push(action);\n};\nconst getFileActions = function() {\n if (typeof window._nc_fileactions === \"undefined\") {\n window._nc_fileactions = [];\n logger.debug(\"FileActions initialized\");\n }\n return window._nc_fileactions;\n};\nclass FileListAction {\n _action;\n constructor(action) {\n this.validateAction(action);\n this._action = action;\n }\n get id() {\n return this._action.id;\n }\n get displayName() {\n return this._action.displayName;\n }\n get iconSvgInline() {\n return this._action.iconSvgInline;\n }\n get order() {\n return this._action.order;\n }\n get enabled() {\n return this._action.enabled;\n }\n get exec() {\n return this._action.exec;\n }\n validateAction(action) {\n if (!action.id || typeof action.id !== \"string\") {\n throw new Error(\"Invalid id\");\n }\n if (!action.displayName || typeof action.displayName !== \"function\") {\n throw new Error(\"Invalid displayName function\");\n }\n if (\"iconSvgInline\" in action && typeof action.iconSvgInline !== \"function\") {\n throw new Error(\"Invalid iconSvgInline function\");\n }\n if (\"order\" in action && typeof action.order !== \"number\") {\n throw new Error(\"Invalid order\");\n }\n if (\"enabled\" in action && typeof action.enabled !== \"function\") {\n throw new Error(\"Invalid enabled function\");\n }\n if (!action.exec || typeof action.exec !== \"function\") {\n throw new Error(\"Invalid exec function\");\n }\n }\n}\nconst registerFileListAction = (action) => {\n if (typeof window._nc_filelistactions === \"undefined\") {\n window._nc_filelistactions = [];\n }\n if (window._nc_filelistactions.find((listAction) => listAction.id === action.id)) {\n logger.error(`FileListAction with id \"${action.id}\" is already registered`, { action });\n return;\n }\n window._nc_filelistactions.push(action);\n};\nconst getFileListActions = () => {\n if (typeof window._nc_filelistactions === \"undefined\") {\n window._nc_filelistactions = [];\n }\n return window._nc_filelistactions;\n};\nfunction getDefaultExportFromCjs(x) {\n return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, \"default\") ? x[\"default\"] : x;\n}\nvar debug_1;\nvar hasRequiredDebug;\nfunction requireDebug() {\n if (hasRequiredDebug) return debug_1;\n hasRequiredDebug = 1;\n const debug = typeof process === \"object\" && process.env && process.env.NODE_DEBUG && /\\bsemver\\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error(\"SEMVER\", ...args) : () => {\n };\n debug_1 = debug;\n return debug_1;\n}\nvar constants;\nvar hasRequiredConstants;\nfunction requireConstants() {\n if (hasRequiredConstants) return constants;\n hasRequiredConstants = 1;\n const SEMVER_SPEC_VERSION = \"2.0.0\";\n const MAX_LENGTH = 256;\n const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */\n 9007199254740991;\n const MAX_SAFE_COMPONENT_LENGTH = 16;\n const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;\n const RELEASE_TYPES = [\n \"major\",\n \"premajor\",\n \"minor\",\n \"preminor\",\n \"patch\",\n \"prepatch\",\n \"prerelease\"\n ];\n constants = {\n MAX_LENGTH,\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_SAFE_INTEGER,\n RELEASE_TYPES,\n SEMVER_SPEC_VERSION,\n FLAG_INCLUDE_PRERELEASE: 1,\n FLAG_LOOSE: 2\n };\n return constants;\n}\nvar re = { exports: {} };\nvar hasRequiredRe;\nfunction requireRe() {\n if (hasRequiredRe) return re.exports;\n hasRequiredRe = 1;\n (function(module, exports) {\n const {\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_LENGTH\n } = requireConstants();\n const debug = requireDebug();\n exports = module.exports = {};\n const re2 = exports.re = [];\n const safeRe = exports.safeRe = [];\n const src = exports.src = [];\n const safeSrc = exports.safeSrc = [];\n const t2 = exports.t = {};\n let R = 0;\n const LETTERDASHNUMBER = \"[a-zA-Z0-9-]\";\n const safeRegexReplacements = [\n [\"\\\\s\", 1],\n [\"\\\\d\", MAX_LENGTH],\n [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]\n ];\n const makeSafeRegex = (value) => {\n for (const [token, max] of safeRegexReplacements) {\n value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);\n }\n return value;\n };\n const createToken = (name, value, isGlobal) => {\n const safe = makeSafeRegex(value);\n const index = R++;\n debug(name, index, value);\n t2[name] = index;\n src[index] = value;\n safeSrc[index] = safe;\n re2[index] = new RegExp(value, isGlobal ? \"g\" : void 0);\n safeRe[index] = new RegExp(safe, isGlobal ? \"g\" : void 0);\n };\n createToken(\"NUMERICIDENTIFIER\", \"0|[1-9]\\\\d*\");\n createToken(\"NUMERICIDENTIFIERLOOSE\", \"\\\\d+\");\n createToken(\"NONNUMERICIDENTIFIER\", `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);\n createToken(\"MAINVERSION\", `(${src[t2.NUMERICIDENTIFIER]})\\\\.(${src[t2.NUMERICIDENTIFIER]})\\\\.(${src[t2.NUMERICIDENTIFIER]})`);\n createToken(\"MAINVERSIONLOOSE\", `(${src[t2.NUMERICIDENTIFIERLOOSE]})\\\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})\\\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})`);\n createToken(\"PRERELEASEIDENTIFIER\", `(?:${src[t2.NONNUMERICIDENTIFIER]}|${src[t2.NUMERICIDENTIFIER]})`);\n createToken(\"PRERELEASEIDENTIFIERLOOSE\", `(?:${src[t2.NONNUMERICIDENTIFIER]}|${src[t2.NUMERICIDENTIFIERLOOSE]})`);\n createToken(\"PRERELEASE\", `(?:-(${src[t2.PRERELEASEIDENTIFIER]}(?:\\\\.${src[t2.PRERELEASEIDENTIFIER]})*))`);\n createToken(\"PRERELEASELOOSE\", `(?:-?(${src[t2.PRERELEASEIDENTIFIERLOOSE]}(?:\\\\.${src[t2.PRERELEASEIDENTIFIERLOOSE]})*))`);\n createToken(\"BUILDIDENTIFIER\", `${LETTERDASHNUMBER}+`);\n createToken(\"BUILD\", `(?:\\\\+(${src[t2.BUILDIDENTIFIER]}(?:\\\\.${src[t2.BUILDIDENTIFIER]})*))`);\n createToken(\"FULLPLAIN\", `v?${src[t2.MAINVERSION]}${src[t2.PRERELEASE]}?${src[t2.BUILD]}?`);\n createToken(\"FULL\", `^${src[t2.FULLPLAIN]}$`);\n createToken(\"LOOSEPLAIN\", `[v=\\\\s]*${src[t2.MAINVERSIONLOOSE]}${src[t2.PRERELEASELOOSE]}?${src[t2.BUILD]}?`);\n createToken(\"LOOSE\", `^${src[t2.LOOSEPLAIN]}$`);\n createToken(\"GTLT\", \"((?:<|>)?=?)\");\n createToken(\"XRANGEIDENTIFIERLOOSE\", `${src[t2.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`);\n createToken(\"XRANGEIDENTIFIER\", `${src[t2.NUMERICIDENTIFIER]}|x|X|\\\\*`);\n createToken(\"XRANGEPLAIN\", `[v=\\\\s]*(${src[t2.XRANGEIDENTIFIER]})(?:\\\\.(${src[t2.XRANGEIDENTIFIER]})(?:\\\\.(${src[t2.XRANGEIDENTIFIER]})(?:${src[t2.PRERELEASE]})?${src[t2.BUILD]}?)?)?`);\n createToken(\"XRANGEPLAINLOOSE\", `[v=\\\\s]*(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:${src[t2.PRERELEASELOOSE]})?${src[t2.BUILD]}?)?)?`);\n createToken(\"XRANGE\", `^${src[t2.GTLT]}\\\\s*${src[t2.XRANGEPLAIN]}$`);\n createToken(\"XRANGELOOSE\", `^${src[t2.GTLT]}\\\\s*${src[t2.XRANGEPLAINLOOSE]}$`);\n createToken(\"COERCEPLAIN\", `${\"(^|[^\\\\d])(\\\\d{1,\"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);\n createToken(\"COERCE\", `${src[t2.COERCEPLAIN]}(?:$|[^\\\\d])`);\n createToken(\"COERCEFULL\", src[t2.COERCEPLAIN] + `(?:${src[t2.PRERELEASE]})?(?:${src[t2.BUILD]})?(?:$|[^\\\\d])`);\n createToken(\"COERCERTL\", src[t2.COERCE], true);\n createToken(\"COERCERTLFULL\", src[t2.COERCEFULL], true);\n createToken(\"LONETILDE\", \"(?:~>?)\");\n createToken(\"TILDETRIM\", `(\\\\s*)${src[t2.LONETILDE]}\\\\s+`, true);\n exports.tildeTrimReplace = \"$1~\";\n createToken(\"TILDE\", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAIN]}$`);\n createToken(\"TILDELOOSE\", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAINLOOSE]}$`);\n createToken(\"LONECARET\", \"(?:\\\\^)\");\n createToken(\"CARETTRIM\", `(\\\\s*)${src[t2.LONECARET]}\\\\s+`, true);\n exports.caretTrimReplace = \"$1^\";\n createToken(\"CARET\", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAIN]}$`);\n createToken(\"CARETLOOSE\", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAINLOOSE]}$`);\n createToken(\"COMPARATORLOOSE\", `^${src[t2.GTLT]}\\\\s*(${src[t2.LOOSEPLAIN]})$|^$`);\n createToken(\"COMPARATOR\", `^${src[t2.GTLT]}\\\\s*(${src[t2.FULLPLAIN]})$|^$`);\n createToken(\"COMPARATORTRIM\", `(\\\\s*)${src[t2.GTLT]}\\\\s*(${src[t2.LOOSEPLAIN]}|${src[t2.XRANGEPLAIN]})`, true);\n exports.comparatorTrimReplace = \"$1$2$3\";\n createToken(\"HYPHENRANGE\", `^\\\\s*(${src[t2.XRANGEPLAIN]})\\\\s+-\\\\s+(${src[t2.XRANGEPLAIN]})\\\\s*$`);\n createToken(\"HYPHENRANGELOOSE\", `^\\\\s*(${src[t2.XRANGEPLAINLOOSE]})\\\\s+-\\\\s+(${src[t2.XRANGEPLAINLOOSE]})\\\\s*$`);\n createToken(\"STAR\", \"(<|>)?=?\\\\s*\\\\*\");\n createToken(\"GTE0\", \"^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$\");\n createToken(\"GTE0PRE\", \"^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$\");\n })(re, re.exports);\n return re.exports;\n}\nvar parseOptions_1;\nvar hasRequiredParseOptions;\nfunction requireParseOptions() {\n if (hasRequiredParseOptions) return parseOptions_1;\n hasRequiredParseOptions = 1;\n const looseOption = Object.freeze({ loose: true });\n const emptyOpts = Object.freeze({});\n const parseOptions = (options) => {\n if (!options) {\n return emptyOpts;\n }\n if (typeof options !== \"object\") {\n return looseOption;\n }\n return options;\n };\n parseOptions_1 = parseOptions;\n return parseOptions_1;\n}\nvar identifiers;\nvar hasRequiredIdentifiers;\nfunction requireIdentifiers() {\n if (hasRequiredIdentifiers) return identifiers;\n hasRequiredIdentifiers = 1;\n const numeric = /^[0-9]+$/;\n const compareIdentifiers = (a2, b2) => {\n if (typeof a2 === \"number\" && typeof b2 === \"number\") {\n return a2 === b2 ? 0 : a2 < b2 ? -1 : 1;\n }\n const anum = numeric.test(a2);\n const bnum = numeric.test(b2);\n if (anum && bnum) {\n a2 = +a2;\n b2 = +b2;\n }\n return a2 === b2 ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a2 < b2 ? -1 : 1;\n };\n const rcompareIdentifiers = (a2, b2) => compareIdentifiers(b2, a2);\n identifiers = {\n compareIdentifiers,\n rcompareIdentifiers\n };\n return identifiers;\n}\nvar semver;\nvar hasRequiredSemver;\nfunction requireSemver() {\n if (hasRequiredSemver) return semver;\n hasRequiredSemver = 1;\n const debug = requireDebug();\n const { MAX_LENGTH, MAX_SAFE_INTEGER } = requireConstants();\n const { safeRe: re2, t: t2 } = requireRe();\n const parseOptions = requireParseOptions();\n const { compareIdentifiers } = requireIdentifiers();\n class SemVer {\n constructor(version, options) {\n options = parseOptions(options);\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {\n return version;\n } else {\n version = version.version;\n }\n } else if (typeof version !== \"string\") {\n throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`);\n }\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n );\n }\n debug(\"SemVer\", version, options);\n this.options = options;\n this.loose = !!options.loose;\n this.includePrerelease = !!options.includePrerelease;\n const m2 = version.trim().match(options.loose ? re2[t2.LOOSE] : re2[t2.FULL]);\n if (!m2) {\n throw new TypeError(`Invalid Version: ${version}`);\n }\n this.raw = version;\n this.major = +m2[1];\n this.minor = +m2[2];\n this.patch = +m2[3];\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError(\"Invalid major version\");\n }\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError(\"Invalid minor version\");\n }\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError(\"Invalid patch version\");\n }\n if (!m2[4]) {\n this.prerelease = [];\n } else {\n this.prerelease = m2[4].split(\".\").map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id;\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num;\n }\n }\n return id;\n });\n }\n this.build = m2[5] ? m2[5].split(\".\") : [];\n this.format();\n }\n format() {\n this.version = `${this.major}.${this.minor}.${this.patch}`;\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join(\".\")}`;\n }\n return this.version;\n }\n toString() {\n return this.version;\n }\n compare(other) {\n debug(\"SemVer.compare\", this.version, this.options, other);\n if (!(other instanceof SemVer)) {\n if (typeof other === \"string\" && other === this.version) {\n return 0;\n }\n other = new SemVer(other, this.options);\n }\n if (other.version === this.version) {\n return 0;\n }\n return this.compareMain(other) || this.comparePre(other);\n }\n compareMain(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n if (this.major < other.major) {\n return -1;\n }\n if (this.major > other.major) {\n return 1;\n }\n if (this.minor < other.minor) {\n return -1;\n }\n if (this.minor > other.minor) {\n return 1;\n }\n if (this.patch < other.patch) {\n return -1;\n }\n if (this.patch > other.patch) {\n return 1;\n }\n return 0;\n }\n comparePre(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n if (this.prerelease.length && !other.prerelease.length) {\n return -1;\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1;\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0;\n }\n let i2 = 0;\n do {\n const a2 = this.prerelease[i2];\n const b2 = other.prerelease[i2];\n debug(\"prerelease compare\", i2, a2, b2);\n if (a2 === void 0 && b2 === void 0) {\n return 0;\n } else if (b2 === void 0) {\n return 1;\n } else if (a2 === void 0) {\n return -1;\n } else if (a2 === b2) {\n continue;\n } else {\n return compareIdentifiers(a2, b2);\n }\n } while (++i2);\n }\n compareBuild(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n let i2 = 0;\n do {\n const a2 = this.build[i2];\n const b2 = other.build[i2];\n debug(\"build compare\", i2, a2, b2);\n if (a2 === void 0 && b2 === void 0) {\n return 0;\n } else if (b2 === void 0) {\n return 1;\n } else if (a2 === void 0) {\n return -1;\n } else if (a2 === b2) {\n continue;\n } else {\n return compareIdentifiers(a2, b2);\n }\n } while (++i2);\n }\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc(release, identifier, identifierBase) {\n if (release.startsWith(\"pre\")) {\n if (!identifier && identifierBase === false) {\n throw new Error(\"invalid increment argument: identifier is empty\");\n }\n if (identifier) {\n const match = `-${identifier}`.match(this.options.loose ? re2[t2.PRERELEASELOOSE] : re2[t2.PRERELEASE]);\n if (!match || match[1] !== identifier) {\n throw new Error(`invalid identifier: ${identifier}`);\n }\n }\n }\n switch (release) {\n case \"premajor\":\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor = 0;\n this.major++;\n this.inc(\"pre\", identifier, identifierBase);\n break;\n case \"preminor\":\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor++;\n this.inc(\"pre\", identifier, identifierBase);\n break;\n case \"prepatch\":\n this.prerelease.length = 0;\n this.inc(\"patch\", identifier, identifierBase);\n this.inc(\"pre\", identifier, identifierBase);\n break;\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case \"prerelease\":\n if (this.prerelease.length === 0) {\n this.inc(\"patch\", identifier, identifierBase);\n }\n this.inc(\"pre\", identifier, identifierBase);\n break;\n case \"release\":\n if (this.prerelease.length === 0) {\n throw new Error(`version ${this.raw} is not a prerelease`);\n }\n this.prerelease.length = 0;\n break;\n case \"major\":\n if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {\n this.major++;\n }\n this.minor = 0;\n this.patch = 0;\n this.prerelease = [];\n break;\n case \"minor\":\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++;\n }\n this.patch = 0;\n this.prerelease = [];\n break;\n case \"patch\":\n if (this.prerelease.length === 0) {\n this.patch++;\n }\n this.prerelease = [];\n break;\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case \"pre\": {\n const base = Number(identifierBase) ? 1 : 0;\n if (this.prerelease.length === 0) {\n this.prerelease = [base];\n } else {\n let i2 = this.prerelease.length;\n while (--i2 >= 0) {\n if (typeof this.prerelease[i2] === \"number\") {\n this.prerelease[i2]++;\n i2 = -2;\n }\n }\n if (i2 === -1) {\n if (identifier === this.prerelease.join(\".\") && identifierBase === false) {\n throw new Error(\"invalid increment argument: identifier already exists\");\n }\n this.prerelease.push(base);\n }\n }\n if (identifier) {\n let prerelease = [identifier, base];\n if (identifierBase === false) {\n prerelease = [identifier];\n }\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = prerelease;\n }\n } else {\n this.prerelease = prerelease;\n }\n }\n break;\n }\n default:\n throw new Error(`invalid increment argument: ${release}`);\n }\n this.raw = this.format();\n if (this.build.length) {\n this.raw += `+${this.build.join(\".\")}`;\n }\n return this;\n }\n }\n semver = SemVer;\n return semver;\n}\nvar major_1;\nvar hasRequiredMajor;\nfunction requireMajor() {\n if (hasRequiredMajor) return major_1;\n hasRequiredMajor = 1;\n const SemVer = requireSemver();\n const major2 = (a2, loose) => new SemVer(a2, loose).major;\n major_1 = major2;\n return major_1;\n}\nvar majorExports = requireMajor();\nconst major = /* @__PURE__ */ getDefaultExportFromCjs(majorExports);\nvar parse_1;\nvar hasRequiredParse;\nfunction requireParse() {\n if (hasRequiredParse) return parse_1;\n hasRequiredParse = 1;\n const SemVer = requireSemver();\n const parse = (version, options, throwErrors = false) => {\n if (version instanceof SemVer) {\n return version;\n }\n try {\n return new SemVer(version, options);\n } catch (er) {\n if (!throwErrors) {\n return null;\n }\n throw er;\n }\n };\n parse_1 = parse;\n return parse_1;\n}\nvar valid_1;\nvar hasRequiredValid;\nfunction requireValid() {\n if (hasRequiredValid) return valid_1;\n hasRequiredValid = 1;\n const parse = requireParse();\n const valid2 = (version, options) => {\n const v = parse(version, options);\n return v ? v.version : null;\n };\n valid_1 = valid2;\n return valid_1;\n}\nvar validExports = requireValid();\nconst valid = /* @__PURE__ */ getDefaultExportFromCjs(validExports);\n/*!\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\nclass ProxyBus {\n bus;\n constructor(bus2) {\n if (typeof bus2.getVersion !== \"function\" || !valid(bus2.getVersion())) {\n console.warn(\"Proxying an event bus with an unknown or invalid version\");\n } else if (major(bus2.getVersion()) !== major(this.getVersion())) {\n console.warn(\n \"Proxying an event bus of version \" + bus2.getVersion() + \" with \" + this.getVersion()\n );\n }\n this.bus = bus2;\n }\n getVersion() {\n return \"3.3.3\";\n }\n subscribe(name, handler) {\n this.bus.subscribe(name, handler);\n }\n unsubscribe(name, handler) {\n this.bus.unsubscribe(name, handler);\n }\n emit(name, ...event) {\n this.bus.emit(name, ...event);\n }\n}\n/*!\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\nclass SimpleBus {\n handlers = /* @__PURE__ */ new Map();\n getVersion() {\n return \"3.3.3\";\n }\n subscribe(name, handler) {\n this.handlers.set(\n name,\n (this.handlers.get(name) || []).concat(\n handler\n )\n );\n }\n unsubscribe(name, handler) {\n this.handlers.set(\n name,\n (this.handlers.get(name) || []).filter((h2) => h2 !== handler)\n );\n }\n emit(name, ...event) {\n const handlers = this.handlers.get(name) || [];\n handlers.forEach((h2) => {\n try {\n ;\n h2(event[0]);\n } catch (e2) {\n console.error(\"could not invoke event listener\", e2);\n }\n });\n }\n}\n/*!\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\nlet bus = null;\nfunction getBus() {\n if (bus !== null) {\n return bus;\n }\n if (typeof window === \"undefined\") {\n return new Proxy({}, {\n get: () => {\n return () => console.error(\n \"Window not available, EventBus can not be established!\"\n );\n }\n });\n }\n if (window.OC?._eventBus && typeof window._nc_event_bus === \"undefined\") {\n console.warn(\n \"found old event bus instance at OC._eventBus. Update your version!\"\n );\n window._nc_event_bus = window.OC._eventBus;\n }\n if (typeof window?._nc_event_bus !== \"undefined\") {\n bus = new ProxyBus(window._nc_event_bus);\n } else {\n bus = window._nc_event_bus = new SimpleBus();\n }\n return bus;\n}\nfunction emit(name, ...event) {\n getBus().emit(name, ...event);\n}\n/*!\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nclass FileListFilter extends TypedEventTarget {\n id;\n order;\n constructor(id, order = 100) {\n super();\n this.id = id;\n this.order = order;\n }\n filter(nodes) {\n throw new Error(\"Not implemented\");\n }\n updateChips(chips) {\n this.dispatchTypedEvent(\"update:chips\", new CustomEvent(\"update:chips\", { detail: chips }));\n }\n filterUpdated() {\n this.dispatchTypedEvent(\"update:filter\", new CustomEvent(\"update:filter\"));\n }\n}\nfunction registerFileListFilter(filter) {\n if (!window._nc_filelist_filters) {\n window._nc_filelist_filters = /* @__PURE__ */ new Map();\n }\n if (window._nc_filelist_filters.has(filter.id)) {\n throw new Error(`File list filter \"${filter.id}\" already registered`);\n }\n window._nc_filelist_filters.set(filter.id, filter);\n emit(\"files:filter:added\", filter);\n}\nfunction unregisterFileListFilter(filterId) {\n if (window._nc_filelist_filters && window._nc_filelist_filters.has(filterId)) {\n window._nc_filelist_filters.delete(filterId);\n emit(\"files:filter:removed\", filterId);\n }\n}\nfunction getFileListFilters() {\n if (!window._nc_filelist_filters) {\n return [];\n }\n return [...window._nc_filelist_filters.values()];\n}\nclass Header {\n _header;\n constructor(header) {\n this.validateHeader(header);\n this._header = header;\n }\n get id() {\n return this._header.id;\n }\n get order() {\n return this._header.order;\n }\n get enabled() {\n return this._header.enabled;\n }\n get render() {\n return this._header.render;\n }\n get updated() {\n return this._header.updated;\n }\n validateHeader(header) {\n if (!header.id || !header.render || !header.updated) {\n throw new Error(\"Invalid header: id, render and updated are required\");\n }\n if (typeof header.id !== \"string\") {\n throw new Error(\"Invalid id property\");\n }\n if (header.enabled !== void 0 && typeof header.enabled !== \"function\") {\n throw new Error(\"Invalid enabled property\");\n }\n if (header.render && typeof header.render !== \"function\") {\n throw new Error(\"Invalid render property\");\n }\n if (header.updated && typeof header.updated !== \"function\") {\n throw new Error(\"Invalid updated property\");\n }\n }\n}\nconst registerFileListHeaders = function(header) {\n if (typeof window._nc_filelistheader === \"undefined\") {\n window._nc_filelistheader = [];\n logger.debug(\"FileListHeaders initialized\");\n }\n if (window._nc_filelistheader.find((search) => search.id === header.id)) {\n logger.error(`Header ${header.id} already registered`, { header });\n return;\n }\n window._nc_filelistheader.push(header);\n};\nconst getFileListHeaders = function() {\n if (typeof window._nc_filelistheader === \"undefined\") {\n window._nc_filelistheader = [];\n logger.debug(\"FileListHeaders initialized\");\n }\n return window._nc_filelistheader;\n};\nclass Navigation extends TypedEventTarget {\n _views = [];\n _currentView = null;\n /**\n * Register a new view on the navigation\n * @param view The view to register\n * @throws `Error` is thrown if a view with the same id is already registered\n */\n register(view) {\n if (this._views.find((search) => search.id === view.id)) {\n throw new Error(`View id ${view.id} is already registered`);\n }\n this._views.push(view);\n this.dispatchTypedEvent(\"update\", new CustomEvent(\"update\"));\n }\n /**\n * Remove a registered view\n * @param id The id of the view to remove\n */\n remove(id) {\n const index = this._views.findIndex((view) => view.id === id);\n if (index !== -1) {\n this._views.splice(index, 1);\n this.dispatchTypedEvent(\"update\", new CustomEvent(\"update\"));\n }\n }\n /**\n * Set the currently active view\n * @fires UpdateActiveViewEvent\n * @param view New active view\n */\n setActive(view) {\n this._currentView = view;\n const event = new CustomEvent(\"updateActive\", { detail: view });\n this.dispatchTypedEvent(\"updateActive\", event);\n }\n /**\n * The currently active files view\n */\n get active() {\n return this._currentView;\n }\n /**\n * All registered views\n */\n get views() {\n return this._views;\n }\n}\nconst getNavigation = function() {\n if (typeof window._nc_navigation === \"undefined\") {\n window._nc_navigation = new Navigation();\n logger.debug(\"Navigation service initialized\");\n }\n return window._nc_navigation;\n};\nclass Column {\n _column;\n constructor(column) {\n isValidColumn(column);\n this._column = column;\n }\n get id() {\n return this._column.id;\n }\n get title() {\n return this._column.title;\n }\n get render() {\n return this._column.render;\n }\n get sort() {\n return this._column.sort;\n }\n get summary() {\n return this._column.summary;\n }\n}\nconst isValidColumn = function(column) {\n if (!column.id || typeof column.id !== \"string\") {\n throw new Error(\"A column id is required\");\n }\n if (!column.title || typeof column.title !== \"string\") {\n throw new Error(\"A column title is required\");\n }\n if (!column.render || typeof column.render !== \"function\") {\n throw new Error(\"A render function is required\");\n }\n if (column.sort && typeof column.sort !== \"function\") {\n throw new Error(\"Column sortFunction must be a function\");\n }\n if (column.summary && typeof column.summary !== \"function\") {\n throw new Error(\"Column summary must be a function\");\n }\n return true;\n};\nvar sax$1 = {};\nvar hasRequiredSax;\nfunction requireSax() {\n if (hasRequiredSax) return sax$1;\n hasRequiredSax = 1;\n (function(exports) {\n (function(sax2) {\n sax2.parser = function(strict, opt) {\n return new SAXParser(strict, opt);\n };\n sax2.SAXParser = SAXParser;\n sax2.SAXStream = SAXStream;\n sax2.createStream = createStream;\n sax2.MAX_BUFFER_LENGTH = 64 * 1024;\n var buffers = [\n \"comment\",\n \"sgmlDecl\",\n \"textNode\",\n \"tagName\",\n \"doctype\",\n \"procInstName\",\n \"procInstBody\",\n \"entity\",\n \"attribName\",\n \"attribValue\",\n \"cdata\",\n \"script\"\n ];\n sax2.EVENTS = [\n \"text\",\n \"processinginstruction\",\n \"sgmldeclaration\",\n \"doctype\",\n \"comment\",\n \"opentagstart\",\n \"attribute\",\n \"opentag\",\n \"closetag\",\n \"opencdata\",\n \"cdata\",\n \"closecdata\",\n \"error\",\n \"end\",\n \"ready\",\n \"script\",\n \"opennamespace\",\n \"closenamespace\"\n ];\n function SAXParser(strict, opt) {\n if (!(this instanceof SAXParser)) {\n return new SAXParser(strict, opt);\n }\n var parser = this;\n clearBuffers(parser);\n parser.q = parser.c = \"\";\n parser.bufferCheckPosition = sax2.MAX_BUFFER_LENGTH;\n parser.opt = opt || {};\n parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags;\n parser.looseCase = parser.opt.lowercase ? \"toLowerCase\" : \"toUpperCase\";\n parser.tags = [];\n parser.closed = parser.closedRoot = parser.sawRoot = false;\n parser.tag = parser.error = null;\n parser.strict = !!strict;\n parser.noscript = !!(strict || parser.opt.noscript);\n parser.state = S.BEGIN;\n parser.strictEntities = parser.opt.strictEntities;\n parser.ENTITIES = parser.strictEntities ? Object.create(sax2.XML_ENTITIES) : Object.create(sax2.ENTITIES);\n parser.attribList = [];\n if (parser.opt.xmlns) {\n parser.ns = Object.create(rootNS);\n }\n if (parser.opt.unquotedAttributeValues === void 0) {\n parser.opt.unquotedAttributeValues = !strict;\n }\n parser.trackPosition = parser.opt.position !== false;\n if (parser.trackPosition) {\n parser.position = parser.line = parser.column = 0;\n }\n emit2(parser, \"onready\");\n }\n if (!Object.create) {\n Object.create = function(o) {\n function F() {\n }\n F.prototype = o;\n var newf = new F();\n return newf;\n };\n }\n if (!Object.keys) {\n Object.keys = function(o) {\n var a2 = [];\n for (var i2 in o) if (o.hasOwnProperty(i2)) a2.push(i2);\n return a2;\n };\n }\n function checkBufferLength(parser) {\n var maxAllowed = Math.max(sax2.MAX_BUFFER_LENGTH, 10);\n var maxActual = 0;\n for (var i2 = 0, l2 = buffers.length; i2 < l2; i2++) {\n var len = parser[buffers[i2]].length;\n if (len > maxAllowed) {\n switch (buffers[i2]) {\n case \"textNode\":\n closeText(parser);\n break;\n case \"cdata\":\n emitNode(parser, \"oncdata\", parser.cdata);\n parser.cdata = \"\";\n break;\n case \"script\":\n emitNode(parser, \"onscript\", parser.script);\n parser.script = \"\";\n break;\n default:\n error(parser, \"Max buffer length exceeded: \" + buffers[i2]);\n }\n }\n maxActual = Math.max(maxActual, len);\n }\n var m2 = sax2.MAX_BUFFER_LENGTH - maxActual;\n parser.bufferCheckPosition = m2 + parser.position;\n }\n function clearBuffers(parser) {\n for (var i2 = 0, l2 = buffers.length; i2 < l2; i2++) {\n parser[buffers[i2]] = \"\";\n }\n }\n function flushBuffers(parser) {\n closeText(parser);\n if (parser.cdata !== \"\") {\n emitNode(parser, \"oncdata\", parser.cdata);\n parser.cdata = \"\";\n }\n if (parser.script !== \"\") {\n emitNode(parser, \"onscript\", parser.script);\n parser.script = \"\";\n }\n }\n SAXParser.prototype = {\n end: function() {\n end(this);\n },\n write,\n resume: function() {\n this.error = null;\n return this;\n },\n close: function() {\n return this.write(null);\n },\n flush: function() {\n flushBuffers(this);\n }\n };\n var Stream;\n try {\n Stream = require(\"stream\").Stream;\n } catch (ex) {\n Stream = function() {\n };\n }\n if (!Stream) Stream = function() {\n };\n var streamWraps = sax2.EVENTS.filter(function(ev) {\n return ev !== \"error\" && ev !== \"end\";\n });\n function createStream(strict, opt) {\n return new SAXStream(strict, opt);\n }\n function SAXStream(strict, opt) {\n if (!(this instanceof SAXStream)) {\n return new SAXStream(strict, opt);\n }\n Stream.apply(this);\n this._parser = new SAXParser(strict, opt);\n this.writable = true;\n this.readable = true;\n var me = this;\n this._parser.onend = function() {\n me.emit(\"end\");\n };\n this._parser.onerror = function(er) {\n me.emit(\"error\", er);\n me._parser.error = null;\n };\n this._decoder = null;\n streamWraps.forEach(function(ev) {\n Object.defineProperty(me, \"on\" + ev, {\n get: function() {\n return me._parser[\"on\" + ev];\n },\n set: function(h2) {\n if (!h2) {\n me.removeAllListeners(ev);\n me._parser[\"on\" + ev] = h2;\n return h2;\n }\n me.on(ev, h2);\n },\n enumerable: true,\n configurable: false\n });\n });\n }\n SAXStream.prototype = Object.create(Stream.prototype, {\n constructor: {\n value: SAXStream\n }\n });\n SAXStream.prototype.write = function(data) {\n if (typeof Buffer === \"function\" && typeof Buffer.isBuffer === \"function\" && Buffer.isBuffer(data)) {\n if (!this._decoder) {\n var SD = require$$1.StringDecoder;\n this._decoder = new SD(\"utf8\");\n }\n data = this._decoder.write(data);\n }\n this._parser.write(data.toString());\n this.emit(\"data\", data);\n return true;\n };\n SAXStream.prototype.end = function(chunk) {\n if (chunk && chunk.length) {\n this.write(chunk);\n }\n this._parser.end();\n return true;\n };\n SAXStream.prototype.on = function(ev, handler) {\n var me = this;\n if (!me._parser[\"on\" + ev] && streamWraps.indexOf(ev) !== -1) {\n me._parser[\"on\" + ev] = function() {\n var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);\n args.splice(0, 0, ev);\n me.emit.apply(me, args);\n };\n }\n return Stream.prototype.on.call(me, ev, handler);\n };\n var CDATA = \"[CDATA[\";\n var DOCTYPE = \"DOCTYPE\";\n var XML_NAMESPACE = \"http://www.w3.org/XML/1998/namespace\";\n var XMLNS_NAMESPACE = \"http://www.w3.org/2000/xmlns/\";\n var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE };\n var nameStart = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/;\n var nameBody = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/;\n var entityStart = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/;\n var entityBody = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/;\n function isWhitespace(c2) {\n return c2 === \" \" || c2 === \"\\n\" || c2 === \"\\r\" || c2 === \"\t\";\n }\n function isQuote(c2) {\n return c2 === '\"' || c2 === \"'\";\n }\n function isAttribEnd(c2) {\n return c2 === \">\" || isWhitespace(c2);\n }\n function isMatch(regex, c2) {\n return regex.test(c2);\n }\n function notMatch(regex, c2) {\n return !isMatch(regex, c2);\n }\n var S = 0;\n sax2.STATE = {\n BEGIN: S++,\n // leading byte order mark or whitespace\n BEGIN_WHITESPACE: S++,\n // leading whitespace\n TEXT: S++,\n // general stuff\n TEXT_ENTITY: S++,\n // & and such.\n OPEN_WAKA: S++,\n // <\n SGML_DECL: S++,\n // \n SCRIPT: S++,\n // \\n\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `\n.file-list-filter-type {\n\tmax-width: 220px;\n}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files/src/components/FileListFilter/FileListFilterType.vue\"],\"names\":[],\"mappings\":\";AAsHA;CACA,gBAAA;AACA\",\"sourcesContent\":[\"\\n\\n\\n\\n\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `\n.new-node-dialog__form[data-v-04462327] {\n\t/* Ensure the dialog does not jump when there is a validity error */\n\tmin-height: calc(2 * var(--default-clickable-area));\n}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/files/src/components/NewNodeDialog.vue\"],\"names\":[],\"mappings\":\";AAmKA;CACA,mEAAA;CACA,mDAAA;AACA\",\"sourcesContent\":[\"\\n\\n\\n\\n\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","import { o as logger, F as FileType } from \"./chunks/dav-Rt1kTtvI.mjs\";\nimport { q, s, N, t, P, c, l, m, n, a, g, p, b, r, d, h, f, k, j, e, i } from \"./chunks/dav-Rt1kTtvI.mjs\";\nimport { TypedEventTarget } from \"typescript-event-target\";\nimport require$$1 from \"string_decoder\";\nimport { getCapabilities } from \"@nextcloud/capabilities\";\nimport { extname, basename } from \"@nextcloud/paths\";\nimport { getCanonicalLocale, getLanguage } from \"@nextcloud/l10n\";\nvar DefaultType = /* @__PURE__ */ ((DefaultType2) => {\n DefaultType2[\"DEFAULT\"] = \"default\";\n DefaultType2[\"HIDDEN\"] = \"hidden\";\n return DefaultType2;\n})(DefaultType || {});\nclass FileAction {\n _action;\n constructor(action) {\n this.validateAction(action);\n this._action = action;\n }\n get id() {\n return this._action.id;\n }\n get displayName() {\n return this._action.displayName;\n }\n get title() {\n return this._action.title;\n }\n get iconSvgInline() {\n return this._action.iconSvgInline;\n }\n get enabled() {\n return this._action.enabled;\n }\n get exec() {\n return this._action.exec;\n }\n get execBatch() {\n return this._action.execBatch;\n }\n get hotkey() {\n return this._action.hotkey;\n }\n get order() {\n return this._action.order;\n }\n get parent() {\n return this._action.parent;\n }\n get default() {\n return this._action.default;\n }\n get destructive() {\n return this._action.destructive;\n }\n get inline() {\n return this._action.inline;\n }\n get renderInline() {\n return this._action.renderInline;\n }\n validateAction(action) {\n if (!action.id || typeof action.id !== \"string\") {\n throw new Error(\"Invalid id\");\n }\n if (!action.displayName || typeof action.displayName !== \"function\") {\n throw new Error(\"Invalid displayName function\");\n }\n if (\"title\" in action && typeof action.title !== \"function\") {\n throw new Error(\"Invalid title function\");\n }\n if (!action.iconSvgInline || typeof action.iconSvgInline !== \"function\") {\n throw new Error(\"Invalid iconSvgInline function\");\n }\n if (!action.exec || typeof action.exec !== \"function\") {\n throw new Error(\"Invalid exec function\");\n }\n if (\"enabled\" in action && typeof action.enabled !== \"function\") {\n throw new Error(\"Invalid enabled function\");\n }\n if (\"execBatch\" in action && typeof action.execBatch !== \"function\") {\n throw new Error(\"Invalid execBatch function\");\n }\n if (\"order\" in action && typeof action.order !== \"number\") {\n throw new Error(\"Invalid order\");\n }\n if (action.destructive !== void 0 && typeof action.destructive !== \"boolean\") {\n throw new Error(\"Invalid destructive flag\");\n }\n if (\"parent\" in action && typeof action.parent !== \"string\") {\n throw new Error(\"Invalid parent\");\n }\n if (action.default && !Object.values(DefaultType).includes(action.default)) {\n throw new Error(\"Invalid default\");\n }\n if (\"inline\" in action && typeof action.inline !== \"function\") {\n throw new Error(\"Invalid inline function\");\n }\n if (\"renderInline\" in action && typeof action.renderInline !== \"function\") {\n throw new Error(\"Invalid renderInline function\");\n }\n if (\"hotkey\" in action && action.hotkey !== void 0) {\n if (typeof action.hotkey !== \"object\") {\n throw new Error(\"Invalid hotkey configuration\");\n }\n if (typeof action.hotkey.key !== \"string\" || !action.hotkey.key) {\n throw new Error(\"Missing or invalid hotkey key\");\n }\n if (typeof action.hotkey.description !== \"string\" || !action.hotkey.description) {\n throw new Error(\"Missing or invalid hotkey description\");\n }\n }\n }\n}\nconst registerFileAction = function(action) {\n if (typeof window._nc_fileactions === \"undefined\") {\n window._nc_fileactions = [];\n logger.debug(\"FileActions initialized\");\n }\n if (window._nc_fileactions.find((search) => search.id === action.id)) {\n logger.error(`FileAction ${action.id} already registered`, { action });\n return;\n }\n window._nc_fileactions.push(action);\n};\nconst getFileActions = function() {\n if (typeof window._nc_fileactions === \"undefined\") {\n window._nc_fileactions = [];\n logger.debug(\"FileActions initialized\");\n }\n return window._nc_fileactions;\n};\nclass FileListAction {\n _action;\n constructor(action) {\n this.validateAction(action);\n this._action = action;\n }\n get id() {\n return this._action.id;\n }\n get displayName() {\n return this._action.displayName;\n }\n get iconSvgInline() {\n return this._action.iconSvgInline;\n }\n get order() {\n return this._action.order;\n }\n get enabled() {\n return this._action.enabled;\n }\n get exec() {\n return this._action.exec;\n }\n validateAction(action) {\n if (!action.id || typeof action.id !== \"string\") {\n throw new Error(\"Invalid id\");\n }\n if (!action.displayName || typeof action.displayName !== \"function\") {\n throw new Error(\"Invalid displayName function\");\n }\n if (\"iconSvgInline\" in action && typeof action.iconSvgInline !== \"function\") {\n throw new Error(\"Invalid iconSvgInline function\");\n }\n if (\"order\" in action && typeof action.order !== \"number\") {\n throw new Error(\"Invalid order\");\n }\n if (\"enabled\" in action && typeof action.enabled !== \"function\") {\n throw new Error(\"Invalid enabled function\");\n }\n if (!action.exec || typeof action.exec !== \"function\") {\n throw new Error(\"Invalid exec function\");\n }\n }\n}\nconst registerFileListAction = (action) => {\n if (typeof window._nc_filelistactions === \"undefined\") {\n window._nc_filelistactions = [];\n }\n if (window._nc_filelistactions.find((listAction) => listAction.id === action.id)) {\n logger.error(`FileListAction with id \"${action.id}\" is already registered`, { action });\n return;\n }\n window._nc_filelistactions.push(action);\n};\nconst getFileListActions = () => {\n if (typeof window._nc_filelistactions === \"undefined\") {\n window._nc_filelistactions = [];\n }\n return window._nc_filelistactions;\n};\nfunction getDefaultExportFromCjs(x) {\n return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, \"default\") ? x[\"default\"] : x;\n}\nvar debug_1;\nvar hasRequiredDebug;\nfunction requireDebug() {\n if (hasRequiredDebug) return debug_1;\n hasRequiredDebug = 1;\n const debug = typeof process === \"object\" && process.env && process.env.NODE_DEBUG && /\\bsemver\\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error(\"SEMVER\", ...args) : () => {\n };\n debug_1 = debug;\n return debug_1;\n}\nvar constants;\nvar hasRequiredConstants;\nfunction requireConstants() {\n if (hasRequiredConstants) return constants;\n hasRequiredConstants = 1;\n const SEMVER_SPEC_VERSION = \"2.0.0\";\n const MAX_LENGTH = 256;\n const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */\n 9007199254740991;\n const MAX_SAFE_COMPONENT_LENGTH = 16;\n const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;\n const RELEASE_TYPES = [\n \"major\",\n \"premajor\",\n \"minor\",\n \"preminor\",\n \"patch\",\n \"prepatch\",\n \"prerelease\"\n ];\n constants = {\n MAX_LENGTH,\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_SAFE_INTEGER,\n RELEASE_TYPES,\n SEMVER_SPEC_VERSION,\n FLAG_INCLUDE_PRERELEASE: 1,\n FLAG_LOOSE: 2\n };\n return constants;\n}\nvar re = { exports: {} };\nvar hasRequiredRe;\nfunction requireRe() {\n if (hasRequiredRe) return re.exports;\n hasRequiredRe = 1;\n (function(module, exports) {\n const {\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_LENGTH\n } = requireConstants();\n const debug = requireDebug();\n exports = module.exports = {};\n const re2 = exports.re = [];\n const safeRe = exports.safeRe = [];\n const src = exports.src = [];\n const safeSrc = exports.safeSrc = [];\n const t2 = exports.t = {};\n let R = 0;\n const LETTERDASHNUMBER = \"[a-zA-Z0-9-]\";\n const safeRegexReplacements = [\n [\"\\\\s\", 1],\n [\"\\\\d\", MAX_LENGTH],\n [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]\n ];\n const makeSafeRegex = (value) => {\n for (const [token, max] of safeRegexReplacements) {\n value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);\n }\n return value;\n };\n const createToken = (name, value, isGlobal) => {\n const safe = makeSafeRegex(value);\n const index = R++;\n debug(name, index, value);\n t2[name] = index;\n src[index] = value;\n safeSrc[index] = safe;\n re2[index] = new RegExp(value, isGlobal ? \"g\" : void 0);\n safeRe[index] = new RegExp(safe, isGlobal ? \"g\" : void 0);\n };\n createToken(\"NUMERICIDENTIFIER\", \"0|[1-9]\\\\d*\");\n createToken(\"NUMERICIDENTIFIERLOOSE\", \"\\\\d+\");\n createToken(\"NONNUMERICIDENTIFIER\", `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);\n createToken(\"MAINVERSION\", `(${src[t2.NUMERICIDENTIFIER]})\\\\.(${src[t2.NUMERICIDENTIFIER]})\\\\.(${src[t2.NUMERICIDENTIFIER]})`);\n createToken(\"MAINVERSIONLOOSE\", `(${src[t2.NUMERICIDENTIFIERLOOSE]})\\\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})\\\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})`);\n createToken(\"PRERELEASEIDENTIFIER\", `(?:${src[t2.NONNUMERICIDENTIFIER]}|${src[t2.NUMERICIDENTIFIER]})`);\n createToken(\"PRERELEASEIDENTIFIERLOOSE\", `(?:${src[t2.NONNUMERICIDENTIFIER]}|${src[t2.NUMERICIDENTIFIERLOOSE]})`);\n createToken(\"PRERELEASE\", `(?:-(${src[t2.PRERELEASEIDENTIFIER]}(?:\\\\.${src[t2.PRERELEASEIDENTIFIER]})*))`);\n createToken(\"PRERELEASELOOSE\", `(?:-?(${src[t2.PRERELEASEIDENTIFIERLOOSE]}(?:\\\\.${src[t2.PRERELEASEIDENTIFIERLOOSE]})*))`);\n createToken(\"BUILDIDENTIFIER\", `${LETTERDASHNUMBER}+`);\n createToken(\"BUILD\", `(?:\\\\+(${src[t2.BUILDIDENTIFIER]}(?:\\\\.${src[t2.BUILDIDENTIFIER]})*))`);\n createToken(\"FULLPLAIN\", `v?${src[t2.MAINVERSION]}${src[t2.PRERELEASE]}?${src[t2.BUILD]}?`);\n createToken(\"FULL\", `^${src[t2.FULLPLAIN]}$`);\n createToken(\"LOOSEPLAIN\", `[v=\\\\s]*${src[t2.MAINVERSIONLOOSE]}${src[t2.PRERELEASELOOSE]}?${src[t2.BUILD]}?`);\n createToken(\"LOOSE\", `^${src[t2.LOOSEPLAIN]}$`);\n createToken(\"GTLT\", \"((?:<|>)?=?)\");\n createToken(\"XRANGEIDENTIFIERLOOSE\", `${src[t2.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`);\n createToken(\"XRANGEIDENTIFIER\", `${src[t2.NUMERICIDENTIFIER]}|x|X|\\\\*`);\n createToken(\"XRANGEPLAIN\", `[v=\\\\s]*(${src[t2.XRANGEIDENTIFIER]})(?:\\\\.(${src[t2.XRANGEIDENTIFIER]})(?:\\\\.(${src[t2.XRANGEIDENTIFIER]})(?:${src[t2.PRERELEASE]})?${src[t2.BUILD]}?)?)?`);\n createToken(\"XRANGEPLAINLOOSE\", `[v=\\\\s]*(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:${src[t2.PRERELEASELOOSE]})?${src[t2.BUILD]}?)?)?`);\n createToken(\"XRANGE\", `^${src[t2.GTLT]}\\\\s*${src[t2.XRANGEPLAIN]}$`);\n createToken(\"XRANGELOOSE\", `^${src[t2.GTLT]}\\\\s*${src[t2.XRANGEPLAINLOOSE]}$`);\n createToken(\"COERCEPLAIN\", `${\"(^|[^\\\\d])(\\\\d{1,\"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);\n createToken(\"COERCE\", `${src[t2.COERCEPLAIN]}(?:$|[^\\\\d])`);\n createToken(\"COERCEFULL\", src[t2.COERCEPLAIN] + `(?:${src[t2.PRERELEASE]})?(?:${src[t2.BUILD]})?(?:$|[^\\\\d])`);\n createToken(\"COERCERTL\", src[t2.COERCE], true);\n createToken(\"COERCERTLFULL\", src[t2.COERCEFULL], true);\n createToken(\"LONETILDE\", \"(?:~>?)\");\n createToken(\"TILDETRIM\", `(\\\\s*)${src[t2.LONETILDE]}\\\\s+`, true);\n exports.tildeTrimReplace = \"$1~\";\n createToken(\"TILDE\", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAIN]}$`);\n createToken(\"TILDELOOSE\", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAINLOOSE]}$`);\n createToken(\"LONECARET\", \"(?:\\\\^)\");\n createToken(\"CARETTRIM\", `(\\\\s*)${src[t2.LONECARET]}\\\\s+`, true);\n exports.caretTrimReplace = \"$1^\";\n createToken(\"CARET\", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAIN]}$`);\n createToken(\"CARETLOOSE\", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAINLOOSE]}$`);\n createToken(\"COMPARATORLOOSE\", `^${src[t2.GTLT]}\\\\s*(${src[t2.LOOSEPLAIN]})$|^$`);\n createToken(\"COMPARATOR\", `^${src[t2.GTLT]}\\\\s*(${src[t2.FULLPLAIN]})$|^$`);\n createToken(\"COMPARATORTRIM\", `(\\\\s*)${src[t2.GTLT]}\\\\s*(${src[t2.LOOSEPLAIN]}|${src[t2.XRANGEPLAIN]})`, true);\n exports.comparatorTrimReplace = \"$1$2$3\";\n createToken(\"HYPHENRANGE\", `^\\\\s*(${src[t2.XRANGEPLAIN]})\\\\s+-\\\\s+(${src[t2.XRANGEPLAIN]})\\\\s*$`);\n createToken(\"HYPHENRANGELOOSE\", `^\\\\s*(${src[t2.XRANGEPLAINLOOSE]})\\\\s+-\\\\s+(${src[t2.XRANGEPLAINLOOSE]})\\\\s*$`);\n createToken(\"STAR\", \"(<|>)?=?\\\\s*\\\\*\");\n createToken(\"GTE0\", \"^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$\");\n createToken(\"GTE0PRE\", \"^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$\");\n })(re, re.exports);\n return re.exports;\n}\nvar parseOptions_1;\nvar hasRequiredParseOptions;\nfunction requireParseOptions() {\n if (hasRequiredParseOptions) return parseOptions_1;\n hasRequiredParseOptions = 1;\n const looseOption = Object.freeze({ loose: true });\n const emptyOpts = Object.freeze({});\n const parseOptions = (options) => {\n if (!options) {\n return emptyOpts;\n }\n if (typeof options !== \"object\") {\n return looseOption;\n }\n return options;\n };\n parseOptions_1 = parseOptions;\n return parseOptions_1;\n}\nvar identifiers;\nvar hasRequiredIdentifiers;\nfunction requireIdentifiers() {\n if (hasRequiredIdentifiers) return identifiers;\n hasRequiredIdentifiers = 1;\n const numeric = /^[0-9]+$/;\n const compareIdentifiers = (a2, b2) => {\n if (typeof a2 === \"number\" && typeof b2 === \"number\") {\n return a2 === b2 ? 0 : a2 < b2 ? -1 : 1;\n }\n const anum = numeric.test(a2);\n const bnum = numeric.test(b2);\n if (anum && bnum) {\n a2 = +a2;\n b2 = +b2;\n }\n return a2 === b2 ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a2 < b2 ? -1 : 1;\n };\n const rcompareIdentifiers = (a2, b2) => compareIdentifiers(b2, a2);\n identifiers = {\n compareIdentifiers,\n rcompareIdentifiers\n };\n return identifiers;\n}\nvar semver;\nvar hasRequiredSemver;\nfunction requireSemver() {\n if (hasRequiredSemver) return semver;\n hasRequiredSemver = 1;\n const debug = requireDebug();\n const { MAX_LENGTH, MAX_SAFE_INTEGER } = requireConstants();\n const { safeRe: re2, t: t2 } = requireRe();\n const parseOptions = requireParseOptions();\n const { compareIdentifiers } = requireIdentifiers();\n class SemVer {\n constructor(version, options) {\n options = parseOptions(options);\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {\n return version;\n } else {\n version = version.version;\n }\n } else if (typeof version !== \"string\") {\n throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`);\n }\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n );\n }\n debug(\"SemVer\", version, options);\n this.options = options;\n this.loose = !!options.loose;\n this.includePrerelease = !!options.includePrerelease;\n const m2 = version.trim().match(options.loose ? re2[t2.LOOSE] : re2[t2.FULL]);\n if (!m2) {\n throw new TypeError(`Invalid Version: ${version}`);\n }\n this.raw = version;\n this.major = +m2[1];\n this.minor = +m2[2];\n this.patch = +m2[3];\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError(\"Invalid major version\");\n }\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError(\"Invalid minor version\");\n }\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError(\"Invalid patch version\");\n }\n if (!m2[4]) {\n this.prerelease = [];\n } else {\n this.prerelease = m2[4].split(\".\").map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id;\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num;\n }\n }\n return id;\n });\n }\n this.build = m2[5] ? m2[5].split(\".\") : [];\n this.format();\n }\n format() {\n this.version = `${this.major}.${this.minor}.${this.patch}`;\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join(\".\")}`;\n }\n return this.version;\n }\n toString() {\n return this.version;\n }\n compare(other) {\n debug(\"SemVer.compare\", this.version, this.options, other);\n if (!(other instanceof SemVer)) {\n if (typeof other === \"string\" && other === this.version) {\n return 0;\n }\n other = new SemVer(other, this.options);\n }\n if (other.version === this.version) {\n return 0;\n }\n return this.compareMain(other) || this.comparePre(other);\n }\n compareMain(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n if (this.major < other.major) {\n return -1;\n }\n if (this.major > other.major) {\n return 1;\n }\n if (this.minor < other.minor) {\n return -1;\n }\n if (this.minor > other.minor) {\n return 1;\n }\n if (this.patch < other.patch) {\n return -1;\n }\n if (this.patch > other.patch) {\n return 1;\n }\n return 0;\n }\n comparePre(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n if (this.prerelease.length && !other.prerelease.length) {\n return -1;\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1;\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0;\n }\n let i2 = 0;\n do {\n const a2 = this.prerelease[i2];\n const b2 = other.prerelease[i2];\n debug(\"prerelease compare\", i2, a2, b2);\n if (a2 === void 0 && b2 === void 0) {\n return 0;\n } else if (b2 === void 0) {\n return 1;\n } else if (a2 === void 0) {\n return -1;\n } else if (a2 === b2) {\n continue;\n } else {\n return compareIdentifiers(a2, b2);\n }\n } while (++i2);\n }\n compareBuild(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n let i2 = 0;\n do {\n const a2 = this.build[i2];\n const b2 = other.build[i2];\n debug(\"build compare\", i2, a2, b2);\n if (a2 === void 0 && b2 === void 0) {\n return 0;\n } else if (b2 === void 0) {\n return 1;\n } else if (a2 === void 0) {\n return -1;\n } else if (a2 === b2) {\n continue;\n } else {\n return compareIdentifiers(a2, b2);\n }\n } while (++i2);\n }\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc(release, identifier, identifierBase) {\n if (release.startsWith(\"pre\")) {\n if (!identifier && identifierBase === false) {\n throw new Error(\"invalid increment argument: identifier is empty\");\n }\n if (identifier) {\n const match = `-${identifier}`.match(this.options.loose ? re2[t2.PRERELEASELOOSE] : re2[t2.PRERELEASE]);\n if (!match || match[1] !== identifier) {\n throw new Error(`invalid identifier: ${identifier}`);\n }\n }\n }\n switch (release) {\n case \"premajor\":\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor = 0;\n this.major++;\n this.inc(\"pre\", identifier, identifierBase);\n break;\n case \"preminor\":\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor++;\n this.inc(\"pre\", identifier, identifierBase);\n break;\n case \"prepatch\":\n this.prerelease.length = 0;\n this.inc(\"patch\", identifier, identifierBase);\n this.inc(\"pre\", identifier, identifierBase);\n break;\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case \"prerelease\":\n if (this.prerelease.length === 0) {\n this.inc(\"patch\", identifier, identifierBase);\n }\n this.inc(\"pre\", identifier, identifierBase);\n break;\n case \"release\":\n if (this.prerelease.length === 0) {\n throw new Error(`version ${this.raw} is not a prerelease`);\n }\n this.prerelease.length = 0;\n break;\n case \"major\":\n if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {\n this.major++;\n }\n this.minor = 0;\n this.patch = 0;\n this.prerelease = [];\n break;\n case \"minor\":\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++;\n }\n this.patch = 0;\n this.prerelease = [];\n break;\n case \"patch\":\n if (this.prerelease.length === 0) {\n this.patch++;\n }\n this.prerelease = [];\n break;\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case \"pre\": {\n const base = Number(identifierBase) ? 1 : 0;\n if (this.prerelease.length === 0) {\n this.prerelease = [base];\n } else {\n let i2 = this.prerelease.length;\n while (--i2 >= 0) {\n if (typeof this.prerelease[i2] === \"number\") {\n this.prerelease[i2]++;\n i2 = -2;\n }\n }\n if (i2 === -1) {\n if (identifier === this.prerelease.join(\".\") && identifierBase === false) {\n throw new Error(\"invalid increment argument: identifier already exists\");\n }\n this.prerelease.push(base);\n }\n }\n if (identifier) {\n let prerelease = [identifier, base];\n if (identifierBase === false) {\n prerelease = [identifier];\n }\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = prerelease;\n }\n } else {\n this.prerelease = prerelease;\n }\n }\n break;\n }\n default:\n throw new Error(`invalid increment argument: ${release}`);\n }\n this.raw = this.format();\n if (this.build.length) {\n this.raw += `+${this.build.join(\".\")}`;\n }\n return this;\n }\n }\n semver = SemVer;\n return semver;\n}\nvar major_1;\nvar hasRequiredMajor;\nfunction requireMajor() {\n if (hasRequiredMajor) return major_1;\n hasRequiredMajor = 1;\n const SemVer = requireSemver();\n const major2 = (a2, loose) => new SemVer(a2, loose).major;\n major_1 = major2;\n return major_1;\n}\nvar majorExports = requireMajor();\nconst major = /* @__PURE__ */ getDefaultExportFromCjs(majorExports);\nvar parse_1;\nvar hasRequiredParse;\nfunction requireParse() {\n if (hasRequiredParse) return parse_1;\n hasRequiredParse = 1;\n const SemVer = requireSemver();\n const parse = (version, options, throwErrors = false) => {\n if (version instanceof SemVer) {\n return version;\n }\n try {\n return new SemVer(version, options);\n } catch (er) {\n if (!throwErrors) {\n return null;\n }\n throw er;\n }\n };\n parse_1 = parse;\n return parse_1;\n}\nvar valid_1;\nvar hasRequiredValid;\nfunction requireValid() {\n if (hasRequiredValid) return valid_1;\n hasRequiredValid = 1;\n const parse = requireParse();\n const valid2 = (version, options) => {\n const v = parse(version, options);\n return v ? v.version : null;\n };\n valid_1 = valid2;\n return valid_1;\n}\nvar validExports = requireValid();\nconst valid = /* @__PURE__ */ getDefaultExportFromCjs(validExports);\n/*!\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\nclass ProxyBus {\n bus;\n constructor(bus2) {\n if (typeof bus2.getVersion !== \"function\" || !valid(bus2.getVersion())) {\n console.warn(\"Proxying an event bus with an unknown or invalid version\");\n } else if (major(bus2.getVersion()) !== major(this.getVersion())) {\n console.warn(\n \"Proxying an event bus of version \" + bus2.getVersion() + \" with \" + this.getVersion()\n );\n }\n this.bus = bus2;\n }\n getVersion() {\n return \"3.3.3\";\n }\n subscribe(name, handler) {\n this.bus.subscribe(name, handler);\n }\n unsubscribe(name, handler) {\n this.bus.unsubscribe(name, handler);\n }\n emit(name, ...event) {\n this.bus.emit(name, ...event);\n }\n}\n/*!\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\nclass SimpleBus {\n handlers = /* @__PURE__ */ new Map();\n getVersion() {\n return \"3.3.3\";\n }\n subscribe(name, handler) {\n this.handlers.set(\n name,\n (this.handlers.get(name) || []).concat(\n handler\n )\n );\n }\n unsubscribe(name, handler) {\n this.handlers.set(\n name,\n (this.handlers.get(name) || []).filter((h2) => h2 !== handler)\n );\n }\n emit(name, ...event) {\n const handlers = this.handlers.get(name) || [];\n handlers.forEach((h2) => {\n try {\n ;\n h2(event[0]);\n } catch (e2) {\n console.error(\"could not invoke event listener\", e2);\n }\n });\n }\n}\n/*!\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\nlet bus = null;\nfunction getBus() {\n if (bus !== null) {\n return bus;\n }\n if (typeof window === \"undefined\") {\n return new Proxy({}, {\n get: () => {\n return () => console.error(\n \"Window not available, EventBus can not be established!\"\n );\n }\n });\n }\n if (window.OC?._eventBus && typeof window._nc_event_bus === \"undefined\") {\n console.warn(\n \"found old event bus instance at OC._eventBus. Update your version!\"\n );\n window._nc_event_bus = window.OC._eventBus;\n }\n if (typeof window?._nc_event_bus !== \"undefined\") {\n bus = new ProxyBus(window._nc_event_bus);\n } else {\n bus = window._nc_event_bus = new SimpleBus();\n }\n return bus;\n}\nfunction emit(name, ...event) {\n getBus().emit(name, ...event);\n}\n/*!\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nclass FileListFilter extends TypedEventTarget {\n id;\n order;\n constructor(id, order = 100) {\n super();\n this.id = id;\n this.order = order;\n }\n filter(nodes) {\n throw new Error(\"Not implemented\");\n }\n updateChips(chips) {\n this.dispatchTypedEvent(\"update:chips\", new CustomEvent(\"update:chips\", { detail: chips }));\n }\n filterUpdated() {\n this.dispatchTypedEvent(\"update:filter\", new CustomEvent(\"update:filter\"));\n }\n}\nfunction registerFileListFilter(filter) {\n if (!window._nc_filelist_filters) {\n window._nc_filelist_filters = /* @__PURE__ */ new Map();\n }\n if (window._nc_filelist_filters.has(filter.id)) {\n throw new Error(`File list filter \"${filter.id}\" already registered`);\n }\n window._nc_filelist_filters.set(filter.id, filter);\n emit(\"files:filter:added\", filter);\n}\nfunction unregisterFileListFilter(filterId) {\n if (window._nc_filelist_filters && window._nc_filelist_filters.has(filterId)) {\n window._nc_filelist_filters.delete(filterId);\n emit(\"files:filter:removed\", filterId);\n }\n}\nfunction getFileListFilters() {\n if (!window._nc_filelist_filters) {\n return [];\n }\n return [...window._nc_filelist_filters.values()];\n}\nclass Header {\n _header;\n constructor(header) {\n this.validateHeader(header);\n this._header = header;\n }\n get id() {\n return this._header.id;\n }\n get order() {\n return this._header.order;\n }\n get enabled() {\n return this._header.enabled;\n }\n get render() {\n return this._header.render;\n }\n get updated() {\n return this._header.updated;\n }\n validateHeader(header) {\n if (!header.id || !header.render || !header.updated) {\n throw new Error(\"Invalid header: id, render and updated are required\");\n }\n if (typeof header.id !== \"string\") {\n throw new Error(\"Invalid id property\");\n }\n if (header.enabled !== void 0 && typeof header.enabled !== \"function\") {\n throw new Error(\"Invalid enabled property\");\n }\n if (header.render && typeof header.render !== \"function\") {\n throw new Error(\"Invalid render property\");\n }\n if (header.updated && typeof header.updated !== \"function\") {\n throw new Error(\"Invalid updated property\");\n }\n }\n}\nconst registerFileListHeaders = function(header) {\n if (typeof window._nc_filelistheader === \"undefined\") {\n window._nc_filelistheader = [];\n logger.debug(\"FileListHeaders initialized\");\n }\n if (window._nc_filelistheader.find((search) => search.id === header.id)) {\n logger.error(`Header ${header.id} already registered`, { header });\n return;\n }\n window._nc_filelistheader.push(header);\n};\nconst getFileListHeaders = function() {\n if (typeof window._nc_filelistheader === \"undefined\") {\n window._nc_filelistheader = [];\n logger.debug(\"FileListHeaders initialized\");\n }\n return window._nc_filelistheader;\n};\nclass Navigation extends TypedEventTarget {\n _views = [];\n _currentView = null;\n /**\n * Register a new view on the navigation\n * @param view The view to register\n * @throws `Error` is thrown if a view with the same id is already registered\n */\n register(view) {\n if (this._views.find((search) => search.id === view.id)) {\n throw new Error(`View id ${view.id} is already registered`);\n }\n this._views.push(view);\n this.dispatchTypedEvent(\"update\", new CustomEvent(\"update\"));\n }\n /**\n * Remove a registered view\n * @param id The id of the view to remove\n */\n remove(id) {\n const index = this._views.findIndex((view) => view.id === id);\n if (index !== -1) {\n this._views.splice(index, 1);\n this.dispatchTypedEvent(\"update\", new CustomEvent(\"update\"));\n }\n }\n /**\n * Set the currently active view\n * @fires UpdateActiveViewEvent\n * @param view New active view\n */\n setActive(view) {\n this._currentView = view;\n const event = new CustomEvent(\"updateActive\", { detail: view });\n this.dispatchTypedEvent(\"updateActive\", event);\n }\n /**\n * The currently active files view\n */\n get active() {\n return this._currentView;\n }\n /**\n * All registered views\n */\n get views() {\n return this._views;\n }\n}\nconst getNavigation = function() {\n if (typeof window._nc_navigation === \"undefined\") {\n window._nc_navigation = new Navigation();\n logger.debug(\"Navigation service initialized\");\n }\n return window._nc_navigation;\n};\nclass Column {\n _column;\n constructor(column) {\n isValidColumn(column);\n this._column = column;\n }\n get id() {\n return this._column.id;\n }\n get title() {\n return this._column.title;\n }\n get render() {\n return this._column.render;\n }\n get sort() {\n return this._column.sort;\n }\n get summary() {\n return this._column.summary;\n }\n}\nconst isValidColumn = function(column) {\n if (!column.id || typeof column.id !== \"string\") {\n throw new Error(\"A column id is required\");\n }\n if (!column.title || typeof column.title !== \"string\") {\n throw new Error(\"A column title is required\");\n }\n if (!column.render || typeof column.render !== \"function\") {\n throw new Error(\"A render function is required\");\n }\n if (column.sort && typeof column.sort !== \"function\") {\n throw new Error(\"Column sortFunction must be a function\");\n }\n if (column.summary && typeof column.summary !== \"function\") {\n throw new Error(\"Column summary must be a function\");\n }\n return true;\n};\nvar sax$1 = {};\nvar hasRequiredSax;\nfunction requireSax() {\n if (hasRequiredSax) return sax$1;\n hasRequiredSax = 1;\n (function(exports) {\n (function(sax2) {\n sax2.parser = function(strict, opt) {\n return new SAXParser(strict, opt);\n };\n sax2.SAXParser = SAXParser;\n sax2.SAXStream = SAXStream;\n sax2.createStream = createStream;\n sax2.MAX_BUFFER_LENGTH = 64 * 1024;\n var buffers = [\n \"comment\",\n \"sgmlDecl\",\n \"textNode\",\n \"tagName\",\n \"doctype\",\n \"procInstName\",\n \"procInstBody\",\n \"entity\",\n \"attribName\",\n \"attribValue\",\n \"cdata\",\n \"script\"\n ];\n sax2.EVENTS = [\n \"text\",\n \"processinginstruction\",\n \"sgmldeclaration\",\n \"doctype\",\n \"comment\",\n \"opentagstart\",\n \"attribute\",\n \"opentag\",\n \"closetag\",\n \"opencdata\",\n \"cdata\",\n \"closecdata\",\n \"error\",\n \"end\",\n \"ready\",\n \"script\",\n \"opennamespace\",\n \"closenamespace\"\n ];\n function SAXParser(strict, opt) {\n if (!(this instanceof SAXParser)) {\n return new SAXParser(strict, opt);\n }\n var parser = this;\n clearBuffers(parser);\n parser.q = parser.c = \"\";\n parser.bufferCheckPosition = sax2.MAX_BUFFER_LENGTH;\n parser.opt = opt || {};\n parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags;\n parser.looseCase = parser.opt.lowercase ? \"toLowerCase\" : \"toUpperCase\";\n parser.tags = [];\n parser.closed = parser.closedRoot = parser.sawRoot = false;\n parser.tag = parser.error = null;\n parser.strict = !!strict;\n parser.noscript = !!(strict || parser.opt.noscript);\n parser.state = S.BEGIN;\n parser.strictEntities = parser.opt.strictEntities;\n parser.ENTITIES = parser.strictEntities ? Object.create(sax2.XML_ENTITIES) : Object.create(sax2.ENTITIES);\n parser.attribList = [];\n if (parser.opt.xmlns) {\n parser.ns = Object.create(rootNS);\n }\n if (parser.opt.unquotedAttributeValues === void 0) {\n parser.opt.unquotedAttributeValues = !strict;\n }\n parser.trackPosition = parser.opt.position !== false;\n if (parser.trackPosition) {\n parser.position = parser.line = parser.column = 0;\n }\n emit2(parser, \"onready\");\n }\n if (!Object.create) {\n Object.create = function(o) {\n function F() {\n }\n F.prototype = o;\n var newf = new F();\n return newf;\n };\n }\n if (!Object.keys) {\n Object.keys = function(o) {\n var a2 = [];\n for (var i2 in o) if (o.hasOwnProperty(i2)) a2.push(i2);\n return a2;\n };\n }\n function checkBufferLength(parser) {\n var maxAllowed = Math.max(sax2.MAX_BUFFER_LENGTH, 10);\n var maxActual = 0;\n for (var i2 = 0, l2 = buffers.length; i2 < l2; i2++) {\n var len = parser[buffers[i2]].length;\n if (len > maxAllowed) {\n switch (buffers[i2]) {\n case \"textNode\":\n closeText(parser);\n break;\n case \"cdata\":\n emitNode(parser, \"oncdata\", parser.cdata);\n parser.cdata = \"\";\n break;\n case \"script\":\n emitNode(parser, \"onscript\", parser.script);\n parser.script = \"\";\n break;\n default:\n error(parser, \"Max buffer length exceeded: \" + buffers[i2]);\n }\n }\n maxActual = Math.max(maxActual, len);\n }\n var m2 = sax2.MAX_BUFFER_LENGTH - maxActual;\n parser.bufferCheckPosition = m2 + parser.position;\n }\n function clearBuffers(parser) {\n for (var i2 = 0, l2 = buffers.length; i2 < l2; i2++) {\n parser[buffers[i2]] = \"\";\n }\n }\n function flushBuffers(parser) {\n closeText(parser);\n if (parser.cdata !== \"\") {\n emitNode(parser, \"oncdata\", parser.cdata);\n parser.cdata = \"\";\n }\n if (parser.script !== \"\") {\n emitNode(parser, \"onscript\", parser.script);\n parser.script = \"\";\n }\n }\n SAXParser.prototype = {\n end: function() {\n end(this);\n },\n write,\n resume: function() {\n this.error = null;\n return this;\n },\n close: function() {\n return this.write(null);\n },\n flush: function() {\n flushBuffers(this);\n }\n };\n var Stream;\n try {\n Stream = require(\"stream\").Stream;\n } catch (ex) {\n Stream = function() {\n };\n }\n if (!Stream) Stream = function() {\n };\n var streamWraps = sax2.EVENTS.filter(function(ev) {\n return ev !== \"error\" && ev !== \"end\";\n });\n function createStream(strict, opt) {\n return new SAXStream(strict, opt);\n }\n function SAXStream(strict, opt) {\n if (!(this instanceof SAXStream)) {\n return new SAXStream(strict, opt);\n }\n Stream.apply(this);\n this._parser = new SAXParser(strict, opt);\n this.writable = true;\n this.readable = true;\n var me = this;\n this._parser.onend = function() {\n me.emit(\"end\");\n };\n this._parser.onerror = function(er) {\n me.emit(\"error\", er);\n me._parser.error = null;\n };\n this._decoder = null;\n streamWraps.forEach(function(ev) {\n Object.defineProperty(me, \"on\" + ev, {\n get: function() {\n return me._parser[\"on\" + ev];\n },\n set: function(h2) {\n if (!h2) {\n me.removeAllListeners(ev);\n me._parser[\"on\" + ev] = h2;\n return h2;\n }\n me.on(ev, h2);\n },\n enumerable: true,\n configurable: false\n });\n });\n }\n SAXStream.prototype = Object.create(Stream.prototype, {\n constructor: {\n value: SAXStream\n }\n });\n SAXStream.prototype.write = function(data) {\n if (typeof Buffer === \"function\" && typeof Buffer.isBuffer === \"function\" && Buffer.isBuffer(data)) {\n if (!this._decoder) {\n var SD = require$$1.StringDecoder;\n this._decoder = new SD(\"utf8\");\n }\n data = this._decoder.write(data);\n }\n this._parser.write(data.toString());\n this.emit(\"data\", data);\n return true;\n };\n SAXStream.prototype.end = function(chunk) {\n if (chunk && chunk.length) {\n this.write(chunk);\n }\n this._parser.end();\n return true;\n };\n SAXStream.prototype.on = function(ev, handler) {\n var me = this;\n if (!me._parser[\"on\" + ev] && streamWraps.indexOf(ev) !== -1) {\n me._parser[\"on\" + ev] = function() {\n var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);\n args.splice(0, 0, ev);\n me.emit.apply(me, args);\n };\n }\n return Stream.prototype.on.call(me, ev, handler);\n };\n var CDATA = \"[CDATA[\";\n var DOCTYPE = \"DOCTYPE\";\n var XML_NAMESPACE = \"http://www.w3.org/XML/1998/namespace\";\n var XMLNS_NAMESPACE = \"http://www.w3.org/2000/xmlns/\";\n var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE };\n var nameStart = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/;\n var nameBody = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/;\n var entityStart = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/;\n var entityBody = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/;\n function isWhitespace(c2) {\n return c2 === \" \" || c2 === \"\\n\" || c2 === \"\\r\" || c2 === \"\t\";\n }\n function isQuote(c2) {\n return c2 === '\"' || c2 === \"'\";\n }\n function isAttribEnd(c2) {\n return c2 === \">\" || isWhitespace(c2);\n }\n function isMatch(regex, c2) {\n return regex.test(c2);\n }\n function notMatch(regex, c2) {\n return !isMatch(regex, c2);\n }\n var S = 0;\n sax2.STATE = {\n BEGIN: S++,\n // leading byte order mark or whitespace\n BEGIN_WHITESPACE: S++,\n // leading whitespace\n TEXT: S++,\n // general stuff\n TEXT_ENTITY: S++,\n // & and such.\n OPEN_WAKA: S++,\n // <\n SGML_DECL: S++,\n // \n SCRIPT: S++,\n //