nextcloud/dist/public-C1mLBHT3.chunk.mjs.map
Ferdinand Thiessen 7d8e640601
chore: compile assets
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-05-05 22:25:40 +02:00

1 line
No EOL
3.9 KiB
Text

{"version":3,"file":"public-C1mLBHT3.chunk.mjs","sources":["../node_modules/@nextcloud/initial-state/dist/index.js","../node_modules/@nextcloud/capabilities/dist/index.mjs","../node_modules/@nextcloud/sharing/dist/public.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n/**\n * @param app app ID, e.g. \"mail\"\n * @param key name of the property\n * @param fallback optional parameter to use as default value\n * @throws if the key can't be found\n */\nexport function loadState(app, key, fallback) {\n const selector = `#initial-state-${app}-${key}`;\n if (window._nc_initial_state?.has(selector)) {\n return window._nc_initial_state.get(selector);\n }\n else if (!window._nc_initial_state) {\n window._nc_initial_state = new Map();\n }\n const elem = document.querySelector(selector);\n if (elem === null) {\n if (fallback !== undefined) {\n return fallback;\n }\n throw new Error(`Could not find initial state ${key} of ${app}`);\n }\n try {\n const parsedValue = JSON.parse(atob(elem.value));\n window._nc_initial_state.set(selector, parsedValue);\n return parsedValue;\n }\n catch (error) {\n console.error('[@nextcloud/initial-state] Could not parse initial state', { key, app, error });\n if (fallback !== undefined) {\n return fallback;\n }\n throw new Error(`Could not parse initial state ${key} of ${app}`, { cause: error });\n }\n}\n","import { loadState } from \"@nextcloud/initial-state\";\nfunction getCapabilities() {\n try {\n return loadState(\"core\", \"capabilities\");\n } catch (error) {\n console.debug(\"Could not find capabilities initial state fall back to _oc_capabilities\");\n if (!(\"_oc_capabilities\" in window)) {\n return {};\n }\n return window[\"_oc_capabilities\"];\n }\n}\nexport {\n getCapabilities\n};\n//# sourceMappingURL=index.mjs.map\n","/*!\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: GPL-3.0-or-later\n */\n/**\n * @module public\n */\nimport { loadState } from '@nextcloud/initial-state';\n/**\n * Check if the current page is on a public share\n */\nexport function isPublicShare() {\n // check both the new initial state version and fallback to legacy input\n return (loadState('files_sharing', 'isPublic', null)\n ?? document.querySelector('input#isPublic[type=\"hidden\"][name=\"isPublic\"][value=\"1\"]') !== null);\n}\n/**\n * Get the sharing token for the current public share\n */\nexport function getSharingToken() {\n return (loadState('files_sharing', 'sharingToken', null)\n ?? document.querySelector('input#sharingToken[type=\"hidden\"]')?.value\n ?? null);\n}\n"],"names":["loadState","app","key","fallback","selector","elem","parsedValue","error","getCapabilities","isPublicShare","getSharingToken"],"mappings":"AAUO,SAASA,EAAUC,EAAKC,EAAKC,EAAU,CAC1C,MAAMC,EAAW,kBAAkBH,CAAG,IAAIC,CAAG,GAC7C,GAAI,OAAO,mBAAmB,IAAIE,CAAQ,EACtC,OAAO,OAAO,kBAAkB,IAAIA,CAAQ,EAEtC,OAAO,oBACb,OAAO,kBAAoB,IAAI,KAEnC,MAAMC,EAAO,SAAS,cAAcD,CAAQ,EAC5C,GAAIC,IAAS,KAAM,CACf,GAAIF,IAAa,OACb,OAAOA,EAEX,MAAM,IAAI,MAAM,gCAAgCD,CAAG,OAAOD,CAAG,EAAE,CACnE,CACA,GAAI,CACA,MAAMK,EAAc,KAAK,MAAM,KAAKD,EAAK,KAAK,CAAC,EAC/C,OAAA,OAAO,kBAAkB,IAAID,EAAUE,CAAW,EAC3CA,CACX,OACOC,EAAO,CAEV,GADA,QAAQ,MAAM,2DAA4D,CAAE,IAAAL,EAAK,IAAAD,EAAK,MAAAM,EAAO,EACzFJ,IAAa,OACb,OAAOA,EAEX,MAAM,IAAI,MAAM,iCAAiCD,CAAG,OAAOD,CAAG,GAAI,CAAE,MAAOM,EAAO,CACtF,CACJ,CCpCA,SAASC,GAAkB,CACzB,GAAI,CACF,OAAOR,EAAU,OAAQ,cAAc,CACzC,MAAgB,CAEd,OADA,QAAQ,MAAM,yEAAyE,EACjF,qBAAsB,OAGrB,OAAO,iBAFL,CAAA,CAGX,CACF,4ECAO,SAASS,GAAgB,CAE5B,OAAQT,EAAU,gBAAiB,WAAY,IAAI,GAC5C,SAAS,cAAc,2DAA2D,IAAM,IACnG,CAIO,SAASU,GAAkB,CAC9B,OAAQV,EAAU,gBAAiB,eAAgB,IAAI,GAChD,SAAS,cAAc,mCAAmC,GAAG,OAC7D,IACX","x_google_ignoreList":[0,1,2]}