You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

systemtags-init.js.map 30KB

1
  1. {"version":3,"file":"systemtags-init.js?v=31f94d4d792dcd1c5054","mappings":"UAAIA,E,6LCWAC,EAAU,CAAC,EAEfA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IAElBF,EAAQG,OAAS,SAAc,KAAM,QAE3CH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKJ,KAAW,IAAQM,QAAS,IAAQA,OAAnD,MCnBDC,EAAoB,SAAUC,GAAM,IAAAC,EACtC,MAAMC,EAAsB,QAAlBD,EAAGD,EAAKG,kBAAU,IAAAF,GAAiB,QAAjBA,EAAfA,EAAkB,sBAAc,IAAAA,OAAA,EAAhCA,EAAmC,cAChD,YAAaG,IAATF,EACO,GAEJ,CAACA,GAAMG,MAClB,EACMC,EAAY,SAAUC,GAAqB,IAAhBC,EAAMC,UAAAC,OAAA,QAAAN,IAAAK,UAAA,IAAAA,UAAA,GACnC,MAAME,EAAaC,SAASC,cAAc,MAM1C,OALAF,EAAWG,UAAUC,IAAI,0BACzBJ,EAAWK,YAAcT,EACrBC,GACAG,EAAWG,UAAUC,IAAI,gCAEtBJ,CACX,EACaM,EAAS,IAAIC,EAAAA,GAAW,CACjCC,GAAI,cACJC,YAAaA,IAAM,GACnBC,cAAeA,IAAM,GACrBC,OAAAA,CAAQC,GAEJ,GAAqB,IAAjBA,EAAMb,OACN,OAAO,EAEX,MAAMV,EAAOuB,EAAM,GAGnB,OAAoB,IAFPxB,EAAkBC,GAEtBU,MAIb,EACAc,KAAMC,SAAY,KAClB,kBAAMC,CAAa1B,GAEf,MAAME,EAAOH,EAAkBC,GAC/B,GAAoB,IAAhBE,EAAKQ,OACL,OAAO,KAEX,MAAMiB,EAAoBf,SAASC,cAAc,MAEjD,GADAc,EAAkBb,UAAUC,IAAI,2BACZ,IAAhBb,EAAKQ,OACLiB,EAAkBC,aAAa,cAA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AK,KAAMF,EAAmBhE,KAAKkE,KAAKF,G,KClDvF7D,EAAoBgE,QAAKlL,ECGzB,IAAImL,EAAsBjE,EAAoBQ,OAAE1H,EAAW,CAAC,OAAO,IAAOkH,EAAoB,SAC9FiE,EAAsBjE,EAAoBQ,EAAEyD,E","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","webpack://nextcloud/./apps/systemtags/src/css/fileEntryInlineSystemTags.scss?0a01","webpack:///nextcloud/apps/systemtags/src/actions/inlineSystemTagsAction.ts","webpack:///nextcloud/apps/systemtags/src/services/davClient.ts","webpack:///nextcloud/apps/systemtags/src/logger.ts","webpack:///nextcloud/apps/systemtags/src/services/systemtags.ts","webpack:///nextcloud/apps/systemtags/src/init.ts","webpack:///nextcloud/apps/systemtags/src/services/api.ts","webpack:///nextcloud/apps/systemtags/src/utils.ts","webpack:///nextcloud/apps/systemtags/src/css/fileEntryInlineSystemTags.scss","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/ensure chunk","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./fileEntryInlineSystemTags.scss\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./fileEntryInlineSystemTags.scss\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { FileAction, Node, registerDavProperty, registerFileAction } from '@nextcloud/files';\nimport { translate as t } from '@nextcloud/l10n';\nimport '../css/fileEntryInlineSystemTags.scss';\nconst getNodeSystemTags = function (node) {\n const tags = node.attributes?.['system-tags']?.['system-tag'];\n if (tags === undefined) {\n return [];\n }\n return [tags].flat();\n};\nconst renderTag = function (tag, isMore = false) {\n const tagElement = document.createElement('li');\n tagElement.classList.add('files-list__system-tag');\n tagElement.textContent = tag;\n if (isMore) {\n tagElement.classList.add('files-list__system-tag--more');\n }\n return tagElement;\n};\nexport const action = new FileAction({\n id: 'system-tags',\n displayName: () => '',\n iconSvgInline: () => '',\n enabled(nodes) {\n // Only show the action on single nodes\n if (nodes.length !== 1) {\n return false;\n }\n const node = nodes[0];\n const tags = getNodeSystemTags(node);\n // Only show the action if the node has system tags\n if (tags.length === 0) {\n return false;\n }\n return true;\n },\n exec: async () => null,\n async renderInline(node) {\n // Ensure we have the system tags as an array\n const tags = getNodeSystemTags(node);\n if (tags.length === 0) {\n return null;\n }\n const systemTagsElement = document.createElement('ul');\n systemTagsElement.classList.add('files-list__system-tags');\n if (tags.length === 1) {\n systemTagsElement.setAttribute('aria-label', t('files', 'This file has the tag {tag}', { tag: tags[0] }));\n }\n else {\n const firstTags = tags.slice(0, -1).join(', ');\n const lastTag = tags[tags.length - 1];\n systemTagsElement.setAttribute('aria-label', t('files', 'This file has the tags {firstTags} and {lastTag}', { firstTags, lastTag }));\n }\n systemTagsElement.append(renderTag(tags[0]));\n // More tags than the one we're showing\n if (tags.length > 1) {\n const moreTagElement = renderTag('+' + (tags.length - 1), true);\n moreTagElement.setAttribute('title', tags.slice(1).join(', '));\n systemTagsElement.append(moreTagElement);\n }\n return systemTagsElement;\n },\n order: 0,\n});\nregisterDavProperty('nc:system-tags');\nregisterFileAction(action);\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { createClient } from 'webdav';\nimport { generateRemoteUrl } from '@nextcloud/router';\nimport { getRequestToken, onRequestTokenUpdate } from '@nextcloud/auth';\n// init webdav client\nconst rootUrl = generateRemoteUrl('dav');\nexport const davClient = createClient(rootUrl);\n// set CSRF token header\nconst setHeaders = (token) => {\n davClient.setHeaders({\n // Add this so the server knows it is an request from the browser\n 'X-Requested-With': 'XMLHttpRequest',\n // Inject user auth\n requesttoken: token ?? '',\n });\n};\n// refresh headers when request token changes\nonRequestTokenUpdate(setHeaders);\nsetHeaders(getRequestToken());\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { getLoggerBuilder } from '@nextcloud/logger';\nexport const logger = getLoggerBuilder()\n .setApp('systemtags')\n .detectUser()\n .build();\n","import { Folder, Permission, getDavNameSpaces, getDavProperties, davGetClient, davResultToNode } from '@nextcloud/files';\nimport { generateRemoteUrl } from '@nextcloud/router';\nimport { getCurrentUser } from '@nextcloud/auth';\nimport { fetchTags } from './api';\nconst client = davGetClient();\nconst resultToNode = (node) => davResultToNode(node);\nconst formatReportPayload = (tagId) => `<?xml version=\"1.0\"?>\n<oc:filter-files ${getDavNameSpaces()}>\n\t<d:prop>\n\t\t${getDavProperties()}\n\t</d:prop>\n <oc:filter-rules>\n <oc:systemtag>${tagId}</oc:systemtag>\n </oc:filter-rules>\n</oc:filter-files>`;\nconst tagToNode = function (tag) {\n return new Folder({\n id: tag.id,\n source: generateRemoteUrl('dav/systemtags/' + tag.id),\n owner: getCurrentUser()?.uid,\n root: '/systemtags',\n permissions: Permission.READ,\n attributes: {\n ...tag,\n 'is-tag': true,\n },\n });\n};\nexport const getContents = async (path = '/') => {\n // List tags in the root\n const tagsCache = (await fetchTags()).filter(tag => tag.userVisible);\n if (path === '/') {\n return {\n folder: new Folder({\n id: 0,\n source: generateRemoteUrl('dav/systemtags'),\n owner: getCurrentUser()?.uid,\n root: '/systemtags',\n permissions: Permission.NONE,\n }),\n contents: tagsCache.map(tagToNode),\n };\n }\n const tagId = parseInt(path.replace('/', ''), 10);\n const tag = tagsCache.find(tag => tag.id === tagId);\n if (!tag) {\n throw new Error('Tag not found');\n }\n const folder = tagToNode(tag);\n const contentsResponse = await client.getDirectoryContents('/', {\n details: true,\n // Only filter favorites if we're at the root\n data: formatReportPayload(tagId),\n headers: {\n // Patched in WebdavClient.ts\n method: 'REPORT',\n },\n });\n return {\n folder,\n contents: contentsResponse.data.map(resultToNode),\n };\n};\n","/**\n * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport './actions/inlineSystemTagsAction.js';\nimport { translate as t } from '@nextcloud/l10n';\nimport { View, getNavigation } from '@nextcloud/files';\nimport TagMultipleSvg from '@mdi/svg/svg/tag-multiple.svg?raw';\nimport { getContents } from './services/systemtags.js';\nconst Navigation = getNavigation();\nNavigation.register(new View({\n id: 'tags',\n name: t('systemtags', 'Tags'),\n caption: t('systemtags', 'List of tags and their associated files and folders.'),\n emptyTitle: t('systemtags', 'No tags found'),\n emptyCaption: t('systemtags', 'Tags you have created will show up here.'),\n icon: TagMultipleSvg,\n order: 25,\n getContents,\n}));\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport axios from '@nextcloud/axios';\nimport { generateUrl } from '@nextcloud/router';\nimport { translate as t } from '@nextcloud/l10n';\nimport { davClient } from './davClient.js';\nimport { formatTag, parseIdFromLocation, parseTags } from '../utils';\nimport { logger } from '../logger.js';\nexport const fetchTagsPayload = `<?xml version=\"1.0\"?>\n<d:propfind xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\">\n\t<d:prop>\n\t\t<oc:id />\n\t\t<oc:display-name />\n\t\t<oc:user-visible />\n\t\t<oc:user-assignable />\n\t\t<oc:can-assign />\n\t</d:prop>\n</d:propfind>`;\nexport const fetchTags = async () => {\n const path = '/systemtags';\n try {\n const { data: tags } = await davClient.getDirectoryContents(path, {\n data: fetchTagsPayload,\n details: true,\n glob: '/systemtags/*', // Filter out first empty tag\n });\n return parseTags(tags);\n }\n catch (error) {\n logger.error(t('systemtags', 'Failed to load tags'), { error });\n throw new Error(t('systemtags', 'Failed to load tags'));\n }\n};\nexport const fetchLastUsedTagIds = async () => {\n const url = generateUrl('/apps/systemtags/lastused');\n try {\n const { data: lastUsedTagIds } = await axios.get(url);\n return lastUsedTagIds.map(Number);\n }\n catch (error) {\n logger.error(t('systemtags', 'Failed to load last used tags'), { error });\n throw new Error(t('systemtags', 'Failed to load last used tags'));\n }\n};\n/**\n * @return created tag id\n */\nexport const createTag = async (tag) => {\n const path = '/systemtags';\n const tagToPost = formatTag(tag);\n try {\n const { headers } = await davClient.customRequest(path, {\n method: 'POST',\n data: tagToPost,\n });\n const contentLocation = headers.get('content-location');\n if (contentLocation) {\n return parseIdFromLocation(contentLocation);\n }\n logger.error(t('systemtags', 'Missing \"Content-Location\" header'));\n throw new Error(t('systemtags', 'Missing \"Content-Location\" header'));\n }\n catch (error) {\n logger.error(t('systemtags', 'Failed to create tag'), { error });\n throw new Error(t('systemtags', 'Failed to create tag'));\n }\n};\nexport const updateTag = async (tag) => {\n const path = '/systemtags/' + tag.id;\n const data = `<?xml version=\"1.0\"?>\n\t<d:propertyupdate xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\">\n\t\t<d:set>\n\t\t\t<d:prop>\n\t\t\t\t<oc:display-name>${tag.displayName}</oc:display-name>\n\t\t\t\t<oc:user-visible>${tag.userVisible}</oc:user-visible>\n\t\t\t\t<oc:user-assignable>${tag.userAssignable}</oc:user-assignable>\n\t\t\t</d:prop>\n\t\t</d:set>\n\t</d:propertyupdate>`;\n try {\n await davClient.customRequest(path, {\n method: 'PROPPATCH',\n data,\n });\n }\n catch (error) {\n logger.error(t('systemtags', 'Failed to update tag'), { error });\n throw new Error(t('systemtags', 'Failed to update tag'));\n }\n};\nexport const deleteTag = async (tag) => {\n const path = '/systemtags/' + tag.id;\n try {\n await davClient.deleteFile(path);\n }\n catch (error) {\n logger.error(t('systemtags', 'Failed to delete tag'), { error });\n throw new Error(t('systemtags', 'Failed to delete tag'));\n }\n};\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport camelCase from 'camelcase';\nexport const defaultBaseTag = {\n userVisible: true,\n userAssignable: true,\n canAssign: true,\n};\nexport const parseTags = (tags) => {\n return tags.map(({ props }) => Object.fromEntries(Object.entries(props)\n .map(([key, value]) => [camelCase(key), camelCase(key) === 'displayName' ? String(value) : value])));\n};\n/**\n * Parse id from `Content-Location` header\n * @param url URL to parse\n */\nexport const parseIdFromLocation = (url) => {\n const queryPos = url.indexOf('?');\n if (queryPos > 0) {\n url = url.substring(0, queryPos);\n }\n const parts = url.split('/');\n let result;\n do {\n result = parts[parts.length - 1];\n parts.pop();\n // note: first result can be empty when there is a trailing slash,\n // so we take the part before that\n } while (!result && parts.length > 0);\n return Number(result);\n};\nexport const formatTag = (initialTag) => {\n const tag = { ...initialTag };\n if (tag.name && !tag.displayName) {\n return tag;\n }\n tag.name = tag.displayName;\n delete tag.displayName;\n return tag;\n};\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, `.files-list__system-tags{--min-size: 32px;display:none;justify-content:center;align-items:center;min-width:calc(var(--min-size)*2);max-width:300px}.files-list__system-tag{padding:5px 10px;border:1px solid;border-radius:var(--border-radius-pill);border-color:var(--color-border);color:var(--color-text-maxcontrast);height:var(--min-size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:22px;text-align:center}.files-list__system-tag--more{overflow:visible;text-overflow:initial}.files-list__system-tag+.files-list__system-tag{margin-left:5px}@media(min-width: 512px){.files-list__system-tags{display:flex}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/systemtags/src/css/fileEntryInlineSystemTags.scss\"],\"names\":[],\"mappings\":\"AAKA,yBACC,gBAAA,CACA,YAAA,CACA,sBAAA,CACA,kBAAA,CACA,iCAAA,CACA,eAAA,CAGD,wBACC,gBAAA,CACA,gBAAA,CACA,uCAAA,CACA,gCAAA,CACA,mCAAA,CACA,sBAAA,CACA,kBAAA,CACA,eAAA,CACA,sBAAA,CACA,gBAAA,CACA,iBAAA,CAEA,8BACC,gBAAA,CACA,qBAAA,CAID,gDACC,eAAA,CAIF,yBACC,yBACC,YAAA,CAAA\",\"sourcesContent\":[\"/**\\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\\n * SPDX-License-Identifier: AGPL-3.0-or-later\\n */\\n\\n.files-list__system-tags {\\n\\t--min-size: 32px;\\n\\tdisplay: none;\\n\\tjustify-content: center;\\n\\talign-items: center;\\n\\tmin-width: calc(var(--min-size) * 2);\\n\\tmax-width: 300px;\\n}\\n\\n.files-list__system-tag {\\n\\tpadding: 5px 10px;\\n\\tborder: 1px solid;\\n\\tborder-radius: var(--border-radius-pill);\\n\\tborder-color: var(--color-border);\\n\\tcolor: var(--color-text-maxcontrast);\\n\\theight: var(--min-size);\\n\\twhite-space: nowrap;\\n\\toverflow: hidden;\\n\\ttext-overflow: ellipsis;\\n\\tline-height: 22px; // min-size - 2 * 5px padding\\n\\ttext-align: center;\\n\\n\\t&--more {\\n\\t\\toverflow: visible;\\n\\t\\ttext-overflow: initial;\\n\\t}\\n\\n\\t// Proper spacing if multiple shown\\n\\t& + .files-list__system-tag {\\n\\t\\tmargin-left: 5px;\\n\\t}\\n}\\n\\n@media (min-width: 512px) {\\n\\t.files-list__system-tags {\\n\\t\\tdisplay: flex;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","// The chunk loading function for additional chunks\n// Since all referenced chunks are already included\n// in this file, this function is empty here.\n__webpack_require__.e = () => (Promise.resolve());","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 2766;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t2766: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [4208], () => (__webpack_require__(49611)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","getNodeSystemTags","node","_node$attributes","tags","attributes","undefined","flat","renderTag","tag","isMore","arguments","length","tagElement","document","createElement","classList","add","textContent","action","FileAction","id","displayName","iconSvgInline","enabled","nodes","exec","async","renderInline","systemTagsElement","setAttribute","t","firstTags","slice","join","lastTag","append","moreTagElement","order","registerDavProperty","registerFileAction","rootUrl","generateRemoteUrl","davClient","createClient","setHeaders","token","requesttoken","onRequestTokenUpdate","getRequestToken","logger","getLoggerBuilder","setApp","detectUser","build","client","davGetClient","resultToNode","davResultToNode","formatReportPayload","tagId","concat","getDavNameSpaces","getDavProperties","tagToNode","_getCurrentUser","Folder","source","owner","getCurrentUser","uid","root","permissions","Permission","READ","getNavigation","register","View","name","caption","emptyTitle","emptyCaption","icon","getContents","path","tagsCache","data","getDirectoryContents","details","glob","map","_ref","props","Object","fromEntries","entries","_ref2","key","value","camelCase","String","parseTags","error","Error","fetchTags","filter","userVisible","_getCurrentUser2","folder","NONE","contents","parseInt","replace","find","headers","method","___CSS_LOADER_EXPORT___","push","module","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","loaded","__webpack_modules__","call","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","fulfilled","j","keys","every","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","e","Promise","resolve","g","globalThis","this","Function","window","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","nmd","paths","children","b","baseURI","self","location","href","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","forEach","bind","nc","__webpack_exports__"],"sourceRoot":""}