iking-web-ui-pro 1.0.48 → 1.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Demo/ik.index.cjs.js +1 -0
- package/dist/Demo/ik.index.es.js +1 -0
- package/dist/Demo/package.json +7 -0
- package/dist/IkApprovalProcess/ik.index.cjs.js +1 -0
- package/dist/IkApprovalProcess/ik.index.es.js +281 -277
- package/dist/IkApprovalProcess/package.json +5 -0
- package/dist/IkApprovalProcessDetail/ik.index.cjs.js +228 -0
- package/dist/IkApprovalProcessDetail/ik.index.es.js +5 -1
- package/dist/IkApprovalProcessDetail/package.json +5 -0
- package/dist/IkAutoCard/ik.index.cjs.js +1 -0
- package/dist/IkAutoCard/package.json +5 -0
- package/dist/IkBaseDialog/ik.index.cjs.js +3 -0
- package/dist/IkBaseDialog/package.json +5 -0
- package/dist/IkBottomOperate/ik.index.cjs.js +1 -0
- package/dist/IkBottomOperate/package.json +5 -0
- package/dist/IkBtnContent/ik.index.cjs.js +1 -0
- package/dist/IkBtnContent/package.json +5 -0
- package/dist/IkBtnSetting/ik.index.cjs.js +1 -0
- package/dist/IkBtnSetting/package.json +5 -0
- package/dist/IkCalendar/ik.index.cjs.js +1 -0
- package/dist/IkCalendar/ik.index.es.js +6 -2
- package/dist/IkCalendar/iking-web-ui-pro.css +1 -1
- package/dist/IkCalendar/package.json +5 -0
- package/dist/IkCollapseCard/ik.index.cjs.js +1 -0
- package/dist/IkCollapseCard/package.json +5 -0
- package/dist/IkCurrencyInput/ik.index.cjs.js +1 -0
- package/dist/IkCurrencyInput/package.json +5 -0
- package/dist/IkDescription/ik.index.cjs.js +228 -0
- package/dist/IkDescription/ik.index.es.js +466 -457
- package/dist/IkDescription/iking-web-ui-pro.css +1 -1
- package/dist/IkDescription/package.json +5 -0
- package/dist/IkDetailPreviewFiles/ik.index.cjs.js +228 -0
- package/dist/IkDetailPreviewFiles/ik.index.es.js +5 -1
- package/dist/IkDetailPreviewFiles/package.json +5 -0
- package/dist/IkDragList/ik.index.cjs.js +1 -0
- package/dist/IkDragList/package.json +5 -0
- package/dist/IkEmpty/ik.index.cjs.js +1 -0
- package/dist/IkEmpty/package.json +5 -0
- package/dist/IkExpandCollapse/ik.index.cjs.js +1 -0
- package/dist/IkExpandCollapse/package.json +5 -0
- package/dist/IkFileIcon/ik.index.cjs.js +1 -0
- package/dist/IkFileIcon/package.json +5 -0
- package/dist/IkHorizontalStepBar/ik.index.cjs.js +1 -0
- package/dist/IkHorizontalStepBar/package.json +7 -0
- package/dist/IkIconPicker/ik.index.cjs.js +1 -0
- package/dist/IkIconPicker/package.json +5 -0
- package/dist/IkImageEditor/ik.index.cjs.js +1 -0
- package/dist/IkImageEditor/ik.index.es.js +13 -12
- package/dist/IkImageEditor/package.json +5 -0
- package/dist/IkImageUploadEditor/ik.index.cjs.js +33 -0
- package/dist/IkImageUploadEditor/ik.index.es.js +1 -1
- package/dist/IkImageUploadEditor/iking-web-ui-pro.css +2 -2
- package/dist/IkImageUploadEditor/package.json +5 -0
- package/dist/IkImageViewer/ik.index.cjs.js +1 -0
- package/dist/IkImageViewer/package.json +5 -0
- package/dist/IkMonacoEditor/ik.index.cjs.js +11 -0
- package/dist/IkMonacoEditor/package.json +5 -0
- package/dist/IkOnlyOffice/ik.index.cjs.js +1 -0
- package/dist/IkOnlyOffice/package.json +5 -0
- package/dist/IkPage/ik.index.cjs.js +1 -0
- package/dist/IkPage/package.json +5 -0
- package/dist/IkPageFull/ik.index.cjs.js +17 -0
- package/dist/IkPageFull/ik.index.es.js +5 -1
- package/dist/IkPageFull/package.json +5 -0
- package/dist/IkPageTabs/ik.index.cjs.js +1 -0
- package/dist/IkPageTabs/package.json +5 -0
- package/dist/IkPickerUser/ik.index.cjs.js +1 -0
- package/dist/IkPickerUser/ik.index.es.js +249 -245
- package/dist/IkPickerUser/package.json +5 -0
- package/dist/IkPlayer/ik.index.cjs.js +226 -0
- package/dist/IkPlayer/ik.index.es.js +5 -1
- package/dist/IkPlayer/package.json +5 -0
- package/dist/IkPreviewFile/ik.index.cjs.js +228 -0
- package/dist/IkPreviewFile/ik.index.es.js +5 -1
- package/dist/IkPreviewFile/package.json +5 -0
- package/dist/IkPreviewFileDialog/ik.index.cjs.js +228 -0
- package/dist/IkPreviewFileDialog/ik.index.es.js +5 -1
- package/dist/IkPreviewFileDialog/package.json +5 -0
- package/dist/IkPrint/html2canvas.esm-C4Mnoizn.js +22 -0
- package/dist/IkPrint/ik.index.cjs.js +145 -0
- package/dist/IkPrint/index.es-BMhBUwqb.js +18 -0
- package/dist/IkPrint/jspdf.es.min-BH6PQjtb.js +193 -0
- package/dist/IkPrint/package.json +5 -0
- package/dist/IkPrint/purify.es-8WZbZdhR.js +2 -0
- package/dist/IkPrintConfig/ik.index.cjs.js +1 -0
- package/dist/IkPrintConfig/package.json +5 -0
- package/dist/IkPrintView/ik.index.cjs.js +1 -0
- package/dist/IkPrintView/package.json +5 -0
- package/dist/IkRadioGroup/ik.index.cjs.js +1 -0
- package/dist/IkRadioGroup/package.json +5 -0
- package/dist/IkSearch/ik.index.cjs.js +26 -0
- package/dist/IkSearch/ik.index.es.js +46 -42
- package/dist/IkSearch/package.json +5 -0
- package/dist/IkSearchHead/ik.index.cjs.js +1 -0
- package/dist/IkSearchHead/package.json +5 -0
- package/dist/IkSelectTag/ik.index.cjs.js +1 -0
- package/dist/IkSelectTag/package.json +5 -0
- package/dist/IkSideText/ik.index.cjs.js +1 -0
- package/dist/IkSideText/package.json +5 -0
- package/dist/IkStatu/ik.index.cjs.js +1 -0
- package/dist/IkStatu/package.json +5 -0
- package/dist/IkStatuOver/ik.index.cjs.js +1 -0
- package/dist/IkStatuOver/package.json +5 -0
- package/dist/IkSvgIcon/ik.index.cjs.js +1 -0
- package/dist/IkSvgIcon/package.json +5 -0
- package/dist/IkTemplateOfficeConfig/ik.index.cjs.js +1 -0
- package/dist/IkTemplateOfficeConfig/package.json +5 -0
- package/dist/IkTinymce/ik.index.cjs.js +102 -0
- package/dist/IkTinymce/package.json +5 -0
- package/dist/IkTooltip/ik.index.cjs.js +1 -0
- package/dist/IkTooltip/package.json +5 -0
- package/dist/IkTree/ik.index.cjs.js +1 -0
- package/dist/IkTree/package.json +5 -0
- package/dist/IkUploadFile/ik.index.cjs.js +228 -0
- package/dist/IkUploadFile/ik.index.es.js +6 -2
- package/dist/IkUploadFile/iking-web-ui-pro.css +1 -1
- package/dist/IkUploadFile/package.json +5 -0
- package/dist/IkUploadImage/ik.index.cjs.js +1 -0
- package/dist/IkUploadImage/package.json +5 -0
- package/dist/IkVerticalStepBar/ik.index.cjs.js +1 -0
- package/dist/IkVerticalStepBar/ik.index.es.js +1 -1
- package/dist/IkVerticalStepBar/iking-web-ui-pro.css +1 -1
- package/dist/IkVerticalStepBar/package.json +7 -0
- package/dist/Provider/ik.index.cjs.js +1 -0
- package/dist/Provider/package.json +5 -0
- package/dist/html2canvas.esm-C4Mnoizn.js +22 -0
- package/dist/iking-web-ui-pro.css +2 -2
- package/dist/{index-B7k0MBYs.mjs → index-Ead_HYDP.mjs} +2311 -2302
- package/dist/index-WKZ7ZkxJ.js +556 -0
- package/dist/index.cjs.js +1 -0
- package/dist/{index.es-x4V15FUC.mjs → index.es-B7kIaWOa.mjs} +2 -2
- package/dist/index.es-CFaOiLhV.js +18 -0
- package/dist/index.es.js +1 -1
- package/dist/jspdf.es.min-ByZc3B2w.js +193 -0
- package/dist/{jspdf.es.min-Dw0HwXiw.mjs → jspdf.es.min-qkJb9M2W.mjs} +1 -1
- package/dist/purify.es-8WZbZdhR.js +2 -0
- package/dist/{src → types/src}/utils/index.d.ts +1 -0
- package/dist/types/src/utils/use-cleanup.d.ts +12 -0
- package/dist/types/src/utils/use-provider.d.ts +15 -0
- package/package.json +14 -7
- package/dist/index.umd.js +0 -787
- package/dist/src/utils/use-provider.d.ts +0 -9
- package/dist/{src → types/src}/components/Demo/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkApprovalProcess/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkApprovalProcess/src/IkApprovalProcess.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkApprovalProcessDetail/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkApprovalProcessDetail/src/IkApprovalProcessDetail.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkAutoCard/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkAutoCard/src/IkAutoCard.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkBaseDialog/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkBaseDialog/src/CloseIcon.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkBaseDialog/src/IkBaseDialog.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkBottomOperate/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkBottomOperate/src/IkBottomOperate.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkBtnContent/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkBtnContent/src/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkBtnSetting/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkBtnSetting/src/IkBtnSetting.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkCalendar/event-utils.d.ts +0 -0
- package/dist/{src → types/src}/components/IkCalendar/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkCalendar/src/IkCalendar.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkCollapseCard/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkCollapseCard/src/index.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkCurrencyInput/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkCurrencyInput/src/IkCurrencyInput.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkDescription/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkDescription/src/IkDescription.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkDetailPreviewFiles/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkDetailPreviewFiles/src/IkDetailPreviewFiles.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkDragList/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkDragList/src/IkDragList.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkDragList/src/default-props.d.ts +0 -0
- package/dist/{src → types/src}/components/IkEmpty/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkEmpty/src/index.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkExpandCollapse/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkExpandCollapse/src/IkExpandCollapse.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkFileIcon/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkFileIcon/src/IkFileIcon.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkHorizontalStepBar/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkHorizontalStepBar/src/IkHorizontalStepBar.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkIconPicker/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkIconPicker/src/index.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkImageEditor/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkImageUploadEditor/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkImageUploadEditor/src/IkImageUploadEditor.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkImageViewer/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkImageViewer/src/IkImageViewer.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkImageViewer/src/image-viewer.d.ts +0 -0
- package/dist/{src → types/src}/components/IkMonacoEditor/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkMonacoEditor/src/editor-config.d.ts +0 -0
- package/dist/{src → types/src}/components/IkMonacoEditor/src/index.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkOnlyOffice/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkOnlyOffice/src/IkOnlyOffice.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPage/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPageFull/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPageFull/src/IkDialog.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPageFull/src/IkPage.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPageFull/src/IkPageHead.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPageFull/src/IkPageTable.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPageFull/src/IkSearchAuto.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPageFull/src/index.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPageFull/src/props.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPageFull/src/search.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPageTabs/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPageTabs/src/IkPageTabs.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPickerUser/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPickerUser/src/avatar/Avatar.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPickerUser/src/default.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPickerUser/src/list/GroupList.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPickerUser/src/list/PostList.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPickerUser/src/list/RoleList.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPickerUser/src/list/props.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPickerUser/src/list/utils.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPickerUser/src/picker.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPickerUser/src/svg/close_svg.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPickerUser/src/svg/group_svg.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPickerUser/src/svg/post_svg.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPickerUser/src/svg/role_svg.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPickerUser/src/svg/search_svg.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPickerUser/src/use-picker-data.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPickerUser/types.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPlayer/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPlayer/src/Player.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPreviewFile/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPreviewFile/src/IkPreviewFile.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPreviewFileDialog/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPreviewFileDialog/src/IkPreviewFileDialog.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPrint/IkPrint.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPrint/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPrintConfig/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPrintConfig/src/IkPrintConfig.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkPrintView/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkRadioGroup/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkRadioGroup/src/index.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkSearch/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkSearch/src/IkSearch.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkSearch/src/IkSearchAuto.d.ts +0 -0
- package/dist/{src → types/src}/components/IkSearch/src/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkSearchHead/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkSearchHead/src/IkSearchHead.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkSelectTag/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkSelectTag/src/index.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkSideText/IkLinearIcon.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkSideText/IkSideText.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkSideText/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkSideText/useLinear.d.ts +0 -0
- package/dist/{src → types/src}/components/IkStatu/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkStatu/src/index.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkStatuOver/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkStatuOver/src/index.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkSvgIcon/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkSvgIcon/src/index.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkTemplateOfficeConfig/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkTemplateOfficeConfig/src/IkTemplateOfficeConfig.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkTemplateOfficeConfig/src/templateOfficeData.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkTinymce/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkTinymce/src/index.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkTooltip/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkTooltip/src/index.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkTree/IkTree.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkTree/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkUploadFile/index.d.ts +3 -3
- package/dist/{src → types/src}/components/IkUploadFile/src/index.vue.d.ts +1 -1
- package/dist/{src → types/src}/components/IkUploadFile/src/utils.d.ts +0 -0
- package/dist/{src → types/src}/components/IkUploadImage/index.d.ts +3 -3
- package/dist/{src → types/src}/components/IkUploadImage/src/index.vue.d.ts +1 -1
- package/dist/{src → types/src}/components/IkUploadImage/src/loading.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/IkVerticalStepBar/index.d.ts +0 -0
- package/dist/{src → types/src}/components/IkVerticalStepBar/src/IkVerticalStepBar.vue.d.ts +0 -0
- package/dist/{src → types/src}/components/Provider/ProviderConfig.vue.d.ts +1 -1
- package/dist/{src → types/src}/components/Provider/index.d.ts +3 -3
- /package/dist/{src → types/src}/components/index.d.ts +0 -0
- /package/dist/{src → types/src}/enum/search.d.ts +0 -0
- /package/dist/{src → types/src}/iking-ui/component.d.ts +0 -0
- /package/dist/{src → types/src}/iking-ui/defaults.d.ts +0 -0
- /package/dist/{src → types/src}/iking-ui/index.d.ts +0 -0
- /package/dist/{src → types/src}/iking-ui/make-installer.d.ts +0 -0
- /package/dist/{src → types/src}/utils/approval.d.ts +0 -0
- /package/dist/{src → types/src}/utils/file.d.ts +0 -0
- /package/dist/{src → types/src}/utils/install.d.ts +0 -0
- /package/dist/{src → types/src}/utils/math.d.ts +0 -0
- /package/dist/{src → types/src}/utils/object.d.ts +0 -0
- /package/dist/{src → types/src}/utils/theme.d.ts +0 -0
- /package/dist/{src → types/src}/utils/typescript.d.ts +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";var sl=Object.defineProperty;var Br=s=>{throw TypeError(s)};var rl=(s,e,t)=>e in s?sl(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var f=(s,e,t)=>rl(s,typeof e!="symbol"?e+"":e,t),Ji=(s,e,t)=>e.has(s)||Br("Cannot "+t);var g=(s,e,t)=>(Ji(s,e,"read from private field"),t?t.call(s):e.get(s)),E=(s,e,t)=>e.has(s)?Br("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),k=(s,e,t,i)=>(Ji(s,e,"write to private field"),i?i.call(s,t):e.set(s,t),t),C=(s,e,t)=>(Ji(s,e,"access private method"),t);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const D=require("vue"),nl=(s,e)=>(s.install=t=>{for(const i of[s,...Object.values({})])t.component(i.name,i)},s),Lr=["csv","djvu","doc","docm","docx","docxf","dot","dotm","dotx","epub","fb2","fodp","fods","fodt","htm","html","mht","odp","ods","odt","oform","otp","ots","ott","oxps","pdf","pot","potm","potx","pps","ppsm","ppsx","ppt","pptm","pptx","rtf","txt","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xml","xps","png","jpeg","jpg","webp","video","mp4","flv","tls"],al=s=>{const e=D.inject("loadUrl"),t=D.computed(()=>s.loadUrl||s.fileUrl||(e==null?void 0:e.value)),i=D.inject("uploadUrl"),r=D.computed(()=>s.action||s.uploadUrl||(i==null?void 0:i.value)),n=D.inject("token"),a=D.computed(()=>s.token||(n==null?void 0:n.value)),o=D.inject("onlyofficeConfig"),l=D.computed(()=>s.onlyofficeConfig||(o==null?void 0:o.value)),c=D.inject("userInfo"),u=D.computed(()=>s.userInfo||(c==null?void 0:c.value)),h=[...Lr,...Lr.map(p=>p.toLocaleUpperCase())];return{cLoadUrl:t,cUploadUrl:r,cToken:a,cOnlyofficeConfig:l,cUserInfo:u,cOnlyofficePreviewType:h}};function ol(s,e){return Object.hasOwn(s,e)}function ll(s,e,t){return new Promise(i=>{s.toBlob(i,e,t)})}const dl=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function cl(s,e,t){const i=dl.exec(s),r=e.mimeType??(i==null?void 0:i[1])??"plain/text";let n;if((i==null?void 0:i[2])!=null){const a=atob(decodeURIComponent(i[3])),o=new Uint8Array(a.length);for(let l=0;l<a.length;l++)o[l]=a.charCodeAt(l);n=[o]}else(i==null?void 0:i[3])!=null&&(n=[decodeURIComponent(i[3])]);return new Blob(n,{type:r})}class hl extends Error{constructor(t,i){super(t);f(this,"isNetworkError");f(this,"cause");this.cause=i==null?void 0:i.cause,this.cause&&ol(this.cause,"isNetworkError")?this.isNetworkError=this.cause.isNetworkError:this.isNetworkError=!1}}function zr(s,e,t,i){return s===e?s:i===0?e:s+(e-s)*2**(-i/t)}const _a=['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])'];class Mi extends Error{constructor(t,i=null){super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.");f(this,"cause");f(this,"isNetworkError");f(this,"request");this.cause=t,this.isNetworkError=!0,this.request=i}}var je,ut,Yt,pt;class ul{constructor(e,t){E(this,je);E(this,ut,!1);E(this,Yt);E(this,pt);k(this,pt,e),k(this,Yt,()=>t(e))}progress(){g(this,ut)||g(this,pt)>0&&(clearTimeout(g(this,je)),k(this,je,setTimeout(g(this,Yt),g(this,pt))))}done(){g(this,ut)||(clearTimeout(g(this,je)),k(this,je,void 0),k(this,ut,!0))}}je=new WeakMap,ut=new WeakMap,Yt=new WeakMap,pt=new WeakMap;const ui=()=>{};function pl(s,e={}){const{body:t=null,headers:i={},method:r="GET",onBeforeRequest:n=ui,onUploadProgress:a=ui,shouldRetry:o=()=>!0,onAfterResponse:l=ui,onTimeout:c=ui,responseType:u,retries:h=3,signal:p=null,timeout:m=3e4,withCredentials:y=!1}=e,b=_=>.3*2**(_-1)*1e3,S=new ul(m,c);function F(_=0){return new Promise(async(T,R)=>{const P=new XMLHttpRequest,v=w=>{o(P)&&_<h?setTimeout(()=>{F(_+1).then(T,R)},b(_)):(S.done(),R(w))};P.open(r,s,!0),P.withCredentials=y,u&&(P.responseType=u),p==null||p.addEventListener("abort",()=>{P.abort(),R(new DOMException("Aborted","AbortError"))}),P.onload=async()=>{try{await l(P,_)}catch(w){w.request=P,v(w);return}P.status>=200&&P.status<300?(S.done(),T(P)):o(P)&&_<h?setTimeout(()=>{F(_+1).then(T,R)},b(_)):(S.done(),R(new Mi(P.statusText,P)))},P.onerror=()=>v(new Mi(P.statusText,P)),P.upload.onprogress=w=>{S.progress(),a(w)},i&&Object.keys(i).forEach(w=>{P.setRequestHeader(w,i[w])}),await n(P,_),P.send(t)})}return F()}function fl(...s){return fetch(...s).catch(e=>{throw e.name==="AbortError"?e:new Mi(e)})}function ml(s){const e=t=>"error"in t&&!!t.error;return s.filter(t=>!e(t))}function gl(s){return s.filter(e=>{var t;return!((t=e.progress)!=null&&t.uploadStarted)||!e.isRestored})}function Fa(s){return typeof s!="object"||s===null||!("nodeType"in s)?!1:s.nodeType===Node.ELEMENT_NODE}function $r(s){if(typeof s=="string"){const e=document.querySelectorAll(s);return e.length===0?null:Array.from(e)}return typeof s=="object"&&Fa(s)?[s]:null}function yl(s,e=document){return typeof s=="string"?e.querySelector(s):Fa(s)?s:null}function Ta(s){const e=s.lastIndexOf(".");return e===-1||e===s.length-1?{name:s,extension:void 0}:{name:s.slice(0,e),extension:s.slice(e+1)}}const Bs={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",msg:"application/vnd.ms-outlook",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function Ca(s){var t;if(s.type)return s.type;const e=s.name?(t=Ta(s.name).extension)==null?void 0:t.toLowerCase():null;return e&&e in Bs?Bs[e]:"application/octet-stream"}function vl(s){return s.charCodeAt(0).toString(32)}function Hr(s){let e="";return s.replace(/[^A-Z0-9]/gi,t=>(e+=`-${vl(t)}`,"/"))+e}function bl(s,e){let t=e||"uppy";return typeof s.name=="string"&&(t+=`-${Hr(s.name.toLowerCase())}`),s.type!==void 0&&(t+=`-${s.type}`),s.meta&&typeof s.meta.relativePath=="string"&&(t+=`-${Hr(s.meta.relativePath.toLowerCase())}`),s.data.size!==void 0&&(t+=`-${s.data.size}`),s.data.lastModified!==void 0&&(t+=`-${s.data.lastModified}`),t}function wl(s){return!s.isRemote||!s.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(s.remote.provider)}function Sl(s,e){if(wl(s))return s.id;const t=Ca(s);return bl({...s,type:t},e)}function qr(s,e){return s===!0?Object.keys(e):Array.isArray(s)?s:[]}const tt=Array.from;function _l(s){const e=tt(s.files);return Promise.resolve(e)}function Ea(s,e,t,{onSuccess:i}){s.readEntries(r=>{const n=[...e,...r];r.length?queueMicrotask(()=>{Ea(s,n,t,{onSuccess:i})}):i(n)},r=>{t(r),i(e)})}function Pa(s,e){return s==null?s:{kind:s.isFile?"file":s.isDirectory?"directory":void 0,name:s.name,getFile(){return new Promise((t,i)=>s.file(t,i))},async*values(){const t=s.createReader();yield*await new Promise(r=>{Ea(t,[],e,{onSuccess:n=>r(n.map(a=>Pa(a,e)))})})},isSameEntry:void 0}}async function*xa(s,e,t=void 0){const i=()=>`${e}/${s.name}`;if(s.kind==="file"){const r=await s.getFile();r!=null?(r.relativePath=e?i():null,yield r):t!=null&&(yield t)}else if(s.kind==="directory")for await(const r of s.values())yield*xa(r,e?i():s.name);else t!=null&&(yield t)}async function*Fl(s,e){const t=await Promise.all(Array.from(s.items,async i=>{let r;return r??(r=Pa(typeof i.getAsEntry=="function"?i.getAsEntry():i.webkitGetAsEntry(),e)),{fileSystemHandle:r,lastResortFile:i.getAsFile()}}));for(const{lastResortFile:i,fileSystemHandle:r}of t)if(r!=null)try{yield*xa(r,"",i)}catch(n){i!=null?yield i:e(n)}else i!=null&&(yield i)}async function Tl(s,e){const t=(e==null?void 0:e.logDropError)??Function.prototype;try{const i=[];for await(const r of Fl(s,t))i.push(r);return i}catch{return _l(s)}}const Cl={__proto__:null,"audio/mp3":"mp3","audio/mp4":"mp4","audio/ogg":"ogg","audio/webm":"webm","image/gif":"gif","image/heic":"heic","image/heif":"heif","image/jpeg":"jpg","image/webp":"webp","image/png":"png","image/svg+xml":"svg","video/mp4":"mp4","video/ogg":"ogv","video/quicktime":"mov","video/webm":"webm","video/x-matroska":"mkv","video/x-msvideo":"avi"};function dt(s){return[s]=s.split(";",1),Cl[s]||null}function El(s){var r;const t=(r=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?([^\n]+)/i.exec(s))==null?void 0:r[1];return`${/^http:\/\//i.test(s)?"ws":"wss"}://${t}`}function Pl(s){for(;s&&!s.dir;)s=s.parentNode;return s==null?void 0:s.dir}function Qi(s){return s<10?`0${s}`:s.toString()}function Pi(){const s=new Date,e=Qi(s.getHours()),t=Qi(s.getMinutes()),i=Qi(s.getSeconds());return`${e}:${t}:${i}`}function xl(){if(typeof window>"u")return!1;const s=document.body;return!(s==null||window==null||!("draggable"in s)||!("ondragstart"in s)||!("ondrop"in s)||!("FormData"in window)||!("FileReader"in window))}function Rl(s){return s?s.readyState!==0&&s.readyState!==4||s.status===0:!1}function Vr(s){return s.startsWith("blob:")}function jr(s){return s?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(s):!1}function Ml(s){const e=Math.floor(s/3600)%24,t=Math.floor(s/60)%60,i=Math.floor(s%60);return{hours:e,minutes:t,seconds:i}}function kl(s){const e=Ml(s),t=e.hours===0?"":`${e.hours}h`,i=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,r=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${i}${r}`}function Al(s){return new Error("Cancelled",{cause:s})}function Wr(s){var e;if(s!=null){const t=()=>this.abort(s.reason);s.addEventListener("abort",t,{once:!0});const i=()=>{s.removeEventListener("abort",t)};(e=this.then)==null||e.call(this,i,i)}return this}var Ce,ye,Ee,ft,ve,mt,We,Q,Ls,Nt,Ra,Ma,ka,Bi,gt;class Ol{constructor(e){E(this,Q);E(this,Ce,0);E(this,ye,[]);E(this,Ee,!1);E(this,ft);E(this,ve,1);E(this,mt);E(this,We);f(this,"limit");E(this,Bi,()=>this.resume());E(this,gt,()=>{if(g(this,Ee)){k(this,We,setTimeout(g(this,gt),0));return}k(this,ve,this.limit),this.limit=Math.ceil((g(this,mt)+g(this,ve))/2);for(let e=g(this,ve);e<=this.limit;e++)C(this,Q,Nt).call(this);g(this,mt)-g(this,ve)>3?k(this,We,setTimeout(g(this,gt),2e3)):k(this,ve,Math.floor(g(this,ve)/2))});typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,t){return!g(this,Ee)&&g(this,Ce)<this.limit?C(this,Q,Ls).call(this,e):C(this,Q,Ma).call(this,e,t)}wrapSyncFunction(e,t){return(...i)=>{const r=this.run(()=>(e(...i),queueMicrotask(()=>r.done()),()=>{}),t);return{abortOn:Wr,abort(){r.abort()}}}}wrapPromiseFunction(e,t){return(...i)=>{let r;const n=new Promise((a,o)=>{r=this.run(()=>{let l,c;try{c=Promise.resolve(e(...i))}catch(u){c=Promise.reject(u)}return c.then(u=>{l?o(l):(r.done(),a(u))},u=>{l?o(l):(r.done(),o(u))}),u=>{l=Al(u)}},t)});return n.abort=a=>{r.abort(a)},n.abortOn=Wr,n}}resume(){k(this,Ee,!1),clearTimeout(g(this,ft));for(let e=0;e<this.limit;e++)C(this,Q,Nt).call(this)}pause(e=null){k(this,Ee,!0),clearTimeout(g(this,ft)),e!=null&&k(this,ft,setTimeout(g(this,Bi),e))}rateLimit(e){clearTimeout(g(this,We)),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(k(this,mt,this.limit-1),this.limit=g(this,ve),k(this,We,setTimeout(g(this,gt),e)))}get isPaused(){return g(this,Ee)}}Ce=new WeakMap,ye=new WeakMap,Ee=new WeakMap,ft=new WeakMap,ve=new WeakMap,mt=new WeakMap,We=new WeakMap,Q=new WeakSet,Ls=function(e){k(this,Ce,g(this,Ce)+1);let t=!1,i;try{i=e()}catch(r){throw k(this,Ce,g(this,Ce)-1),r}return{abort:r=>{t||(t=!0,k(this,Ce,g(this,Ce)-1),i==null||i(r),C(this,Q,Nt).call(this))},done:()=>{t||(t=!0,k(this,Ce,g(this,Ce)-1),C(this,Q,Nt).call(this))}}},Nt=function(){queueMicrotask(()=>C(this,Q,Ra).call(this))},Ra=function(){if(g(this,Ee)||g(this,Ce)>=this.limit||g(this,ye).length===0)return;const e=g(this,ye).shift();if(e==null)throw new Error("Invariant violation: next is null");const t=C(this,Q,Ls).call(this,e.fn);e.abort=t.abort,e.done=t.done},Ma=function(e,t){const i={fn:e,priority:(t==null?void 0:t.priority)||0,abort:()=>{C(this,Q,ka).call(this,i)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},r=g(this,ye).findIndex(n=>i.priority>n.priority);return r===-1?g(this,ye).push(i):g(this,ye).splice(r,0,i),i},ka=function(e){const t=g(this,ye).indexOf(e);t!==-1&&g(this,ye).splice(t,1)},Bi=new WeakMap,gt=new WeakMap;const Zi=Symbol("__queue");function Dl(s,e,t){const i=[];return s.forEach(r=>typeof r!="string"?i.push(r):e[Symbol.split](r).forEach((n,a,o)=>{n!==""&&i.push(n),a<o.length-1&&i.push(t)})),i}/**
|
|
2
|
+
* Takes a string with placeholder variables like `%{smart_count} file selected`
|
|
3
|
+
* and replaces it with values from options `{smart_count: 5}`
|
|
4
|
+
*
|
|
5
|
+
* @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
|
|
6
|
+
* taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
|
|
7
|
+
*
|
|
8
|
+
* @param phrase that needs interpolation, with placeholders
|
|
9
|
+
* @param options with values that will be used to replace placeholders
|
|
10
|
+
*/function Gr(s,e){const t=/\$/g,i="$$$$";let r=[s];if(e==null)return r;for(const n of Object.keys(e))if(n!=="_"){let a=e[n];typeof a=="string"&&(a=t[Symbol.replace](a,i)),r=Dl(r,new RegExp(`%\\{${n}\\}`,"g"),a)}return r}const Nl=s=>{throw new Error(`missing string: ${s}`)};var Kt,Jt,zs;class Aa{constructor(e,{onMissingKey:t=Nl}={}){E(this,Jt);f(this,"locale");E(this,Kt);this.locale={strings:{},pluralize(i){return i===1?0:1}},Array.isArray(e)?e.forEach(C(this,Jt,zs),this):C(this,Jt,zs).call(this,e),k(this,Kt,t)}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let i=this.locale.strings[e];if(i==null&&(g(this,Kt).call(this,e),i=e),typeof i=="object"){if(t&&typeof t.smart_count<"u"){const n=this.locale.pluralize(t.smart_count);return Gr(i[n],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof i!="string")throw new Error("string was not a string");return Gr(i,t)}}Kt=new WeakMap,Jt=new WeakSet,zs=function(e){if(!(e!=null&&e.strings))return;const t=this.locale;Object.assign(this.locale,{strings:{...t.strings,...e.strings},pluralize:e.pluralize||t.pluralize})};const es="...";function Oa(s,e){if(e===0)return"";if(s.length<=e)return s;if(e<=es.length+1)return`${s.slice(0,e-1)}…`;const t=e-es.length,i=Math.ceil(t/2),r=Math.floor(t/2);return s.slice(0,i)+es+s.slice(-r)}class Il extends Error{constructor(){super(...arguments);f(this,"name","UserFacingApiError")}}var ai,L,Da,He,Xr,Na,Ia,Ua,vr,$s,Hs,qt={},Ba=[],Ul=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,oi=Array.isArray;function Se(s,e){for(var t in e)s[t]=e[t];return s}function br(s){s&&s.parentNode&&s.parentNode.removeChild(s)}function wr(s,e,t){var i,r,n,a={};for(n in e)n=="key"?i=e[n]:n=="ref"?r=e[n]:a[n]=e[n];if(arguments.length>2&&(a.children=arguments.length>3?ai.call(arguments,2):t),typeof s=="function"&&s.defaultProps!=null)for(n in s.defaultProps)a[n]===void 0&&(a[n]=s.defaultProps[n]);return zt(s,a,i,r,null)}function zt(s,e,t,i,r){var n={type:s,props:e,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++Da,__i:-1,__u:0};return r==null&&L.vnode!=null&&L.vnode(n),n}function Bl(){return{current:null}}function pe(s){return s.children}function ee(s,e){this.props=s,this.context=e}function Tt(s,e){if(e==null)return s.__?Tt(s.__,s.__i+1):null;for(var t;e<s.__k.length;e++)if((t=s.__k[e])!=null&&t.__e!=null)return t.__e;return typeof s.type=="function"?Tt(s):null}function La(s){var e,t;if((s=s.__)!=null&&s.__c!=null){for(s.__e=s.__c.base=null,e=0;e<s.__k.length;e++)if((t=s.__k[e])!=null&&t.__e!=null){s.__e=s.__c.base=t.__e;break}return La(s)}}function Yr(s){(!s.__d&&(s.__d=!0)&&He.push(s)&&!ki.__r++||Xr!=L.debounceRendering)&&((Xr=L.debounceRendering)||Na)(ki)}function ki(){for(var s,e,t,i,r,n,a,o=1;He.length;)He.length>o&&He.sort(Ia),s=He.shift(),o=He.length,s.__d&&(t=void 0,i=void 0,r=(i=(e=s).__v).__e,n=[],a=[],e.__P&&((t=Se({},i)).__v=i.__v+1,L.vnode&&L.vnode(t),Sr(e.__P,t,i,e.__n,e.__P.namespaceURI,32&i.__u?[r]:null,n,r??Tt(i),!!(32&i.__u),a),t.__v=i.__v,t.__.__k[t.__i]=t,Ha(n,t,a),i.__e=i.__=null,t.__e!=r&&La(t)));ki.__r=0}function za(s,e,t,i,r,n,a,o,l,c,u){var h,p,m,y,b,S,F,_=i&&i.__k||Ba,T=e.length;for(l=Ll(t,e,_,l,T),h=0;h<T;h++)(m=t.__k[h])!=null&&(p=m.__i==-1?qt:_[m.__i]||qt,m.__i=h,S=Sr(s,m,p,r,n,a,o,l,c,u),y=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&_r(p.ref,null,m),u.push(m.ref,m.__c||y,m)),b==null&&y!=null&&(b=y),(F=!!(4&m.__u))||p.__k===m.__k?l=$a(m,l,s,F):typeof m.type=="function"&&S!==void 0?l=S:y&&(l=y.nextSibling),m.__u&=-7);return t.__e=b,l}function Ll(s,e,t,i,r){var n,a,o,l,c,u=t.length,h=u,p=0;for(s.__k=new Array(r),n=0;n<r;n++)(a=e[n])!=null&&typeof a!="boolean"&&typeof a!="function"?(l=n+p,(a=s.__k[n]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?zt(null,a,null,null,null):oi(a)?zt(pe,{children:a},null,null,null):a.constructor==null&&a.__b>0?zt(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=s,a.__b=s.__b+1,o=null,(c=a.__i=zl(a,t,l,h))!=-1&&(h--,(o=t[c])&&(o.__u|=2)),o==null||o.__v==null?(c==-1&&(r>u?p--:r<u&&p++),typeof a.type!="function"&&(a.__u|=4)):c!=l&&(c==l-1?p--:c==l+1?p++:(c>l?p--:p++,a.__u|=4))):s.__k[n]=null;if(h)for(n=0;n<u;n++)(o=t[n])!=null&&(2&o.__u)==0&&(o.__e==i&&(i=Tt(o)),Va(o,o));return i}function $a(s,e,t,i){var r,n;if(typeof s.type=="function"){for(r=s.__k,n=0;r&&n<r.length;n++)r[n]&&(r[n].__=s,e=$a(r[n],e,t,i));return e}s.__e!=e&&(i&&(e&&s.type&&!e.parentNode&&(e=Tt(s)),t.insertBefore(s.__e,e||null)),e=s.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Re(s,e){return e=e||[],s==null||typeof s=="boolean"||(oi(s)?s.some(function(t){Re(t,e)}):e.push(s)),e}function zl(s,e,t,i){var r,n,a,o=s.key,l=s.type,c=e[t],u=c!=null&&(2&c.__u)==0;if(c===null&&s.key==null||u&&o==c.key&&l==c.type)return t;if(i>(u?1:0)){for(r=t-1,n=t+1;r>=0||n<e.length;)if((c=e[a=r>=0?r--:n++])!=null&&(2&c.__u)==0&&o==c.key&&l==c.type)return a}return-1}function Kr(s,e,t){e[0]=="-"?s.setProperty(e,t??""):s[e]=t==null?"":typeof t!="number"||Ul.test(e)?t:t+"px"}function pi(s,e,t,i,r){var n,a;e:if(e=="style")if(typeof t=="string")s.style.cssText=t;else{if(typeof i=="string"&&(s.style.cssText=i=""),i)for(e in i)t&&e in t||Kr(s.style,e,"");if(t)for(e in t)i&&t[e]==i[e]||Kr(s.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")n=e!=(e=e.replace(Ua,"$1")),a=e.toLowerCase(),e=a in s||e=="onFocusOut"||e=="onFocusIn"?a.slice(2):e.slice(2),s.l||(s.l={}),s.l[e+n]=t,t?i?t.u=i.u:(t.u=vr,s.addEventListener(e,n?Hs:$s,n)):s.removeEventListener(e,n?Hs:$s,n);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in s)try{s[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?s.removeAttribute(e):s.setAttribute(e,e=="popover"&&t==1?"":t))}}function Jr(s){return function(e){if(this.l){var t=this.l[e.type+s];if(e.t==null)e.t=vr++;else if(e.t<t.u)return;return t(L.event?L.event(e):e)}}}function Sr(s,e,t,i,r,n,a,o,l,c){var u,h,p,m,y,b,S,F,_,T,R,P,v,w,M,N,I,U=e.type;if(e.constructor!=null)return null;128&t.__u&&(l=!!(32&t.__u),n=[o=e.__e=t.__e]),(u=L.__b)&&u(e);e:if(typeof U=="function")try{if(F=e.props,_="prototype"in U&&U.prototype.render,T=(u=U.contextType)&&i[u.__c],R=u?T?T.props.value:u.__:i,t.__c?S=(h=e.__c=t.__c).__=h.__E:(_?e.__c=h=new U(F,R):(e.__c=h=new ee(F,R),h.constructor=U,h.render=Hl),T&&T.sub(h),h.props=F,h.state||(h.state={}),h.context=R,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),_&&h.__s==null&&(h.__s=h.state),_&&U.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Se({},h.__s)),Se(h.__s,U.getDerivedStateFromProps(F,h.__s))),m=h.props,y=h.state,h.__v=e,p)_&&U.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),_&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(_&&U.getDerivedStateFromProps==null&&F!==m&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(F,R),!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(F,h.__s,R)===!1||e.__v==t.__v){for(e.__v!=t.__v&&(h.props=F,h.state=h.__s,h.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function($){$&&($.__=e)}),P=0;P<h._sb.length;P++)h.__h.push(h._sb[P]);h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(F,h.__s,R),_&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(m,y,b)})}if(h.context=R,h.props=F,h.__P=s,h.__e=!1,v=L.__r,w=0,_){for(h.state=h.__s,h.__d=!1,v&&v(e),u=h.render(h.props,h.state,h.context),M=0;M<h._sb.length;M++)h.__h.push(h._sb[M]);h._sb=[]}else do h.__d=!1,v&&v(e),u=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++w<25);h.state=h.__s,h.getChildContext!=null&&(i=Se(Se({},i),h.getChildContext())),_&&!p&&h.getSnapshotBeforeUpdate!=null&&(b=h.getSnapshotBeforeUpdate(m,y)),N=u,u!=null&&u.type===pe&&u.key==null&&(N=qa(u.props.children)),o=za(s,oi(N)?N:[N],e,t,i,r,n,a,o,l,c),h.base=e.__e,e.__u&=-161,h.__h.length&&a.push(h),S&&(h.__E=h.__=null)}catch($){if(e.__v=null,l||n!=null)if($.then){for(e.__u|=l?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;n[n.indexOf(o)]=null,e.__e=o}else{for(I=n.length;I--;)br(n[I]);qs(e)}else e.__e=t.__e,e.__k=t.__k,$.then||qs(e);L.__e($,e,t)}else n==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):o=e.__e=$l(t.__e,e,t,i,r,n,a,l,c);return(u=L.diffed)&&u(e),128&e.__u?void 0:o}function qs(s){s&&s.__c&&(s.__c.__e=!0),s&&s.__k&&s.__k.forEach(qs)}function Ha(s,e,t){for(var i=0;i<t.length;i++)_r(t[i],t[++i],t[++i]);L.__c&&L.__c(e,s),s.some(function(r){try{s=r.__h,r.__h=[],s.some(function(n){n.call(r)})}catch(n){L.__e(n,r.__v)}})}function qa(s){return typeof s!="object"||s==null||s.__b&&s.__b>0?s:oi(s)?s.map(qa):Se({},s)}function $l(s,e,t,i,r,n,a,o,l){var c,u,h,p,m,y,b,S=t.props,F=e.props,_=e.type;if(_=="svg"?r="http://www.w3.org/2000/svg":_=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),n!=null){for(c=0;c<n.length;c++)if((m=n[c])&&"setAttribute"in m==!!_&&(_?m.localName==_:m.nodeType==3)){s=m,n[c]=null;break}}if(s==null){if(_==null)return document.createTextNode(F);s=document.createElementNS(r,_,F.is&&F),o&&(L.__m&&L.__m(e,n),o=!1),n=null}if(_==null)S===F||o&&s.data==F||(s.data=F);else{if(n=n&&ai.call(s.childNodes),S=t.props||qt,!o&&n!=null)for(S={},c=0;c<s.attributes.length;c++)S[(m=s.attributes[c]).name]=m.value;for(c in S)if(m=S[c],c!="children"){if(c=="dangerouslySetInnerHTML")h=m;else if(!(c in F)){if(c=="value"&&"defaultValue"in F||c=="checked"&&"defaultChecked"in F)continue;pi(s,c,null,m,r)}}for(c in F)m=F[c],c=="children"?p=m:c=="dangerouslySetInnerHTML"?u=m:c=="value"?y=m:c=="checked"?b=m:o&&typeof m!="function"||S[c]===m||pi(s,c,m,S[c],r);if(u)o||h&&(u.__html==h.__html||u.__html==s.innerHTML)||(s.innerHTML=u.__html),e.__k=[];else if(h&&(s.innerHTML=""),za(e.type=="template"?s.content:s,oi(p)?p:[p],e,t,i,_=="foreignObject"?"http://www.w3.org/1999/xhtml":r,n,a,n?n[0]:t.__k&&Tt(t,0),o,l),n!=null)for(c=n.length;c--;)br(n[c]);o||(c="value",_=="progress"&&y==null?s.removeAttribute("value"):y!=null&&(y!==s[c]||_=="progress"&&!y||_=="option"&&y!=S[c])&&pi(s,c,y,S[c],r),c="checked",b!=null&&b!=s[c]&&pi(s,c,b,S[c],r))}return s}function _r(s,e,t){try{if(typeof s=="function"){var i=typeof s.__u=="function";i&&s.__u(),i&&e==null||(s.__u=s(e))}else s.current=e}catch(r){L.__e(r,t)}}function Va(s,e,t){var i,r;if(L.unmount&&L.unmount(s),(i=s.ref)&&(i.current&&i.current!=s.__e||_r(i,null,e)),(i=s.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){L.__e(n,e)}i.base=i.__P=null}if(i=s.__k)for(r=0;r<i.length;r++)i[r]&&Va(i[r],e,t||typeof s.type!="function");t||br(s.__e),s.__c=s.__=s.__e=void 0}function Hl(s,e,t){return this.constructor(s,t)}function Qr(s,e,t){var i,r,n,a;e==document&&(e=document.documentElement),L.__&&L.__(s,e),r=(i=!1)?null:e.__k,n=[],a=[],Sr(e,s=e.__k=wr(pe,null,[s]),r||qt,qt,e.namespaceURI,r?null:e.firstChild?ai.call(e.childNodes):null,n,r?r.__e:e.firstChild,i,a),Ha(n,s,a)}function ja(s,e,t){var i,r,n,a,o=Se({},s.props);for(n in s.type&&s.type.defaultProps&&(a=s.type.defaultProps),e)n=="key"?i=e[n]:n=="ref"?r=e[n]:o[n]=e[n]===void 0&&a!=null?a[n]:e[n];return arguments.length>2&&(o.children=arguments.length>3?ai.call(arguments,2):t),zt(s.type,o,i||s.key,r||s.ref,null)}ai=Ba.slice,L={__e:function(s,e,t,i){for(var r,n,a;e=e.__;)if((r=e.__c)&&!r.__)try{if((n=r.constructor)&&n.getDerivedStateFromError!=null&&(r.setState(n.getDerivedStateFromError(s)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(s,i||{}),a=r.__d),a)return r.__E=r}catch(o){s=o}throw s}},Da=0,ee.prototype.setState=function(s,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Se({},this.state),typeof s=="function"&&(s=s(Se({},t),this.props)),s&&Se(t,s),s!=null&&this.__v&&(e&&this._sb.push(e),Yr(this))},ee.prototype.forceUpdate=function(s){this.__v&&(this.__e=!0,s&&this.__h.push(s),Yr(this))},ee.prototype.render=pe,He=[],Na=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ia=function(s,e){return s.__v.__b-e.__v.__b},ki.__r=0,Ua=/(PointerCapture)$|Capture$/i,vr=0,$s=Jr(!1),Hs=Jr(!0);var ql=0;function d(s,e,t,i,r,n){e||(e={});var a,o,l=e;if("ref"in l)for(o in l={},e)o=="ref"?a=e[o]:l[o]=e[o];var c={type:s,props:l,key:t,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ql,__i:-1,__u:0,__source:r,__self:n};if(typeof s=="function"&&(a=s.defaultProps))for(o in a)l[o]===void 0&&(l[o]=a[o]);return L.vnode&&L.vnode(c),c}var Vt,j,ts,Zr,jt=0,Wa=[],W=L,en=W.__b,tn=W.__r,sn=W.diffed,rn=W.__c,nn=W.unmount,an=W.__;function Fr(s,e){W.__h&&W.__h(j,s,jt||e),jt=0;var t=j.__H||(j.__H={__:[],__h:[]});return s>=t.__.length&&t.__.push({}),t.__[s]}function Ct(s){return jt=1,Vl(Xa,s)}function Vl(s,e,t){var i=Fr(Vt++,2);if(i.t=s,!i.__c&&(i.__=[Xa(void 0,e),function(o){var l=i.__N?i.__N[0]:i.__[0],c=i.t(l,o);l!==c&&(i.__N=[c,i.__[1]],i.__c.setState({}))}],i.__c=j,!j.__f)){var r=function(o,l,c){if(!i.__c.__H)return!0;var u=i.__c.__H.__.filter(function(p){return!!p.__c});if(u.every(function(p){return!p.__N}))return!n||n.call(this,o,l,c);var h=i.__c.props!==o;return u.forEach(function(p){if(p.__N){var m=p.__[0];p.__=p.__N,p.__N=void 0,m!==p.__[0]&&(h=!0)}}),n&&n.call(this,o,l,c)||h};j.__f=!0;var n=j.shouldComponentUpdate,a=j.componentWillUpdate;j.componentWillUpdate=function(o,l,c){if(this.__e){var u=n;n=void 0,r(o,l,c),n=u}a&&a.call(this,o,l,c)},j.shouldComponentUpdate=r}return i.__N||i.__}function Ai(s,e){var t=Fr(Vt++,3);!W.__s&&Ga(t.__H,e)&&(t.__=s,t.u=e,j.__H.__h.push(t))}function $t(s){return jt=5,Tr(function(){return{current:s}},[])}function Tr(s,e){var t=Fr(Vt++,7);return Ga(t.__H,e)&&(t.__=s(),t.__H=e,t.__h=s),t.__}function Oi(s,e){return jt=8,Tr(function(){return s},e)}function jl(){for(var s;s=Wa.shift();)if(s.__P&&s.__H)try{s.__H.__h.forEach(xi),s.__H.__h.forEach(Vs),s.__H.__h=[]}catch(e){s.__H.__h=[],W.__e(e,s.__v)}}W.__b=function(s){j=null,en&&en(s)},W.__=function(s,e){s&&e.__k&&e.__k.__m&&(s.__m=e.__k.__m),an&&an(s,e)},W.__r=function(s){tn&&tn(s),Vt=0;var e=(j=s.__c).__H;e&&(ts===j?(e.__h=[],j.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(xi),e.__h.forEach(Vs),e.__h=[],Vt=0)),ts=j},W.diffed=function(s){sn&&sn(s);var e=s.__c;e&&e.__H&&(e.__H.__h.length&&(Wa.push(e)!==1&&Zr===W.requestAnimationFrame||((Zr=W.requestAnimationFrame)||Wl)(jl)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),ts=j=null},W.__c=function(s,e){e.some(function(t){try{t.__h.forEach(xi),t.__h=t.__h.filter(function(i){return!i.__||Vs(i)})}catch(i){e.some(function(r){r.__h&&(r.__h=[])}),e=[],W.__e(i,t.__v)}}),rn&&rn(s,e)},W.unmount=function(s){nn&&nn(s);var e,t=s.__c;t&&t.__H&&(t.__H.__.forEach(function(i){try{xi(i)}catch(r){e=r}}),t.__H=void 0,e&&W.__e(e,t.__v))};var on=typeof requestAnimationFrame=="function";function Wl(s){var e,t=function(){clearTimeout(i),on&&cancelAnimationFrame(e),setTimeout(s)},i=setTimeout(t,35);on&&(e=requestAnimationFrame(t))}function xi(s){var e=j,t=s.__c;typeof t=="function"&&(s.__c=void 0,t()),j=e}function Vs(s){var e=j;s.__c=s.__(),j=e}function Ga(s,e){return!s||s.length!==e.length||e.some(function(t,i){return t!==s[i]})}function Xa(s,e){return typeof e=="function"?e(s):e}const Gl={position:"relative",width:"100%",minHeight:"100%"},Xl={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};function Yl({data:s,rowHeight:e,renderRow:t,overscanCount:i=10,padding:r=4,...n}){const a=$t(null),[o,l]=Ct(0),[c,u]=Ct(0);Ai(()=>{function _(){a.current!=null&&c!==a.current.offsetHeight&&u(a.current.offsetHeight)}return _(),window.addEventListener("resize",_),()=>{window.removeEventListener("resize",_)}},[c]);const h=Oi(()=>{a.current&&l(a.current.scrollTop)},[]);let p=Math.floor(o/e),m=Math.floor(c/e);i&&(p=Math.max(0,p-p%i),m+=i);const y=p+m+r,b=s.slice(p,y),S={...Gl,height:s.length*e},F={...Xl,top:p*e};return d("div",{onScroll:h,ref:a,...n,children:d("div",{role:"presentation",style:S,children:d("div",{role:"presentation",style:F,children:b.map(t)})})})}class Ya{constructor(e,t){f(this,"uppy");f(this,"opts");f(this,"id");f(this,"defaultLocale");f(this,"i18n");f(this,"i18nArray");f(this,"type");f(this,"VERSION");this.uppy=e,this.opts=t??{}}getPluginState(){const{plugins:e}=this.uppy.getState();return(e==null?void 0:e[this.id])||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const e=new Aa([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}var be,Qt;class Kl{constructor(e){E(this,be);E(this,Qt,[]);k(this,be,e)}on(e,t){return g(this,Qt).push([e,t]),g(this,be).on(e,t)}remove(){for(const[e,t]of g(this,Qt).splice(0))g(this,be).off(e,t)}onFilePause(e,t){this.on("upload-pause",(i,r)=>{e===(i==null?void 0:i.id)&&t(r)})}onFileRemove(e,t){this.on("file-removed",i=>{e===i.id&&t(i.id)})}onPause(e,t){this.on("upload-pause",(i,r)=>{e===(i==null?void 0:i.id)&&t(r)})}onRetry(e,t){this.on("upload-retry",i=>{e===(i==null?void 0:i.id)&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{g(this,be).getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{g(this,be).getFile(e)&&t()})}onCancelAll(e,t){this.on("cancel-all",(...i)=>{g(this,be).getFile(e)&&t(...i)})}onResumeAll(e,t){this.on("resume-all",()=>{g(this,be).getFile(e)&&t()})}}be=new WeakMap,Qt=new WeakMap;const Jl={debug:()=>{},warn:()=>{},error:(...s)=>console.error(`[Uppy] [${Pi()}]`,...s)},Ql={debug:(...s)=>console.debug(`[Uppy] [${Pi()}]`,...s),warn:(...s)=>console.warn(`[Uppy] [${Pi()}]`,...s),error:(...s)=>console.error(`[Uppy] [${Pi()}]`,...s)};var fi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function st(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var is,ln;function Zl(){return ln||(ln=1,is=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);const t=e<0;let i=Math.abs(e);if(t&&(i=-i),i===0)return"0 B";const r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.min(Math.floor(Math.log(i)/Math.log(1024)),r.length-1),a=Number(i/1024**n),o=r[n];return`${a>=10||a%1===0?Math.round(a):a.toFixed(1)} ${o}`}),is}var ed=Zl();const Ve=st(ed);var ss,dn;function td(){if(dn)return ss;dn=1;function s(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}return s.prototype.match=function(e){var t=!0,i=this.parts,r,n=i.length,a;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)t=!1;else{for(a=(e||"").split(this.separator),r=0;t&&r<n;r++)i[r]!=="*"&&(r<a.length?t=i[r]===a[r]:t=!1);t=t&&a}else if(typeof e.splice=="function")for(t=[],r=e.length;r--;)this.match(e[r])&&(t[t.length]=e[r]);else if(typeof e=="object"){t={};for(var o in e)this.match(o)&&(t[o]=e[o])}return t},ss=function(e,t,i){var r=new s(e,i||/[\/\.]/);return typeof t<"u"?r.match(t):r},ss}var rs,cn;function id(){if(cn)return rs;cn=1;var s=td(),e=/[\/\+\.]/;return rs=function(t,i){function r(n){var a=s(n,t,e);return a&&a.length>=2}return i?r(i.split(";")[0]):r},rs}var sd=id();const rd=st(sd),nd={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class ce extends Error{constructor(t,i){super(t);f(this,"isUserFacing");f(this,"file");f(this,"isRestriction",!0);this.isUserFacing=(i==null?void 0:i.isUserFacing)??!0,i!=null&&i.file&&(this.file=i.file)}}class ad{constructor(e,t){f(this,"getI18n");f(this,"getOpts");this.getI18n=t,this.getOpts=()=>{var r;const i=e();if(((r=i.restrictions)==null?void 0:r.allowedFileTypes)!=null&&!Array.isArray(i.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return i}}validateAggregateRestrictions(e,t){const{maxTotalFileSize:i,maxNumberOfFiles:r}=this.getOpts().restrictions;if(r&&e.filter(a=>!a.isGhost).length+t.length>r)throw new ce(`${this.getI18n()("youCanOnlyUploadX",{smart_count:r})}`);if(i){const n=[...e,...t].reduce((a,o)=>a+(o.size??0),0);if(n>i)throw new ce(this.getI18n()("aggregateExceedsSize",{sizeAllowed:Ve(i),size:Ve(n)}))}}validateSingleFile(e){const{maxFileSize:t,minFileSize:i,allowedFileTypes:r}=this.getOpts().restrictions;if(r&&!r.some(a=>a.includes("/")?e.type?rd(e.type.replace(/;.*?$/,""),a):!1:a[0]==="."&&e.extension?e.extension.toLowerCase()===a.slice(1).toLowerCase():!1)){const a=r.join(", ");throw new ce(this.getI18n()("youCanOnlyUploadFileTypes",{types:a}),{file:e})}if(t&&e.size!=null&&e.size>t)throw new ce(this.getI18n()("exceedsSize",{size:Ve(t),file:e.name??this.getI18n()("unnamed")}),{file:e});if(i&&e.size!=null&&e.size<i)throw new ce(this.getI18n()("inferiorSize",{size:Ve(i)}),{file:e})}validate(e,t){t.forEach(i=>{this.validateSingleFile(i)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){const{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new ce(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){const t=new ce(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name??this.getI18n()("unnamed")})),{requiredMetaFields:i}=this.getOpts().restrictions,r=[];for(const n of i)(!Object.hasOwn(e.meta,n)||e.meta[n]==="")&&r.push(n);return{missingFields:r,error:t}}}function od(s){let e=null,t;return(...i)=>(t=i,e||(e=Promise.resolve().then(()=>(e=null,s(...t)))),e)}var Zt;const Li=class Li extends Ya{constructor(){super(...arguments);E(this,Zt);f(this,"isTargetDOMEl");f(this,"el");f(this,"parent");f(this,"title")}getTargetPlugin(t){let i;if(typeof(t==null?void 0:t.addTarget)=="function")i=t,i instanceof Li||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:i,UIPlugin:Li}}));else if(typeof t=="function"){const r=t;this.uppy.iteratePlugins(n=>{n instanceof r&&(i=n)})}return i}mount(t,i){const r=i.id,n=yl(t);if(n){this.isTargetDOMEl=!0;const l=document.createElement("div");return l.classList.add("uppy-Root"),k(this,Zt,od(c=>{this.uppy.getPlugin(this.id)&&(Qr(this.render(c,l),l),this.afterUpdate())})),this.uppy.log(`Installing ${r} to a DOM element '${t}'`),this.opts.replaceTargetContent&&(n.innerHTML=""),Qr(this.render(this.uppy.getState(),l),l),this.el=l,n.appendChild(l),l.dir=this.opts.direction||Pl(l)||"ltr",this.onMount(),this.el}const a=this.getTargetPlugin(t);if(a)return this.uppy.log(`Installing ${r} to ${a.id}`),this.parent=a,this.el=a.addTarget(i),this.onMount(),this.el;this.uppy.log(`Not installing ${r}`);let o=`Invalid target option given to ${r}.`;throw typeof t=="function"?o+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":o+="If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> 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.",new Error(o)}render(t,i){throw new Error("Extend the render method to add your plugin to a DOM element")}update(t){var i;this.el!=null&&((i=g(this,Zt))==null||i.call(this,t))}unmount(){var t;this.isTargetDOMEl&&((t=this.el)==null||t.remove()),this.onUnmount()}onMount(){}onUnmount(){}};Zt=new WeakMap;let Ie=Li;const ld="5.0.0",dd={version:ld};var yt,zi,Ja;class Ka{constructor(){E(this,zi);f(this,"state",{});E(this,yt,new Set)}getState(){return this.state}setState(e){const t={...this.state},i={...this.state,...e};this.state=i,C(this,zi,Ja).call(this,t,i,e)}subscribe(e){return g(this,yt).add(e),()=>{g(this,yt).delete(e)}}}yt=new WeakMap,zi=new WeakSet,Ja=function(...e){g(this,yt).forEach(t=>{t(...e)})},f(Ka,"VERSION",dd.version);var ns,hn;function Cr(){if(hn)return ns;hn=1;function s(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return ns=s,ns}var as,un;function cd(){if(un)return as;un=1;var s=typeof fi=="object"&&fi&&fi.Object===Object&&fi;return as=s,as}var os,pn;function Qa(){if(pn)return os;pn=1;var s=cd(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=s||e||Function("return this")();return os=t,os}var ls,fn;function hd(){if(fn)return ls;fn=1;var s=Qa(),e=function(){return s.Date.now()};return ls=e,ls}var ds,mn;function ud(){if(mn)return ds;mn=1;var s=/\s/;function e(t){for(var i=t.length;i--&&s.test(t.charAt(i)););return i}return ds=e,ds}var cs,gn;function pd(){if(gn)return cs;gn=1;var s=ud(),e=/^\s+/;function t(i){return i&&i.slice(0,s(i)+1).replace(e,"")}return cs=t,cs}var hs,yn;function Za(){if(yn)return hs;yn=1;var s=Qa(),e=s.Symbol;return hs=e,hs}var us,vn;function fd(){if(vn)return us;vn=1;var s=Za(),e=Object.prototype,t=e.hasOwnProperty,i=e.toString,r=s?s.toStringTag:void 0;function n(a){var o=t.call(a,r),l=a[r];try{a[r]=void 0;var c=!0}catch{}var u=i.call(a);return c&&(o?a[r]=l:delete a[r]),u}return us=n,us}var ps,bn;function md(){if(bn)return ps;bn=1;var s=Object.prototype,e=s.toString;function t(i){return e.call(i)}return ps=t,ps}var fs,wn;function gd(){if(wn)return fs;wn=1;var s=Za(),e=fd(),t=md(),i="[object Null]",r="[object Undefined]",n=s?s.toStringTag:void 0;function a(o){return o==null?o===void 0?r:i:n&&n in Object(o)?e(o):t(o)}return fs=a,fs}var ms,Sn;function yd(){if(Sn)return ms;Sn=1;function s(e){return e!=null&&typeof e=="object"}return ms=s,ms}var gs,_n;function vd(){if(_n)return gs;_n=1;var s=gd(),e=yd(),t="[object Symbol]";function i(r){return typeof r=="symbol"||e(r)&&s(r)==t}return gs=i,gs}var ys,Fn;function bd(){if(Fn)return ys;Fn=1;var s=pd(),e=Cr(),t=vd(),i=NaN,r=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt;function l(c){if(typeof c=="number")return c;if(t(c))return i;if(e(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=e(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=s(c);var h=n.test(c);return h||a.test(c)?o(c.slice(2),h?2:8):r.test(c)?i:+c}return ys=l,ys}var vs,Tn;function eo(){if(Tn)return vs;Tn=1;var s=Cr(),e=hd(),t=bd(),i="Expected a function",r=Math.max,n=Math.min;function a(o,l,c){var u,h,p,m,y,b,S=0,F=!1,_=!1,T=!0;if(typeof o!="function")throw new TypeError(i);l=t(l)||0,s(c)&&(F=!!c.leading,_="maxWait"in c,p=_?r(t(c.maxWait)||0,l):p,T="trailing"in c?!!c.trailing:T);function R(A){var H=u,z=h;return u=h=void 0,S=A,m=o.apply(z,H),m}function P(A){return S=A,y=setTimeout(M,l),F?R(A):m}function v(A){var H=A-b,z=A-S,J=l-H;return _?n(J,p-z):J}function w(A){var H=A-b,z=A-S;return b===void 0||H>=l||H<0||_&&z>=p}function M(){var A=e();if(w(A))return N(A);y=setTimeout(M,v(A))}function N(A){return y=void 0,T&&u?R(A):(u=h=void 0,m)}function I(){y!==void 0&&clearTimeout(y),S=0,u=b=h=y=void 0}function U(){return y===void 0?m:N(e())}function $(){var A=e(),H=w(A);if(u=arguments,h=this,b=A,H){if(y===void 0)return P(b);if(_)return clearTimeout(y),y=setTimeout(M,l),R(b)}return y===void 0&&(y=setTimeout(M,l)),m}return $.cancel=I,$.flush=U,$}return vs=a,vs}var bs,Cn;function wd(){if(Cn)return bs;Cn=1;var s=eo(),e=Cr(),t="Expected a function";function i(r,n,a){var o=!0,l=!0;if(typeof r!="function")throw new TypeError(t);return e(a)&&(o="leading"in a?!!a.leading:o,l="trailing"in a?!!a.trailing:l),s(r,n,{leading:o,maxWait:n,trailing:l})}return bs=i,bs}var Sd=wd();const _d=st(Sd);var ws,En;function Fd(){return En||(En=1,ws=function(){var e={},t=e._fns={};e.emit=function(a,o,l,c,u,h,p){var m=i(a);m.length&&r(a,m,[o,l,c,u,h,p])},e.on=function(a,o){t[a]||(t[a]=[]),t[a].push(o)},e.once=function(a,o){function l(){o.apply(this,arguments),e.off(a,l)}this.on(a,l)},e.off=function(a,o){var l=[];if(a&&o){var c=this._fns[a],u=0,h=c?c.length:0;for(u;u<h;u++)c[u]!==o&&l.push(c[u])}l.length?this._fns[a]=l:delete this._fns[a]};function i(n){var a=t[n]?t[n]:[],o=n.indexOf(":"),l=o===-1?[n]:[n.substring(0,o),n.substring(o+1)],c=Object.keys(t),u=0,h=c.length;for(u;u<h;u++){var p=c[u];if(p==="*"&&(a=a.concat(t[p])),l.length===2&&l[0]===p){a=a.concat(t[p]);break}}return a}function r(n,a,o){var l=0,c=a.length;for(l;l<c&&a[l];l++)a[l].event=n,a[l].apply(a[l],o)}return e}),ws}var Td=Fd();const Cd=st(Td);let Ed="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Yi=(s=21)=>{let e="",t=s|0;for(;t--;)e+=Ed[Math.random()*64|0];return e};const Pd="5.1.0",xd={version:Pd};function Rd(s,e){return e.name?e.name:s.split("/")[0]==="image"?`${s.split("/")[0]}.${s.split("/")[1]}`:"noname"}const Md={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function kd(s){if(s==null&&typeof navigator<"u"&&(s=navigator.userAgent),!s)return!0;const e=/Edge\/(\d+\.\d+)/.exec(s);if(!e)return!0;const i=e[1].split(".",2),r=parseInt(i[0],10),n=parseInt(i[1],10);return r<15||r===15&&n<15063||r>18||r===18&&n>=18218}const mi={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};var Ge,le,de,ei,Xe,vt,bt,Ye,x,$e,js,to,Ws,io,Gs,Xs,Ys,Ks,$i,Js,Ke,so,ro,Me,ti,It,no,Ri,Ut;let Ad=(Ge=class{constructor(e){E(this,x);E(this,le,Object.create(null));E(this,de);E(this,ei);E(this,Xe,Cd());E(this,vt,new Set);E(this,bt,new Set);E(this,Ye,new Set);f(this,"defaultLocale");f(this,"locale");f(this,"opts");f(this,"store");f(this,"i18n");f(this,"i18nArray");f(this,"scheduledAutoProceed",null);f(this,"wasOffline",!1);E(this,$i,(e,t)=>{const i=e?this.getFile(e.id):void 0;if(e==null||!i){this.log(`Not setting progress for a file that has been removed: ${e==null?void 0:e.id}`);return}if(i.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${e.id}`);return}const r={bytesTotal:t.bytesTotal,percentage:t.bytesTotal!=null&&Number.isFinite(t.bytesTotal)&&t.bytesTotal>0?Math.round(t.bytesUploaded/t.bytesTotal*100):void 0};i.progress.uploadStarted!=null?this.setFileState(e.id,{progress:{...i.progress,...r,bytesUploaded:t.bytesUploaded}}):this.setFileState(e.id,{progress:{...i.progress,...r}}),g(this,Ke).call(this)});E(this,Ke,_d(()=>C(this,x,Js).call(this),500,{leading:!0,trailing:!0}));E(this,Me,this.updateOnlineStatus.bind(this));E(this,ti,new Map);this.defaultLocale=Md;const t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:nd,meta:{},onBeforeFileAdded:(r,n)=>!Object.hasOwn(n,r.id),onBeforeUpload:r=>r,store:new Ka,logger:Jl,infoTimeout:5e3},i={...t,...e};this.opts={...i,restrictions:{...t.restrictions,...e==null?void 0:e.restrictions}},e!=null&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e!=null&&e.debug&&(this.opts.logger=Ql),this.log(`Using Core v${Ge.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...mi,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:kd(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),k(this,de,new ad(()=>this.opts,()=>this.i18n)),k(this,ei,this.store.subscribe((r,n,a)=>{this.emit("state-update",r,n,a),this.updateAll(n)})),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),C(this,x,ro).call(this)}emit(e,...t){g(this,Xe).emit(e,...t)}on(e,t){return g(this,Xe).on(e,t),this}once(e,t){return g(this,Xe).once(e,t),this}off(e,t){return g(this,Xe).off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){const t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map(([i,r])=>[i,{...t[i],...r}]))}})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){const e=i=>this.log(`Missing i18n string: ${i}`,"error"),t=new Aa([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e==null?void 0:e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions(e)}),this.setState(void 0)}resetProgress(){const e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},i=Object.create(null);Object.keys(t).forEach(r=>{i[r]={...t[r],progress:{...t[r].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:i,...mi})}clear(){const{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...mi,files:{}})}addPreProcessor(e){g(this,vt).add(e)}removePreProcessor(e){return g(this,vt).delete(e)}addPostProcessor(e){g(this,Ye).add(e)}removePostProcessor(e){return g(this,Ye).delete(e)}addUploader(e){g(this,bt).add(e)}removeUploader(e){return g(this,bt).delete(e)}setMeta(e){const t={...this.getState().meta,...e},i={...this.getState().files};Object.keys(i).forEach(r=>{i[r]={...i[r],meta:{...i[r].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:i})}setFileMeta(e,t){const i={...this.getState().files};if(!i[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}const r={...i[e].meta,...t};i[e]={...i[e],meta:r},this.setState({files:i})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(t=>this.getFile(t))}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:i}=this.getState(),r=Object.values(e),n=[],a=[],o=[],l=[],c=[],u=[],h=[],p=[],m=[];for(const y of r){const{progress:b}=y;!b.uploadComplete&&b.uploadStarted&&(n.push(y),y.isPaused||p.push(y)),b.uploadStarted||a.push(y),(b.uploadStarted||b.preprocess||b.postprocess)&&o.push(y),b.uploadStarted&&l.push(y),y.isPaused&&c.push(y),b.uploadComplete&&u.push(y),y.error&&h.push(y),(b.preprocess||b.postprocess)&&m.push(y)}return{newFiles:a,startedFiles:o,uploadStartedFiles:l,pausedFiles:c,completeFiles:u,erroredFiles:h,inProgressFiles:n,inProgressNotPausedFiles:p,processingFiles:m,isUploadStarted:l.length>0,isAllComplete:t===100&&u.length===r.length&&m.length===0,isAllErrored:!!i&&h.length===r.length,isAllPaused:n.length!==0&&c.length===n.length,isUploadInProgress:n.length>0,isSomeGhost:r.some(y=>y.isGhost)}}validateRestrictions(e,t=this.getFiles()){try{g(this,de).validate(t,[e])}catch(i){return i}return null}validateSingleFile(e){try{g(this,de).validateSingleFile(e)}catch(t){return t.message}return null}validateAggregateRestrictions(e){const t=this.getFiles();try{g(this,de).validateAggregateRestrictions(t,e)}catch(i){return i.message}return null}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){C(this,x,Ws).call(this,e);const{nextFilesState:t,validFilesToAdd:i,errors:r}=C(this,x,Xs).call(this,[e]),n=r.filter(o=>o.isRestriction);if(C(this,x,$e).call(this,n),r.length>0)throw r[0];this.setState({files:t});const[a]=i;return this.emit("file-added",a),this.emit("files-added",i),this.log(`Added file: ${a.name}, ${a.id}, mime type: ${a.type}`),C(this,x,Gs).call(this),a.id}addFiles(e){C(this,x,Ws).call(this);const{nextFilesState:t,validFilesToAdd:i,errors:r}=C(this,x,Xs).call(this,e),n=r.filter(o=>o.isRestriction);C(this,x,$e).call(this,n);const a=r.filter(o=>!o.isRestriction);if(a.length>0){let o=`Multiple errors occurred while adding files:
|
|
11
|
+
`;if(a.forEach(l=>{o+=`
|
|
12
|
+
* ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:a.length}),details:o},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(a,o);{const l=new Error(o);throw l.errors=a,l}}this.setState({files:t}),i.forEach(o=>{this.emit("file-added",o)}),this.emit("files-added",i),i.length>5?this.log(`Added batch of ${i.length} files`):Object.values(i).forEach(o=>{this.log(`Added file: ${o.name}
|
|
13
|
+
id: ${o.id}
|
|
14
|
+
type: ${o.type}`)}),i.length>0&&C(this,x,Gs).call(this)}removeFiles(e){const{files:t,currentUploads:i}=this.getState(),r={...t},n={...i},a=Object.create(null);e.forEach(u=>{t[u]&&(a[u]=t[u],delete r[u])});function o(u){return a[u]===void 0}Object.keys(n).forEach(u=>{const h=i[u].fileIDs.filter(o);if(h.length===0){delete n[u];return}const{capabilities:p}=this.getState();if(h.length!==i[u].fileIDs.length&&!p.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");n[u]={...i[u],fileIDs:h}});const l={currentUploads:n,files:r};Object.keys(r).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),g(this,Ke).call(this);const c=Object.keys(a);c.forEach(u=>{this.emit("file-removed",a[u])}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;const t=this.getFile(e),r=!(t.isPaused||!1);return this.setFileState(e,{isPaused:r}),this.emit("upload-pause",t,r),r}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(i=>!e[i].progress.uploadComplete&&e[i].progress.uploadStarted).forEach(i=>{const r={...e[i],isPaused:!0};e[i]=r}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(i=>!e[i].progress.uploadComplete&&e[i].progress.uploadStarted).forEach(i=>{const r={...e[i],isPaused:!1,error:null};e[i]=r}),this.setState({files:e}),this.emit("resume-all")}async retryAll(){const e=await C(this,x,Ks).call(this);return this.emit("complete",e),e}cancelAll(){this.emit("cancel-all");const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t),this.setState(mi)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));const t=C(this,x,It).call(this,[e],{forceAllowNewUpload:!0});return C(this,x,Ut).call(this,t)}logout(){this.iteratePlugins(e=>{var t,i;(i=(t=e.provider)==null?void 0:t.logout)==null||i.call(t)})}[Symbol.for("uppy test: updateTotalProgress")](){return C(this,x,Js).call(this)}updateOnlineStatus(){window.navigator.onLine??!0?(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)}getID(){return this.opts.id}use(e,...t){if(typeof e!="function"){const a=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(a)}const i=new e(this,...t),r=i.id;if(!r)throw new Error("Your plugin must have an id");if(!i.type)throw new Error("Your plugin must have a type");const n=this.getPlugin(r);if(n){const a=`Already found a plugin named '${n.id}'. Tried to use: '${r}'.
|
|
15
|
+
Uppy plugins must have unique \`id\` options.`;throw new Error(a)}return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),i.type in g(this,le)?g(this,le)[i.type].push(i):g(this,le)[i.type]=[i],i.install(),this.emit("plugin-added",i),this}getPlugin(e){for(const t of Object.values(g(this,le))){const i=t.find(r=>r.id===e);if(i!=null)return i}}[Symbol.for("uppy test: getPlugins")](e){return g(this,le)[e]}iteratePlugins(e){Object.values(g(this,le)).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=g(this,le)[e.type],i=t.findIndex(a=>a.id===e.id);i!==-1&&t.splice(i,1);const n={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(n)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),g(this,ei).call(this),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",g(this,Me)),window.removeEventListener("offline",g(this,Me)))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t="info",i=3e3){const r=typeof e=="object";this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout(()=>this.hideInfo(),i),this.emit("info-visible")}log(e,t){const{logger:i}=this.opts;switch(t){case"error":i.error(e);break;case"warning":i.warn(e);break;default:i.debug(e);break}}registerRequestClient(e,t){g(this,ti).set(e,t)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const t=g(this,ti).get(e.remote.requestClientId);if(t==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return t}async restore(e){if(this.log(`Core: attempting to restore upload "${e}"`),!this.getState().currentUploads[e])throw C(this,x,Ri).call(this,e),new Error("Nonexistent upload");const t=await C(this,x,Ut).call(this,e);return this.emit("complete",t),t}[Symbol.for("uppy test: createUpload")](...e){return C(this,x,It).call(this,...e)}addResultData(e,t){if(!C(this,x,no).call(this,e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}const{currentUploads:i}=this.getState(),r={...i[e],result:{...i[e].result,...t}};this.setState({currentUploads:{...i,[e]:r}})}async upload(){var r;(r=g(this,le).uploader)!=null&&r.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState();if(C(this,x,Ys).call(this).length>0){const n=await C(this,x,Ks).call(this);if(!(this.getFiles().filter(o=>o.progress.uploadStarted==null).length>0))return this.emit("complete",n),n;({files:e}=this.getState())}const i=this.opts.onBeforeUpload(e);return i===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(i&&typeof i=="object"&&(e=i,this.setState({files:e})),Promise.resolve().then(()=>g(this,de).validateMinNumberOfFiles(e)).catch(n=>{throw C(this,x,$e).call(this,[n]),n}).then(()=>{if(!C(this,x,to).call(this,e))throw new ce(this.i18n("missingRequiredMetaField"))}).catch(n=>{throw n}).then(async()=>{const{currentUploads:n}=this.getState(),a=Object.values(n).flatMap(u=>u.fileIDs),o=[];Object.keys(e).forEach(u=>{const h=this.getFile(u);!h.progress.uploadStarted&&a.indexOf(u)===-1&&o.push(h.id)});const l=C(this,x,It).call(this,o),c=await C(this,x,Ut).call(this,l);return this.emit("complete",c),c}).catch(n=>{throw this.emit("error",n),this.log(n,"error"),n}))}},le=new WeakMap,de=new WeakMap,ei=new WeakMap,Xe=new WeakMap,vt=new WeakMap,bt=new WeakMap,Ye=new WeakMap,x=new WeakSet,$e=function(e){for(const a of e)a.isRestriction?this.emit("restriction-failed",a.file,a):this.emit("error",a,a.file),this.log(a,"warning");const t=e.filter(a=>a.isUserFacing),i=4,r=t.slice(0,i),n=t.slice(i);r.forEach(({message:a,details:o=""})=>{this.info({message:a,details:o},"error",this.opts.infoTimeout)}),n.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:n.length})})},js=function(e){const{missingFields:t,error:i}=g(this,de).getMissingRequiredMetaFields(e);return t.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:t,error:i.message}),this.log(i.message),this.emit("restriction-failed",e,i),!1):(t.length===0&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)},to=function(e){let t=!0;for(const i of Object.values(e))C(this,x,js).call(this,i)||(t=!1);return t},Ws=function(e){const{allowNewUpload:t}=this.getState();if(t===!1){const i=new ce(this.i18n("noMoreFilesAllowed"),{file:e});throw C(this,x,$e).call(this,[i]),i}},io=function(e){const t=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e}:e,i=Ca(t),r=Rd(i,t),n=Ta(r).extension,a=Sl(t,this.getID()),o=t.meta||{};o.name=r,o.type=i;const l=Number.isFinite(t.data.size)?t.data.size:null;return{source:t.source||"",id:a,name:r,extension:n||"",meta:{...this.getState().meta,...o},type:i,data:t.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isGhost:!1,isRemote:t.isRemote||!1,remote:t.remote,preview:t.preview}},Gs=function(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))},Xs=function(e){var a;let{files:t}=this.getState(),i={...t};const r=[],n=[];for(const o of e)try{let l=C(this,x,io).call(this,o);const c=(a=t[l.id])==null?void 0:a.isGhost;c&&(l={...t[l.id],isGhost:!1,data:o.data},this.log(`Replaced the blob in the restored ghost file: ${l.name}, ${l.id}`));const u=this.opts.onBeforeFileAdded(l,i);if(t=this.getState().files,i={...t,...i},!u&&this.checkIfFileAlreadyExists(l.id))throw new ce(this.i18n("noDuplicates",{fileName:l.name??this.i18n("unnamed")}),{file:o});if(u===!1&&!c)throw new ce("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:o});typeof u=="object"&&u!==null&&(l=u),g(this,de).validateSingleFile(l),i[l.id]=l,r.push(l)}catch(l){n.push(l)}try{g(this,de).validateAggregateRestrictions(Object.values(t),r)}catch(o){return n.push(o),{nextFilesState:t,validFilesToAdd:[],errors:n}}return{nextFilesState:i,validFilesToAdd:r,errors:n}},Ys=function(){const{files:e}=this.getState();return Object.keys(e).filter(t=>{const i=e[t];return i.error&&(!i.missingRequiredMetaFields||i.missingRequiredMetaFields.length===0)})},Ks=async function(){const e=C(this,x,Ys).call(this),t={...this.getState().files};if(e.forEach(r=>{t[r]={...t[r],isPaused:!1,error:null}}),this.setState({files:t,error:null}),this.emit("retry-all",this.getFilesByIds(e)),e.length===0)return{successful:[],failed:[]};const i=C(this,x,It).call(this,e,{forceAllowNewUpload:!0});return C(this,x,Ut).call(this,i)},$i=new WeakMap,Js=function(){const e=C(this,x,so).call(this);let t=null;e!=null&&(t=Math.round(e*100),t>100?t=100:t<0&&(t=0)),this.emit("progress",t??0),this.setState({totalProgress:t??0})},Ke=new WeakMap,so=function(){const t=this.getFiles().filter(l=>l.progress.uploadStarted||l.progress.preprocess||l.progress.postprocess);if(t.length===0)return 0;if(t.every(l=>l.progress.uploadComplete))return 1;const i=l=>l.progress.bytesTotal!=null&&l.progress.bytesTotal!==0,r=t.filter(i),n=t.filter(l=>!i(l));if(r.every(l=>l.progress.uploadComplete)&&n.length>0&&!n.every(l=>l.progress.uploadComplete))return null;const a=r.reduce((l,c)=>l+(c.progress.bytesTotal??0),0),o=r.reduce((l,c)=>l+(c.progress.bytesUploaded||0),0);return a===0?0:o/a},ro=function(){const e=(r,n,a)=>{let o=r.message||"Unknown error";r.details&&(o+=` ${r.details}`),this.setState({error:o}),n!=null&&n.id in this.getState().files&&this.setFileState(n.id,{error:o,response:a})};this.on("error",e),this.on("upload-error",(r,n,a)=>{if(e(n,r,a),typeof n=="object"&&n.message){this.log(n.message,"error");const o=new Error(this.i18n("failedToUpload",{file:(r==null?void 0:r.name)??""}));o.isUserFacing=!0,o.details=n.message,n.details&&(o.details+=` ${n.details}`),C(this,x,$e).call(this,[o])}else C(this,x,$e).call(this,[n])});let t=null;this.on("upload-stalled",(r,n)=>{const{message:a}=r,o=n.map(l=>l.meta.name).join(", ");t||(this.info({message:a,details:o},"warning",this.opts.infoTimeout),t=setTimeout(()=>{t=null},this.opts.infoTimeout)),this.log(`${a} ${o}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const i=r=>{const n=r.filter(o=>{const l=o!=null&&this.getFile(o.id);return l||this.log(`Not setting progress for a file that has been removed: ${o==null?void 0:o.id}`),l}),a=Object.fromEntries(n.map(o=>[o.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:o.size}}]));this.patchFilesState(a)};this.on("upload-start",i),this.on("upload-progress",g(this,$i)),this.on("upload-success",(r,n)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}const a=this.getFile(r.id).progress;this.setFileState(r.id,{progress:{...a,postprocess:g(this,Ye).size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:a.bytesTotal},response:n,uploadURL:n.uploadURL,isPaused:!1}),r.size==null&&this.setFileState(r.id,{size:n.bytesUploaded||a.bytesTotal}),g(this,Ke).call(this)}),this.on("preprocess-progress",(r,n)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}this.setFileState(r.id,{progress:{...this.getFile(r.id).progress,preprocess:n}})}),this.on("preprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}const n={...this.getState().files};n[r.id]={...n[r.id],progress:{...n[r.id].progress}},delete n[r.id].progress.preprocess,this.setState({files:n})}),this.on("postprocess-progress",(r,n)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}this.setFileState(r.id,{progress:{...this.getState().files[r.id].progress,postprocess:n}})}),this.on("postprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}const n={...this.getState().files};n[r.id]={...n[r.id],progress:{...n[r.id].progress}},delete n[r.id].progress.postprocess,this.setState({files:n})}),this.on("restored",()=>{g(this,Ke).call(this)}),this.on("dashboard:file-edit-complete",r=>{r&&C(this,x,js).call(this,r)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",g(this,Me)),window.addEventListener("offline",g(this,Me)),setTimeout(g(this,Me),3e3))},Me=new WeakMap,ti=new WeakMap,It=function(e,t={}){const{forceAllowNewUpload:i=!1}=t,{allowNewUpload:r,currentUploads:n}=this.getState();if(!r&&!i)throw new Error("Cannot create a new upload: already uploading.");const a=Yi();return this.emit("upload",a,this.getFilesByIds(e)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...n,[a]:{fileIDs:e,step:0,result:{}}}}),a},no=function(e){const{currentUploads:t}=this.getState();return t[e]},Ri=function(e){const t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})},Ut=async function(e){const t=()=>{const{currentUploads:a}=this.getState();return a[e]};let i=t();const r=[...g(this,vt),...g(this,bt),...g(this,Ye)];try{for(let a=i.step||0;a<r.length&&i;a++){const o=r[a];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...i,step:a}}});const{fileIDs:l}=i;await o(l,e),i=t()}}catch(a){throw C(this,x,Ri).call(this,e),a}if(i){i.fileIDs.forEach(c=>{const u=this.getFile(c);u!=null&&u.progress.postprocess&&this.emit("postprocess-complete",u)});const a=i.fileIDs.map(c=>this.getFile(c)),o=a.filter(c=>!c.error),l=a.filter(c=>c.error);this.addResultData(e,{successful:o,failed:l,uploadID:e}),i=t()}let n;return i&&(n=i.result,C(this,x,Ri).call(this,e)),n==null&&(this.log(`Not setting result for an upload that has been removed: ${e}`),n={successful:[],failed:[],uploadID:e}),n},f(Ge,"VERSION",xd.version),Ge);const Od="4.0.1",Dd={version:Od};/*!
|
|
16
|
+
* Cropper.js v1.6.2
|
|
17
|
+
* https://fengyuanchen.github.io/cropperjs
|
|
18
|
+
*
|
|
19
|
+
* Copyright 2015-present Chen Fengyuan
|
|
20
|
+
* Released under the MIT license
|
|
21
|
+
*
|
|
22
|
+
* Date: 2024-04-21T07:43:05.335Z
|
|
23
|
+
*/function Pn(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(s,r).enumerable})),t.push.apply(t,i)}return t}function ao(s){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pn(Object(t),!0).forEach(function(i){Bd(s,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):Pn(Object(t)).forEach(function(i){Object.defineProperty(s,i,Object.getOwnPropertyDescriptor(t,i))})}return s}function Nd(s,e){if(typeof s!="object"||!s)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var i=t.call(s,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(s)}function oo(s){var e=Nd(s,"string");return typeof e=="symbol"?e:e+""}function Qs(s){"@babel/helpers - typeof";return Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qs(s)}function Id(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}function xn(s,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(s,oo(i.key),i)}}function Ud(s,e,t){return e&&xn(s.prototype,e),t&&xn(s,t),Object.defineProperty(s,"prototype",{writable:!1}),s}function Bd(s,e,t){return e=oo(e),e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function lo(s){return Ld(s)||zd(s)||$d(s)||Hd()}function Ld(s){if(Array.isArray(s))return Zs(s)}function zd(s){if(typeof Symbol<"u"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}function $d(s,e){if(s){if(typeof s=="string")return Zs(s,e);var t=Object.prototype.toString.call(s).slice(8,-1);if(t==="Object"&&s.constructor&&(t=s.constructor.name),t==="Map"||t==="Set")return Array.from(s);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Zs(s,e)}}function Zs(s,e){(e==null||e>s.length)&&(e=s.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=s[t];return i}function Hd(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
24
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Ki=typeof window<"u"&&typeof window.document<"u",Fe=Ki?window:{},Er=Ki&&Fe.document.documentElement?"ontouchstart"in Fe.document.documentElement:!1,Pr=Ki?"PointerEvent"in Fe:!1,q="cropper",xr="all",co="crop",ho="move",uo="zoom",Le="e",ze="w",rt="s",xe="n",xt="ne",Rt="nw",Mt="se",kt="sw",er="".concat(q,"-crop"),Rn="".concat(q,"-disabled"),ie="".concat(q,"-hidden"),Mn="".concat(q,"-hide"),qd="".concat(q,"-invisible"),Di="".concat(q,"-modal"),tr="".concat(q,"-move"),Wt="".concat(q,"Action"),gi="".concat(q,"Preview"),Rr="crop",po="move",fo="none",ir="crop",sr="cropend",rr="cropmove",nr="cropstart",kn="dblclick",Vd=Er?"touchstart":"mousedown",jd=Er?"touchmove":"mousemove",Wd=Er?"touchend touchcancel":"mouseup",An=Pr?"pointerdown":Vd,On=Pr?"pointermove":jd,Dn=Pr?"pointerup pointercancel":Wd,Nn="ready",In="resize",Un="wheel",ar="zoom",Bn="image/jpeg",Gd=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Xd=/^data:/,Yd=/^data:image\/jpeg;base64,/,Kd=/^img|canvas$/i,mo=200,go=100,Ln={viewMode:0,dragMode:Rr,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:mo,minContainerHeight:go,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Jd='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',Qd=Number.isNaN||Fe.isNaN;function O(s){return typeof s=="number"&&!Qd(s)}var zn=function(e){return e>0&&e<1/0};function Ss(s){return typeof s>"u"}function it(s){return Qs(s)==="object"&&s!==null}var Zd=Object.prototype.hasOwnProperty;function at(s){if(!it(s))return!1;try{var e=s.constructor,t=e.prototype;return e&&t&&Zd.call(t,"isPrototypeOf")}catch{return!1}}function te(s){return typeof s=="function"}var ec=Array.prototype.slice;function yo(s){return Array.from?Array.from(s):ec.call(s)}function G(s,e){return s&&te(e)&&(Array.isArray(s)||O(s.length)?yo(s).forEach(function(t,i){e.call(s,t,i,s)}):it(s)&&Object.keys(s).forEach(function(t){e.call(s,s[t],t,s)})),s}var V=Object.assign||function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return it(e)&&i.length>0&&i.forEach(function(n){it(n)&&Object.keys(n).forEach(function(a){e[a]=n[a]})}),e},tc=/\.\d*(?:0|9){12}\d*$/;function ct(s){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return tc.test(s)?Math.round(s*e)/e:s}var ic=/^width|height|left|top|marginLeft|marginTop$/;function Oe(s,e){var t=s.style;G(e,function(i,r){ic.test(r)&&O(i)&&(i="".concat(i,"px")),t[r]=i})}function sc(s,e){return s.classList?s.classList.contains(e):s.className.indexOf(e)>-1}function Y(s,e){if(e){if(O(s.length)){G(s,function(i){Y(i,e)});return}if(s.classList){s.classList.add(e);return}var t=s.className.trim();t?t.indexOf(e)<0&&(s.className="".concat(t," ").concat(e)):s.className=e}}function _e(s,e){if(e){if(O(s.length)){G(s,function(t){_e(t,e)});return}if(s.classList){s.classList.remove(e);return}s.className.indexOf(e)>=0&&(s.className=s.className.replace(e,""))}}function ot(s,e,t){if(e){if(O(s.length)){G(s,function(i){ot(i,e,t)});return}t?Y(s,e):_e(s,e)}}var rc=/([a-z\d])([A-Z])/g;function Mr(s){return s.replace(rc,"$1-$2").toLowerCase()}function or(s,e){return it(s[e])?s[e]:s.dataset?s.dataset[e]:s.getAttribute("data-".concat(Mr(e)))}function Gt(s,e,t){it(t)?s[e]=t:s.dataset?s.dataset[e]=t:s.setAttribute("data-".concat(Mr(e)),t)}function nc(s,e){if(it(s[e]))try{delete s[e]}catch{s[e]=void 0}else if(s.dataset)try{delete s.dataset[e]}catch{s.dataset[e]=void 0}else s.removeAttribute("data-".concat(Mr(e)))}var vo=/\s\s*/,bo=(function(){var s=!1;if(Ki){var e=!1,t=function(){},i=Object.defineProperty({},"once",{get:function(){return s=!0,e},set:function(n){e=n}});Fe.addEventListener("test",t,i),Fe.removeEventListener("test",t,i)}return s})();function oe(s,e,t){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},r=t;e.trim().split(vo).forEach(function(n){if(!bo){var a=s.listeners;a&&a[n]&&a[n][t]&&(r=a[n][t],delete a[n][t],Object.keys(a[n]).length===0&&delete a[n],Object.keys(a).length===0&&delete s.listeners)}s.removeEventListener(n,r,i)})}function ne(s,e,t){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},r=t;e.trim().split(vo).forEach(function(n){if(i.once&&!bo){var a=s.listeners,o=a===void 0?{}:a;r=function(){delete o[n][t],s.removeEventListener(n,r,i);for(var c=arguments.length,u=new Array(c),h=0;h<c;h++)u[h]=arguments[h];t.apply(s,u)},o[n]||(o[n]={}),o[n][t]&&s.removeEventListener(n,o[n][t],i),o[n][t]=r,s.listeners=o}s.addEventListener(n,r,i)})}function ht(s,e,t){var i;return te(Event)&&te(CustomEvent)?i=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(e,!0,!0,t)),s.dispatchEvent(i)}function wo(s){var e=s.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var _s=Fe.location,ac=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function $n(s){var e=s.match(ac);return e!==null&&(e[1]!==_s.protocol||e[2]!==_s.hostname||e[3]!==_s.port)}function Hn(s){var e="timestamp=".concat(new Date().getTime());return s+(s.indexOf("?")===-1?"?":"&")+e}function Ht(s){var e=s.rotate,t=s.scaleX,i=s.scaleY,r=s.translateX,n=s.translateY,a=[];O(r)&&r!==0&&a.push("translateX(".concat(r,"px)")),O(n)&&n!==0&&a.push("translateY(".concat(n,"px)")),O(e)&&e!==0&&a.push("rotate(".concat(e,"deg)")),O(t)&&t!==1&&a.push("scaleX(".concat(t,")")),O(i)&&i!==1&&a.push("scaleY(".concat(i,")"));var o=a.length?a.join(" "):"none";return{WebkitTransform:o,msTransform:o,transform:o}}function oc(s){var e=ao({},s),t=0;return G(s,function(i,r){delete e[r],G(e,function(n){var a=Math.abs(i.startX-n.startX),o=Math.abs(i.startY-n.startY),l=Math.abs(i.endX-n.endX),c=Math.abs(i.endY-n.endY),u=Math.sqrt(a*a+o*o),h=Math.sqrt(l*l+c*c),p=(h-u)/u;Math.abs(p)>Math.abs(t)&&(t=p)})}),t}function yi(s,e){var t=s.pageX,i=s.pageY,r={endX:t,endY:i};return e?r:ao({startX:t,startY:i},r)}function lc(s){var e=0,t=0,i=0;return G(s,function(r){var n=r.startX,a=r.startY;e+=n,t+=a,i+=1}),e/=i,t/=i,{pageX:e,pageY:t}}function De(s){var e=s.aspectRatio,t=s.height,i=s.width,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",n=zn(i),a=zn(t);if(n&&a){var o=t*e;r==="contain"&&o>i||r==="cover"&&o<i?t=i/e:i=t*e}else n?t=i/e:a&&(i=t*e);return{width:i,height:t}}function dc(s){var e=s.width,t=s.height,i=s.degree;if(i=Math.abs(i)%180,i===90)return{width:t,height:e};var r=i%90*Math.PI/180,n=Math.sin(r),a=Math.cos(r),o=e*a+t*n,l=e*n+t*a;return i>90?{width:l,height:o}:{width:o,height:l}}function cc(s,e,t,i){var r=e.aspectRatio,n=e.naturalWidth,a=e.naturalHeight,o=e.rotate,l=o===void 0?0:o,c=e.scaleX,u=c===void 0?1:c,h=e.scaleY,p=h===void 0?1:h,m=t.aspectRatio,y=t.naturalWidth,b=t.naturalHeight,S=i.fillColor,F=S===void 0?"transparent":S,_=i.imageSmoothingEnabled,T=_===void 0?!0:_,R=i.imageSmoothingQuality,P=R===void 0?"low":R,v=i.maxWidth,w=v===void 0?1/0:v,M=i.maxHeight,N=M===void 0?1/0:M,I=i.minWidth,U=I===void 0?0:I,$=i.minHeight,A=$===void 0?0:$,H=document.createElement("canvas"),z=H.getContext("2d"),J=De({aspectRatio:m,width:w,height:N}),re=De({aspectRatio:m,width:U,height:A},"cover"),se=Math.min(J.width,Math.max(re.width,y)),ae=Math.min(J.height,Math.max(re.height,b)),Et=De({aspectRatio:r,width:w,height:N}),Pt=De({aspectRatio:r,width:U,height:A},"cover"),li=Math.min(Et.width,Math.max(Pt.width,n)),di=Math.min(Et.height,Math.max(Pt.height,a)),ci=[-li/2,-di/2,li,di];return H.width=ct(se),H.height=ct(ae),z.fillStyle=F,z.fillRect(0,0,se,ae),z.save(),z.translate(se/2,ae/2),z.rotate(l*Math.PI/180),z.scale(u,p),z.imageSmoothingEnabled=T,z.imageSmoothingQuality=P,z.drawImage.apply(z,[s].concat(lo(ci.map(function(Ur){return Math.floor(ct(Ur))})))),z.restore(),H}var So=String.fromCharCode;function hc(s,e,t){var i="";t+=e;for(var r=e;r<t;r+=1)i+=So(s.getUint8(r));return i}var uc=/^data:.*,/;function pc(s){var e=s.replace(uc,""),t=atob(e),i=new ArrayBuffer(t.length),r=new Uint8Array(i);return G(r,function(n,a){r[a]=t.charCodeAt(a)}),i}function fc(s,e){for(var t=[],i=8192,r=new Uint8Array(s);r.length>0;)t.push(So.apply(null,yo(r.subarray(0,i)))),r=r.subarray(i);return"data:".concat(e,";base64,").concat(btoa(t.join("")))}function mc(s){var e=new DataView(s),t;try{var i,r,n;if(e.getUint8(0)===255&&e.getUint8(1)===216)for(var a=e.byteLength,o=2;o+1<a;){if(e.getUint8(o)===255&&e.getUint8(o+1)===225){r=o;break}o+=1}if(r){var l=r+4,c=r+10;if(hc(e,l,4)==="Exif"){var u=e.getUint16(c);if(i=u===18761,(i||u===19789)&&e.getUint16(c+2,i)===42){var h=e.getUint32(c+4,i);h>=8&&(n=c+h)}}}if(n){var p=e.getUint16(n,i),m,y;for(y=0;y<p;y+=1)if(m=n+y*12+2,e.getUint16(m,i)===274){m+=8,t=e.getUint16(m,i),e.setUint16(m,1,i);break}}}catch{t=1}return t}function gc(s){var e=0,t=1,i=1;switch(s){case 2:t=-1;break;case 3:e=-180;break;case 4:i=-1;break;case 5:e=90,i=-1;break;case 6:e=90;break;case 7:e=90,t=-1;break;case 8:e=-90;break}return{rotate:e,scaleX:t,scaleY:i}}var yc={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,t=this.options,i=this.container,r=this.cropper,n=Number(t.minContainerWidth),a=Number(t.minContainerHeight);Y(r,ie),_e(e,ie);var o={width:Math.max(i.offsetWidth,n>=0?n:mo),height:Math.max(i.offsetHeight,a>=0?a:go)};this.containerData=o,Oe(r,{width:o.width,height:o.height}),Y(e,ie),_e(r,ie)},initCanvas:function(){var e=this.containerData,t=this.imageData,i=this.options.viewMode,r=Math.abs(t.rotate)%180===90,n=r?t.naturalHeight:t.naturalWidth,a=r?t.naturalWidth:t.naturalHeight,o=n/a,l=e.width,c=e.height;e.height*o>e.width?i===3?l=e.height*o:c=e.width/o:i===3?c=e.width/o:l=e.height*o;var u={aspectRatio:o,naturalWidth:n,naturalHeight:a,width:l,height:c};this.canvasData=u,this.limited=i===1||i===2,this.limitCanvas(!0,!0),u.width=Math.min(Math.max(u.width,u.minWidth),u.maxWidth),u.height=Math.min(Math.max(u.height,u.minHeight),u.maxHeight),u.left=(e.width-u.width)/2,u.top=(e.height-u.height)/2,u.oldLeft=u.left,u.oldTop=u.top,this.initialCanvasData=V({},u)},limitCanvas:function(e,t){var i=this.options,r=this.containerData,n=this.canvasData,a=this.cropBoxData,o=i.viewMode,l=n.aspectRatio,c=this.cropped&&a;if(e){var u=Number(i.minCanvasWidth)||0,h=Number(i.minCanvasHeight)||0;o>1?(u=Math.max(u,r.width),h=Math.max(h,r.height),o===3&&(h*l>u?u=h*l:h=u/l)):o>0&&(u?u=Math.max(u,c?a.width:0):h?h=Math.max(h,c?a.height:0):c&&(u=a.width,h=a.height,h*l>u?u=h*l:h=u/l));var p=De({aspectRatio:l,width:u,height:h});u=p.width,h=p.height,n.minWidth=u,n.minHeight=h,n.maxWidth=1/0,n.maxHeight=1/0}if(t)if(o>(c?0:1)){var m=r.width-n.width,y=r.height-n.height;n.minLeft=Math.min(0,m),n.minTop=Math.min(0,y),n.maxLeft=Math.max(0,m),n.maxTop=Math.max(0,y),c&&this.limited&&(n.minLeft=Math.min(a.left,a.left+(a.width-n.width)),n.minTop=Math.min(a.top,a.top+(a.height-n.height)),n.maxLeft=a.left,n.maxTop=a.top,o===2&&(n.width>=r.width&&(n.minLeft=Math.min(0,m),n.maxLeft=Math.max(0,m)),n.height>=r.height&&(n.minTop=Math.min(0,y),n.maxTop=Math.max(0,y))))}else n.minLeft=-n.width,n.minTop=-n.height,n.maxLeft=r.width,n.maxTop=r.height},renderCanvas:function(e,t){var i=this.canvasData,r=this.imageData;if(t){var n=dc({width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0}),a=n.width,o=n.height,l=i.width*(a/i.naturalWidth),c=i.height*(o/i.naturalHeight);i.left-=(l-i.width)/2,i.top-=(c-i.height)/2,i.width=l,i.height=c,i.aspectRatio=a/o,i.naturalWidth=a,i.naturalHeight=o,this.limitCanvas(!0,!1)}(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCanvas(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,Oe(this.canvas,V({width:i.width,height:i.height},Ht({translateX:i.left,translateY:i.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var t=this.canvasData,i=this.imageData,r=i.naturalWidth*(t.width/t.naturalWidth),n=i.naturalHeight*(t.height/t.naturalHeight);V(i,{width:r,height:n,left:(t.width-r)/2,top:(t.height-n)/2}),Oe(this.image,V({width:i.width,height:i.height},Ht(V({translateX:i.left,translateY:i.top},i)))),e&&this.output()},initCropBox:function(){var e=this.options,t=this.canvasData,i=e.aspectRatio||e.initialAspectRatio,r=Number(e.autoCropArea)||.8,n={width:t.width,height:t.height};i&&(t.height*i>t.width?n.height=n.width/i:n.width=n.height*i),this.cropBoxData=n,this.limitCropBox(!0,!0),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),n.width=Math.max(n.minWidth,n.width*r),n.height=Math.max(n.minHeight,n.height*r),n.left=t.left+(t.width-n.width)/2,n.top=t.top+(t.height-n.height)/2,n.oldLeft=n.left,n.oldTop=n.top,this.initialCropBoxData=V({},n)},limitCropBox:function(e,t){var i=this.options,r=this.containerData,n=this.canvasData,a=this.cropBoxData,o=this.limited,l=i.aspectRatio;if(e){var c=Number(i.minCropBoxWidth)||0,u=Number(i.minCropBoxHeight)||0,h=o?Math.min(r.width,n.width,n.width+n.left,r.width-n.left):r.width,p=o?Math.min(r.height,n.height,n.height+n.top,r.height-n.top):r.height;c=Math.min(c,r.width),u=Math.min(u,r.height),l&&(c&&u?u*l>c?u=c/l:c=u*l:c?u=c/l:u&&(c=u*l),p*l>h?p=h/l:h=p*l),a.minWidth=Math.min(c,h),a.minHeight=Math.min(u,p),a.maxWidth=h,a.maxHeight=p}t&&(o?(a.minLeft=Math.max(0,n.left),a.minTop=Math.max(0,n.top),a.maxLeft=Math.min(r.width,n.left+n.width)-a.width,a.maxTop=Math.min(r.height,n.top+n.height)-a.height):(a.minLeft=0,a.minTop=0,a.maxLeft=r.width-a.width,a.maxTop=r.height-a.height))},renderCropBox:function(){var e=this.options,t=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,e.movable&&e.cropBoxMovable&&Gt(this.face,Wt,i.width>=t.width&&i.height>=t.height?ho:xr),Oe(this.cropBox,V({width:i.width,height:i.height},Ht({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),ht(this.element,ir,this.getData())}},vc={initPreview:function(){var e=this.element,t=this.crossOrigin,i=this.options.preview,r=t?this.crossOriginUrl:this.url,n=e.alt||"The image to preview",a=document.createElement("img");if(t&&(a.crossOrigin=t),a.src=r,a.alt=n,this.viewBox.appendChild(a),this.viewBoxImage=a,!!i){var o=i;typeof i=="string"?o=e.ownerDocument.querySelectorAll(i):i.querySelector&&(o=[i]),this.previews=o,G(o,function(l){var c=document.createElement("img");Gt(l,gi,{width:l.offsetWidth,height:l.offsetHeight,html:l.innerHTML}),t&&(c.crossOrigin=t),c.src=r,c.alt=n,c.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',l.innerHTML="",l.appendChild(c)})}},resetPreview:function(){G(this.previews,function(e){var t=or(e,gi);Oe(e,{width:t.width,height:t.height}),e.innerHTML=t.html,nc(e,gi)})},preview:function(){var e=this.imageData,t=this.canvasData,i=this.cropBoxData,r=i.width,n=i.height,a=e.width,o=e.height,l=i.left-t.left-e.left,c=i.top-t.top-e.top;!this.cropped||this.disabled||(Oe(this.viewBoxImage,V({width:a,height:o},Ht(V({translateX:-l,translateY:-c},e)))),G(this.previews,function(u){var h=or(u,gi),p=h.width,m=h.height,y=p,b=m,S=1;r&&(S=p/r,b=n*S),n&&b>m&&(S=m/n,y=r*S,b=m),Oe(u,{width:y,height:b}),Oe(u.getElementsByTagName("img")[0],V({width:a*S,height:o*S},Ht(V({translateX:-l*S,translateY:-c*S},e))))}))}},bc={bind:function(){var e=this.element,t=this.options,i=this.cropper;te(t.cropstart)&&ne(e,nr,t.cropstart),te(t.cropmove)&&ne(e,rr,t.cropmove),te(t.cropend)&&ne(e,sr,t.cropend),te(t.crop)&&ne(e,ir,t.crop),te(t.zoom)&&ne(e,ar,t.zoom),ne(i,An,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&ne(i,Un,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&ne(i,kn,this.onDblclick=this.dblclick.bind(this)),ne(e.ownerDocument,On,this.onCropMove=this.cropMove.bind(this)),ne(e.ownerDocument,Dn,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&ne(window,In,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,i=this.cropper;te(t.cropstart)&&oe(e,nr,t.cropstart),te(t.cropmove)&&oe(e,rr,t.cropmove),te(t.cropend)&&oe(e,sr,t.cropend),te(t.crop)&&oe(e,ir,t.crop),te(t.zoom)&&oe(e,ar,t.zoom),oe(i,An,this.onCropStart),t.zoomable&&t.zoomOnWheel&&oe(i,Un,this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&oe(i,kn,this.onDblclick),oe(e.ownerDocument,On,this.onCropMove),oe(e.ownerDocument,Dn,this.onCropEnd),t.responsive&&oe(window,In,this.onResize)}},wc={resize:function(){if(!this.disabled){var e=this.options,t=this.container,i=this.containerData,r=t.offsetWidth/i.width,n=t.offsetHeight/i.height,a=Math.abs(r-1)>Math.abs(n-1)?r:n;if(a!==1){var o,l;e.restore&&(o=this.getCanvasData(),l=this.getCropBoxData()),this.render(),e.restore&&(this.setCanvasData(G(o,function(c,u){o[u]=c*a})),this.setCropBoxData(G(l,function(c,u){l[u]=c*a})))}}},dblclick:function(){this.disabled||this.options.dragMode===fo||this.setDragMode(sc(this.dragBox,er)?po:Rr)},wheel:function(e){var t=this,i=Number(this.options.wheelZoomRatio)||.1,r=1;this.disabled||(e.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){t.wheeling=!1},50),e.deltaY?r=e.deltaY>0?1:-1:e.wheelDelta?r=-e.wheelDelta/120:e.detail&&(r=e.detail>0?1:-1),this.zoom(-r*i,e)))},cropStart:function(e){var t=e.buttons,i=e.button;if(!(this.disabled||(e.type==="mousedown"||e.type==="pointerdown"&&e.pointerType==="mouse")&&(O(t)&&t!==1||O(i)&&i!==0||e.ctrlKey))){var r=this.options,n=this.pointers,a;e.changedTouches?G(e.changedTouches,function(o){n[o.identifier]=yi(o)}):n[e.pointerId||0]=yi(e),Object.keys(n).length>1&&r.zoomable&&r.zoomOnTouch?a=uo:a=or(e.target,Wt),Gd.test(a)&&ht(this.element,nr,{originalEvent:e,action:a})!==!1&&(e.preventDefault(),this.action=a,this.cropping=!1,a===co&&(this.cropping=!0,Y(this.dragBox,Di)))}},cropMove:function(e){var t=this.action;if(!(this.disabled||!t)){var i=this.pointers;e.preventDefault(),ht(this.element,rr,{originalEvent:e,action:t})!==!1&&(e.changedTouches?G(e.changedTouches,function(r){V(i[r.identifier]||{},yi(r,!0))}):V(i[e.pointerId||0]||{},yi(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,i=this.pointers;e.changedTouches?G(e.changedTouches,function(r){delete i[r.identifier]}):delete i[e.pointerId||0],t&&(e.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,ot(this.dragBox,Di,this.cropped&&this.options.modal)),ht(this.element,sr,{originalEvent:e,action:t}))}}},Sc={change:function(e){var t=this.options,i=this.canvasData,r=this.containerData,n=this.cropBoxData,a=this.pointers,o=this.action,l=t.aspectRatio,c=n.left,u=n.top,h=n.width,p=n.height,m=c+h,y=u+p,b=0,S=0,F=r.width,_=r.height,T=!0,R;!l&&e.shiftKey&&(l=h&&p?h/p:1),this.limited&&(b=n.minLeft,S=n.minTop,F=b+Math.min(r.width,i.width,i.left+i.width),_=S+Math.min(r.height,i.height,i.top+i.height));var P=a[Object.keys(a)[0]],v={x:P.endX-P.startX,y:P.endY-P.startY},w=function(N){switch(N){case Le:m+v.x>F&&(v.x=F-m);break;case ze:c+v.x<b&&(v.x=b-c);break;case xe:u+v.y<S&&(v.y=S-u);break;case rt:y+v.y>_&&(v.y=_-y);break}};switch(o){case xr:c+=v.x,u+=v.y;break;case Le:if(v.x>=0&&(m>=F||l&&(u<=S||y>=_))){T=!1;break}w(Le),h+=v.x,h<0&&(o=ze,h=-h,c-=h),l&&(p=h/l,u+=(n.height-p)/2);break;case xe:if(v.y<=0&&(u<=S||l&&(c<=b||m>=F))){T=!1;break}w(xe),p-=v.y,u+=v.y,p<0&&(o=rt,p=-p,u-=p),l&&(h=p*l,c+=(n.width-h)/2);break;case ze:if(v.x<=0&&(c<=b||l&&(u<=S||y>=_))){T=!1;break}w(ze),h-=v.x,c+=v.x,h<0&&(o=Le,h=-h,c-=h),l&&(p=h/l,u+=(n.height-p)/2);break;case rt:if(v.y>=0&&(y>=_||l&&(c<=b||m>=F))){T=!1;break}w(rt),p+=v.y,p<0&&(o=xe,p=-p,u-=p),l&&(h=p*l,c+=(n.width-h)/2);break;case xt:if(l){if(v.y<=0&&(u<=S||m>=F)){T=!1;break}w(xe),p-=v.y,u+=v.y,h=p*l}else w(xe),w(Le),v.x>=0?m<F?h+=v.x:v.y<=0&&u<=S&&(T=!1):h+=v.x,v.y<=0?u>S&&(p-=v.y,u+=v.y):(p-=v.y,u+=v.y);h<0&&p<0?(o=kt,p=-p,h=-h,u-=p,c-=h):h<0?(o=Rt,h=-h,c-=h):p<0&&(o=Mt,p=-p,u-=p);break;case Rt:if(l){if(v.y<=0&&(u<=S||c<=b)){T=!1;break}w(xe),p-=v.y,u+=v.y,h=p*l,c+=n.width-h}else w(xe),w(ze),v.x<=0?c>b?(h-=v.x,c+=v.x):v.y<=0&&u<=S&&(T=!1):(h-=v.x,c+=v.x),v.y<=0?u>S&&(p-=v.y,u+=v.y):(p-=v.y,u+=v.y);h<0&&p<0?(o=Mt,p=-p,h=-h,u-=p,c-=h):h<0?(o=xt,h=-h,c-=h):p<0&&(o=kt,p=-p,u-=p);break;case kt:if(l){if(v.x<=0&&(c<=b||y>=_)){T=!1;break}w(ze),h-=v.x,c+=v.x,p=h/l}else w(rt),w(ze),v.x<=0?c>b?(h-=v.x,c+=v.x):v.y>=0&&y>=_&&(T=!1):(h-=v.x,c+=v.x),v.y>=0?y<_&&(p+=v.y):p+=v.y;h<0&&p<0?(o=xt,p=-p,h=-h,u-=p,c-=h):h<0?(o=Mt,h=-h,c-=h):p<0&&(o=Rt,p=-p,u-=p);break;case Mt:if(l){if(v.x>=0&&(m>=F||y>=_)){T=!1;break}w(Le),h+=v.x,p=h/l}else w(rt),w(Le),v.x>=0?m<F?h+=v.x:v.y>=0&&y>=_&&(T=!1):h+=v.x,v.y>=0?y<_&&(p+=v.y):p+=v.y;h<0&&p<0?(o=Rt,p=-p,h=-h,u-=p,c-=h):h<0?(o=kt,h=-h,c-=h):p<0&&(o=xt,p=-p,u-=p);break;case ho:this.move(v.x,v.y),T=!1;break;case uo:this.zoom(oc(a),e),T=!1;break;case co:if(!v.x||!v.y){T=!1;break}R=wo(this.cropper),c=P.startX-R.left,u=P.startY-R.top,h=n.minWidth,p=n.minHeight,v.x>0?o=v.y>0?Mt:xt:v.x<0&&(c-=h,o=v.y>0?kt:Rt),v.y<0&&(u-=p),this.cropped||(_e(this.cropBox,ie),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}T&&(n.width=h,n.height=p,n.left=c,n.top=u,this.action=o,this.renderCropBox()),G(a,function(M){M.startX=M.endX,M.startY=M.endY})}},_c={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Y(this.dragBox,Di),_e(this.cropBox,ie),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=V({},this.initialImageData),this.canvasData=V({},this.initialCanvasData),this.cropBoxData=V({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(V(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),_e(this.dragBox,Di),Y(this.cropBox,ie)),this},replace:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,G(this.previews,function(i){i.getElementsByTagName("img")[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,_e(this.cropper,Rn)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Y(this.cropper,Rn)),this},destroy:function(){var e=this.element;return e[q]?(e[q]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,i=this.canvasData,r=i.left,n=i.top;return this.moveTo(Ss(e)?e:r+Number(e),Ss(t)?t:n+Number(t))},moveTo:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,i=this.canvasData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(O(e)&&(i.left=e,r=!0),O(t)&&(i.top=t,r=!0),r&&this.renderCanvas(!0)),this},zoom:function(e,t){var i=this.canvasData;return e=Number(e),e<0?e=1/(1-e):e=1+e,this.zoomTo(i.width*e/i.naturalWidth,null,t)},zoomTo:function(e,t,i){var r=this.options,n=this.canvasData,a=n.width,o=n.height,l=n.naturalWidth,c=n.naturalHeight;if(e=Number(e),e>=0&&this.ready&&!this.disabled&&r.zoomable){var u=l*e,h=c*e;if(ht(this.element,ar,{ratio:e,oldRatio:a/l,originalEvent:i})===!1)return this;if(i){var p=this.pointers,m=wo(this.cropper),y=p&&Object.keys(p).length?lc(p):{pageX:i.pageX,pageY:i.pageY};n.left-=(u-a)*((y.pageX-m.left-n.left)/a),n.top-=(h-o)*((y.pageY-m.top-n.top)/o)}else at(t)&&O(t.x)&&O(t.y)?(n.left-=(u-a)*((t.x-n.left)/a),n.top-=(h-o)*((t.y-n.top)/o)):(n.left-=(u-a)/2,n.top-=(h-o)/2);n.width=u,n.height=h,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return e=Number(e),O(e)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,O(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(O(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,i=this.imageData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(O(e)&&(i.scaleX=e,r=!0),O(t)&&(i.scaleY=t,r=!0),r&&this.renderCanvas(!0,!0)),this},getData:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.options,i=this.imageData,r=this.canvasData,n=this.cropBoxData,a;if(this.ready&&this.cropped){a={x:n.left-r.left,y:n.top-r.top,width:n.width,height:n.height};var o=i.width/i.naturalWidth;if(G(a,function(u,h){a[h]=u/o}),e){var l=Math.round(a.y+a.height),c=Math.round(a.x+a.width);a.x=Math.round(a.x),a.y=Math.round(a.y),a.width=c-a.x,a.height=l-a.y}}else a={x:0,y:0,width:0,height:0};return t.rotatable&&(a.rotate=i.rotate||0),t.scalable&&(a.scaleX=i.scaleX||1,a.scaleY=i.scaleY||1),a},setData:function(e){var t=this.options,i=this.imageData,r=this.canvasData,n={};if(this.ready&&!this.disabled&&at(e)){var a=!1;t.rotatable&&O(e.rotate)&&e.rotate!==i.rotate&&(i.rotate=e.rotate,a=!0),t.scalable&&(O(e.scaleX)&&e.scaleX!==i.scaleX&&(i.scaleX=e.scaleX,a=!0),O(e.scaleY)&&e.scaleY!==i.scaleY&&(i.scaleY=e.scaleY,a=!0)),a&&this.renderCanvas(!0,!0);var o=i.width/i.naturalWidth;O(e.x)&&(n.left=e.x*o+r.left),O(e.y)&&(n.top=e.y*o+r.top),O(e.width)&&(n.width=e.width*o),O(e.height)&&(n.height=e.height*o),this.setCropBoxData(n)}return this},getContainerData:function(){return this.ready?V({},this.containerData):{}},getImageData:function(){return this.sized?V({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&G(["left","top","width","height","naturalWidth","naturalHeight"],function(i){t[i]=e[i]}),t},setCanvasData:function(e){var t=this.canvasData,i=t.aspectRatio;return this.ready&&!this.disabled&&at(e)&&(O(e.left)&&(t.left=e.left),O(e.top)&&(t.top=e.top),O(e.width)?(t.width=e.width,t.height=e.width/i):O(e.height)&&(t.height=e.height,t.width=e.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var e=this.cropBoxData,t;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(e){var t=this.cropBoxData,i=this.options.aspectRatio,r,n;return this.ready&&this.cropped&&!this.disabled&&at(e)&&(O(e.left)&&(t.left=e.left),O(e.top)&&(t.top=e.top),O(e.width)&&e.width!==t.width&&(r=!0,t.width=e.width),O(e.height)&&e.height!==t.height&&(n=!0,t.height=e.height),i&&(r?t.height=t.width/i:n&&(t.width=t.height*i)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,i=cc(this.image,this.imageData,t,e);if(!this.cropped)return i;var r=this.getData(e.rounded),n=r.x,a=r.y,o=r.width,l=r.height,c=i.width/Math.floor(t.naturalWidth);c!==1&&(n*=c,a*=c,o*=c,l*=c);var u=o/l,h=De({aspectRatio:u,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),p=De({aspectRatio:u,width:e.minWidth||0,height:e.minHeight||0},"cover"),m=De({aspectRatio:u,width:e.width||(c!==1?i.width:o),height:e.height||(c!==1?i.height:l)}),y=m.width,b=m.height;y=Math.min(h.width,Math.max(p.width,y)),b=Math.min(h.height,Math.max(p.height,b));var S=document.createElement("canvas"),F=S.getContext("2d");S.width=ct(y),S.height=ct(b),F.fillStyle=e.fillColor||"transparent",F.fillRect(0,0,y,b);var _=e.imageSmoothingEnabled,T=_===void 0?!0:_,R=e.imageSmoothingQuality;F.imageSmoothingEnabled=T,R&&(F.imageSmoothingQuality=R);var P=i.width,v=i.height,w=n,M=a,N,I,U,$,A,H;w<=-o||w>P?(w=0,N=0,U=0,A=0):w<=0?(U=-w,w=0,N=Math.min(P,o+w),A=N):w<=P&&(U=0,N=Math.min(o,P-w),A=N),N<=0||M<=-l||M>v?(M=0,I=0,$=0,H=0):M<=0?($=-M,M=0,I=Math.min(v,l+M),H=I):M<=v&&($=0,I=Math.min(l,v-M),H=I);var z=[w,M,N,I];if(A>0&&H>0){var J=y/o;z.push(U*J,$*J,A*J,H*J)}return F.drawImage.apply(F,[i].concat(lo(z.map(function(re){return Math.floor(ct(re))})))),S},setAspectRatio:function(e){var t=this.options;return!this.disabled&&!Ss(e)&&(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,i=this.dragBox,r=this.face;if(this.ready&&!this.disabled){var n=e===Rr,a=t.movable&&e===po;e=n||a?e:fo,t.dragMode=e,Gt(i,Wt,e),ot(i,er,n),ot(i,tr,a),t.cropBoxMovable||(Gt(r,Wt,e),ot(r,er,n),ot(r,tr,a))}return this}},Fc=Fe.Cropper,_o=(function(){function s(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Id(this,s),!e||!Kd.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=V({},Ln,at(t)&&t),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return Ud(s,[{key:"init",value:function(){var t=this.element,i=t.tagName.toLowerCase(),r;if(!t[q]){if(t[q]=this,i==="img"){if(this.isImg=!0,r=t.getAttribute("src")||"",this.originalUrl=r,!r)return;r=t.src}else i==="canvas"&&window.HTMLCanvasElement&&(r=t.toDataURL());this.load(r)}}},{key:"load",value:function(t){var i=this;if(t){this.url=t,this.imageData={};var r=this.element,n=this.options;if(!n.rotatable&&!n.scalable&&(n.checkOrientation=!1),!n.checkOrientation||!window.ArrayBuffer){this.clone();return}if(Xd.test(t)){Yd.test(t)?this.read(pc(t)):this.clone();return}var a=new XMLHttpRequest,o=this.clone.bind(this);this.reloading=!0,this.xhr=a,a.onabort=o,a.onerror=o,a.ontimeout=o,a.onprogress=function(){a.getResponseHeader("content-type")!==Bn&&a.abort()},a.onload=function(){i.read(a.response)},a.onloadend=function(){i.reloading=!1,i.xhr=null},n.checkCrossOrigin&&$n(t)&&r.crossOrigin&&(t=Hn(t)),a.open("GET",t,!0),a.responseType="arraybuffer",a.withCredentials=r.crossOrigin==="use-credentials",a.send()}}},{key:"read",value:function(t){var i=this.options,r=this.imageData,n=mc(t),a=0,o=1,l=1;if(n>1){this.url=fc(t,Bn);var c=gc(n);a=c.rotate,o=c.scaleX,l=c.scaleY}i.rotatable&&(r.rotate=a),i.scalable&&(r.scaleX=o,r.scaleY=l),this.clone()}},{key:"clone",value:function(){var t=this.element,i=this.url,r=t.crossOrigin,n=i;this.options.checkCrossOrigin&&$n(i)&&(r||(r="anonymous"),n=Hn(i)),this.crossOrigin=r,this.crossOriginUrl=n;var a=document.createElement("img");r&&(a.crossOrigin=r),a.src=n||i,a.alt=t.alt||"The image to crop",this.image=a,a.onload=this.start.bind(this),a.onerror=this.stop.bind(this),Y(a,Mn),t.parentNode.insertBefore(a,t.nextSibling)}},{key:"start",value:function(){var t=this,i=this.image;i.onload=null,i.onerror=null,this.sizing=!0;var r=Fe.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(Fe.navigator.userAgent),n=function(c,u){V(t.imageData,{naturalWidth:c,naturalHeight:u,aspectRatio:c/u}),t.initialImageData=V({},t.imageData),t.sizing=!1,t.sized=!0,t.build()};if(i.naturalWidth&&!r){n(i.naturalWidth,i.naturalHeight);return}var a=document.createElement("img"),o=document.body||document.documentElement;this.sizingImage=a,a.onload=function(){n(a.width,a.height),r||o.removeChild(a)},a.src=i.src,r||(a.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",o.appendChild(a))}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var t=this.element,i=this.options,r=this.image,n=t.parentNode,a=document.createElement("div");a.innerHTML=Jd;var o=a.querySelector(".".concat(q,"-container")),l=o.querySelector(".".concat(q,"-canvas")),c=o.querySelector(".".concat(q,"-drag-box")),u=o.querySelector(".".concat(q,"-crop-box")),h=u.querySelector(".".concat(q,"-face"));this.container=n,this.cropper=o,this.canvas=l,this.dragBox=c,this.cropBox=u,this.viewBox=o.querySelector(".".concat(q,"-view-box")),this.face=h,l.appendChild(r),Y(t,ie),n.insertBefore(o,t.nextSibling),_e(r,Mn),this.initPreview(),this.bind(),i.initialAspectRatio=Math.max(0,i.initialAspectRatio)||NaN,i.aspectRatio=Math.max(0,i.aspectRatio)||NaN,i.viewMode=Math.max(0,Math.min(3,Math.round(i.viewMode)))||0,Y(u,ie),i.guides||Y(u.getElementsByClassName("".concat(q,"-dashed")),ie),i.center||Y(u.getElementsByClassName("".concat(q,"-center")),ie),i.background&&Y(o,"".concat(q,"-bg")),i.highlight||Y(h,qd),i.cropBoxMovable&&(Y(h,tr),Gt(h,Wt,xr)),i.cropBoxResizable||(Y(u.getElementsByClassName("".concat(q,"-line")),ie),Y(u.getElementsByClassName("".concat(q,"-point")),ie)),this.render(),this.ready=!0,this.setDragMode(i.dragMode),i.autoCrop&&this.crop(),this.setData(i.data),te(i.ready)&&ne(t,Nn,i.ready,{once:!0}),ht(t,Nn)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var t=this.cropper.parentNode;t&&t.removeChild(this.cropper),_e(this.element,ie)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=Fc,s}},{key:"setDefaults",value:function(t){V(Ln,at(t)&&t)}}])})();V(_o.prototype,yc,vc,bc,wc,Sc,_c);function Tc(s,e){const t=s.width/e.width,i=s.height/e.height,r=Math.min(t,i),n=e.width*r,a=e.height*r,o=(s.width-n)/2,l=(s.height-a)/2;return{width:n,height:a,left:o,top:l}}function Cc(s){return s*(Math.PI/180)}function Ec(s,e,t){const i=Math.abs(Cc(t));return Math.max((Math.sin(i)*s+Math.cos(i)*e)/e,(Math.sin(i)*e+Math.cos(i)*s)/s)}function Pc(s,e,t){return e.left<s.left?{left:s.left,width:t.width}:e.top<s.top?{top:s.top,height:t.height}:e.left+e.width>s.left+s.width?{left:s.left+s.width-t.width,width:t.width}:e.top+e.height>s.top+s.height?{top:s.top+s.height-t.height,height:t.height}:null}function xc(s,e,t){return e.left<s.left?{left:s.left,width:t.left+t.width-s.left}:e.top<s.top?{top:s.top,height:t.top+t.height-s.top}:e.left+e.width>s.left+s.width?{left:t.left,width:s.left+s.width-t.left}:e.top+e.height>s.top+s.height?{top:t.top,height:s.top+s.height-t.top}:null}class Rc extends ee{constructor(t){super(t);f(this,"imgElement");f(this,"cropper");f(this,"onRotate90Deg",()=>{const{angle90Deg:t}=this.state,i=t-90;this.setState({angle90Deg:i,angleGranular:0}),this.cropper.scale(1),this.cropper.rotateTo(i);const r=this.cropper.getCanvasData(),n=this.cropper.getContainerData(),a=Tc(n,r);this.cropper.setCanvasData(a),this.cropper.setCropBoxData(a)});f(this,"onRotateGranular",t=>{const i=Number(t.target.value);this.setState({angleGranular:i});const{angle90Deg:r}=this.state,n=r+i;this.cropper.rotateTo(n);const a=this.cropper.getImageData(),o=Ec(a.naturalWidth,a.naturalHeight,i),l=this.cropper.getImageData().scaleX<0?-o:o;this.cropper.scale(l,o)});this.state={angle90Deg:0,angleGranular:0,prevCropboxData:null},this.storePrevCropboxData=this.storePrevCropboxData.bind(this),this.limitCropboxMovement=this.limitCropboxMovement.bind(this)}componentDidMount(){const{opts:t,storeCropperInstance:i}=this.props;this.cropper=new _o(this.imgElement,t.cropperOptions),this.imgElement.addEventListener("cropstart",this.storePrevCropboxData),this.imgElement.addEventListener("cropend",this.limitCropboxMovement),i(this.cropper)}componentWillUnmount(){this.cropper.destroy(),this.imgElement.removeEventListener("cropstart",this.storePrevCropboxData),this.imgElement.removeEventListener("cropend",this.limitCropboxMovement)}storePrevCropboxData(){this.setState({prevCropboxData:this.cropper.getCropBoxData()})}limitCropboxMovement(t){const i=this.cropper.getCanvasData(),r=this.cropper.getCropBoxData(),{prevCropboxData:n}=this.state;if(t.detail.action==="all"){const a=Pc(i,r,n);a&&this.cropper.setCropBoxData(a)}else{const a=xc(i,r,n);a&&this.cropper.setCropBoxData(a)}}renderGranularRotate(){const{i18n:t}=this.props,{angleGranular:i}=this.state;return d("label",{role:"tooltip","aria-label":`${i}º`,"data-microtip-position":"top",className:"uppy-ImageCropper-rangeWrapper",children:d("input",{className:"uppy-ImageCropper-range uppy-u-reset",type:"range",onInput:this.onRotateGranular,onChange:this.onRotateGranular,value:i,min:"-45",max:"45","aria-label":t("rotate")})})}renderRevert(){const{i18n:t,opts:i}=this.props;return d("button",{"data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":t("revert"),onClick:()=>{this.cropper.reset(),this.cropper.setAspectRatio(i.cropperOptions.initialAspectRatio),this.setState({angle90Deg:0,angleGranular:0})},children:d("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",children:[d("path",{d:"M0 0h24v24H0z",fill:"none"}),d("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})]})})}renderRotate(){const{i18n:t}=this.props;return d("button",{"data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":t("rotate"),onClick:this.onRotate90Deg,children:d("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",children:[d("path",{d:"M0 0h24v24H0V0zm0 0h24v24H0V0z",fill:"none"}),d("path",{d:"M14 10a2 2 0 012 2v7a2 2 0 01-2 2H6a2 2 0 01-2-2v-7a2 2 0 012-2h8zm0 1.75H6a.25.25 0 00-.243.193L5.75 12v7a.25.25 0 00.193.243L6 19.25h8a.25.25 0 00.243-.193L14.25 19v-7a.25.25 0 00-.193-.243L14 11.75zM12 .76V4c2.3 0 4.61.88 6.36 2.64a8.95 8.95 0 012.634 6.025L21 13a1 1 0 01-1.993.117L19 13h-.003a6.979 6.979 0 00-2.047-4.95 6.97 6.97 0 00-4.652-2.044L12 6v3.24L7.76 5 12 .76z"})]})})}renderFlip(){const{i18n:t}=this.props;return d("button",{"data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":t("flipHorizontal"),onClick:()=>this.cropper.scaleX(-this.cropper.getData().scaleX||-1),children:d("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",children:[d("path",{d:"M0 0h24v24H0z",fill:"none"}),d("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"})]})})}renderZoomIn(){const{i18n:t}=this.props;return d("button",{"data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":t("zoomIn"),onClick:()=>this.cropper.zoom(.1),children:d("svg",{"aria-hidden":"true",className:"uppy-c-icon",height:"24",viewBox:"0 0 24 24",width:"24",children:[d("path",{d:"M0 0h24v24H0V0z",fill:"none"}),d("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),d("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})]})})}renderZoomOut(){const{i18n:t}=this.props;return d("button",{"data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":t("zoomOut"),onClick:()=>this.cropper.zoom(-.1),children:d("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",children:[d("path",{d:"M0 0h24v24H0V0z",fill:"none"}),d("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})]})})}renderCropSquare(){const{i18n:t}=this.props;return d("button",{"data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":t("aspectRatioSquare"),onClick:()=>this.cropper.setAspectRatio(1),children:d("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",children:[d("path",{d:"M0 0h24v24H0z",fill:"none"}),d("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})]})})}renderCropWidescreen(){const{i18n:t}=this.props;return d("button",{"data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":t("aspectRatioLandscape"),onClick:()=>this.cropper.setAspectRatio(16/9),children:d("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",children:[d("path",{d:"M 19,4.9999992 V 17.000001 H 4.9999998 V 6.9999992 H 19 m 0,-2 H 4.9999998 c -1.0999999,0 -1.9999999,0.9000001 -1.9999999,2 V 17.000001 c 0,1.1 0.9,2 1.9999999,2 H 19 c 1.1,0 2,-0.9 2,-2 V 6.9999992 c 0,-1.0999999 -0.9,-2 -2,-2 z"}),d("path",{fill:"none",d:"M0 0h24v24H0z"})]})})}renderCropWidescreenVertical(){const{i18n:t}=this.props;return d("button",{"data-microtip-position":"top",type:"button","aria-label":t("aspectRatioPortrait"),className:"uppy-u-reset uppy-c-btn",onClick:()=>this.cropper.setAspectRatio(9/16),children:d("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",children:[d("path",{d:"M 19.000001,19 H 6.999999 V 5 h 10.000002 v 14 m 2,0 V 5 c 0,-1.0999999 -0.9,-1.9999999 -2,-1.9999999 H 6.999999 c -1.1,0 -2,0.9 -2,1.9999999 v 14 c 0,1.1 0.9,2 2,2 h 10.000002 c 1.1,0 2,-0.9 2,-2 z"}),d("path",{d:"M0 0h24v24H0z",fill:"none"})]})})}render(){const{currentImage:t,opts:i}=this.props,{actions:r}=i,n=URL.createObjectURL(t.data);return d("div",{className:"uppy-ImageCropper",children:[d("div",{className:"uppy-ImageCropper-container",children:d("img",{className:"uppy-ImageCropper-image",alt:t.name,src:n,ref:a=>{this.imgElement=a}})}),d("div",{className:"uppy-ImageCropper-controls",children:[r.revert&&this.renderRevert(),r.rotate&&this.renderRotate(),r.granularRotate&&this.renderGranularRotate(),r.flip&&this.renderFlip(),r.zoomIn&&this.renderZoomIn(),r.zoomOut&&this.renderZoomOut(),r.cropSquare&&this.renderCropSquare(),r.cropWidescreen&&this.renderCropWidescreen(),r.cropWidescreenVertical&&this.renderCropWidescreenVertical()]})]})}}const Mc={strings:{revert:"Reset",rotate:"Rotate 90°",zoomIn:"Zoom in",zoomOut:"Zoom out",flipHorizontal:"Flip horizontally",aspectRatioSquare:"Crop square",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)"}},Fo={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},To={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},kc={quality:.8,actions:To,cropperOptions:Fo};class Co extends Ie{constructor(t,i){super(t,{...kc,...i,actions:{...To,...i==null?void 0:i.actions},cropperOptions:{...Fo,...i==null?void 0:i.cropperOptions}});f(this,"cropper");f(this,"save",()=>{const t=n=>{const{currentImage:a}=this.getPluginState();this.uppy.setFileState(a.id,{data:new File([n],a.name??this.i18n("unnamed"),{type:n.type}),size:n.size,preview:void 0});const o=this.uppy.getFile(a.id);this.uppy.emit("thumbnail:request",o),this.setPluginState({currentImage:o}),this.uppy.emit("file-editor:complete",o)},{currentImage:i}=this.getPluginState(),r=this.cropper.getCroppedCanvas({});r.width%2!==0&&this.cropper.setData({width:r.width-1}),r.height%2!==0&&this.cropper.setData({height:r.height-1}),this.cropper.getCroppedCanvas(this.opts.cropperOptions.croppedCanvasOptions).toBlob(t,i.type,this.opts.quality)});f(this,"storeCropperInstance",t=>{this.cropper=t});f(this,"selectFile",t=>{this.uppy.emit("file-editor:start",t),this.setPluginState({currentImage:t})});this.id=this.opts.id||"ImageEditor",this.title="Image Editor",this.type="editor",this.defaultLocale=Mc,this.i18nInit()}canEditFile(t){if(!t.type||t.isRemote)return!1;const i=t.type.split("/")[1];return!!/^(jpe?g|gif|png|bmp|webp)$/.test(i)}install(){this.setPluginState({currentImage:null});const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){const{currentImage:t}=this.getPluginState();if(t){const i=this.uppy.getFile(t.id);this.uppy.emit("file-editor:cancel",i)}this.unmount()}render(){const{currentImage:t}=this.getPluginState();return t===null||t.isRemote?null:d(Rc,{currentImage:t,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})}}f(Co,"VERSION",Dd.version);const Ni={strings:{},pluralize(){return 0}};Ni.strings={addBulkFilesFailed:"内部错误导致添加 %{smart_count} 个文件失败",addMore:"添加更多文件",addMoreFiles:"添加更多文件",addingMoreFiles:"添加更多文件",allowAccessDescription:"为了通过您的相机进行拍照或录像,请给网站相机的访问权限",allowAccessTitle:"请允许对相机的访问权限",authenticateWith:"连接到 %{pluginName}",authenticateWithTitle:"请使用 %{pluginName} 进行认证以选择文件",back:"返回",browse:"浏览",browseFiles:"浏览",cancel:"取消",cancelUpload:"取消上传",closeModal:"关闭窗口",companionError:"和 Companion 连接失败了",companionUnauthorizeHint:"请访问 %{url} 以认证您的 %{provider} 账户",complete:"上传完毕",connectedToInternet:"连接至网络",copyLink:"复制链接",copyLinkToClipboardFallback:"复制以下网址",copyLinkToClipboardSuccess:"链接已复制到剪贴板",creatingAssembly:"正在准备上传…",creatingAssemblyFailed:"Transloadit:无法创建程序集",dashboardTitle:"文件上传工具",dashboardWindowTitle:"文件上传工具窗口(点击离开以关闭)",dataUploadedOfTotal:"%{total} / %{complete}",done:"完成",dropHint:"拖拽文件到这里",dropPasteBoth:"拖拽文件到这里,或者%{browse}文件",dropPasteFiles:"拖拽文件到这里,或者%{browse}文件",dropPasteFolders:"拖拽文件到这里,或者%{browse}文件",dropPasteImportBoth:"拖拽文件到这里,粘贴、%{browse}或者导入",dropPasteImportFiles:"拖拽文件到这里,粘贴、%{browse}或者导入",dropPasteImportFolders:"拖拽文件到这里,粘贴、%{browse}或者导入",editFile:"编辑文件",editImage:"编辑图片",editing:"正在编辑 %{file}",emptyFolderAdded:"无法从空文件夹添加文件",encoding:"正在编码…",enterCorrectUrl:"错误链接: 请确认您输入的是文件的链接",enterUrlToImport:"输入链接或者导入文件",exceedsSize:"文件超过了最大尺寸限制 %{size}",failedToFetch:"Companion 无法抓取此链接,请确保它是正确的",failedToUpload:"上传 %{file} 失败",fileSource:"文件源:%{name}",filesUploadedOfTotal:"已上传 %{smart_count} 个文件中的 %{complete} 个",filter:"筛选器",finishEditingFile:"完成文件编辑",folderAdded:"从 %{folder} 添加了 %{smart_count} 个文件",generatingThumbnails:"正在生成缩略图…",import:"导入",importFrom:"从 %{name} 导入",inferiorSize:"文件大小必须超过 %{size}",loading:"正在载入…",logOut:"登出",micDisabled:"麦克风的权限访问被用户拒绝",myDevice:"我的设备",noCameraDescription:"为了拍摄照片或录制视频,请连接一个摄像设备",noCameraTitle:"摄像头不可用",noDuplicates:"无法添加重复文件 %{fileName},该文件已存在",noFilesFound:"这里空空如也",noInternetConnection:"无法连接到网络",noMoreFilesAllowed:"无法添加新文件:已正在上传文件",openFolderNamed:"打开文件夹 %{name}",pause:"暂停",pauseUpload:"暂停上传",paused:"已暂停",poweredBy:"强力驱动于 %{uppy}",processingXFiles:"正在处理 %{smart_count} 个文件",recording:"正在录制",recordingLength:"录制长度 %{recording_length}",recordingStoppedMaxSize:"录像已停止,文件大小即将超过限制",removeFile:"删除文件",resetFilter:"重置筛选器",resume:"恢复",resumeUpload:"恢复上传",retry:"重试",retryUpload:"重试",saveChanges:"保存变更",selectFileNamed:"选择文件 %{name}",selectX:"选择 %{smart_count}",smile:"笑一笑!",startCapturing:"开始屏幕录制",startRecording:"开始视频录制",stopCapturing:"停止屏幕录制",stopRecording:"停止视频录制",streamActive:"视频流已激活",streamPassive:"视频流未激活",submitRecordedFile:"提交已录制视频",takePicture:"拍照",timedOut:"上传已超时 %{seconds} 秒,中止上传",unselectFileNamed:"取消选择文件 %{name}",upload:"上传",uploadComplete:"上传完成",uploadFailed:"上传失败",uploadPaused:"上传暂停",uploadXFiles:"上传 %{smart_count} 个文件",uploadXNewFiles:"新上传了 %{smart_count} 个文件",uploading:"正在上传",uploadingXFiles:"正在上传 %{smart_count} 个文件",xFilesSelected:"%{smart_count} 个文件待上传",xMoreFilesAdded:"又有 %{smart_count} 个文件被添加",xTimeLeft:"剩余 %{time}",youCanOnlyUploadFileTypes:"您只能上传这些文件类型:%{types}",youCanOnlyUploadX:"您只能上传 %{smart_count} 个文件",youHaveToAtLeastSelectX:"您至少要选择 %{smart_count} 个文件"};typeof Uppy<"u"&&(globalThis.Uppy.locales.zh_CN=Ni);const Ac="5.0.1",Oc={version:Ac},Dc={strings:{pluginNameScreenCapture:"Screencast",startCapturing:"Begin screen capturing",stopCapturing:"Stop screen capturing",submitRecordedFile:"Submit recorded file",streamActive:"Stream active",streamPassive:"Stream passive",micDisabled:"Microphone access denied by user",recording:"Recording",takeScreenshot:"Take Screenshot",discardMediaFile:"Discard Media"}};function Nc({onDiscard:s,i18n:e}){return d("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--discard",type:"button",title:e("discardMediaFile"),"aria-label":e("discardMediaFile"),onClick:s,"data-uppy-super-focusable":!0,children:d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[d("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),d("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}function Ic({recording:s,onStartRecording:e,onStopRecording:t,i18n:i}){return s?d("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--video uppy-ScreenCapture-button--stop-rec",type:"button",title:i("stopCapturing"),"aria-label":i("stopCapturing"),onClick:t,"data-uppy-super-focusable":!0,children:d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100",children:d("rect",{x:"15",y:"15",width:"70",height:"70"})})}):d("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--video",type:"button",title:i("startCapturing"),"aria-label":i("startCapturing"),onClick:e,"data-uppy-super-focusable":!0,children:d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:d("path",{d:"M4.5 4.5a3 3 0 0 0-3 3v9a3 3 0 0 0 3 3h8.25a3 3 0 0 0 3-3v-9a3 3 0 0 0-3-3H4.5ZM19.94 18.75l-2.69-2.69V7.94l2.69-2.69c.944-.945 2.56-.276 2.56 1.06v11.38c0 1.336-1.616 2.005-2.56 1.06Z"})})})}function Uc({onScreenshot:s,i18n:e}){return d("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--screenshot",type:"button",title:e("takeScreenshot"),"aria-label":e("takeScreenshot"),onClick:s,"data-uppy-super-focusable":!0,children:d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:[d("path",{d:"M12 9a3.75 3.75 0 1 0 0 7.5A3.75 3.75 0 0 0 12 9Z"}),d("path",{"fill-rule":"evenodd",d:"M9.344 3.071a49.52 49.52 0 0 1 5.312 0c.967.052 1.83.585 2.332 1.39l.821 1.317c.24.383.645.643 1.11.71.386.054.77.113 1.152.177 1.432.239 2.429 1.493 2.429 2.909V18a3 3 0 0 1-3 3h-15a3 3 0 0 1-3-3V9.574c0-1.416.997-2.67 2.429-2.909.382-.064.766-.123 1.151-.178a1.56 1.56 0 0 0 1.11-.71l.822-1.315a2.942 2.942 0 0 1 2.332-1.39ZM6.75 12.75a5.25 5.25 0 1 1 10.5 0 5.25 5.25 0 0 1-10.5 0Zm12-1.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z","clip-rule":"evenodd"})]})})}function Bc(s){return(s-(s%=60))/60+(s>9?":":":0")+s}class Lc extends ee{constructor(t){super(t);f(this,"wrapperStyle",{width:"100%",height:"100%",display:"flex"});f(this,"overlayStyle",{position:"absolute",width:"100%",height:"100%",background:"black",opacity:.7});f(this,"infoContainerStyle",{marginLeft:"auto",marginRight:"auto",marginTop:"auto",marginBottom:"auto",zIndex:1,color:"white"});f(this,"infotextStyle",{marginLeft:"auto",marginRight:"auto",marginBottom:"1rem",fontSize:"1.5rem"});f(this,"timeStyle",{display:"block",fontWeight:"bold",marginLeft:"auto",marginRight:"auto",fontSize:"3rem",fontFamily:"Courier New"});f(this,"timerRunning",!1);f(this,"timer");this.state={elapsedTime:0}}startTimer(){this.timerTick(),this.timerRunning=!0}resetTimer(){clearTimeout(this.timer),this.setState({elapsedTime:0}),this.timerRunning=!1}timerTick(){this.timer=setTimeout(()=>{this.setState(t=>({elapsedTime:t.elapsedTime+1})),this.timerTick()},1e3)}render(){const{recording:t,i18n:i}={...this.props},{elapsedTime:r}=this.state,n=Bc(r);return t&&!this.timerRunning&&this.startTimer(),!t&&this.timerRunning&&this.resetTimer(),t?d("div",{style:this.wrapperStyle,children:[d("div",{style:this.overlayStyle}),d("div",{style:this.infoContainerStyle,children:[d("div",{style:this.infotextStyle,children:i("recording")}),d("div",{style:this.timeStyle,children:n})]})]}):null}}function zc({streamActive:s,i18n:e}){return s?d("div",{title:e("streamActive"),className:"uppy-ScreenCapture-icon--stream uppy-ScreenCapture-icon--streamActive",children:d("svg",{"aria-hidden":"true",focusable:"false",width:"24",height:"24",viewBox:"0 0 24 24",children:[d("path",{d:"M0 0h24v24H0z",opacity:".1",fill:"none"}),d("path",{d:"M0 0h24v24H0z",fill:"none"}),d("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"})]})}):d("div",{title:e("streamPassive"),className:"uppy-ScreenCapture-icon--stream",children:d("svg",{"aria-hidden":"true",focusable:"false",width:"24",height:"24",viewBox:"0 0 24 24",children:[d("path",{d:"M0 0h24v24H0z",opacity:".1",fill:"none"}),d("path",{d:"M0 0h24v24H0z",fill:"none"}),d("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 $c({recording:s,recordedVideo:e,onSubmit:t,capturedScreenshotUrl:i,i18n:r}){return(e||i)&&!s?d("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--submit",type:"button",title:r("submitRecordedFile"),"aria-label":r("submitRecordedFile"),onClick:t,"data-uppy-super-focusable":!0,children:d("svg",{width:"12",height:"9",viewBox:"0 0 12 9",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon",children:d("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})})}):null}class Hc extends ee{constructor(){super(...arguments);f(this,"videoElement",null)}componentWillUnmount(){const{onStop:t}=this.props;t()}render(){const{recording:t,stream:i,recordedVideo:r,enableScreenshots:n,capturedScreenshotUrl:a}=this.props,o={playsinline:!0};return(t||!r&&!t)&&(o.muted=!0,o.autoplay=!0,o.srcObject=i),r&&!t&&(o.muted=!1,o.controls=!0,o.src=r,this.videoElement&&(this.videoElement.srcObject=null)),d("div",{className:"uppy uppy-ScreenCapture-container",children:[d("div",{className:"uppy-ScreenCapture-mediaContainer",children:[d(zc,{...this.props}),a&&!t&&!r?d("div",{className:"uppy-ScreenCapture-imageContainer",children:d("img",{src:a,className:"uppy-ScreenCapture-media",alt:"screenshotPreview"})}):d("video",{ref:l=>{this.videoElement=l},className:"uppy-ScreenCapture-media",...o}),d("div",{children:d(Lc,{...this.props})})]}),d("div",{className:"uppy-ScreenCapture-buttonContainer",children:r||a?d(pe,{children:[d($c,{...this.props}),d(Nc,{...this.props})]}):d(pe,{children:[n&&!t&&d(Uc,{...this.props}),d(Ic,{...this.props})]})})]})}}function qc(){return d("svg",{className:"uppy-DashboardTab-iconScreenRec","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:d("g",{fill:"currentcolor",fillRule:"evenodd",children:[d("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"}),d("circle",{cx:"16",cy:"16",r:"2"})]})})}function Vc(){var s;return window.MediaRecorder&&((s=navigator.mediaDevices)==null?void 0:s.getDisplayMedia)}function jc(){return window.MediaRecorder&&navigator.mediaDevices}const Wc=["image/png","image/jpeg","image/webp"],Gc={displayMediaConstraints:{video:{width:1280,height:720,frameRate:{ideal:3,max:5},cursor:"motion",displaySurface:"monitor"}},userMediaConstraints:{audio:!0},preferredVideoMimeType:"video/webm",preferredImageMimeType:"image/png",enableScreenshots:!0};class Eo extends Ie{constructor(t,i){super(t,{...Gc,...i});f(this,"mediaDevices");f(this,"protocol");f(this,"icon");f(this,"streamInterrupted");f(this,"captureActive");f(this,"capturedMediaFile");f(this,"videoStream",null);f(this,"audioStream",null);f(this,"userDenied",!1);f(this,"recorder",null);f(this,"outputStream",null);f(this,"recordingChunks",null);this.mediaDevices=jc(),this.protocol=location.protocol==="https:"?"https":"http",this.id=this.opts.id||"ScreenCapture",this.type="acquirer",this.icon=qc,this.defaultLocale=Dc,this.i18nInit(),this.title=this.i18n("pluginNameScreenCapture"),this.install=this.install.bind(this),this.setPluginState=this.setPluginState.bind(this),this.render=this.render.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.startRecording=this.startRecording.bind(this),this.stopRecording=this.stopRecording.bind(this),this.submit=this.submit.bind(this),this.streamInterrupted=this.streamInactivated.bind(this),this.captureScreenshot=this.captureScreenshot.bind(this),this.discardRecordedMedia=this.discardRecordedMedia.bind(this),this.captureActive=!1,this.capturedMediaFile=null,this.setPluginState({streamActive:!1,audioStreamActive:!1,recording:!1,recordedVideo:null,screenRecError:null,capturedScreenshotUrl:null,status:"init"})}install(){if(!Vc())return this.uppy.log("Screen recorder access is not supported","warning"),null;this.setPluginState({streamActive:!1,audioStreamActive:!1,status:"init"});const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.videoStream&&this.stop(),this.unmount()}start(){return this.mediaDevices?(this.captureActive=!0,this.selectAudioStreamSource(),this.selectVideoStreamSource().then(t=>{var i;t===!1&&(i=this.parent)!=null&&i.hideAllPanels&&(this.parent.hideAllPanels(),this.captureActive=!1)})):Promise.reject(new Error("Screen recorder access not supported"))}selectVideoStreamSource(){return this.videoStream?new Promise(t=>t(this.videoStream)):this.mediaDevices.getDisplayMedia(this.opts.displayMediaConstraints).then(t=>(this.videoStream=t,this.videoStream.addEventListener("inactive",()=>{this.streamInactivated()}),this.setPluginState({streamActive:!0,status:"ready",screenRecError:null}),t)).catch(t=>(this.setPluginState({screenRecError:t,status:"error"}),this.userDenied=!0,setTimeout(()=>{this.userDenied=!1},1e3),!1))}selectAudioStreamSource(){return this.audioStream?new Promise(t=>t(this.audioStream)):this.mediaDevices.getUserMedia(this.opts.userMediaConstraints).then(t=>(this.audioStream=t,this.setPluginState({audioStreamActive:!0}),t)).catch(t=>(t.name==="NotAllowedError"&&(this.uppy.info(this.i18n("micDisabled"),"error",5e3),this.uppy.log(this.i18n("micDisabled"),"warning")),!1))}startRecording(){const t={};this.capturedMediaFile=null,this.recordingChunks=[];const{preferredVideoMimeType:i}=this.opts;this.selectVideoStreamSource().then(r=>{if(r===!1)throw new Error("No video stream available");i&&MediaRecorder.isTypeSupported(i)&&dt(i)&&(t.mimeType=i);const n=[r.getVideoTracks()[0]];this.audioStream&&n.push(this.audioStream.getAudioTracks()[0]),this.outputStream=new MediaStream(n),this.recorder=new MediaRecorder(this.outputStream,t),this.recorder.addEventListener("dataavailable",a=>{this.recordingChunks.push(a.data)}),this.recorder.start(),this.setPluginState({recording:!0,status:"recording"})}).catch(r=>{this.uppy.log(r,"error"),this.setPluginState({screenRecError:r,status:"error"})})}streamInactivated(){var r;const{recordedVideo:t,recording:i}={...this.getPluginState()};!t&&!i?((r=this.parent)!=null&&r.hideAllPanels&&this.parent.hideAllPanels(),this.setPluginState({status:"init"})):i&&(this.uppy.log("Capture stream inactive — stop recording"),this.stopRecording()),this.videoStream=null,this.audioStream=null,this.setPluginState({streamActive:!1,audioStreamActive:!1})}stopRecording(){return new Promise(i=>{this.recorder.addEventListener("stop",()=>{i()}),this.recorder.stop()}).then(()=>(this.setPluginState({recording:!1}),this.getVideo())).then(i=>{this.capturedMediaFile=i,this.setPluginState({recordedVideo:URL.createObjectURL(i.data),status:"captured"})}).then(()=>{this.recordingChunks=null,this.recorder=null},i=>{throw this.recordingChunks=null,this.recorder=null,i})}discardRecordedMedia(){const{capturedScreenshotUrl:t,recordedVideo:i}=this.getPluginState();t&&URL.revokeObjectURL(t),i&&URL.revokeObjectURL(i),this.capturedMediaFile=null,this.setPluginState({recordedVideo:null,capturedScreenshotUrl:null,status:this.getPluginState().streamActive?"ready":"init"})}submit(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(t){t.isRestriction||this.uppy.log(t,"warning")}}stop(){this.videoStream&&(this.videoStream.getVideoTracks().forEach(r=>{r.stop()}),this.videoStream.getAudioTracks().forEach(r=>{r.stop()}),this.videoStream=null),this.audioStream&&(this.audioStream.getAudioTracks().forEach(r=>{r.stop()}),this.audioStream.getVideoTracks().forEach(r=>{r.stop()}),this.audioStream=null),this.outputStream&&(this.outputStream.getAudioTracks().forEach(r=>{r.stop()}),this.outputStream.getVideoTracks().forEach(r=>{r.stop()}),this.outputStream=null);const{capturedScreenshotUrl:t,recordedVideo:i}=this.getPluginState();t&&URL.revokeObjectURL(t),i&&URL.revokeObjectURL(i),this.setPluginState({recording:!1,streamActive:!1,audioStreamActive:!1,recordedVideo:null,capturedScreenshotUrl:null,status:"init"}),this.captureActive=!1}getVideo(){const t=this.recordingChunks[0].type,i=dt(t);if(!i)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${t}"`));const r=`screencap-${Date.now()}.${i}`,n=new Blob(this.recordingChunks,{type:t}),a={source:this.id,name:r,data:new Blob([n],{type:t}),type:t};return Promise.resolve(a)}async captureScreenshot(){var t;if(!((t=this.mediaDevices)!=null&&t.getDisplayMedia))throw new Error("Screen capture is not supported");try{let i=this.videoStream;if(!i){const c=await this.selectVideoStreamSource();if(!c)throw new Error("Failed to get screen capture stream");i=c}const r=document.createElement("video");r.srcObject=i,await new Promise(c=>{r.onloadedmetadata=()=>{r.play(),c(null)}});const n=document.createElement("canvas");n.width=r.videoWidth,n.height=r.videoHeight;const a=n.getContext("2d");if(!a)throw new Error("Failed to get canvas context");a.drawImage(r,0,0,n.width,n.height);let o=this.opts.preferredImageMimeType;(!o||!Wc.includes(o))&&(this.uppy.log(`Unsupported image type "${o}", falling back to image/png`,"warning"),o="image/png");const l=1;return new Promise((c,u)=>{n.toBlob(h=>{if(!h){u(new Error("Failed to create screenshot blob"));return}const p=dt(o)||"png",m={source:this.id,name:`Screenshot ${new Date().toISOString()}.${p}`,type:o,data:h};try{this.capturedMediaFile=m;const y=URL.createObjectURL(h);this.setPluginState({capturedScreenshotUrl:y,status:"captured"}),c()}catch(y){this.getPluginState().capturedScreenshotUrl&&this.setPluginState({capturedScreenshotUrl:null}),y.isRestriction||this.uppy.log(y,"error"),u(y)}finally{r.srcObject=null,n.remove(),r.remove()}},o,l)})}catch(i){throw this.uppy.log(i,"error"),i}}render(){const t=this.getPluginState();return!t.streamActive&&!this.captureActive&&!this.userDenied&&this.start(),d(Hc,{...t,onStartRecording:this.startRecording,onStopRecording:this.stopRecording,enableScreenshots:this.opts.enableScreenshots,onScreenshot:this.captureScreenshot,onStop:this.stop,onSubmit:this.submit,i18n:this.i18n,stream:this.videoStream,onDiscard:this.discardRecordedMedia})}}f(Eo,"VERSION",Oc.version);var Fs={},Ts,qn;function Xc(){if(qn)return Ts;qn=1;function s(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return Ts=s,s.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},s.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},s.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var i=this._timeouts.shift();if(i===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),i=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},i),this._options.unref&&this._timer.unref(),!0},s.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var i=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){i._operationTimeoutCb()},i._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},s.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},s.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},s.prototype.start=s.prototype.try,s.prototype.errors=function(){return this._errors},s.prototype.attempts=function(){return this._attempts},s.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,i=0,r=0;r<this._errors.length;r++){var n=this._errors[r],a=n.message,o=(e[a]||0)+1;e[a]=o,o>=i&&(t=n,i=o)}return t},Ts}var Vn;function Yc(){return Vn||(Vn=1,(function(s){var e=Xc();s.operation=function(t){var i=s.timeouts(t);return new e(i,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})},s.timeouts=function(t){if(t instanceof Array)return[].concat(t);var i={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)i[r]=t[r];if(i.minTimeout>i.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],a=0;a<i.retries;a++)n.push(this.createTimeout(a,i));return t&&t.forever&&!n.length&&n.push(this.createTimeout(a,i)),n.sort(function(o,l){return o-l}),n},s.createTimeout=function(t,i){var r=i.randomize?Math.random()+1:1,n=Math.round(r*Math.max(i.minTimeout,1)*Math.pow(i.factor,t));return n=Math.min(n,i.maxTimeout),n},s.wrap=function(t,i,r){if(i instanceof Array&&(r=i,i=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var a=0;a<r.length;a++){var o=r[a],l=t[o];t[o]=(function(u){var h=s.operation(i),p=Array.prototype.slice.call(arguments,1),m=p.pop();p.push(function(y){h.retry(y)||(y&&(arguments[0]=h.mainError()),m.apply(this,arguments))}),h.attempt(function(){u.apply(t,p)})}).bind(t,l),t[o].options=i}}})(Fs)),Fs}var Cs,jn;function Kc(){return jn||(jn=1,Cs=Yc()),Cs}var Jc=Kc();const Qc=st(Jc),Zc=Object.prototype.toString,eh=s=>Zc.call(s)==="[object Error]",th=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function ih(s){if(!(s&&eh(s)&&s.name==="TypeError"&&typeof s.message=="string"))return!1;const{message:t,stack:i}=s;return t==="Load failed"?i===void 0||"__sentry_captured__"in s:t.startsWith("error sending request for url")?!0:th.has(t)}class lr extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}}const Wn=(s,e,t)=>{const i=t.retries-(e-1);return s.attemptNumber=e,s.retriesLeft=i,s};async function Gn(s,e){return new Promise((t,i)=>{e={...e},e.onFailedAttempt??(e.onFailedAttempt=()=>{}),e.shouldRetry??(e.shouldRetry=()=>!0),e.retries??(e.retries=10);const r=Qc.operation(e),n=()=>{var o;r.stop(),i((o=e.signal)==null?void 0:o.reason)};e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",n,{once:!0});const a=()=>{var o;(o=e.signal)==null||o.removeEventListener("abort",n),r.stop()};r.attempt(async o=>{try{const l=await s(o);a(),t(l)}catch(l){try{if(!(l instanceof Error))throw new TypeError(`Non-error was thrown: "${l}". You should only throw errors.`);if(l instanceof lr)throw l.originalError;if(l instanceof TypeError&&!ih(l))throw l;if(Wn(l,o,e),await e.shouldRetry(l)||(r.stop(),i(l)),await e.onFailedAttempt(l),!r.retry(l))throw r.mainError()}catch(c){Wn(c,o,e),a(),i(c)}}})})}const sh="5.1.0",rh={version:sh};class nh extends Error{constructor(){super("Authorization required");f(this,"isAuthError");this.name="AuthError",this.isAuthError=!0}}function ah(s){return s.replace(/\/$/,"")}const Xn=10,oh=300*1e3,lh=401;class dh extends Error{constructor({statusCode:t,message:i}){super(i);f(this,"statusCode");this.name="HttpError",this.statusCode=t}}async function ch(s){if(s.status===lh)throw new nh;if(s.ok)return s.json();let e=`Failed request with status: ${s.status}. ${s.statusText}`,t;try{t=await s.json(),t.message&&(e=`${e} message: ${t.message}`),t.requestId&&(e=`${e} request-Id: ${t.requestId}`)}catch(i){throw new Error(e,{cause:i})}throw s.status>=400&&s.status<=499&&t.message?new Il(t.message):new dh({statusCode:s.status,message:e})}function hh(s,e,t){const{progress:i,bytesUploaded:r,bytesTotal:n}=e;i&&(s.uppy.log(`Upload progress: ${i}`),s.uppy.emit("upload-progress",t,{uploadStarted:t.progress.uploadStarted??0,bytesUploaded:r,bytesTotal:n}))}var Je,Ue,dr,Hi,cr;class Po{constructor(e,t){E(this,Ue);E(this,Je);f(this,"uppy");f(this,"opts");E(this,Hi,async({file:e,postBody:t,signal:i})=>{var n;if(((n=e.remote)==null?void 0:n.url)==null)throw new Error("Cannot connect to an undefined URL");return(await this.post(e.remote.url,{...e.remote.body,...t},{signal:i})).token});this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),k(this,Je,t.companionHeaders)}setCompanionHeaders(e){k(this,Je,e)}[Symbol.for("uppy test: getCompanionHeaders")](){return g(this,Je)}get hostname(){const{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return ah(e!=null&&e[t]?e[t]:t)}async headers(e=!1){return{...{Accept:"application/json",...e?void 0:{"Content-Type":"application/json"}},...g(this,Je)}}onReceiveResponse(e){const{headers:t}=e,r=this.uppy.getState().companion||{},n=this.opts.companionUrl;t.has("i-am")&&t.get("i-am")!==r[n]&&this.uppy.setState({companion:{...r,[n]:t.get("i-am")}})}async request({path:e,method:t="GET",data:i,skipPostResponse:r,signal:n}){try{const a=await this.headers(!i),o=await fl(C(this,Ue,dr).call(this,e),{method:t,signal:n,headers:a,credentials:this.opts.companionCookiesRule||"same-origin",body:i?JSON.stringify(i):null});return r||this.onReceiveResponse(o),await ch(o)}catch(a){throw a.isAuthError||a.name==="UserFacingApiError"||a.name==="AbortError"?a:new hl(`Could not ${t} ${C(this,Ue,dr).call(this,e)}`,{cause:a})}}async get(e,t){return this.request({...t,path:e})}async post(e,t,i){return this.request({...i,path:e,method:"POST",data:t})}async delete(e,t,i){return this.request({...i,path:e,method:"DELETE",data:t})}async uploadRemoteFile(e,t,i){try{const{signal:r,getQueue:n}=i||{};return await Gn(async()=>{var c;const a=(c=this.uppy.getFile(e.id))==null?void 0:c.serverToken;if(a!=null)return this.uppy.log(`Connecting to exiting websocket ${a}`),C(this,Ue,cr).call(this,{file:e,queue:n(),signal:r});const l=await n().wrapPromiseFunction(async(...u)=>{try{return await g(this,Hi).call(this,...u)}catch(h){if(h.isAuthError)throw new lr(h);if(h.cause==null)throw h;const p=h.cause,m=()=>[408,409,429,418,423].includes(p.statusCode)||p.statusCode>=500&&p.statusCode<=599&&![501,505].includes(p.statusCode);throw p.name==="HttpError"&&!m()?new lr(p):p}},{priority:-1})({file:e,postBody:t,signal:r}).abortOn(r);if(this.uppy.getFile(e.id))return this.uppy.setFileState(e.id,{serverToken:l}),C(this,Ue,cr).call(this,{file:this.uppy.getFile(e.id),queue:n(),signal:r})},{retries:Xn,signal:r,onFailedAttempt:a=>this.uppy.log(`Retrying upload due to: ${a.message}`,"warning")})}catch(r){if(r.name==="AbortError")return;throw this.uppy.emit("upload-error",e,r),r}}}Je=new WeakMap,Ue=new WeakSet,dr=function(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`},Hi=new WeakMap,cr=async function({file:e,queue:t,signal:i}){let r;const{capabilities:n}=this.uppy.getState();try{return await new Promise((a,o)=>{const l=e.serverToken,c=El(e.remote.companionUrl);let u,h,p,{isPaused:m}=e;const y=(w,M)=>{if(u==null||u.readyState!==u.OPEN){this.uppy.log(`Cannot send "${w}" to socket ${e.id} because the socket state was ${String(u==null?void 0:u.readyState)}`,"warning");return}u.send(JSON.stringify({action:w,payload:M??{}}))};function b(){n.resumableUploads&&y(m?"pause":"resume")}const S=async()=>{h&&h.abort(),h=new AbortController;const w=N=>{var I;this.uppy.setFileState(e.id,{serverToken:null}),(I=h==null?void 0:h.abort)==null||I.call(h),o(N)};function M(){clearTimeout(p),!m&&(p=setTimeout(()=>w(new Error("Timeout waiting for message from Companion socket")),oh))}try{await t.wrapPromiseFunction(async()=>{await Gn(async()=>new Promise((I,U)=>{u=new WebSocket(`${c}/api/${l}`),M(),u.addEventListener("close",()=>{u=void 0,U(new Error("Socket closed unexpectedly"))}),u.addEventListener("error",A=>{this.uppy.log(`Companion socket error ${JSON.stringify(A)}, closing socket`,"warning"),u==null||u.close()}),u.addEventListener("open",()=>{b()}),u.addEventListener("message",A=>{var H,z,J;M();try{const{action:re,payload:se}=JSON.parse(A.data);switch(re){case"progress":{hh(this,se,this.uppy.getFile(e.id));break}case"success":{const ae=(H=se.response)==null?void 0:H.responseText;this.uppy.emit("upload-success",this.uppy.getFile(e.id),{uploadURL:se.url,status:((z=se.response)==null?void 0:z.status)??200,body:ae?JSON.parse(ae):void 0}),(J=h==null?void 0:h.abort)==null||J.call(h),a();break}case"error":{const{message:ae}=se.error;throw Object.assign(new Error(ae),{cause:se.error})}default:this.uppy.log(`Companion socket unknown action ${re}`,"warning")}}catch(re){w(re)}});const $=()=>{this.uppy.log(`Closing socket ${e.id}`),clearTimeout(p),u&&u.close(),u=void 0};h.signal.addEventListener("abort",()=>{$()})}),{retries:Xn,signal:h.signal,onFailedAttempt:()=>{h.signal.aborted||this.uppy.log(`Retrying websocket ${e.id}`)}})})().abortOn(h.signal)}catch(N){if(h.signal.aborted)return;w(N)}},F=w=>{n.resumableUploads&&(m=w,u&&b())},_=w=>{var M;n.individualCancellation&&w.id===e.id&&(y("cancel"),(M=h==null?void 0:h.abort)==null||M.call(h),this.uppy.log(`upload ${e.id} was removed`),a())},T=()=>{var w;y("cancel"),(w=h==null?void 0:h.abort)==null||w.call(h),this.uppy.log(`upload ${e.id} was canceled`),a()},R=(w,M)=>{(w==null?void 0:w.id)===e.id&&F(M)},P=()=>F(!0),v=()=>F(!1);this.uppy.on("file-removed",_),this.uppy.on("cancel-all",T),this.uppy.on("upload-pause",R),this.uppy.on("pause-all",P),this.uppy.on("resume-all",v),r=()=>{this.uppy.off("file-removed",_),this.uppy.off("cancel-all",T),this.uppy.off("upload-pause",R),this.uppy.off("pause-all",P),this.uppy.off("resume-all",v)},i.addEventListener("abort",()=>{h==null||h.abort()}),S()})}finally{r==null||r()}},f(Po,"VERSION",rh.version);const uh="5.0.1",ph={version:uh},fh={strings:{pluginNameUrl:"Link",import:"Import",enterUrlToImport:"Enter URL to import a file",failedToFetch:"Companion failed to fetch this URL, please make sure it’s correct",enterCorrectUrl:"Incorrect URL: Please make sure you are entering a direct link to a file"}};var ii;class mh extends ee{constructor(t){super(t);f(this,"form",document.createElement("form"));f(this,"input");E(this,ii,t=>{t.preventDefault();const{addFile:i}=this.props,r=this.input.value.trim();i(r)});this.form.id=Yi()}componentDidMount(){this.input.value="",this.form.addEventListener("submit",g(this,ii)),document.body.appendChild(this.form)}componentWillUnmount(){this.form.removeEventListener("submit",g(this,ii)),document.body.removeChild(this.form)}render(){const{i18n:t}=this.props;return d("div",{className:"uppy-Url",children:[d("input",{className:"uppy-u-reset uppy-c-textInput uppy-Url-input",type:"text","aria-label":t("enterUrlToImport"),placeholder:t("enterUrlToImport"),ref:i=>{this.input=i},"data-uppy-super-focusable":!0,form:this.form.id}),d("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Url-importButton",type:"submit",form:this.form.id,children:t("import")})]})}}ii=new WeakMap;function Yn(s,e,t){const i=tt(s.items);let r;switch(e){case"paste":{if(i.some(a=>a.kind==="file"))return;r=i.filter(a=>a.kind==="string"&&a.type==="text/plain");break}case"drop":{r=i.filter(n=>n.kind==="string"&&n.type==="text/uri-list");break}default:throw new Error(`isDropOrPaste must be either 'drop' or 'paste', but it's ${e}`)}r.forEach(n=>{n.getAsString(a=>t(a))})}function gh(){return d("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:d("path",{d:"M23.637 15.312l-2.474 2.464a3.582 3.582 0 01-.577.491c-.907.657-1.897.986-2.968.986a4.925 4.925 0 01-3.959-1.971c-.248-.329-.164-.902.165-1.149.33-.247.907-.164 1.155.164 1.072 1.478 3.133 1.724 4.618.656a.642.642 0 00.33-.328l2.473-2.463c1.238-1.313 1.238-3.366-.082-4.597a3.348 3.348 0 00-4.618 0l-1.402 1.395a.799.799 0 01-1.154 0 .79.79 0 010-1.15l1.402-1.394a4.843 4.843 0 016.843 0c2.062 1.805 2.144 5.007.248 6.896zm-8.081 5.664l-1.402 1.395a3.348 3.348 0 01-4.618 0c-1.319-1.23-1.319-3.365-.082-4.596l2.475-2.464.328-.328c.743-.492 1.567-.739 2.475-.657.906.165 1.648.574 2.143 1.314.248.329.825.411 1.155.165.33-.248.412-.822.165-1.15-.825-1.068-1.98-1.724-3.216-1.888-1.238-.247-2.556.082-3.628.902l-.495.493-2.474 2.464c-1.897 1.969-1.814 5.09.083 6.977.99.904 2.226 1.396 3.463 1.396s2.473-.492 3.463-1.395l1.402-1.396a.79.79 0 000-1.15c-.33-.328-.908-.41-1.237-.082z",fill:"#FF753E","fill-rule":"nonzero"})})}function yh(s){const e=/^[a-z0-9]+:\/\//,t="http://";return e.test(s)?s:t+s}function vh(s){return tt(s.dataTransfer.items).filter(i=>i.kind==="string"&&i.type==="text/uri-list").length>0}function bh(s){return(s==null?void 0:s.startsWith("http://"))||(s==null?void 0:s.startsWith("https://"))}function wh(s){const{pathname:e}=new URL(s);return e.substring(e.lastIndexOf("/")+1)}const qe=class qe extends Ie{constructor(t,i){super(t,i);f(this,"icon");f(this,"hostname");f(this,"client");f(this,"canHandleRootDrop");f(this,"getMeta",t=>this.client.post("url/meta",{url:t}));f(this,"addFile",async(t,i)=>{if(t.startsWith("blob"))return;const r=yh(t);if(!bh(r)){this.uppy.log(`[URL] Incorrect URL entered: ${r}`),this.uppy.info(this.i18n("enterCorrectUrl"),"error",4e3);return}this.uppy.log(`[URL] Adding file from dropped/pasted url: ${r}`);try{const n=await this.getMeta(r),a={meta:i,source:this.id,name:n.name||wh(r),type:n.type,data:{size:n.size},isRemote:!0,body:{url:r},remote:{companionUrl:this.opts.companionUrl,url:`${this.hostname}/url/get`,body:{fileId:r,url:r},requestClientId:qe.requestClientId}};this.uppy.log("[Url] Adding remote file");try{return this.uppy.addFile(a)}catch(o){return o.isRestriction||this.uppy.log(o),o}}catch(n){return this.uppy.log(n),this.uppy.info({message:this.i18n("failedToFetch"),details:n},"error",4e3),n}});f(this,"handleRootDrop",t=>{Yn(t.dataTransfer,"drop",i=>{this.addFile(i)})});f(this,"handleRootPaste",t=>{Yn(t.clipboardData,"paste",i=>{this.addFile(i)})});if(this.id=this.opts.id||"Url",this.type="acquirer",this.icon=()=>d(gh,{}),this.defaultLocale=fh,this.i18nInit(),this.title=this.i18n("pluginNameUrl"),this.hostname=this.opts.companionUrl,!this.hostname)throw new Error("Companion hostname is required, please consult https://uppy.io/docs/companion");this.client=new Po(t,{pluginId:this.id,provider:"url",companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionCookiesRule:this.opts.companionCookiesRule}),this.uppy.registerRequestClient(qe.requestClientId,this.client)}render(){return d(mh,{i18n:this.i18n,addFile:this.addFile})}install(){const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount()}};f(qe,"VERSION",ph.version),f(qe,"requestClientId",qe.name);let Ii=qe;Ii.prototype.canHandleRootDrop=vh;var Es={exports:{}};/*!
|
|
25
|
+
Copyright (c) 2018 Jed Watson.
|
|
26
|
+
Licensed under the MIT License (MIT), see
|
|
27
|
+
http://jedwatson.github.io/classnames
|
|
28
|
+
*/var Kn;function Sh(){return Kn||(Kn=1,(function(s){(function(){var e={}.hasOwnProperty;function t(){for(var n="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(n=r(n,i(o)))}return n}function i(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var a="";for(var o in n)e.call(n,o)&&n[o]&&(a=r(a,o));return a}function r(n,a){return a?n?n+" "+a:n+a:n}s.exports?(t.default=t,s.exports=t):window.classNames=t})()})(Es)),Es.exports}var _h=Sh();const fe=st(_h);var Fh=eo();const Th=st(Fh);function Ch(){return d("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30",children:d("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"})})}function B(s,e,t){return e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}var xo=typeof self<"u"?self:global;const Xt=typeof navigator<"u",Eh=Xt&&typeof HTMLImageElement>"u",Jn=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),Ro=xo.Buffer,Mo=!!Ro,Ph=s=>s!==void 0;function ko(s){return s===void 0||(s instanceof Map?s.size===0:Object.values(s).filter(Ph).length===0)}function K(s){let e=new Error(s);throw delete e.stack,e}function Qn(s){let e=(function(t){let i=0;return t.ifd0.enabled&&(i+=1024),t.exif.enabled&&(i+=2048),t.makerNote&&(i+=2048),t.userComment&&(i+=1024),t.gps.enabled&&(i+=512),t.interop.enabled&&(i+=100),t.ifd1.enabled&&(i+=1024),i+2048})(s);return s.jfif.enabled&&(e+=50),s.xmp.enabled&&(e+=2e4),s.iptc.enabled&&(e+=14e3),s.icc.enabled&&(e+=6e3),e}const Ps=s=>String.fromCharCode.apply(null,s),Zn=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0;class ue{static from(e,t){return e instanceof this&&e.le===t?e:new ue(e,void 0,void 0,t)}constructor(e,t=0,i,r){if(typeof r=="boolean"&&(this.le=r),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){i===void 0&&(i=e.byteLength-t);let n=new DataView(e,t,i);this._swapDataView(n)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof ue){i===void 0&&(i=e.byteLength-t),(t+=e.byteOffset)+i>e.byteOffset+e.byteLength&&K("Creating view outside of available memory in ArrayBuffer");let n=new DataView(e.buffer,t,i);this._swapDataView(n)}else if(typeof e=="number"){let n=new DataView(new ArrayBuffer(e));this._swapDataView(n)}else K("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,i=ue){return e instanceof DataView||e instanceof ue?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||K("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new i(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new ue(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return r=this.getUint8Array(e,t),Zn?Zn.decode(r):Mo?Buffer.from(r).toString("utf8"):decodeURIComponent(escape(Ps(r)));var r}getLatin1String(e=0,t=this.byteLength){let i=this.getUint8Array(e,t);return Ps(i)}getUnicodeString(e=0,t=this.byteLength){const i=[];for(let r=0;r<t&&e+r<this.byteLength;r+=2)i.push(this.getUint16(e+r));return Ps(i)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,i){switch(t){case 1:return this.getUint8(e,i);case 2:return this.getUint16(e,i);case 4:return this.getUint32(e,i);case 8:return this.getUint64&&this.getUint64(e,i)}}getUint(e,t,i){switch(t){case 8:return this.getUint8(e,i);case 16:return this.getUint16(e,i);case 32:return this.getUint32(e,i);case 64:return this.getUint64&&this.getUint64(e,i)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}}function hr(s,e){K(`${s} '${e}' was not loaded, try using full build of exifr.`)}class kr extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||hr(this.kind,e),t&&(e in t||(function(i,r){K(`Unknown ${i} '${r}'.`)})(this.kind,e),t[e].enabled||hr(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var Ao=new kr("file parser"),he=new kr("segment parser"),Ar=new kr("file reader");let xh=xo.fetch;function ea(s,e){return(t=s).startsWith("data:")||t.length>1e4?pr(s,e,"base64"):Jn&&s.includes("://")?ur(s,e,"url",ta):Jn?pr(s,e,"fs"):Xt?ur(s,e,"url",ta):void K("Invalid input argument");var t}async function ur(s,e,t,i){return Ar.has(t)?pr(s,e,t):i?(async function(r,n){let a=await n(r);return new ue(a)})(s,i):void K(`Parser ${t} is not loaded`)}async function pr(s,e,t){let i=new(Ar.get(t))(s,e);return await i.read(),i}const ta=s=>xh(s).then((e=>e.arrayBuffer())),fr=s=>new Promise(((e,t)=>{let i=new FileReader;i.onloadend=()=>e(i.result||new ArrayBuffer),i.onerror=t,i.readAsArrayBuffer(s)})),Or=new Map,Rh=new Map,Mh=new Map,vi=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],Oo=["jfif","xmp","icc","iptc","ihdr"],mr=["tiff",...Oo],X=["ifd0","ifd1","exif","gps","interop"],bi=[...mr,...X],wi=["makerNote","userComment"],Do=["translateKeys","translateValues","reviveValues","multiSegment"],Si=[...Do,"sanitize","mergeOutput","silentErrors"];class No{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class At extends No{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,i,r){if(super(),B(this,"enabled",!1),B(this,"skip",new Set),B(this,"pick",new Set),B(this,"deps",new Set),B(this,"translateKeys",!1),B(this,"translateValues",!1),B(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(r),this.canBeFiltered=X.includes(e),this.canBeFiltered&&(this.dict=Or.get(e)),i!==void 0)if(Array.isArray(i))this.parse=this.enabled=!0,this.canBeFiltered&&i.length>0&&this.translateTagSet(i,this.pick);else if(typeof i=="object"){if(this.enabled=!0,this.parse=i.parse!==!1,this.canBeFiltered){let{pick:n,skip:a}=i;n&&n.length>0&&this.translateTagSet(n,this.pick),a&&a.length>0&&this.translateTagSet(a,this.skip)}this.applyInheritables(i)}else i===!0||i===!1?this.parse=this.enabled=i:K(`Invalid options argument: ${i}`)}applyInheritables(e){let t,i;for(t of Do)i=e[t],i!==void 0&&(this[t]=i)}translateTagSet(e,t){if(this.dict){let i,r,{tagKeys:n,tagValues:a}=this.dict;for(i of e)typeof i=="string"?(r=a.indexOf(i),r===-1&&(r=n.indexOf(Number(i))),r!==-1&&t.add(Number(n[r]))):t.add(i)}else for(let i of e)t.add(i)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,Ui(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Ui(this.pick,this.deps)}}var Z={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,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},ia=new Map;class Dr extends No{static useCached(e){let t=ia.get(e);return t!==void 0||(t=new this(e),ia.set(e,t)),t}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):K(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=Xt?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of vi)this[e]=Z[e];for(e of Si)this[e]=Z[e];for(e of wi)this[e]=Z[e];for(e of bi)this[e]=new At(e,Z[e],void 0,this)}setupFromTrue(){let e;for(e of vi)this[e]=Z[e];for(e of Si)this[e]=Z[e];for(e of wi)this[e]=!0;for(e of bi)this[e]=new At(e,!0,void 0,this)}setupFromArray(e){let t;for(t of vi)this[t]=Z[t];for(t of Si)this[t]=Z[t];for(t of wi)this[t]=Z[t];for(t of bi)this[t]=new At(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,X)}setupFromObject(e){let t;for(t of(X.ifd0=X.ifd0||X.image,X.ifd1=X.ifd1||X.thumbnail,Object.assign(this,e),vi))this[t]=xs(e[t],Z[t]);for(t of Si)this[t]=xs(e[t],Z[t]);for(t of wi)this[t]=xs(e[t],Z[t]);for(t of mr)this[t]=new At(t,Z[t],e[t],this);for(t of X)this[t]=new At(t,Z[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,X,bi),e.tiff===!0?this.batchEnableWithBool(X,!0):e.tiff===!1?this.batchEnableWithUserValue(X,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,X):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,X)}batchEnableWithBool(e,t){for(let i of e)this[i].enabled=t}batchEnableWithUserValue(e,t){for(let i of e){let r=t[i];this[i].enabled=r!==!1&&r!==void 0}}setupGlobalFilters(e,t,i,r=i){if(e&&e.length){for(let a of r)this[a].enabled=!1;let n=sa(e,i);for(let[a,o]of n)Ui(this[a].pick,o),this[a].enabled=!0}else if(t&&t.length){let n=sa(t,i);for(let[a,o]of n)Ui(this[a].skip,o)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:i,iptc:r,icc:n}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),i.enabled||e.skip.add(700),r.enabled||e.skip.add(33723),n.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:i,interop:r}=this;r.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),i.needed&&e.deps.add(34853),this.tiff.enabled=X.some((n=>this[n].enabled===!0))||this.makerNote||this.userComment;for(let n of X)this[n].finalizeFilters()}get onlyTiff(){return!Oo.map((e=>this[e].enabled)).some((e=>e===!0))&&this.tiff.enabled}checkLoadedPlugins(){for(let e of mr)this[e].enabled&&!he.has(e)&&hr("segment parser",e)}}function sa(s,e){let t,i,r,n,a=[];for(r of e){for(n of(t=Or.get(r),i=[],t))(s.includes(n[0])||s.includes(n[1]))&&i.push(n[0]);i.length&&a.push([r,i])}return a}function xs(s,e){return s!==void 0?s:e!==void 0?e:void 0}function Ui(s,e){for(let t of e)s.add(t)}B(Dr,"default",Z);class kh{constructor(e){B(this,"parsers",{}),B(this,"output",{}),B(this,"errors",[]),B(this,"pushToErrors",(t=>this.errors.push(t))),this.options=Dr.useCached(e)}async read(e){this.file=await(function(t,i){return typeof t=="string"?ea(t,i):Xt&&!Eh&&t instanceof HTMLImageElement?ea(t.src,i):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new ue(t):Xt&&t instanceof Blob?ur(t,i,"blob",fr):void K("Invalid input argument")})(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[i,r]of Ao)if(r.canHandle(e,t))return this.fileParser=new r(this.options,this.file,this.parsers),e[i]=!0;this.file.close&&this.file.close(),K("Unknown file format")}async parse(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(await this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):await this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),ko(i=e)?void 0:i;var i}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map((async i=>{let r=await i.parse();i.assignToOutput(e,r)}));this.options.silentErrors&&(t=t.map((i=>i.catch(this.pushToErrors)))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,i=he.get("tiff",e);var r;if(t.tiff?r={start:0,type:"tiff"}:t.jpeg&&(r=await this.fileParser.getOrFindSegment("tiff")),r===void 0)return;let n=await this.fileParser.ensureSegmentChunk(r),a=this.parsers.tiff=new i(n,e,t),o=await a.extractThumbnail();return t.close&&t.close(),o}}class lt{static findPosition(e,t){let i=e.getUint16(t+2)+2,r=typeof this.headerLength=="function"?this.headerLength(e,t,i):this.headerLength,n=t+r,a=i-r;return{offset:t,length:i,headerLength:r,start:n,size:a,end:n+a}}static parse(e,t={}){return new this(e,new Dr({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof ue?e:new ue(e)}constructor(e,t={},i){B(this,"errors",[]),B(this,"raw",new Map),B(this,"handleError",(r=>{if(!this.options.silentErrors)throw r;this.errors.push(r.message)})),this.chunk=this.normalizeInput(e),this.file=i,this.type=this.constructor.type,this.globalOptions=this.options=t,this.localOptions=t[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let i=Mh.get(t),r=Rh.get(t),n=Or.get(t),a=this.options[t],o=a.reviveValues&&!!i,l=a.translateValues&&!!r,c=a.translateKeys&&!!n,u={};for(let[h,p]of e)o&&i.has(h)?p=i.get(h)(p):l&&r.has(h)&&(p=this.translateValue(p,r.get(h))),c&&n.has(h)&&(h=n.get(h)||h),u[h]=p;return u}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,i){if(this.globalOptions.mergeOutput)return Object.assign(e,i);e[t]?Object.assign(e[t],i):e[t]=i}}B(lt,"headerLength",4),B(lt,"type",void 0),B(lt,"multiSegment",!1),B(lt,"canHandle",(()=>!1));function Ah(s){return s===192||s===194||s===196||s===219||s===221||s===218||s===254}function Oh(s){return s>=224&&s<=239}function Dh(s,e,t){for(let[i,r]of he)if(r.canHandle(s,e,t))return i}class ra extends class{constructor(e,t,i){B(this,"errors",[]),B(this,"ensureSegmentChunk",(async r=>{let n=r.start,a=r.size||65536;if(this.file.chunked)if(this.file.available(n,a))r.chunk=this.file.subarray(n,a);else try{r.chunk=await this.file.readChunk(n,a)}catch(o){K(`Couldn't read segment: ${JSON.stringify(r)}. ${o.message}`)}else this.file.byteLength>n+a?r.chunk=this.file.subarray(n,a):r.size===void 0?r.chunk=this.file.subarray(n):K("Segment unreachable: "+JSON.stringify(r));return r.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=i}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let i=new(he.get(e))(t,this.options,this.file);return this.parsers[e]=i}createParsers(e){for(let t of e){let{type:i,chunk:r}=t,n=this.options[i];if(n&&n.enabled){let a=this.parsers[i];a&&a.append||a||this.createParser(i,r)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),B(this,"appSegments",[]),B(this,"jpegSegments",[]),B(this,"unknownSegments",[])}static canHandle(e,t){return t===65496}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(he.keyList())):(e=e===void 0?he.keyList().filter((t=>this.options[t].enabled)):e.filter((t=>this.options[t].enabled&&he.has(t))),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:i,findAll:r,wanted:n,remaining:a}=this;if(!r&&this.file.chunked&&(r=Array.from(n).some((o=>{let l=he.get(o),c=this.options[o];return l.multiSegment&&c.multiSegment})),r&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,i.byteLength),!this.options.onlyTiff&&i.chunked){let o=!1;for(;a.size>0&&!o&&(i.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=i,c=this.appSegments.some((u=>!this.file.available(u.offset||u.start,u.length||u.size)));if(o=e>l&&!c?!await i.readNextChunk(e):!await i.readNextChunk(l),(e=this.findAppSegmentsInRange(e,i.byteLength))===void 0)return}}}findAppSegmentsInRange(e,t){t-=2;let i,r,n,a,o,l,{file:c,findAll:u,wanted:h,remaining:p,options:m}=this;for(;e<t;e++)if(c.getUint8(e)===255){if(i=c.getUint8(e+1),Oh(i)){if(r=c.getUint16(e+2),n=Dh(c,e,r),n&&h.has(n)&&(a=he.get(n),o=a.findPosition(c,e),l=m[n],o.type=n,this.appSegments.push(o),!u&&(a.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=o.chunkNumber<o.chunkCount,this.unfinishedMultiSegment||p.delete(n)):p.delete(n),p.size===0)))break;m.recordUnknownSegments&&(o=lt.findPosition(c,e),o.marker=i,this.unknownSegments.push(o)),e+=r+1}else if(Ah(i)){if(r=c.getUint16(e+2),i===218&&m.stopAfterSos!==!1)return;m.recordJpegSegments&&this.jpegSegments.push({offset:e,length:r,marker:i}),e+=r+1}}return e}mergeMultiSegments(){if(!this.appSegments.some((t=>t.multiSegment)))return;let e=(function(t,i){let r,n,a,o=new Map;for(let l=0;l<t.length;l++)r=t[l],n=r[i],o.has(n)?a=o.get(n):o.set(n,a=[]),a.push(r);return Array.from(o)})(this.appSegments,"type");this.mergedAppSegments=e.map((([t,i])=>{let r=he.get(t,this.options);return r.handleMultiSegments?{type:t,chunk:r.handleMultiSegments(i)}:i[0]}))}getSegment(e){return this.appSegments.find((t=>t.type===e))}async getOrFindSegment(e){let t=this.getSegment(e);return t===void 0&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}B(ra,"type","jpeg"),Ao.set("jpeg",ra);const Nh=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class Ih extends lt{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,i=new Map){let{pick:r,skip:n}=this.options[t];r=new Set(r);let a=r.size>0,o=n.size===0,l=this.chunk.getUint16(e);e+=2;for(let c=0;c<l;c++){let u=this.chunk.getUint16(e);if(a){if(r.has(u)&&(i.set(u,this.parseTag(e,u,t)),r.delete(u),r.size===0))break}else!o&&n.has(u)||i.set(u,this.parseTag(e,u,t));e+=12}return i}parseTag(e,t,i){let{chunk:r}=this,n=r.getUint16(e+2),a=r.getUint32(e+4),o=Nh[n];if(o*a<=4?e+=8:e=r.getUint32(e+8),(n<1||n>13)&&K(`Invalid TIFF value type. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e}`),e>r.byteLength&&K(`Invalid TIFF value offset. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e} is outside of chunk size ${r.byteLength}`),n===1)return r.getUint8Array(e,a);if(n===2)return(l=(function(c){for(;c.endsWith("\0");)c=c.slice(0,-1);return c})(l=r.getString(e,a)).trim())===""?void 0:l;var l;if(n===7)return r.getUint8Array(e,a);if(a===1)return this.parseTagValue(n,e);{let c=new((function(h){switch(h){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}})(n))(a),u=o;for(let h=0;h<a;h++)c[h]=this.parseTagValue(n,e),e+=u;return c}}parseTagValue(e,t){let{chunk:i}=this;switch(e){case 1:return i.getUint8(t);case 3:return i.getUint16(t);case 4:return i.getUint32(t);case 5:return i.getUint32(t)/i.getUint32(t+4);case 6:return i.getInt8(t);case 8:return i.getInt16(t);case 9:return i.getInt32(t);case 10:return i.getInt32(t)/i.getInt32(t+4);case 11:return i.getFloat(t);case 12:return i.getDouble(t);case 13:return i.getUint32(t);default:K(`Invalid tiff type ${e}`)}}}class Rs extends Ih{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1165519206&&e.getUint16(t+8)===0}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return t.catch!==void 0&&(t=t.catch(this.handleError)),t}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let i=new Map;return this[t]=i,this.parseTags(e,t,i),i}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&K("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&K(`IFD0 offset points to outside of file.
|
|
29
|
+
this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,Qn(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return t.size!==0?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0}async parseExifBlock(){if(this.exif||(this.ifd0||await this.parseIfd0Block(),this.exifOffset===void 0))return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,Qn(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let i=e.get(t);i&&i.length===1&&e.set(t,i[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",na(...e.get(2),e.get(1))),e.set("longitude",na(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),this.interopOffset!==void 0||this.exif||await this.parseExifBlock(),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),this.ifd1===void 0)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,i,r={};for(t of X)if(e=this[t],!ko(e))if(i=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(r,i)}else r[t]=i;return this.makerNote&&(r.makerNote=this.makerNote),this.userComment&&(r.userComment=this.userComment),r}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[i,r]of Object.entries(t))this.assignObjectToOutput(e,i,r)}}function na(s,e,t,i){var r=s+e/60+t/3600;return i!=="S"&&i!=="W"||(r*=-1),r}B(Rs,"type","tiff"),B(Rs,"headerLength",10),he.set("tiff",Rs);const Nr={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1};Object.assign({},Nr,{firstChunkSize:4e4,gps:[1,2,3,4]});Object.assign({},Nr,{tiff:!1,ifd1:!0,mergeOutput:!1});const Uh=Object.assign({},Nr,{firstChunkSize:4e4,ifd0:[274]});async function Bh(s){let e=new kh(Uh);await e.read(s);let t=await e.parse();if(t&&t.ifd0)return t.ifd0[274]}const Lh=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}});let Bt=!0,Lt=!0;if(typeof navigator=="object"){let s=navigator.userAgent;if(s.includes("iPad")||s.includes("iPhone")){let e=s.match(/OS (\d+)_(\d+)/);if(e){let[,t,i]=e;Bt=Number(t)+.1*Number(i)<13.4,Lt=!1}}else if(s.includes("OS X 10")){let[,e]=s.match(/OS X 10[_.](\d+)/);Bt=Lt=Number(e)<15}if(s.includes("Chrome/")){let[,e]=s.match(/Chrome\/(\d+)/);Bt=Lt=Number(e)<81}else if(s.includes("Firefox/")){let[,e]=s.match(/Firefox\/(\d+)/);Bt=Lt=Number(e)<77}}async function zh(s){let e=await Bh(s);return Object.assign({canvas:Bt,css:Lt},Lh[e])}class $h extends ue{constructor(...e){super(...e),B(this,"ranges",new Hh),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,i){if(e===0&&this.byteLength===0&&i){let r=new DataView(i.buffer||i,i.byteOffset,i.byteLength);this._swapDataView(r)}else{let r=e+t;if(r>this.byteLength){let{dataView:n}=this._extend(r);this._swapDataView(n)}}}_extend(e){let t;t=Mo?Ro.allocUnsafe(e):new Uint8Array(e);let i=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:i}}subarray(e,t,i=!1){return t=t||this._lengthToEnd(e),i&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,i=!1){i&&this._tryExtend(t,e.byteLength,e);let r=super.set(e,t);return this.ranges.add(t,r.byteLength),r}async ensureChunk(e,t){this.chunked&&(this.ranges.available(e,t)||await this.readChunk(e,t))}available(e,t){return this.ranges.available(e,t)}}class Hh{constructor(){B(this,"list",[])}get length(){return this.list.length}add(e,t,i=0){let r=e+t,n=this.list.filter((a=>aa(e,a.offset,r)||aa(e,a.end,r)));if(n.length>0){e=Math.min(e,...n.map((o=>o.offset))),r=Math.max(r,...n.map((o=>o.end))),t=r-e;let a=n.shift();a.offset=e,a.length=t,a.end=r,this.list=this.list.filter((o=>!n.includes(o)))}else this.list.push({offset:e,length:t,end:r})}available(e,t){let i=e+t;return this.list.some((r=>r.offset<=e&&i<=r.end))}}function aa(s,e,t){return s<=e&&e<=t}class qh extends $h{constructor(e,t){super(0),B(this,"chunksRead",0),this.input=e,this.options=t}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,i=await this.readChunk(e,t);return!!i&&i.byteLength===t}async readChunk(e,t){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}Ar.set("blob",class extends qh{async readWhole(){this.chunked=!1;let s=await fr(this.input);this._swapArrayBuffer(s)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(s,e){let t=e?s+e:void 0,i=this.input.slice(s,t),r=await fr(i);return this.set(r,s,!0)}});const Vh="5.0.1",jh={version:Vh},Wh={strings:{generatingThumbnails:"Generating thumbnails..."}};function Gh(s,e,t){try{s.getContext("2d").getImageData(0,0,1,1)}catch(i){if(i.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return s.toBlob?new Promise(i=>{s.toBlob(i,e,t)}).then(i=>{if(i===null)throw new Error("cannot read image, probably an svg with external resources");return i}):Promise.resolve().then(()=>cl(s.toDataURL(e,t),{})).then(i=>{if(i===null)throw new Error("could not extract blob, probably an old browser");return i})}function Xh(s,e){let t=s.width,i=s.height;(e.deg===90||e.deg===270)&&(t=s.height,i=s.width);const r=document.createElement("canvas");r.width=t,r.height=i;const n=r.getContext("2d");return n.translate(t/2,i/2),e.canvas&&(n.rotate(e.rad),n.scale(e.scaleX,e.scaleY)),n.drawImage(s,-s.width/2,-s.height/2,s.width,s.height),r}function Yh(s){const e=s.width/s.height,t=5e6,i=4096;let r=Math.floor(Math.sqrt(t*e)),n=Math.floor(t/Math.sqrt(t*e));if(r>i&&(r=i,n=Math.round(r/e)),n>i&&(n=i,r=Math.round(e*n)),s.width>r){const a=document.createElement("canvas");return a.width=r,a.height=n,a.getContext("2d").drawImage(s,0,0,r,n),a}return s}const Kh={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1};class Io extends Ie{constructor(t,i){super(t,{...Kh,...i});f(this,"queue");f(this,"queueProcessing");f(this,"defaultThumbnailDimension");f(this,"thumbnailType");f(this,"onFileAdded",t=>{!t.preview&&t.data&&jr(t.type)&&!t.isRemote&&this.addToQueue(t.id)});f(this,"onCancelRequest",t=>{const i=this.queue.indexOf(t.id);i!==-1&&this.queue.splice(i,1)});f(this,"onFileRemoved",t=>{const i=this.queue.indexOf(t.id);i!==-1&&this.queue.splice(i,1),t.preview&&Vr(t.preview)&&URL.revokeObjectURL(t.preview)});f(this,"onRestored",()=>{this.uppy.getFiles().filter(i=>i.isRestored).forEach(i=>{(!i.preview||Vr(i.preview))&&this.addToQueue(i.id)})});f(this,"onAllFilesRemoved",()=>{this.queue=[]});f(this,"waitUntilAllProcessed",t=>{t.forEach(r=>{const n=this.uppy.getFile(r);this.uppy.emit("preprocess-progress",n,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});const i=()=>{t.forEach(r=>{const n=this.uppy.getFile(r);this.uppy.emit("preprocess-complete",n)})};return new Promise(r=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{i(),r()}):(i(),r())})});if(this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType,this.defaultLocale=Wh,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(t,i,r){const n=URL.createObjectURL(t.data),a=new Promise((l,c)=>{const u=new Image;u.src=n,u.addEventListener("load",()=>{URL.revokeObjectURL(n),l(u)}),u.addEventListener("error",h=>{URL.revokeObjectURL(n),c(h.error||new Error("Could not create thumbnail"))})}),o=zh(t.data).catch(()=>1);return Promise.all([a,o]).then(([l,c])=>{const u=this.getProportionalDimensions(l,i,r,c.deg),h=Xh(l,c),p=this.resizeImage(h,u.width,u.height);return Gh(p,this.thumbnailType,80)}).then(l=>URL.createObjectURL(l))}getProportionalDimensions(t,i,r,n){let a=t.width/t.height;if((n===90||n===270)&&(a=t.height/t.width),i!=null){let o=i;return t.width<i&&(o=t.width),{width:o,height:Math.round(o/a)}}if(r!=null){let o=r;return t.height<r&&(o=t.height),{width:Math.round(o*a),height:o}}return{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/a)}}resizeImage(t,i,r){let n=Yh(t),a=Math.ceil(Math.log2(n.width/i));a<1&&(a=1);let o=i*2**(a-1),l=r*2**(a-1);const c=2;for(;a--;){const u=document.createElement("canvas");u.width=o,u.height=l,u.getContext("2d").drawImage(n,0,0,o,l),n=u,o=Math.round(o/c),l=Math.round(l/c)}return n}setPreviewURL(t,i){this.uppy.setFileState(t,{preview:i})}addToQueue(t){this.queue.push(t),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){const t=this.uppy.getFile(this.queue.shift());return t?this.requestThumbnail(t).catch(()=>{}).then(()=>this.processQueue()):(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"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(t){return jr(t.type)&&!t.isRemote?this.createThumbnail(t,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(i=>{this.setPreviewURL(t.id,i),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${t.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(t.id),i)}).catch(i=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${t.id}:`,"warning"),this.uppy.log(i,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(t.id),i)}):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}}f(Io,"VERSION",jh.version);const Jh="5.0.2",Qh={version:Jh};class Uo extends ee{constructor(){super(...arguments);f(this,"fileInput",null);f(this,"folderInput",null);f(this,"mobilePhotoFileInput",null);f(this,"mobileVideoFileInput",null);f(this,"triggerFileInputClick",()=>{var t;(t=this.fileInput)==null||t.click()});f(this,"triggerFolderInputClick",()=>{var t;(t=this.folderInput)==null||t.click()});f(this,"triggerVideoCameraInputClick",()=>{var t;(t=this.mobileVideoFileInput)==null||t.click()});f(this,"triggerPhotoCameraInputClick",()=>{var t;(t=this.mobilePhotoFileInput)==null||t.click()});f(this,"onFileInputChange",t=>{this.props.handleInputChange(t),t.currentTarget.value=""});f(this,"renderHiddenInput",(t,i)=>{var r;return d("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:t,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:(r=this.props.allowedFileTypes)==null?void 0:r.join(", "),ref:i})});f(this,"renderHiddenCameraInput",(t,i,r)=>{const a={photo:"image/*",video:"video/*"}[t];return d("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${t}`,onChange:this.onFileInputChange,capture:i===""?"environment":i,accept:a,ref:r})});f(this,"renderMyDeviceAcquirer",()=>d("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice",children:d("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick,children:[d("div",{className:"uppy-DashboardTab-inner",children:d("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:d("path",{d:"M8.45 22.087l-1.305-6.674h17.678l-1.572 6.674H8.45zm4.975-12.412l1.083 1.765a.823.823 0 00.715.386h7.951V13.5H8.587V9.675h4.838zM26.043 13.5h-1.195v-2.598c0-.463-.336-.75-.798-.75h-8.356l-1.082-1.766A.823.823 0 0013.897 8H7.728c-.462 0-.815.256-.815.718V13.5h-.956a.97.97 0 00-.746.37.972.972 0 00-.19.81l1.724 8.565c.095.44.484.755.933.755H24c.44 0 .824-.3.929-.727l2.043-8.568a.972.972 0 00-.176-.825.967.967 0 00-.753-.38z",fill:"currentcolor","fill-rule":"evenodd"})})}),d("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("myDevice")})]})}));f(this,"renderPhotoCamera",()=>d("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera",children:d("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerPhotoCameraInputClick,children:[d("div",{className:"uppy-DashboardTab-inner",children:d("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:d("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383","fill-rule":"nonzero"})})}),d("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("takePictureBtn")})]})}));f(this,"renderVideoCamera",()=>d("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera",children:d("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerVideoCameraInputClick,children:[d("div",{className:"uppy-DashboardTab-inner",children:d("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32",children:d("path",{fill:"#FF675E",fillRule:"nonzero",d:"m21.254 14.277 2.941-2.588c.797-.313 1.243.818 1.09 1.554-.01 2.094.02 4.189-.017 6.282-.126.915-1.145 1.08-1.58.34l-2.434-2.142c-.192.287-.504 1.305-.738.468-.104-1.293-.028-2.596-.05-3.894.047-.312.381.823.426 1.069.063-.384.206-.744.362-1.09zm-12.939-3.73c3.858.013 7.717-.025 11.574.02.912.129 1.492 1.237 1.351 2.217-.019 2.412.04 4.83-.03 7.239-.17 1.025-1.166 1.59-2.029 1.429-3.705-.012-7.41.025-11.114-.019-.913-.129-1.492-1.237-1.352-2.217.018-2.404-.036-4.813.029-7.214.136-.82.83-1.473 1.571-1.454z "})})}),d("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("recordVideoBtn")})]})}));f(this,"renderBrowseButton",(t,i)=>{const r=this.props.acquirers.length;return d("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:i,"data-uppy-super-focusable":r===0,children:t})});f(this,"renderDropPasteBrowseTagline",t=>{const i=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),r=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),n=this.props.fileManagerSelectionType,a=n.charAt(0).toUpperCase()+n.slice(1);return d("div",{class:"uppy-Dashboard-AddFiles-title",children:this.props.disableLocalFiles?this.props.i18n("importFiles"):t>0?this.props.i18nArray(`dropPasteImport${a}`,{browseFiles:i,browseFolders:r,browse:i}):this.props.i18nArray(`dropPaste${a}`,{browseFiles:i,browseFolders:r,browse:i})})});f(this,"renderAcquirer",t=>{var i;return d("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":t.id,children:d("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":t.id,"aria-controls":`uppy-DashboardContent-panel--${t.id}`,"aria-selected":((i=this.props.activePickerPanel)==null?void 0:i.id)===t.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(t.id),children:[d("div",{className:"uppy-DashboardTab-inner",children:t.icon()}),d("div",{className:"uppy-DashboardTab-name",children:t.name})]})})});f(this,"renderAcquirers",t=>{const i=[...t],r=i.splice(t.length-2,t.length);return d(pe,{children:[i.map(n=>this.renderAcquirer(n)),d("span",{role:"presentation",style:{"white-space":"nowrap"},children:r.map(n=>this.renderAcquirer(n))})]})});f(this,"renderSourcesList",(t,i)=>{const{showNativePhotoCameraButton:r,showNativeVideoCameraButton:n}=this.props;let a=[];const o="myDevice";i||a.push({key:o,elements:this.renderMyDeviceAcquirer()}),r&&a.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),n&&a.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),a.push(...t.map(h=>({key:h.id,elements:this.renderAcquirer(h)}))),a.length===1&&a[0].key===o&&(a=[]);const c=[...a],u=c.splice(a.length-2,a.length);return d(pe,{children:[this.renderDropPasteBrowseTagline(a.length),d("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist",children:[c.map(({key:h,elements:p})=>d(pe,{children:p},h)),d("span",{role:"presentation",style:{"white-space":"nowrap"},children:u.map(({key:h,elements:p})=>d(pe,{children:p},h))})]})]})})}[Symbol.for("uppy test: disable unused locale key warning")](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){const{i18nArray:t}=this.props,i=d("span",{children:[d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11",children:d("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})}),d("span",{className:"uppy-Dashboard-poweredByUppy",children:"Uppy"})]}),r=t("poweredBy",{uppy:i});return d("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy",children:r})}render(){const{showNativePhotoCameraButton:t,showNativeVideoCameraButton:i,nativeCameraFacingMode:r}=this.props;return d("div",{className:"uppy-Dashboard-AddFiles",children:[this.renderHiddenInput(!1,n=>{this.fileInput=n}),this.renderHiddenInput(!0,n=>{this.folderInput=n}),t&&this.renderHiddenCameraInput("photo",r,n=>{this.mobilePhotoFileInput=n}),i&&this.renderHiddenCameraInput("video",r,n=>{this.mobileVideoFileInput=n}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),d("div",{className:"uppy-Dashboard-AddFiles-info",children:[this.props.note&&d("div",{className:"uppy-Dashboard-note",children:this.props.note}),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()]})]})}}const Zh=s=>d("div",{className:fe("uppy-Dashboard-AddFilesPanel",s.className),"data-uppy-panelType":"AddFiles","aria-hidden":!s.showAddFilesPanel,children:[d("div",{className:"uppy-DashboardContent-bar",children:[d("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:s.i18n("addingMoreFiles")}),d("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>s.toggleAddFilesPanel(!1),children:s.i18n("back")})]}),d(Uo,{...s})]});function eu(s){const e=s.files[s.fileCardFor],t=()=>{s.uppy.emit("file-editor:cancel",e),s.closeFileEditor()};return d("div",{className:fe("uppy-DashboardContent-panel",s.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor",children:[d("div",{className:"uppy-DashboardContent-bar",children:[d("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:s.i18nArray("editing",{file:d("span",{className:"uppy-DashboardContent-titleFile",children:e.meta?e.meta.name:e.name})})}),d("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t,children:s.i18n("cancel")}),d("button",{className:"uppy-DashboardContent-save",type:"button",onClick:s.saveFileEditor,children:s.i18n("save")})]}),d("div",{className:"uppy-DashboardContent-panelBody",children:s.editors.map(i=>s.uppy.getPlugin(i.id).render(s.state))})]})}function tu(){return d("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25",children:d("g",{fill:"#686DE0",fillRule:"evenodd",children:[d("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),d("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),d("circle",{cx:"7.5",cy:"9.5",r:"1.5"})]})})}function iu(){return d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:d("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"})})}function su(){return d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:d("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"})})}function ru(){return d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:d("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"})})}function nu(){return d("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25",children:d("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"})})}function au(){return d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:d("g",{fill:"#A7AFB7",fillRule:"nonzero",children:[d("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),d("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})]})})}function ou(){return d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:d("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"})})}function Ir(s){const e={color:"#838999",icon:au()};if(!s)return e;const t=s.split("/")[0],i=s.split("/")[1];return t==="text"?{color:"#5a5e69",icon:ou()}:t==="image"?{color:"#686de0",icon:tu()}:t==="audio"?{color:"#068dbb",icon:iu()}:t==="video"?{color:"#19af67",icon:su()}:t==="application"&&i==="pdf"?{color:"#e25149",icon:ru()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(i)!==-1?{color:"#00C469",icon:nu()}:e}function Ne(s){const{tagName:e}=s.target;if(e==="INPUT"||e==="TEXTAREA"){s.stopPropagation();return}s.preventDefault(),s.stopPropagation()}function Bo(s){const{file:e}=s;if(e.preview)return d("img",{draggable:!1,className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});const{color:t,icon:i}=Ir(e.type);return d("div",{className:"uppy-Dashboard-Item-previewIconWrap",children:[d("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t},children:i}),d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76",children:d("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})})]})}function lu(s){const{computedMetaFields:e,requiredMetaFields:t,updateMeta:i,form:r,formState:n}=s,a={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(o=>{const l=`uppy-Dashboard-FileCard-input-${o.id}`,c=t.includes(o.id);return d("fieldset",{className:"uppy-Dashboard-FileCard-fieldset",children:[d("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l,children:o.name}),o.render!==void 0?o.render({value:n[o.id],onChange:u=>i(u,o.id),fieldCSSClasses:a,required:c,form:r.id},wr):d("input",{className:a.text,id:l,form:r.id,type:o.type||"text",required:c,value:n[o.id],placeholder:o.placeholder,onInput:u=>i(u.target.value,o.id),"data-uppy-super-focusable":!0})]},o.id)})}function du(s){const{files:e,fileCardFor:t,toggleFileCard:i,saveFileCard:r,metaFields:n,requiredMetaFields:a,openFileEditor:o,i18n:l,i18nArray:c,className:u,canEditFile:h}=s,p=()=>typeof n=="function"?n(e[t]):n,m=e[t],y=p()??[],b=h(m),S={};y.forEach(w=>{S[w.id]=m.meta[w.id]??""});const[F,_]=Ct(S),T=Oi(w=>{w.preventDefault(),r(F,t)},[r,F,t]),R=(w,M)=>{_({...F,[M]:w})},P=()=>{i(!1)},[v]=Ct(()=>{const w=document.createElement("form");return w.setAttribute("tabindex","-1"),w.id=Yi(),w});return Ai(()=>(document.body.appendChild(v),v.addEventListener("submit",T),()=>{v.removeEventListener("submit",T),v.parentNode&&document.body.removeChild(v)}),[v,T]),d("div",{className:fe("uppy-Dashboard-FileCard",u),"data-uppy-panelType":"FileCard",onDragOver:Ne,onDragLeave:Ne,onDrop:Ne,onPaste:Ne,children:[d("div",{className:"uppy-DashboardContent-bar",children:[d("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:c("editing",{file:d("span",{className:"uppy-DashboardContent-titleFile",children:m.meta?m.meta.name:m.name})})}),d("button",{className:"uppy-DashboardContent-back",type:"button",form:v.id,title:l("finishEditingFile"),onClick:P,children:l("cancel")})]}),d("div",{className:"uppy-Dashboard-FileCard-inner",children:[d("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:Ir(m.type).color},children:[d(Bo,{file:m}),b&&d("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:w=>{T(w),o(m)},children:l("editImage")})]}),d("div",{className:"uppy-Dashboard-FileCard-info",children:d(lu,{computedMetaFields:y,requiredMetaFields:a,updateMeta:R,form:v,formState:F})}),d("div",{className:"uppy-Dashboard-FileCard-actions",children:[d("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:v.id,children:l("saveChanges")}),d("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:P,form:v.id,children:l("cancel")})]})]})]})}function Lo(s,e){if(s===e)return!0;if(!s||!e)return!1;const t=Object.keys(s),i=Object.keys(e),r=t.length;if(i.length!==r)return!1;for(let n=0;n<r;n++){const a=t[n];if(s[a]!==e[a]||!Object.prototype.hasOwnProperty.call(e,a))return!1}return!0}function cu(s,e="Copy the URL below"){return new Promise(t=>{const i=document.createElement("textarea");i.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),i.value=s,document.body.appendChild(i),i.select();const r=()=>{document.body.removeChild(i),window.prompt(e,s),t()};try{return document.execCommand("copy")?(document.body.removeChild(i),t()):r()}catch{return document.body.removeChild(i),r()}})}function hu({file:s,uploadInProgressOrComplete:e,metaFields:t,canEditFile:i,i18n:r,onClick:n}){return!e&&t&&t.length>0||!e&&i(s)?d("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":r("editFileWithFilename",{file:s.meta.name}),title:r("editFileWithFilename",{file:s.meta.name}),onClick:()=>n(),children:d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14",children:d("g",{fillRule:"evenodd",children:[d("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",fillRule:"nonzero"}),d("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),d("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})]})})}):null}function uu({i18n:s,onClick:e,file:t}){return d("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":s("removeFile",{file:t.meta.name}),title:s("removeFile",{file:t.meta.name}),onClick:()=>e(),children:d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18",children:[d("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"}),d("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"})]})})}function pu({file:s,uppy:e,i18n:t}){const i=r=>{cu(s.uploadURL,t("copyLinkToClipboardFallback")).then(()=>{e.log("Link copied to clipboard."),e.info(t("copyLinkToClipboardSuccess"),"info",3e3)}).catch(e.log).then(()=>r.target.focus({preventScroll:!0}))};return d("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":t("copyLink"),title:t("copyLink"),onClick:r=>i(r),children:d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12",children:d("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"})})})}function fu(s){const{uppy:e,file:t,uploadInProgressOrComplete:i,canEditFile:r,metaFields:n,showLinkToFileUploadResult:a,showRemoveButton:o,i18n:l,toggleFileCard:c,openFileEditor:u}=s;return d("div",{className:"uppy-Dashboard-Item-actionWrapper",children:[d(hu,{i18n:l,file:t,uploadInProgressOrComplete:i,canEditFile:r,metaFields:n,onClick:()=>{n&&n.length>0?c(!0,t.id):u(t)}}),a&&t.uploadURL?d(pu,{file:t,uppy:e,i18n:l}):null,o?d(uu,{i18n:l,file:t,onClick:()=>e.removeFile(t.id)}):null]})}const mu=(s,e)=>(typeof e=="function"?e():e).filter(r=>r.id===s)[0].name;function zo(s){const{file:e,toggleFileCard:t,i18n:i,metaFields:r}=s,{missingRequiredMetaFields:n}=e;if(!(n!=null&&n.length))return null;const a=n.map(o=>mu(o,r)).join(", ");return d("div",{className:"uppy-Dashboard-Item-errorMessage",children:[i("missingRequiredMetaFields",{smart_count:n.length,fields:a})," ",d("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id),children:i("editFile")})]})}const gu=s=>{const{author:e,name:t}=s.file.meta;function i(){return s.isSingleFile&&s.containerHeight>=350?90:s.containerWidth<=352?35:s.containerWidth<=576?60:e?20:30}return d("div",{className:"uppy-Dashboard-Item-name",title:t,children:Oa(t,i())})},yu=s=>{var r;const{author:e}=s.file.meta,t=(r=s.file.remote)==null?void 0:r.providerName,i="·";return e?d("div",{className:"uppy-Dashboard-Item-author",children:[d("a",{href:`${e.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",children:Oa(e.name,13)}),t?d(pe,{children:[` ${i} `,t,` ${i} `]}):null]}):null},vu=s=>s.file.size&&d("div",{className:"uppy-Dashboard-Item-statusSize",children:Ve(s.file.size)}),bu=s=>s.file.isGhost&&d("span",{children:[" • ",d("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>s.toggleAddFilesPanel(!0),children:s.i18n("reSelect")})]}),wu=({file:s,onClick:e})=>s.error?d("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":s.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:e,type:"button",children:"?"}):null;function Su(s){const{file:e,i18n:t,toggleFileCard:i,metaFields:r,toggleAddFilesPanel:n,isSingleFile:a,containerHeight:o,containerWidth:l}=s;return d("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source,children:[d("div",{className:"uppy-Dashboard-Item-fileName",children:[gu({file:e,isSingleFile:a,containerHeight:o,containerWidth:l}),d(wu,{file:e,onClick:()=>alert(e.error)})]}),d("div",{className:"uppy-Dashboard-Item-status",children:[yu({file:e}),vu({file:e}),bu({file:e,toggleAddFilesPanel:n,i18n:t})]}),d(zo,{file:e,i18n:t,toggleFileCard:i,metaFields:r})]})}function _u(s){const{file:e,i18n:t,toggleFileCard:i,metaFields:r,showLinkToFileUploadResult:n}=s,o=e.preview?"rgba(255, 255, 255, 0.5)":Ir(e.type).color;return d("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:o},children:[n&&e.uploadURL&&d("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name,children:d("span",{hidden:!0,children:e.meta.name})}),d(Bo,{file:e}),d(zo,{file:e,i18n:t,toggleFileCard:i,metaFields:r})]})}function Fu(s){if(!s.isUploaded){if(s.error&&!s.hideRetryButton){s.uppy.retryUpload(s.file.id);return}s.resumableUploads&&!s.hidePauseResumeButton?s.uppy.pauseResume(s.file.id):s.individualCancellation&&!s.hideCancelButton&&s.uppy.removeFile(s.file.id)}}function oa(s){return s.isUploaded?s.i18n("uploadComplete"):s.error?s.i18n("retryUpload"):s.resumableUploads?s.file.isPaused?s.i18n("resumeUpload"):s.i18n("pauseUpload"):s.individualCancellation?s.i18n("cancelUpload"):""}function Ms(s){return d("div",{className:"uppy-Dashboard-Item-progress",children:d("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":oa(s),title:oa(s),onClick:()=>Fu(s),children:s.children})})}function _i({children:s}){return d("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle",children:s})}function ks({progress:s}){const e=2*Math.PI*15;return d("g",{children:[d("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),d("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":e,"stroke-dashoffset":e-e/100*s})]})}function Tu(s){return!s.file.progress.uploadStarted||s.file.progress.percentage===void 0?null:s.isUploaded?d("div",{className:"uppy-Dashboard-Item-progress",children:d("div",{className:"uppy-Dashboard-Item-progressIndicator",children:d(_i,{children:[d("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),d("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})]})})}):s.recoveredState?null:s.error&&!s.hideRetryButton?d(Ms,{...s,children:d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19",children:[d("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),d("path",{d:"M7.9 3H10v2H7.9z"}),d("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),d("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"})]})}):s.resumableUploads&&!s.hidePauseResumeButton?d(Ms,{...s,children:d(_i,{children:[d(ks,{progress:s.file.progress.percentage}),s.file.isPaused?d("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):d("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)",children:[d("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),d("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})]})]})}):!s.resumableUploads&&s.individualCancellation&&!s.hideCancelButton?d(Ms,{...s,children:d(_i,{children:[d(ks,{progress:s.file.progress.percentage}),d("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"})]})}):d("div",{className:"uppy-Dashboard-Item-progress",children:d("div",{className:"uppy-Dashboard-Item-progressIndicator",children:d(_i,{children:d(ks,{progress:s.file.progress.percentage})})})})}class Cu extends ee{componentDidMount(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!Lo(this.props,e)}componentDidUpdate(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){const{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){const{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,i=!!e.progress.uploadComplete&&!t&&!e.error,r=!!e.progress.uploadStarted||!!t,n=e.progress.uploadStarted&&!e.progress.uploadComplete||t,a=e.error||!1,{isGhost:o}=e;let l=(this.props.individualCancellation||!n)&&!i;i&&this.props.showRemoveButtonAfterComplete&&(l=!0);const c=fe({"uppy-Dashboard-Item":!0,"is-inprogress":n&&!this.props.recoveredState,"is-processing":t,"is-complete":i,"is-error":!!a,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":o});return d("div",{className:c,id:`uppy_${e.id}`,role:this.props.role,children:[d("div",{className:"uppy-Dashboard-Item-preview",children:[d(_u,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),d(Tu,{uppy:this.props.uppy,file:e,error:a,isUploaded:i,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})]}),d("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons",children:[d(Su,{file:e,containerWidth:this.props.containerWidth,containerHeight:this.props.containerHeight,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields,isSingleFile:this.props.isSingleFile}),d(fu,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:r,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})]})]})}}function Eu(s,e){const t=[];let i=[];return s.forEach(r=>{i.length<e?i.push(r):(t.push(i),i=[r])}),i.length&&t.push(i),t}function Pu({id:s,i18n:e,uppy:t,files:i,resumableUploads:r,hideRetryButton:n,hidePauseResumeButton:a,hideCancelButton:o,showLinkToFileUploadResult:l,showRemoveButtonAfterComplete:c,metaFields:u,isSingleFile:h,toggleFileCard:p,handleRequestThumbnail:m,handleCancelThumbnail:y,recoveredState:b,individualCancellation:S,itemsPerRow:F,openFileEditor:_,canEditFile:T,toggleAddFilesPanel:R,containerWidth:P,containerHeight:v}){const w=F===1?71:200,M=Tr(()=>{const I=($,A)=>Number(i[A].isGhost)-Number(i[$].isGhost),U=Object.keys(i);return b&&U.sort(I),Eu(U,F)},[i,F,b]),N=I=>d("div",{class:"uppy-Dashboard-filesInner",role:"presentation",children:I.map(U=>d(Cu,{uppy:t,id:s,i18n:e,resumableUploads:r,individualCancellation:S,hideRetryButton:n,hidePauseResumeButton:a,hideCancelButton:o,showLinkToFileUploadResult:l,showRemoveButtonAfterComplete:c,metaFields:u,recoveredState:b,isSingleFile:h,containerWidth:P,containerHeight:v,toggleFileCard:p,handleRequestThumbnail:m,handleCancelThumbnail:y,role:"listitem",openFileEditor:_,canEditFile:T,toggleAddFilesPanel:R,file:i[U]},U))},I[0]);return h?d("div",{class:"uppy-Dashboard-files",children:N(M[0])}):d(Yl,{class:"uppy-Dashboard-files",role:"list",data:M,renderRow:N,rowHeight:w})}const la=300;class xu extends ee{constructor(){super(...arguments);f(this,"ref",Bl())}componentWillEnter(t){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(t,la)}componentWillLeave(t){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(t,la)}render(){const{children:t}=this.props;return d("div",{className:"uppy-Informer-animated",ref:this.ref,children:t})}}function Ru(s,e){return Object.assign(s,e)}function Mu(s,e){return(s==null?void 0:s.key)??e}function ku(s,e){const t=s._ptgLinkedRefs||(s._ptgLinkedRefs={});return t[e]||(t[e]=i=>{s.refs[e]=i})}function Ot(s){const e={};for(let t=0;t<s.length;t++)if(s[t]!=null){const i=Mu(s[t],t.toString(36));e[i]=s[t]}return e}function Au(s,e){s=s||{},e=e||{};const t=a=>Object.hasOwn(e,a)?e[a]:s[a],i={};let r=[];for(const a in s)Object.hasOwn(e,a)?r.length&&(i[a]=r,r=[]):r.push(a);const n={};for(const a in e){if(Object.hasOwn(i,a))for(let o=0;o<i[a].length;o++){const l=i[a][o];n[i[a][o]]=t(l)}n[a]=t(a)}for(let a=0;a<r.length;a++)n[r[a]]=t(r[a]);return n}const Ou=s=>s;class $o extends ee{constructor(e,t){super(e,t),this.refs={},this.state={children:Ot(Re(Re(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){const e=this.state.children;for(const t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){const t=Ot(Re(e.children)||[]),i=this.state.children;this.setState(n=>({children:Au(n.children,t)}));let r;for(r in t)if(Object.hasOwn(t,r)){const n=i&&Object.hasOwn(i,r);t[r]&&n&&this.currentlyTransitioningKeys[r]?(this.keysToEnter.push(r),this.keysToAbortLeave.push(r)):t[r]&&!n&&!this.currentlyTransitioningKeys[r]&&this.keysToEnter.push(r)}for(r in i)if(Object.hasOwn(i,r)){const n=t&&Object.hasOwn(t,r);i[r]&&!n&&!this.currentlyTransitioningKeys[r]&&this.keysToLeave.push(r)}}componentDidUpdate(){const{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);const{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){const t=this.keysToAbortLeave.indexOf(e);t!==-1&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t!=null&&t.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){const t=this.refs[e];t!=null&&t.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const i=Ot(Re(this.props.children)||[]);(!i||!Object.hasOwn(i,e))&&this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t!=null&&t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){const t=this.refs[e];t!=null&&t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const i=Ot(Re(this.props.children)||[]);(!i||!Object.hasOwn(i,e))&&this.performLeave(e)}performLeave(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;this.currentlyTransitioningKeys[e]=!0;const i=this.refs[e];i!=null&&i.componentWillLeave?i.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;const i=this.refs[e];i!=null&&i.componentDidLeave&&i.componentDidLeave(),delete this.currentlyTransitioningKeys[e];const r=Ot(Re(this.props.children)||[]);if(r&&Object.hasOwn(r,e))this.performEnter(e);else{const n=Ru({},this.state.children);delete n[e],this.setState({children:n})}}render({childFactory:e,transitionLeave:t,transitionName:i,transitionAppear:r,transitionEnter:n,transitionLeaveTimeout:a,transitionEnterTimeout:o,transitionAppearTimeout:l,component:c,...u},{children:h}){const p=Object.entries(h).map(([m,y])=>{if(!y)return;const b=ku(this,m);return ja(e(y),{ref:b,key:m})}).filter(Boolean);return wr(c,u,p)}}$o.defaultProps={component:"span",childFactory:Ou};class da extends ee{render(){const{info:e}=this.props.uppy.getState();return d("div",{className:"uppy uppy-Informer",children:d($o,{children:e.map(t=>d(xu,{children:d("p",{role:"alert",children:[t.message," ",t.details&&d("span",{"aria-label":t.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${t.message}
|
|
30
|
+
|
|
31
|
+
${t.details}`),children:"?"})]})},t.message))})})}}function Du({activePickerPanel:s,className:e,hideAllPanels:t,i18n:i,state:r,uppy:n}){const a=$t(null);return d("div",{className:fe("uppy-DashboardContent-panel",e),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${s.id}`,onDragOver:Ne,onDragLeave:Ne,onDrop:Ne,onPaste:Ne,children:[d("div",{className:"uppy-DashboardContent-bar",children:[d("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:i("importFrom",{name:s.name})}),d("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t,children:i("cancel")})]}),d("div",{ref:a,className:"uppy-DashboardContent-panelBody",children:n.getPlugin(s.id).render(r,a.current)})]})}const me={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function Nu(s,e,t,i={}){if(s)return me.STATE_ERROR;if(e)return me.STATE_COMPLETE;if(t)return me.STATE_PAUSED;let r=me.STATE_WAITING;const n=Object.keys(i);for(let a=0;a<n.length;a++){const{progress:o}=i[n[a]];if(o.uploadStarted&&!o.uploadComplete)return me.STATE_UPLOADING;o.preprocess&&r!==me.STATE_UPLOADING&&(r=me.STATE_PREPROCESSING),o.postprocess&&r!==me.STATE_UPLOADING&&r!==me.STATE_PREPROCESSING&&(r=me.STATE_POSTPROCESSING)}return r}function Iu({files:s,i18n:e,isAllComplete:t,isAllErrored:i,isAllPaused:r,inProgressNotPausedFiles:n,newFiles:a,processingFiles:o}){switch(Nu(i,t,r,s)){case"uploading":return e("uploadingXFiles",{smart_count:n.length});case"preprocessing":case"postprocessing":return e("processingXFiles",{smart_count:o.length});case"paused":return e("uploadPaused");case"waiting":return e("xFilesSelected",{smart_count:a.length});case"complete":return e("uploadComplete");case"error":return e("error")}}function Uu(s){const{i18n:e,isAllComplete:t,hideCancelButton:i,maxNumberOfFiles:r,toggleAddFilesPanel:n,uppy:a}=s;let{allowNewUpload:o}=s;return o&&r&&(o=s.totalFileCount<s.maxNumberOfFiles),d("div",{className:"uppy-DashboardContent-bar",children:[!t&&!i?d("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>a.cancelAll(),children:e("cancel")}):d("div",{}),d("div",{className:"uppy-DashboardContent-title",children:d(Iu,{...s})}),o?d("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>n(!0),children:[d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15",children:d("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})}),d("span",{className:"uppy-DashboardContent-addMoreCaption",children:e("addMore")})]}):d("div",{})]})}const nt="uppy-transition-slideDownUp",ca=250;function Fi({children:s}){const[e,t]=Ct(null),[i,r]=Ct(""),n=$t(),a=$t(),o=$t(),l=Oi(()=>{r(`${nt}-enter`),cancelAnimationFrame(o.current),clearTimeout(a.current),a.current=void 0,o.current=requestAnimationFrame(()=>{r(`${nt}-enter ${nt}-enter-active`),n.current=setTimeout(()=>{r("")},ca)})},[]),c=Oi(()=>{r(`${nt}-leave`),cancelAnimationFrame(o.current),clearTimeout(n.current),n.current=void 0,o.current=requestAnimationFrame(()=>{r(`${nt}-leave ${nt}-leave-active`),a.current=setTimeout(()=>{t(null),r("")},ca)})},[]);return Ai(()=>{const u=Re(s)[0];e!==u&&(u&&!e?l():e&&!u&&!a.current&&c(),t(u))},[s,e,l,c]),Ai(()=>()=>{clearTimeout(n.current),clearTimeout(a.current),cancelAnimationFrame(o.current)},[]),e?ja(e,{className:fe(i,e.props.className)}):null}const ge={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"},Bu="·",ha=()=>` ${Bu} `;function Lu(s){const{newFiles:e,isUploadStarted:t,recoveredState:i,i18n:r,uploadState:n,isSomeGhost:a,startUpload:o}=s,l=fe("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":n===ge.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":a}),c=e&&t&&!i?r("uploadXNewFiles",{smart_count:e}):r("uploadXFiles",{smart_count:e});return d("button",{type:"button",className:l,"aria-label":r("uploadXFiles",{smart_count:e}),onClick:o,disabled:a,"data-uppy-super-focusable":!0,children:c})}function zu(s){const{i18n:e,uppy:t}=s;return d("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e("retryUpload"),onClick:()=>t.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry",children:[d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10",children:d("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})}),e("retry")]})}function $u(s){const{i18n:e,uppy:t}=s;return d("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e("cancel"),"aria-label":e("cancel"),onClick:()=>t.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0,children:d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16",children:d("g",{fill:"none",fillRule:"evenodd",children:[d("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),d("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"})]})})})}function Hu(s){const{isAllPaused:e,i18n:t,isAllComplete:i,resumableUploads:r,uppy:n}=s,a=t(e?"resume":"pause");function o(){if(!i){if(!r){n.cancelAll();return}if(e){n.resumeAll();return}n.pauseAll()}}return d("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:o,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0,children:d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16",children:d("g",{fill:"none",fillRule:"evenodd",children:[d("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),d("path",{fill:"#FFF",d:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"})]})})})}function qu(s){const{i18n:e,doneButtonHandler:t}=s;return d("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:t,"data-uppy-super-focusable":!0,children:e("done")})}function Ho(){return d("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14",children:d("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",fillRule:"evenodd"})})}function Vu(s){const{progress:e}=s,{value:t,mode:i,message:r}=e;return d("div",{className:"uppy-StatusBar-content",children:[d(Ho,{}),i==="determinate"?`${Math.round(t*100)}% · `:"",r]})}function ju(s){const{numUploads:e,complete:t,totalUploadedSize:i,totalSize:r,totalETA:n,i18n:a}=s,o=e>1,l=Ve(i);return d("div",{className:"uppy-StatusBar-statusSecondary",children:[o&&a("filesUploadedOfTotal",{complete:t,smart_count:e}),d("span",{className:"uppy-StatusBar-additionalInfo",children:[o&&ha(),r!=null?a("dataUploadedOfTotal",{complete:l,total:Ve(r)}):a("dataUploadedOfUnknown",{complete:l}),ha(),n!=null&&a("xTimeLeft",{time:kl(n)})]})]})}function qo(s){const{i18n:e,complete:t,numUploads:i}=s;return d("div",{className:"uppy-StatusBar-statusSecondary",children:e("filesUploadedOfTotal",{complete:t,smart_count:i})})}function Wu(s){const{i18n:e,newFiles:t,startUpload:i}=s,r=fe("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return d("div",{className:"uppy-StatusBar-statusSecondary",children:[d("div",{className:"uppy-StatusBar-statusSecondaryHint",children:e("xMoreFilesAdded",{smart_count:t})}),d("button",{type:"button",className:r,"aria-label":e("uploadXFiles",{smart_count:t}),onClick:i,children:e("upload")})]})}function Gu(s){const{i18n:e,supportsUploadProgress:t,totalProgress:i,hideProgressDetails:r,isUploadStarted:n,isAllComplete:a,isAllPaused:o,newFiles:l,numUploads:c,complete:u,totalUploadedSize:h,totalSize:p,totalETA:m,startUpload:y}=s,b=l&&n;if(!n||a)return null;const S=e(o?"paused":"uploading");function F(){return!o&&!b&&!r?t?d(ju,{numUploads:c,complete:u,totalUploadedSize:h,totalSize:p,totalETA:m,i18n:e}):d(qo,{i18n:e,complete:u,numUploads:c}):null}return d("div",{className:"uppy-StatusBar-content",title:S,children:[o?null:d(Ho,{}),d("div",{className:"uppy-StatusBar-status",children:[d("div",{className:"uppy-StatusBar-statusPrimary",children:t&&i!==0?`${S}: ${i}%`:S}),F(),b?d(Wu,{i18n:e,newFiles:l,startUpload:y}):null]})]})}function Xu(s){const{i18n:e}=s;return d("div",{className:"uppy-StatusBar-content",role:"status",title:e("complete"),children:d("div",{className:"uppy-StatusBar-status",children:d("div",{className:"uppy-StatusBar-statusPrimary",children:[d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11",children:d("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})}),e("complete")]})})})}function Yu(s){const{error:e,i18n:t,complete:i,numUploads:r}=s;function n(){const a=`${t("uploadFailed")}
|
|
32
|
+
|
|
33
|
+
${e}`;alert(a)}return d("div",{className:"uppy-StatusBar-content",title:t("uploadFailed"),children:[d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11",children:d("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"})}),d("div",{className:"uppy-StatusBar-status",children:[d("div",{className:"uppy-StatusBar-statusPrimary",children:[t("uploadFailed"),d("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":t("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:n,type:"button",children:"?"})]}),d(qo,{i18n:t,complete:i,numUploads:r})]})]})}function As(s){const e=[];let t="indeterminate",i;for(const{progress:n}of Object.values(s)){const{preprocess:a,postprocess:o}=n;i==null&&(a||o)&&({mode:t,message:i}=a||o),(a==null?void 0:a.mode)==="determinate"&&e.push(a.value),(o==null?void 0:o.mode)==="determinate"&&e.push(o.value)}const r=e.reduce((n,a)=>n+a/e.length,0);return{mode:t,message:i,value:r}}const{STATE_ERROR:ua,STATE_WAITING:Ku,STATE_PREPROCESSING:Os,STATE_UPLOADING:Ti,STATE_POSTPROCESSING:Ds,STATE_COMPLETE:Ci}=ge;function Ju({newFiles:s,allowNewUpload:e,isUploadInProgress:t,isAllPaused:i,resumableUploads:r,error:n,hideUploadButton:a=void 0,hidePauseResumeButton:o=!1,hideCancelButton:l=!1,hideRetryButton:c=!1,recoveredState:u,uploadState:h,totalProgress:p,files:m,supportsUploadProgress:y,hideAfterFinish:b=!1,isSomeGhost:S,doneButtonHandler:F=void 0,isUploadStarted:_,i18n:T,startUpload:R,uppy:P,isAllComplete:v,hideProgressDetails:w=void 0,numUploads:M,complete:N,totalSize:I,totalETA:U,totalUploadedSize:$}){function A(){switch(h){case Ds:case Os:{const hi=As(m);return hi.mode==="determinate"?hi.value*100:p}case ua:return null;case Ti:return y?p:null;default:return p}}function H(){switch(h){case Ds:case Os:{const{mode:hi}=As(m);return hi==="indeterminate"}case Ti:return!y;default:return!1}}const z=A(),J=z??100,re=!n&&s&&(!t&&!i||u)&&e&&!a,se=!l&&h!==Ku&&h!==Ci,ae=r&&!o&&h===Ti,Et=n&&!v&&!c,Pt=F&&h===Ci,li=fe("uppy-StatusBar-progress",{"is-indeterminate":H()}),di=fe("uppy-StatusBar",`is-${h}`,{"has-ghosts":S}),ci=(()=>{switch(h){case Os:case Ds:return d(Vu,{progress:As(m)});case Ci:return d(Xu,{i18n:T});case ua:return d(Yu,{error:n,i18n:T,numUploads:M,complete:N});case Ti:return d(Gu,{i18n:T,supportsUploadProgress:y,totalProgress:p,hideProgressDetails:w,isUploadStarted:_,isAllComplete:v,isAllPaused:i,newFiles:s,numUploads:M,complete:N,totalUploadedSize:$,totalSize:I,totalETA:U,startUpload:R});default:return null}})();return!(re||Et||ae||se||Pt)&&!ci||h===Ci&&b?null:d("div",{className:di,children:[d("div",{className:li,style:{width:`${J}%`},role:"progressbar","aria-label":`${J}%`,"aria-valuetext":`${J}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":z}),ci,d("div",{className:"uppy-StatusBar-actions",children:[re?d(Lu,{newFiles:s,isUploadStarted:_,recoveredState:u,i18n:T,isSomeGhost:S,startUpload:R,uploadState:h}):null,Et?d(zu,{i18n:T,uppy:P}):null,ae?d(Hu,{isAllPaused:i,i18n:T,isAllComplete:v,resumableUploads:r,uppy:P}):null,se?d($u,{i18n:T,uppy:P}):null,Pt?d(qu,{i18n:T,doneButtonHandler:F}):null]})]})}const Qu=2e3,Zu=2e3;function ep(s,e,t,i){if(s)return ge.STATE_ERROR;if(e)return ge.STATE_COMPLETE;if(t)return ge.STATE_WAITING;let r=ge.STATE_WAITING;const n=Object.keys(i);for(let a=0;a<n.length;a++){const{progress:o}=i[n[a]];if(o.uploadStarted&&!o.uploadComplete)return ge.STATE_UPLOADING;o.preprocess&&(r=ge.STATE_PREPROCESSING),o.postprocess&&r!==ge.STATE_PREPROCESSING&&(r=ge.STATE_POSTPROCESSING)}return r}var ke,we,Qe,Pe,si,qi,Vo;class tp extends ee{constructor(){super(...arguments);E(this,qi);E(this,ke);E(this,we);E(this,Qe);E(this,Pe);E(this,si,()=>{const{recoveredState:t}=this.props.uppy.getState();if(k(this,Qe,null),k(this,Pe,null),t){k(this,we,Object.values(t.files).reduce((i,{progress:r})=>i+(r.bytesUploaded||0),0)),this.props.uppy.emit("restore-confirmed");return}k(this,ke,performance.now()),k(this,we,0)});f(this,"startUpload",()=>this.props.uppy.upload().catch((()=>{})))}componentDidMount(){k(this,ke,performance.now()),k(this,we,this.props.uppy.getFiles().reduce((t,i)=>t+(i.progress.bytesUploaded||0),0)),this.props.uppy.on("upload",g(this,si))}componentWillUnmount(){this.props.uppy.off("upload",g(this,si))}render(){const{capabilities:t,files:i,allowNewUpload:r,totalProgress:n,error:a,recoveredState:o}=this.props.uppy.getState(),{newFiles:l,startedFiles:c,completeFiles:u,isUploadStarted:h,isAllComplete:p,isAllPaused:m,isUploadInProgress:y,isSomeGhost:b}=this.props.uppy.getObjectOfFilesPerState(),S=o?Object.values(i):l,F=!!t.resumableUploads,_=t.uploadProgress!==!1;let T=null,R=0;c.every(v=>v.progress.bytesTotal!=null&&v.progress.bytesTotal!==0)?(T=0,c.forEach(v=>{T+=v.progress.bytesTotal||0,R+=v.progress.bytesUploaded||0})):c.forEach(v=>{R+=v.progress.bytesUploaded||0});const P=C(this,qi,Vo).call(this,{uploaded:R,total:T});return d(Ju,{error:a,uploadState:ep(a,p,o,i||{}),allowNewUpload:r,totalProgress:n,totalSize:T,totalUploadedSize:R,isAllComplete:p,isAllPaused:m,isUploadStarted:h,isUploadInProgress:y,isSomeGhost:b,recoveredState:o,complete:u.length,newFiles:S.length,numUploads:c.length,totalETA:P,files:i,i18n:this.props.i18n,uppy:this.props.uppy,startUpload:this.startUpload,doneButtonHandler:this.props.doneButtonHandler,resumableUploads:F,supportsUploadProgress:_,hideProgressDetails:this.props.hideProgressDetails,hideUploadButton:this.props.hideUploadButton,hideRetryButton:this.props.hideRetryButton,hidePauseResumeButton:this.props.hidePauseResumeButton,hideCancelButton:this.props.hideCancelButton,hideAfterFinish:this.props.hideAfterFinish})}}ke=new WeakMap,we=new WeakMap,Qe=new WeakMap,Pe=new WeakMap,si=new WeakMap,qi=new WeakSet,Vo=function(t){if(t.total==null||t.total===0)return null;const i=t.total-t.uploaded;if(i<=0)return null;g(this,ke)??k(this,ke,performance.now());const r=performance.now()-g(this,ke);if(r===0)return Math.round((g(this,Pe)??0)/100)/10;if(g(this,we)==null)return k(this,we,t.uploaded),null;const n=t.uploaded-g(this,we);if(k(this,we,t.uploaded),n<=0)return Math.round((g(this,Pe)??0)/100)/10;const a=n/r;if(!Number.isFinite(a)||a<=0)return null;const o=g(this,Qe)==null?a:zr(a,g(this,Qe),Qu,r);if(!Number.isFinite(o)||o<=0)return null;k(this,Qe,o);const l=i/o;if(!Number.isFinite(l)||l<0)return null;const c=Math.max((g(this,Pe)??0)-r,0),u=g(this,Pe)==null?l:zr(l,c,Zu,r);return!Number.isFinite(u)||u<0?null:(k(this,Pe,u),k(this,ke,performance.now()),Math.round(u/100)/10)};const pa=900,fa=700,Ns=576,ma=330;function ip(s){const e=s.totalFileCount===0,t=s.totalFileCount===1,i=s.containerWidth>Ns,r=s.containerHeight>ma,n=fe({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":s.disabled,"uppy-Dashboard--animateOpenClose":s.animateOpenClose,"uppy-Dashboard--isClosing":s.isClosing,"uppy-Dashboard--isDraggingOver":s.isDraggingOver,"uppy-Dashboard--modal":!s.inline,"uppy-size--md":s.containerWidth>Ns,"uppy-size--lg":s.containerWidth>fa,"uppy-size--xl":s.containerWidth>pa,"uppy-size--height-md":s.containerHeight>ma,"uppy-Dashboard--isAddFilesPanelVisible":s.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":s.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":s.singleFileFullScreen&&t&&r});let a=1;s.containerWidth>pa?a=5:s.containerWidth>fa?a=4:s.containerWidth>Ns&&(a=3);const o=s.showSelectedFiles&&!e,l=s.recoveredState?Object.keys(s.recoveredState.files).length:null,c=s.files?Object.keys(s.files).filter(p=>s.files[p].isGhost).length:0,u=()=>c>0?s.i18n("recoveredXFiles",{smart_count:c}):s.i18n("recoveredAllFiles");return d("div",{className:n,"data-uppy-theme":s.theme,"data-uppy-num-acquirers":s.acquirers.length,"data-uppy-drag-drop-supported":!s.disableLocalFiles&&xl(),"aria-hidden":s.inline?"false":s.isHidden,"aria-disabled":s.disabled,"aria-label":s.inline?s.i18n("dashboardTitle"):s.i18n("dashboardWindowTitle"),onPaste:s.handlePaste,onDragOver:s.handleDragOver,onDragLeave:s.handleDragLeave,onDrop:s.handleDrop,children:[d("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:s.handleClickOutside}),d("div",{className:"uppy-Dashboard-inner",role:s.inline?void 0:"dialog",style:{width:s.inline&&s.width?s.width:"",height:s.inline&&s.height?s.height:""},children:[s.inline?null:d("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":s.i18n("closeModal"),title:s.i18n("closeModal"),onClick:s.closeModal,children:d("span",{"aria-hidden":"true",children:"×"})}),d("div",{className:"uppy-Dashboard-innerWrap",children:[d("div",{className:"uppy-Dashboard-dropFilesHereHint",children:s.i18n("dropHint")}),o&&d(Uu,{...s}),l&&d("div",{className:"uppy-Dashboard-serviceMsg",children:[d("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19",children:d("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd",children:[d("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),d("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),d("circle",{fill:"#000",cx:"12",cy:"17",r:"1"})]})}),d("strong",{className:"uppy-Dashboard-serviceMsg-title",children:s.i18n("sessionRestored")}),d("div",{className:"uppy-Dashboard-serviceMsg-text",children:u()})]}),o?d(Pu,{id:s.id,i18n:s.i18n,uppy:s.uppy,files:s.files,resumableUploads:s.resumableUploads,hideRetryButton:s.hideRetryButton,hidePauseResumeButton:s.hidePauseResumeButton,hideCancelButton:s.hideCancelButton,showLinkToFileUploadResult:s.showLinkToFileUploadResult,showRemoveButtonAfterComplete:s.showRemoveButtonAfterComplete,metaFields:s.metaFields,toggleFileCard:s.toggleFileCard,handleRequestThumbnail:s.handleRequestThumbnail,handleCancelThumbnail:s.handleCancelThumbnail,recoveredState:s.recoveredState,individualCancellation:s.individualCancellation,openFileEditor:s.openFileEditor,canEditFile:s.canEditFile,toggleAddFilesPanel:s.toggleAddFilesPanel,isSingleFile:t,itemsPerRow:a,containerWidth:s.containerWidth,containerHeight:s.containerHeight}):d(Uo,{i18n:s.i18n,i18nArray:s.i18nArray,acquirers:s.acquirers,handleInputChange:s.handleInputChange,maxNumberOfFiles:s.maxNumberOfFiles,allowedFileTypes:s.allowedFileTypes,showNativePhotoCameraButton:s.showNativePhotoCameraButton,showNativeVideoCameraButton:s.showNativeVideoCameraButton,nativeCameraFacingMode:s.nativeCameraFacingMode,showPanel:s.showPanel,activePickerPanel:s.activePickerPanel,disableLocalFiles:s.disableLocalFiles,fileManagerSelectionType:s.fileManagerSelectionType,note:s.note,proudlyDisplayPoweredByUppy:s.proudlyDisplayPoweredByUppy}),d(Fi,{children:s.showAddFilesPanel?d(Zh,{...s,isSizeMD:i},"AddFiles"):null}),d(Fi,{children:s.fileCardFor?d(du,{...s},"FileCard"):null}),d(Fi,{children:s.activePickerPanel?d(Du,{...s},"Picker"):null}),d(Fi,{children:s.showFileEditor?d(eu,{...s},"Editor"):null}),d("div",{className:"uppy-Dashboard-progressindicators",children:[!s.disableInformer&&d(da,{uppy:s.uppy}),!s.disableStatusBar&&d(tp,{uppy:s.uppy,i18n:s.i18n,hideProgressDetails:s.hideProgressDetails,hideUploadButton:s.hideUploadButton,hideRetryButton:s.hideRetryButton,hidePauseResumeButton:s.hidePauseResumeButton,hideCancelButton:s.hideCancelButton,hideAfterFinish:s.hideProgressAfterFinish,doneButtonHandler:s.doneButtonHandler}),!s.disableInformer&&d(da,{uppy:s.uppy}),s.progressindicators.map(p=>s.uppy.getPlugin(p.id).render(s.state))]})]})]})]})}const sp={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editImage:"Edit image",editing:"Editing %{file}",error:"Error",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",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"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."},takePictureBtn:"Take Picture",recordVideoBtn:"Record Video",uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",dataUploadedOfUnknown:"%{complete} of unknown",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function jo(s,e){if(e){const t=s.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return s}function rp(){let s=!1;return Th((t,i)=>{const r=jo(t,i),n=r.contains(document.activeElement);if(n&&s)return;const a=r.querySelector("[data-uppy-super-focusable]");if(!(n&&!a))if(a)a.focus({preventScroll:!0}),s=!0;else{const o=r.querySelector(_a);o==null||o.focus({preventScroll:!0}),s=!1}},260)}function ga(s,e){const t=e[0];t&&(t.focus(),s.preventDefault())}function np(s,e){const t=e[e.length-1];t&&(t.focus(),s.preventDefault())}function ap(s){return s.contains(document.activeElement)}function Wo(s,e,t){const i=jo(t,e),r=tt(i.querySelectorAll(_a)),n=r.indexOf(document.activeElement);ap(i)?s.shiftKey&&n===0?np(s,r):!s.shiftKey&&n===r.length-1&&ga(s,r):ga(s,r)}function op(s,e,t){e===null||Wo(s,e,t)}const ya=9,lp=27;function va(){const s={};return s.promise=new Promise((e,t)=>{s.resolve=e,s.reject=t}),s}const dp={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:Ch,showLinkToFileUploadResult:!1,hideProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,disabled:!1,disableLocalFiles:!1,nativeCameraFacingMode:"",onDragLeave:()=>{},onDragOver:()=>{},onDrop:()=>{},plugins:[],doneButtonHandler:void 0,onRequestCloseModal:null,inline:!1,animateOpenClose:!0,browserBackButtonClose:!1,closeAfterFinish:!1,closeModalOnClickOutside:!1,disablePageScrollWhenModalOpen:!0,trigger:null,width:750,height:550};var Us,wt,Ze,ri,St,Vi,ji,Wi,et,Gi,Xi,_t,Be,gr,yr;let Go=(Us=class extends Ie{constructor(t,i){var n;const r=(i==null?void 0:i.autoOpen)??null;super(t,{...dp,...i,autoOpen:r});E(this,Be);E(this,wt);f(this,"modalName",`uppy-Dashboard-${Yi()}`);f(this,"superFocus",rp());f(this,"ifFocusedOnUppyRecently",!1);f(this,"dashboardIsDisabled");f(this,"savedScrollPosition");f(this,"savedActiveElement");f(this,"resizeObserver");f(this,"darkModeMediaQuery");f(this,"makeDashboardInsidesVisibleAnywayTimeout");f(this,"removeTarget",t=>{const r=this.getPluginState().targets.filter(n=>n.id!==t.id);this.setPluginState({targets:r})});f(this,"addTarget",t=>{const i=t.id||t.constructor.name,r=t.title||i,n=t.type;if(n!=="acquirer"&&n!=="progressindicator"&&n!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;const a={id:i,name:r,type:n},l=this.getPluginState().targets.slice();return l.push(a),this.setPluginState({targets:l}),this.el});f(this,"hideAllPanels",()=>{var r;const t=this.getPluginState(),i={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};t.activePickerPanel===i.activePickerPanel&&t.showAddFilesPanel===i.showAddFilesPanel&&t.showFileEditor===i.showFileEditor&&t.activeOverlayType===i.activeOverlayType||(this.setPluginState(i),this.uppy.emit("dashboard:close-panel",(r=t.activePickerPanel)==null?void 0:r.id))});f(this,"showPanel",t=>{const{targets:i}=this.getPluginState(),r=i.find(n=>n.type==="acquirer"&&n.id===t);this.setPluginState({activePickerPanel:r,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",t)});f(this,"canEditFile",t=>{const{targets:i}=this.getPluginState();return g(this,et).call(this,i).some(n=>this.uppy.getPlugin(n.id).canEditFile(t))});f(this,"openFileEditor",t=>{const{targets:i}=this.getPluginState(),r=g(this,et).call(this,i);this.setPluginState({showFileEditor:!0,fileCardFor:t.id||null,activeOverlayType:"FileEditor"}),r.forEach(n=>{this.uppy.getPlugin(n.id).selectFile(t)})});f(this,"closeFileEditor",()=>{const{metaFields:t}=this.getPluginState();t&&t.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})});f(this,"saveFileEditor",()=>{const{targets:t}=this.getPluginState();g(this,et).call(this,t).forEach(r=>{this.uppy.getPlugin(r.id).save()}),this.closeFileEditor()});f(this,"openModal",()=>{const{promise:t,resolve:i}=va();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){const r=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",r,!1),i()};this.el.addEventListener("animationend",r,!1)}else this.setPluginState({isHidden:!1}),i();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),t});f(this,"closeModal",t=>{var l;const i=(t==null?void 0:t.manualClose)??!0,{isHidden:r,isClosing:n}=this.getPluginState();if(r||n)return;const{promise:a,resolve:o}=va();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});const c=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",c,!1),o()};this.el.addEventListener("animationend",c,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),o();return document.removeEventListener("keydown",this.handleKeyDownInModal),i&&this.opts.browserBackButtonClose&&(l=history.state)!=null&&l[this.modalName]&&history.back(),this.uppy.emit("dashboard:modal-closed"),a});f(this,"isModalOpen",()=>!this.getPluginState().isHidden||!1);f(this,"requestCloseModal",()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal());f(this,"setDarkModeCapability",t=>{const{capabilities:i}=this.uppy.getState();this.uppy.setState({capabilities:{...i,darkMode:t}})});f(this,"handleSystemDarkModeChange",t=>{const i=t.matches;this.uppy.log(`[Dashboard] Dark mode is ${i?"on":"off"}`),this.setDarkModeCapability(i)});f(this,"toggleFileCard",(t,i)=>{const r=this.uppy.getFile(i);t?this.uppy.emit("dashboard:file-edit-start",r):this.uppy.emit("dashboard:file-edit-complete",r),this.setPluginState({fileCardFor:t?i:null,activeOverlayType:t?"FileCard":null})});f(this,"toggleAddFilesPanel",t=>{this.setPluginState({showAddFilesPanel:t,activeOverlayType:t?"AddFiles":null})});f(this,"addFiles",t=>{const i=t.map(r=>({source:this.id,name:r.name,type:r.type,data:r,meta:{relativePath:r.relativePath||r.webkitRelativePath||null}}));try{this.uppy.addFiles(i)}catch(r){this.uppy.log(r)}});f(this,"startListeningToResize",()=>{this.resizeObserver=new ResizeObserver(t=>{const i=t[0],{width:r,height:n}=i.contentRect;this.setPluginState({containerWidth:r,containerHeight:n,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{const t=this.getPluginState(),i=!this.opts.inline&&t.isHidden;!t.areInsidesReadyToBeVisible&&!i&&(this.uppy.log("[Dashboard] resize event didn’t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)});f(this,"stopListeningToResize",()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)});f(this,"recordIfFocusedOnUppyRecently",t=>{this.el.contains(t.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())});f(this,"disableInteractiveElements",t=>{const i=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],r=g(this,wt)??tt(this.el.querySelectorAll(i)).filter(n=>!n.classList.contains("uppy-Dashboard-close"));for(const n of r)n.tagName==="A"?n.setAttribute("aria-disabled",t):n.disabled=t;t?k(this,wt,r):k(this,wt,null),this.dashboardIsDisabled=t});f(this,"updateBrowserHistory",()=>{var t;(t=history.state)!=null&&t[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)});f(this,"handlePopState",t=>{var i;this.isModalOpen()&&(!t.state||!t.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&((i=t.state)!=null&&i[this.modalName])&&history.back()});f(this,"handleKeyDownInModal",t=>{t.keyCode===lp&&this.requestCloseModal(),t.keyCode===ya&&Wo(t,this.getPluginState().activeOverlayType,this.el)});f(this,"handleClickOutside",()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()});f(this,"handlePaste",t=>{this.uppy.iteratePlugins(r=>{var n;r.type==="acquirer"&&((n=r.handleRootPaste)==null||n.call(r,t))});const i=tt(t.clipboardData.files);i.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(i))});f(this,"handleInputChange",t=>{t.preventDefault();const i=tt(t.currentTarget.files||[]);i.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(i))});f(this,"handleDragOver",t=>{t.preventDefault(),t.stopPropagation();const i=()=>{let o=!0;return this.uppy.iteratePlugins(l=>{var c;(c=l.canHandleRootDrop)!=null&&c.call(l,t)&&(o=!0)}),o},r=()=>{const{types:o}=t.dataTransfer;return o.some(l=>l==="Files")},n=i(),a=r();if(!n&&!a||this.opts.disabled||this.opts.disableLocalFiles&&(a||!n)||!this.uppy.getState().allowNewUpload){t.dataTransfer.dropEffect="none";return}t.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(t)});f(this,"handleDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(t)});f(this,"handleDrop",async t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(a=>{var o;a.type==="acquirer"&&((o=a.handleRootDrop)==null||o.call(a,t))});let i=!1;const r=a=>{this.uppy.log(a,"error"),i||(this.uppy.info(a.message,"error"),i=!0)};this.uppy.log("[Dashboard] Processing dropped files");const n=await Tl(t.dataTransfer,{logDropError:r});n.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(n)),this.opts.onDrop(t)});f(this,"handleRequestThumbnail",t=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",t)});f(this,"handleCancelThumbnail",t=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",t)});f(this,"handleKeyDownInInline",t=>{t.keyCode===ya&&op(t,this.getPluginState().activeOverlayType,this.el)});f(this,"handlePasteOnBody",t=>{this.el.contains(document.activeElement)&&this.handlePaste(t)});f(this,"handleComplete",({failed:t})=>{this.opts.closeAfterFinish&&!(t!=null&&t.length)&&this.requestCloseModal()});f(this,"handleCancelRestore",()=>{this.uppy.emit("restore-canceled")});E(this,Ze,()=>{if(this.opts.disableThumbnailGenerator)return;const t=600,i=this.uppy.getFiles();if(i.length===1){const r=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);r==null||r.setOptions({thumbnailWidth:t});const n={...i[0],preview:void 0};r==null||r.requestThumbnail(n).then(()=>{r==null||r.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}});E(this,ri,t=>{const i=t[0],{metaFields:r}=this.getPluginState(),n=r&&r.length>0,a=this.canEditFile(i);n&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,i.id):a&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(i)});f(this,"initEvents",()=>{if(this.opts.trigger&&!this.opts.inline){const t=$r(this.opts.trigger);t?t.forEach(i=>i.addEventListener("click",this.openModal)):this.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")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-added",g(this,_t)),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),this.uppy.on("files-added",g(this,Ze)),this.uppy.on("file-removed",g(this,Ze)),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.on("files-added",g(this,ri))});f(this,"removeEvents",()=>{const t=$r(this.opts.trigger);!this.opts.inline&&t&&t.forEach(i=>i.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",g(this,_t)),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),this.uppy.off("files-added",g(this,Ze)),this.uppy.off("file-removed",g(this,Ze)),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.off("files-added",g(this,ri))});f(this,"superFocusOnEachUpdate",()=>{const t=this.el.contains(document.activeElement),i=document.activeElement===document.body||document.activeElement===null,r=this.uppy.getState().info.length===0,n=!this.opts.inline;r&&(n||t||i&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()});f(this,"afterUpdate",()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()});f(this,"saveFileCard",(t,i)=>{this.uppy.setFileMeta(i,t),this.toggleFileCard(!1,i)});E(this,St,t=>{const i=this.uppy.getPlugin(t.id);return{...t,icon:i.icon||this.opts.defaultPickerIcon,render:i.render}});E(this,Vi,t=>{const i=this.uppy.getPlugin(t.id);return typeof i.isSupported!="function"?!0:i.isSupported()});E(this,ji,t=>t.filter(i=>i.type==="acquirer"&&g(this,Vi).call(this,i)).map(g(this,St)));E(this,Wi,t=>t.filter(i=>i.type==="progressindicator").map(g(this,St)));E(this,et,t=>t.filter(i=>i.type==="editor").map(g(this,St)));f(this,"render",t=>{const i=this.getPluginState(),{files:r,capabilities:n,allowNewUpload:a}=t,{newFiles:o,uploadStartedFiles:l,completeFiles:c,erroredFiles:u,inProgressFiles:h,inProgressNotPausedFiles:p,processingFiles:m,isUploadStarted:y,isAllComplete:b,isAllPaused:S}=this.uppy.getObjectOfFilesPerState(),F=g(this,ji).call(this,i.targets),_=g(this,Wi).call(this,i.targets),T=g(this,et).call(this,i.targets);let R;return this.opts.theme==="auto"?R=n.darkMode?"dark":"light":R=this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),ip({state:t,isHidden:i.isHidden,files:r,newFiles:o,uploadStartedFiles:l,completeFiles:c,erroredFiles:u,inProgressFiles:h,inProgressNotPausedFiles:p,processingFiles:m,isUploadStarted:y,isAllComplete:b,isAllPaused:S,totalFileCount:Object.keys(r).length,totalProgress:t.totalProgress,allowNewUpload:a,acquirers:F,theme:R,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:i.activePickerPanel,showFileEditor:i.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:i.isClosing,progressindicators:_,editors:T,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:t.recoveredState,metaFields:i.metaFields,resumableUploads:n.resumableUploads||!1,individualCancellation:n.individualCancellation,isMobileDevice:n.isMobileDevice,fileCardFor:i.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:i.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:i.containerWidth,containerHeight:i.containerHeight,areInsidesReadyToBeVisible:i.areInsidesReadyToBeVisible,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,showNativePhotoCameraButton:this.opts.showNativePhotoCameraButton,showNativeVideoCameraButton:this.opts.showNativeVideoCameraButton,nativeCameraFacingMode:this.opts.nativeCameraFacingMode,singleFileFullScreen:this.opts.singleFileFullScreen,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:i.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop,disableInformer:this.opts.disableInformer,disableStatusBar:this.opts.disableStatusBar,hideProgressDetails:this.opts.hideProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideProgressAfterFinish:this.opts.hideProgressAfterFinish,doneButtonHandler:this.opts.doneButtonHandler})});E(this,Gi,()=>{const{plugins:t}=this.opts;t.forEach(i=>{const r=this.uppy.getPlugin(i);r?r.mount(this,r):this.uppy.log(`[Uppy] Dashboard could not find plugin '${i}', make sure to uppy.use() the plugins you are specifying`,"warning")})});E(this,Xi,()=>{this.uppy.iteratePlugins(g(this,_t))});E(this,_t,t=>{var r;const i=["acquirer","editor"];t&&!((r=t.opts)!=null&&r.target)&&i.includes(t.type)&&(this.getPluginState().targets.some(a=>t.id===a.id)||t.mount(this,t))});f(this,"install",()=>{var l;this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});const{inline:t,closeAfterFinish:i}=this.opts;if(t&&i)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.");const{allowMultipleUploads:r,allowMultipleUploadBatches:n}=this.uppy.opts;(r||n)&&i&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");const{target:a}=this.opts;a&&this.mount(a,this),this.opts.disableThumbnailGenerator||this.uppy.use(Io,{id:C(this,Be,yr).call(this),...C(this,Be,gr).call(this)}),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;const o=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;this.uppy.log(`[Dashboard] Dark mode is ${o?"on":"off"}`),this.setDarkModeCapability(o),this.opts.theme==="auto"&&((l=this.darkModeMediaQuery)==null||l.addListener(this.handleSystemDarkModeChange)),g(this,Gi).call(this),g(this,Xi).call(this),this.initEvents()});f(this,"uninstall",()=>{var i;if(!this.opts.disableThumbnailGenerator){const r=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);r&&this.uppy.removePlugin(r)}const{plugins:t}=this.opts;t.forEach(r=>{const n=this.uppy.getPlugin(r);n&&n.unmount()}),this.opts.theme==="auto"&&((i=this.darkModeMediaQuery)==null||i.removeListener(this.handleSystemDarkModeChange)),this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()});this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=sp,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),(n=this.opts).onRequestCloseModal??(n.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}setOptions(t){var i;super.setOptions(t),(i=this.uppy.getPlugin(C(this,Be,yr).call(this)))==null||i.setOptions(C(this,Be,gr).call(this))}},wt=new WeakMap,Ze=new WeakMap,ri=new WeakMap,St=new WeakMap,Vi=new WeakMap,ji=new WeakMap,Wi=new WeakMap,et=new WeakMap,Gi=new WeakMap,Xi=new WeakMap,_t=new WeakMap,Be=new WeakSet,gr=function(){const{thumbnailWidth:t,thumbnailHeight:i,thumbnailType:r,waitForThumbnailsBeforeUpload:n}=this.opts;return{thumbnailWidth:t,thumbnailHeight:i,thumbnailType:r,waitForThumbnailsBeforeUpload:n,lazy:!n}},yr=function(){return`${this.id}:ThumbnailGenerator`},f(Us,"VERSION",Qh.version),Us);function Xo(s,e,t,i){D.onMounted(()=>{s()}),D.onBeforeUnmount(()=>{t.removePlugin(e.value)}),D.watch(()=>i.value,(r,n)=>{Lo(r,n)||e.value.setOptions({...r})})}const cp=D.defineComponent({name:"Dashboard",props:{uppy:{type:Object,required:!0},props:{type:Object}},setup(s){const e=D.ref(),t=D.ref(),i=D.ref(s.props);return Xo(()=>{const{uppy:n}=s,a={id:"Dashboard",inline:!0,...s.props,target:e.value};n.use(Go,a),t.value=n.getPlugin(a.id)},t,s.uppy,i),()=>D.h("div",{ref:e})}}),hp=D.defineComponent({name:"DashboardModal",props:{uppy:{type:Object,required:!0},props:{type:Object},open:{type:Boolean,required:!0}},setup(s){const e=D.ref(),t=D.ref(),i=D.ref(s.props);return Xo(()=>{const{uppy:n}=s,a={id:"DashboardModal",inline:!1,...s.props,target:e.value};n.use(Go,a),t.value=n.getPlugin(a.id)},t,s.uppy,i),D.watch(()=>s.open,(n,a)=>{n&&!a&&t.value.openModal(),!n&&a&&t.value.closeModal()}),()=>D.h("div",{ref:e})}});var Dt={exports:{}},ba;function up(){if(ba)return Dt.exports;ba=1,Dt.exports=i,Dt.exports.isMobile=i,Dt.exports.default=i;const s=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,e=/CrOS/,t=/android|ipad|playbook|silk/i;function i(r){r||(r={});let n=r.ua;if(!n&&typeof navigator<"u"&&(n=navigator.userAgent),n&&n.headers&&typeof n.headers["user-agent"]=="string"&&(n=n.headers["user-agent"]),typeof n!="string")return!1;let a=s.test(n)&&!e.test(n)||!!r.tablet&&t.test(n);return!a&&r.tablet&&r.featureDetect&&navigator&&navigator.maxTouchPoints>1&&n.indexOf("Macintosh")!==-1&&n.indexOf("Safari")!==-1&&(a=!0),a}return Dt.exports}var pp=up();const fp="5.0.1",mp={version:fp};function Yo(){return d("svg",{"aria-hidden":"true",focusable:"false",fill:"#0097DC",width:"66",height:"55",viewBox:"0 0 66 55",children:d("path",{d:"M57.3 8.433c4.59 0 8.1 3.51 8.1 8.1v29.7c0 4.59-3.51 8.1-8.1 8.1H8.7c-4.59 0-8.1-3.51-8.1-8.1v-29.7c0-4.59 3.51-8.1 8.1-8.1h9.45l4.59-7.02c.54-.54 1.35-1.08 2.16-1.08h16.2c.81 0 1.62.54 2.16 1.08l4.59 7.02h9.45zM33 14.64c-8.62 0-15.393 6.773-15.393 15.393 0 8.62 6.773 15.393 15.393 15.393 8.62 0 15.393-6.773 15.393-15.393 0-8.62-6.773-15.393-15.393-15.393zM33 40c-5.648 0-9.966-4.319-9.966-9.967 0-5.647 4.318-9.966 9.966-9.966s9.966 4.319 9.966 9.966C42.966 35.681 38.648 40 33 40z",fillRule:"evenodd"})})}function gp({onDiscard:s,i18n:e}){return d("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--discard",type:"button",title:e("discardRecordedFile"),"aria-label":e("discardRecordedFile"),onClick:s,"data-uppy-super-focusable":!0,children:d("svg",{width:"13",height:"13",viewBox:"0 0 13 13",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon",children:d("g",{fill:"#FFF",fillRule:"evenodd",children:[d("path",{d:"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"}),d("path",{d:"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"})]})})})}function yp({recording:s,onStartRecording:e,onStopRecording:t,i18n:i}){return s?d("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:i("stopRecording"),"aria-label":i("stopRecording"),onClick:t,"data-uppy-super-focusable":!0,children:d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100",children:d("rect",{x:"15",y:"15",width:"70",height:"70"})})}):d("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:i("startRecording"),"aria-label":i("startRecording"),onClick:e,"data-uppy-super-focusable":!0,children:d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100",children:d("circle",{cx:"50",cy:"50",r:"40"})})})}function vp(s){return`${Math.floor(s/60)}:${String(s%60).padStart(2,"0")}`}function bp({recordingLengthSeconds:s}){const e=vp(s);return d("span",{children:e})}function wp({onSnapshot:s,i18n:e}){return d("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture",type:"button",title:e("takePicture"),"aria-label":e("takePicture"),onClick:s,"data-uppy-super-focusable":!0,children:Yo()})}function Sp({onSubmit:s,i18n:e}){return d("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--submit",type:"button",title:e("submitRecordedFile"),"aria-label":e("submitRecordedFile"),onClick:s,"data-uppy-super-focusable":!0,children:d("svg",{width:"12",height:"9",viewBox:"0 0 12 9",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon",children:d("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})})})}function _p({currentDeviceId:s,videoSources:e,onChangeVideoSource:t}){return d("div",{className:"uppy-Webcam-videoSource",children:d("select",{className:"uppy-u-reset uppy-Webcam-videoSource-select",onChange:i=>{t(i.target.value)},children:e.map(i=>d("option",{value:i.deviceId,selected:i.deviceId===s,children:i.label},i.deviceId))})})}function Ei(s,e){return s.includes(e)}class Fp extends ee{constructor(){super(...arguments);f(this,"videoElement");f(this,"refs")}componentDidMount(){const{onFocus:t}=this.props;t()}componentWillUnmount(){const{onStop:t}=this.props;t()}render(){const{src:t,recordedVideo:i,capturedSnapshot:r,recording:n,modes:a,supportsRecording:o,videoSources:l,showVideoSourceDropdown:c,showRecordingLength:u,onSubmit:h,i18n:p,mirror:m,onSnapshot:y,onStartRecording:b,onStopRecording:S,onDiscardRecordedMedia:F,recordingLengthSeconds:_}=this.props,T=!!i,R=!!r,P=T||R,v=!P&&o&&(Ei(a,"video-only")||Ei(a,"audio-only")||Ei(a,"video-audio")),w=!P&&Ei(a,"picture"),M=o&&u&&!T,N=c&&l&&l.length>1,I={playsInline:!0};return i?(I.muted=!1,I.controls=!0,I.src=i,this.videoElement&&(this.videoElement.srcObject=null)):(I.muted=!0,I.autoPlay=!0,I.srcObject=t),d("div",{className:"uppy uppy-Webcam-container",children:[d("div",{className:"uppy-Webcam-videoContainer",children:r&&!n&&!i?d("div",{className:"uppy-Webcam-imageContainer",children:d("img",{src:r,className:"uppy-Webcam-video",alt:"capturedSnapshot"})}):d("video",{ref:U=>{this.videoElement=U},className:`uppy-Webcam-video ${m?"uppy-Webcam-video--mirrored":""}`,...I})}),d("div",{className:"uppy-Webcam-footer",children:[d("div",{className:"uppy-Webcam-videoSourceContainer",children:N?_p(this.props):null}),d("div",{className:"uppy-Webcam-buttonContainer",children:[w&&d(wp,{onSnapshot:y,i18n:p}),v&&d(yp,{recording:n,onStartRecording:b,onStopRecording:S,i18n:p}),(T||R)&&d(Sp,{onSubmit:h,i18n:p}),(T||R)&&d(gp,{onDiscard:F,i18n:p})]}),d("div",{className:"uppy-Webcam-recordingLength",children:M&&d(bp,{recordingLengthSeconds:_})})]})]})}}const Tp={strings:{pluginNameCamera:"Camera",noCameraTitle:"Camera Not Available",noCameraDescription:"In order to take pictures or record video, please connect a camera device",recordingStoppedMaxSize:"Recording stopped because the file size is about to exceed the limit",submitRecordedFile:"Submit recorded file",discardRecordedFile:"Discard recorded file",smile:"Smile!",takePicture:"Take a picture",startRecording:"Begin video recording",stopRecording:"Stop video recording",recordingLength:"Recording length %{recording_length}",allowAccessTitle:"Please allow access to your camera",allowAccessDescription:"In order to take pictures or record video with your camera, please allow camera access for this site."}};function Cp({icon:s,i18n:e,hasCamera:t}){return d("div",{className:"uppy-Webcam-permissons",children:[d("div",{className:"uppy-Webcam-permissonsIcon",children:s()}),d("div",{className:"uppy-Webcam-title",children:e(t?"allowAccessTitle":"noCameraTitle")}),d("p",{children:e(t?"allowAccessDescription":"noCameraDescription")})]})}function Ep(){return typeof MediaRecorder=="function"&&!!MediaRecorder.prototype&&typeof MediaRecorder.prototype.start=="function"}function wa(s){return s[0]==="."?Bs[s.slice(1)]:s}function Pp(s){return/^video\/[^*]+$/.test(s)}function xp(s){return/^image\/[^*]+$/.test(s)}function Rp(){return navigator.mediaDevices}function Is(s,e){return s.includes(e)}const Mp={onBeforeSnapshot:()=>Promise.resolve(),countdown:!1,modes:["video-audio","video-only","audio-only","picture"],mirror:!0,showVideoSourceDropdown:!1,preferredImageMimeType:null,preferredVideoMimeType:null,showRecordingLength:!1,mobileNativeCamera:pp.isMobile({tablet:!0})};var Ae;class Ko extends Ie{constructor(t,i){super(t,{...Mp,...i});E(this,Ae);f(this,"mediaDevices");f(this,"supportsUserMedia");f(this,"protocol");f(this,"capturedMediaFile");f(this,"icon");f(this,"webcamActive");f(this,"stream",null);f(this,"recorder",null);f(this,"recordingChunks",null);f(this,"recordingLengthTimer");f(this,"captureInProgress",!1);this.mediaDevices=Rp(),this.supportsUserMedia=!!this.mediaDevices,this.protocol=location.protocol.match(/https/i)?"https":"http",this.id=this.opts.id||"Webcam",this.type="acquirer",this.capturedMediaFile=null,this.icon=()=>d("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:d("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383",fillRule:"nonzero"})}),this.defaultLocale=Tp,this.i18nInit(),this.title=this.i18n("pluginNameCamera"),k(this,Ae,this.opts.mirror),this.install=this.install.bind(this),this.setPluginState=this.setPluginState.bind(this),this.render=this.render.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.takeSnapshot=this.takeSnapshot.bind(this),this.startRecording=this.startRecording.bind(this),this.stopRecording=this.stopRecording.bind(this),this.discardRecordedMedia=this.discardRecordedMedia.bind(this),this.submit=this.submit.bind(this),this.oneTwoThreeSmile=this.oneTwoThreeSmile.bind(this),this.focus=this.focus.bind(this),this.changeVideoSource=this.changeVideoSource.bind(this),this.webcamActive=!1,this.opts.countdown&&(this.opts.onBeforeSnapshot=this.oneTwoThreeSmile),this.setPluginState({hasCamera:!1,cameraReady:!1,cameraError:null,recordingLengthSeconds:0,videoSources:[],currentDeviceId:null,capturedSnapshot:null})}getStatus(){const{recordedVideo:t,capturedSnapshot:i,isRecording:r,cameraReady:n,cameraError:a}=this.getPluginState();return r?"recording":t!=null||i!=null?"captured":n?"ready":a?"error":"init"}setOptions(t){super.setOptions({...t,videoConstraints:{...this.opts.videoConstraints,...t==null?void 0:t.videoConstraints}})}hasCameraCheck(){return this.mediaDevices?this.mediaDevices.enumerateDevices().then(t=>t.some(i=>i.kind==="videoinput")):Promise.resolve(!1)}isAudioOnly(){return this.opts.modes.length===1&&this.opts.modes[0]==="audio-only"}getConstraints(t=null){const i=this.opts.modes.indexOf("video-audio")!==-1||this.opts.modes.indexOf("audio-only")!==-1,r=!this.isAudioOnly()&&(this.opts.modes.indexOf("video-audio")!==-1||this.opts.modes.indexOf("video-only")!==-1||this.opts.modes.indexOf("picture")!==-1),n={...this.opts.videoConstraints||{},...t!=null&&{deviceId:t}};return{audio:i,video:r?n:!1}}start(t=null){if(!this.supportsUserMedia)return Promise.reject(new Error("Webcam access not supported"));this.webcamActive=!0,this.opts.mirror&&k(this,Ae,!0);const i=this.getConstraints(t==null?void 0:t.deviceId);this.hasCameraCheck().then(r=>(this.setPluginState({hasCamera:r}),this.mediaDevices.getUserMedia(i).then(n=>{this.stream=n;let a=null;const o=this.isAudioOnly()?n.getAudioTracks():n.getVideoTracks();!t||!t.deviceId?a=o[0].getSettings().deviceId:o.forEach(l=>{l.getSettings().deviceId===t.deviceId&&(a=l.getSettings().deviceId)}),this.updateVideoSources(),this.setPluginState({currentDeviceId:a,cameraReady:!0})}).catch(n=>{this.setPluginState({cameraReady:!1,cameraError:n}),this.uppy.info(n.message,"error")})))}getMediaRecorderOptions(){const t={};if(MediaRecorder.isTypeSupported){const{restrictions:i}=this.uppy.opts;let r=[];this.opts.preferredVideoMimeType?r=[this.opts.preferredVideoMimeType]:i.allowedFileTypes&&(r=i.allowedFileTypes.map(wa).filter(Pp));const n=o=>MediaRecorder.isTypeSupported(o)&&dt(o),a=r.filter(n);a.length>0&&(t.mimeType=a[0])}return t}startRecording(){this.recorder=new MediaRecorder(this.stream,this.getMediaRecorderOptions()),this.recordingChunks=[];let t=!1;this.recorder.addEventListener("dataavailable",i=>{this.recordingChunks.push(i.data);const{restrictions:r}=this.uppy.opts;if(this.recordingChunks.length>1&&r.maxFileSize!=null&&!t){const n=this.recordingChunks.reduce((c,u)=>c+u.size,0),o=(n-this.recordingChunks[0].size)/(this.recordingChunks.length-1)*3,l=Math.max(0,r.maxFileSize-o);n>l&&(t=!0,this.uppy.info(this.i18n("recordingStoppedMaxSize"),"warning",4e3),this.stopRecording())}}),this.recorder.start(500),this.opts.showRecordingLength&&(this.recordingLengthTimer=setInterval(()=>{const i=this.getPluginState().recordingLengthSeconds;this.setPluginState({recordingLengthSeconds:i+1})},1e3)),this.setPluginState({isRecording:!0})}stopRecording(){return new Promise(i=>{this.recorder.addEventListener("stop",()=>{i()}),this.recorder.stop(),this.opts.showRecordingLength&&(clearInterval(this.recordingLengthTimer),this.setPluginState({recordingLengthSeconds:0}))}).then(()=>(this.setPluginState({isRecording:!1}),this.getVideo())).then(i=>{try{this.capturedMediaFile=i,this.setPluginState({recordedVideo:URL.createObjectURL(i.data)}),k(this,Ae,!1)}catch(r){r.isRestriction||this.uppy.log(r)}}).then(()=>{this.recordingChunks=null,this.recorder=null},i=>{throw this.recordingChunks=null,this.recorder=null,i})}discardRecordedMedia(){const{recordedVideo:t,capturedSnapshot:i}=this.getPluginState();t&&URL.revokeObjectURL(t),i&&URL.revokeObjectURL(i),this.setPluginState({recordedVideo:null,capturedSnapshot:null}),this.opts.mirror&&k(this,Ae,!0),this.capturedMediaFile=null}submit(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(t){t.isRestriction||this.uppy.log(t,"error")}}async stop(){if(this.stream){const t=this.stream.getAudioTracks(),i=this.stream.getVideoTracks();t.concat(i).forEach(r=>r.stop())}this.recorder&&await new Promise(t=>{this.recorder.addEventListener("stop",t,{once:!0}),this.recorder.stop(),this.opts.showRecordingLength&&clearInterval(this.recordingLengthTimer)}),this.recordingChunks=null,this.recorder=null,this.webcamActive=!1,this.stream=null,this.setPluginState({recordedVideo:null,capturedSnapshot:null,isRecording:!1,recordingLengthSeconds:0})}getVideoElement(){return this.el.querySelector(".uppy-Webcam-video")}oneTwoThreeSmile(){return new Promise((t,i)=>{let r=this.opts.countdown;const n=setInterval(()=>{if(!this.webcamActive)return clearInterval(n),this.captureInProgress=!1,i(new Error("Webcam is not active"));r?(this.uppy.info(`${r}...`,"warning",800),r--):(clearInterval(n),this.uppy.info(this.i18n("smile"),"success",1500),setTimeout(()=>t(),1500))},1e3)})}async takeSnapshot(){if(!this.captureInProgress){this.captureInProgress=!0;try{await this.opts.onBeforeSnapshot()}catch(t){const i=typeof t=="object"?t.message:t;throw this.uppy.info(i,"error",5e3),new Error(`onBeforeSnapshot: ${i}`)}try{const t=await this.getImage();this.capturedMediaFile=t;const i=URL.createObjectURL(t.data);this.setPluginState({capturedSnapshot:i}),this.captureInProgress=!1}catch(t){this.captureInProgress=!1,t.isRestriction||this.uppy.log(t)}}}getImage(){const t=this.getVideoElement();if(!t)return Promise.reject(new Error("No video element found, likely due to the Webcam tab being closed."));const i=t.videoWidth,r=t.videoHeight,n=document.createElement("canvas");n.width=i,n.height=r,n.getContext("2d").drawImage(t,0,0);const{restrictions:o}=this.uppy.opts;let l=[];this.opts.preferredImageMimeType?l=[this.opts.preferredImageMimeType]:o.allowedFileTypes&&(l=o.allowedFileTypes.map(wa).filter(xp));const c=l[0]||"image/jpeg",u=dt(c)||"jpg",h=`cam-${Date.now()}.${u}`;return ll(n,c).then(p=>({source:this.id,name:h,data:new Blob([p],{type:c}),type:c}))}getVideo(){const t=this.recordingChunks.find(o=>{var l;return((l=o.type)==null?void 0:l.length)>0}).type,i=dt(t);if(!i)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${t}"`));const r=`webcam-${Date.now()}.${i}`,n=new Blob(this.recordingChunks,{type:t}),a={source:this.id,name:r,data:new Blob([n],{type:t}),type:t};return Promise.resolve(a)}focus(){this.opts.countdown&&setTimeout(()=>{this.uppy.info(this.i18n("smile"),"success",1500)},1e3)}changeVideoSource(t){this.stop(),this.start({deviceId:t})}updateVideoSources(){this.mediaDevices.enumerateDevices().then(t=>{this.setPluginState({videoSources:t.filter(i=>i.kind==="videoinput")})})}render(){this.webcamActive||this.start();const t=this.getPluginState();return!t.cameraReady||!t.hasCamera?d(Cp,{icon:Yo,i18n:this.i18n,hasCamera:t.hasCamera}):d(Fp,{...t,onChangeVideoSource:this.changeVideoSource,onSnapshot:this.takeSnapshot,onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onDiscardRecordedMedia:this.discardRecordedMedia,onSubmit:this.submit,onFocus:this.focus,onStop:this.stop,i18n:this.i18n,modes:this.opts.modes,showRecordingLength:this.opts.showRecordingLength,showVideoSourceDropdown:this.opts.showVideoSourceDropdown,supportsRecording:Ep(),recording:t.isRecording,mirror:g(this,Ae),src:this.stream})}install(){var a;const{mobileNativeCamera:t,modes:i,videoConstraints:r}=this.opts,{target:n}=this.opts;if(t&&n){(a=this.getTargetPlugin(n))==null||a.setOptions({showNativeVideoCameraButton:Is(i,"video-only")||Is(i,"video-audio"),showNativePhotoCameraButton:Is(i,"picture"),nativeCameraFacingMode:r==null?void 0:r.facingMode});return}this.setPluginState({cameraReady:!1,recordingLengthSeconds:0}),n&&this.mount(n,this),this.mediaDevices&&(this.updateVideoSources(),this.mediaDevices.ondevicechange=()=>{if(this.updateVideoSources(),this.stream){let o=!0;const{videoSources:l,currentDeviceId:c}=this.getPluginState();l.forEach(u=>{c===u.deviceId&&(o=!1)}),o&&(this.stop(),this.start())}})}uninstall(){this.stop(),this.unmount()}onUnmount(){this.stop()}}Ae=new WeakMap,f(Ko,"VERSION",mp.version);const kp="5.0.1",Ap={version:kp},Op={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function Dp(s,e){let t=e;return t||(t=new Error("Upload error")),typeof t=="string"&&(t=new Error(t)),t instanceof Error||(t=Object.assign(new Error("Upload error"),{data:t})),Rl(s)?(t=new Mi(t,s),t):(t.request=s,t)}function Sa(s){return s.data.slice(0,s.data.size,s.meta.type)}const Np={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""};var Ft,Te,Qo,Zo,el,tl,ni;class Jo extends Ya{constructor(t,i){super(t,{...Np,fieldName:i.bundle?"files[]":"file",...i});E(this,Te);E(this,Ft);f(this,"requests");f(this,"uploaderEvents");E(this,ni,async t=>{if(t.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&!this.opts[Zi]&&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...");const i=this.uppy.getFilesByIds(t),r=ml(i),n=gl(r);if(this.uppy.emit("upload-start",n),this.opts.bundle){if(r.some(o=>o.isRemote))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await C(this,Te,Zo).call(this,r)}else await C(this,Te,tl).call(this,r)});if(this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=Op,this.i18nInit(),Zi in this.opts?this.requests=this.opts[Zi]:this.requests=new Ol(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&typeof this.opts.headers=="function")throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if((i==null?void 0:i.allowedMetaFields)===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),k(this,Ft,r=>async(n,a)=>{var o,l;try{const c=await pl(n,{...a,onBeforeRequest:(p,m)=>{var y,b;return(b=(y=this.opts).onBeforeRequest)==null?void 0:b.call(y,p,m,r)},shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:p=>{const m=Math.ceil(p/1e3),y=new Error(this.i18n("uploadStalled",{seconds:m}));this.uppy.emit("upload-stalled",y,r)},onUploadProgress:p=>{if(p.lengthComputable)for(const{id:m}of r){const y=this.uppy.getFile(m);this.uppy.emit("upload-progress",y,{uploadStarted:y.progress.uploadStarted??0,bytesUploaded:p.loaded/p.total*y.size,bytesTotal:y.size})}}});let u=await((l=(o=this.opts).getResponseData)==null?void 0:l.call(o,c));if(c.responseType==="json")u??(u=c.response);else try{u??(u=JSON.parse(c.responseText))}catch(p){throw new Error("@uppy/xhr-upload expects a JSON response (with a `url` property). To parse non-JSON responses, use `getResponseData` to turn your response into JSON.",{cause:p})}const h=typeof(u==null?void 0:u.url)=="string"?u.url:void 0;for(const{id:p}of r)this.uppy.emit("upload-success",this.uppy.getFile(p),{status:c.status,body:u,uploadURL:h});return c}catch(c){if(c.name==="AbortError")return;const u=c.request;for(const h of r)this.uppy.emit("upload-error",this.uppy.getFile(h.id),Dp(u,c),u);throw c}})}getOptions(t){const i=this.uppy.getState().xhrUpload,{headers:r}=this.opts,n={...this.opts,...i||{},...t.xhrUpload||{},headers:{}};return typeof r=="function"?n.headers=r(t):Object.assign(n.headers,this.opts.headers),i&&Object.assign(n.headers,i.headers),t.xhrUpload&&Object.assign(n.headers,t.xhrUpload.headers),n}addMetadata(t,i,r){qr(r.allowedMetaFields,i).forEach(a=>{const o=i[a];Array.isArray(o)?o.forEach(l=>t.append(a,l)):t.append(a,o)})}createFormDataUpload(t,i){const r=new FormData;this.addMetadata(r,t.meta,i);const n=Sa(t);return t.name?r.append(i.fieldName,n,t.meta.name):r.append(i.fieldName,n),r}createBundledUpload(t,i){const r=new FormData,{meta:n}=this.uppy.getState();return this.addMetadata(r,n,i),t.forEach(a=>{const o=this.getOptions(a),l=Sa(a);a.name?r.append(o.fieldName,l,a.name):r.append(o.fieldName,l)}),r}install(){if(this.opts.bundle){const{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,individualCancellation:!1}})}this.uppy.addUploader(g(this,ni))}uninstall(){if(this.opts.bundle){const{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,individualCancellation:!0}})}this.uppy.removeUploader(g(this,ni))}}Ft=new WeakMap,Te=new WeakSet,Qo=async function(t){const i=new Kl(this.uppy),r=new AbortController,n=this.requests.wrapPromiseFunction(async()=>{const a=this.getOptions(t),o=g(this,Ft).call(this,[t]),l=a.formData?this.createFormDataUpload(t,a):t.data,c=typeof a.endpoint=="string"?a.endpoint:await a.endpoint(t);return o(c,{...a,body:l,signal:r.signal})});i.onFileRemove(t.id,()=>r.abort()),i.onCancelAll(t.id,()=>{r.abort()});try{await n().abortOn(r.signal)}catch(a){if(a.message!=="Cancelled")throw a}finally{i.remove()}},Zo=async function(t){const i=new AbortController,r=this.requests.wrapPromiseFunction(async()=>{const a=this.uppy.getState().xhrUpload??{},o=g(this,Ft).call(this,t),l=this.createBundledUpload(t,{...this.opts,...a}),c=typeof this.opts.endpoint=="string"?this.opts.endpoint:await this.opts.endpoint(t);return o(c,{...this.opts,body:l,signal:i.signal})});function n(){i.abort()}this.uppy.once("cancel-all",n);try{await r().abortOn(i.signal)}catch(a){if(a.message!=="Cancelled")throw a}finally{this.uppy.off("cancel-all",n)}},el=function(t){var n;const i=this.getOptions(t),r=qr(i.allowedMetaFields,t.meta);return{...(n=t.remote)==null?void 0:n.body,protocol:"multipart",endpoint:i.endpoint,size:t.data.size,fieldname:i.fieldName,metadata:Object.fromEntries(r.map(a=>[a,t.meta[a]])),httpMethod:i.method,useFormData:i.formData,headers:i.headers}},tl=async function(t){await Promise.allSettled(t.map(i=>{if(i.isRemote){const r=()=>this.requests,n=new AbortController,a=l=>{l.id===i.id&&n.abort()};this.uppy.on("file-removed",a);const o=this.uppy.getRequestClientForFile(i).uploadRemoteFile(i,C(this,Te,el).call(this,i),{signal:n.signal,getQueue:r});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",a)},{priority:-1})(),o}return C(this,Te,Qo).call(this,i)}))},ni=new WeakMap,f(Jo,"VERSION",Ap.version);const Ip=D.defineComponent({__name:"IkImageUploadEditor",props:D.mergeModels({tools:{type:Array,default:()=>[]},isModal:{type:Boolean,default:!1},uploadFun:{type:Function,default:()=>()=>{}},accept:{type:Array,default:["image/*"]},action:{type:String,default:"#"},disabled:{type:Boolean,default:!1},width:{type:Number,default:580},height:{type:Number,default:350},showProgressDetails:{type:Boolean,default:!0},hideUploadButton:{type:Boolean,default:!1},fileManagerSelectionType:{type:String,default:"both"},minFileSize:{type:Number,default:0},maxFileSize:{type:Number,default:10},maxNumberOfFiles:{type:Number,default:100},minNumberOfFiles:{type:Number,default:1},allowedFileTypes:{type:Array,default:()=>["image/*","video/*"]}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:D.mergeModels(["upload-success","upload-error","dashboard:modal-closed"],["update:open"]),setup(s,{emit:e}){const t=s;Ni.strings.poweredBy="";const i=e,{cToken:r,cUploadUrl:n}=al(t),a=new Ad({locale:{strings:{...Ni.strings,save:"确定",dropHereOr:"拖拽文件到这里,或%{browse}",dropHint:"拖拽文件到这里",browse:"浏览",browseFiles:"浏览本地文件",dropPasteBoth:"拖拽文件到这里,或者%{browse}文件",dropPasteFiles:"拖拽文件到这里,或者%{browse}文件",dropPasteFolders:"拖拽文件到这里,或者%{browse}文件",dropPasteImportBoth:"拖拽文件到这里、粘贴、%{browse}",dropPasteImportFiles:"拖拽文件到这里、粘贴、%{browse}",dropPasteImportFolders:"拖拽文件到这里、粘贴、%{browse}"},pluralize(){return 0}},autoProceed:!1,restrictions:{minFileSize:t.minFileSize*1024*1024,maxFileSize:t.maxFileSize*1024*1024,maxNumberOfFiles:t.maxNumberOfFiles,minNumberOfFiles:t.minNumberOfFiles,allowedFileTypes:t.accept},debug:!1,meta:{type:"avatar"},onBeforeFileAdded:l=>(console.log("onBeforeFileAdded: ",l),!0),onBeforeUpload:l=>(console.log("onBeforeUpload: ",l),!0)}).use(Ko,{locale:{strings:{pluginNameCamera:"摄像头"},pluralize(){return 0}}}).use(Ii,{locale:{strings:{pluginNameUrl:"文件链接"},pluralize(){return 0}},companionUrl:"http://localhost:5173"}).use(Eo,{locale:{strings:{pluginNameScreenCapture:"录屏"},pluralize(){return 0}}}).use(Co).use(Jo,{endpoint:n.value,fieldName:"file",headers:{Authorization:`Bearer ${r.value}`}}),o=D.useModel(s,"open");return a.on("upload-success",(l,c)=>{console.log("res: ",c),console.log("result: ",l),i("upload-success",{result:l,res:c})}),a.on("upload-error",(l,c)=>{console.log("res: ",c),console.log("error: ",l),i("upload-error",{error:l,res:c})}),a.on("dashboard:modal-closed",()=>{o.value=!1,i("dashboard:modal-closed",!1)}),(l,c)=>s.isModal?(D.openBlock(),D.createBlock(D.unref(hp),{key:0,open:o.value,uppy:D.unref(a),props:{disabled:t.disabled,fileManagerSelectionType:s.fileManagerSelectionType}},null,8,["open","uppy","props"])):(D.openBlock(),D.createBlock(D.unref(cp),{key:1,uppy:D.unref(a),props:{disabled:t.disabled,width:t.width,height:t.height,fileManagerSelectionType:s.fileManagerSelectionType}},null,8,["uppy","props"]))}}),Up=(s,e)=>{const t=s.__vccOpts||s;for(const[i,r]of e)t[i]=r;return t},Bp=Up(Ip,[["__scopeId","data-v-9404907f"]]),il=nl(Bp);exports.IkImageUploadEditor=il;exports.default=il;
|