{"ast":null,"code":"import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nvar traverseFileTree = function traverseFileTree(files, callback, isAccepted) {\n var flattenFileList = [];\n var progressFileList = [];\n files.forEach(function (file) {\n return progressFileList.push(file.webkitGetAsEntry());\n });\n function loopFiles(item) {\n var dirReader = item.createReader();\n function sequence() {\n dirReader.readEntries(function (entries) {\n var entryList = Array.prototype.slice.apply(entries);\n progressFileList.push.apply(progressFileList, _toConsumableArray(entryList));\n // Check if all the file has been viewed\n var isFinished = !entryList.length;\n if (!isFinished) {\n sequence();\n }\n });\n }\n sequence();\n }\n // eslint-disable-next-line @typescript-eslint/naming-convention\n var _traverseFileTree = function _traverseFileTree(item, path) {\n if (!item) {\n return;\n }\n // eslint-disable-next-line no-param-reassign\n item.path = path || '';\n if (item.isFile) {\n item.file(function (file) {\n if (isAccepted(file)) {\n // https://github.com/ant-design/ant-design/issues/16426\n if (item.fullPath && !file.webkitRelativePath) {\n Object.defineProperties(file, {\n webkitRelativePath: {\n writable: true\n }\n });\n // eslint-disable-next-line no-param-reassign\n file.webkitRelativePath = item.fullPath.replace(/^\\//, '');\n Object.defineProperties(file, {\n webkitRelativePath: {\n writable: false\n }\n });\n }\n flattenFileList.push(file);\n }\n });\n } else if (item.isDirectory) {\n loopFiles(item);\n }\n };\n function walkFiles() {\n var wipIndex = 0;\n while (wipIndex < progressFileList.length) {\n _traverseFileTree(progressFileList[wipIndex]);\n wipIndex++;\n }\n callback(flattenFileList);\n }\n walkFiles();\n};\nexport default traverseFileTree;","map":{"version":3,"names":["_toConsumableArray","traverseFileTree","files","callback","isAccepted","flattenFileList","progressFileList","forEach","file","push","webkitGetAsEntry","loopFiles","item","dirReader","createReader","sequence","readEntries","entries","entryList","Array","prototype","slice","apply","isFinished","length","_traverseFileTree","path","isFile","fullPath","webkitRelativePath","Object","defineProperties","writable","replace","isDirectory","walkFiles","wipIndex"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-upload/es/traverseFileTree.js"],"sourcesContent":["import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nvar traverseFileTree = function traverseFileTree(files, callback, isAccepted) {\n var flattenFileList = [];\n var progressFileList = [];\n files.forEach(function (file) {\n return progressFileList.push(file.webkitGetAsEntry());\n });\n function loopFiles(item) {\n var dirReader = item.createReader();\n function sequence() {\n dirReader.readEntries(function (entries) {\n var entryList = Array.prototype.slice.apply(entries);\n progressFileList.push.apply(progressFileList, _toConsumableArray(entryList));\n // Check if all the file has been viewed\n var isFinished = !entryList.length;\n if (!isFinished) {\n sequence();\n }\n });\n }\n sequence();\n }\n // eslint-disable-next-line @typescript-eslint/naming-convention\n var _traverseFileTree = function _traverseFileTree(item, path) {\n if (!item) {\n return;\n }\n // eslint-disable-next-line no-param-reassign\n item.path = path || '';\n if (item.isFile) {\n item.file(function (file) {\n if (isAccepted(file)) {\n // https://github.com/ant-design/ant-design/issues/16426\n if (item.fullPath && !file.webkitRelativePath) {\n Object.defineProperties(file, {\n webkitRelativePath: {\n writable: true\n }\n });\n // eslint-disable-next-line no-param-reassign\n file.webkitRelativePath = item.fullPath.replace(/^\\//, '');\n Object.defineProperties(file, {\n webkitRelativePath: {\n writable: false\n }\n });\n }\n flattenFileList.push(file);\n }\n });\n } else if (item.isDirectory) {\n loopFiles(item);\n }\n };\n function walkFiles() {\n var wipIndex = 0;\n while (wipIndex < progressFileList.length) {\n _traverseFileTree(progressFileList[wipIndex]);\n wipIndex++;\n }\n callback(flattenFileList);\n }\n walkFiles();\n};\nexport default traverseFileTree;"],"mappings":"AAAA,OAAOA,kBAAkB,MAAM,8CAA8C;AAC7E,IAAIC,gBAAgB,GAAG,SAASA,gBAAgBA,CAACC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAE;EAC5E,IAAIC,eAAe,GAAG,EAAE;EACxB,IAAIC,gBAAgB,GAAG,EAAE;EACzBJ,KAAK,CAACK,OAAO,CAAC,UAAUC,IAAI,EAAE;IAC5B,OAAOF,gBA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