Index: lams_central/src/java/org/lamsfoundation/lams/web/LAMSUploadServlet.java =================================================================== diff -u -r6df51a3e26e804c21c80b9611eaed7b1a6180327 -r49b072598933566cedd795667351678071f03004 --- lams_central/src/java/org/lamsfoundation/lams/web/LAMSUploadServlet.java (.../LAMSUploadServlet.java) (revision 6df51a3e26e804c21c80b9611eaed7b1a6180327) +++ lams_central/src/java/org/lamsfoundation/lams/web/LAMSUploadServlet.java (.../LAMSUploadServlet.java) (revision 49b072598933566cedd795667351678071f03004) @@ -23,6 +23,7 @@ import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.servlet.ServletFileUpload; +import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.lamsfoundation.lams.util.Configuration; import org.lamsfoundation.lams.util.ConfigurationKeys; @@ -37,14 +38,22 @@ /** * Servlet to upload files.
* - * This servlet accepts just file uploads, eventually with a parameter specifying file type + * This servlet accepts just file uploads, optionally with a parameter specifying file type * + * For CKEditor uploads: * This servlet has been modified for LAMS to support the lams_www/secure/[design folder] format. The design folder is a * folder with a unique numeric name. Whenever a new design is created (using "New" in the client), a new design folder * name is assigned. The [design folder] is passed in as the CurrentFolder. This servlet supports the image and link * windows, not the browse window. + * + * Currently this servlet can not be rewritten to Spring Controller. + * Requests to controllers pass few additional Spring layers. + * For files uploaded with Ajax Spring looks for Spring Security CSRF token. + * It is not present as we do not use Spring Security. It results in HTTP 405 Method not allowed. + * There are ways to turn off CSRF check, but not with current Spring version. + * We can try to rewrite this servlet once we upgrade Spring and switch to programmatic configuration. * - * + * @author Marcin Cieslak * @author Simone Chiaretta (simo@users.sourceforge.net) * @author Mitchell Seaton */ @@ -66,6 +75,28 @@ SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, config.getServletContext()); } + @Override + public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { + if (!request.getServletPath().endsWith("tmpFileUploadDelete")) { + return; + } + + String tmpFileUploadId = request.getParameter("tmpFileUploadId"); + String fileName = request.getParameter("name"); + + String uploadSubDir = FileUtil.prefix + tmpFileUploadId; + File uploadDir = new File(Configuration.get(ConfigurationKeys.LAMS_TEMP_DIR), uploadSubDir); + File file = new File(uploadDir, fileName); + if (file.exists() && file.delete()) { + if (log.isDebugEnabled()) { + log.debug("Deleted temporarily uploaded file: " + file.getAbsolutePath()); + } + } else { + log.warn("Could not find or delete temporarily uploaded file: " + file.getAbsolutePath()); + } + + } + /** * Manage the Upload requests.
* @@ -77,18 +108,32 @@ * */ @Override - public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { if (log.isDebugEnabled()) { log.debug("Upload started"); } - String currentFolderStr = request.getParameter("CurrentFolder"); + String currentFolder = request.getParameter("CurrentFolder"); + if (request.getServletPath().endsWith("tmpFileUpload")) { + processTemporaryFileUpload(request, response); + } else if (StringUtils.isNotBlank(currentFolder)) { + processCKEditorUpload(request, response, currentFolder); + } else { + log.warn("Unrecognised file upload type"); + } + } + + /** + * Processes files uploaded using CKEditor + */ + private void processCKEditorUpload(HttpServletRequest request, HttpServletResponse response, String currentFolder) + throws IOException { String newName = null; String fileUrl = null; String returnMessage = null; - if (currentFolderStr.equals("/-1/")) { + if (currentFolder.equals("/-1/")) { returnMessage = "Security error. You probably don't have enough permissions to upload. Please check your server."; } else { // get realBaseDir and lamsContextPath at request time from config values in memory @@ -121,15 +166,14 @@ String fileName = pathParts[pathParts.length - 1]; // validate file size - boolean maxFilesizeExceededMessage = FileValidatorUtil.validateFileSize(uplFile.getSize(), true); - if (!maxFilesizeExceededMessage) { - fileName = centralMessageService.getMessage("errors.maxfilesize", + boolean fileSizeValidated = FileValidatorUtil.validateFileSize(uplFile.getSize(), true); + if (!fileSizeValidated) { + returnMessage = centralMessageService.getMessage("errors.maxfilesize", new Object[] { Configuration.getAsInt(ConfigurationKeys.UPLOAD_FILE_LARGE_MAX_SIZE) }); // validate file extension } else if (!FileUtil.isExtensionAllowed(fileType, fileName)) { returnMessage = "Invalid file type"; - } else { try { boolean isVirusFree = FileUtil.isVirusFree(uplFile.getInputStream()); @@ -141,13 +185,12 @@ } if (returnMessage == null) { - - File uploadDir = UploadFileUtil.getUploadDir(currentFolderStr, fileType); + File uploadDir = UploadFileUtil.getUploadDir(currentFolder, fileType); fileName = UploadFileUtil.getUploadFileName(uploadDir, fileName); newName = fileName; File destinationFile = new File(uploadDir, fileName); - String currentWebPath = UploadFileUtil.getUploadWebPath(currentFolderStr, fileType); + String currentWebPath = UploadFileUtil.getUploadWebPath(currentFolder, fileType); fileUrl = currentWebPath + '/' + fileName; FileCopyUtils.copy(uplFile.getInputStream(), new FileOutputStream(destinationFile)); @@ -158,16 +201,15 @@ } } catch (Exception e) { log.error(e); - returnMessage = "Error while uploading file: " + e.getMessage(); + returnMessage = e.getMessage(); } } - if (returnMessage == null) { - returnMessage = "File successfully uploaded: " + newName; + if (returnMessage != null) { + log.warn("Error while uploading file \"" + newName + "\": " + returnMessage); } String ckeditorSetUrlFuncNum = request.getParameter("CKEditorFuncNum"); - if (ckeditorSetUrlFuncNum != null) { response.setContentType("text/html; charset=UTF-8"); response.setHeader("Cache-Control", "no-cache"); @@ -179,13 +221,82 @@ out.println(""); out.flush(); out.close(); - } else if (log.isDebugEnabled()) { - log.debug("No CKEditor method found to run after completion, but upload finished with message: " - + returnMessage); } + } - if (log.isDebugEnabled()) { - log.debug("Upload finished"); + /** + * Processes files using Ajax. Puts them into temporary dir so a subsequent form submit can pick them up. + * + * @throws IOException + */ + private void processTemporaryFileUpload(HttpServletRequest request, HttpServletResponse response) + throws IOException { + String newName = null; + String returnMessage = null; + + DiskFileItemFactory fileItemFactory = new DiskFileItemFactory(); + ServletFileUpload fileUpload = new ServletFileUpload(fileItemFactory); + try { + List fileItems = fileUpload.parseRequest(request); + Map fields = new HashMap<>(); + + Iterator iter = fileItems.iterator(); + while (iter.hasNext()) { + FileItem fileItem = iter.next(); + if (fileItem.isFormField()) { + fields.put(fileItem.getFieldName(), fileItem.getString()); + } else { + fields.put(fileItem.getFieldName(), fileItem); + } + } + FileItem uplFile = (FileItem) fields.get("file"); + if (uplFile == null) { + returnMessage = "Can not find a field named \"file\""; + } + + if (returnMessage == null) { + String fileName = uplFile.getName(); + + // validate file size + boolean fileSizeValidated = FileValidatorUtil.validateFileSize(uplFile.getSize(), true); + if (!fileSizeValidated) { + returnMessage = centralMessageService.getMessage("errors.maxfilesize", + new Object[] { Configuration.getAsInt(ConfigurationKeys.UPLOAD_FILE_LARGE_MAX_SIZE) }); + } else { + try { + boolean isVirusFree = FileUtil.isVirusFree(uplFile.getInputStream()); + if (!isVirusFree) { + returnMessage = "File contains a virus: " + fileName; + } + } catch (IOException e) { + returnMessage = "Could not scan file: " + fileName; + } + } + + if (returnMessage == null) { + String uploadSubDir = FileUtil.prefix + fields.get("tmpFileUploadId"); + File uploadDir = new File(Configuration.get(ConfigurationKeys.LAMS_TEMP_DIR), uploadSubDir); + uploadDir.mkdir(); + fileName = UploadFileUtil.getUploadFileName(uploadDir, fileName); + newName = fileName; + File destinationFile = new File(uploadDir, fileName); + + FileCopyUtils.copy(uplFile.getInputStream(), new FileOutputStream(destinationFile)); + if (log.isDebugEnabled()) { + log.debug("Uploaded file to " + destinationFile.getAbsolutePath()); + } + } + } + } catch (Exception e) { + returnMessage = e.getMessage(); } + + if (returnMessage == null) { + response.setContentType("application/json;charset=UTF-8"); + response.getWriter().write("{\"name\" : \"" + newName + "\"}"); + } else { + log.warn("Error while uploading file \"" + newName + "\": " + returnMessage); + response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + } } } \ No newline at end of file Index: lams_central/web/WEB-INF/web.xml =================================================================== diff -u -rb16efd85f61de9c2aab7d2fbf6364681eb15d458 -r49b072598933566cedd795667351678071f03004 --- lams_central/web/WEB-INF/web.xml (.../web.xml) (revision b16efd85f61de9c2aab7d2fbf6364681eb15d458) +++ lams_central/web/WEB-INF/web.xml (.../web.xml) (revision 49b072598933566cedd795667351678071f03004) @@ -501,6 +501,14 @@ /ckeditor/filemanager/upload/simpleuploader + SimpleUploader + /tmpFileUpload + + + SimpleUploader + /tmpFileUploadDelete + + RuntimeStatsServlet /runtimeStats Index: lams_central/web/css/uppy.min.css =================================================================== diff -u --- lams_central/web/css/uppy.min.css (revision 0) +++ lams_central/web/css/uppy.min.css (revision 49b072598933566cedd795667351678071f03004) @@ -0,0 +1,11 @@ +.uppy-Root{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:left;position:relative;color:#333}.uppy-Root *,.uppy-Root :after,.uppy-Root :before{box-sizing:inherit}.uppy-Root [hidden]{display:none}.uppy-u-reset{-webkit-appearance:none;line-height:1;padding:0;color:inherit;-webkit-backface-visibility:visible;backface-visibility:visible;background:none;border:none;border-collapse:separate;border-image:none;border-radius:0;border-spacing:0;box-shadow:none;clear:none;cursor:auto;display:inline;empty-cells:show;float:none;font-family:inherit;font-size:inherit;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none;left:auto;letter-spacing:normal;list-style:none;margin:0;max-height:none;max-width:none;min-height:0;min-width:0;opacity:1;outline:medium none invert;overflow:visible;overflow-x:visible;overflow-y:visible;text-align:left;text-decoration:none;text-indent:0;text-shadow:none;text-transform:none;top:auto;transform:none;transform-origin:50% 50% 0;transform-style:flat;transition:none 0s ease 0s;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;z-index:auto}.uppy-c-textInput{border:1px solid #ddd;border-radius:4px;font-size:14px;line-height:1.5;padding:6px 8px;background-color:#fff}.uppy-size--md .uppy-c-textInput{padding:8px 10px}.uppy-c-textInput:focus{border-color:rgba(34,117,215,.6);outline:none;box-shadow:0 0 0 3px rgba(34,117,215,.15)}[data-uppy-theme=dark] .uppy-c-textInput{background-color:#333;border-color:#333;color:#eaeaea}[data-uppy-theme=dark] .uppy-c-textInput:focus{border-color:#525252;box-shadow:none}.uppy-c-icon{max-width:100%;max-height:100%;fill:currentColor;display:inline-block;overflow:hidden}.uppy-c-btn{display:inline-block;text-align:center;white-space:nowrap;vertical-align:middle;font-family:inherit;font-size:16px;line-height:1;font-weight:500;transition-property:background-color,color;transition-duration:.3s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.uppy-c-btn:not(:disabled):not(.disabled){cursor:pointer}.uppy-c-btn::-moz-focus-inner{border:0}.uppy-c-btn-primary{font-size:14px;padding:10px 18px;border-radius:4px;background-color:#2275d7;color:#fff}.uppy-c-btn-primary:hover{background-color:#1b5dab}.uppy-c-btn-primary:focus{outline:none;box-shadow:0 0 0 3px rgba(34,117,215,.4)}.uppy-size--md .uppy-c-btn-primary{padding:13px 22px}[data-uppy-theme=dark] .uppy-c-btn-primary{color:#eaeaea}[data-uppy-theme=dark] .uppy-c-btn-primary:focus{outline:none}[data-uppy-theme=dark] .uppy-c-btn-primary::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-c-btn-primary:focus{box-shadow:0 0 0 2px rgba(170,225,255,.85)}.uppy-c-btn-link{font-size:14px;line-height:1;padding:10px 15px;border-radius:4px;background-color:transparent;color:#525252}.uppy-c-btn-link:hover{color:#333}.uppy-c-btn-link:focus{outline:none;box-shadow:0 0 0 3px rgba(34,117,215,.25)}.uppy-size--md .uppy-c-btn-link{padding:13px 18px}[data-uppy-theme=dark] .uppy-c-btn-link{color:#eaeaea}[data-uppy-theme=dark] .uppy-c-btn-link:focus{outline:none}[data-uppy-theme=dark] .uppy-c-btn-link::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-c-btn-link:focus{box-shadow:0 0 0 2px rgba(170,225,255,.85)}[data-uppy-theme=dark] .uppy-c-btn-link:hover{color:#939393}.uppy-c-btn--small{font-size:.9em;padding:7px 16px;border-radius:2px}.uppy-size--md .uppy-c-btn--small{padding:8px 10px;border-radius:2px}.uppy-Informer{position:absolute;bottom:60px;left:0;right:0;text-align:center;opacity:1;transform:none;transition:all .25s ease-in;z-index:1005}.uppy-Informer[aria-hidden=true]{opacity:0;transform:translateY(350%);transition:all .3s ease-in;z-index:-1000}.uppy-Informer p{display:inline-block;margin:0;font-size:12px;line-height:1.4;font-weight:400;padding:6px 15px;background-color:#757575;color:#fff;border-radius:18px;max-width:90%}.uppy-size--md .uppy-Informer p{font-size:14px;line-height:1.3;max-width:500px;padding:10px 20px}[data-uppy-theme=dark] .uppy-Informer p{background-color:#333}.uppy-Informer span{line-height:12px;width:13px;height:13px;display:inline-block;vertical-align:middle;color:#525252;background-color:#fff;border-radius:50%;position:relative;top:-1px;left:3px;font-size:10px;margin-left:-1px}.uppy-Informer span:hover{cursor:help}.uppy-Informer span:after{line-height:1.3;word-wrap:break-word}.uppy-Root [aria-label][role~=tooltip]{position:relative}.uppy-Root [aria-label][role~=tooltip]:after,.uppy-Root [aria-label][role~=tooltip]:before{transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden;will-change:transform;opacity:0;pointer-events:none;transition:all var(--microtip-transition-duration,.18s) var(--microtip-transition-easing,ease-in-out) var(--microtip-transition-delay,0s);position:absolute;box-sizing:border-box;z-index:10;transform-origin:top}.uppy-Root [aria-label][role~=tooltip]:before{background-size:100% auto!important;content:""}.uppy-Root [aria-label][role~=tooltip]:after{background:rgba(17,17,17,.9);border-radius:4px;color:#fff;content:attr(aria-label);font-size:var(--microtip-font-size,13px);font-weight:var(--microtip-font-weight,normal);text-transform:var(--microtip-text-transform,none);padding:.5em 1em;white-space:nowrap;box-sizing:content-box}.uppy-Root [aria-label][role~=tooltip]:focus:after,.uppy-Root [aria-label][role~=tooltip]:focus:before,.uppy-Root [aria-label][role~=tooltip]:hover:after,.uppy-Root [aria-label][role~=tooltip]:hover:before{opacity:1;pointer-events:auto}.uppy-Root [role~=tooltip][data-microtip-position|=top]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M2.658 0h32.004c-6 0-11.627 12.002-16.002 12.002C14.285 12.002 8.594 0 2.658 0z'/%3E%3C/svg%3E") no-repeat;height:6px;width:18px;margin-bottom:5px}.uppy-Root [role~=tooltip][data-microtip-position|=top]:after{margin-bottom:11px}.uppy-Root [role~=tooltip][data-microtip-position|=top]:before{transform:translate3d(-50%,0,0);bottom:100%;left:50%}.uppy-Root [role~=tooltip][data-microtip-position|=top]:hover:before{transform:translate3d(-50%,-5px,0)}.uppy-Root [role~=tooltip][data-microtip-position|=top]:after{transform:translate3d(-50%,0,0);bottom:100%;left:50%}.uppy-Root [role~=tooltip][data-microtip-position=top]:hover:after{transform:translate3d(-50%,-5px,0)}.uppy-Root [role~=tooltip][data-microtip-position=top-left]:after{transform:translate3d(calc(-100% + 16px),0,0);bottom:100%}.uppy-Root [role~=tooltip][data-microtip-position=top-left]:hover:after{transform:translate3d(calc(-100% + 16px),-5px,0)}.uppy-Root [role~=tooltip][data-microtip-position=top-right]:after{transform:translate3d(-16px,0,0);bottom:100%}.uppy-Root [role~=tooltip][data-microtip-position=top-right]:hover:after{transform:translate3d(-16px,-5px,0)}.uppy-Root [role~=tooltip][data-microtip-position|=bottom]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002C21.715-.002 27.406 12 33.342 12z'/%3E%3C/svg%3E") no-repeat;height:6px;width:18px;margin-top:5px;margin-bottom:0}.uppy-Root [role~=tooltip][data-microtip-position|=bottom]:after{margin-top:11px}.uppy-Root [role~=tooltip][data-microtip-position|=bottom]:before{transform:translate3d(-50%,-10px,0);bottom:auto;left:50%;top:100%}.uppy-Root [role~=tooltip][data-microtip-position|=bottom]:hover:before{transform:translate3d(-50%,0,0)}.uppy-Root [role~=tooltip][data-microtip-position|=bottom]:after{transform:translate3d(-50%,-10px,0);top:100%;left:50%}.uppy-Root [role~=tooltip][data-microtip-position=bottom]:hover:after{transform:translate3d(-50%,0,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom-left]:after{transform:translate3d(calc(-100% + 16px),-10px,0);top:100%}.uppy-Root [role~=tooltip][data-microtip-position=bottom-left]:hover:after{transform:translate3d(calc(-100% + 16px),0,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom-right]:after{transform:translate3d(-16px,-10px,0);top:100%}.uppy-Root [role~=tooltip][data-microtip-position=bottom-right]:hover:after{transform:translate3d(-16px,0,0)}.uppy-Root [role~=tooltip][data-microtip-position=left]:after,.uppy-Root [role~=tooltip][data-microtip-position=left]:before{bottom:auto;left:auto;right:100%;top:50%;transform:translate3d(10px,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-position=left]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M0 33.342V1.338c0 6 12.002 11.627 12.002 16.002C12.002 21.715 0 27.406 0 33.342z'/%3E%3C/svg%3E") no-repeat;height:18px;width:6px;margin-right:5px;margin-bottom:0}.uppy-Root [role~=tooltip][data-microtip-position=left]:after{margin-right:11px}.uppy-Root [role~=tooltip][data-microtip-position=left]:hover:after,.uppy-Root [role~=tooltip][data-microtip-position=left]:hover:before{transform:translate3d(0,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-position=right]:after,.uppy-Root [role~=tooltip][data-microtip-position=right]:before{bottom:auto;left:100%;top:50%;transform:translate3d(-10px,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-position=right]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M12 2.658v32.004c0-6-12.002-11.627-12.002-16.002C-.002 14.285 12 8.594 12 2.658z'/%3E%3C/svg%3E") no-repeat;height:18px;width:6px;margin-bottom:0;margin-left:5px}.uppy-Root [role~=tooltip][data-microtip-position=right]:after{margin-left:11px}.uppy-Root [role~=tooltip][data-microtip-position=right]:hover:after,.uppy-Root [role~=tooltip][data-microtip-position=right]:hover:before{transform:translate3d(0,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-size=small]:after{white-space:normal;width:80px}.uppy-Root [role~=tooltip][data-microtip-size=medium]:after{white-space:normal;width:150px}.uppy-Root [role~=tooltip][data-microtip-size=large]:after{white-space:normal;width:260px}.uppy-StatusBar{display:-ms-flexbox;display:flex;position:relative;height:40px;line-height:40px;font-size:12px;font-weight:400;color:#fff;background-color:#fff;z-index:1001;transition:height .2s}[data-uppy-theme=dark] .uppy-StatusBar{background-color:#1f1f1f}.uppy-size--md .uppy-StatusBar{height:46px}.uppy-StatusBar:before{content:"";position:absolute;left:0;right:0;top:0;bottom:0;width:100%;height:2px;background-color:#eaeaea}[data-uppy-theme=dark] .uppy-StatusBar:before{background-color:#757575}.uppy-StatusBar[aria-hidden=true]{overflow-y:hidden;height:0}.uppy-StatusBar.is-complete .uppy-StatusBar-progress{background-color:#1bb240}.uppy-StatusBar.is-error .uppy-StatusBar-progress{background-color:#e32437}.uppy-StatusBar.is-complete .uppy-StatusBar-statusIndicator{color:#1bb240}.uppy-StatusBar.is-error .uppy-StatusBar-statusIndicator{color:#e32437}.uppy-StatusBar:not([aria-hidden=true]).is-waiting{background-color:#fff;height:65px;border-top:1px solid #eaeaea}[data-uppy-theme=dark] .uppy-StatusBar:not([aria-hidden=true]).is-waiting{background-color:#1f1f1f;border-top:1px solid #333}.uppy-StatusBar-progress{background-color:#2275d7;height:2px;position:absolute;z-index:1001;transition:background-color,width .3s ease-out}.uppy-StatusBar-progress.is-indeterminate{background-size:64px 64px;background-image:linear-gradient(45deg,rgba(0,0,0,.3) 25%,transparent 0,transparent 50%,rgba(0,0,0,.3) 0,rgba(0,0,0,.3) 75%,transparent 0,transparent);animation:uppy-StatusBar-ProgressStripes 1s linear infinite}@keyframes uppy-StatusBar-ProgressStripes{0%{background-position:0 0}to{background-position:64px 0}}.uppy-StatusBar.is-postprocessing .uppy-StatusBar-progress,.uppy-StatusBar.is-preprocessing .uppy-StatusBar-progress{background-color:#f6a623}.uppy-StatusBar.is-waiting .uppy-StatusBar-progress{display:none}.uppy-StatusBar-content{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;position:relative;z-index:1002;padding-left:10px;white-space:nowrap;text-overflow:ellipsis;color:#333;height:100%}.uppy-size--md .uppy-StatusBar-content{padding-left:15px}[data-uppy-theme=dark] .uppy-StatusBar-content{color:#eaeaea}.uppy-StatusBar-status{line-height:1.4;font-weight:400;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;padding-right:.3em}.uppy-Root:not(.uppy-size--md) .uppy-StatusBar-additionalInfo{display:none}.uppy-StatusBar-statusPrimary{font-weight:500;line-height:1}[data-uppy-theme=dark] .uppy-StatusBar-statusPrimary{color:#eaeaea}.uppy-StatusBar-statusSecondary{margin-top:1px;font-size:11px;line-height:1.2;display:inline-block;color:#757575;white-space:nowrap}[data-uppy-theme=dark] .uppy-StatusBar-statusSecondary{color:#bbb}.uppy-StatusBar-statusSecondaryHint{display:inline-block;vertical-align:middle;margin-right:5px;line-height:1}.uppy-size--md .uppy-StatusBar-statusSecondaryHint{margin-right:8px}.uppy-StatusBar-statusIndicator{position:relative;top:1px;color:#525252;margin-right:7px}.uppy-StatusBar-statusIndicator svg{vertical-align:text-bottom}.uppy-StatusBar-actions{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;position:absolute;top:0;bottom:0;right:10px;z-index:1004}.uppy-StatusBar.is-waiting .uppy-StatusBar-actions{width:100%;position:static;padding:0 15px;background-color:#fafafa}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actions{background-color:#1f1f1f}.uppy-StatusBar-actionCircleBtn{line-height:1;cursor:pointer;margin:3px;opacity:.9}.uppy-StatusBar-actionCircleBtn:focus{outline:none}.uppy-StatusBar-actionCircleBtn::-moz-focus-inner{border:0}.uppy-StatusBar-actionCircleBtn:focus{box-shadow:0 0 0 3px rgba(34,117,215,.5)}[data-uppy-theme=dark] .uppy-StatusBar-actionCircleBtn:focus{outline:none}[data-uppy-theme=dark] .uppy-StatusBar-actionCircleBtn::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-StatusBar-actionCircleBtn:focus{box-shadow:0 0 0 2px rgba(170,225,255,.85)}.uppy-StatusBar-actionCircleBtn:hover{opacity:1}.uppy-StatusBar-actionCircleBtn:focus{border-radius:50%}.uppy-StatusBar-actionCircleBtn svg{vertical-align:bottom}.uppy-StatusBar-actionBtn{display:inline-block;vertical-align:middle;font-size:10px;line-height:inherit;color:#2275d7}.uppy-size--md .uppy-StatusBar-actionBtn{font-size:11px}.uppy-StatusBar-actionBtn--retry{height:16px;border-radius:8px;margin-right:6px;background-color:#ff4b23;line-height:1;color:#fff;padding:1px 6px 3px 18px;position:relative}.uppy-StatusBar-actionBtn--retry:focus{outline:none}.uppy-StatusBar-actionBtn--retry::-moz-focus-inner{border:0}.uppy-StatusBar-actionBtn--retry:focus{box-shadow:0 0 0 3px rgba(34,117,215,.5)}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--retry:focus{outline:none}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--retry::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--retry:focus{box-shadow:0 0 0 2px rgba(170,225,255,.85)}.uppy-StatusBar-actionBtn--retry:hover{background-color:#f92d00}.uppy-StatusBar-actionBtn--retry svg{position:absolute;top:3px;left:6px}.uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload{font-size:14px;width:100%;padding:15px 10px;color:#fff;background-color:#1bb240;line-height:1}.uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload:hover{background-color:#189c38}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload{background-color:#1c8b37}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload:hover{background-color:#18762f}.uppy-size--md .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload{padding:13px 22px;width:auto}.uppy-StatusBar:not(.is-waiting) .uppy-StatusBar-actionBtn--upload{background-color:transparent;color:#2275d7}.uppy-StatusBar-actionBtn--uploadNewlyAdded{padding-right:3px;padding-left:3px;padding-bottom:1px;border-radius:3px}.uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{outline:none}.uppy-StatusBar-actionBtn--uploadNewlyAdded::-moz-focus-inner{border:0}.uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{box-shadow:0 0 0 3px rgba(34,117,215,.5)}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{outline:none}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--uploadNewlyAdded::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{box-shadow:0 0 0 2px rgba(170,225,255,.85)}.uppy-StatusBar-details{line-height:12px;width:13px;height:13px;display:inline-block;vertical-align:middle;color:#fff;background-color:#939393;border-radius:50%;position:relative;top:0;left:2px;font-size:10px;font-weight:600;text-align:center;cursor:help}.uppy-StatusBar-details:after{line-height:1.3;word-wrap:break-word}.uppy-StatusBar-spinner{animation-name:uppy-StatusBar-spinnerAnimation;animation-duration:1s;animation-iteration-count:infinite;animation-timing-function:linear;margin-right:10px;fill:#2275d7}.uppy-StatusBar.is-postprocessing .uppy-StatusBar-spinner,.uppy-StatusBar.is-preprocessing .uppy-StatusBar-spinner{fill:#f6a623}@keyframes uppy-StatusBar-spinnerAnimation{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.uppy-ProviderBrowser-viewType--grid ul.uppy-ProviderBrowser-list{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:start;align-items:flex-start;padding:6px}.uppy-ProviderBrowser-viewType--grid ul.uppy-ProviderBrowser-list:after{content:"";-ms-flex:auto;flex:auto}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem{width:50%;position:relative;margin:0}.uppy-size--md .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem{width:33.3333%}.uppy-size--lg .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem{width:25%}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem:before{content:"";padding-top:100%;display:block}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--selected img,.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--selected svg{opacity:.85}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview .uppy-ProviderBrowserItem-inner{background-color:hsla(0,0%,57.6%,.2)}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview .uppy-ProviderBrowserItem-inner{background-color:hsla(0,0%,91.8%,.2)}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview svg{fill:rgba(0,0,0,.7);width:30%;height:30%}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview svg{fill:hsla(0,0%,100%,.8)}.uppy-ProviderBrowser-viewType--grid button.uppy-ProviderBrowserItem-inner{border-radius:4px;overflow:hidden;position:absolute;top:7px;left:7px;right:7px;bottom:7px;text-align:center;width:calc(100% - 14px);height:calc(100% - 14px)}.uppy-ProviderBrowser-viewType--grid button.uppy-ProviderBrowserItem-inner:focus{outline:none;box-shadow:0 0 0 3px rgba(34,117,215,.9)}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--grid button.uppy-ProviderBrowserItem-inner{box-shadow:0 0 0 3px rgba(170,225,255,.7)}.uppy-ProviderBrowser-viewType--grid button.uppy-ProviderBrowserItem-inner img{width:100%;height:100%;object-fit:cover;border-radius:4px}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-fakeCheckbox{position:absolute;top:16px;right:16px;width:26px;height:26px;background-color:#2275d7;border-radius:50%;z-index:1002;opacity:0}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-fakeCheckbox:after{width:12px;height:7px;left:7px;top:8px}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-fakeCheckbox--is-checked{opacity:1}.uppy-ProviderBrowser-viewType--list{background-color:#fff}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--list{background-color:#1f1f1f}.uppy-ProviderBrowser-viewType--list li.uppy-ProviderBrowserItem{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:7px 15px;margin:0}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--list li.uppy-ProviderBrowserItem{color:#eaeaea}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-fakeCheckbox{margin-right:15px;height:17px;width:17px;border-radius:3px;background-color:#fff;border:1px solid #cfcfcf}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-fakeCheckbox:focus{border:1px solid #2275d7;box-shadow:0 0 0 3px rgba(34,117,215,.25);outline:none}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-fakeCheckbox:after{opacity:0;height:5px;width:9px;left:3px;top:4px}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-fakeCheckbox:focus{border-color:rgba(2,186,242,.7);box-shadow:0 0 0 3px rgba(2,186,242,.2)}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-fakeCheckbox--is-checked{background-color:#2275d7;border-color:#2275d7}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-fakeCheckbox--is-checked:after{opacity:1}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:2px}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner:focus{outline:none;text-decoration:underline}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner img,.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner svg{margin-right:8px;max-width:20px;max-height:20px}.uppy-ProviderBrowserItem-fakeCheckbox{position:relative;cursor:pointer;-ms-flex-negative:0;flex-shrink:0}.uppy-ProviderBrowserItem-fakeCheckbox:after{content:"";position:absolute;cursor:pointer;border-left:2px solid #eaeaea;border-bottom:2px solid #eaeaea;transform:rotate(-45deg)}[data-uppy-theme=dark] .uppy-ProviderBrowserItem-fakeCheckbox{background-color:#1f1f1f;border-color:#939393}[data-uppy-theme=dark] .uppy-ProviderBrowserItem-fakeCheckbox--is-checked{background-color:#333}.uppy-DashboardContent-panelBody{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex:1;flex:1}[data-uppy-theme=dark] .uppy-DashboardContent-panelBody{background-color:#1f1f1f}.uppy-Provider-auth,.uppy-Provider-empty,.uppy-Provider-error,.uppy-Provider-loading{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex-flow:column wrap;flex-flow:column wrap;-ms-flex:1;flex:1;color:#939393}.uppy-Provider-empty{color:#939393}.uppy-Provider-authIcon svg{width:100px;height:75px;margin-bottom:15px}.uppy-Provider-authTitle{font-size:17px;line-height:1.4;font-weight:400;margin-bottom:30px;padding:0 15px;max-width:500px;text-align:center;color:#757575}.uppy-size--md .uppy-Provider-authTitle{font-size:20px}[data-uppy-theme=dark] .uppy-Provider-authTitle{color:#cfcfcf}.uppy-Provider-breadcrumbs{-ms-flex:1;flex:1;color:#525252;font-size:12px;margin-bottom:10px;text-align:left}.uppy-size--md .uppy-Provider-breadcrumbs{margin-bottom:0}[data-uppy-theme=dark] .uppy-Provider-breadcrumbs{color:#eaeaea}.uppy-Provider-breadcrumbsIcon{display:inline-block;color:#525252;vertical-align:middle;margin-right:4px;line-height:1}.uppy-Provider-breadcrumbsIcon svg{width:13px;height:13px;fill:#525252}.uppy-Provider-breadcrumbs button{display:inline-block;line-height:inherit;padding:4px;border-radius:3px}.uppy-Provider-breadcrumbs button:focus{outline:none}.uppy-Provider-breadcrumbs button::-moz-focus-inner{border:0}.uppy-Provider-breadcrumbs button:hover{color:#1b5dab}.uppy-Provider-breadcrumbs button:focus{background-color:#eceef2}[data-uppy-theme=dark] .uppy-Provider-breadcrumbs button:focus{background-color:#333}.uppy-Provider-breadcrumbs button:hover{text-decoration:underline;cursor:pointer}[data-uppy-theme=dark] .uppy-Provider-breadcrumbs button{color:#eaeaea}.uppy-ProviderBrowser{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1;font-size:14px;font-weight:400;height:100%}.uppy-ProviderBrowser-user{margin:0 8px 0 0;font-weight:500;color:#333}[data-uppy-theme=dark] .uppy-ProviderBrowser-user{color:#eaeaea}.uppy-ProviderBrowser-user:after{content:"\00B7";position:relative;left:4px;color:#939393;font-weight:400}.uppy-ProviderBrowser-header{z-index:1001;border-bottom:1px solid #eaeaea;position:relative}[data-uppy-theme=dark] .uppy-ProviderBrowser-header{border-bottom:1px solid #333}.uppy-ProviderBrowser-headerBar{padding:7px 15px;background-color:#fafafa;z-index:1001;color:#757575;line-height:1.4;font-size:12px}.uppy-size--md .uppy-ProviderBrowser-headerBar{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}[data-uppy-theme=dark] .uppy-ProviderBrowser-headerBar{background-color:#1f1f1f}.uppy-ProviderBrowser-headerBar--simple{text-align:center;display:block;-ms-flex-pack:center;justify-content:center}.uppy-ProviderBrowser-headerBar--simple .uppy-Provider-breadcrumbsWrap{-ms-flex:none;flex:none;display:inline-block;vertical-align:middle}.uppy-ProviderBrowser-search{width:100%;background-color:#fff;position:relative;height:30px;margin-top:10px;margin-bottom:5px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}[data-uppy-theme=dark] .uppy-ProviderBrowser-search{background-color:#1f1f1f}.uppy-ProviderBrowser-searchIcon{position:absolute;width:12px;height:12px;left:16px;z-index:1002;color:#bbb}.uppy-ProviderBrowser-searchInput{width:100%;height:30px;background-color:transparent;outline:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:12px;line-height:1.4;border:0;margin:0 8px;padding-left:27px;z-index:1001;border-radius:4px}[data-uppy-theme=dark] .uppy-ProviderBrowser-searchInput{background-color:#1f1f1f;color:#eaeaea}.uppy-ProviderBrowser-searchInput:focus{outline:0;background-color:#f4f4f4}[data-uppy-theme=dark] .uppy-ProviderBrowser-searchInput:focus{background-color:#333}.uppy-ProviderBrowser-searchClose{position:absolute;width:22px;height:22px;padding:6px;right:12px;top:4px;z-index:1002;color:#939393;cursor:pointer}.uppy-ProviderBrowser-searchClose:hover{color:#757575}.uppy-ProviderBrowser-searchClose svg{vertical-align:text-top}.uppy-ProviderBrowser-searchInput:-ms-input-placeholder{color:#939393;opacity:1}.uppy-ProviderBrowser-searchInput::placeholder{color:#939393;opacity:1}.uppy-ProviderBrowser-userLogout{cursor:pointer;line-height:inherit;color:#2275d7;padding:4px;border-radius:3px}.uppy-ProviderBrowser-userLogout:focus{outline:none}.uppy-ProviderBrowser-userLogout::-moz-focus-inner{border:0}.uppy-ProviderBrowser-userLogout:hover{color:#1b5dab}.uppy-ProviderBrowser-userLogout:focus{background-color:#eceef2}[data-uppy-theme=dark] .uppy-ProviderBrowser-userLogout:focus{background-color:#333}.uppy-ProviderBrowser-userLogout:hover{text-decoration:underline}[data-uppy-theme=dark] .uppy-ProviderBrowser-userLogout{color:#eaeaea}.uppy-ProviderBrowser-body{-ms-flex:1;flex:1;position:relative}.uppy-ProviderBrowser-list{-ms-flex:1;flex:1;position:relative;display:block;width:100%;height:100%;background-color:#fff;border-spacing:0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;position:absolute;top:0;bottom:0;left:0;right:0;list-style:none;margin:0;padding:0}[data-uppy-theme=dark] .uppy-ProviderBrowser-list{background-color:#1f1f1f}.uppy-ProviderBrowserItem-inner{cursor:pointer;font-weight:500;font-size:13px}.uppy-ProviderBrowser-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background-color:#fff;height:65px;border-top:1px solid #eaeaea;padding:0 15px}.uppy-ProviderBrowser-footer button{margin-right:8px}[data-uppy-theme=dark] .uppy-ProviderBrowser-footer{background-color:#1f1f1f;border-top:1px solid #333}.uppy-Dashboard-Item-previewInnerWrap{width:100%;height:100%;overflow:hidden;position:relative;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;box-shadow:0 0 2px 0 rgba(0,0,0,.4);border-radius:3px}.uppy-size--md .uppy-Dashboard-Item-previewInnerWrap{box-shadow:0 1px 2px rgba(0,0,0,.15)}.uppy-Dashboard-Item-previewInnerWrap:after{content:"";position:absolute;left:0;right:0;top:0;bottom:0;background-color:rgba(0,0,0,.65);display:none;z-index:1001}.uppy-Dashboard-Item-previewLink{position:absolute;left:0;right:0;top:0;bottom:0;z-index:1002}.uppy-Dashboard-Item-previewLink:focus{box-shadow:inset 0 0 0 3px #76abe9}[data-uppy-theme=dark] .uppy-Dashboard-Item-previewLink:focus{box-shadow:inset 0 0 0 3px #016c8d}.uppy-Dashboard-Item-preview img.uppy-Dashboard-Item-previewImg{width:100%;height:100%;object-fit:cover;transform:translateZ(0);border-radius:3px}.uppy-Dashboard-Item-progress{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:1002;color:#fff;text-align:center;width:120px;transition:all .35 ease}.uppy-Dashboard-Item-progressIndicator{display:inline-block;width:38px;height:38px;opacity:.9}.uppy-size--md .uppy-Dashboard-Item-progressIndicator{width:55px;height:55px}button.uppy-Dashboard-Item-progressIndicator{cursor:pointer}button.uppy-Dashboard-Item-progressIndicator:focus{outline:none}button.uppy-Dashboard-Item-progressIndicator::-moz-focus-inner{border:0}button.uppy-Dashboard-Item-progressIndicator:focus .uppy-Dashboard-Item-progressIcon--bg,button.uppy-Dashboard-Item-progressIndicator:focus .uppy-Dashboard-Item-progressIcon--retry{fill:#76abe9}.uppy-Dashboard-Item-progressIcon--circle{width:100%;height:100%}.uppy-Dashboard-Item-progressIcon--bg{stroke:hsla(0,0%,100%,.4)}.uppy-Dashboard-Item-progressIcon--progress{stroke:#fff;transition:stroke-dashoffset .5s ease-out}.uppy-Dashboard-Item-progressIcon--play{stroke:#fff;fill:#fff;transition:all .2s}.uppy-Dashboard-Item-progressIcon--cancel{fill:#fff;transition:all .2s}.uppy-Dashboard-Item-progressIcon--pause{stroke:#fff;fill:#fff;transition:all .2s}.uppy-Dashboard-Item-progressIcon--check{fill:#fff;transition:all .2s}.uppy-Dashboard-Item-progressIcon--retry{fill:#fff}.uppy-Dashboard-Item.is-complete .uppy-Dashboard-Item-progress{transform:none;top:-9px;right:-8px;left:auto;width:auto}.uppy-Dashboard-Item.is-error .uppy-Dashboard-Item-progressIndicator{width:18px;height:18px}.uppy-size--md .uppy-Dashboard-Item.is-error .uppy-Dashboard-Item-progressIndicator{width:28px;height:28px}.uppy-Dashboard-Item.is-complete .uppy-Dashboard-Item-progressIndicator{width:18px;height:18px;opacity:1}.uppy-size--md .uppy-Dashboard-Item.is-complete .uppy-Dashboard-Item-progressIndicator{width:22px;height:22px}.uppy-Dashboard-Item.is-processing .uppy-Dashboard-Item-progress{opacity:0}.uppy-Dashboard-Item-fileInfo{padding-right:5px}.uppy-Dashboard-Item-name{font-size:12px;line-height:1.3;font-weight:500;margin-bottom:4px;word-break:break-all;word-wrap:anywhere}[data-uppy-theme=dark] .uppy-Dashboard-Item-name{color:#eaeaea}.uppy-Dashboard-Item-status{font-size:11px;line-height:1.3;font-weight:400;color:#757575}[data-uppy-theme=dark] .uppy-Dashboard-Item-status{color:#bbb}.uppy-Dashboard-Item-statusSize{display:inline-block;vertical-align:bottom;text-transform:uppercase}.uppy-Dashboard-Item-sourceIcon{display:none;vertical-align:bottom;color:#bbb}.uppy-Dashboard-Item-sourceIcon:not(:first-child){position:relative;margin-left:14px}.uppy-Dashboard-Item-sourceIcon svg,.uppy-Dashboard-Item-sourceIcon svg *{max-width:100%;max-height:100%;display:inline-block;vertical-align:text-bottom;overflow:hidden;fill:currentColor;width:11px;height:12px}.uppy-Dashboard-Item-action{cursor:pointer;color:#939393}.uppy-Dashboard-Item-action:focus{outline:none}.uppy-Dashboard-Item-action::-moz-focus-inner{border:0}.uppy-Dashboard-Item-action:focus{box-shadow:0 0 0 3px rgba(34,117,215,.5)}.uppy-Dashboard-Item-action:hover{opacity:1;color:#1f1f1f}[data-uppy-theme=dark] .uppy-Dashboard-Item-action{color:#cfcfcf}[data-uppy-theme=dark] .uppy-Dashboard-Item-action:focus{outline:none}[data-uppy-theme=dark] .uppy-Dashboard-Item-action::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-Dashboard-Item-action:focus{box-shadow:0 0 0 2px rgba(170,225,255,.85)}[data-uppy-theme=dark] .uppy-Dashboard-Item-action:hover{color:#eaeaea}.uppy-Dashboard-Item-action--remove{color:#1f1f1f;opacity:.95}.uppy-Dashboard-Item-action--remove:hover{opacity:1;color:#000}[data-uppy-theme=dark] .uppy-Dashboard-Item-action--remove{color:#525252}[data-uppy-theme=dark] .uppy-Dashboard-Item-action--remove:hover{color:#333}.uppy-Dashboard:not(.uppy-size--md) .uppy-Dashboard-Item-actionWrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.uppy-Dashboard:not(.uppy-size--md) .uppy-Dashboard-Item-action{width:22px;height:22px;padding:3px;margin-left:3px}.uppy-Dashboard:not(.uppy-size--md) .uppy-Dashboard-Item-action:focus{border-radius:3px}.uppy-size--md .uppy-Dashboard-Item-action--copyLink,.uppy-size--md .uppy-Dashboard-Item-action--edit{width:16px;height:16px;padding:0}.uppy-size--md .uppy-Dashboard-Item-action--copyLink:focus,.uppy-size--md .uppy-Dashboard-Item-action--edit:focus{border-radius:3px}.uppy-size--md .uppy-Dashboard-Item-action--remove{z-index:1002;position:absolute;top:-8px;right:-8px;width:18px;height:18px;padding:0}.uppy-size--md .uppy-Dashboard-Item-action--remove:focus{border-radius:50%}.uppy-Dashboard-Item{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-bottom:1px solid #eaeaea;padding:10px 0 10px 10px}[data-uppy-theme=dark] .uppy-Dashboard-Item{border-bottom:1px solid #333}.uppy-size--md .uppy-Dashboard-Item{position:relative;display:block;float:left;margin:5px 15px;padding:0;width:calc(33.333% - 30px);height:215px;border-bottom:0}.uppy-size--lg .uppy-Dashboard-Item{margin:5px 15px;width:calc(25% - 30px);height:190px}.uppy-size--xl .uppy-Dashboard-Item{width:calc(20% - 30px);height:210px}.uppy-Dashboard-Item-preview{position:relative}.uppy-Dashboard:not(.uppy-size--md) .uppy-Dashboard-Item-preview{-ms-flex-negative:0;flex-shrink:0;-ms-flex-positive:0;flex-grow:0;width:50px;height:50px}.uppy-size--md .uppy-Dashboard-Item-preview{width:100%;height:140px}.uppy-size--lg .uppy-Dashboard-Item-preview{height:120px}.uppy-size--xl .uppy-Dashboard-Item-preview{height:140px}.uppy-Dashboard-Item-fileInfoAndButtons{-ms-flex-positive:1;flex-grow:1;padding-right:8px;padding-left:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.uppy-size--md .uppy-Dashboard-Item-fileInfoAndButtons{-ms-flex-align:start;align-items:flex-start;width:100%;padding:9px 0 0}.uppy-Dashboard-Item-fileInfo{-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1}.uppy-Dashboard-Item-actionWrapper{-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0}.uppy-Dashboard-Item.is-error .uppy-Dashboard-Item-previewInnerWrap:after,.uppy-Dashboard-Item.is-inprogress .uppy-Dashboard-Item-previewInnerWrap:after{display:block}.uppy-Dashboard-Item.is-inprogress:not(.is-resumable) .uppy-Dashboard-Item-action--remove{display:none}.uppy-Dashboard-Item-errorDetails{line-height:12px;width:12px;height:12px;display:inline-block;vertical-align:middle;color:#fff;background-color:#939393;border-radius:50%;position:relative;top:-1px;left:6px;font-size:8px;font-weight:600;text-align:center;cursor:help}.uppy-Dashboard-Item-errorDetails:after{line-height:1.3;word-wrap:break-word}.uppy-Dashboard-FileCard{width:100%;height:100%;position:absolute;top:0;left:0;right:0;bottom:0;z-index:1005;box-shadow:0 0 10px 4px rgba(0,0,0,.1);background-color:#fff;border-radius:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.uppy-Dashboard-FileCard .uppy-DashboardContent-bar{border-top-left-radius:5px;border-top-right-radius:5px}.uppy-Dashboard-FileCard .uppy-Dashboard-FileCard-actions{border-bottom-left-radius:5px;border-bottom-right-radius:5px}.uppy-Dashboard-FileCard-inner{height:100%;-ms-flex-positive:1;flex-grow:1;-ms-flex-direction:column;flex-direction:column}.uppy-Dashboard-FileCard-inner,.uppy-Dashboard-FileCard-preview{-ms-flex-negative:1;flex-shrink:1;min-height:0;display:-ms-flexbox;display:flex}.uppy-Dashboard-FileCard-preview{height:60%;-ms-flex-positive:0;flex-grow:0;border-bottom:1px solid #eaeaea;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;position:relative}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-preview{background-color:#333;border-bottom:0}.uppy-Dashboard-FileCard-preview img.uppy-Dashboard-Item-previewImg{max-width:90%;max-height:90%;object-fit:cover;-ms-flex:0 0 auto;flex:0 0 auto;border-radius:3px;box-shadow:0 3px 20px rgba(0,0,0,.15)}.uppy-Dashboard-FileCard-edit{position:absolute;top:10px;right:10px;font-size:13px;background-color:rgba(0,0,0,.5);color:#fff;padding:7px 15px;border-radius:50px}.uppy-Dashboard-FileCard-edit:focus{outline:none}.uppy-Dashboard-FileCard-edit::-moz-focus-inner{border:0}.uppy-Dashboard-FileCard-edit:focus{box-shadow:0 0 0 3px rgba(34,117,215,.5)}.uppy-Dashboard-FileCard-edit:hover{background-color:rgba(0,0,0,.8)}.uppy-Dashboard-FileCard-info{height:40%;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;padding:30px 20px 20px;overflow-y:auto;-webkit-overflow-scrolling:touch}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-info{background-color:#1f1f1f}.uppy-Dashboard-FileCard-fieldset{font-size:0;border:0;padding:0;max-width:640px;margin:auto auto 12px}.uppy-Dashboard-FileCard-label{display:inline-block;vertical-align:middle;width:22%;font-size:12px;color:#525252}.uppy-size--md .uppy-Dashboard-FileCard-label{font-size:14px}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-label{color:#eaeaea}.uppy-Dashboard-FileCard-input{display:inline-block;vertical-align:middle;width:78%}.uppy-Dashboard-FileCard-actions{height:55px;-ms-flex-negative:0;flex-shrink:0;-ms-flex-positive:0;flex-grow:0;border-top:1px solid #eaeaea;padding:0 15px;background-color:#fafafa;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.uppy-size--md .uppy-Dashboard-FileCard-actions{height:65px}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-actions{border-top:1px solid #333;background-color:#1f1f1f}.uppy-Dashboard-FileCard-actionsBtn{margin-right:10px}.uppy-transition-slideDownUp-enter{opacity:.01;transform:translate3d(0,-105%,0);transition:transform .25s ease-in-out,opacity .25s ease-in-out}.uppy-transition-slideDownUp-enter.uppy-transition-slideDownUp-enter-active{opacity:1;transform:translateZ(0)}.uppy-transition-slideDownUp-leave{opacity:1;transform:translateZ(0);transition:transform .25s ease-in-out,opacity .25s ease-in-out}.uppy-transition-slideDownUp-leave.uppy-transition-slideDownUp-leave-active{opacity:.01;transform:translate3d(0,-105%,0)}@keyframes uppy-Dashboard-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes uppy-Dashboard-fadeOut{0%{opacity:1}to{opacity:0}}@keyframes uppy-Dashboard-slideDownAndFadeIn{0%{transform:translate3d(-50%,-70%,0);opacity:0}to{transform:translate3d(-50%,-50%,0);opacity:1}}@keyframes uppy-Dashboard-slideDownAndFadeIn--small{0%{transform:translate3d(0,-20%,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes uppy-Dashboard-slideUpFadeOut{0%{transform:translate3d(-50%,-50%,0);opacity:1}to{transform:translate3d(-50%,-70%,0);opacity:0}}@keyframes uppy-Dashboard-slideUpFadeOut--small{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20%,0);opacity:0}}.uppy-Dashboard--modal{z-index:1001}.uppy-Dashboard--modal[aria-hidden=true]{display:none}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideDownAndFadeIn--small .3s cubic-bezier(0,0,.2,1)}@media only screen and (min-width:820px){.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideDownAndFadeIn .3s cubic-bezier(0,0,.2,1)}}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose>.uppy-Dashboard-overlay{animation:uppy-Dashboard-fadeIn .3s cubic-bezier(0,0,.2,1)}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose.uppy-Dashboard--isClosing>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideUpFadeOut--small .3s cubic-bezier(0,0,.2,1)}@media only screen and (min-width:820px){.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose.uppy-Dashboard--isClosing>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideUpFadeOut .3s cubic-bezier(0,0,.2,1)}}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose.uppy-Dashboard--isClosing>.uppy-Dashboard-overlay{animation:uppy-Dashboard-fadeOut .3s cubic-bezier(0,0,.2,1)}.uppy-Dashboard-isFixed{overflow:hidden;height:100vh}.uppy-Dashboard--modal .uppy-Dashboard-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.5);z-index:1001}.uppy-Dashboard-inner{position:relative;background-color:#fafafa;max-width:100%;max-height:100%;outline:none;border:1px solid #eaeaea;border-radius:5px}.uppy-size--md .uppy-Dashboard-inner{min-height:auto}@media only screen and (min-width:820px){.uppy-Dashboard-inner{width:750px;height:550px}}.uppy-Dashboard--modal .uppy-Dashboard-inner{z-index:1002}[data-uppy-theme=dark] .uppy-Dashboard-inner{background-color:#1f1f1f}.uppy-Dashboard-innerWrap{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;overflow:hidden;position:relative;border-radius:5px;opacity:0}.uppy-Dashboard--isInnerWrapVisible .uppy-Dashboard-innerWrap{opacity:1}.uppy-Dashboard--modal .uppy-Dashboard-inner{position:fixed;top:35px;left:15px;right:15px;bottom:15px;border:none}@media only screen and (min-width:820px){.uppy-Dashboard--modal .uppy-Dashboard-inner{top:50%;left:50%;transform:translate(-50%,-50%);box-shadow:0 5px 15px 4px rgba(0,0,0,.15)}}.uppy-Dashboard-close{display:block;position:absolute;top:-33px;right:-2px;cursor:pointer;color:hsla(0,0%,100%,.9);font-size:27px;z-index:1005}.uppy-Dashboard-close:focus{outline:none}.uppy-Dashboard-close::-moz-focus-inner{border:0}.uppy-Dashboard-close:focus{color:#8cb8ed}@media only screen and (min-width:820px){.uppy-Dashboard-close{font-size:35px;top:-10px;right:-35px}}.uppy-Dashboard-AddFiles{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;height:100%;position:relative;text-align:center}[data-uppy-drag-drop-supported=true] .uppy-Dashboard-AddFiles{margin:7px;height:calc(100% - 14px);border-radius:3px;border:1px dashed #dfdfdf}.uppy-Dashboard-AddFilesPanel .uppy-Dashboard-AddFiles{border:none;height:calc(100% - 54px)}.uppy-Dashboard--modal .uppy-Dashboard-AddFiles{border-color:#cfcfcf}[data-uppy-theme=dark] .uppy-Dashboard-AddFiles{border-color:#757575}.uppy-Dashboard-AddFiles-info{padding-top:15px;padding-bottom:15px;margin-top:auto;display:none}.uppy-size--height-md .uppy-Dashboard-AddFiles-info{display:block}.uppy-size--md .uppy-Dashboard-AddFiles-info{position:absolute;bottom:25px;left:0;right:0;padding-top:30px;padding-bottom:0}[data-uppy-num-acquirers="0"] .uppy-Dashboard-AddFiles-info{margin-top:0}.uppy-Dashboard-browse{cursor:pointer;color:rgba(34,117,215,.9)}.uppy-Dashboard-browse:focus{outline:none}.uppy-Dashboard-browse::-moz-focus-inner{border:0}.uppy-Dashboard-browse:focus,.uppy-Dashboard-browse:hover{border-bottom:1px solid #2275d7}[data-uppy-theme=dark] .uppy-Dashboard-browse{color:rgba(2,186,242,.9)}[data-uppy-theme=dark] .uppy-Dashboard-browse:focus,[data-uppy-theme=dark] .uppy-Dashboard-browse:hover{border-bottom:1px solid #02baf2}.uppy-Dashboard-browseBtn{display:block;font-size:14px;font-weight:500;margin-top:8px;margin-bottom:5px;width:100%}.uppy-size--md .uppy-Dashboard-browseBtn{font-size:15px;width:auto;margin:15px auto;padding:13px 44px}.uppy-Dashboard-AddFiles-list{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;margin-top:2px;padding:2px 0;width:100%}.uppy-size--md .uppy-Dashboard-AddFiles-list{-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;max-width:600px;overflow-y:visible;margin-top:15px;padding-top:0;-ms-flex:none;flex:none}.uppy-DashboardTab{width:100%;text-align:center;border-bottom:1px solid #eaeaea}[data-uppy-theme=dark] .uppy-DashboardTab{border-bottom:1px solid #333}.uppy-size--md .uppy-DashboardTab{display:inline-block;width:auto;margin-bottom:10px;border-bottom:none}.uppy-DashboardTab-btn{width:100%;height:100%;cursor:pointer;border:0;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;color:#525252;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:12px 15px;line-height:1;text-align:center}.uppy-DashboardTab-btn:focus{outline:none}.uppy-size--md .uppy-DashboardTab-btn{width:86px;margin-right:1px;-ms-flex-direction:column;flex-direction:column;padding:10px 3px;border-radius:5px}[data-uppy-theme=dark] .uppy-DashboardTab-btn{color:#eaeaea}.uppy-DashboardTab-btn::-moz-focus-inner{border:0}.uppy-DashboardTab-btn:hover{background-color:#f1f3f6}[data-uppy-theme=dark] .uppy-DashboardTab-btn:hover{background-color:#333}.uppy-DashboardTab-btn:active,.uppy-DashboardTab-btn:focus{background-color:#eceef2}[data-uppy-theme=dark] .uppy-DashboardTab-btn:active,[data-uppy-theme=dark] .uppy-DashboardTab-btn:focus{background-color:#525252}.uppy-DashboardTab-btn svg{max-width:100%;max-height:100%;display:inline-block;vertical-align:text-top;overflow:hidden;transition:transform .15s ease-in-out;margin-right:10px}.uppy-size--md .uppy-DashboardTab-btn svg{margin-right:0}.uppy-DashboardTab-name{font-size:14px;font-weight:500}.uppy-size--md .uppy-DashboardTab-name{font-size:11px;line-height:15px;margin-top:8px;margin-bottom:0}.uppy-DashboardTab svg{width:23px;height:23px;vertical-align:middle}.uppy-size--md .uppy-DashboardTab svg{width:30px;height:30px}.uppy-Dashboard-input{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1}.uppy-DashboardContent-bar{-ms-flex-negative:0;flex-shrink:0;height:40px;width:100%;padding:0 10px;z-index:1004;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;position:relative;border-bottom:1px solid #eaeaea;background-color:#fafafa}.uppy-size--md .uppy-DashboardContent-bar{height:50px;padding:0 15px}[data-uppy-theme=dark] .uppy-DashboardContent-bar{background-color:#1f1f1f;border-bottom:1px solid #333}.uppy-DashboardContent-title{position:absolute;top:0;left:0;right:0;text-align:center;font-size:12px;line-height:40px;font-weight:500;width:100%;max-width:170px;text-overflow:ellipsis;white-space:nowrap;overflow-x:hidden;margin:auto}.uppy-size--md .uppy-DashboardContent-title{font-size:14px;line-height:50px;max-width:300px}[data-uppy-theme=dark] .uppy-DashboardContent-title{color:#eaeaea}.uppy-DashboardContent-back{background:none;-webkit-appearance:none;font-family:inherit;font-size:inherit;line-height:1;border:0;color:inherit;border-radius:3px;font-size:12px;font-weight:400;cursor:pointer;color:#2275d7;padding:7px 6px;margin:0 0 0 -6px}.uppy-DashboardContent-back:focus{outline:none}.uppy-DashboardContent-back::-moz-focus-inner{border:0}.uppy-DashboardContent-back:hover{color:#1b5dab}.uppy-DashboardContent-back:focus{background-color:#eceef2}[data-uppy-theme=dark] .uppy-DashboardContent-back:focus{background-color:#333}.uppy-size--md .uppy-DashboardContent-back{font-size:14px}[data-uppy-theme=dark] .uppy-DashboardContent-back{color:#02baf2}.uppy-DashboardContent-addMore{background:none;-webkit-appearance:none;font-family:inherit;font-size:inherit;line-height:1;border:0;color:inherit;border-radius:3px;font-weight:500;cursor:pointer;color:#2275d7;width:29px;height:29px;padding:7px 8px;margin:0 -5px 0 0}.uppy-DashboardContent-addMore:focus{outline:none}.uppy-DashboardContent-addMore::-moz-focus-inner{border:0}.uppy-DashboardContent-addMore:hover{color:#1b5dab}.uppy-DashboardContent-addMore:focus{background-color:#eceef2}[data-uppy-theme=dark] .uppy-DashboardContent-addMore:focus{background-color:#333}.uppy-size--md .uppy-DashboardContent-addMore{font-size:14px;width:auto;height:auto;margin-right:-8px}[data-uppy-theme=dark] .uppy-DashboardContent-addMore{color:#02baf2}.uppy-DashboardContent-addMore svg{vertical-align:baseline;margin-right:4px}.uppy-size--md .uppy-DashboardContent-addMore svg{width:11px;height:11px}.uppy-DashboardContent-addMoreCaption{display:none}.uppy-size--md .uppy-DashboardContent-addMoreCaption{display:inline}.uppy-DashboardContent-panel{background-color:#f5f5f5;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.uppy-Dashboard-AddFilesPanel,.uppy-DashboardContent-panel{position:absolute;top:0;bottom:0;left:0;right:0;overflow:hidden;z-index:1005;border-radius:5px;display:-ms-flexbox;display:flex}.uppy-Dashboard-AddFilesPanel{background:#fafafa;background:linear-gradient(0deg,#fafafa 35%,hsla(0,0%,98%,.85));box-shadow:0 0 10px 5px rgba(0,0,0,.15);-ms-flex-direction:column;flex-direction:column}[data-uppy-theme=dark] .uppy-Dashboard-AddFilesPanel{background-color:#333;background:linear-gradient(0deg,#1f1f1f 35%,rgba(31,31,31,.85))}.uppy-Dashboard--isAddFilesPanelVisible .uppy-Dashboard-files{filter:blur(2px)}.uppy-Dashboard-progress{position:absolute;bottom:0;left:0;width:100%;height:12%}.uppy-Dashboard-progressBarContainer.is-active{z-index:1004;position:absolute;top:0;left:0;width:100%;height:100%}.uppy-Dashboard-filesContainer{position:relative;overflow-y:hidden;margin:0;-ms-flex:1;flex:1}.uppy-Dashboard-filesContainer:after{content:"";display:table;clear:both}.uppy-Dashboard-files{margin:0;padding:0 0 10px;overflow-y:auto;-webkit-overflow-scrolling:touch;-ms-flex:1;flex:1}.uppy-size--md .uppy-Dashboard-files{padding-top:10px}.uppy-Dashboard-dropFilesHereHint{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;visibility:hidden;position:absolute;top:7px;right:7px;bottom:7px;left:7px;padding-top:90px;border:1px dashed #2275d7;border-radius:3px;z-index:2000;text-align:center;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='48' height='48' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 1v1C11.85 2 2 11.85 2 24s9.85 22 22 22 22-9.85 22-22S36.15 2 24 2V1zm0 0V0c13.254 0 24 10.746 24 24S37.254 48 24 48 0 37.254 0 24 10.746 0 24 0v1zm7.707 19.293a.999.999 0 11-1.414 1.414L25 16.414V34a1 1 0 11-2 0V16.414l-5.293 5.293a.999.999 0 11-1.414-1.414l7-7a.999.999 0 011.414 0l7 7z' fill='%232275D7'/%3E%3C/svg%3E");background-position:50% 50%;background-repeat:no-repeat;color:#757575;font-size:16px}[data-uppy-theme=dark] .uppy-Dashboard-dropFilesHereHint{color:#bbb;border-color:#02baf2;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='48' height='48' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 1v1C11.85 2 2 11.85 2 24s9.85 22 22 22 22-9.85 22-22S36.15 2 24 2V1zm0 0V0c13.254 0 24 10.746 24 24S37.254 48 24 48 0 37.254 0 24 10.746 0 24 0v1zm7.707 19.293a.999.999 0 11-1.414 1.414L25 16.414V34a1 1 0 11-2 0V16.414l-5.293 5.293a.999.999 0 11-1.414-1.414l7-7a.999.999 0 011.414 0l7 7z' fill='%2302BAF2'/%3E%3C/svg%3E")}.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-dropFilesHereHint{visibility:visible}.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-files,.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-progressindicators,.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-DashboardContent-bar{opacity:.15}.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-AddFiles{opacity:.03}.uppy-Dashboard-dropFilesIcon{display:none;margin-bottom:15px}.uppy-size--md.uppy-size--height-md .uppy-Dashboard-dropFilesIcon{display:block}.uppy-Dashboard-AddFiles-title{font-size:17px;line-height:1.35;font-weight:500;color:#000;margin-top:15px;margin-bottom:5px;text-align:left;padding:0 15px;width:100%}.uppy-size--md .uppy-Dashboard-AddFiles-title{font-size:25px;margin-top:5px;font-weight:400;text-align:center;max-width:480px}[data-uppy-num-acquirers="0"] .uppy-Dashboard-AddFiles-title{text-align:center}[data-uppy-theme=dark] .uppy-Dashboard-AddFiles-title{color:#eaeaea}.uppy-Dashboard-AddFiles-title button{font-weight:500}.uppy-size--md .uppy-Dashboard-AddFiles-title button{font-weight:400}.uppy-Dashboard-note{font-size:14px;line-height:1.25;text-align:center;color:#757575;max-width:350px;margin:auto;padding:0 15px}.uppy-size--md .uppy-Dashboard-note{font-size:15px;line-height:1.35;max-width:600px}[data-uppy-theme=dark] .uppy-Dashboard-note{color:#cfcfcf}a.uppy-Dashboard-poweredBy{display:inline-block;text-align:center;font-size:11px;color:#939393;text-decoration:none;margin-top:8px}.uppy-Dashboard-poweredByIcon{stroke:#939393;fill:none;margin-left:1px;margin-right:1px;position:relative;top:1px;opacity:.9;vertical-align:text-top}.uppy-Dashboard-Item-previewIcon{width:25px;height:25px;z-index:100;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.uppy-size--md .uppy-Dashboard-Item-previewIcon{width:38px;height:38px}.uppy-Dashboard-Item-previewIcon svg{width:100%;height:100%}.uppy-Dashboard-Item-previewIconWrap{height:76px;max-height:75%;position:relative}.uppy-Dashboard-Item-previewIconBg{width:100%;height:100%;filter:drop-shadow(rgba(0,0,0,.1) 0 1px 1px)}.uppy-Dashboard-upload{position:relative;width:50px;height:50px}.uppy-size--md .uppy-Dashboard-upload{width:60px;height:60px}.uppy-Dashboard-upload .uppy-c-icon{position:relative;top:1px;width:50%}.uppy-Dashboard-uploadCount{position:absolute;top:-12px;right:-12px;background-color:#1bb240;color:#fff;border-radius:50%;width:16px;height:16px;line-height:16px;font-size:8px}.uppy-size--md .uppy-Dashboard-uploadCount{width:18px;height:18px;line-height:18px;font-size:9px}.uppy-DragDrop-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:7px;background-color:#fff;cursor:pointer;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;max-width:100%}.uppy-DragDrop-container:focus{outline:none;box-shadow:0 0 0 3px rgba(34,117,215,.4)}.uppy-DragDrop-container::-moz-focus-inner{border:0}.uppy-DragDrop-inner{margin:0;text-align:center;padding:80px 20px;line-height:1.4}.uppy-DragDrop-arrow{width:60px;height:60px;fill:#e0e0e0;margin-bottom:17px}.uppy-DragDrop--isDragDropSupported{border:2px dashed #adadad}.uppy-DragDrop--isDraggingOver{border:2px dashed #2275d7;background:#eaeaea}.uppy-DragDrop--isDraggingOver .uppy-DragDrop-arrow{fill:#939393}.uppy-DragDrop-label{display:block;font-size:1.15em;margin-bottom:5px}.uppy-DragDrop-browse{color:#2275d7;cursor:pointer}.uppy-DragDrop-note{font-size:1em;color:#adadad}.uppy-FileInput-container{margin-bottom:15px}.uppy-FileInput-btn{background:none;-webkit-appearance:none;font-family:inherit;font-size:inherit;line-height:1;margin:0;color:inherit;font-family:sans-serif;font-size:.85em;padding:10px 15px;color:#14457f;border:1px solid #14457f;border-radius:8px;cursor:pointer}.uppy-FileInput-btn:hover{background-color:#14457f;color:#fff}.uppy-ProgressBar{position:absolute;top:0;left:0;width:100%;height:3px;z-index:10000;transition:height .2s}.uppy-ProgressBar[aria-hidden=true]{height:0}.uppy-ProgressBar-inner{background-color:#2275d7;box-shadow:0 0 10px rgba(34,117,215,.7);height:100%;width:0;transition:width .4s ease}.uppy-ProgressBar-percentage{display:none;text-align:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff}.uppy-Url{width:100%;height:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}[data-uppy-theme=dark] .uppy-Url{background-color:#1f1f1f}.uppy-Url-input{width:90%;max-width:650px;margin-bottom:15px}.uppy-size--md .uppy-Url-input{margin-bottom:20px}.uppy-Url-importButton{padding:13px 25px}.uppy-size--md .uppy-Url-importButton{padding:13px 30px}.uppy-Webcam-container{width:100%;height:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}.uppy-Webcam-videoContainer{width:100%;-ms-flex:1;flex:1;-ms-flex-positive:1;flex-grow:1;overflow:hidden;background-color:#333;text-align:center;position:relative}.uppy-Webcam-video{max-width:100%;max-height:100%;position:absolute;top:0;right:0;bottom:0;left:0;margin:auto}.uppy-Webcam-video--mirrored{transform:scaleX(-1)}.uppy-Webcam-buttonContainer{width:100%;height:75px;border-top:1px solid #eaeaea;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:0 20px}.uppy-Webcam-button{width:45px;height:45px;border-radius:50%;background-color:#e32437;color:#fff;cursor:pointer;transition:all .3s}.uppy-Webcam-button:focus{outline:none}.uppy-Webcam-button::-moz-focus-inner{border:0}.uppy-Webcam-button:focus{box-shadow:0 0 0 3px rgba(34,117,215,.5)}[data-uppy-theme=dark] .uppy-Webcam-button:focus{outline:none}[data-uppy-theme=dark] .uppy-Webcam-button::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-Webcam-button:focus{box-shadow:0 0 0 2px rgba(170,225,255,.85)}.uppy-Webcam-button svg{width:30px;height:30px;max-width:100%;max-height:100%;display:inline-block;vertical-align:text-top;overflow:hidden;fill:currentColor}.uppy-size--md .uppy-Webcam-button{width:60px;height:60px}.uppy-Webcam-button:hover{background-color:#d31b2d}.uppy-Webcam-button--picture{margin-right:12px}.uppy-Webcam-permissons{padding:15px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex-flow:column wrap;flex-flow:column wrap;height:100%;-ms-flex:1;flex:1}.uppy-Webcam-permissons p{max-width:450px;line-height:1.3;text-align:center;line-height:1.45;color:#939393;margin:0}.uppy-Webcam-permissonsIcon svg{width:100px;height:75px;color:#bbb;margin-bottom:30px}.uppy-Webcam-recordingLength{position:absolute;right:20px;color:#757575;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.uppy-Webcam-title{font-size:22px;line-height:1.35;font-weight:400;margin:0 0 5px;padding:0 15px;max-width:500px;text-align:center;color:#333}[data-uppy-theme=dark] .uppy-Webcam-title{color:#eaeaea}.uppy-ScreenCapture-container{width:100%;height:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}.uppy-ScreenCapture-videoContainer{width:100%;-ms-flex:1;flex:1;-ms-flex-positive:1;flex-grow:1;overflow:hidden;background-color:#333;text-align:center;position:relative}.uppy-size--md .uppy-ScreenCapture-videoContainer{max-width:100%}.uppy-ScreenCapture-video{max-width:100%;max-height:100%;position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;outline:0}.uppy-ScreenCapture-buttonContainer{width:100%;height:75px;border-top:1px solid #eaeaea;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:0 20px;background-color:#fff}[data-uppy-theme=dark] .uppy-ScreenCapture-buttonContainer{background-color:#1f1f1f;border-top:1px solid #333}.uppy-ScreenCapture-button{width:45px;height:45px;border-radius:50%;color:#fff;cursor:pointer;transition:all .3s}.uppy-ScreenCapture-button:focus{outline:none}.uppy-ScreenCapture-button::-moz-focus-inner{border:0}.uppy-ScreenCapture-button:focus{box-shadow:0 0 0 3px rgba(34,117,215,.5)}[data-uppy-theme=dark] .uppy-ScreenCapture-button:focus{outline:none}[data-uppy-theme=dark] .uppy-ScreenCapture-button::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-ScreenCapture-button:focus{box-shadow:0 0 0 2px rgba(170,225,255,.85)}.uppy-size--md .uppy-ScreenCapture-button{width:60px;height:60px}.uppy-ScreenCapture-button:hover{background-color:#d31b2d}.uppy-ScreenCapture-button svg{width:30px;height:30px;max-width:100%;max-height:100%;display:inline-block;vertical-align:text-top;overflow:hidden;fill:currentColor}.uppy-ScreenCapture-button--submit{background-color:#2275d7;margin-left:12px}.uppy-ScreenCapture-button--submit:hover{background-color:#1f69c1}.uppy-ScreenCapture-button--submit:disabled{background-color:#939393;cursor:default}.uppy-ScreenCapture-button--submit:disabled:hover{background-color:#eaeaea}.uppy-ScreenCapture-title{font-size:22px;line-height:1.35;font-weight:400;margin:0 0 5px;padding:0 15px;max-width:500px;text-align:center;color:#333}.uppy-ScreenCapture-icon--stream{position:absolute;right:0;top:0;margin:1rem;z-index:1}.uppy-ScreenCapture-icon--stream svg{fill:#939393}.uppy-ScreenCapture-icon--streamActive svg{animation:uppy-ScreenCapture-icon--blink 1s cubic-bezier(.47,0,.75,.72) infinite}@keyframes uppy-ScreenCapture-icon--blink{0%{fill:#2275d7}50%{fill:#939393}to{fill:#2275d7}}.uppy-ScreenCapture-button--video{color:#fff;background:#e32437}.uppy-ScreenCapture-button--video:hover{background-color:#bc1828} + +/*! + * Cropper.js v1.5.6 + * https://fengyuanchen.github.io/cropperjs + * + * Copyright 2015-present Chen Fengyuan + * Released under the MIT license + * + * Date: 2019-10-04T04:33:44.164Z + */.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}.uppy-ImageCropper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:100%;height:100%}.uppy-ImageCropper-container{-ms-flex-positive:1;flex-grow:1}.uppy-ImageCropper-image{display:block;max-height:400px}.uppy-ImageCropper-controls{position:absolute;bottom:15px;left:50%;transform:translateX(-50%);background-color:rgba(0,0,0,.6);color:#fff;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.uppy-ImageCropper-controls button{width:35px;height:35px}.uppy-ImageCropper-controls button svg{padding:3px}.uppy-size--md .uppy-ImageCropper-controls button{width:40px;height:40px}.uppy-size--md .uppy-ImageCropper-controls button svg{padding:1px}.uppy-ImageCropper-controls button:hover{background-color:rgba(34,117,215,.8)}.uppy-ImageCropper-controls button:focus{outline:none;background-color:rgba(34,117,215,.8)} \ No newline at end of file Index: lams_central/web/includes/javascript/uppy.min.js =================================================================== diff -u --- lams_central/web/includes/javascript/uppy.min.js (revision 0) +++ lams_central/web/includes/javascript/uppy.min.js (revision 49b072598933566cedd795667351678071f03004) @@ -0,0 +1,2 @@ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Uppy=e()}}(function(){var e,t,r,n=function(e){var t;return function(r){return t||e(t={exports:{},parent:r},t.exports),t.exports}},i=n(function(e,t){var r=Ju("socket.io-client");e.exports=t=i;var n=t.managers={};function i(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,o=Zu(e),s=o.source,a=o.id,u=o.path,l=n[a]&&u in n[a].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||l?(r("ignoring socket cache for %s",s),i=sp(s,t)):(n[a]||(r("new io instance for %s",s),n[a]=sp(s,t)),i=n[a]),o.query&&!t.query&&(t.query=o.query),i.socket(o.path,t)}t.protocol=fl.protocol,t.connect=i,t.Manager=sp,t.Socket=Zc}),o=n(function(e,t){}),s=n(function(e,t){(function(e){"use strict";t.Buffer=e,t.INSPECT_MAX_BYTES=50;var r=2147483647;function n(t){if(t>r)throw new RangeError('The value "'+t+'" is invalid for option "size"');var n=new Uint8Array(t);return n.__proto__=e.prototype,n}function e(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return s(e)}return i(e,t,r)}function i(t,r,i){if("string"==typeof t)return function(t,r){if("string"==typeof r&&""!==r||(r="utf8"),!e.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var i=0|l(t,r),o=n(i),s=o.write(t,r);return s!==i&&(o=o.slice(0,s)),o}(t,r);if(ArrayBuffer.isView(t))return a(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(B(t,ArrayBuffer)||t&&B(t.buffer,ArrayBuffer))return function(t,r,n){if(r<0||t.byteLength=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function l(t,r){if(e.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var o=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return R(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return x(t).length;default:if(o)return i?-1:R(t).length;r=(""+r).toLowerCase(),o=!0}}function c(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function p(t,r,n,i,o){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),I(n=+n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof r&&(r=e.from(r,i)),e.isBuffer(r))return 0===r.length?-1:d(t,r,n,i,o);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,n):Uint8Array.prototype.lastIndexOf.call(t,r,n):d(t,[r],n,i,o);throw new TypeError("val must be string, number or Buffer")}function d(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var p=!0,d=0;di&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function b(e,t,r){return 0===t&&r===e.length?ln.fromByteArray(e):ln.fromByteArray(e.slice(t,r))}function w(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+p<=r)switch(p){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&l)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,p=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=p}return function(e){var t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);for(var r="",n=0;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return w(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},e.prototype.toLocaleString=e.prototype.toString,e.prototype.equals=function(t){if(!e.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===e.compare(this,t)},e.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),""},e.prototype.compare=function(t,r,n,i,o){if(B(t,Uint8Array)&&(t=e.from(t,t.offset,t.byteLength)),!e.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),r<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(this===t)return 0;for(var s=(o>>>=0)-(i>>>=0),a=(n>>>=0)-(r>>>=0),u=Math.min(s,a),l=this.slice(i,o),c=t.slice(r,n),p=0;p>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return h(this,e,t,r);case"utf8":case"utf-8":return f(this,e,t,r);case"ascii":return y(this,e,t,r);case"latin1":case"binary":return g(this,e,t,r);case"base64":return v(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function S(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;ii)&&(r=i);for(var o="",s=t;sr)throw new RangeError("Trying to access beyond buffer length")}function F(t,r,n,i,o,s){if(!e.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||rt.length)throw new RangeError("Index out of range")}function A(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(e,t,r,n,i){return t=+t,r>>>=0,i||A(e,0,r,4),mn.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||A(e,0,r,8),mn.write(e,t,r,n,52,8),r+8}e.prototype.slice=function(t,r){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r>>=0,t>>>=0,r||E(e,t,this.length);for(var n=this[e],i=1,o=0;++o>>=0,t>>>=0,r||E(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},e.prototype.readUInt8=function(e,t){return e>>>=0,t||E(e,1,this.length),this[e]},e.prototype.readUInt16LE=function(e,t){return e>>>=0,t||E(e,2,this.length),this[e]|this[e+1]<<8},e.prototype.readUInt16BE=function(e,t){return e>>>=0,t||E(e,2,this.length),this[e]<<8|this[e+1]},e.prototype.readUInt32LE=function(e,t){return e>>>=0,t||E(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},e.prototype.readUInt32BE=function(e,t){return e>>>=0,t||E(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},e.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||E(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},e.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||E(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},e.prototype.readInt8=function(e,t){return e>>>=0,t||E(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},e.prototype.readInt16LE=function(e,t){e>>>=0,t||E(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},e.prototype.readInt16BE=function(e,t){e>>>=0,t||E(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},e.prototype.readInt32LE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},e.prototype.readInt32BE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},e.prototype.readFloatLE=function(e,t){return e>>>=0,t||E(e,4,this.length),mn.read(this,e,!0,23,4)},e.prototype.readFloatBE=function(e,t){return e>>>=0,t||E(e,4,this.length),mn.read(this,e,!1,23,4)},e.prototype.readDoubleLE=function(e,t){return e>>>=0,t||E(e,8,this.length),mn.read(this,e,!0,52,8)},e.prototype.readDoubleBE=function(e,t){return e>>>=0,t||E(e,8,this.length),mn.read(this,e,!1,52,8)},e.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||F(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,n||F(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},e.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||F(this,e,t,1,255,0),this[t]=255&e,t+1},e.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||F(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},e.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||F(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},e.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||F(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},e.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||F(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},e.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);F(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+r},e.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);F(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},e.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||F(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},e.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||F(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},e.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||F(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},e.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||F(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},e.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},e.prototype.writeFloatLE=function(e,t,r){return O(this,e,t,!0,r)},e.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},e.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},e.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},e.prototype.copy=function(t,r,n,i){if(!e.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r=0;--s)t[s+r]=this[s+n];else Uint8Array.prototype.set.call(t,this.subarray(n,i),r);return o},e.prototype.fill=function(t,r,n,i){if("string"==typeof t){if("string"==typeof r?(i=r,r=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!e.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===t.length){var o=t.charCodeAt(0);("utf8"===i&&o<128||"latin1"===i)&&(t=o)}}else"number"==typeof t&&(t&=255);if(r<0||this.length>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=r;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function x(e){return ln.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(T,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function B(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}}).call(this,s({}).Buffer)}),a=e={};function u(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function c(e){if(t===setTimeout)return setTimeout(e,0);if((t===u||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:u}catch(e){t=u}try{r="function"==typeof clearTimeout?clearTimeout:l}catch(e){r=l}}();var p,d=[],f=!1,y=-1;function g(){f&&p&&(f=!1,p.length?d=p.concat(d):y=-1,d.length&&v())}function v(){if(!f){var e=c(g);f=!0;for(var t=d.length;t;){for(p=d,d=[];++y1)for(var r=1;r-1};function i(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function o(e){return"string"!=typeof e&&(e=String(e)),e}function s(e){var r={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(r[Symbol.iterator]=function(){return r}),r}function a(e){this.map={},e instanceof a?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function u(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function l(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function c(e){var t=new FileReader,r=l(t);return t.readAsArrayBuffer(e),r}function p(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(e){var r;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:t.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:t.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():t.arrayBuffer&&t.blob&&(r=e)&&DataView.prototype.isPrototypeOf(r)?(this._bodyArrayBuffer=p(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||n(e))?this._bodyArrayBuffer=p(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=u(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?u(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(c)}),this.text=function(){var e,t,r,n=u(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=l(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function y(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}}),t}function g(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new a(t.headers),this.url=t.url||"",this._initBody(e)}f.prototype.clone=function(){return new f(this,{body:this._bodyInit})},d.call(f.prototype),d.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new a(this.headers),url:this.url})},g.error=function(){var e=new g(null,{status:0,statusText:""});return e.type="error",e};var v=[301,302,303,307,308];g.redirect=function(e,t){if(-1===v.indexOf(t))throw new RangeError("Invalid status code");return new g(null,{status:t,headers:{location:e}})},e.DOMException=self.DOMException;try{new e.DOMException}catch(hc){e.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function m(r,n){return new Promise(function(i,o){var s=new f(r,n);if(s.signal&&s.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function l(){u.abort()}u.onload=function(){var e,t,r={status:u.status,statusText:u.statusText,headers:(e=u.getAllResponseHeaders()||"",t=new a,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}}),t)};r.url="responseURL"in u?u.responseURL:r.headers.get("X-Request-URL");var n="response"in u?u.response:u.responseText;i(new g(n,r))},u.onerror=function(){o(new TypeError("Network request failed"))},u.ontimeout=function(){o(new TypeError("Network request failed"))},u.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},u.open(s.method,s.url,!0),"include"===s.credentials?u.withCredentials=!0:"omit"===s.credentials&&(u.withCredentials=!1),"responseType"in u&&t.blob&&(u.responseType="blob"),s.headers.forEach(function(e,t){u.setRequestHeader(t,e)}),s.signal&&(s.signal.addEventListener("abort",l),u.onreadystatechange=function(){4===u.readyState&&s.signal.removeEventListener("abort",l)}),u.send(void 0===s._bodyInit?null:s._bodyInit)})}m.polyfill=!0,self.fetch||(self.fetch=m,self.Headers=a,self.Request=f,self.Response=g),e.Headers=a,e.Request=f,e.Response=g,e.fetch=m,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof S.exports?_(S.exports):_(this.WHATWGFetch={}),S=S.exports;var k=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function C(){return(C=Object.assign||function(e){for(var t=1;t=7&&t<=10},H.fingerprint=R,I=H;var V={};(function(e){var t="Expected a function",r=NaN,n="[object Symbol]",i=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,u=parseInt,l="object"==typeof e&&e&&e.Object===Object&&e,c="object"==typeof self&&self&&self.Object===Object&&self,p=l||c||Function("return this")(),d=Object.prototype.toString,h=Math.max,f=Math.min,y=function(){return p.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&d.call(e)==n}(e))return r;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var l=s.test(e);return l||a.test(e)?u(e.slice(2),l?2:8):o.test(e)?r:+e}V=function(e,r,n){var i=!0,o=!0;if("function"!=typeof e)throw new TypeError(t);return g(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),function(e,r,n){var i,o,s,a,u,l,c=0,p=!1,d=!1,m=!0;if("function"!=typeof e)throw new TypeError(t);function b(t){var r=i,n=o;return i=o=void 0,c=t,a=e.apply(n,r)}function w(e){var t=e-l;return void 0===l||t>=r||t<0||d&&e-c>=s}function _(){var e=y();if(w(e))return S(e);u=setTimeout(_,function(e){var t=r-(e-l);return d?f(t,s-(e-c)):t}(e))}function S(e){return u=void 0,m&&i?b(e):(i=o=void 0,a)}function k(){var e=y(),t=w(e);if(i=arguments,o=this,l=e,t){if(void 0===u)return function(e){return c=e,u=setTimeout(_,r),p?b(e):a}(l);if(d)return u=setTimeout(_,r),b(l)}return void 0===u&&(u=setTimeout(_,r)),a}return r=v(r)||0,g(n)&&(p=!!n.leading,s=(d="maxWait"in n)?h(v(n.maxWait)||0,r):s,m="trailing"in n?!!n.trailing:m),k.cancel=function(){void 0!==u&&clearTimeout(u),c=0,i=l=o=u=void 0},k.flush=function(){return void 0===u?a:S(y())},k}(e,r,{leading:i,maxWait:r,trailing:o})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var W=function(e){if("number"!=typeof e||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/Math.pow(1024,n));var i=r[n];return e>=10||e%1==0?(t?"-":"")+e.toFixed(0)+" "+i:(t?"-":"")+e.toFixed(1)+" "+i},G={};function X(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}X.prototype.match=function(e){var t,r,n=!0,i=this.parts,o=i.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(r=(e||"").split(this.separator),t=0;n&&t18||18===n&&i>=18218};function ie(e){return 2!==e.length?0+e:e}var oe=function(){var e=new Date;return ie(e.getHours().toString())+":"+ie(e.getMinutes().toString())+":"+ie(e.getSeconds().toString())},se={justErrorsLogger:{debug:function(){},warn:function(){},error:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n2;)_.push(arguments[s]);for(r&&null!=r.children&&(_.length||_.push(r.children),delete r.children);_.length;)if((i=_.pop())&&void 0!==i.pop)for(s=i.length;s--;)_.push(i[s]);else"boolean"==typeof i&&(i=null),(o="function"!=typeof t)&&(null==i?i="":"number"==typeof i?i=String(i):"string"!=typeof i&&(o=!1)),o&&n?a[a.length-1]+=i:a===S?a=[i]:a.push(i),n=o;var u=new e;return u.nodeName=t,u.children=a,u.attributes=null==r?void 0:r,u.key=null==r?void 0:r.key,void 0!==w.vnode&&w.vnode(u),u}function r(e,t){for(var r in t)e[r]=t[r];return e}function n(e){!e.__d&&(e.__d=!0)&&1==P.push(e)&&(w.debounceRendering||k)(i)}function i(){var e,t=P;for(P=[];e=t.pop();)e.__d&&v(e)}function o(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function s(e){var t=r({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var i in n)void 0===t[i]&&(t[i]=n[i]);return t}function a(e){var t=e.parentNode;t&&t.removeChild(e)}function u(e,t,r,n,i){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)r&&r(null),n&&n(e);else if("class"!==t||i)if("style"===t){if(n&&"string"!=typeof n&&"string"!=typeof r||(e.style.cssText=n||""),n&&"object"==typeof n){if("string"!=typeof r)for(var o in r)o in n||(e.style[o]="");for(var o in n)e.style[o]="number"==typeof n[o]&&!1===C.test(o)?n[o]+"px":n[o]}}else if("dangerouslySetInnerHTML"===t)n&&(e.innerHTML=n.__html||"");else if("o"==t[0]&&"n"==t[1]){var s=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),n?r||e.addEventListener(t,l,s):e.removeEventListener(t,l,s),(e.__l||(e.__l={}))[t]=n}else if("list"!==t&&"type"!==t&&!i&&t in e)!function(e,t,r){try{e[t]=r}catch(n){}}(e,t,null==n?"":n),null!=n&&!1!==n||e.removeAttribute(t);else{var a=i&&t!==(t=t.replace(/^xlink:?/,""));null==n||!1===n?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof n&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),n):e.setAttribute(t,n))}else e.className=n||""}function l(e){return this.__l[e.type](w.event&&w.event(e)||e)}function c(){for(var e;e=E.pop();)w.afterMount&&w.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,r,n,i,l){F++||(A=null!=i&&void 0!==i.ownerSVGElement,O=null!=e&&!("__preactattr_"in e));var p=function e(t,r,n,i,l){var c=t,p=A;if(null!=r&&"boolean"!=typeof r||(r=""),"string"==typeof r||"number"==typeof r)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||l)?t.nodeValue!=r&&(t.nodeValue=r):(c=document.createTextNode(r),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,y,v=r.nodeName;if("function"==typeof v)return function(e,t,r,n){for(var i=e&&e._component,o=i,a=e,u=i&&e._componentConstructor===t.nodeName,l=u,c=s(t);i&&!l&&(i=i.__u);)l=i.constructor===t.nodeName;return i&&l&&(!n||i._component)?(g(i,c,3,r,n),e=i.base):(o&&!u&&(m(o),e=a=null),i=f(t.nodeName,c,r),e&&!i.__b&&(i.__b=e,a=null),g(i,c,1,r,n),e=i.base,a&&e!==a&&(a._component=null,d(a,!1))),e}(t,r,n,i);if(A="svg"===v||"foreignObject"!==v&&A,v=String(v),(!t||!o(t,v))&&(h=v,(y=A?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=y,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,w=c.__preactattr_,_=r.children;if(null==w){w=c.__preactattr_={};for(var S=c.attributes,k=S.length;k--;)w[S[k].name]=S[k].value}return!O&&_&&1===_.length&&"string"==typeof _[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=_[0]&&(b.nodeValue=_[0]):(_&&_.length||null!=b)&&function(t,r,n,i,s){var u,l,c,p,h,f,y,g,v=t.childNodes,m=[],b={},w=0,_=0,S=v.length,k=0,C=r?r.length:0;if(0!==S)for(var P=0;P2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,r){return p(r,e,{},!1,t,!1)},rerender:i,options:w};ae.exports=T}(),ae=ae.exports;var ue=function(e){return e&&"object"==typeof e&&e.nodeType===Node.ELEMENT_NODE},le=function(e,t){return void 0===t&&(t=document),"string"==typeof e?t.querySelector(e):ue(e)?e:void 0};function ce(){return(ce=Object.assign||function(e){for(var t=1;t tag initializing Uppy is right before the closing tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.")},t.render=function(e){throw new Error("Extend the render method to add your plugin to a DOM element")},t.addTarget=function(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")},t.unmount=function(){this.isTargetDOMEl&&this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},t.install=function(){},t.uninstall=function(){this.unmount()},e}();function he(){return(he=Object.assign||function(e){for(var t=1;ti)throw new be(""+this.i18n("youCanOnlyUploadX",{smart_count:i}));if(o&&!o.some(function(e){return e.indexOf("/")>-1?!!t.type&&function(e,t){function r(t){var r=G(t,e,K);return r&&r.length>=2}return t?r(t.split(";")[0]):r}(t.type.replace(/;.*?$/,""),e):"."===e[0]&&t.extension.toLowerCase()===e.substr(1).toLowerCase()})){var s=o.join(", ");throw new be(this.i18n("youCanOnlyUploadFileTypes",{types:s}))}if(n&&null!=t.data.size&&t.data.size>n)throw new be(this.i18n("exceedsSize2",{backwardsCompat:this.i18n("exceedsSize"),size:W(n)}))},n._showOrLogErrorAndThrow=function(e,t){var r=void 0===t?{}:t,n=r.showInformer,i=void 0===n||n,o=r.file,s=void 0===o?null:o,a=r.throwErr,u=void 0===a||a,l="object"==typeof e?e.message:e,c="object"==typeof e&&e.details?e.details:"",p=l;if(c&&(p+=" "+c),e.isRestriction?(this.log(p),this.emit("restriction-failed",s,e)):this.log(p,"error"),i&&this.info({message:l,details:c},"error",5e3),u)throw"object"==typeof e?e:new Error(e)},n._assertNewUploadAllowed=function(e){!1===this.getState().allowNewUpload&&this._showOrLogErrorAndThrow(new be(this.i18n("noNewAlreadyUploading")),{file:e})},n._checkAndCreateFileStateObject=function(e,t){var r=ee(t);t.type=r;var n,i=this.opts.onBeforeFileAdded(t,e);!1===i&&this._showOrLogErrorAndThrow(new be("Cannot add the file because onBeforeFileAdded returned false."),{showInformer:!1,file:t}),"object"==typeof i&&i&&(t=i),n=t.name?t.name:"image"===r.split("/")[0]?r.split("/")[0]+"."+r.split("/")[1]:"noname";var o=Q(n).extension,s=t.isRemote||!1,a=re(t);e[a]&&this._showOrLogErrorAndThrow(new be(this.i18n("noDuplicates",{fileName:n})),{file:t});var u=t.meta||{};u.name=n,u.type=r;var l=isFinite(t.data.size)?t.data.size:null,c={source:t.source||"",id:a,name:n,extension:o||"",meta:he({},this.getState().meta,u),type:r,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isRemote:s,remote:t.remote||"",preview:t.preview};try{this._checkRestrictions(e,c)}catch(hc){this._showOrLogErrorAndThrow(hc,{file:c})}return c},n._startIfAutoProceed=function(){var e=this;this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(function(){e.scheduledAutoProceed=null,e.upload().catch(function(t){t.isRestriction||e.log(t.stack||t.message||t)})},4))},n.addFile=function(e){var t;this._assertNewUploadAllowed(e);var r=this.getState().files,n=this._checkAndCreateFileStateObject(r,e);return this.setState({files:he({},r,(t={},t[n.id]=n,t))}),this.emit("file-added",n),this.log("Added file: "+n.name+", "+n.id+", mime type: "+n.type),this._startIfAutoProceed(),n.id},n.addFiles=function(e){var t=this;this._assertNewUploadAllowed();for(var r=he({},this.getState().files),n=[],i=[],o=0;o5?this.log("Added batch of "+n.length+" files"):Object.keys(n).forEach(function(e){t.log("Added file: "+n[e].name+"\n id: "+n[e].id+"\n type: "+n[e].type)}),n.length>0&&this._startIfAutoProceed(),i.length>0){var a="Multiple errors occurred while adding files:\n";i.forEach(function(e){a+="\n * "+e.message}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:i.length}),details:a},"error",5e3);var u=new Error(a);throw u.errors=i,u}},n.removeFiles=function(e,t){var r=this,n=this.getState(),i=n.files,o=n.currentUploads,s=he({},i),a=he({},o),u=Object.create(null);function l(e){return void 0===u[e]}e.forEach(function(e){i[e]&&(u[e]=i[e],delete s[e])});var c=[];Object.keys(a).forEach(function(e){var t=o[e].fileIDs.filter(l);0!==t.length?a[e]=he({},o[e],{fileIDs:t}):c.push(e)}),c.forEach(function(e){delete a[e]});var p={currentUploads:a,files:s};0===Object.keys(s).length&&(p.allowNewUpload=!0,p.error=null),this.setState(p),this._calculateTotalProgress();var d=Object.keys(u);d.forEach(function(e){r.emit("file-removed",u[e],t)}),d.length>5?this.log("Removed "+d.length+" files"):this.log("Removed files: "+d.join(", "))},n.removeFile=function(e,t){void 0===t&&(t=null),this.removeFiles([e],t)},n.pauseResume=function(e){if(this.getState().capabilities.resumableUploads&&!this.getFile(e).uploadComplete){var t=!this.getFile(e).isPaused;return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}},n.pauseAll=function(){var e=he({},this.getState().files);Object.keys(e).filter(function(t){return!e[t].progress.uploadComplete&&e[t].progress.uploadStarted}).forEach(function(t){var r=he({},e[t],{isPaused:!0});e[t]=r}),this.setState({files:e}),this.emit("pause-all")},n.resumeAll=function(){var e=he({},this.getState().files);Object.keys(e).filter(function(t){return!e[t].progress.uploadComplete&&e[t].progress.uploadStarted}).forEach(function(t){var r=he({},e[t],{isPaused:!1,error:null});e[t]=r}),this.setState({files:e}),this.emit("resume-all")},n.retryAll=function(){var e=he({},this.getState().files),t=Object.keys(e).filter(function(t){return e[t].error});if(t.forEach(function(t){var r=he({},e[t],{isPaused:!1,error:null});e[t]=r}),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});var r=this._createUpload(t,{forceAllowNewUpload:!0});return this._runUpload(r)},n.cancelAll=function(){this.emit("cancel-all");var e=this.getState().files,t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState({totalProgress:0,error:null})},n.retryUpload=function(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);var t=this._createUpload([e],{forceAllowNewUpload:!0});return this._runUpload(t)},n.reset=function(){this.cancelAll()},n._calculateProgress=function(e,t){if(this.getFile(e.id)){var r=isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:he({},this.getFile(e.id).progress,{bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:r?Math.round(t.bytesUploaded/t.bytesTotal*100):0})}),this._calculateTotalProgress()}else this.log("Not setting progress for a file that has been removed: "+e.id)},n._calculateTotalProgress=function(){var e=this.getFiles().filter(function(e){return e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess});if(0===e.length)return this.emit("progress",0),void this.setState({totalProgress:0});var t=e.filter(function(e){return null!=e.progress.bytesTotal}),r=e.filter(function(e){return null==e.progress.bytesTotal});if(0!==t.length){var n=t.reduce(function(e,t){return e+t.progress.bytesTotal},0),i=n/t.length;n+=i*r.length;var o=0;t.forEach(function(e){o+=e.progress.bytesUploaded}),r.forEach(function(e){o+=i*(e.progress.percentage||0)/100});var s=0===n?0:Math.round(o/n*100);s>100&&(s=100),this.setState({totalProgress:s}),this.emit("progress",s)}else{var a=100*e.length,u=r.reduce(function(e,t){return e+t.progress.percentage},0),l=Math.round(u/a*100);this.setState({totalProgress:l})}},n._addListeners=function(){var e=this;this.on("error",function(t){var r="Unknown error";t.message&&(r=t.message),t.details&&(r+=" "+t.details),e.setState({error:r})}),this.on("upload-error",function(t,r,n){var i="Unknown error";if(r.message&&(i=r.message),r.details&&(i+=" "+r.details),e.setFileState(t.id,{error:i,response:n}),e.setState({error:r.message}),"object"==typeof r&&r.message){var o=new Error(r.message);o.details=r.message,r.details&&(o.details+=" "+r.details),o.message=e.i18n("failedToUpload",{file:t.name}),e._showOrLogErrorAndThrow(o,{throwErr:!1})}else e._showOrLogErrorAndThrow(r,{throwErr:!1})}),this.on("upload",function(){e.setState({error:null})}),this.on("upload-started",function(t,r){e.getFile(t.id)?e.setFileState(t.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:t.size}}):e.log("Not setting progress for a file that has been removed: "+t.id)}),this.on("upload-progress",this._calculateProgress),this.on("upload-success",function(t,r){if(e.getFile(t.id)){var n=e.getFile(t.id).progress;e.setFileState(t.id,{progress:he({},n,{uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal}),response:r,uploadURL:r.uploadURL,isPaused:!1}),e._calculateTotalProgress()}else e.log("Not setting progress for a file that has been removed: "+t.id)}),this.on("preprocess-progress",function(t,r){e.getFile(t.id)?e.setFileState(t.id,{progress:he({},e.getFile(t.id).progress,{preprocess:r})}):e.log("Not setting progress for a file that has been removed: "+t.id)}),this.on("preprocess-complete",function(t){if(e.getFile(t.id)){var r=he({},e.getState().files);r[t.id]=he({},r[t.id],{progress:he({},r[t.id].progress)}),delete r[t.id].progress.preprocess,e.setState({files:r})}else e.log("Not setting progress for a file that has been removed: "+t.id)}),this.on("postprocess-progress",function(t,r){e.getFile(t.id)?e.setFileState(t.id,{progress:he({},e.getState().files[t.id].progress,{postprocess:r})}):e.log("Not setting progress for a file that has been removed: "+t.id)}),this.on("postprocess-complete",function(t){if(e.getFile(t.id)){var r=he({},e.getState().files);r[t.id]=he({},r[t.id],{progress:he({},r[t.id].progress)}),delete r[t.id].progress.postprocess,e.setState({files:r})}else e.log("Not setting progress for a file that has been removed: "+t.id)}),this.on("restored",function(){e._calculateTotalProgress()}),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",function(){return e.updateOnlineStatus()}),window.addEventListener("offline",function(){return e.updateOnlineStatus()}),setTimeout(function(){return e.updateOnlineStatus()},3e3))},n.updateOnlineStatus=function(){void 0===window.navigator.onLine||window.navigator.onLine?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)},n.getID=function(){return this.opts.id},n.use=function(e,t){if("function"!=typeof e)throw new TypeError("Expected a plugin class, but got "+(null===e?"null":typeof e)+". Please verify that the plugin was imported and spelled correctly.");var r=new e(this,t),n=r.id;if(this.plugins[r.type]=this.plugins[r.type]||[],!n)throw new Error("Your plugin must have an id");if(!r.type)throw new Error("Your plugin must have a type");var i=this.getPlugin(n);if(i){var o="Already found a plugin named '"+i.id+"'. Tried to use: '"+n+"'.\nUppy plugins must have unique `id` options. See https://uppy.io/docs/plugins/#id.";throw new Error(o)}return e.VERSION&&this.log("Using "+n+" v"+e.VERSION),this.plugins[r.type].push(r),r.install(),this},n.getPlugin=function(e){var t=null;return this.iteratePlugins(function(r){if(r.id===e)return t=r,!1}),t},n.iteratePlugins=function(e){var t=this;Object.keys(this.plugins).forEach(function(r){t.plugins[r].forEach(e)})},n.removePlugin=function(e){this.log("Removing plugin "+e.id),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();var t=this.plugins[e.type].slice(),r=t.indexOf(e);-1!==r&&(t.splice(r,1),this.plugins[e.type]=t);var n=this.getState();delete n.plugins[e.id],this.setState(n)},n.close=function(){var e=this;this.log("Closing Uppy instance "+this.opts.id+": removing all files and uninstalling plugins"),this.reset(),this._storeUnsubscribe(),this.iteratePlugins(function(t){e.removePlugin(t)})},n.info=function(e,t,r){void 0===t&&(t="info"),void 0===r&&(r=3e3);var n="object"==typeof e;this.setState({info:{isHidden:!1,type:t,message:n?e.message:e,details:n?e.details:null}}),this.emit("info-visible"),clearTimeout(this.infoTimeoutID),this.infoTimeoutID=0!==r?setTimeout(this.hideInfo,r):void 0},n.hideInfo=function(){var e=he({},this.getState().info,{isHidden:!0});this.setState({info:e}),this.emit("info-hidden")},n.log=function(e,t){var r=this.opts.logger;switch(t){case"error":r.error(e);break;case"warning":r.warn(e);break;default:r.debug(e)}},n.run=function(){return this.log("Calling run() is no longer necessary.","warning"),this},n.restore=function(e){return this.log('Core: attempting to restore upload "'+e+'"'),this.getState().currentUploads[e]?this._runUpload(e):(this._removeUpload(e),Promise.reject(new Error("Nonexistent upload")))},n._createUpload=function(e,t){var r;void 0===t&&(t={});var n=t.forceAllowNewUpload,i=void 0!==n&&n,o=this.getState(),s=o.allowNewUpload,a=o.currentUploads;if(!s&&!i)throw new Error("Cannot create a new upload: already uploading.");var u=I();return this.emit("upload",{id:u,fileIDs:e}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploads,currentUploads:he({},a,(r={},r[u]={fileIDs:e,step:0,result:{}},r))}),u},n._getUpload=function(e){return this.getState().currentUploads[e]},n.addResultData=function(e,t){var r;if(this._getUpload(e)){var n=this.getState().currentUploads,i=he({},n[e],{result:he({},n[e].result,t)});this.setState({currentUploads:he({},n,(r={},r[e]=i,r))})}else this.log("Not setting result for an upload that has been removed: "+e)},n._removeUpload=function(e){var t=he({},this.getState().currentUploads);delete t[e],this.setState({currentUploads:t})},n._runUpload=function(e){var t=this,r=this.getState().currentUploads[e].step,n=[].concat(this.preProcessors,this.uploaders,this.postProcessors),i=Promise.resolve();return n.forEach(function(n,o){o300){var t="Failed request with status: "+e.status+". "+e.statusText;return e.json().then(function(e){throw t=e.message?t+" message: "+e.message:t,t=e.requestId?t+" request-Id: "+e.requestId:t,new Error(t)}).catch(function(){throw new Error(t)})}return e.json()},n.preflight=function(e){var t=this;return this.preflightDone?Promise.resolve(this.allowedHeaders.slice()):fetch(this._getUrl(e),{method:"OPTIONS"}).then(function(e){return e.headers.has("access-control-allow-headers")&&(t.allowedHeaders=e.headers.get("access-control-allow-headers").split(",").map(function(e){return e.trim().toLowerCase()})),t.preflightDone=!0,t.allowedHeaders.slice()}).catch(function(e){return t.uppy.log("[CompanionClient] unable to make preflight request "+e,"warning"),t.preflightDone=!0,t.allowedHeaders.slice()})},n.preflightAndHeaders=function(e){var t=this;return Promise.all([this.preflight(e),this.headers()]).then(function(e){var r=e[0],n=e[1];return Object.keys(n).forEach(function(e){-1===r.indexOf(e.toLowerCase())&&(t.uppy.log("[CompanionClient] excluding unallowed header "+e),delete n[e])}),n})},n.get=function(e,t){var r=this;return this.preflightAndHeaders(e).then(function(t){return Oe(r._getUrl(e),{method:"get",headers:t,credentials:"same-origin"})}).then(this._getPostResponseFunc(t)).then(function(e){return r._json(e)}).catch(function(t){return t=t.isAuthError?t:new Error("Could not get "+r._getUrl(e)+". "+t),Promise.reject(t)})},n.post=function(e,t,r){var n=this;return this.preflightAndHeaders(e).then(function(r){return Oe(n._getUrl(e),{method:"post",headers:r,credentials:"same-origin",body:JSON.stringify(t)})}).then(this._getPostResponseFunc(r)).then(function(e){return n._json(e)}).catch(function(t){return t=t.isAuthError?t:new Error("Could not post "+n._getUrl(e)+". "+t),Promise.reject(t)})},n.delete=function(e,t,r){var n=this;return this.preflightAndHeaders(e).then(function(r){return Oe(n.hostname+"/"+e,{method:"delete",headers:r,credentials:"same-origin",body:t?JSON.stringify(t):null})}).then(this._getPostResponseFunc(r)).then(function(e){return n._json(e)}).catch(function(t){return t=t.isAuthError?t:new Error("Could not delete "+n._getUrl(e)+". "+t),Promise.reject(t)})},t=e,(r=[{key:"hostname",get:function(){var e=this.uppy.getState().companion,t=this.opts.companionUrl;return(e&&e[t]?e[t]:t).replace(/\/$/,"")}},{key:"defaultHeaders",get:function(){return{Accept:"application/json","Content-Type":"application/json","Uppy-Versions":"@uppy/companion-client="+e.VERSION}}}])&&Te(t.prototype,r),e}(),Ee.VERSION="1.5.3",Fe),xe={};function De(){return(De=Object.assign||function(e){for(var t=1;t0&&e.isOpen;){var r=e._queued[0];e.send(r.action,r.payload),e._queued=e._queued.slice(1)}},this.socket.onclose=function(t){e.isOpen=!1},this.socket.onmessage=this._handleMessage},t.close=function(){this.socket&&this.socket.close()},t.send=function(e,t){this.isOpen?this.socket.send(JSON.stringify({action:e,payload:t})):this._queued.push({action:e,payload:t})},t.on=function(e,t){this.emitter.on(e,t)},t.emit=function(e,t){this.emitter.emit(e,t)},t.once=function(e,t){this.emitter.once(e,t)},t._handleMessage=function(e){try{var t=JSON.parse(e.data);this.emit(t.action,t.payload)}catch(hc){console.log(hc)}},e}()},je=ae.h,Me=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.prototype.render=function(){var e=je("span",{class:"uppy-Provider-authTitleName"},this.props.pluginName,je("br",null));return je("div",{class:"uppy-Provider-auth"},je("div",{class:"uppy-Provider-authIcon"},this.props.pluginIcon()),je("div",{class:"uppy-Provider-authTitle"},this.props.i18nArray("authenticateWithTitle",{pluginName:e})),je("button",{type:"button",class:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn",onclick:this.props.handleAuth,"data-uppy-super-focusable":!0},this.props.i18nArray("authenticateWith",{pluginName:this.props.pluginName})))},n}(ae.Component),Le={exports:{}};!function(){"use strict";var e={}.hasOwnProperty;function t(){for(var r=[],n=0;n0&&dt(ut,lt({selected:n},e)))},ft=ae.h,yt=function(e){return ft("div",{class:"uppy-Provider-loading"},ft("span",null,e.i18n("loading")))},gt=function(e){if(!e)return!1;var t=e.split("/")[1];return!!/^(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(t)};function vt(){return(vt=Object.assign||function(e){for(var t=1;ti?-1:ri?1:ri?-1:ri?1:ri?-1:ni?1:n=10||e%1==0?(t?"-":"")+e.toFixed(0)+" "+i:(t?"-":"")+e.toFixed(1)+" "+i}(e.file.data.size))}(e),function(e){return e.file.source&&e.file.source!==e.id&&jt("div",{class:"uppy-Dashboard-Item-sourceIcon"},e.acquirers.map(function(t){if(t.id===e.file.source)return function(e,t){return jt("span",{title:t.i18n("fileSource",{name:e.name})},e.icon())}(t,e)}))}(e),jt(Mt,{file:e.file,onClick:function(){alert(e.file.error)}})))},Nt=ae.h;function zt(e){var t=e.file,r=e.uploadInProgressOrComplete,n=e.metaFields,i=e.i18n,o=e.onClick;return!r&&n&&n.length>0?Nt("button",{class:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":i("editFile")+" "+t.meta.name,title:i("editFile"),onclick:function(){return o()}},Nt("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},Nt("g",{"fill-rule":"evenodd"},Nt("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z","fill-rule":"nonzero"}),Nt("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),Nt("path",{"fill-rule":"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function qt(e){var t=e.i18n,r=e.onClick;return Nt("button",{class:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":t("removeFile"),title:t("removeFile"),onclick:function(){return r()}},Nt("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},Nt("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),Nt("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}var Ht=function(e,t){var r,n;(r=t.file.uploadURL,n=t.i18n("copyLinkToClipboardFallback"),n=n||"Copy the URL below",new Promise(function(e){var t=document.createElement("textarea");t.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),t.value=r,document.body.appendChild(t),t.select();var i=function(){document.body.removeChild(t),window.prompt(n,r),e()};try{return document.execCommand("copy")?(document.body.removeChild(t),e()):i()}catch(hc){return document.body.removeChild(t),i()}})).then(function(){t.log("Link copied to clipboard."),t.info(t.i18n("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(function(){return e.target.focus({preventScroll:!0})})};function Vt(e){return Nt("button",{class:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":e.i18n("copyLink"),title:e.i18n("copyLink"),onclick:function(t){return Ht(t,e)}},Nt("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},Nt("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})))}var Wt=function(e){var t=e.file,r=e.uploadInProgressOrComplete,n=e.metaFields,i=e.showLinkToFileUploadResult,o=e.showRemoveButton,s=e.i18n,a=e.removeFile,u=e.toggleFileCard,l=e.log,c=e.info;return Nt("div",{className:"uppy-Dashboard-Item-actionWrapper"},Nt(zt,{i18n:s,file:t,uploadInProgressOrComplete:r,metaFields:n,onClick:function(){return u(t.id)}}),i&&t.uploadURL?Nt(Vt,{file:t,i18n:s,info:c,log:l}):null,o?Nt(qt,{i18n:s,info:e.info,log:e.log,onClick:function(){return a(t.id,"removed-by-user")}}):null)},Gt=ae.h,Xt=function(e){var t,r;function n(){return e.apply(this,arguments)||this}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var i=n.prototype;return i.shouldComponentUpdate=function(e){return!function(e,t){if(e===t)return!0;for(var r in e)if(!(r in t))return!1;for(var r in t)if(e[r]!==t[r])return!1;return!0}(this.props,e)},i.componentDidMount=function(){var e=this.props.file;e.preview||this.props.handleRequestThumbnail(e)},i.componentWillUnmount=function(){var e=this.props.file;e.preview||this.props.handleCancelThumbnail(e)},i.render=function(){var e=this.props.file,t=e.progress.preprocess||e.progress.postprocess,r=e.progress.uploadComplete&&!t&&!e.error,n=e.progress.uploadStarted||t,i=e.progress.uploadStarted&&!e.progress.uploadComplete||t,o=e.error||!1,s=this.props.individualCancellation?!r:!i&&!r;r&&this.props.showRemoveButtonAfterComplete&&(s=!0);var a=Le({"uppy-Dashboard-Item":!0,"is-inprogress":i,"is-processing":t,"is-complete":r,"is-error":!!o,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation});return Gt("div",{class:a,id:"uppy_"+e.id,role:this.props.role},Gt("div",{class:"uppy-Dashboard-Item-preview"},Gt(Ut,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult}),Gt(It,{file:e,error:o,isUploaded:r,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,showRemoveButtonAfterComplete:this.props.showRemoveButtonAfterComplete,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,pauseUpload:this.props.pauseUpload,cancelUpload:this.props.cancelUpload,retryUpload:this.props.retryUpload,i18n:this.props.i18n})),Gt("div",{class:"uppy-Dashboard-Item-fileInfoAndButtons"},Gt(Lt,{file:e,id:this.props.id,acquirers:this.props.acquirers,containerWidth:this.props.containerWidth,i18n:this.props.i18n}),Gt(Wt,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:s,uploadInProgressOrComplete:n,removeFile:this.props.removeFile,toggleFileCard:this.props.toggleFileCard,i18n:this.props.i18n,log:this.props.log,info:this.props.info})))},n}(ae.Component);function Kt(){return(Kt=Object.assign||function(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,["data","rowHeight","renderRow","overscanCount","sync"])),a=this.state,u=a.offset,l=a.height,c=Math.floor(u/r),p=Math.floor(l/r);o&&(c=Math.max(0,c-c%o),p+=o);var d=c+p+4,h=t.slice(c,d),f=Kt({},Jt,{height:t.length*r}),y=Kt({},Qt,{top:c*r});return $t("div",Kt({onScroll:this.handleScroll},s),$t("div",{role:"presentation",style:f},$t("div",{role:"presentation",style:y},h.map(n))))},n}(Yt);function er(){return(er=Object.assign||function(e){for(var t=1;t0?t.props.i18nArray("dropPaste",{browse:u}):t.props.i18nArray("dropPasteImport",{browse:u})}catch(h){}return nr("div",{class:"uppy-Dashboard-AddFiles-title"},a)},t.renderAcquirer=function(e){return nr("div",{class:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},nr("button",{type:"button",class:"uppy-DashboardTab-btn",role:"tab",tabindex:0,"aria-controls":"uppy-DashboardContent-panel--"+e.id,"aria-selected":t.props.activePickerPanel.id===e.id,"data-uppy-super-focusable":!0,onclick:function(){return t.props.showPanel(e.id)}},e.icon(),nr("div",{class:"uppy-DashboardTab-name"},e.name)))},t.renderAcquirers=function(e){var r=[].concat(e),n=r.splice(e.length-2,e.length);return nr("div",{class:"uppy-Dashboard-AddFiles-list",role:"tablist"},t.renderMyDeviceAcquirer(),r.map(function(e){return t.renderAcquirer(e)}),nr("span",{role:"presentation",style:"white-space: nowrap;"},n.map(function(e){return t.renderAcquirer(e)})))},t}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var i=n.prototype;return i.renderPoweredByUppy=function(){var e=nr("span",null,nr("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},nr("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z","fill-rule":"evenodd"})),nr("span",{class:"uppy-Dashboard-poweredByUppy"},"Uppy")),t=this.props.i18nArray("poweredBy2",{backwardsCompat:this.props.i18n("poweredBy"),uppy:e});return nr("a",{tabindex:"-1",href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",class:"uppy-Dashboard-poweredBy"},t)},i.render=function(){var e=this;return nr("div",{class:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,function(t){e.fileInput=t}),this.renderHiddenInput(!0,function(t){e.folderInput=t}),this.renderDropPasteBrowseTagline(),this.props.acquirers.length>0&&this.renderAcquirers(this.props.acquirers),nr("div",{class:"uppy-Dashboard-AddFiles-info"},this.props.note&&nr("div",{class:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy(this.props)))},n}(ae.Component),or=ae.h,sr=function(e){return or("div",{class:"uppy-Dashboard-AddFilesPanel","data-uppy-panelType":"AddFiles","aria-hidden":e.showAddFilesPanel},or("div",{class:"uppy-DashboardContent-bar"},or("div",{class:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18n("addingMoreFiles")),or("button",{class:"uppy-DashboardContent-back",type:"button",onclick:function(t){return e.toggleAddFilesPanel(!1)}},e.i18n("back"))),or(ir,e))},ar=function(e){var t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t?(e.preventDefault(),e.stopPropagation()):e.stopPropagation()},ur=ae.h,lr=function(e){return ur("div",{class:"uppy-DashboardContent-panel",role:"tabpanel","data-uppy-panelType":"PickerPanel",id:"uppy-DashboardContent-panel--"+e.activePickerPanel.id,onDragOver:ar,onDragLeave:ar,onDrop:ar,onPaste:ar},ur("div",{class:"uppy-DashboardContent-bar"},ur("div",{class:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18n("importFrom",{name:e.activePickerPanel.name})),ur("button",{class:"uppy-DashboardContent-back",type:"button",onclick:e.hideAllPanels},e.i18n("done"))),ur("div",{class:"uppy-DashboardContent-panelBody"},e.getPlugin(e.activePickerPanel.id).render(e.state)))},cr=ae.h,pr=function(e){var t=this.props.files[this.props.fileCardFor];return cr("div",{class:"uppy-DashboardContent-panel",role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},cr("div",{class:"uppy-DashboardContent-bar"},cr("div",{class:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18nArray("editing",{file:cr("span",{class:"uppy-DashboardContent-titleFile"},t.meta?t.meta.name:t.name)})),cr("button",{class:"uppy-DashboardContent-back",type:"button",onclick:e.hideAllPanels},e.i18n("done"))),cr("div",{class:"uppy-DashboardContent-panelBody"},e.editors.map(function(t){return e.getPlugin(t.id).render(e.state)})))},dr=ae.h,hr={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function fr(e){switch(function(e,t,r,n){if(void 0===n&&(n={}),e)return hr.STATE_ERROR;if(t)return hr.STATE_COMPLETE;if(r)return hr.STATE_PAUSED;for(var i=hr.STATE_WAITING,o=Object.keys(n),s=0;s=0;)i=i.replace(t,l);e.className=i.trim()}}var f={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},y=[];"undefined"!=typeof window&&function(){var e=document.createElement("div").style;for(var t in"AnimationEvent"in window||delete f.animationend.animation,"TransitionEvent"in window||delete f.transitionend.transition,f){var r=f[t];for(var n in r)if(n in e){y.push(r[n]);break}}}();var g=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},v=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},m=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},b=function(e){function t(){var n,i;g(this,t);for(var o=arguments.length,s=Array(o),a=0;a=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(t,["component","transitionName","transitionEnter","transitionLeave","transitionEnterTimeout","transitionLeaveTimeout","children"])),s=r.children;return e.h(i,o,n(s).map(this.renderChild))},i}(e.Component);return w.defaultProps={component:"span",transitionEnter:!0,transitionLeave:!0},w},"object"==typeof _r.exports?_r.exports=vr(ae):this.PreactCSSTransitionGroup=vr(this.preact),_r=_r.exports;var kr=ae.h;function Cr(e){return kr(_r,{transitionName:"uppy-transition-slideDownUp",transitionEnterTimeout:250,transitionLeaveTimeout:250},e.children)}var Pr=function(e){var t=0===e.totalFileCount,r=e.containerWidth>576,n=Le({"uppy-Root":e.isTargetDOMEl,"uppy-Dashboard":!0,"uppy-Dashboard--animateOpenClose":e.animateOpenClose,"uppy-Dashboard--isClosing":e.isClosing,"uppy-Dashboard--isDraggingOver":e.isDraggingOver,"uppy-Dashboard--modal":!e.inline,"uppy-size--md":e.containerWidth>576,"uppy-size--lg":e.containerWidth>700,"uppy-size--xl":e.containerWidth>900,"uppy-size--height-md":e.containerHeight>400,"uppy-Dashboard--isAddFilesPanelVisible":e.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":e.areInsidesReadyToBeVisible}),i=1;e.containerWidth>900?i=5:e.containerWidth>700?i=4:e.containerWidth>576&&(i=3);var o=e.showSelectedFiles&&!t;return kr("div",{class:n,"data-uppy-theme":e.theme,"data-uppy-num-acquirers":e.acquirers.length,"data-uppy-drag-drop-supported":wr(),"aria-hidden":e.inline?"false":e.isHidden,"aria-label":e.inline?e.i18n("dashboardTitle"):e.i18n("dashboardWindowTitle"),onpaste:e.handlePaste,onDragOver:e.handleDragOver,onDragLeave:e.handleDragLeave,onDrop:e.handleDrop},kr("div",{class:"uppy-Dashboard-overlay",tabindex:-1,onclick:e.handleClickOutside}),kr("div",{class:"uppy-Dashboard-inner","aria-modal":!e.inline&&"true",role:!e.inline&&"dialog",style:{width:e.inline&&e.width?e.width:"",height:e.inline&&e.height?e.height:""}},e.inline?null:kr("button",{class:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":e.i18n("closeModal"),title:e.i18n("closeModal"),onclick:e.closeModal},kr("span",{"aria-hidden":"true"},"\xd7")),kr("div",{class:"uppy-Dashboard-innerWrap"},kr("div",{class:"uppy-Dashboard-dropFilesHereHint"},e.i18n("dropHint")),o&&kr(yr,e),o?kr(rr,Sr({},e,{itemsPerRow:i})):kr(ir,Sr({},e,{isSizeMD:r})),kr(Cr,null,e.showAddFilesPanel?kr(sr,Sr({key:"AddFiles"},e,{isSizeMD:r})):null),kr(Cr,null,e.fileCardFor?kr(br,Sr({key:"FileCard"},e)):null),kr(Cr,null,e.activePickerPanel?kr(lr,Sr({key:"Picker"},e)):null),kr(Cr,null,e.showFileEditor?kr(pr,Sr({key:"Editor"},e)):null),kr("div",{class:"uppy-Dashboard-progressindicators"},e.progressindicators.map(function(t){return e.getPlugin(t.id).render(e.state)})))))},Er="error",Fr="waiting",Ar="preprocessing",Or="uploading",Ur="postprocessing",Tr="complete",Rr=function(e){if("number"!=typeof e||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/Math.pow(1024,n));var i=r[n];return e>=10||e%1==0?(t?"-":"")+e.toFixed(0)+" "+i:(t?"-":"")+e.toFixed(1)+" "+i},xr=function(e){var t,r=(t=e,{hours:Math.floor(t/3600)%24,minutes:Math.floor(t/60)%60,seconds:Math.floor(t%60)}),n=r.hours?r.hours+"h ":"",i=r.hours?("0"+r.minutes).substr(-2):r.minutes,o=i?i+"m":"",s=i?("0"+r.seconds).substr(-2):r.seconds;return""+n+o+(r.hours?"":i?" "+s+"s":s+"s")};function Dr(){return(Dr=Object.assign||function(e){for(var t=1;t1;return jr("div",{class:"uppy-StatusBar-statusSecondary"},t&&e.i18n("filesUploadedOfTotal",{complete:e.complete,smart_count:e.numUploads}),jr("span",{class:"uppy-StatusBar-additionalInfo"},t&&" \xb7 ",e.i18n("dataUploadedOfTotal",{complete:Rr(e.totalUploadedSize),total:Rr(e.totalSize)})," \xb7 ",e.i18n("xTimeLeft",{time:xr(e.totalETA)})))},500,{leading:!0,trailing:!0}),Xr=function(e){if(!e.isUploadStarted||e.isAllComplete)return null;var t=e.isAllPaused?e.i18n("paused"):e.i18n("uploading"),r=e.newFiles&&e.isUploadStarted;return jr("div",{class:"uppy-StatusBar-content","aria-label":t,title:t},e.isAllPaused?null:jr(qr,null),jr("div",{class:"uppy-StatusBar-status"},jr("div",{class:"uppy-StatusBar-statusPrimary"},e.supportsUploadProgress?t+": "+e.totalProgress+"%":t),e.isAllPaused||r||!e.showProgressDetails?null:e.supportsUploadProgress?jr(Gr,e):jr(Vr,e),r?jr(Wr,e):null))},Kr=function(e){e.totalProgress;var t=e.i18n;return jr("div",{class:"uppy-StatusBar-content",role:"status",title:t("complete")},jr("div",{class:"uppy-StatusBar-status"},jr("div",{class:"uppy-StatusBar-statusPrimary"},jr("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},jr("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),t("complete"))))},$r=function(e){var t=e.error,r=(e.retryAll,e.hideRetryButton,e.i18n);return jr("div",{class:"uppy-StatusBar-content",role:"alert",title:r("uploadFailed")},jr("div",{class:"uppy-StatusBar-status"},jr("div",{class:"uppy-StatusBar-statusPrimary"},jr("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},jr("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),r("uploadFailed"))),jr("span",{class:"uppy-StatusBar-details","aria-label":t,"data-microtip-position":"top-right","data-microtip-size":"medium",role:"tooltip",onclick:function(){var e=r("uploadFailed")+" \n\n "+t;alert(e)}},"?"))};function Yr(){return(Yr=Object.assign||function(e){for(var t=1;t0,b=100===i&&l.length===Object.keys(r).length&&0===f.length,w=o&&c.length===s.length,_=0!==p.length&&u.length===p.length,S=p.length>0,k=t.resumableUploads||!1,C=!1!==t.uploadProgress;return function(e){var t,r,n=e=e||{},i=n.newFiles,o=n.allowNewUpload,s=n.isUploadInProgress,a=n.isAllPaused,u=n.resumableUploads,l=n.error,c=n.hideUploadButton,p=n.hidePauseResumeButton,d=n.hideCancelButton,h=n.hideRetryButton,f=e.uploadState,y=e.totalProgress;if(f===Ar||f===Ur){var g=function(e){var t=[];Object.keys(e).forEach(function(r){var n=e[r].progress;n.preprocess&&t.push(n.preprocess),n.postprocess&&t.push(n.postprocess)});var r=t[0];return{mode:r.mode,message:r.message,value:t.filter(function(e){return"determinate"===e.mode}).reduce(function(e,t,r,n){return e+t.value/n.length},0)}}(e.files);"determinate"===(t=g.mode)&&(y=100*g.value),r=Hr(g)}else f===Tr?r=Kr(e):f===Or?(e.supportsUploadProgress||(t="indeterminate",y=null),r=Xr(e)):f===Er&&(y=void 0,r=$r(e));var v="number"==typeof y?y:100,m=f===Fr&&e.hideUploadButton||f===Fr&&!e.newFiles>0||f===Tr&&e.hideAfterFinish,b=!l&&i&&!s&&!a&&o&&!c,w=!d&&f!==Fr&&f!==Tr,_=u&&!p&&f===Or,S=l&&!h,k="uppy-StatusBar-progress\n "+(t?"is-"+t:""),C=Le({"uppy-Root":e.isTargetDOMEl},"uppy-StatusBar","is-"+f);return jr("div",{class:C,"aria-hidden":m},jr("div",{class:k,style:{width:v+"%"},role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":y}),r,jr("div",{class:"uppy-StatusBar-actions"},b?jr(Mr,Dr({},e,{uploadState:f})):null,S?jr(Lr,e):null,_?jr(zr,e):null,w?jr(Nr,e):null))}({error:o,uploadState:this.getUploadingState(w,b,e.files||{}),allowNewUpload:n,totalProgress:i,totalSize:g,totalUploadedSize:v,isAllComplete:b,isAllPaused:_,isAllErrored:w,isUploadStarted:m,isUploadInProgress:S,complete:l.length,newFiles:a.length,numUploads:h.length,totalETA:y,files:r,i18n:this.i18n,pauseAll:this.uppy.pauseAll,resumeAll:this.uppy.resumeAll,retryAll:this.uppy.retryAll,cancelAll:this.uppy.cancelAll,startUpload:this.startUpload,resumableUploads:k,supportsUploadProgress:C,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish,isTargetDOMEl:this.isTargetDOMEl})},i.install=function(){var e=this.opts.target;e&&this.mount(e,this)},i.uninstall=function(){this.unmount()},n}(pe.Plugin),Br.VERSION="1.7.3",Ir);function tn(){return(tn=Object.assign||function(e){for(var t=1;t0?i-4:i;for(r=0;r>16&255,s[a++]=t>>8&255,s[a++]=255&t;return 2===o&&(t=pn[e.charCodeAt(r)]<<2|pn[e.charCodeAt(r+1)]>>4,s[a++]=255&t),1===o&&(t=pn[e.charCodeAt(r)]<<10|pn[e.charCodeAt(r+1)]<<4|pn[e.charCodeAt(r+2)]>>2,s[a++]=t>>8&255,s[a++]=255&t),s},fromByteArray:function(e){for(var t,r=e.length,n=r%3,i=[],o=0,s=r-n;os?s:o+16383));return 1===n?(t=e[r-1],i.push(cn[t>>2]+cn[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(cn[t>>10]+cn[t>>4&63]+cn[t<<2&63]+"=")),i.join("")}},cn=[],pn=[],dn="undefined"!=typeof Uint8Array?Uint8Array:Array,hn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fn=0,yn=hn.length;fn0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function vn(e,t,r){for(var n,i,o=[],s=t;s>18&63]+cn[i>>12&63]+cn[i>>6&63]+cn[63&i]);return o.join("")}pn["-".charCodeAt(0)]=62,pn["_".charCodeAt(0)]=63;var mn={read:function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,c=-7,p=r?i-1:0,d=r?-1:1,h=e[t+p];for(p+=d,o=h&(1<<-c)-1,h>>=-c,c+=a;c>0;o=256*o+e[t+p],p+=d,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+p],p+=d,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),o-=l}return(h?-1:1)*s*Math.pow(2,o-n)},write:function(e,t,r,n,i,o){var s,a,u,l=8*o-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,f=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+p>=1?d/u:d*Math.pow(2,1-p))*u>=2&&(s++,u/=2),s+p>=c?(a=0,s=c):s+p>=1?(a=(t*u-1)*Math.pow(2,i),s+=p):(a=t*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;e[r+h]=255&a,h+=f,a/=256,i-=8);for(s=s<0;e[r+h]=255&s,h+=f,s/=256,l-=8);e[r+h-f]|=128*y}},bn={exports:{}};(function(e,t,r){var n,i;n=this,i=function(n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var r=0;r1?t-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:0;return this.substring(t,t+e.length)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return this.substring(t-e.length,t)===e});var S="undefined"!=typeof self?self:t,k=S.fetch||function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(r,n){var i=new XMLHttpRequest;if(i.open("get",e,!0),i.responseType="arraybuffer",i.onerror=n,t.headers)for(var o in t.headers)i.setRequestHeader(o,t.headers[o]);i.onload=function(){r({ok:i.status>=200&&i.status<300,status:i.status,arrayBuffer:function(){return Promise.resolve(i.response)}})},i.send(null)})},C=function(e){var t=[];if(Object.defineProperties(t,{size:{get:function(){return this.length}},has:{value:function(e){return-1!==this.indexOf(e)}},add:{value:function(e){this.has(e)||this.push(e)}},delete:{value:function(e){if(this.has(e)){var t=this.indexOf(e);this.splice(t,1)}}}}),Array.isArray(e))for(var r=0;r=0}},{key:"delete",value:function(e){var t=this._keys.indexOf(e);return!(t<0||(delete this._map["map_"+e],this._keys.splice(t,1),0))}},{key:"keys",value:function(){return this._keys.slice(0)}},{key:"values",value:function(){var e=this;return this._keys.map(function(t){return e.get(t)})}},{key:"entries",value:function(){var e=this;return this._keys.map(function(t){return[t,e.get(t)]})}},{key:"forEach",value:function(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;if(i(this,e),"boolean"==typeof o&&(this.le=o),Array.isArray(t)&&(t=new Uint8Array(t)),0===t)this.byteOffset=0,this.byteLength=0;else if(t instanceof ArrayBuffer){void 0===n&&(n=t.byteLength-r);var s=new DataView(t,r,n);this._swapDataView(s)}else if(t instanceof Uint8Array||t instanceof DataView||t instanceof e){if(void 0===n&&(n=t.byteLength-r),(r+=t.byteOffset)+n>t.byteOffset+t.byteLength)throw I("Creating view outside of available memory in ArrayBuffer");var a=new DataView(t.buffer,r,n);this._swapDataView(a)}else{if("number"!=typeof t)throw I("Invalid input argument for BufferView: "+t);var u=new DataView(new ArrayBuffer(t));this._swapDataView(u)}}return s(e,null,[{key:"from",value:function(t,r){return t instanceof this&&t.le===r?t:new e(t,void 0,void 0,r)}}]),s(e,[{key:"_swapArrayBuffer",value:function(e){this._swapDataView(new DataView(e))}},{key:"_swapBuffer",value:function(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}},{key:"_swapDataView",value:function(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}},{key:"_lengthToEnd",value:function(e){return this.byteLength-e}},{key:"set",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;if(t instanceof DataView||t instanceof e?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer&&(t=new Uint8Array(t)),!(t instanceof Uint8Array))throw I("BufferView.set(): Invalid data argument.");return this.toUint8().set(t,r),new n(this,r,t.byteLength)}},{key:"subarray",value:function(t,r){return new e(this,t,r=r||this._lengthToEnd(t))}},{key:"toUint8",value:function(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}},{key:"getUint8Array",value:function(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}},{key:"getString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.byteLength;return function(e){return M?M.decode(e):x?r.from(e).toString("utf8"):decodeURIComponent(escape(String.fromCharCode.apply(null,e)))}(this.getUint8Array(e,t))}},{key:"getUnicodeString",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.byteLength,r=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getInt16(e,t)}},{key:"getInt32",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getInt32(e,t)}},{key:"getUint16",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getUint16(e,t)}},{key:"getUint32",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getUint32(e,t)}},{key:"getFloat32",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat32(e,t)}},{key:"getFloat64",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat64(e,t)}},{key:"getFloat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat32(e,t)}},{key:"getDouble",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat64(e,t)}},{key:"getUint64",value:function(e){var t=this.getUint32(e),r=this.getUint32(e+4);if(t<1048575)return t<<32|r;if(void 0!==typeof R)return console.warn("Using BigInt because of type 64uint but JS can only handle 53b numbers."),R(t)<1e4)return Y(e,t,"base64");if(A)return J(e,t,"url",K);if(U)return Y(e,t,"fs");throw I("Invalid input argument");var r}var Z=function(e){function t(){return i(this,t),f(this,l(t).apply(this,arguments))}return u(t,d(E)),s(t,[{key:"tagKeys",get:function(){return this.allKeys||(this.allKeys=w(this.keys())),this.allKeys}},{key:"tagValues",get:function(){return this.allValues||(this.allValues=w(this.values())),this.allValues}}]),t}();function ee(e,t,r){var n=new Z,i=r;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=w(i));for(var o=0;o0&&s.translateTagSet(n,s.pick);else if("object"==typeof n){if(s.enabled=!0,s.parse=!1!==n.parse,s.canBeFiltered){var u=n.pick,c=n.skip;u&&u.length>0&&s.translateTagSet(u,s.pick),c&&c.length>0&&s.translateTagSet(c,s.skip)}s.applyInheritables(n)}else{if(!0!==n&&!1!==n)throw I("Invalid options argument: ".concat(n));s.parse=s.enabled=n}return s}return u(t,he),s(t,[{key:"needed",get:function(){return this.enabled||this.deps.size>0}}]),s(t,[{key:"applyInheritables",value:function(e){var t,r,n=pe;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=w(n));for(var i=0;i0?(this.enabled=!0,we(this.pick,this.deps)):this.enabled&&this.pick.size>0&&we(this.pick,this.deps)}}]),t}(),ye={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},ge=P(),ve=function(e){function t(e){var r;if(i(this,t),r=f(this,l(t).call(this)),!0===e)r.setupFromTrue();else if(void 0===e)r.setupFromUndefined();else if(Array.isArray(e))r.setupFromArray(e);else{if("object"!=typeof e)throw I("Invalid options argument ".concat(e));r.setupFromObject(e)}return void 0===r.firstChunkSize&&(r.firstChunkSize=A?r.firstChunkSizeBrowser:r.firstChunkSizeNode),r.mergeOutput&&(r.ifd1.enabled=!1),r.filterNestedSegmentTags(),r.traverseTiffDependencyTree(),r.checkLoadedPlugins(),r}return u(t,he),s(t,null,[{key:"useCached",value:function(e){var t=ge.get(e);return void 0!==t?t:(t=new this(e),ge.set(e,t),t)}}]),s(t,[{key:"setupFromUndefined",value:function(){var e,t=oe;Array.isArray(t)||("function"==typeof t.entries&&(t=t.entries()),t=w(t));for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:r;if(e&&e.length){var i=n;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=w(i));for(var o=0;o50)return!1;for(var r=16,n=[];r0&&(r.errors=n),r=B(t=r)?void 0:t,e.file.close&&e.file.close(),r})})}catch(e){return Promise.reject(e)}}},{key:"extractThumbnail",value:function(){try{var e=this;e.setup();var t,r=H.get("tiff",e.options);return Ee(function(){if(!e.file.isTiff)return function(e){var t=e();if(t&&t.then)return t.then(Fe)}(function(){if(e.file.isJpeg)return Pe(e.fileParser.getOrFindSegment("tiff"),function(e){t=e})});t={start:0,type:"tiff"}},function(){if(void 0!==t)return Pe(e.fileParser.ensureSegmentChunk(t),function(t){return Pe((e.parsers.tiff=new r(t,e.options,e.file)).extractThumbnail(),function(t){return e.file.close&&e.file.close(),t})})})}catch(e){return Promise.reject(e)}}}]),e}();function Oe(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Ue(e){return function(){for(var t=[],r=0;r=81&&(n.rotateCanvas=n.rotateCss=!1)}}var We=Object.freeze({__proto__:null,rotation:Te,orientation:Re,gps:xe,thumbnailUrl:De,thumbnail:Be,parse:Ie,rotations:je,get rotateCanvas(){return n.rotateCanvas},get rotateCss(){return n.rotateCss},Exifr:Ae,fileParsers:q,segmentParsers:H,fileReaders:V,tagKeys:re,tagValues:ne,tagRevivers:ie,createDictionary:ee,extendDictionary:te,fetchUrlAsArrayBuffer:K,readBlobAsArrayBuffer:X,chunkedProps:oe,otherSegments:se,segments:ae,tiffBlocks:ue,segmentsAndBlocks:le,tiffExtractables:ce,inheritables:pe,allFormatters:de,Options:ve,disableAllOptions:_e,gpsOnlyOptions:Se,orientationOnlyOptions:ke,thumbnailOnlyOptions:Ce});function Ge(){}var Xe=function(e){function t(){var e,r;i(this,t);for(var n=arguments.length,o=new Array(n),s=0;sthis.byteLength){var o=this._extend(i).dataView;this._swapDataView(o)}}}},{key:"_extend",value:function(e){var t;t=x?T.allocUnsafe(e):new Uint8Array(e);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:r}}},{key:"subarray",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return r=r||this._lengthToEnd(e),n&&this._tryExtend(e,r),this.ranges.add(e,r),y(l(t.prototype),"subarray",this).call(this,e,r)}},{key:"set",value:function(e,r){arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&this._tryExtend(r,e.byteLength,e);var n=y(l(t.prototype),"set",this).call(this,e,r);return this.ranges.add(r,n.byteLength),n}},{key:"ensureChunk",value:function(e,t){try{if(!this.chunked)return;if(this.ranges.available(e,t))return;return function(e,t){return e&&e.then?e.then(Ge):Promise.resolve()}(this.readChunk(e,t))}catch(e){return Promise.reject(e)}}},{key:"available",value:function(e,t){return this.ranges.available(e,t)}}]),t}(),Ke=function(){function e(){i(this,e),a(this,"list",[])}return s(e,[{key:"add",value:function(e,t){var r=e+t,n=this.list.filter(function(t){return $e(e,t.offset,r)||$e(e,t.end,r)});if(n.length>0){e=Math.min.apply(Math,[e].concat(n.map(function(e){return e.offset}))),t=(r=Math.max.apply(Math,[r].concat(n.map(function(e){return e.end}))))-e;var i=n.shift();i.offset=e,i.length=t,i.end=r,this.list=this.list.filter(function(e){return!n.includes(e)})}else this.list.push({offset:e,length:t,end:r})}},{key:"available",value:function(e,t){var r=e+t;return this.list.some(function(t){return t.offset<=e&&r<=t.end})}},{key:"length",get:function(){return this.list.length}}]),e}();function $e(e,t,r){return e<=t&&t<=r}function Ye(){}function Je(e,t){if(!t)return e&&e.then?e.then(Ye):Promise.resolve()}function Qe(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var Ze=function(e){function t(){return i(this,t),f(this,l(t).apply(this,arguments))}return u(t,e),s(t,[{key:"readWhole",value:function(){try{var e=this;return e.chunked=!1,Qe(X(e.input),function(t){e._swapArrayBuffer(t)})}catch(e){return Promise.reject(e)}}},{key:"readChunked",value:function(){return this.chunked=!0,this.size=this.input.size,y(l(t.prototype),"readChunked",this).call(this)}},{key:"_readChunk",value:function(e,t){try{var r=this,n=t?e+t:void 0,i=r.input.slice(e,n);return Qe(X(i),function(t){return r.set(t,e,!0)})}catch(e){return Promise.reject(e)}}}]),t}(function(e){function t(e,r){var n;return i(this,t),a(h(n=f(this,l(t).call(this,0))),"chunksRead",0),n.input=e,n.options=r,n}return u(t,Xe),s(t,[{key:"readWhole",value:function(){try{return this.chunked=!1,Je(this.readChunk(this.nextChunkOffset))}catch(e){return Promise.reject(e)}}},{key:"readChunked",value:function(){try{return this.chunked=!0,Je(this.readChunk(0,this.options.firstChunkSize))}catch(e){return Promise.reject(e)}}},{key:"readNextChunk",value:function(e){try{if(void 0===e&&(e=this.nextChunkOffset),this.fullyRead)return this.chunksRead++,!1;var t=this.options.chunkSize;return r=this.readChunk(e,t),n=function(e){return!!e&&e.byteLength===t},r&&r.then||(r=Promise.resolve(r)),n?r.then(n):r}catch(e){return Promise.reject(e)}var r,n}},{key:"readChunk",value:function(e,t){try{if(this.chunksRead++,0===(t=this.safeWrapAddress(e,t)))return;return this._readChunk(e,t)}catch(e){return Promise.reject(e)}}},{key:"safeWrapAddress",value:function(e,t){return void 0!==this.size&&e+t>this.size?Math.max(0,this.size-e):t}},{key:"read",value:function(){return this.options.chunked?this.readChunked():this.readWhole()}},{key:"close",value:function(){}},{key:"nextChunkOffset",get:function(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}},{key:"canReadNextChunk",get:function(){return this.chunksReadi+o)e.chunk=s.file.subarray(i,o);else{if(void 0!==e.size)throw I("Segment unreachable: "+JSON.stringify(e));e.chunk=s.file.subarray(i)}},r=function(t){return e.chunk},(n=t())&&n.then?n.then(r):r()},function(){for(var e=[],t=0;t1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;i(this,e),a(this,"errors",[]),a(this,"raw",P()),a(this,"handleError",function(e){if(!r.options.silentErrors)throw e;r.errors.push(e.message)}),this.chunk=this.normalizeInput(t),this.file=o,this.type=this.constructor.type,this.globalOptions=this.options=n,this.localOptions=n[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}return s(e,[{key:"normalizeInput",value:function(e){return e instanceof L?e:new L(e)}}],[{key:"findPosition",value:function(e,t){var r=e.getUint16(t+2)+2,n="function"==typeof this.headerLength?this.headerLength(e,t,r):this.headerLength,i=t+n,o=r-n;return{offset:t,length:r,headerLength:n,start:i,size:o,end:i+o}}},{key:"parse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new this(e,new ve(a({},this.type,t))).parse()}}]),s(e,[{key:"translate",value:function(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}},{key:"translateBlock",value:function(e,t){var r=ie.get(t),n=ne.get(t),i=re.get(t),o=this.options[t],s=o.reviveValues&&!!r,a=o.translateValues&&!!n,u=o.translateKeys&&!!i,l={},c=e;Array.isArray(c)||("function"==typeof c.entries&&(c=c.entries()),c=w(c));for(var p=0;p=224&&e<=239}function pt(e,t){var r=H;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=w(r));for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;try{var r=this;r.setupSegmentFinderArgs(t);var n=r.file,i=r.findAll,o=r.wanted,s=r.remaining;return ot(function(){if(!i&&r.file.chunked)return i=w(o).some(function(e){var t=H.get(e),n=r.options[e];return t.multiSegment&&n.multiSegment}),function(e){var t=function(){if(i)return it(r.file.readWhole())}();if(t&&t.then)return t.then(nt)}()},function(){var t=!1;if(e=r._findAppSegments(e,n.byteLength,i,o,s),!r.options.onlyTiff)return function(){if(n.chunked){var i=!1;return function(e,t,r){for(var n;;){var i=e();if(ut(i)&&(i=i.v),!i)return o;if(i.then){n=0;break}var o=r();if(o&&o.then){if(!ut(o)){n=1;break}o=o.s}if(t){var s=t();if(s&&s.then&&!ut(s)){n=2;break}}}var a=new at,u=st.bind(null,a,2);return(0===n?i.then(c):1===n?o.then(l):s.then(p)).then(void 0,u),a;function l(n){o=n;do{if(t&&(s=t())&&s.then&&!ut(s))return void s.then(p).then(void 0,u);if(!(i=e())||ut(i)&&!i.v)return void st(a,1,o);if(i.then)return void i.then(c).then(void 0,u);ut(o=r())&&(o=o.v)}while(!o||!o.then);o.then(l).then(void 0,u)}function c(e){e?(o=r())&&o.then?o.then(l).then(void 0,u):l(o):st(a,1,o)}function p(){(i=e())?i.then?i.then(c).then(void 0,u):c(i):st(a,1,o)}}(function(){return!t&&s.size>0&&!i&&(!!n.canReadNextChunk||!!r.unfinishedMultiSegment)},void 0,function(){var o=n.nextChunkOffset,s=r.appSegments.some(function(e){return!r.file.available(e.offset||e.start,e.length||e.size)});return ot(function(){return rt(e>o&&!s?n.readNextChunk(e):n.readNextChunk(o),function(e){i=!e})},function(){void 0===(e=r._findAppSegments(e,n.byteLength))&&(t=!0)})})}}()})}catch(e){return Promise.reject(e)}}},{key:"_findAppSegments",value:function(e,t){for(var r,n,i,o,s,a,u=this.file,l=this.findAll,c=this.wanted,p=this.remaining,d=this.options;ee.file.byteLength)throw I("IFD0 offset points to outside of file.\nthis.ifd0Offset: ".concat(e.ifd0Offset,", file.byteLength: ").concat(e.file.byteLength));return yt(function(){if(e.file.isTiff)return ft(e.file.ensureChunk(e.ifd0Offset,j(e.options)))},function(){var t=e.parseBlock(e.ifd0Offset,"ifd0");if(0!==t.size)return e.exifOffset=t.get(34665),e.interopOffset=t.get(40965),e.gpsOffset=t.get(34853),e.xmp=t.get(700),e.iptc=t.get(33723),e.icc=t.get(34675),e.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t})}catch(e){return Promise.reject(e)}}},{key:"ensureBlockChunk",value:function(e,t){try{var r=this;return yt(function(){if(r.file.isTiff)return ft(r.file.ensureChunk(e,t))},function(){e>r.chunk.byteLength&&(r.chunk=L.from(r.file,r.le))})}catch(e){return Promise.reject(e)}}},{key:"parseExifBlock",value:function(){try{var e=this;if(e.exif)return;return yt(function(){if(!e.ifd0)return ft(e.parseIfd0Block())},function(){if(void 0!==e.exifOffset)return yt(function(){if(e.file.isTiff)return ft(e.file.ensureChunk(e.exifOffset,j(e.options)))},function(){var t=e.parseBlock(e.exifOffset,"exif");return e.interopOffset||(e.interopOffset=t.get(40965)),e.makerNote=t.get(37500),e.userComment=t.get(37510),e.options.sanitize&&(t.delete(40965),t.delete(37500),t.delete(37510)),e.unpack(t,41728),e.unpack(t,41729),t})})}catch(e){return Promise.reject(e)}}},{key:"unpack",value:function(e,t){var r=e.get(t);r&&1===r.length&&e.set(t,r[0])}},{key:"parseGpsBlock",value:function(){try{var e=this;if(e.gps)return;return yt(function(){if(!e.ifd0)return ft(e.parseIfd0Block())},function(){if(void 0!==e.gpsOffset){var t=e.parseBlock(e.gpsOffset,"gps");return t&&t.has(2)&&t.has(4)&&(t.set("latitude",mt.apply(void 0,t.get(2).concat([t.get(1)]))),t.set("longitude",mt.apply(void 0,t.get(4).concat([t.get(3)])))),t}})}catch(e){return Promise.reject(e)}}},{key:"parseInteropBlock",value:function(){try{var e=this;if(e.interop)return;return yt(function(){if(!e.ifd0)return ft(e.parseIfd0Block())},function(){return yt(function(){if(void 0===e.interopOffset&&!e.exif)return ft(e.parseExifBlock())},function(){if(void 0!==e.interopOffset)return e.parseBlock(e.interopOffset,"interop")})})}catch(e){return Promise.reject(e)}}},{key:"parseThumbnailBlock",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{var t=this;if(t.ifd1||t.ifd1Parsed)return;if(t.options.mergeOutput&&!e)return;return t.findIfd1Offset(),t.ifd1Offset>0&&(t.parseBlock(t.ifd1Offset,"ifd1"),t.ifd1Parsed=!0),t.ifd1}catch(e){return Promise.reject(e)}}},{key:"extractThumbnail",value:function(){try{var e=this;return e.headerParsed||e.parseHeader(),yt(function(){if(!e.ifd1Parsed)return ft(e.parseThumbnailBlock(!0))},function(){if(void 0!==e.ifd1){var t=e.ifd1.get(513),r=e.ifd1.get(514);return e.chunk.getUint8Array(t,r)}})}catch(e){return Promise.reject(e)}}},{key:"createOutput",value:function(){var e,t,r,n={},i=ue;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=w(i));for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:P(),n=this.options[t],i=n.pick,o=n.skip,s=(i=C(i)).size>0,a=0===o.size,u=this.chunk.getUint16(e);e+=2;for(var l=0;l13)throw I("Invalid TIFF value type. block: ".concat(r.toUpperCase(),", tag: ").concat(t.toString(16),", type: ").concat(i,", offset ").concat(e));if(e>this.chunk.byteLength)throw I("Invalid TIFF value offset. block: ".concat(r.toUpperCase(),", tag: ").concat(t.toString(16),", type: ").concat(i,", offset ").concat(e," is outside of chunk size ").concat(this.chunk.byteLength));if(1===i)return this.chunk.getUint8Array(e,o);if(2===i)return""===(n=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(n=this.chunk.getString(e,o)).trim())?void 0:n;if(7===i)return this.chunk.getUint8Array(e,o);if(1===o)return this.parseTagValue(i,e);for(var a=new(function(e){switch(i){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}}())(o),u=s,l=0;l4096&&(r=4096,n=Math.round(r/t)),n>4096&&(n=4096,r=Math.round(t*n)),e.width>r){var i=document.createElement("canvas");i.width=r,i.height=n,i.getContext("2d").drawImage(e,0,0,r,n),e=i}return e},i.resizeImage=function(e,t,r){e=this.protect(e);var n=Math.ceil(un(e.width/t));n<1&&(n=1);for(var i=t*Math.pow(2,n-1),o=r*Math.pow(2,n-1);n--;){var s=document.createElement("canvas");s.width=i,s.height=o,s.getContext("2d").drawImage(e,0,0,i,o),e=s,i=Math.round(i/2),o=Math.round(o/2)}return e},i.rotateImage=function(e,t){var r=e.width,n=e.height;90!==t.deg&&270!==t.deg||(r=e.height,n=e.width);var i=document.createElement("canvas");i.width=r,i.height=n;var o=i.getContext("2d");return o.translate(r/2,n/2),t.canvas&&(o.rotate(t.rad),o.scale(t.scaleX,t.scaleY)),o.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),i},i.canvasToBlob=function(e,t,r){try{e.getContext("2d").getImageData(0,0,1,1)}catch(hc){if(18===hc.code)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return e.toBlob?new Promise(function(n){e.toBlob(n,t,r)}).then(function(e){if(null===e)throw new Error("cannot read image, probably an svg with external resources");return e}):Promise.resolve().then(function(){return sn(e.toDataURL(t,r),{})}).then(function(e){if(null===e)throw new Error("could not extract blob, probably an old browser");return e})},i.setPreviewURL=function(e,t){this.uppy.setFileState(e,{preview:t})},i.addToQueue=function(e){this.queue.push(e),!1===this.queueProcessing&&this.processQueue()},i.processQueue=function(){var e=this;if(this.queueProcessing=!0,this.queue.length>0){var t=this.uppy.getFile(this.queue.shift());return t?this.requestThumbnail(t).catch(function(e){}).then(function(){return e.processQueue()}):void this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error")}this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated")},i.requestThumbnail=function(e){var t=this;return gt(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(function(r){t.setPreviewURL(e.id,r),t.uppy.log("[ThumbnailGenerator] Generated thumbnail for "+e.id),t.uppy.emit("thumbnail:generated",t.uppy.getFile(e.id),r)}).catch(function(r){t.uppy.log("[ThumbnailGenerator] Failed thumbnail for "+e.id+":","warning"),t.uppy.log(r,"warning"),t.uppy.emit("thumbnail:error",t.uppy.getFile(e.id),r)}):Promise.resolve()},i.install=function(){this.uppy.on("file-removed",this.onFileRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)},i.uninstall=function(){this.uppy.off("file-removed",this.onFileRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)},n}(pe.Plugin),wn.VERSION="1.6.5",_n),Cn=function(e){if("string"==typeof e){var t=[].slice.call(document.querySelectorAll(e));return t.length>0?t:null}if("object"==typeof e&&ue(e))return[e]},Pn=function(e){return Array.prototype.slice.call(e||[],0)},En=function(e,t){var r=[],n=[];return Pn(e.items).forEach(function(e){var i=e.webkitGetAsEntry();i&&n.push(function e(n){return new Promise(function(i){if(n.isFile)n.file(function(e){var t;e.relativePath=(t=n).fullPath&&t.fullPath!=="/"+t.name?t.fullPath:null,r.push(e),i()},function(e){t(e),i()});else if(n.isDirectory){!function e(t,r,n,i){var o=i.onSuccess;t.readEntries(function(i){var s=[].concat(r,i);i.length?setTimeout(function(){e(t,s,n,{onSuccess:o})},0):o(s)},function(e){n(e),o(r)})}(n.createReader(),[],t,{onSuccess:function(t){var r=t.map(function(t){return e(t)});Promise.all(r).then(function(){return i()})}})}})}(i))}),Promise.all(n).then(function(){return r})},Fn=function(e,t){var r=(void 0===t?{}:t).logDropError,n=void 0===r?function(){}:r;return e.items&&e.items[0]&&"webkitGetAsEntry"in e.items[0]?En(e,n):function(e){var t=Pn(e.files);return Promise.resolve(t)}(e)},An=function(e,t){if(t){var r=e.querySelector('[data-uppy-paneltype="'+t+'"]');if(r)return r}return e},On=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];function Un(e,t){var r=t[0];r&&(r.focus(),e.preventDefault())}function Tn(e,t,r){var n=An(r,t),i=Pn(n.querySelectorAll(On)),o=i.indexOf(document.activeElement);!function(e){return e.contains(document.activeElement)}(n)?Un(e,i):e.shiftKey&&0===o?function(e,t){var r=i[i.length-1];r&&(r.focus(),e.preventDefault())}(e):e.shiftKey||o!==i.length-1||Un(e,i)}var Rn={forModal:function(e,t,r){Tn(e,t,r)},forInline:function(e,t,r){null===t||Tn(e,t,r)}},xn={exports:{}};(function(e){!function(e,t){"object"==typeof xn.exports?xn.exports=t():e.ResizeObserver=t()}(this,function(){"use strict";var t=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var r=-1;return e.some(function(e,n){return e[0]===t&&(r=n,!0)}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var r=e(this.__entries__,t),n=this.__entries__[r];return n&&n[1]},t.prototype.set=function(t,r){var n=e(this.__entries__,t);~n?this.__entries__[n][1]=r:this.__entries__.push([t,r])},t.prototype.delete=function(t){var r=this.__entries__,n=e(r,t);~n&&r.splice(n,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var r=0,n=this.__entries__;r0},e.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),u?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=void 0===t?"":t;a.some(function(e){return!!~r.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),c=function(e,t){for(var r=0,n=Object.keys(t);r0},e}(),_="undefined"!=typeof WeakMap?new WeakMap:new t,S=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=l.getInstance(),n=new w(t,r,this);_.set(this,n)};return["observe","unobserve","disconnect"].forEach(function(e){S.prototype[e]=function(){var t;return(t=_.get(this))[e].apply(t,arguments)}}),void 0!==n.ResizeObserver?n.ResizeObserver:S})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),xn=xn.exports;var Dn={};(function(e){var t=NaN,r="[object Symbol]",n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt,u="object"==typeof e&&e&&e.Object===Object&&e,l="object"==typeof self&&self&&self.Object===Object&&self,c=u||l||Function("return this")(),p=Object.prototype.toString,d=Math.max,h=Math.min,f=function(){return c.Date.now()};function y(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&p.call(e)==r}(e))return t;if(y(e)){var u="function"==typeof e.valueOf?e.valueOf():e;e=y(u)?u+"":u}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var l=o.test(e);return l||s.test(e)?a(e.slice(2),l?2:8):i.test(e)?t:+e}Dn=function(e,t,r){var n,i,o,s,a,u,l=0,c=!1,p=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var r=n,o=i;return n=i=void 0,l=t,s=e.apply(o,r)}function b(e){var r=e-u;return void 0===u||r>=t||r<0||p&&e-l>=o}function w(){var e=f();if(b(e))return _(e);a=setTimeout(w,function(e){var r=t-(e-u);return p?h(r,o-(e-l)):r}(e))}function _(e){return a=void 0,v&&n?m(e):(n=i=void 0,s)}function S(){var e=f(),r=b(e);if(n=arguments,i=this,u=e,r){if(void 0===a)return function(e){return l=e,a=setTimeout(w,t),c?m(e):s}(u);if(p)return a=setTimeout(w,t),m(u)}return void 0===a&&(a=setTimeout(w,t)),s}return t=g(t)||0,y(r)&&(c=!!r.leading,o=(p="maxWait"in r)?d(g(r.maxWait)||0,t):o,v="trailing"in r?!!r.trailing:v),S.cancel=function(){void 0!==a&&clearTimeout(a),l=0,n=u=i=a=void 0},S.flush=function(){return void 0===a?s:_(f())},S}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Bn=function(){var e=!1;return Dn(function(t,r){var n=An(t,r),i=n.contains(document.activeElement);if(!i||!e){var o=n.querySelector("[data-uppy-super-focusable]");if(!i||o)if(o)o.focus({preventScroll:!0}),e=!0;else{var s=n.querySelector(On);s&&s.focus({preventScroll:!0}),e=!1}}},260)};function In(e,t){if(e.length!==t.length)return!1;for(var r=0;r0&&(n.uppy.log("[Dashboard] Files were dropped"),n.addFiles(e))})},n.handleRequestThumbnail=function(e){n.opts.waitForThumbnailsBeforeUpload||n.uppy.emit("thumbnail:request",e)},n.handleCancelThumbnail=function(e){n.opts.waitForThumbnailsBeforeUpload||n.uppy.emit("thumbnail:cancel",e)},n.handleKeyDownInInline=function(e){e.keyCode===Wn&&Rn.forInline(e,n.getPluginState().activeOverlayType,n.el)},n.handlePasteOnBody=function(e){n.el.contains(document.activeElement)&&n.handlePaste(e)},n.handleComplete=function(e){var t=e.failed;e.uploadID,n.opts.closeAfterFinish&&0===t.length&&n.requestCloseModal()},n.initEvents=function(){if(n.opts.trigger&&!n.opts.inline){var e=Cn(n.opts.trigger);e?e.forEach(function(e){return e.addEventListener("click",n.openModal)}):n.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}n.startListeningToResize(),document.addEventListener("paste",n.handlePasteOnBody),n.uppy.on("plugin-remove",n.removeTarget),n.uppy.on("file-added",n.hideAllPanels),n.uppy.on("dashboard:modal-closed",n.hideAllPanels),n.uppy.on("file-editor:complete",n.hideAllPanels),n.uppy.on("complete",n.handleComplete),document.addEventListener("focus",n.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",n.recordIfFocusedOnUppyRecently,!0),n.opts.inline&&n.el.addEventListener("keydown",n.handleKeyDownInInline)},n.removeEvents=function(){var e=Cn(n.opts.trigger);!n.opts.inline&&e&&e.forEach(function(e){return e.removeEventListener("click",n.openModal)}),n.stopListeningToResize(),document.removeEventListener("paste",n.handlePasteOnBody),window.removeEventListener("popstate",n.handlePopState,!1),n.uppy.off("plugin-remove",n.removeTarget),n.uppy.off("file-added",n.hideAllPanels),n.uppy.off("dashboard:modal-closed",n.hideAllPanels),n.uppy.off("complete",n.handleComplete),document.removeEventListener("focus",n.recordIfFocusedOnUppyRecently),document.removeEventListener("click",n.recordIfFocusedOnUppyRecently),n.opts.inline&&n.el.removeEventListener("keydown",n.handleKeyDownInInline)},n.superFocusOnEachUpdate=function(){var e=n.el.contains(document.activeElement),t=document.activeElement===document.body||null===document.activeElement,r=n.uppy.getState().info.isHidden,i=!n.opts.inline;r&&(i||e||t&&n.ifFocusedOnUppyRecently)?n.superFocus(n.el,n.getPluginState().activeOverlayType):n.superFocus.cancel()},n.afterUpdate=function(){n.superFocusOnEachUpdate()},n.cancelUpload=function(e){n.uppy.removeFile(e)},n.saveFileCard=function(e,t){n.uppy.setFileMeta(t,e),n.toggleFileCard()},n._attachRenderFunctionToTarget=function(e){var t=n.uppy.getPlugin(e.id);return Nn({},e,{icon:t.icon||n.opts.defaultPickerIcon,render:t.render})},n._isTargetSupported=function(e){var t=n.uppy.getPlugin(e.id);return"function"!=typeof t.isSupported||t.isSupported()},n._getAcquirers=Vn(function(e){return e.filter(function(e){return"acquirer"===e.type&&n._isTargetSupported(e)}).map(n._attachRenderFunctionToTarget)}),n._getProgressIndicators=Vn(function(e){return e.filter(function(e){return"progressindicator"===e.type}).map(n._attachRenderFunctionToTarget)}),n._getEditors=Vn(function(e){return e.filter(function(e){return"editor"===e.type}).map(n._attachRenderFunctionToTarget)}),n.render=function(e){var t,r=n.getPluginState(),i=e.files,o=e.capabilities,s=e.allowNewUpload,a=Object.keys(i).filter(function(e){return!i[e].progress.uploadStarted}),u=Object.keys(i).filter(function(e){return i[e].progress.uploadStarted}),l=Object.keys(i).filter(function(e){return i[e].isPaused}),c=Object.keys(i).filter(function(e){return i[e].progress.uploadComplete}),p=Object.keys(i).filter(function(e){return i[e].error}),d=Object.keys(i).filter(function(e){return!i[e].progress.uploadComplete&&i[e].progress.uploadStarted}),h=d.filter(function(e){return!i[e].isPaused}),f=Object.keys(i).filter(function(e){return i[e].progress.preprocess||i[e].progress.postprocess}),y=u.length>0,g=100===e.totalProgress&&c.length===Object.keys(i).length&&0===f.length,v=y&&p.length===u.length,m=0!==d.length&&l.length===d.length,b=n._getAcquirers(r.targets),w=n._getProgressIndicators(r.targets),_=n._getEditors(r.targets);return t="auto"===n.opts.theme?o.darkMode?"dark":"light":n.opts.theme,["files","folders","both"].indexOf(n.opts.fileManagerSelectionType)<0&&(n.opts.fileManagerSelectionType="files",console.error('Unsupported option for "fileManagerSelectionType". Using default of "'+n.opts.fileManagerSelectionType+'".')),Pr({state:e,isHidden:r.isHidden,files:i,newFiles:a,uploadStartedFiles:u,completeFiles:c,erroredFiles:p,inProgressFiles:d,inProgressNotPausedFiles:h,processingFiles:f,isUploadStarted:y,isAllComplete:g,isAllErrored:v,isAllPaused:m,totalFileCount:Object.keys(i).length,totalProgress:e.totalProgress,allowNewUpload:s,acquirers:b,theme:t,activePickerPanel:r.activePickerPanel,showFileEditor:r.showFileEditor,animateOpenClose:n.opts.animateOpenClose,isClosing:r.isClosing,getPlugin:n.uppy.getPlugin,progressindicators:w,editors:_,autoProceed:n.uppy.opts.autoProceed,id:n.id,closeModal:n.requestCloseModal,handleClickOutside:n.handleClickOutside,handleInputChange:n.handleInputChange,handlePaste:n.handlePaste,inline:n.opts.inline,showPanel:n.showPanel,hideAllPanels:n.hideAllPanels,log:n.uppy.log,i18n:n.i18n,i18nArray:n.i18nArray,removeFile:n.uppy.removeFile,uppy:n.uppy,info:n.uppy.info,note:n.opts.note,metaFields:r.metaFields,resumableUploads:o.resumableUploads||!1,individualCancellation:o.individualCancellation,isMobileDevice:o.isMobileDevice,pauseUpload:n.uppy.pauseResume,retryUpload:n.uppy.retryUpload,cancelUpload:n.cancelUpload,cancelAll:n.uppy.cancelAll,fileCardFor:r.fileCardFor,toggleFileCard:n.toggleFileCard,toggleAddFilesPanel:n.toggleAddFilesPanel,showAddFilesPanel:r.showAddFilesPanel,saveFileCard:n.saveFileCard,openFileEditor:n.openFileEditor,canEditFile:n.canEditFile,width:n.opts.width,height:n.opts.height,showLinkToFileUploadResult:n.opts.showLinkToFileUploadResult,fileManagerSelectionType:n.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:n.opts.proudlyDisplayPoweredByUppy,hideCancelButton:n.opts.hideCancelButton,hideRetryButton:n.opts.hideRetryButton,hidePauseResumeButton:n.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:n.opts.showRemoveButtonAfterComplete,containerWidth:r.containerWidth,containerHeight:r.containerHeight,areInsidesReadyToBeVisible:r.areInsidesReadyToBeVisible,isTargetDOMEl:n.isTargetDOMEl,parentElement:n.el,allowedFileTypes:n.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:n.uppy.opts.restrictions.maxNumberOfFiles,showSelectedFiles:n.opts.showSelectedFiles,handleRequestThumbnail:n.handleRequestThumbnail,handleCancelThumbnail:n.handleCancelThumbnail,isDraggingOver:r.isDraggingOver,handleDragOver:n.handleDragOver,handleDragLeave:n.handleDragLeave,handleDrop:n.handleDrop})},n.discoverProviderPlugins=function(){n.uppy.iteratePlugins(function(e){e&&!e.target&&e.opts&&e.opts.target===n.constructor&&n.addTarget(e)})},n.install=function(){n.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:!1,showFileEditor:!1,metaFields:n.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});var e=n.opts,t=e.inline,r=e.closeAfterFinish;if(t&&r)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");n.uppy.opts.allowMultipleUploads&&r&&n.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploads` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");var i=n.opts.target;i&&n.mount(i,zn(n)),(n.opts.plugins||[]).forEach(function(e){var t=n.uppy.getPlugin(e);t&&t.mount(zn(n),t)}),n.opts.disableStatusBar||n.uppy.use(en,{id:n.id+":StatusBar",target:zn(n),hideUploadButton:n.opts.hideUploadButton,hideRetryButton:n.opts.hideRetryButton,hidePauseResumeButton:n.opts.hidePauseResumeButton,hideCancelButton:n.opts.hideCancelButton,showProgressDetails:n.opts.showProgressDetails,hideAfterFinish:n.opts.hideProgressAfterFinish,locale:n.opts.locale}),n.opts.disableInformer||n.uppy.use(on,{id:n.id+":Informer",target:zn(n)}),n.opts.disableThumbnailGenerator||n.uppy.use(kn,{id:n.id+":ThumbnailGenerator",thumbnailWidth:n.opts.thumbnailWidth,waitForThumbnailsBeforeUpload:n.opts.waitForThumbnailsBeforeUpload,lazy:!n.opts.waitForThumbnailsBeforeUpload}),n.darkModeMediaQuery="undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;var o=!!n.darkModeMediaQuery&&n.darkModeMediaQuery.matches;n.uppy.log("[Dashboard] Dark mode is "+(o?"on":"off")),n.setDarkModeCapability(o),"auto"===n.opts.theme&&n.darkModeMediaQuery.addListener(n.handleSystemDarkModeChange),n.discoverProviderPlugins(),n.initEvents()},n.uninstall=function(){if(!n.opts.disableInformer){var e=n.uppy.getPlugin(n.id+":Informer");e&&n.uppy.removePlugin(e)}if(!n.opts.disableStatusBar){var t=n.uppy.getPlugin(n.id+":StatusBar");t&&n.uppy.removePlugin(t)}if(!n.opts.disableThumbnailGenerator){var r=n.uppy.getPlugin(n.id+":ThumbnailGenerator");r&&n.uppy.removePlugin(r)}(n.opts.plugins||[]).forEach(function(e){var t=n.uppy.getPlugin(e);t&&t.unmount()}),"auto"===n.opts.theme&&n.darkModeMediaQuery.removeListener(n.handleSystemDarkModeChange),n.unmount(),n.removeEvents()},n.id=n.opts.id||"Dashboard",n.title="Dashboard",n.type="orchestrator",n.modalName="uppy-Dashboard-"+I(),n.defaultLocale={strings:{closeModal:"Close Modal",importFrom:"Import from %{name}",addingMoreFiles:"Adding more files",addMoreFiles:"Add more files",dashboardWindowTitle:"File Uploader Window (Press escape to close)",dashboardTitle:"File Uploader",copyLinkToClipboardSuccess:"Link copied to clipboard",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",fileSource:"File source: %{name}",done:"Done",back:"Back",addMore:"Add more",removeFile:"Remove file",editFile:"Edit file",editing:"Editing %{file}",finishEditingFile:"Finish editing file",saveChanges:"Save changes",cancel:"Cancel",myDevice:"My Device",dropPasteFiles:"Drop files here, paste or %{browseFiles}",dropPasteFolders:"Drop files here, paste or %{browseFolders}",dropPasteBoth:"Drop files here, paste, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, paste, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, paste, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, paste, %{browseFiles}, %{browseFolders} or import from:",dropHint:"Drop your files here",browseFiles:"browse files",browseFolders:"browse folders",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy2:"%{backwardsCompat} %{uppy}",poweredBy:"Powered by"}};var i={target:"body",metaFields:[],trigger:"#uppy-select-files",inline:!1,width:750,height:550,thumbnailWidth:280,waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:Kn,showLinkToFileUploadResult:!0,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,onRequestCloseModal:function(){return n.closeModal()},showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,browserBackButtonClose:!1,theme:"light"};return n.opts=Nn({},i,r),n.i18nInit(),n.superFocus=Bn(),n.ifFocusedOnUppyRecently=!1,n.makeDashboardInsidesVisibleAnywayTimeout=null,n.removeDragOverClassTimeout=null,n}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(qn),jn.VERSION="1.12.2",Mn);function Qn(){return(Qn=Object.assign||function(e){for(var t=1;t0&&(e.mimeType=n[0])}return e},i._startRecording=function(){var e=this;this.recorder=new MediaRecorder(this.stream,this._getMediaRecorderOptions()),this.recordingChunks=[];var t=!1;this.recorder.addEventListener("dataavailable",function(r){e.recordingChunks.push(r.data);var n=e.uppy.opts.restrictions;if(e.recordingChunks.length>1&&null!=n.maxFileSize&&!t){var i=e.recordingChunks.reduce(function(e,t){return e+t.size},0),o=(i-e.recordingChunks[0].size)/(e.recordingChunks.length-1)*3;i>Math.max(0,n.maxFileSize-o)&&(t=!0,e.uppy.info(e.i18n("recordingStoppedMaxSize"),"warning",4e3),e._stopRecording())}}),this.recorder.start(500),this.opts.showRecordingLength&&(this.recordingLengthTimer=setInterval(function(){var t=e.getPluginState().recordingLengthSeconds;e.setPluginState({recordingLengthSeconds:t+1})},1e3)),this.setPluginState({isRecording:!0})},i._stopRecording=function(){var e=this;return new Promise(function(t,r){e.recorder.addEventListener("stop",function(){t()}),e.recorder.stop(),e.opts.showRecordingLength&&(clearInterval(e.recordingLengthTimer),e.setPluginState({recordingLengthSeconds:0}))}).then(function(){return e.setPluginState({isRecording:!1}),e.getVideo()}).then(function(t){try{e.uppy.addFile(t)}catch(hc){hc.isRestriction||e.uppy.log(hc)}}).then(function(){e.recordingChunks=null,e.recorder=null},function(t){throw e.recordingChunks=null,e.recorder=null,t})},i._stop=function(){this.stream.getAudioTracks().forEach(function(e){e.stop()}),this.stream.getVideoTracks().forEach(function(e){e.stop()}),this.webcamActive=!1,this.stream=null},i._getVideoElement=function(){return this.el.querySelector(".uppy-Webcam-video")},i._oneTwoThreeSmile=function(){var e=this;return new Promise(function(t,r){var n=e.opts.countdown,i=setInterval(function(){if(!e.webcamActive)return clearInterval(i),e.captureInProgress=!1,r(new Error("Webcam is not active"));n>0?(e.uppy.info(n+"...","warning",800),n--):(clearInterval(i),e.uppy.info(e.i18n("smile"),"success",1500),setTimeout(function(){return t()},1500))},1e3)})},i._takeSnapshot=function(){var e=this;this.captureInProgress||(this.captureInProgress=!0,this.opts.onBeforeSnapshot().catch(function(t){var r="object"==typeof t?t.message:t;return e.uppy.info(r,"error",5e3),Promise.reject(new Error("onBeforeSnapshot: "+r))}).then(function(){return e._getImage()}).then(function(t){e.captureInProgress=!1;try{e.uppy.addFile(t)}catch(hc){hc.isRestriction||e.uppy.log(hc)}},function(t){throw e.captureInProgress=!1,t}))},i._getImage=function(){var e=this,t=this._getVideoElement();if(!t)return Promise.reject(new Error("No video element found, likely due to the Webcam tab being closed."));var r=t.videoWidth,n=t.videoHeight,i=document.createElement("canvas");i.width=r,i.height=n,i.getContext("2d").drawImage(t,0,0);var o=this.uppy.opts.restrictions,s=[];this.opts.preferredImageMimeType?s=[this.opts.preferredImageMimeType]:o.allowedFileTypes&&(s=o.allowedFileTypes.map(Uo).filter(Ro));var a=s[0]||"image/jpeg",u=ho(a)||"jpg",l="cam-"+Date.now()+"."+u;return function(e,t,r){return e.toBlob?new Promise(function(n){e.toBlob(n,t,r)}):Promise.resolve().then(function(){return sn(e.toDataURL(t,r),{})})}(i,a).then(function(t){return{source:e.id,name:l,data:new Blob([t],{type:a}),type:a}})},i.getVideo=function(){var e=this.recordingChunks[0].type,t=ho(e);if(!t)return Promise.reject(new Error('Could not retrieve recording: Unsupported media type "'+e+'"'));var r="webcam-"+Date.now()+"."+t,n=new Blob(this.recordingChunks,{type:e}),i={source:this.id,name:r,data:new Blob([n],{type:e}),type:e};return Promise.resolve(i)},i._focus=function(){var e=this;this.opts.countdown&&setTimeout(function(){e.uppy.info(e.i18n("smile"),"success",1500)},1e3)},i.render=function(){this.webcamActive||this._start();var e=this.getPluginState();return e.cameraReady&&e.hasCamera?Oo(Co,Fo({},e,{onSnapshot:this._takeSnapshot,onStartRecording:this._startRecording,onStopRecording:this._stopRecording,onFocus:this._focus,onStop:this._stop,i18n:this.i18n,modes:this.opts.modes,showRecordingLength:this.opts.showRecordingLength,supportsRecording:"function"==typeof MediaRecorder&&!!MediaRecorder.prototype&&"function"==typeof MediaRecorder.prototype.start,recording:e.isRecording,mirror:this.opts.mirror,src:this.stream})):Oo(Eo,{icon:yo,i18n:this.i18n,hasCamera:e.hasCamera})},i.install=function(){this.setPluginState({cameraReady:!1,recordingLengthSeconds:0});var e=this.opts.target;e&&this.mount(e,this)},i.uninstall=function(){this.stream&&this._stop(),this.unmount()},n}(pe.Plugin),So.VERSION="1.6.10",ko),Do=ae.h,Bo=function(){return Do("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},Do("g",{fill:"none","fill-rule":"evenodd"},Do("rect",{fill:"#2C3E50",width:"32",height:"32",rx:"16"}),Do("path",{d:"M24.182 9H7.818C6.81 9 6 9.742 6 10.667v10c0 .916.81 1.666 1.818 1.666h4.546V24h7.272v-1.667h4.546c1 0 1.809-.75 1.809-1.666l.009-10C26 9.742 25.182 9 24.182 9zM24 21H8V11h16v10z",fill:"#FFF","fill-rule":"nonzero"}),Do("circle",{fill:"#FFF",cx:"16",cy:"16",r:"2"})))},Io=ae.h,jo=function(e){var t=e.recording,r=e.onStartRecording,n=e.onStopRecording,i=e.i18n;return t?Io("button",{class:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--video uppy-ScreenCapture-button--stop-rec",type:"button",title:i("stopRecording"),"aria-label":i("stopRecording"),onclick:n,"data-uppy-super-focusable":!0},Io("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},Io("rect",{x:"15",y:"15",width:"70",height:"70"}))):Io("button",{class:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--video",type:"button",title:i("startCapturing"),"aria-label":i("stopCapturing"),onclick:r,"data-uppy-super-focusable":!0},Io("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},Io("circle",{cx:"50",cy:"50",r:"40"})))},Mo=ae.h,Lo=function(e){var t=e.recording,r=e.recordedVideo,n=e.onSubmit,i=e.i18n;return r&&!t?Mo("button",{class:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--submit",type:"button",title:i("submitRecordedFile"),"aria-label":i("submitRecordedFile"),onclick:n,"data-uppy-super-focusable":!0},Mo("svg",{"aria-hidden":"true",focusable:"false",class:"uppy-c-icon",width:"48",height:"48",viewBox:"0 0 48 48"},Mo("path",{d:"M0 0h48v48h-48z",fill:"none"}),Mo("path",{d:"M38.71 20.07c-1.36-6.88-7.43-12.07-14.71-12.07-5.78 0-10.79 3.28-13.3 8.07-6.01.65-10.7 5.74-10.7 11.93 0 6.63 5.37 12 12 12h26c5.52 0 10-4.48 10-10 0-5.28-4.11-9.56-9.29-9.93zm-10.71 5.93v8h-8v-8h-6l10-10 10 10h-6z"}))):null};function No(){return(No=Object.assign||function(e){for(var t=1;t9?":":":0")+e},i.render=function(){var e=No({},this.props),t=e.recording,r=e.i18n,n=this.fmtMSS(this.state.elapsedTime);return t&&!this.timerRunning&&this.startTimer(),!t&&this.timerRunning&&this.resetTimer(),t?zo("div",{style:this.wrapperStyle},zo("div",{style:this.overlayStyle}),zo("div",{style:this.infoContainerStyle},zo("div",{style:this.infotextStyle},r("recording")),zo("div",{style:this.timeStyle},n))):null},n}(ae.Component),Ho=ae.h,Vo=function(e){var t=e.streamActive,r=e.i18n;return t?Ho("div",{title:r("streamActive"),"aria-label":r("streamActive"),class:"uppy-ScreenCapture-icon--stream uppy-ScreenCapture-icon--streamActive"},Ho("svg",{"aria-hidden":"true",focusable:"false",width:"24",height:"24",viewBox:"0 0 24 24"},Ho("path",{d:"M0 0h24v24H0z",opacity:".1",fill:"none"}),Ho("path",{d:"M0 0h24v24H0z",fill:"none"}),Ho("path",{d:"M1 18v3h3c0-1.66-1.34-3-3-3zm0-4v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7zm18-7H5v1.63c3.96 1.28 7.09 4.41 8.37 8.37H19V7zM1 10v2c4.97 0 9 4.03 9 9h2c0-6.08-4.93-11-11-11zm20-7H3c-1.1 0-2 .9-2 2v3h2V5h18v14h-7v2h7c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}))):Ho("div",{title:r("streamPassive"),"aria-label":r("streamPassive"),class:"uppy-ScreenCapture-icon--stream"},Ho("svg",{"aria-hidden":"true",focusable:"false",width:"24",height:"24",viewBox:"0 0 24 24"},Ho("path",{d:"M0 0h24v24H0z",opacity:".1",fill:"none"}),Ho("path",{d:"M0 0h24v24H0z",fill:"none"}),Ho("path",{d:"M21 3H3c-1.1 0-2 .9-2 2v3h2V5h18v14h-7v2h7c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM1 18v3h3c0-1.66-1.34-3-3-3zm0-4v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7zm0-4v2c4.97 0 9 4.03 9 9h2c0-6.08-4.93-11-11-11z"})))};function Wo(){return(Wo=Object.assign||function(e){for(var t=1;t=this.limit)&&0!==this.queuedHandlers.length){var e=this.queuedHandlers.shift(),t=this._call(e.fn);e.abort=t.abort,e.done=t.done}},t._queue=function(e,t){var r=this;void 0===t&&(t={});var n={fn:e,priority:t.priority||0,abort:function(){r._dequeue(n)},done:function(){throw new Error("Cannot mark a queued request as done: this indicates a bug")}},i=function(e,t){for(var r=0;ri.priority)return r;var i;return-1}(this.queuedHandlers);return-1===i?this.queuedHandlers.push(n):this.queuedHandlers.splice(i,0,n),n},t._dequeue=function(e){var t=this.queuedHandlers.indexOf(e);-1!==t&&this.queuedHandlers.splice(t,1)},t.run=function(e,t){return this.activeRequests0&&(this._aliveTimer&&clearTimeout(this._aliveTimer),this._aliveTimer=setTimeout(this._onTimedOut,this._timeout))},t.done=function(){this._aliveTimer&&(clearTimeout(this._aliveTimer),this._aliveTimer=null),this._isDone=!0},e}(),ds=function(e){return!!e&&(0!==e.readyState&&4!==e.readyState||0===e.status)};function hs(){return(hs=Object.assign||function(e){for(var t=1;t=200&&e<300}},t),this.requests=t.__queue,this.uploaderEvents=Object.create(null)}var t=e.prototype;return t._getOptions=function(e){var t=this.uppy.getState().xhrUpload,r=hs({},this.opts,t||{},e.xhrUpload||{},{headers:{}});return hs(r.headers,this.opts.headers),t&&hs(r.headers,t.headers),e.xhrUpload&&hs(r.headers,e.xhrUpload.headers),r},t.uploadFile=function(e,t,r){var n=this.uppy.getFile(e);if(n.error)throw new Error(n.error);return n.isRemote?this._uploadRemoteFile(n,t,r):this._uploadLocalFile(n,t,r)},t._addMetadata=function(e,t,r){(Array.isArray(r.metaFields)?r.metaFields:Object.keys(t)).forEach(function(r){e.append(r,t[r])})},t._createFormDataUpload=function(e,t){var r=new FormData;this._addMetadata(r,e.meta,t);var n=function(e){return e.data.slice(0,e.data.size,e.meta.type)}(e);return e.name?r.append(t.fieldName,n,e.meta.name):r.append(t.fieldName,n),r},t._createBareUpload=function(e,t){return e.data},t._onFileRemoved=function(e,t){this.uploaderEvents[e].on("file-removed",function(r){e===r.id&&t(r.id)})},t._onRetry=function(e,t){this.uploaderEvents[e].on("upload-retry",function(r){e===r&&t()})},t._onRetryAll=function(e,t){var r=this;this.uploaderEvents[e].on("retry-all",function(n){r.uppy.getFile(e)&&t()})},t._onCancelAll=function(e,t){var r=this;this.uploaderEvents[e].on("cancel-all",function(){r.uppy.getFile(e)&&t()})},t._uploadLocalFile=function(e,t,r){var n=this,i=this._getOptions(e);return this.uppy.log("uploading "+t+" of "+r),new Promise(function(t,r){var o=i.formData?n._createFormDataUpload(e,i):n._createBareUpload(e,i),s=new XMLHttpRequest;n.uploaderEvents[e.id]=new cs(n.uppy);var a=new ps(i.timeout,function(){s.abort(),l.done();var t=new Error(n.i18n("timedOut",{seconds:Math.ceil(i.timeout/1e3)}));n.uppy.emit("upload-error",e,t),r(t)}),u=I();s.upload.addEventListener("loadstart",function(e){n.uppy.log("[AwsS3/XHRUpload] "+u+" started")}),s.upload.addEventListener("progress",function(t){n.uppy.log("[AwsS3/XHRUpload] "+u+" progress: "+t.loaded+" / "+t.total),a.progress(),t.lengthComputable&&n.uppy.emit("upload-progress",e,{uploader:n,bytesUploaded:t.loaded,bytesTotal:t.total})}),s.addEventListener("load",function(o){if(n.uppy.log("[AwsS3/XHRUpload] "+u+" finished"),a.done(),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null),i.validateStatus(o.target.status,s.responseText,s)){var c=i.getResponseData(s.responseText,s),p=c[i.responseUrlFieldName],d={status:o.target.status,body:c,uploadURL:p};return n.uppy.emit("upload-success",e,d),p&&n.uppy.log("Download "+e.name+" from "+p),t(e)}var h=i.getResponseData(s.responseText,s),f=vs(s,i.getResponseError(s.responseText,s)),y={status:o.target.status,body:h};return n.uppy.emit("upload-error",e,f,y),r(f)}),s.addEventListener("error",function(t){n.uppy.log("[AwsS3/XHRUpload] "+u+" errored"),a.done(),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null);var o=vs(s,i.getResponseError(s.responseText,s));return n.uppy.emit("upload-error",e,o),r(o)}),s.open(i.method.toUpperCase(),i.endpoint,!0),s.withCredentials=i.withCredentials,""!==i.responseType&&(s.responseType=i.responseType),Object.keys(i.headers).forEach(function(e){s.setRequestHeader(e,i.headers[e])});var l=n.requests.run(function(){return s.send(o),function(){a.done(),s.abort()}},{priority:1});n._onFileRemoved(e.id,function(){l.abort(),r(new Error("File removed"))}),n._onCancelAll(e.id,function(){l.abort(),r(new Error("Upload cancelled"))})})},t._uploadRemoteFile=function(e,t,r){var n=this,i=this._getOptions(e);return new Promise(function(t,r){var o={};(Array.isArray(i.metaFields)?i.metaFields:Object.keys(e.meta)).forEach(function(t){o[t]=e.meta[t]}),new(e.remote.providerOptions.provider?fs:ys)(n.uppy,e.remote.providerOptions).post(e.remote.url,hs({},e.remote.body,{endpoint:i.endpoint,size:e.data.size,fieldname:i.fieldName,metadata:o,httpMethod:i.method,useFormData:i.formData,headers:i.headers})).then(function(o){var s=o.token,a=ls(e.remote.companionUrl),u=new gs({target:a+"/api/"+s,autoOpen:!1});n.uploaderEvents[e.id]=new cs(n.uppy),n._onFileRemoved(e.id,function(){u.send("pause",{}),l.abort(),t("upload "+e.id+" was removed")}),n._onCancelAll(e.id,function(){u.send("pause",{}),l.abort(),t("upload "+e.id+" was canceled")}),n._onRetry(e.id,function(){u.send("pause",{}),u.send("resume",{})}),n._onRetryAll(e.id,function(){u.send("pause",{}),u.send("resume",{})}),u.on("progress",function(t){return us(n,t,e)}),u.on("success",function(r){var o=i.getResponseData(r.response.responseText,r.response),s=o[i.responseUrlFieldName],a={status:r.response.status,body:o,uploadURL:s};return n.uppy.emit("upload-success",e,a),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null),t()}),u.on("error",function(t){var o=t.response,s=o?i.getResponseError(o.responseText,o):hs(new Error(t.error.message),{cause:t.error});n.uppy.emit("upload-error",e,s),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null),r(s)});var l=n.requests.run(function(){return u.open(),e.isPaused&&u.send("pause",{}),function(){return u.close()}})}).catch(function(t){n.uppy.emit("upload-error",e,t),r(t)})})},e}(),_s=function(e,t){var r,n=t.headers?t.headers["content-type"]:t.getResponseHeader("Content-Type");if("string"==typeof n){var i=(r=n,r.replace(/;.*$/,"")).toLowerCase();if("application/xml"===i||"text/xml"===i)return!0;if("text/html"===i&&/^<\?xml /.test(e))return!0}return!1};function Ss(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ks(){return(ks=Object.assign||function(e){for(var t=1;t"),n=e.indexOf("",r);return-1!==r&&-1!==n?e.slice(r+t.length+2,n):""}function Fs(e){if(e&&e.error){var t=new Error(e.message);throw ks(t,e.error),t}return e}var As=!1,Os=(bs=ms=function(e){var t,r;function n(t,r){var n;(n=e.call(this,t,r)||this).type="uploader",n.id=n.opts.id||"AwsS3",n.title="AWS S3";var i={timeout:3e4,limit:0,metaFields:[],getUploadParameters:n.getUploadParameters.bind(Ss(n))};return n.opts=ks({},i,r),n.client=new Ps(t,r),n.handleUpload=n.handleUpload.bind(Ss(n)),n.requests=new os(n.opts.limit),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var i=n.prototype;return i.getUploadParameters=function(e){if(!this.opts.companionUrl)throw new Error("Expected a `companionUrl` option containing a Companion address.");var t=e.meta.name,r=e.meta.type,n={};this.opts.metaFields.forEach(function(t){null!=e.meta[t]&&(n[t]=e.meta[t].toString())});var i=function e(t,r){var n=[];for(var i in t)if(as.call(t,i)){var o,s=t[i],a=encodeURIComponent(i);o="object"==typeof s?e(s,r?r+"["+a+"]":a):(r?r+"["+a+"]":a)+"="+encodeURIComponent(s),n.push(o)}return n.join("&")}({filename:t,type:r,metadata:n});return this.client.get("s3/params?"+i).then(Fs)},i.validateParameters=function(e,t){if("object"!=typeof t||!t||"string"!=typeof t.url||"object"!=typeof t.fields&&null!=t.fields||null!=t.method&&!/^(put|post)$/i.test(t.method)){var r=new TypeError("AwsS3: got incorrect result from 'getUploadParameters()' for file '"+e.name+"', expected an object '{ url, method, fields, headers }'.\nSee https://uppy.io/docs/aws-s3/#getUploadParameters-file for more on the expected format.");throw console.error(r),r}},i.handleUpload=function(e){var t=this,r=Object.create(null);function n(e){var t=e.id;k(r,t)&&r[t].abort()}this.uppy.on("file-removed",n),e.forEach(function(e){var r=t.uppy.getFile(e);t.uppy.emit("upload-started",r)});var i=this.requests.wrapPromiseFunction(function(e){return t.opts.getUploadParameters(e)}),o=e.length;return ss(e.map(function(e,n){return r[e]=i(t.uppy.getFile(e)),r[e].then(function(i){delete r[e];var s=t.uppy.getFile(e);t.validateParameters(s,i);var a=i.method,u=void 0===a?"post":a,l=i.url,c=i.fields,p=i.headers,d={method:u,formData:"post"===u.toLowerCase(),endpoint:l,metaFields:c?Object.keys(c):[]};return p&&(d.headers=p),t.uppy.setFileState(s.id,{meta:ks({},s.meta,c),xhrUpload:d}),t._uploader.uploadFile(s.id,n,o)}).catch(function(n){delete r[e];var i=t.uppy.getFile(e);t.uppy.emit("upload-error",i,n)})})).then(function(e){return t.uppy.off("file-removed",n),e})},i.install=function(){var e=this.uppy;this.uppy.addUploader(this.handleUpload);var t={fieldName:"file",responseUrlFieldName:"location",timeout:this.opts.timeout,__queue:this.requests,responseType:"text",getResponseData:this.opts.getResponseData||function(t,r){var n,i;return _s(t,r)?{location:(n=r.responseURL,i=Es(t,"Location"),n?new Cs(i,n).toString():new Cs(i).toString()),bucket:Es(t,"Bucket"),key:Es(t,"Key"),etag:Es(t,"ETag")}:"POST"===this.method.toUpperCase()?(As||(e.log("[AwsS3] No response data found, make sure to set the success_action_status AWS SDK option to 201. See https://uppy.io/docs/aws-s3/#POST-Uploads","warning"),As=!0),{location:null}):r.responseURL?{location:r.responseURL.replace(/\?.*$/,"")}:{location:null}},getResponseError:function(e,t){if(_s(e,t)){var r=Es(e,"Message");return new Error(r)}}};this._uploader=new ws(this.uppy,t),this._uploader.i18n=this.uppy.i18n},i.uninstall=function(){this.uppy.removePreProcessor(this.handleUpload)},n}(pe.Plugin),ms.VERSION="1.6.9",bs),Us={};function Ts(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rs(e,t){for(var r=0;r=t))break}r.forEach(function(t){e._uploadPartRetryable(t).catch(function(t){e._onError(t)})})}}},t._retryable=function(e){var t=this,r=e.before,n=e.attempt,i=e.after,o=this.options.retryDelays,s=this.abortController.signal;return r&&r(),function e(r){return n().catch(function(n){if(t._aborted())throw Ks();if(function(e){if(e.source&&"number"==typeof e.source.status){var t=e.source.status;return 0===t||409===t||423===t||t>=500&&t<600}return!1}(n)&&r=300){var r=new Error("Non 2xx");return r.source=t.target,void n.reject(r)}i._onPartProgress(e,o.size,o.size);var s=t.target.getResponseHeader("ETag");null!==s?(i._onPartComplete(e,s),n.resolve()):n.reject(new Error("AwsS3/Multipart: Could not read the ETag header. This likely means CORS is not configured correctly on the S3 Bucket. Seee https://uppy.io/docs/aws-s3-multipart#S3-Bucket-Configuration for instructions."))}),u.addEventListener("error",function(t){l(),i.chunkState[e].busy=!1;var r=new Error("Unknown error");r.source=t.target,n.reject(r)}),u.send(o),a},t._completeUpload=function(){var e=this;return this.parts.sort(function(e,t){return e.PartNumber-t.PartNumber}),Promise.resolve().then(function(){return e.options.completeMultipartUpload({key:e.key,uploadId:e.uploadId,parts:e.parts})}).then(function(t){e.options.onSuccess(t)},function(t){e._onError(t)})},t._abortUpload=function(){var e=this;this.abortController.abort(),this.createdPromise.then(function(){e.options.abortMultipartUpload({key:e.key,uploadId:e.uploadId})},function(){})},t._onError=function(e){e&&"AbortError"===e.name||this.options.onError(e)},t.start=function(){this.isPaused=!1,this.uploadId?this._resumeUpload():this._createUpload()},t.pause=function(){this.abortController.abort(),this.abortController=new Xs,this.isPaused=!0},t.abort=function(e){if(void 0===e&&(e={}),!e.really)return this.pause();this._abortUpload()},e}();function Js(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qs(){return(Qs=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(function(e,t){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this),(t=r.call(this,e)).originalRequest=o,t.originalResponse=s,t.causingError=i,null!=i&&(e+=", caused by ".concat(i.toString())),null!=o){var a=o.getHeader("X-Request-ID")||"n/a",u=o.getMethod(),l=o.getURL(),c=s?s.getStatus():"n/a",p=s?s.getBody()||"":"n/a";e+=", originated from request (method: ".concat(u,", url: ").concat(l,", response code: ").concat(c,", response text: ").concat(p,", request id: ").concat(a,")")}return t.message=e,t}return n}();ia.default=ca;var pa={};Object.defineProperty(pa,"__esModule",{value:!0}),pa.default=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})};var da={exports:{}};(function(e){!function(e,t){"object"==typeof da.exports?da.exports=t(e):t(e)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:this,function(e){"use strict";var t,r=(e=e||{}).Base64,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=function(e){for(var t={},r=0,n=e.length;r>>6)+o(128|63&t):o(224|t>>>12&15)+o(128|t>>>6&63)+o(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return o(240|t>>>18&7)+o(128|t>>>12&63)+o(128|t>>>6&63)+o(128|63&t)},a=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,u=function(e){return e.replace(a,s)},l=function(e){var t=[0,2,1][e.length%3],r=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[n.charAt(r>>>18),n.charAt(r>>>12&63),t>=2?"=":n.charAt(r>>>6&63),t>=1?"=":n.charAt(63&r)].join("")},c=e.btoa&&"function"==typeof e.btoa?function(t){return e.btoa(t)}:function(e){if(e.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return e.replace(/[\s\S]{1,3}/g,l)},p=function(e){return c(u(String(e)))},d=function(e){return e.replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,"")},h=function(e,t){return t?d(p(e)):p(e)};e.Uint8Array&&(t=function(e,t){for(var r="",i=0,o=e.length;i>>18)+n.charAt(l>>>12&63)+(void 0!==a?n.charAt(l>>>6&63):"=")+(void 0!==u?n.charAt(63&l):"=")}return t?d(r):r});var f,y=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,g=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return o(55296+(t>>>10))+o(56320+(1023&t));case 3:return o((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return o((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},v=function(e){return e.replace(y,g)},m=function(e){var t=e.length,r=t%4,n=(t>0?i[e.charAt(0)]<<18:0)|(t>1?i[e.charAt(1)]<<12:0)|(t>2?i[e.charAt(2)]<<6:0)|(t>3?i[e.charAt(3)]:0),s=[o(n>>>16),o(n>>>8&255),o(255&n)];return s.length-=[0,0,2,1][r],s.join("")},b=e.atob&&"function"==typeof e.atob?function(t){return e.atob(t)}:function(e){return e.replace(/\S{1,4}/g,m)},w=function(e){return b(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},_=function(e){return function(e){return v(b(e))}(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))};if(e.Uint8Array&&(f=function(e){return Uint8Array.from(w(e),function(e){return e.charCodeAt(0)})}),e.Base64={VERSION:"2.6.2",atob:w,btoa:c,fromBase64:_,toBase64:h,utob:u,encode:h,encodeURI:function(e){return h(e,!0)},btou:v,decode:_,noConflict:function(){var t=e.Base64;return e.Base64=r,t},fromUint8Array:t,toUint8Array:f},"function"==typeof Object.defineProperty){var S=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};e.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",S(function(){return _(this)})),Object.defineProperty(String.prototype,"toBase64",S(function(e){return h(this,e)})),Object.defineProperty(String.prototype,"toBase64URI",S(function(){return h(this,!0)}))}}return e.Meteor&&(Base64=e.Base64),!!da.exports&&(da.exports.Base64=e.Base64),{Base64:e.Base64}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),da=da.exports;var ha={};Object.defineProperty(ha,"__esModule",{value:!0}),ha.enableDebugLog=function(){fa=!0},ha.log=function(e){fa&&console.log(e)};var fa=!1,ya={};Object.defineProperty(ya,"__esModule",{value:!0}),ya.default=void 0;var ga=ba(ia),va=ba(pa),ma=ba(is);function ba(e){return e&&e.__esModule?e:{default:e}}function wa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _a(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if("function"==typeof r||"function"==typeof n)throw new Error("tus: the terminate function does not accept a callback since v2 anymore; please use the returned Promise instead");var i=Fa("DELETE",t,r);return i.send().then(function(e){if(204!==e.getStatus())throw new ga.default("tus: unexpected response while terminating upload",null,i,e)}).catch(function(n){if(n instanceof ga.default||(n=new ga.default("tus: failed to terminate upload",n,i,null)),!Aa(n,0,r))throw n;var o=r.retryDelays[0],s=r.retryDelays.slice(1),a=_a({},r,{retryDelays:s});return new Promise(function(e){return setTimeout(e,o)}).then(function(){return e.terminate(t,a)})})}}],(r=[{key:"findPreviousUploads",value:function(){var e=this;return this.options.fingerprint(this.file,this.options).then(function(t){return e._urlStorage.findUploadsByFingerprint(t)})}},{key:"resumeFromPreviousUpload",value:function(e){this.url=e.uploadUrl||null,this._parallelUploadUrls=e.parallelUploadUrls||null,this._urlStorageKey=e.urlStorageKey}},{key:"start",value:function(){var e=this,t=this.file;if(t)if(this.options.endpoint||this.options.uploadUrl){var r=this.options.retryDelays;null==r||"[object Array]"===Object.prototype.toString.call(r)?(this.options.parallelUploads>1&&["uploadUrl","uploadSize","uploadLengthDeferred"].forEach(function(t){e.options[t]&&e._emitError(new Error("tus: cannot use the ".concat(t," option when parallelUploads is enabled")))}),this.options.fingerprint(t,this.options).then(function(r){return null==r?(0,ha.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,ha.log)("Calculated fingerprint: ".concat(r)),e._fingerprint=r,e._source?e._source:e.options.fileReader.openFile(t,e.options.chunkSize)}).then(function(t){e._source=t,e.options.parallelUploads>1||null!=e._parallelUploadUrls?e._startParallelUpload():e._startSingleUpload()}).catch(function(t){e._emitError(t)})):this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"))}else this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));else this._emitError(new Error("tus: no file or stream to upload provided"))}},{key:"_startParallelUpload",value:function(){var t=this,r=this._size=this._source.size,n=0;this._parallelUploads=[];var i=null!=this._parallelUploadUrls?this._parallelUploadUrls.length:this.options.parallelUploads,o=function(e,t,r){for(var n=Math.floor(e/t),i=[],o=0;othis._offsetBeforeRetry&&(this._retryAttempt=0),Aa(e,this._retryAttempt,this.options))){var r=this.options.retryDelays[this._retryAttempt++];return this._offsetBeforeRetry=this._offset,void(this._retryTimeout=setTimeout(function(){t.start()},r))}if("function"!=typeof this.options.onError)throw e;this.options.onError(e)}}},{key:"_emitSuccess",value:function(){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),"function"==typeof this.options.onSuccess&&this.options.onSuccess()}},{key:"_emitProgress",value:function(e,t){"function"==typeof this.options.onProgress&&this.options.onProgress(e,t)}},{key:"_emitChunkComplete",value:function(e,t,r){"function"==typeof this.options.onChunkComplete&&this.options.onChunkComplete(e,t,r)}},{key:"_createUpload",value:function(){var e=this;if(this.options.endpoint){var t=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?t.setHeader("Upload-Defer-Length",1):t.setHeader("Upload-Length",this._size);var r,n=Pa(this.options.metadata);""!==n&&t.setHeader("Upload-Metadata",n),this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,r=this._addChunkToRequest(t)):r=this._sendRequest(t,null),r.then(function(r){if(Ea(r.getStatus(),200)){var n=r.getHeader("Location");if(null!=n){if(e.url=Oa(e.options.endpoint,n),(0,ha.log)("Created upload at ".concat(e.url)),"function"==typeof e.options._onUploadUrlAvailable&&e.options._onUploadUrlAvailable(),0===e._size)return e._emitSuccess(),void e._source.close();e._saveUploadInUrlStorage(),e.options.uploadDataDuringCreation?e._handleUploadResponse(t,r):(e._offset=0,e._performUpload())}else e._emitHttpError(t,r,"tus: invalid or missing Location header")}else e._emitHttpError(t,r,"tus: unexpected response while creating upload")}).catch(function(r){e._emitHttpError(t,null,"tus: failed to create upload",r)})}else this._emitError(new Error("tus: unable to create upload because no endpoint is provided"))}},{key:"_resumeUpload",value:function(){var e=this,t=this._openRequest("HEAD",this.url);this._sendRequest(t,null).then(function(r){var n=r.getStatus();if(!Ea(n,200))return Ea(n,400)&&e._removeFromUrlStorage(),423===n?void e._emitHttpError(t,r,"tus: upload is currently locked; retry later"):e.options.endpoint?(e.url=null,void e._createUpload()):void e._emitHttpError(t,r,"tus: unable to resume upload (new upload cannot be created without an endpoint)");var i=parseInt(r.getHeader("Upload-Offset"),10);if(isNaN(i))e._emitHttpError(t,r,"tus: invalid or missing offset value");else{var o=parseInt(r.getHeader("Upload-Length"),10);if(!isNaN(o)||e.options.uploadLengthDeferred){if("function"==typeof e.options._onUploadUrlAvailable&&e.options._onUploadUrlAvailable(),i===o)return e._emitProgress(o,o),void e._emitSuccess();e._offset=i,e._performUpload()}else e._emitHttpError(t,r,"tus: invalid or missing length value")}}).catch(function(r){e._emitHttpError(t,null,"tus: failed to resume upload",r)})}},{key:"_performUpload",value:function(){var e,t=this;this._aborted||(this.options.overridePatchMethod?(e=this._openRequest("POST",this.url)).setHeader("X-HTTP-Method-Override","PATCH"):e=this._openRequest("PATCH",this.url),e.setHeader("Upload-Offset",this._offset),this._addChunkToRequest(e).then(function(r){Ea(r.getStatus(),200)?t._handleUploadResponse(e,r):t._emitHttpError(e,r,"tus: unexpected response while uploading chunk")}).catch(function(r){t._aborted||t._emitHttpError(e,null,"tus: failed to upload chunk at offset "+t._offset,r)}))}},{key:"_addChunkToRequest",value:function(e){var t=this,r=this._offset,n=this._offset+this.options.chunkSize;return e.setProgressHandler(function(e){t._emitProgress(r+e,t._size)}),e.setHeader("Content-Type","application/offset+octet-stream"),(n===1/0||n>this._size)&&!this.options.uploadLengthDeferred&&(n=this._size),this._source.slice(r,n).then(function(r){var n=r.value,i=r.done;return t.options.uploadLengthDeferred&&i&&(t._size=t._offset+(n&&n.size?n.size:0),e.setHeader("Upload-Length",t._size)),null===n?t._sendRequest(e):(t._emitProgress(t._offset,t._size),t._sendRequest(e,n))})}},{key:"_handleUploadResponse",value:function(e,t){var r=parseInt(t.getHeader("Upload-Offset"),10);if(isNaN(r))this._emitHttpError(e,t,"tus: invalid or missing offset value");else{if(this._emitProgress(r,this._size),this._emitChunkComplete(r-this._offset,r,this._size),this._offset=r,r==this._size)return this._emitSuccess(),void this._source.close();this._performUpload()}}},{key:"_openRequest",value:function(e,t){var r=Fa(e,t,this.options);return this._req=r,r}},{key:"_removeFromUrlStorage",value:function(){var e=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(t){e._emitError(t)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var e=this;if(this.options.storeFingerprintForResuming&&this._fingerprint){var t={size:this._size,metadata:this.options.metadata,creationTime:(new Date).toString()};this._parallelUploads?t.parallelUploadUrls=this._parallelUploadUrls:t.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,t).then(function(t){return e._urlStorageKey=t}).catch(function(t){e._emitError(t)})}}},{key:"_sendRequest",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"function"==typeof this.options.onBeforeRequest&&this.options.onBeforeRequest(e),e.send(r).then(function(r){return"function"==typeof t.options.onAfterResponse&&t.options.onAfterResponse(e,r),r})}}])&&ka(t.prototype,r),n&&ka(t,n),e}();function Pa(e){var t=[];for(var r in e)t.push(r+" "+da.Base64.encode(e[r]));return t.join(",")}function Ea(e,t){return e>=t&&e0&&void 0!==arguments[0]?arguments[0]:null;return new Promise(function(r,n){e._xhr.onload=function(){r(new Ga(e._xhr))},e._xhr.onerror=function(e){n(e)},e._xhr.send(t)})}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),e}(),Ga=function(){function e(t){za(this,e),this._xhr=t}return Ha(e,[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(e){return this._xhr.getResponseHeader(e)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),e}(),Xa={};Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.default=void 0;Xa.default=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase()};var Ka={};Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.default=function(e){return new Promise(function(t,r){var n=new XMLHttpRequest;n.responseType="blob",n.onload=function(){var e=n.response;t(e)},n.onerror=function(e){r(e)},n.open("GET",e),n.send()})};var $a={};Object.defineProperty($a,"__esModule",{value:!0}),$a.default=void 0;$a.default=function(){return"undefined"!=typeof window&&(void 0!==window.PhoneGap||void 0!==window.Cordova||void 0!==window.cordova)};var Ya={};Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.default=function(e){return new Promise(function(t,r){var n=new FileReader;n.onload=function(){var e=new Uint8Array(n.result);t({value:e})},n.onerror=function(e){r(e)},n.readAsArrayBuffer(e)})};var Ja={};Object.defineProperty(Ja,"__esModule",{value:!0}),Ja.default=void 0;var Qa=ru(Xa),Za=ru(Ka),eu=ru($a),tu=ru(Ya);function ru(e){return e&&e.__esModule?e:{default:e}}function nu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iu(e,t){for(var r=0;rthis._bufferOffset&&(this._buffer=this._buffer.slice(e-this._bufferOffset),this._bufferOffset=e);var r=0===uu(this._buffer);return this._done&&r?null:this._buffer.slice(0,t-e)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}]),e}();function uu(e){return void 0===e?0:void 0!==e.size?e.size:e.length}var lu=function(){function e(){nu(this,e)}return ou(e,[{key:"openFile",value:function(e,t){return(0,Qa.default)()&&e&&void 0!==e.uri?(0,Za.default)(e.uri).then(function(e){return new su(e)}).catch(function(e){throw new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. "+e)}):"function"==typeof e.slice&&void 0!==e.size?Promise.resolve(new su(e)):"function"==typeof e.read?(t=+t,isFinite(t)?Promise.resolve(new au(e,t)):Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option"))):Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment"))}}]),e}();Ja.default=lu;var cu={};Object.defineProperty(cu,"__esModule",{value:!0}),cu.default=function(e,t){return(0,du.default)()?Promise.resolve(function(e,t){var r=e.exif?function(e){var t=0;if(0===e.length)return t;for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,t){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this),t=Pu({},Fu,{},t),i.call(this,e,t)}return t=o,r=[{key:"terminate",value:function(e,t,r){return t=Pu({},Fu,{},t),fu.default.terminate(e,t,r)}}],null&&_u(t.prototype,null),r&&_u(t,r),o}();hu.Upload=Au;var Ou,Uu,Tu=window,Ru=Tu.XMLHttpRequest,xu=Tu.Blob;Ru&&xu&&xu.prototype.slice;function Du(){return(Du=Object.assign||function(e){for(var t=1;t0)return function(e){if(!((e=String(e)).length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"days":case"day":case"d":return r*Gu;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*r;case"minutes":case"minute":case"mins":case"min":case"m":return r*Wu;case"seconds":case"second":case"secs":case"sec":case"s":return r*Vu;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(e);if("number"===n&&!1===isNaN(e))return t.long?Xu(r=e,Gu,"day")||Xu(r,36e5,"hour")||Xu(r,Wu,"minute")||Xu(r,Vu,"second")||r+" ms":function(e){return e>=Gu?Math.round(e/Gu)+"d":e>=36e5?Math.round(e/36e5)+"h":e>=Wu?Math.round(e/Wu)+"m":e>=Vu?Math.round(e/Vu)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))},Ku.instances=[],Ku.names=[],Ku.skips=[],Ku.formatters={};var Ju={};(function(e){function t(){var t;try{t=Ju.storage.debug}catch(Dd){}return!t&&void 0!==e&&"env"in e&&(t=e.env.DEBUG),t}(Ju=Ju=Ku).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},Ju.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+Ju.humanize(this.diff),t){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(n++,"%c"===e&&(i=n))}),e.splice(i,0,r)}},Ju.save=function(e){try{null==e?Ju.storage.removeItem("debug"):Ju.storage.debug=e}catch(Dd){}},Ju.load=t,Ju.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},Ju.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(Dd){}}(),Ju.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],Ju.formatters.j=function(e){try{return JSON.stringify(e)}catch(hc){return"[UnexpectedJSONParseError]: "+hc.message}},Ju.enable(t())}).call(this,e);var Qu=Ju("socket.io-client:url"),Zu=function(e,t){var r=e;t=t||"undefined"!=typeof location&&location,null==e&&(e=t.protocol+"//"+t.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(Qu("protocol-less url %s",e),e=void 0!==t?t.protocol+"//"+e:"https://"+e),Qu("parse %s",e),r=Hu(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var n=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+n+":"+r.port,r.href=r.protocol+"://"+n+(t&&t.port===r.port?"":":"+r.port),r};function el(e,t,r){if(!(e0)return function(e){if(!((e=String(e)).length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"days":case"day":case"d":return 864e5*r;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*r;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*r;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(e);if("number"===n&&!1===isNaN(e))return t.long?el(r=e,864e5,"day")||el(r,36e5,"hour")||el(r,6e4,"minute")||el(r,1e3,"second")||r+" ms":function(e){return e>=864e5?Math.round(e/864e5)+"d":e>=36e5?Math.round(e/36e5)+"h":e>=6e4?Math.round(e/6e4)+"m":e>=1e3?Math.round(e/1e3)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))},tl.instances=[],tl.names=[],tl.skips=[],tl.formatters={};var il={};(function(e){function t(){var t;try{t=il.storage.debug}catch(Dd){}return!t&&void 0!==e&&"env"in e&&(t=e.env.DEBUG),t}(il=il=tl).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},il.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+il.humanize(this.diff),t){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(n++,"%c"===e&&(i=n))}),e.splice(i,0,r)}},il.save=function(e){try{null==e?il.storage.removeItem("debug"):il.storage.debug=e}catch(Dd){}},il.load=t,il.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},il.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(Dd){}}(),il.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],il.formatters.j=function(e){try{return JSON.stringify(e)}catch(hc){return"[UnexpectedJSONParseError]: "+hc.message}},il.enable(t())}).call(this,e);var ol={exports:{}};function sl(e){if(e)return function(e){for(var t in sl.prototype)e[t]=sl.prototype[t];return e}(e)}ol.exports=sl,sl.prototype.on=sl.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},sl.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},sl.prototype.off=sl.prototype.removeListener=sl.prototype.removeAllListeners=sl.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i0)return function(e){if(!((e=String(e)).length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"days":case"day":case"d":return 864e5*r;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*r;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*r;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(e);if("number"===n&&!1===isNaN(e))return t.long?Cl(r=e,864e5,"day")||Cl(r,36e5,"hour")||Cl(r,6e4,"minute")||Cl(r,1e3,"second")||r+" ms":function(e){return e>=864e5?Math.round(e/864e5)+"d":e>=36e5?Math.round(e/36e5)+"h":e>=6e4?Math.round(e/6e4)+"m":e>=1e3?Math.round(e/1e3)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))},Pl.instances=[],Pl.names=[],Pl.skips=[],Pl.formatters={};var Al={};(function(e){function t(){var t;try{t=Al.storage.debug}catch(Dd){}return!t&&void 0!==e&&"env"in e&&(t=e.env.DEBUG),t}(Al=Al=Pl).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},Al.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+Al.humanize(this.diff),t){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(n++,"%c"===e&&(i=n))}),e.splice(i,0,r)}},Al.save=function(e){try{null==e?Al.storage.removeItem("debug"):Al.storage.debug=e}catch(Dd){}},Al.load=t,Al.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},Al.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(Dd){}}(),Al.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],Al.formatters.j=function(e){try{return JSON.stringify(e)}catch(hc){return"[UnexpectedJSONParseError]: "+hc.message}},Al.enable(t())}).call(this,e);var Ol=[].indexOf,Ul=function(e,t){if(Ol)return e.indexOf(t);for(var r=0;rn&&(r=n),t>=n||t>=r||0===n)return new ArrayBuffer(0);for(var i=new Uint8Array(e),o=new Uint8Array(r-t),s=t,a=0;s=55296&&t<=56319&&i=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function Wl(e,t){return ql(e>>t&63|128)}function Gl(e,t){if(0==(4294967168&e))return ql(e);var r="";return 0==(4294965248&e)?r=ql(e>>6&31|192):0==(4294901760&e)?(Vl(e,t)||(e=65533),r=ql(e>>12&15|224),r+=Wl(e,6)):0==(4292870144&e)&&(r=ql(e>>18&7|240),r+=Wl(e,12),r+=Wl(e,6)),r+ql(63&e|128)}function Xl(){if(Nl>=Ll)throw Error("Invalid byte index");var e=255&Ml[Nl];if(Nl++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function Kl(e){var t,r;if(Nl>Ll)throw Error("Invalid byte index");if(Nl==Ll)return!1;if(t=255&Ml[Nl],Nl++,0==(128&t))return t;if(192==(224&t)){if((r=(31&t)<<6|Xl())>=128)return r;throw Error("Invalid continuation byte")}if(224==(240&t)){if((r=(15&t)<<12|Xl()<<6|Xl())>=2048)return Vl(r,e)?r:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(r=(7&t)<<18|Xl()<<12|Xl()<<6|Xl())>=65536&&r<=1114111)return r;throw Error("Invalid UTF-8 detected")}var $l=function(e,t){for(var r=!1!==(t=t||{}).strict,n=Hl(e),i=n.length,o=-1,s="";++o65535&&(i+=ql((t-=65536)>>>10&1023|55296),t=56320|1023&t),i+=ql(t);return i}(i)},Jl={};!function(){"use strict";for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256),r=0;r>2],o+=e[(3&n[r])<<4|n[r+1]>>4],o+=e[(15&n[r+1])<<2|n[r+2]>>6],o+=e[63&n[r+2]];return i%3==2?o=o.substring(0,o.length-1)+"=":i%3==1&&(o=o.substring(0,o.length-2)+"=="),o},Jl.decode=function(e){var r,n,i,o,s,a=.75*e.length,u=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var c=new ArrayBuffer(a),p=new Uint8Array(c);for(r=0;r>4,p[l++]=(15&i)<<4|o>>2,p[l++]=(3&o)<<6|63&s;return c}}();var Ql={},Zl=void 0!==Zl?Zl:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,ec=function(){try{return 2===new Blob(["hi"]).size}catch(Dd){return!1}}(),tc=ec&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(Dd){return!1}}(),rc=Zl&&Zl.prototype.append&&Zl.prototype.getBlob;function nc(e){return e.map(function(e){if(e.buffer instanceof ArrayBuffer){var t=e.buffer;if(e.byteLength!==t.byteLength){var r=new Uint8Array(e.byteLength);r.set(new Uint8Array(t,e.byteOffset,e.byteLength)),t=r.buffer}return t}return e})}function ic(e,t){t=t||{};var r=new Zl;return nc(e).forEach(function(e){r.append(e)}),t.type?r.getBlob(t.type):r.getBlob()}function oc(e,t){return new Blob(nc(e),t||{})}"undefined"!=typeof Blob&&(ic.prototype=Blob.prototype,oc.prototype=Blob.prototype),Ql=ec?tc?Blob:oc:rc?ic:void 0;var sc,ac={};"undefined"!=typeof ArrayBuffer&&(sc=Jl);var uc="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),lc="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),cc=uc||lc;ac.protocol=3;var pc=ac.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},dc=Rl(pc),hc={type:"error",data:"parser error"};function fc(e,t,r){for(var n=new Array(e.length),i=zl(e.length,r),o=function(e,r,i){t(r,function(t,r){n[e]=r,i(t,n)})},s=0;s1?{type:dc[n],data:e.substring(1)}:{type:dc[n]}:hc}n=new Uint8Array(e)[0];var i=Il(e,1);return Ql&&"blob"===t&&(i=new Ql([i])),{type:dc[n],data:i}},ac.decodeBase64Packet=function(e,t){var r=dc[e.charAt(0)];if(!sc)return{type:r,data:{base64:!0,data:e.substr(1)}};var n=sc.decode(e.substr(1));return"blob"===t&&Ql&&(n=new Ql([n])),{type:r,data:n}},ac.encodePayload=function(e,t,r){"function"==typeof t&&(r=t,t=null);var n=Bl(e);return t&&n?Ql&&!cc?ac.encodePayloadAsBlob(e,r):ac.encodePayloadAsArrayBuffer(e,r):e.length?void fc(e,function(e,r){ac.encodePacket(e,!!n&&t,!1,function(e){r(null,function(e){return e.length+":"+e}(e))})},function(e,t){return r(t.join(""))}):r("0:")},ac.decodePayload=function(e,t,r){if("string"!=typeof e)return ac.decodePayloadAsBinary(e,t,r);var n;if("function"==typeof t&&(r=t,t=null),""===e)return r(hc,0,1);for(var i,o,s="",a=0,u=e.length;a0;){for(var o=new Uint8Array(n),s=0===o[0],a="",u=1;255!==o[u];u++){if(a.length>310)return r(hc,0,1);a+=o[u]}n=Il(n,2+a.length),a=parseInt(a);var l=Il(n,0,a);if(s)try{l=String.fromCharCode.apply(null,new Uint8Array(l))}catch(Dd){var c=new Uint8Array(l);for(l="",u=0;u0);return t}function Ac(){var e=Fc(+new Date);return e!==mc?(Pc=0,mc=e):e+"."+Fc(Pc++)}for(;Ec';o=document.createElement(e)}catch(Dd){(o=document.createElement("iframe")).name=i.iframeId,o.src="javascript:0"}o.id=i.iframeId,i.form.appendChild(o),i.iframe=o}this.form.action=this.uri(),c(),e=e.replace(n,"\\\n"),this.area.value=e.replace(r,"\\n");try{this.form.submit()}catch(Dd){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===i.iframe.readyState&&l()}:this.iframe.onload=l}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var zc={};(function(e){var t,r,n=Al("engine.io-client:websocket");if("undefined"!=typeof WebSocket)t=WebSocket;else if("undefined"!=typeof self)t=self.WebSocket||self.MozWebSocket;else try{r=o({})}catch(Dd){}var i=t||r;function s(e){e&&e.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=t&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(i=r),yc.call(this,e)}zc=s,wc(s,yc),s.prototype.name="websocket",s.prototype.supportsBinary=!0,s.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,r={agent:this.agent,perMessageDeflate:this.perMessageDeflate};r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(r.headers=this.extraHeaders),this.localAddress&&(r.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?t?new i(e,t):new i(e):new i(e,t,r)}catch(hc){return this.emit("error",hc)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},s.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},s.prototype.write=function(t){var r=this;this.writable=!1;for(var i=t.length,o=0,s=i;o0&&(this.extraHeaders=t.extraHeaders),t.localAddress&&(this.localAddress=t.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}Hc=Wc,Wc.priorWebsocketSuccess=!1,Sl(Wc.prototype),Wc.protocol=ac.protocol,Wc.Socket=Wc,Wc.Transport=yc,Wc.transports=qc,Wc.parser=ac,Wc.prototype.createTransport=function(e){Vc('creating transport "%s"',e);var t=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}(this.query);t.EIO=ac.protocol,t.transport=e;var r=this.transportOptions[e]||{};return this.id&&(t.sid=this.id),new qc[e]({query:t,socket:this,agent:r.agent||this.agent,hostname:r.hostname||this.hostname,port:r.port||this.port,secure:r.secure||this.secure,path:r.path||this.path,forceJSONP:r.forceJSONP||this.forceJSONP,jsonp:r.jsonp||this.jsonp,forceBase64:r.forceBase64||this.forceBase64,enablesXDR:r.enablesXDR||this.enablesXDR,timestampRequests:r.timestampRequests||this.timestampRequests,timestampParam:r.timestampParam||this.timestampParam,policyPort:r.policyPort||this.policyPort,pfx:r.pfx||this.pfx,key:r.key||this.key,passphrase:r.passphrase||this.passphrase,cert:r.cert||this.cert,ca:r.ca||this.ca,ciphers:r.ciphers||this.ciphers,rejectUnauthorized:r.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:r.perMessageDeflate||this.perMessageDeflate,extraHeaders:r.extraHeaders||this.extraHeaders,forceNode:r.forceNode||this.forceNode,localAddress:r.localAddress||this.localAddress,requestTimeout:r.requestTimeout||this.requestTimeout,protocols:r.protocols||void 0,isReactNative:this.isReactNative})},Wc.prototype.open=function(){var e;if(this.rememberUpgrade&&Wc.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length){var t=this;return void setTimeout(function(){t.emit("error","No transports available")},0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(Dd){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},Wc.prototype.setTransport=function(e){Vc("setting transport %s",e.name);var t=this;this.transport&&(Vc("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",function(){t.onDrain()}).on("packet",function(e){t.onPacket(e)}).on("error",function(e){t.onError(e)}).on("close",function(){t.onClose("transport close")})},Wc.prototype.probe=function(e){Vc('probing transport "%s"',e);var t=this.createTransport(e,{probe:1}),r=!1,n=this;function i(){if(n.onlyBinaryUpgrades){var i=!this.supportsBinary&&n.transport.supportsBinary;r=r||i}r||(Vc('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",function(i){if(!r)if("pong"===i.type&&"probe"===i.data){if(Vc('probe transport "%s" pong',e),n.upgrading=!0,n.emit("upgrading",t),!t)return;Wc.priorWebsocketSuccess="websocket"===t.name,Vc('pausing current transport "%s"',n.transport.name),n.transport.pause(function(){r||"closed"!==n.readyState&&(Vc("changing transport and sending upgrade packet"),c(),n.setTransport(t),t.send([{type:"upgrade"}]),n.emit("upgrade",t),t=null,n.upgrading=!1,n.flush())})}else{Vc('probe transport "%s" failed',e);var o=new Error("probe error");o.transport=t.name,n.emit("upgradeError",o)}}))}function o(){r||(r=!0,c(),t.close(),t=null)}function s(r){var i=new Error("probe error: "+r);i.transport=t.name,o(),Vc('probe transport "%s" failed because of error: %s',e,r),n.emit("upgradeError",i)}function a(){s("transport closed")}function u(){s("socket closed")}function l(e){t&&e.name!==t.name&&(Vc('"%s" works - aborting "%s"',e.name,t.name),o())}function c(){t.removeListener("open",i),t.removeListener("error",s),t.removeListener("close",a),n.removeListener("close",u),n.removeListener("upgrading",l)}Wc.priorWebsocketSuccess=!1,t.once("open",i),t.once("error",s),t.once("close",a),this.once("close",u),this.once("upgrading",l),t.open()},Wc.prototype.onOpen=function(){if(Vc("socket open"),this.readyState="open",Wc.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){Vc("starting upgrade probes");for(var e=0,t=this.upgrades.length;e0&&e.jitter<=1?e.jitter:0,this.attempts=0}ip=op,op.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-r:e+r}return 0|Math.min(e,this.max)},op.prototype.reset=function(){this.attempts=0},op.prototype.setMin=function(e){this.ms=e},op.prototype.setMax=function(e){this.max=e},op.prototype.setJitter=function(e){this.jitter=e};var sp={},ap=Ju("socket.io-client:manager"),up=Object.prototype.hasOwnProperty;function lp(e,t){if(!(this instanceof lp))return new lp(e,t);e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new ip({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var r=t.parser||fl;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this.autoConnect=!1!==t.autoConnect,this.autoConnect&&this.open()}sp=lp,lp.prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)up.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},lp.prototype.updateSocketIds=function(){for(var e in this.nsps)up.call(this.nsps,e)&&(this.nsps[e].id=this.generateId(e))},lp.prototype.generateId=function(e){return("/"===e?"":e+"#")+this.engine.id},Xc(lp.prototype),lp.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},lp.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},lp.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},lp.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},lp.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},lp.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},lp.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},lp.prototype.open=lp.prototype.connect=function(e,t){if(ap("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;ap("opening %s",this.uri),this.engine=Gc(this.uri,this.opts);var r=this.engine,n=this;this.readyState="opening",this.skipReconnect=!1;var i=Yc(r,"open",function(){n.onopen(),e&&e()}),o=Yc(r,"error",function(t){if(ap("connect_error"),n.cleanup(),n.readyState="closed",n.emitAll("connect_error",t),e){var r=new Error("Connection error");r.data=t,e(r)}else n.maybeReconnectOnOpen()});if(!1!==this._timeout){var s=this._timeout;ap("connect attempt will timeout after %d",s);var a=setTimeout(function(){ap("connect attempt timed out after %d",s),i.destroy(),r.close(),r.emit("error","timeout"),n.emitAll("connect_timeout",s)},s);this.subs.push({destroy:function(){clearTimeout(a)}})}return this.subs.push(i),this.subs.push(o),this},lp.prototype.onopen=function(){ap("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(Yc(e,"data",Qc(this,"ondata"))),this.subs.push(Yc(e,"ping",Qc(this,"onping"))),this.subs.push(Yc(e,"pong",Qc(this,"onpong"))),this.subs.push(Yc(e,"error",Qc(this,"onerror"))),this.subs.push(Yc(e,"close",Qc(this,"onclose"))),this.subs.push(Yc(this.decoder,"decoded",Qc(this,"ondecoded")))},lp.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},lp.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},lp.prototype.ondata=function(e){this.decoder.add(e)},lp.prototype.ondecoded=function(e){this.emit("packet",e)},lp.prototype.onerror=function(e){ap("error",e),this.emitAll("error",e)},lp.prototype.socket=function(e,t){var r=this.nsps[e];if(!r){r=new Zc(this,e,t),this.nsps[e]=r;var n=this;r.on("connecting",i),r.on("connect",function(){r.id=n.generateId(e)}),this.autoConnect&&i()}function i(){~Ul(n.connecting,r)||n.connecting.push(r)}return r},lp.prototype.destroy=function(e){var t=Ul(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},lp.prototype.packet=function(e){ap("writing packet %j",e);var t=this;e.query&&0===e.type&&(e.nsp+="?"+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,function(r){for(var n=0;n0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},lp.prototype.cleanup=function(){ap("cleanup");for(var e=this.subs.length,t=0;t=this._reconnectionAttempts)ap("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();ap("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var r=setTimeout(function(){e.skipReconnect||(ap("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open(function(t){t?(ap("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(ap("reconnect success"),e.onreconnect())}))},t);this.subs.push({destroy:function(){clearTimeout(r)}})}},lp.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)};var cp={exports:{}};function pp(e){if(e)return function(e){for(var t in pp.prototype)e[t]=pp.prototype[t];return e}(e)}cp.exports=pp,pp.prototype.on=pp.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},pp.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},pp.prototype.off=pp.prototype.removeListener=pp.prototype.removeAllListeners=pp.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i=fp.indexOf(t)}var gp=function(e){var t,r;function n(t){var r;return(r=e.call(this)||this).status=t,r.socket=null,r.pollInterval=null,r.closed=!1,r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var o=n.prototype;return o.connect=function(){this._connectSocket(),this._beginPolling()},o._onFinished=function(){this.emit("finished"),this.close()},o._connectSocket=function(){var e=this,t=function(e){var t=/^\w+:\/\//.exec(e),r=0;t&&(r=t[0].length+1);var n=e.indexOf("/",r);return-1===n?{origin:e,pathname:"/"}:{origin:e.slice(0,n),pathname:e.slice(n)}}(this.status.websocket_url),r=(hp||(hp=i({})),hp).connect(t.origin,{transports:["websocket"],path:t.pathname});r.on("connect",function(){r.emit("assembly_connect",{id:e.status.assembly_id}),e.emit("connect")}),r.on("connect_failed",function(){e._onError(new Ae("Transloadit Socket.io connection error")),e.socket=null}),r.on("error",function(){r.disconnect(),e.socket=null}),r.on("assembly_finished",function(){e._onFinished()}),r.on("assembly_upload_finished",function(t){e.emit("upload",t),e.status.uploads.push(t)}),r.on("assembly_uploading_finished",function(){e.emit("executing")}),r.on("assembly_upload_meta_data_extracted",function(){e.emit("metadata"),e._fetchStatus({diff:!1})}),r.on("assembly_result_finished",function(t,r){e.emit("result",t,r),e.status.results[t]||(e.status.results[t]=[]),e.status.results[t].push(r)}),r.on("assembly_error",function(t){e._onError(t),e._fetchStatus({diff:!1})}),this.socket=r},o._onError=function(e){this.emit("error",dp(new Error(e.message),e))},o._beginPolling=function(){var e=this;this.pollInterval=setInterval(function(){e.socket&&e.socket.connected||e._fetchStatus()},2e3)},o._fetchStatus=function(e){var t=this,r=(void 0===e?{}:e).diff,n=void 0===r||r;return Oe(this.status.assembly_ssl_url).then(function(e){return e.json()}).then(function(e){t.closed||(t.emit("status",e),n?t.updateStatus(e):t.status=e)}).catch(function(e){return t._onError(e)})},o.update=function(){return this._fetchStatus({diff:!0})},o.updateStatus=function(e){this._diffStatus(this.status,e),this.status=e},o._diffStatus=function(e,t){var r=this,n=e.ok,i=t.ok;if(t.error&&!e.error)return this._onError(t);var o=yp(i,"ASSEMBLY_EXECUTING")&&!yp(n,"ASSEMBLY_EXECUTING");o&&this.emit("executing"),Object.keys(t.uploads).filter(function(t){return!k(e.uploads,t)}).map(function(e){return t.uploads[e]}).forEach(function(e){r.emit("upload",e)}),o&&this.emit("metadata"),Object.keys(t.results).forEach(function(n){var i=t.results[n],o=e.results[n];i.filter(function(e){return!o||!o.some(function(t){return t.id===e.id})}).forEach(function(e){r.emit("result",n,e)})}),yp(i,"ASSEMBLY_COMPLETED")&&!yp(n,"ASSEMBLY_COMPLETED")&&this.emit("finished")},o.close=function(){this.closed=!0,this.socket&&(this.socket.disconnect(),this.socket=null),clearInterval(this.pollInterval)},n}(cp),vp=function(){function e(e){void 0===e&&(e={}),this.opts=e,this._reportError=this._reportError.bind(this),this._headers={"Transloadit-Client":this.opts.client}}var t=e.prototype;return t.createAssembly=function(e){var t=this,r=(e.templateId,e.params),n=e.fields,i=e.signature,o=e.expectedFiles,s=new FormData;s.append("params","string"==typeof r?r:JSON.stringify(r)),i&&s.append("signature",i),Object.keys(n).forEach(function(e){s.append(e,n[e])}),s.append("num_expected_upload_files",o);var a=this.opts.service+"/assemblies";return Oe(a,{method:"post",headers:this._headers,body:s}).then(function(e){return e.json()}).then(function(e){if(e.error){var t=new Error(e.error);throw t.details=e.message,t.assembly=e,e.assembly_id&&(t.details+=" Assembly ID: "+e.assembly_id),t}return e}).catch(function(e){return t._reportError(e,{url:a,type:"API_ERROR"})})},t.reserveFile=function(e,t){var r=this,n=encodeURIComponent(t.size),i=e.assembly_ssl_url+"/reserve_file?size="+n;return Oe(i,{method:"post",headers:this._headers}).then(function(e){return e.json()}).catch(function(n){return r._reportError(n,{assembly:e,file:t,url:i,type:"API_ERROR"})})},t.addFile=function(e,t){var r=this;if(!t.uploadURL)return Promise.reject(new Error("File does not have an `uploadURL`."));var n=encodeURIComponent(t.size),i=encodeURIComponent(t.uploadURL),o="size="+n+"&filename="+encodeURIComponent(t.name)+"&fieldname=file&s3Url="+i,s=e.assembly_ssl_url+"/add_file?"+o;return Oe(s,{method:"post",headers:this._headers}).then(function(e){return e.json()}).catch(function(n){return r._reportError(n,{assembly:e,file:t,url:s,type:"API_ERROR"})})},t.cancelAssembly=function(e){var t=this,r=e.assembly_ssl_url;return Oe(r,{method:"delete",headers:this._headers}).then(function(e){return e.json()}).catch(function(e){return t._reportError(e,{url:r,type:"API_ERROR"})})},t.getAssemblyStatus=function(e){var t=this;return Oe(e,{headers:this._headers}).then(function(e){return e.json()}).catch(function(r){return t._reportError(r,{url:e,type:"STATUS_ERROR"})})},t.submitError=function(e,t){var r=t.endpoint,n=t.instance,i=t.assembly,o=e.details?e.message+" ("+e.details+")":e.message;return Oe("https://status.transloadit.com/client_error",{method:"post",body:JSON.stringify({endpoint:r,instance:n,assembly_id:i,agent:"undefined"!=typeof navigator?navigator.userAgent:"",client:this.opts.client,error:o})}).then(function(e){return e.json()})},t._reportError=function(e,t){if(!1===this.opts.errorReporting)throw e;var r={type:t.type};throw t.assembly&&(r.assembly=t.assembly.assembly_id,r.instance=t.assembly.instance),t.url&&(r.endpoint=t.url),this.submitError(e,r).catch(function(e){}),e},e}(),mp={};function bp(e){if(!e)throw new Error("Transloadit: The `params` option is required.");if("string"==typeof e)try{e=JSON.parse(e)}catch(hc){throw hc.message="Transloadit: The `params` option is a malformed JSON string: "+hc.message,hc}if(!e.auth||!e.auth.key)throw new Error("Transloadit: The `params.auth.key` option is required. You can find your Transloadit API key at https://transloadit.com/account/api-settings.")}var wp=function(){function e(e,t){this.files=e,this.opts=t}var t=e.prototype;return t._normalizeAssemblyOptions=function(e,t){if(Array.isArray(t.fields)){var r=t.fields;t.fields={},r.forEach(function(r){t.fields[r]=e.meta[r]})}return t.fields||(t.fields={}),t},t._getAssemblyOptions=function(e){var t=this,r=this.opts;return Promise.resolve().then(function(){return r.getAssemblyOptions(e,r)}).then(function(r){return t._normalizeAssemblyOptions(e,r)}).then(function(t){return bp(t.params),{fileIDs:[e.id],options:t}})},t._dedupe=function(e){var t=Object.create(null);return e.forEach(function(e){var r,n=e.fileIDs,i=e.options,o=JSON.stringify(i);t[o]?(r=t[o].fileIDs).push.apply(r,n):t[o]={options:i,fileIDs:[].concat(n)}}),Object.keys(t).map(function(e){return t[e]})},t.build=function(){var e=this,t=this.opts;return this.files.length>0?Promise.all(this.files.map(function(t){return e._getAssemblyOptions(t)})).then(function(t){return e._dedupe(t)}):t.alwaysRunAssembly?Promise.resolve(t.getAssemblyOptions(null,t)).then(function(t){return bp(t.params),[{fileIDs:e.files.map(function(e){return e.id}),options:t}]}):Promise.resolve([])},e}();function _p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(mp=wp).validateParams=bp;var Sp,kp,Cp=function(e){var t,r;function n(t,r){var n;return(n=e.call(this)||this)._uppy=t,n._assemblyIDs=r,n._remaining=r.length,n.promise=new Promise(function(e,t){n._resolve=e,n._reject=t}),n._onAssemblyComplete=n._onAssemblyComplete.bind(_p(n)),n._onAssemblyCancel=n._onAssemblyCancel.bind(_p(n)),n._onAssemblyError=n._onAssemblyError.bind(_p(n)),n._onImportError=n._onImportError.bind(_p(n)),n._addListeners(),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var i=n.prototype;return i._watching=function(e){return-1!==this._assemblyIDs.indexOf(e)},i._onAssemblyComplete=function(e){this._watching(e.assembly_id)&&(this._uppy.log("[Transloadit] AssemblyWatcher: Got Assembly finish "+e.assembly_id),this.emit("assembly-complete",e.assembly_id),this._checkAllComplete())},i._onAssemblyCancel=function(e){this._watching(e.assembly_id)&&this._checkAllComplete()},i._onAssemblyError=function(e,t){this._watching(e.assembly_id)&&(this._uppy.log("[Transloadit] AssemblyWatcher: Got Assembly error "+e.assembly_id),this._uppy.log(t),this.emit("assembly-error",e.assembly_id,t),this._checkAllComplete())},i._onImportError=function(e,t,r){this._watching(e.assembly_id)&&this._onAssemblyError(e,r)},i._checkAllComplete=function(){this._remaining-=1,0===this._remaining&&(this._removeListeners(),this._resolve())},i._removeListeners=function(){this._uppy.off("transloadit:complete",this._onAssemblyComplete),this._uppy.off("transloadit:assembly-cancel",this._onAssemblyCancel),this._uppy.off("transloadit:assembly-error",this._onAssemblyError),this._uppy.off("transloadit:import-error",this._onImportError)},i._addListeners=function(){this._uppy.on("transloadit:complete",this._onAssemblyComplete),this._uppy.on("transloadit:assembly-cancel",this._onAssemblyCancel),this._uppy.on("transloadit:assembly-error",this._onAssemblyError),this._uppy.on("transloadit:import-error",this._onImportError)},n}(cp),Pp={};function Ep(){return(Ep=Object.assign||function(e){for(var t=1;t=200&&e<300}};if(n.opts=Dp({},i,r),n.i18nInit(),n.handleUpload=n.handleUpload.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)),n.opts.__queue instanceof os?n.requests=n.opts.__queue:n.requests=new os(n.opts.limit),n.opts.bundle&&!n.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");return n.uploaderEvents=Object.create(null),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var i=n.prototype;return i.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},i.i18nInit=function(){this.translator=new E([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.setPluginState()},i.getOptions=function(e){var t=this.uppy.getState().xhrUpload,r=Dp({},this.opts,t||{},e.xhrUpload||{},{headers:{}});return Dp(r.headers,this.opts.headers),t&&Dp(r.headers,t.headers),e.xhrUpload&&Dp(r.headers,e.xhrUpload.headers),r},i.addMetadata=function(e,t,r){(Array.isArray(r.metaFields)?r.metaFields:Object.keys(t)).forEach(function(r){e.append(r,t[r])})},i.createFormDataUpload=function(e,t){var r=new FormData;this.addMetadata(r,e.meta,t);var n=Lp(e);return e.name?r.append(t.fieldName,n,e.meta.name):r.append(t.fieldName,n),r},i.createBundledUpload=function(e,t){var r=this,n=new FormData,i=this.uppy.getState().meta;return this.addMetadata(n,i,t),e.forEach(function(e){var t=r.getOptions(e),i=Lp(e);e.name?n.append(t.fieldName,i,e.name):n.append(t.fieldName,i)}),n},i.createBareUpload=function(e,t){return e.data},i.upload=function(e,t,r){var n=this,i=this.getOptions(e);return this.uppy.log("uploading "+t+" of "+r),new Promise(function(t,r){n.uppy.emit("upload-started",e);var o=i.formData?n.createFormDataUpload(e,i):n.createBareUpload(e,i),s=new XMLHttpRequest;n.uploaderEvents[e.id]=new cs(n.uppy);var a=new ps(i.timeout,function(){s.abort(),l.done();var t=new Error(n.i18n("timedOut",{seconds:Math.ceil(i.timeout/1e3)}));n.uppy.emit("upload-error",e,t),r(t)}),u=I();s.upload.addEventListener("loadstart",function(e){n.uppy.log("[XHRUpload] "+u+" started")}),s.upload.addEventListener("progress",function(t){n.uppy.log("[XHRUpload] "+u+" progress: "+t.loaded+" / "+t.total),a.progress(),t.lengthComputable&&n.uppy.emit("upload-progress",e,{uploader:n,bytesUploaded:t.loaded,bytesTotal:t.total})}),s.addEventListener("load",function(o){if(n.uppy.log("[XHRUpload] "+u+" finished"),a.done(),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null),i.validateStatus(o.target.status,s.responseText,s)){var c=i.getResponseData(s.responseText,s),p=c[i.responseUrlFieldName],d={status:o.target.status,body:c,uploadURL:p};return n.uppy.emit("upload-success",e,d),p&&n.uppy.log("Download "+e.name+" from "+p),t(e)}var h=i.getResponseData(s.responseText,s),f=Mp(s,i.getResponseError(s.responseText,s)),y={status:o.target.status,body:h};return n.uppy.emit("upload-error",e,f,y),r(f)}),s.addEventListener("error",function(t){n.uppy.log("[XHRUpload] "+u+" errored"),a.done(),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null);var o=Mp(s,i.getResponseError(s.responseText,s));return n.uppy.emit("upload-error",e,o),r(o)}),s.open(i.method.toUpperCase(),i.endpoint,!0),s.withCredentials=i.withCredentials,""!==i.responseType&&(s.responseType=i.responseType),Object.keys(i.headers).forEach(function(e){s.setRequestHeader(e,i.headers[e])});var l=n.requests.run(function(){return s.send(o),function(){a.done(),s.abort()}});n.onFileRemove(e.id,function(){l.abort(),r(new Error("File removed"))}),n.onCancelAll(e.id,function(){l.abort(),r(new Error("Upload cancelled"))})})},i.uploadRemote=function(e,t,r){var n=this,i=this.getOptions(e);return new Promise(function(t,r){n.uppy.emit("upload-started",e);var o={};(Array.isArray(i.metaFields)?i.metaFields:Object.keys(e.meta)).forEach(function(t){o[t]=e.meta[t]}),new(e.remote.providerOptions.provider?Bp:Ip)(n.uppy,e.remote.providerOptions).post(e.remote.url,Dp({},e.remote.body,{endpoint:i.endpoint,size:e.data.size,fieldname:i.fieldName,metadata:o,httpMethod:i.method,useFormData:i.formData,headers:i.headers})).then(function(o){var s=o.token,a=ls(e.remote.companionUrl),u=new jp({target:a+"/api/"+s,autoOpen:!1});n.uploaderEvents[e.id]=new cs(n.uppy),n.onFileRemove(e.id,function(){u.send("pause",{}),l.abort(),t("upload "+e.id+" was removed")}),n.onCancelAll(e.id,function(){u.send("pause",{}),l.abort(),t("upload "+e.id+" was canceled")}),n.onRetry(e.id,function(){u.send("pause",{}),u.send("resume",{})}),n.onRetryAll(e.id,function(){u.send("pause",{}),u.send("resume",{})}),u.on("progress",function(t){return us(n,t,e)}),u.on("success",function(r){var o=i.getResponseData(r.response.responseText,r.response),s=o[i.responseUrlFieldName],a={status:r.response.status,body:o,uploadURL:s};return n.uppy.emit("upload-success",e,a),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null),t()}),u.on("error",function(t){var o=t.response,s=o?i.getResponseError(o.responseText,o):Dp(new Error(t.error.message),{cause:t.error});n.uppy.emit("upload-error",e,s),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null),r(s)});var l=n.requests.run(function(){return u.open(),e.isPaused&&u.send("pause",{}),function(){return u.close()}})}).catch(function(t){n.uppy.emit("upload-error",e,t),r(t)})})},i.uploadBundle=function(e){var t=this;return new Promise(function(r,n){var i=t.opts.endpoint,o=t.opts.method,s=t.uppy.getState().xhrUpload,a=t.createBundledUpload(e,Dp({},t.opts,s||{})),u=new XMLHttpRequest,l=new ps(t.opts.timeout,function(){u.abort();var e=new Error(t.i18n("timedOut",{seconds:Math.ceil(t.opts.timeout/1e3)}));c(e),n(e)}),c=function(r){e.forEach(function(e){t.uppy.emit("upload-error",e,r)})};u.upload.addEventListener("loadstart",function(e){t.uppy.log("[XHRUpload] started uploading bundle"),l.progress()}),u.upload.addEventListener("progress",function(r){l.progress(),r.lengthComputable&&e.forEach(function(e){t.uppy.emit("upload-progress",e,{uploader:t,bytesUploaded:r.loaded/r.total*e.size,bytesTotal:e.size})})}),u.addEventListener("load",function(i){if(l.done(),t.opts.validateStatus(i.target.status,u.responseText,u)){var o=t.opts.getResponseData(u.responseText,u),s={status:i.target.status,body:o};return e.forEach(function(e){t.uppy.emit("upload-success",e,s)}),r()}var a=t.opts.getResponseError(u.responseText,u)||new Error("Upload error");return a.request=u,c(a),n(a)}),u.addEventListener("error",function(e){l.done();var r=t.opts.getResponseError(u.responseText,u)||new Error("Upload error");return c(r),n(r)}),t.uppy.on("cancel-all",function(){l.done(),u.abort()}),u.open(o.toUpperCase(),i,!0),u.withCredentials=t.opts.withCredentials,""!==t.opts.responseType&&(u.responseType=t.opts.responseType),Object.keys(t.opts.headers).forEach(function(e){u.setRequestHeader(e,t.opts.headers[e])}),u.send(a),e.forEach(function(e){t.uppy.emit("upload-started",e)})})},i.uploadFiles=function(e){var t=this,r=e.map(function(r,n){var i=parseInt(n,10)+1,o=e.length;return r.error?Promise.reject(new Error(r.error)):r.isRemote?t.uploadRemote(r,i,o):t.upload(r,i,o)});return ss(r)},i.onFileRemove=function(e,t){this.uploaderEvents[e].on("file-removed",function(r){e===r.id&&t(r.id)})},i.onRetry=function(e,t){this.uploaderEvents[e].on("upload-retry",function(r){e===r&&t()})},i.onRetryAll=function(e,t){var r=this;this.uploaderEvents[e].on("retry-all",function(n){r.uppy.getFile(e)&&t()})},i.onCancelAll=function(e,t){var r=this;this.uploaderEvents[e].on("cancel-all",function(){r.uppy.getFile(e)&&t()})},i.handleUpload=function(e){var t=this;if(0===e.length)return this.uppy.log("[XHRUpload] No files to upload!"),Promise.resolve();0!==this.opts.limit||this.opts.__queue||this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");var r=e.map(function(e){return t.uppy.getFile(e)});if(this.opts.bundle){if(r.some(function(e){return e.isRemote}))throw new Error("Can\u2019t upload remote files when bundle: true option is set");return this.uploadBundle(r)}return this.uploadFiles(r).then(function(){return null})},i.install=function(){if(this.opts.bundle){var e=this.uppy.getState().capabilities;this.uppy.setState({capabilities:Dp({},e,{individualCancellation:!1})})}this.uppy.addUploader(this.handleUpload)},i.uninstall=function(){if(this.opts.bundle){var e=this.uppy.getState().capabilities;this.uppy.setState({capabilities:Dp({},e,{individualCancellation:!0})})}this.uppy.removeUploader(this.handleUpload)},n}(pe.Plugin),Rp.VERSION="1.6.3",xp),zp={__esModule:!0};zp.default=Kp,zp.getFieldData=$p;var qp={"[object HTMLCollection]":!0,"[object NodeList]":!0,"[object RadioNodeList]":!0},Hp={button:!0,fieldset:!0,reset:!0,submit:!0},Vp={checkbox:!0,radio:!0},Wp=/^\s+|\s+$/g,Gp=Array.prototype.slice,Xp=Object.prototype.toString;function Kp(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{trim:!1};if(!e)throw new Error("A form is required by getFormData, was given form="+e);for(var r={},n=void 0,i=[],o={},s=0,a=e.elements.length;s2&&void 0!==arguments[2]?arguments[2]:{trim:!1};if(!e)throw new Error("A form is required by getFieldData, was given form="+e);if(!t&&"[object String]"!==Xp.call(t))throw new Error("A field name is required by getFieldData, was given fieldName="+t);var n=e.elements[t];if(!n||n.disabled)return null;if(!qp[Xp.call(n)])return Yp(n,r.trim);for(var i=[],o=!0,s=0,a=n.length;s0?i:null}function Yp(e,t){var r=null,n=e.type;if("select-one"===n)return e.options.length&&(r=e.options[e.selectedIndex].value),r;if("select-multiple"===n){r=[];for(var i=0,o=e.options.length;i target element passed in options to operate, none was found","error")},i.uninstall=function(){this.form.removeEventListener("submit",this.handleFormSubmit),this.uppy.off("upload",this.handleUploadStart),this.uppy.off("complete",this.handleSuccess)},n}(td),Jp.VERSION="1.3.19",Qp),id={},od="undefined"!=typeof navigator&&"serviceWorker"in navigator,sd=function(){function e(e){this.ready=new Promise(function(e,t){od?navigator.serviceWorker.controller?e():navigator.serviceWorker.addEventListener("controllerchange",function(){e()}):t(new Error("Unsupported"))}),this.name=e.storeName}var t=e.prototype;return t.list=function(){var e=this,t={},r=new Promise(function(e,r){t.resolve=e,t.reject=r});console.log("Loading stored blobs from Service Worker");var n=function r(n){if(n.data.store===e.name)switch(n.data.type){case"uppy/ALL_FILES":t.resolve(n.data.files),navigator.serviceWorker.removeEventListener("message",r)}};return this.ready.then(function(){navigator.serviceWorker.addEventListener("message",n),navigator.serviceWorker.controller.postMessage({type:"uppy/GET_FILES",store:e.name})}),r},t.put=function(e){var t=this;return this.ready.then(function(){navigator.serviceWorker.controller.postMessage({type:"uppy/ADD_FILE",store:t.name,file:e})})},t.delete=function(e){var t=this;return this.ready.then(function(){navigator.serviceWorker.controller.postMessage({type:"uppy/REMOVE_FILE",store:t.name,fileID:e})})},e}();sd.isSupported=od,id=sd;var ad={};function ud(){return(ud=Object.assign||function(e){for(var t=1;tthis.opts.maxFileSize?Promise.reject(new Error("File is too big to store.")):this.getSize().then(function(e){return e>t.opts.maxTotalSize?Promise.reject(new Error("No space left")):t.ready}).then(function(r){return gd(r.transaction([dd],"readwrite").objectStore(dd).add({id:t.key(e.id),fileID:e.id,store:t.name,expires:Date.now()+t.opts.expires,data:e.data}))})},t.delete=function(e){var t=this;return this.ready.then(function(r){return gd(r.transaction([dd],"readwrite").objectStore(dd).delete(t.key(e)))})},e.cleanup=function(){return yd(pd).then(function(e){var t=e.transaction([dd],"readwrite").objectStore(dd).index("expires").openCursor(IDBKeyRange.upperBound(Date.now()));return new Promise(function(r,n){t.onsuccess=function(t){var n=t.target.result;if(n){var i=n.value;console.log("[IndexedDBStore] Deleting record",i.fileID,"of size",function(e){if("number"!=typeof e||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/Math.pow(1024,n));var i=r[n];return e>=10||e%1==0?(t?"-":"")+e.toFixed(0)+" "+i:(t?"-":"")+e.toFixed(1)+" "+i}(i.data.size),"- expired on",new Date(i.expires)),n.delete(),n.continue()}else r(e)},t.onerror=n})}).then(function(e){e.close()})},e}();function bd(){return(bd=Object.assign||function(e){for(var t=1;t0)return e.uppy.log("[GoldenRetriever] Successfully recovered "+r+" blobs from IndexedDB!"),e.uppy.info("Successfully recovered "+r+" files","success",3e3),e.onBlobsLoaded(t);e.uppy.log("[GoldenRetriever] No blobs found in IndexedDB")}).catch(function(t){e.uppy.log("[GoldenRetriever] Failed to recover blobs from IndexedDB","warning"),e.uppy.log(t)})},i.onBlobsLoaded=function(e){var t=this,r=[],n=Pd({},this.uppy.getState().files);Object.keys(e).forEach(function(i){var o=t.uppy.getFile(i);if(o){var s=Pd({},o,{data:e[i],isRestored:!0});n[i]=s}else r.push(i)}),this.uppy.setState({files:n}),this.uppy.emit("restored",this.savedPluginData),r.length&&this.deleteBlobs(r).then(function(){t.uppy.log("[GoldenRetriever] Cleaned up "+r.length+" old files")}).catch(function(e){t.uppy.log("[GoldenRetriever] Could not clean up "+r.length+" old files","warning"),t.uppy.log(e)})},i.deleteBlobs=function(e){var t=this,r=[];return e.forEach(function(e){t.ServiceWorkerStore&&r.push(t.ServiceWorkerStore.delete(e)),t.IndexedDBStore&&r.push(t.IndexedDBStore.delete(e))}),Promise.all(r)},i.install=function(){var e=this;this.loadFilesStateFromLocalStorage(),this.uppy.getFiles().length>0?this.ServiceWorkerStore?(this.uppy.log("[GoldenRetriever] Attempting to load files from Service Worker..."),this.loadFileBlobsFromServiceWorker()):(this.uppy.log("[GoldenRetriever] Attempting to load files from Indexed DB..."),this.loadFileBlobsFromIndexedDB()):(this.uppy.log("[GoldenRetriever] No files need to be loaded, only restoring processing state..."),this.onBlobsLoaded([])),this.uppy.on("file-added",function(t){t.isRemote||(e.ServiceWorkerStore&&e.ServiceWorkerStore.put(t).catch(function(t){e.uppy.log("[GoldenRetriever] Could not store file","warning"),e.uppy.log(t)}),e.IndexedDBStore.put(t).catch(function(t){e.uppy.log("[GoldenRetriever] Could not store file","warning"),e.uppy.log(t)}))}),this.uppy.on("file-removed",function(t){e.ServiceWorkerStore&&e.ServiceWorkerStore.delete(t.id).catch(function(t){e.uppy.log("[GoldenRetriever] Failed to remove file","warning"),e.uppy.log(t)}),e.IndexedDBStore.delete(t.id).catch(function(t){e.uppy.log("[GoldenRetriever] Failed to remove file","warning"),e.uppy.log(t)})}),this.uppy.on("complete",function(t){var r=t.successful,n=r.map(function(e){return e.id});e.deleteBlobs(n).then(function(){e.uppy.log("[GoldenRetriever] Removed "+r.length+" files that finished uploading")}).catch(function(t){e.uppy.log("[GoldenRetriever] Could not remove "+r.length+" files that finished uploading","warning"),e.uppy.log(t)})}),this.uppy.on("state-update",this.saveFilesStateToLocalStorage),this.uppy.on("restored",function(){var t=e.uppy.getState().currentUploads;t&&Object.keys(t).forEach(function(r){e.uppy.restore(r,t[r])})})},n}(pe.Plugin),_d.VERSION="1.3.18",Sd);function Ud(){return(Ud=Object.assign||function(e){for(var t=1;t maxFileSize) { - String maxSize = FileValidatorUtil.formatSize(maxFileSize); - - // set error message - return false; - } - return true; + return fileSize <= maxFileSize; } public static boolean validateFileSize(Long fileSize, boolean largeFile) { float maxFileSize = largeFile ? Configuration.getAsInt(ConfigurationKeys.UPLOAD_FILE_LARGE_MAX_SIZE) : Configuration.getAsInt(ConfigurationKeys.UPLOAD_FILE_MAX_SIZE); - if (fileSize > maxFileSize) { - String maxSize = FileValidatorUtil.formatSize(maxFileSize); - - return false; - } - return true; + return fileSize <= maxFileSize; } public static String formatSize(double size) { Index: lams_common/src/java/org/lamsfoundation/lams/util/UploadFileUtil.java =================================================================== diff -u -rc4e287d7ad3270750700d819ec360d0648ed2e5e -r49b072598933566cedd795667351678071f03004 --- lams_common/src/java/org/lamsfoundation/lams/util/UploadFileUtil.java (.../UploadFileUtil.java) (revision c4e287d7ad3270750700d819ec360d0648ed2e5e) +++ lams_common/src/java/org/lamsfoundation/lams/util/UploadFileUtil.java (.../UploadFileUtil.java) (revision 49b072598933566cedd795667351678071f03004) @@ -25,8 +25,6 @@ import java.io.File; -import org.apache.log4j.Logger; - /** * Wraps up interface to the Commons FileUpload as much as possible. Reads configuration information such the maximum * size of a file from lams.xml using the ConfigurationService. @@ -35,15 +33,8 @@ * */ public class UploadFileUtil { - private static Logger log = Logger.getLogger(UploadFileUtil.class); - private static final int DEFAULT_MAX_SIZE = 5000000; // 5 Meg - private static final int DEFAULT_MEMORY_SIZE = 4096; - static { - - } - /** * @return Maximum size (in megabytes) that a file may be. Standard size, use during running of sequence. */ @@ -140,9 +131,9 @@ String trimmedFolder = contentFolderID.replace("-", "").replace("/", ""); //if trimmedFolder length is less than 12, supplement it with missing character if (trimmedFolder.length() < 12) { - trimmedFolder += "123456789012".substring(0, 12-trimmedFolder.length()); + trimmedFolder += "123456789012".substring(0, 12 - trimmedFolder.length()); } - + for (int groupIndex = 0; groupIndex < 6; groupIndex++) { result[groupIndex] = "" + trimmedFolder.charAt(groupIndex * 2) + trimmedFolder.charAt(groupIndex * 2 + 1); } Index: lams_tool_images/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r4409f4bd1640395d7eacbf1681be39628304d815 -r49b072598933566cedd795667351678071f03004 --- lams_tool_images/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 4409f4bd1640395d7eacbf1681be39628304d815) +++ lams_tool_images/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 49b072598933566cedd795667351678071f03004) @@ -12,9 +12,8 @@ label.authoring.basic.title = Title label.authoring.basic.add.image = Add image label.authoring.basic.add.images = Add images -label.authoring.basic.add.multiple.images = Add multiple images -label.authoring.basic.upload.multiple.images = Upload multiple images label.authoring.basic.upload.single.image = Upload single image +label.authoring.basic.replace.image = If you want to replace the image, upload a new one below. label.authoring.basic.image.list = Images label.authoring.basic.resource.edit = Edit label.authoring.basic.resource.delete = Delete Index: lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/service/IImageGalleryService.java =================================================================== diff -u -r3bb7e0141ae1cc15ccd737c95d90b5762a34ad61 -r49b072598933566cedd795667351678071f03004 --- lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/service/IImageGalleryService.java (.../IImageGalleryService.java) (revision 3bb7e0141ae1cc15ccd737c95d90b5762a34ad61) +++ lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/service/IImageGalleryService.java (.../IImageGalleryService.java) (revision 49b072598933566cedd795667351678071f03004) @@ -23,6 +23,7 @@ package org.lamsfoundation.lams.tool.imageGallery.service; +import java.io.File; import java.util.List; import java.util.Map; import java.util.Set; @@ -40,7 +41,6 @@ import org.lamsfoundation.lams.tool.imageGallery.model.ImageGalleryUser; import org.lamsfoundation.lams.tool.imageGallery.model.ImageVote; import org.lamsfoundation.lams.tool.service.ICommonToolService; -import org.springframework.web.multipart.MultipartFile; /** * Interface that defines the contract that all ShareImageGallery service provider must follow. @@ -74,7 +74,7 @@ * @param file * @throws UploadImageGalleryFileException */ - void uploadImageGalleryItemFile(ImageGalleryItem item, MultipartFile file) throws UploadImageGalleryFileException; + void uploadImageGalleryItemFile(ImageGalleryItem item, File file) throws UploadImageGalleryFileException; // ********** for user methods ************* /** Index: lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/service/ImageGalleryServiceImpl.java =================================================================== diff -u -rcfe1a8cfc78f98f1f0beda760599f08b4fa0b61f -r49b072598933566cedd795667351678071f03004 --- lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/service/ImageGalleryServiceImpl.java (.../ImageGalleryServiceImpl.java) (revision cfe1a8cfc78f98f1f0beda760599f08b4fa0b61f) +++ lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/service/ImageGalleryServiceImpl.java (.../ImageGalleryServiceImpl.java) (revision 49b072598933566cedd795667351678071f03004) @@ -24,6 +24,8 @@ package org.lamsfoundation.lams.tool.imageGallery.service; import java.awt.image.BufferedImage; +import java.io.File; +import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; @@ -97,7 +99,6 @@ import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.util.imgscalr.ResizePictureUtil; -import org.springframework.web.multipart.MultipartFile; /** * @author Andrey Balan @@ -538,8 +539,7 @@ } @Override - public void uploadImageGalleryItemFile(ImageGalleryItem image, MultipartFile file) - throws UploadImageGalleryFileException { + public void uploadImageGalleryItemFile(ImageGalleryItem image, File file) throws UploadImageGalleryFileException { ImageGalleryConfigItem mediumImageDimensionsKey = getConfigItem( ImageGalleryConfigItem.KEY_MEDIUM_IMAGE_DIMENSIONS); @@ -552,9 +552,9 @@ try { // upload file NodeKey nodeKey = uploadMultipartFile(file); - image.setFileName(file.getOriginalFilename()); + image.setFileName(file.getName()); image.setOriginalFileUuid(nodeKey.getUuid()); - String fileName = file.getOriginalFilename(); + String fileName = file.getName(); InputStream originalIS = imageGalleryToolContentHandler.getFileInputStream(nodeKey.getUuid()); BufferedImage originalImage = ImageIO.read(originalIS); @@ -612,16 +612,15 @@ * @throws RepositoryCheckedException * @throws InvalidParameterException */ - private NodeKey uploadMultipartFile(MultipartFile file) throws UploadImageGalleryFileException { - if ((file == null) || StringUtils.isEmpty(file.getOriginalFilename())) { + private NodeKey uploadMultipartFile(File file) throws UploadImageGalleryFileException { + if ((file == null) || StringUtils.isEmpty(file.getName())) { throw new UploadImageGalleryFileException( messageService.getMessage("error.msg.upload.file.not.found", new Object[] { file })); } NodeKey node = null; try { - node = imageGalleryToolContentHandler.uploadFile(file.getInputStream(), file.getOriginalFilename(), - file.getContentType()); + node = imageGalleryToolContentHandler.uploadFile(new FileInputStream(file), file.getName(), null); } catch (InvalidParameterException e) { throw new UploadImageGalleryFileException(messageService.getMessage("error.msg.invaid.param.upload")); } catch (FileNotFoundException e) { Fisheye: Tag 49b072598933566cedd795667351678071f03004 refers to a dead (removed) revision in file `lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/util/ImageGalleryUtils.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/web/controller/AuthoringController.java =================================================================== diff -u -r7b3ea39ddf6e10186cf9916562121c205bb0e5ad -r49b072598933566cedd795667351678071f03004 --- lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/web/controller/AuthoringController.java (.../AuthoringController.java) (revision 7b3ea39ddf6e10186cf9916562121c205bb0e5ad) +++ lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/web/controller/AuthoringController.java (.../AuthoringController.java) (revision 49b072598933566cedd795667351678071f03004) @@ -23,6 +23,7 @@ package org.lamsfoundation.lams.tool.imageGallery.web.controller; +import java.io.File; import java.lang.reflect.InvocationTargetException; import java.sql.Timestamp; import java.util.ArrayList; @@ -50,14 +51,13 @@ import org.lamsfoundation.lams.tool.imageGallery.model.ImageGalleryItem; import org.lamsfoundation.lams.tool.imageGallery.model.ImageGalleryUser; import org.lamsfoundation.lams.tool.imageGallery.service.IImageGalleryService; -import org.lamsfoundation.lams.tool.imageGallery.service.UploadImageGalleryFileException; import org.lamsfoundation.lams.tool.imageGallery.util.ImageGalleryItemComparator; -import org.lamsfoundation.lams.tool.imageGallery.util.ImageGalleryUtils; import org.lamsfoundation.lams.tool.imageGallery.web.form.ImageGalleryForm; import org.lamsfoundation.lams.tool.imageGallery.web.form.ImageGalleryItemForm; import org.lamsfoundation.lams.tool.imageGallery.web.form.MultipleImagesForm; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.util.CommonConstants; +import org.lamsfoundation.lams.util.FileUtil; import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.session.SessionManager; @@ -66,11 +66,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Controller; +import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.multipart.MultipartFile; /** * @author Andrey Balan @@ -296,7 +296,7 @@ } } imageGalleryPO.setImageGalleryItems(itemList); - // delete instructino file from database. + // delete instructions file from database. List delImageGalleryItemList = getDeletedImageGalleryItemList(sessionMap); iter = delImageGalleryItemList.iterator(); while (iter.hasNext()) { @@ -349,12 +349,15 @@ boolean saveUsingLearningAction = WebUtil.readBooleanParam(request, "saveUsingLearningAction", false); request.setAttribute("saveUsingLearningAction", saveUsingLearningAction); + imageGalleryItemForm.setTmpFileUploadId(FileUtil.generateTmpFileUploadId()); + return "pages/authoring/parts/addimage"; } /** * Display edit page for existed imageGallery item. */ + @SuppressWarnings("unchecked") @RequestMapping("/editImage") public String editImage(@ModelAttribute ImageGalleryItemForm imageGalleryItemForm, HttpServletRequest request) { @@ -363,7 +366,7 @@ SessionMap sessionMap = (SessionMap) request.getSession() .getAttribute(sessionMapID); - int itemIdx = NumberUtils.stringToInt(request.getParameter(ImageGalleryConstants.PARAM_IMAGE_INDEX), -1); + int itemIdx = NumberUtils.toInt(request.getParameter(ImageGalleryConstants.PARAM_IMAGE_INDEX), -1); ImageGalleryItem item = null; if (itemIdx != -1) { SortedSet imageGalleryList = getImageList(sessionMap); @@ -373,6 +376,9 @@ populateItemToForm(itemIdx, item, imageGalleryItemForm, request); } } + + imageGalleryItemForm.setTmpFileUploadId(FileUtil.generateTmpFileUploadId()); + return (item == null) ? null : "pages/authoring/parts/addimage"; } @@ -398,13 +404,10 @@ public String saveOrUpdateImage(@ModelAttribute ImageGalleryItemForm imageGalleryItemForm, HttpServletRequest request, HttpServletResponse response) { - MultiValueMap errorMap = ImageGalleryUtils.validateImageGalleryItem(imageGalleryItemForm, true, - messageService); + MultiValueMap errorMap = new LinkedMultiValueMap<>(); try { - if (errorMap.isEmpty()) { - extractFormToImageGalleryItem(request, imageGalleryItemForm); - } + extractFormToImageGalleryItems(request, imageGalleryItemForm); } catch (Exception e) { // any upload exception will display as normal error message rather then throw exception directly errorMap.add("GLOBAL", messageService.getMessage(ImageGalleryConstants.ERROR_MSG_UPLOAD_FAILED, @@ -484,40 +487,6 @@ } /** - * This method will get necessary information from imageGallery item form and save or update into - * HttpSession ImageGalleryItemList. Notice, this save is not persist them into database, just save - * HttpSession temporarily. Only they will be persist when the entire authoring page is being - * persisted. - */ - @RequestMapping("/saveMultipleImages") - public String saveMultipleImages(@ModelAttribute MultipleImagesForm multipleImagesForm, HttpServletRequest request, - HttpServletResponse response) { - - MultiValueMap errorMap = ImageGalleryUtils.validateMultipleImages(multipleImagesForm, true, - messageService); - - try { - if (errorMap.isEmpty()) { - extractMultipleFormToImageGalleryItems(request, multipleImagesForm); - } - } catch (Exception e) { - // any upload exception will display as normal error message rather then throw exception directly - errorMap.add("GLOBAL", messageService.getMessage(ImageGalleryConstants.ERROR_MSG_UPLOAD_FAILED, - new Object[] { e.getMessage() })); - } - - if (!errorMap.isEmpty()) { - request.setAttribute("errorMap", errorMap); - return "pages/authoring/parts/addmultipleimages"; - } - - // set session map ID so that itemlist.jsp can get sessionMAP - request.setAttribute(ImageGalleryConstants.ATTR_SESSION_MAP_ID, multipleImagesForm.getSessionMapID()); - // return null to close this window - return "pages/authoring/parts/itemlist"; - } - - /** * Remove imageGallery item from HttpSession list and update page display. As authoring rule, all persist only * happen when user submit whole page. So this remove is just impact HttpSession values. */ @@ -598,7 +567,7 @@ form.setDescription(item.getDescription()); form.setTitle(item.getTitle()); if (itemIdx >= 0) { - form.setImageIndex(new Integer(itemIdx).toString()); + form.setImageIndex(String.valueOf(itemIdx)); } if (item.getOriginalFileUuid() != null) { @@ -613,7 +582,8 @@ /** * Extract web form content to imageGallery item. */ - private void extractFormToImageGalleryItem(HttpServletRequest request, ImageGalleryItemForm imageForm) + @SuppressWarnings("unchecked") + private void extractFormToImageGalleryItems(HttpServletRequest request, ImageGalleryItemForm imageForm) throws Exception { /* * BE CAREFUL: This method will copy necessary info from request form to an old or new ImageGalleryItem @@ -624,110 +594,88 @@ SessionMap sessionMap = (SessionMap) request.getSession() .getAttribute(imageForm.getSessionMapID()); - // check whether it is "edit(old item)" or "add(new item)" + SortedSet imageList = getImageList(sessionMap); - int imageIdx = NumberUtils.stringToInt(imageForm.getImageIndex(), -1); - ImageGalleryItem image = null; + int imageIdx = NumberUtils.toInt(imageForm.getImageIndex(), -1); + ImageGalleryItem item = null; - if (imageIdx == -1) { // add - image = new ImageGalleryItem(); - image.setCreateDate(new Timestamp(new Date().getTime())); + // check whether it is "edit(old item)" or "add(new item)" + boolean hasOld = imageIdx >= 0; + if (hasOld) { + List rList = new ArrayList<>(imageList); + item = rList.get(imageIdx); + } else { + item = new ImageGalleryItem(); + item.setCreateDate(new Timestamp(new Date().getTime())); int maxSeq = 1; if (imageList != null && imageList.size() > 0) { ImageGalleryItem last = imageList.last(); maxSeq = last.getSequenceId() + 1; } - image.setSequenceId(maxSeq); - imageList.add(image); - } else { // edit - List rList = new ArrayList<>(imageList); - image = rList.get(imageIdx); + item.setSequenceId(maxSeq); } - // uploadImageGalleryItemFile - // and setting file properties' fields: item.setFileUuid(); - // item.setFileName(); - if (imageForm.getFile() != null) { - // if it has old file, and upload a new, then save old to deleteList - ImageGalleryItem delImage = new ImageGalleryItem(); - boolean hasOld = false; - if (image.getOriginalFileUuid() != null) { - hasOld = true; - // be careful, This new ImageGalleryItem object never be save into database - // just temporarily use for saving fileUuid and versionID use: - delImage.setOriginalFileUuid(image.getOriginalFileUuid()); - } - try { - igService.uploadImageGalleryItemFile(image, imageForm.getFile()); - } catch (UploadImageGalleryFileException e) { - // if it is new add , then remove it! - if (imageIdx == -1) { - imageList.remove(image); - } - throw e; - } - // put it after "upload" to ensure deleted file added into list only no exception happens during upload - if (hasOld) { - List delAtt = getDeletedItemAttachmentList(sessionMap); - delAtt.add(delImage); - } - } - String title = imageForm.getTitle(); if (StringUtils.isBlank(title)) { Long nextImageTitleNumber = (Long) sessionMap.get(ImageGalleryConstants.ATTR_NEXT_IMAGE_TITLE); sessionMap.put(ImageGalleryConstants.ATTR_NEXT_IMAGE_TITLE, nextImageTitleNumber + 1); title = igService.generateNextImageTitle(nextImageTitleNumber); } - image.setTitle(title); + item.setTitle(title); - image.setDescription(imageForm.getDescription()); - image.setCreateByAuthor(true); - image.setHide(false); - } + item.setDescription(imageForm.getDescription()); + item.setCreateByAuthor(true); + item.setHide(false); - /** - * Extract web form content to imageGallery items. - */ - private void extractMultipleFormToImageGalleryItems(HttpServletRequest request, MultipleImagesForm multipleForm) - throws Exception { + File uploadDir = FileUtil.getTmpFileUploadDir(imageForm.getTmpFileUploadId()); + if (uploadDir.canRead()) { + File[] files = uploadDir.listFiles(); + if (files.length == 0) { + return; + } - SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(multipleForm.getSessionMapID()); - // check whether it is "edit(old item)" or "add(new item)" - SortedSet imageList = getImageList(sessionMap); + if (hasOld) { + // if we are replacing an image, there can be only 1 upload + if (files.length > 1) { + throw new ServletException("Uploaded more than 1 image while editing an Image Gallery Item"); + } - List fileList = ImageGalleryUtils.createFileListFromMultipleForm(multipleForm); - for (MultipartFile file : fileList) { - ImageGalleryItem image = new ImageGalleryItem(); - image.setCreateDate(new Timestamp(new Date().getTime())); - int maxSeq = 1; - if (imageList != null && imageList.size() > 0) { - ImageGalleryItem last = imageList.last(); - maxSeq = last.getSequenceId() + 1; + // if it has old file, and upload a new, then save old to deleteList + ImageGalleryItem delImage = new ImageGalleryItem(); + // be careful, This new ImageGalleryItem object never be save into database + // just temporarily use for saving fileUuid + delImage.setOriginalFileUuid(item.getOriginalFileUuid()); + List delAtt = getDeletedItemAttachmentList(sessionMap); + delAtt.add(delImage); } - image.setSequenceId(maxSeq); - imageList.add(image); - // uploadImageGalleryItemFile - // and setting file properties' fields: item.setFileUuid(); - // item.setFileName(); - try { - igService.uploadImageGalleryItemFile(image, file); - } catch (UploadImageGalleryFileException e) { - imageList.remove(image); - throw e; - } + int sequenceId = item.getSequenceId(); + for (File file : files) { + // if user uploaded multiple new images, all of them get the same title and description + if (sequenceId > item.getSequenceId()) { + ImageGalleryItem nextItem = new ImageGalleryItem(); + nextItem.setCreateDate(item.getCreateDate()); + nextItem.setSequenceId(sequenceId); - Long nextImageTitleNumber = (Long) sessionMap.get(ImageGalleryConstants.ATTR_NEXT_IMAGE_TITLE); - sessionMap.put(ImageGalleryConstants.ATTR_NEXT_IMAGE_TITLE, nextImageTitleNumber + 1); - String title = igService.generateNextImageTitle(nextImageTitleNumber); - image.setTitle(title); + title = imageForm.getTitle(); + if (StringUtils.isBlank(title)) { + Long nextImageTitleNumber = (Long) sessionMap.get(ImageGalleryConstants.ATTR_NEXT_IMAGE_TITLE); + sessionMap.put(ImageGalleryConstants.ATTR_NEXT_IMAGE_TITLE, nextImageTitleNumber + 1); + title = igService.generateNextImageTitle(nextImageTitleNumber); + } + nextItem.setTitle(title); + nextItem.setDescription(item.getDescription()); + nextItem.setCreateByAuthor(true); + nextItem.setHide(false); + item = nextItem; + } - image.setDescription(""); - image.setCreateByAuthor(true); - image.setHide(false); + igService.uploadImageGalleryItemFile(item, file); + if (!hasOld) { + imageList.add(item); + } + sequenceId++; + } } } - } Index: lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/web/controller/LearningController.java =================================================================== diff -u -r7e1926a1f28d55c8de63720fbc97f918de5cc711 -r49b072598933566cedd795667351678071f03004 --- lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/web/controller/LearningController.java (.../LearningController.java) (revision 7e1926a1f28d55c8de63720fbc97f918de5cc711) +++ lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/web/controller/LearningController.java (.../LearningController.java) (revision 49b072598933566cedd795667351678071f03004) @@ -27,7 +27,6 @@ import java.sql.Timestamp; import java.util.Date; import java.util.Iterator; -import java.util.List; import java.util.Set; import java.util.TreeSet; @@ -52,12 +51,9 @@ import org.lamsfoundation.lams.tool.imageGallery.model.ImageVote; import org.lamsfoundation.lams.tool.imageGallery.service.IImageGalleryService; import org.lamsfoundation.lams.tool.imageGallery.service.ImageGalleryException; -import org.lamsfoundation.lams.tool.imageGallery.service.UploadImageGalleryFileException; import org.lamsfoundation.lams.tool.imageGallery.util.ImageGalleryItemComparator; -import org.lamsfoundation.lams.tool.imageGallery.util.ImageGalleryUtils; import org.lamsfoundation.lams.tool.imageGallery.web.form.ImageGalleryItemForm; import org.lamsfoundation.lams.tool.imageGallery.web.form.ImageRatingForm; -import org.lamsfoundation.lams.tool.imageGallery.web.form.MultipleImagesForm; import org.lamsfoundation.lams.tool.imageGallery.web.form.ReflectionForm; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.util.MessageService; @@ -68,11 +64,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Controller; +import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.multipart.MultipartFile; import org.springframework.web.util.HtmlUtils; /** @@ -256,17 +252,11 @@ SessionMap sessionMap = (SessionMap) request.getSession() .getAttribute(imageGalleryItemForm.getSessionMapID()); - ToolAccessMode mode = (ToolAccessMode) sessionMap.get(AttributeNames.ATTR_MODE); - //validate form - boolean isLargeFilesAllowed = mode.isTeacher(); - MultiValueMap errorMap = ImageGalleryUtils.validateImageGalleryItem(imageGalleryItemForm, - isLargeFilesAllowed, messageService); + MultiValueMap errorMap = new LinkedMultiValueMap<>(); try { - if (errorMap.isEmpty()) { - extractFormToImageGalleryItem(request, imageGalleryItemForm); - } + extractFormToImageGalleryItem(request, imageGalleryItemForm); } catch (Exception e) { // any upload exception will display as normal error message rather then throw exception directly errorMap.add("GLOBAL", messageService.getMessage(ImageGalleryConstants.ERROR_MSG_UPLOAD_FAILED, @@ -291,41 +281,6 @@ /** * Save file or url imageGallery item into database. */ - @RequestMapping("/saveMultipleImages") - public String saveMultipleImages(@ModelAttribute MultipleImagesForm multipleForm, HttpServletRequest request, - HttpServletResponse response) throws IOException { - - SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(multipleForm.getSessionMapID()); - ToolAccessMode mode = (ToolAccessMode) sessionMap.get(AttributeNames.ATTR_MODE); - - //validate form - boolean isLargeFilesAllowed = mode.isTeacher(); - MultiValueMap errorMap = ImageGalleryUtils.validateMultipleImages(multipleForm, - isLargeFilesAllowed, messageService); - - try { - if (errorMap.isEmpty()) { - extractMultipleFormToImageGalleryItems(request, multipleForm); - } - } catch (Exception e) { - // any upload exception will display as normal error message rather then throw exception directly - errorMap.add("GLOBAL", messageService.getMessage(ImageGalleryConstants.ERROR_MSG_UPLOAD_FAILED, - new Object[] { e.getMessage() })); - } - - if (!errorMap.isEmpty()) { - ServletOutputStream outputStream = response.getOutputStream(); -// outputStream.print(errors.get().next().toString()); - response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); - } - - return null; - } - - /** - * Save file or url imageGallery item into database. - */ @RequestMapping("/deleteImage") public String deleteImage(HttpServletRequest request, HttpServletResponse response) { @@ -559,14 +514,14 @@ // upload ImageGalleryItem file // and setting file properties' fields: item.setFileUuid(); // item.setFileName(); - if (imageForm.getFile() != null) { - try { - igService.uploadImageGalleryItemFile(image, imageForm.getFile()); - } catch (UploadImageGalleryFileException e) { - // remove new image! - throw e; - } - } +// if (imageForm.getFile() != null) { +// try { +// igService.uploadImageGalleryItemFile(image, imageForm.getFile()); +// } catch (UploadImageGalleryFileException e) { +// // remove new image! +// throw e; +// } +// } String title = imageForm.getTitle(); if (StringUtils.isBlank(title)) { @@ -606,22 +561,4 @@ igService.notifyTeachersOnImageSumbit(toolSessionId, user); } } - - /** - * Extract web form content to imageGallery items. - */ - private void extractMultipleFormToImageGalleryItems(HttpServletRequest request, MultipleImagesForm multipleForm) - throws Exception { - - List fileList = ImageGalleryUtils.createFileListFromMultipleForm(multipleForm); - for (MultipartFile file : fileList) { - ImageGalleryItemForm imageForm = new ImageGalleryItemForm(); - imageForm.setSessionMapID(multipleForm.getSessionMapID()); - imageForm.setTitle(""); - imageForm.setDescription(""); - imageForm.setFile(file); - extractFormToImageGalleryItem(request, imageForm); - } - } - } Index: lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/web/form/ImageGalleryItemForm.java =================================================================== diff -u -r9e395fca5d7eb4a5ac4c9768642a336723a950f7 -r49b072598933566cedd795667351678071f03004 --- lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/web/form/ImageGalleryItemForm.java (.../ImageGalleryItemForm.java) (revision 9e395fca5d7eb4a5ac4c9768642a336723a950f7) +++ lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/web/form/ImageGalleryItemForm.java (.../ImageGalleryItemForm.java) (revision 49b072598933566cedd795667351678071f03004) @@ -45,6 +45,7 @@ private Long fileUuid; private String fileName; private MultipartFile file; + private String tmpFileUploadId; //used only in monitoring private String imageUid; @@ -132,6 +133,14 @@ this.file = file; } + public String getTmpFileUploadId() { + return tmpFileUploadId; + } + + public void setTmpFileUploadId(String tmpFileUploadId) { + this.tmpFileUploadId = tmpFileUploadId; + } + public String getImageUid() { return imageUid; } Index: lams_tool_images/web/includes/javascript/imageGalleryitem.js =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r49b072598933566cedd795667351678071f03004 --- lams_tool_images/web/includes/javascript/imageGalleryitem.js (.../imageGalleryitem.js) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_images/web/includes/javascript/imageGalleryitem.js (.../imageGalleryitem.js) (revision 49b072598933566cedd795667351678071f03004) @@ -37,32 +37,7 @@ $.each($('#imageGalleryItemForm').serializeArray(), function(i, field) { formData.append(field.name, field.value); }); - - // validate uploading file if we add it for the first time - if (!eval($("#has-file").val())) { - var fileSelect = document.getElementById('fileSelector'); - // Get the selected files from the input. - var files = fileSelect.files; - - if (files.length == 0) { - alert(LABEL_ITEM_BLANK); - return; - } - var file = files[0]; - // Check the file type and file size - if ( ! validateShowErrorImageType(file, LABEL_NOT_ALLOWED_FORMAT ) || - ! validateShowErrorFileSize(file, UPLOAD_FILE_LARGE_MAX_SIZE, LABEL_MAX_FILE_SIZE) ) { - return; - } - - // Add the file to the request. - formData.append('file', file, file.name); - $('#uploadButtons').hide(); - $('#itemAttachmentArea_Busy').show(); - - } - $.ajax({ type: 'POST', url: $("#imageGalleryItemForm").attr('action'), @@ -79,83 +54,74 @@ alert(errorMessage); } }); -} +} -function submitMultipleImageGalleryItems(){ - var formData = new FormData(); - formData.append('sessionMapID', $("#sessionMapID").val()); - - // Get selected files from the inputs - var validateFiles = []; - var errorDivs = []; - if ($('#file1').val()) { - var file = document.getElementById('file1').files[0]; - validateFiles.push(file); - errorDivs.push('fileerror1'); - formData.append('file1', file, file.name); - } - if ($('#file2').val()) { - var file = document.getElementById('file2').files[0]; - validateFiles.push(file); - errorDivs.push('fileerror2'); - formData.append('file2', file, file.name); - } - if ($('#file3').val()) { - var file = document.getElementById('file3').files[0]; - validateFiles.push(file); - errorDivs.push('fileerror3'); - formData.append('file3', file, file.name); - } - if ($('#file4').val()) { - var file = document.getElementById('file4').files[0]; - validateFiles.push(file); - errorDivs.push('fileerror4'); - formData.append('file4', file, file.name); - } - if ($('#file5').val()) { - var file = document.getElementById('file5').files[0]; - validateFiles.push(file); - errorDivs.push('fileerror5'); - formData.append('file5', file, file.name); - } - - // validate files - if (validateFiles.length == 0) { - alert(LABEL_ITEM_BLANK); - return; - } - var valid = true; - for (var i = 0; i < validateFiles.length; i++) { - // Check the file type and file size - var file = validateFiles[i]; - var errorDivId = errorDivs[i]; - if ( ! validateShowErrorImageType(file, LABEL_NOT_ALLOWED_FORMAT, false, errorDivId ) || - ! validateShowErrorFileSize(file, UPLOAD_FILE_LARGE_MAX_SIZE, LABEL_MAX_FILE_SIZE, false, errorDivId) ) { - valid=false; - } - } - if ( ! valid ) { - return; - } - - $('#uploadButtons').hide(); - $('#itemAttachmentArea_Busy').show(); - - - $.ajax({ - type: 'POST', - url: saveMultipleImagesUrl, - data: formData, - processData: false, - contentType: false, - success: function(data) { - //invoke callback function in case image was successfully uploaded - imageUploadedCallback(data); - }, - error: function(jqXHR, textStatus, errorMessage) { - $('#uploadButtons').show(); - $('#itemAttachmentArea_Busy').hide(); - alert(errorMessage); - } - }); -} +/** + * Initialised Uppy as the file upload widget + */ +function initFileUpload(tmpFileUploadId, singleFileUpload) { + var uppy = Uppy.Core({ + // upload immediately + autoProceed: true, + allowMultipleUploads: true, + debug: false, + restrictions: { + // taken from LAMS configuration + maxFileSize: +UPLOAD_FILE_LARGE_MAX_SIZE, + // when file gets replaced in an existing item, we can only select one + maxNumberOfFiles: singleFileUpload ? 1 : 10, + allowedFileTypes: UPLOAD_ALLOWED_EXTENSIONS + }, + meta: { + // all uploaded files go to this subdir in LAMS tmp dir + // its format is: upload__ + 'tmpFileUploadId' : tmpFileUploadId, + // for server-side file type validation; consistent with CKEditor parameter + 'Type' : 'Image', + 'largeFilesAllowed' : true + } + }); + + // upload using Ajax + uppy.use(Uppy.XHRUpload, { + endpoint: LAMS_URL + 'tmpFileUpload', + fieldName : 'file', + // files are uploaded one by one + limit : 1 + }); + + uppy.use(Uppy.Dashboard, { + target: '#image-upload-area', + inline: true, + height: 300, + width: '100%', + showProgressDetails : true, + hideRetryButton : true, + hideCancelButton : true, + showRemoveButtonAfterComplete: true, + proudlyDisplayPoweredByUppy: false + }); + + uppy.use(Uppy.Webcam, { + target: Uppy.Dashboard, + modes: ['picture'] + }); + + uppy.on('upload-success', (file, response) => { + // if file name was modified by server, reflect it in Uppy + file.meta.name = response.body.name; + }); + + uppy.on('file-removed', (file, reason) => { + if (reason === 'removed-by-user') { + // delete file from temporary folder on server + $.ajax({ + url : LAMS_URL + 'tmpFileUploadDelete', + data : { + 'tmpFileUploadId' : tmpFileUploadId, + 'name' : file.meta.name + } + }) + } + }) +} \ No newline at end of file Index: lams_tool_images/web/pages/authoring/authoring.jsp =================================================================== diff -u -re739ff3cdb84a0f87795156409657e96eb8f21b6 -r49b072598933566cedd795667351678071f03004 --- lams_tool_images/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision e739ff3cdb84a0f87795156409657e96eb8f21b6) +++ lams_tool_images/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 49b072598933566cedd795667351678071f03004) @@ -3,26 +3,33 @@ <%@ page import="org.lamsfoundation.lams.tool.imageGallery.ImageGalleryConstants"%> <%@ page import="org.lamsfoundation.lams.util.Configuration" %> <%@ page import="org.lamsfoundation.lams.util.ConfigurationKeys" %> +<%@ page import="org.lamsfoundation.lams.util.FileUtil" %> <%@ page import="org.lamsfoundation.lams.util.FileValidatorUtil" %> <%=Configuration.get(ConfigurationKeys.UPLOAD_FILE_LARGE_MAX_SIZE)%> +<%=FileUtil.ALLOWED_EXTENSIONS_IMAGE%> <fmt:message key="label.author.title" /> <%@ include file="/common/tabbedheader.jsp"%> + +