{"version":3,"file":"getUploader.mjs","sources":["../../lib/upload/getUploader.ts"],"sourcesContent":["/*!\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { isPublicShare } from '@nextcloud/sharing/public'\nimport { scopedGlobals } from '../globalScope.ts'\nimport { Uploader } from './uploader/Uploader.ts'\n\n/**\n * Get the global Uploader instance.\n *\n * Note: If you need a local uploader you can just create a new instance,\n * this global instance will be shared with other apps and is mostly useful\n * for the Files app web UI to keep track of all uploads and their progress.\n *\n * @param isPublic Set to true to use public upload endpoint (by default it is auto detected)\n * @param forceRecreate Force a new uploader instance - main purpose is for testing\n */\nexport function getUploader(isPublic: boolean = isPublicShare(), forceRecreate = false): Uploader {\n\tif (forceRecreate || scopedGlobals.uploader === undefined) {\n\t\tscopedGlobals.uploader = new Uploader(isPublic)\n\t}\n\n\treturn scopedGlobals.uploader\n}\n"],"names":[],"mappings":";;;AAAA;AAAA;AAAA;AAAA;AAmBO,SAAS,YAAY,WAAoB,iBAAiB,gBAAgB,OAAiB;AACjG,MAAI,iBAAiB,cAAc,aAAa,QAAW;AAC1D,kBAAc,WAAW,IAAI,SAAS,QAAQ;AAAA,EAC/C;AAEA,SAAO,cAAc;AACtB;"}