next-ui3 1.5.5 → 1.5.7
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/index.css +1 -1
- package/dist/index.full.min.js +38 -89
- package/dist/index.full.min.mjs +41 -92
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/utils/index.min.js +2 -2
- package/dist/utils/index.min.mjs +2 -2
- package/es/components/index.d.ts +1 -0
- package/es/components/preview/src/audio/index.vue.d.ts +5 -0
- package/es/components/preview/src/html/index.vue.d.ts +51 -0
- package/es/components/preview/src/index.vue.d.ts +2 -2
- package/es/components/preview/src/markdown/index.vue.d.ts +55 -0
- package/es/components/preview/src/video/index.vue.d.ts +4 -3
- package/es/components/slider/index.d.ts +2 -0
- package/es/components/slider/src/index.vue.d.ts +30 -0
- package/es/config/enums.d.ts +2 -1
- package/es/config/preview.d.ts +1 -0
- package/es/hooks/index.d.ts +2 -0
- package/es/hooks/use-audio/index.d.ts +41 -0
- package/es/hooks/use-preview-config/index.d.ts +4 -8
- package/es/hooks/use-video/index.d.ts +46 -0
- package/es/locale/lang/en.d.ts +4 -0
- package/es/locale/lang/en.mjs +5 -1
- package/es/locale/lang/en.mjs.map +1 -1
- package/es/locale/lang/zh-cn.d.ts +4 -0
- package/es/locale/lang/zh-cn.mjs +5 -1
- package/es/locale/lang/zh-cn.mjs.map +1 -1
- package/es/utils/format.d.ts +2 -0
- package/es/version.d.ts +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/preview/src/audio/index.vue.d.ts +5 -0
- package/lib/components/preview/src/html/index.vue.d.ts +51 -0
- package/lib/components/preview/src/index.vue.d.ts +2 -2
- package/lib/components/preview/src/markdown/index.vue.d.ts +55 -0
- package/lib/components/preview/src/video/index.vue.d.ts +4 -3
- package/lib/components/slider/index.d.ts +2 -0
- package/lib/components/slider/src/index.vue.d.ts +30 -0
- package/lib/config/enums.d.ts +2 -1
- package/lib/config/preview.d.ts +1 -0
- package/lib/hooks/index.d.ts +2 -0
- package/lib/hooks/use-audio/index.d.ts +41 -0
- package/lib/hooks/use-preview-config/index.d.ts +4 -8
- package/lib/hooks/use-video/index.d.ts +46 -0
- package/lib/locale/lang/en.d.ts +4 -0
- package/lib/locale/lang/en.js +5 -1
- package/lib/locale/lang/en.js.map +1 -1
- package/lib/locale/lang/zh-cn.d.ts +4 -0
- package/lib/locale/lang/zh-cn.js +5 -1
- package/lib/locale/lang/zh-cn.js.map +1 -1
- package/lib/utils/format.d.ts +2 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/nt-slider.css +1 -0
- package/theme-chalk/src/index.scss +1 -0
- package/theme-chalk/src/preview/audio.scss +236 -26
- package/theme-chalk/src/preview/index.scss +1 -0
- package/theme-chalk/src/preview/markdown.scss +153 -0
- package/theme-chalk/src/preview/text.scss +6 -0
- package/theme-chalk/src/preview/video.scss +345 -6
- package/theme-chalk/src/slider.scss +74 -0
package/dist/locale/en.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! Next UI v1.5.
|
|
1
|
+
/*! Next UI v1.5.7 */(function(e,l){typeof exports=="object"&&typeof module!="undefined"?module.exports=l():typeof define=="function"&&define.amd?define(l):(e=typeof globalThis!="undefined"?globalThis:e||self,e.NextUILocaleEn=l())})(this,function(){"use strict";var e={name:"en",nt:{common:{loadingText:"Loading",loading:"Loading...",loadError:"Load failed, click to retry",empty:"No data",noMatch:"No matching data",success:"Operation successful",checkAll:"Check all",all:"All",more:"More",pleaseInput:"Please input {label}",pleaseSelect:"Please select {label}",to:"To",startDate:"Start date",endDate:"End date",startTime:"Start time",endTime:"End time",systemPrompt:"System prompt",confirm:"Confirm",cancel:"Cancel"},building:{text:"Building..."},datePicker:{quarter:{year:"{year}",firstQuarter:"1st quarter",secondQuarter:"2nd quarter",thirdQuarter:"3rd quarter",fourthQuarter:"4th quarter",first:"1",second:"2",third:"3",fourth:"4",format:"q [quarter], YYYY"},semiAnnual:{year:"{year}",firstHalf:"1st half",secondHalf:"2nd half"}},downloadButton:{downloadError:"Download failed"},fileSelect:{dragAndDrop:"Drag and drop files here, or",selectFile:"Select file",changeFile:"Change file",supportFileTypes:"Only support {fileTypes} files",maxFileSize:"File size cannot exceed {maxSize}",maxFileCount:"Max {maxCount} files can be selected"},fileUpload:{drop:"Drop files here to upload",drag:"Click or drag files here to upload",unsupportedFileType:"Unsupported upload {ext} file, the current selected file {filename} has been discarded",maxFileSize:"File size cannot exceed {maxSize}, the current selected file {filename} has been discarded",maxFileCount:"File total cannot exceed {maxCount}, the files exceeding have been discarded",someFilesFailed:"Some files have not been successfully uploaded",uploadFailed:"Upload failed",retryTip:"Upload failed, click to retry",allFiles:"All ({count})",uploadingFiles:"Uploading ({count})",uploadedFiles:"Success ({count})",failedFiles:"Failed ({count})",retryAll:"Retry all",removeAll:"Remove all",confirmRemoveAll:"Are you sure you want to remove all files in the current tab (total {count} files)?"},filter:{search:"Search",reset:"Reset",expand:"Expand",collapse:"Collapse"},form:{requiredInput:"Please input {label}",requiredSelect:"Please select {label}"},table:{confirm:"Confirm",reset:"Reset"},treePanel:{filterPlaceholder:"Please input keyword",currentSelected:"Current selected"},upload:{upload:"Upload",uploadFailed:"Upload failed",supportFileTypes:"Only support {fileTypes} files",maxFileSize:"File size cannot exceed {maxSize}",maxFileCount:"Max {maxCount} files can be selected"},preview:{scaleUp:"Zoom in",scaleDown:"Zoom out",scaleReset:"Reset",prevPage:"Previous page",nextPage:"Next page",noDoc:"No document",loadPdfError:"Load PDF failed",copy:"Copy",copySuccess:"Copied",lineNumbers:"Line #",wordWrap:"Wrap",fileTooLarge:"File too large to preview (max {maxSize})",noAudio:"No audio file",noVideo:"No video file",play:"Play",pause:"Pause",mute:"Mute",unmute:"Unmute",fullscreen:"Fullscreen",exitFullscreen:"Exit fullscreen",imageLoadError:"Image load failed",audioLoadError:"Audio load failed",videoLoadError:"Video load failed",textLoadError:"File load failed",converting:"Converting document",convertError:"Document conversion failed",converterNotConfigured:"Please configure document converter",notSupported:"Not supported for preview",previewMode:"Preview"}}};return e});
|
package/dist/locale/en.min.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! Next UI v1.5.
|
|
1
|
+
/*! Next UI v1.5.7 */var e={name:"en",nt:{common:{loadingText:"Loading",loading:"Loading...",loadError:"Load failed, click to retry",empty:"No data",noMatch:"No matching data",success:"Operation successful",checkAll:"Check all",all:"All",more:"More",pleaseInput:"Please input {label}",pleaseSelect:"Please select {label}",to:"To",startDate:"Start date",endDate:"End date",startTime:"Start time",endTime:"End time",systemPrompt:"System prompt",confirm:"Confirm",cancel:"Cancel"},building:{text:"Building..."},datePicker:{quarter:{year:"{year}",firstQuarter:"1st quarter",secondQuarter:"2nd quarter",thirdQuarter:"3rd quarter",fourthQuarter:"4th quarter",first:"1",second:"2",third:"3",fourth:"4",format:"q [quarter], YYYY"},semiAnnual:{year:"{year}",firstHalf:"1st half",secondHalf:"2nd half"}},downloadButton:{downloadError:"Download failed"},fileSelect:{dragAndDrop:"Drag and drop files here, or",selectFile:"Select file",changeFile:"Change file",supportFileTypes:"Only support {fileTypes} files",maxFileSize:"File size cannot exceed {maxSize}",maxFileCount:"Max {maxCount} files can be selected"},fileUpload:{drop:"Drop files here to upload",drag:"Click or drag files here to upload",unsupportedFileType:"Unsupported upload {ext} file, the current selected file {filename} has been discarded",maxFileSize:"File size cannot exceed {maxSize}, the current selected file {filename} has been discarded",maxFileCount:"File total cannot exceed {maxCount}, the files exceeding have been discarded",someFilesFailed:"Some files have not been successfully uploaded",uploadFailed:"Upload failed",retryTip:"Upload failed, click to retry",allFiles:"All ({count})",uploadingFiles:"Uploading ({count})",uploadedFiles:"Success ({count})",failedFiles:"Failed ({count})",retryAll:"Retry all",removeAll:"Remove all",confirmRemoveAll:"Are you sure you want to remove all files in the current tab (total {count} files)?"},filter:{search:"Search",reset:"Reset",expand:"Expand",collapse:"Collapse"},form:{requiredInput:"Please input {label}",requiredSelect:"Please select {label}"},table:{confirm:"Confirm",reset:"Reset"},treePanel:{filterPlaceholder:"Please input keyword",currentSelected:"Current selected"},upload:{upload:"Upload",uploadFailed:"Upload failed",supportFileTypes:"Only support {fileTypes} files",maxFileSize:"File size cannot exceed {maxSize}",maxFileCount:"Max {maxCount} files can be selected"},preview:{scaleUp:"Zoom in",scaleDown:"Zoom out",scaleReset:"Reset",prevPage:"Previous page",nextPage:"Next page",noDoc:"No document",loadPdfError:"Load PDF failed",copy:"Copy",copySuccess:"Copied",lineNumbers:"Line #",wordWrap:"Wrap",fileTooLarge:"File too large to preview (max {maxSize})",noAudio:"No audio file",noVideo:"No video file",play:"Play",pause:"Pause",mute:"Mute",unmute:"Unmute",fullscreen:"Fullscreen",exitFullscreen:"Exit fullscreen",imageLoadError:"Image load failed",audioLoadError:"Audio load failed",videoLoadError:"Video load failed",textLoadError:"File load failed",converting:"Converting document",convertError:"Document conversion failed",converterNotConfigured:"Please configure document converter",notSupported:"Not supported for preview",previewMode:"Preview"}}};export{e as default};
|
package/dist/locale/zh-cn.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! Next UI v1.5.
|
|
1
|
+
/*! Next UI v1.5.7 */(function(u,e){typeof exports=="object"&&typeof module!="undefined"?module.exports=e():typeof define=="function"&&define.amd?define(e):(u=typeof globalThis!="undefined"?globalThis:u||self,u.NextUILocaleZhCn=e())})(this,function(){"use strict";var u={name:"zh-cn",nt:{common:{loadingText:"\u6B63\u5728\u52A0\u8F7D",loading:"\u6B63\u5728\u52A0\u8F7D...",loadError:"\u52A0\u8F7D\u5931\u8D25\uFF0C\u70B9\u51FB\u91CD\u8BD5",empty:"\u6682\u65E0\u6570\u636E",noMatch:"\u6682\u65E0\u5339\u914D\u6570\u636E",success:"\u64CD\u4F5C\u6210\u529F",checkAll:"\u5168\u9009",all:"\u5168\u90E8",more:"\u66F4\u591A",pleaseInput:"\u8BF7\u8F93\u5165{label}",pleaseSelect:"\u8BF7\u9009\u62E9{label}",to:"\u81F3",startDate:"\u5F00\u59CB\u65E5\u671F",endDate:"\u7ED3\u675F\u65E5\u671F",startTime:"\u5F00\u59CB\u65F6\u95F4",endTime:"\u7ED3\u675F\u65F6\u95F4",systemPrompt:"\u7CFB\u7EDF\u63D0\u793A",confirm:"\u786E\u8BA4",cancel:"\u53D6\u6D88"},building:{text:"\u6B63\u5728\u5EFA\u8BBE\u4E2D..."},datePicker:{quarter:{year:"{year}\u5E74",firstQuarter:"\u7B2C\u4E00\u5B63\u5EA6",secondQuarter:"\u7B2C\u4E8C\u5B63\u5EA6",thirdQuarter:"\u7B2C\u4E09\u5B63\u5EA6",fourthQuarter:"\u7B2C\u56DB\u5B63\u5EA6",first:"\u4E00",second:"\u4E8C",third:"\u4E09",fourth:"\u56DB",format:"YYYY\u5E74\u7B2Cq\u5B63\u5EA6"},semiAnnual:{year:"{year}\u5E74",firstHalf:"\u4E0A\u534A\u5E74",secondHalf:"\u4E0B\u534A\u5E74"}},downloadButton:{downloadError:"\u4E0B\u8F7D\u5931\u8D25"},fileSelect:{dragAndDrop:"\u62D6\u62FD\u6587\u4EF6\u81F3\u6B64\uFF0C\u6216\u8005",selectFile:"\u9009\u62E9\u6587\u4EF6",changeFile:"\u66F4\u6362\u6587\u4EF6",supportFileTypes:"\u53EA\u652F\u6301 {fileTypes} \u683C\u5F0F\u7684\u6587\u4EF6",maxFileSize:"\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 {maxSize}",maxFileCount:"\u6700\u591A\u9009\u62E9 {maxCount} \u4E2A\u6587\u4EF6"},fileUpload:{drop:"\u91CA\u653E\u6587\u4EF6\u5230\u6B64\u5904\u4E0A\u4F20",drag:"\u70B9\u51FB\u6216\u62D6\u62FD\u6587\u4EF6\u5230\u6B64\u5904\u4E0A\u4F20",unsupportedFileType:"\u4E0D\u652F\u6301\u4E0A\u4F20{ext}\u6587\u4EF6\uFF0C\u5F53\u524D\u9009\u4E2D\u6587\u4EF6{filename}\u5DF2\u4F5C\u5E9F",maxFileSize:"\u6587\u4EF6\u6700\u5927\u4E0D\u8D85\u8FC7{maxSize}\uFF0C\u5F53\u524D\u9009\u4E2D\u6587\u4EF6{filename}\u5DF2\u4F5C\u5E9F",maxFileCount:"\u6587\u4EF6\u603B\u6570\u4E0D\u80FD\u8D85\u8FC7{maxCount}\u4E2A\uFF0C\u8D85\u51FA\u7684\u6587\u4EF6\u5DF2\u5E9F\u5F03",someFilesFailed:"\u8FD8\u6709\u6587\u4EF6\u672A\u6210\u529F\u4E0A\u4F20",uploadFailed:"\u4E0A\u4F20\u5931\u8D25",retryTip:"\u4E0A\u4F20\u5931\u8D25\uFF0C\u70B9\u51FB\u91CD\u8BD5",allFiles:"\u5168\u90E8 ({count})",uploadingFiles:"\u4E0A\u4F20\u4E2D ({count})",failedFiles:"\u4E0A\u4F20\u5931\u8D25 ({count})",uploadedFiles:"\u4E0A\u4F20\u6210\u529F ({count})",retryAll:"\u5168\u90E8\u91CD\u8BD5",removeAll:"\u5168\u90E8\u79FB\u9664",confirmRemoveAll:"\u786E\u5B9A\u8981\u79FB\u9664\u5F53\u524D\u9875\u7B7E\u4E0B\u6240\u6709\u6587\u4EF6\uFF08\u5171{count}\u4E2A\uFF09\u5417\uFF1F"},filter:{search:"\u641C\u7D22",reset:"\u91CD\u7F6E",expand:"\u5C55\u5F00",collapse:"\u6536\u8D77"},form:{requiredInput:"\u8BF7\u8F93\u5165{label}",requiredSelect:"\u8BF7\u9009\u62E9{label}"},table:{confirm:"\u786E\u8BA4",reset:"\u91CD\u7F6E"},treePanel:{filterPlaceholder:"\u8BF7\u8F93\u5165\u5173\u952E\u5B57",currentSelected:"\u5F53\u524D\u9009\u4E2D"},upload:{upload:"\u4E0A\u4F20",uploadFailed:"\u4E0A\u4F20\u5931\u8D25",supportFileTypes:"\u53EA\u652F\u6301 {fileTypes} \u683C\u5F0F\u7684\u6587\u4EF6",maxFileSize:"\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 {maxSize}",maxFileCount:"\u6700\u591A\u9009\u62E9 {maxCount} \u4E2A\u6587\u4EF6"},preview:{scaleUp:"\u653E\u5927",scaleDown:"\u7F29\u5C0F",scaleReset:"\u91CD\u7F6E",prevPage:"\u4E0A\u4E00\u9875",nextPage:"\u4E0B\u4E00\u9875",noDoc:"\u6682\u65E0\u6587\u6863",loadPdfError:"\u52A0\u8F7DPDF\u5931\u8D25",copy:"\u590D\u5236",copySuccess:"\u590D\u5236\u6210\u529F",lineNumbers:"\u663E\u793A\u884C\u53F7",wordWrap:"\u81EA\u52A8\u6362\u884C",fileTooLarge:"\u6587\u4EF6\u8FC7\u5927\uFF0C\u65E0\u6CD5\u9884\u89C8\uFF08\u6700\u5927 {maxSize}\uFF09",noAudio:"\u6682\u65E0\u97F3\u9891\u6587\u4EF6",noVideo:"\u6682\u65E0\u89C6\u9891\u6587\u4EF6",play:"\u64AD\u653E",pause:"\u6682\u505C",mute:"\u9759\u97F3",unmute:"\u53D6\u6D88\u9759\u97F3",fullscreen:"\u5168\u5C4F",exitFullscreen:"\u9000\u51FA\u5168\u5C4F",imageLoadError:"\u56FE\u7247\u52A0\u8F7D\u5931\u8D25",audioLoadError:"\u97F3\u9891\u52A0\u8F7D\u5931\u8D25",videoLoadError:"\u89C6\u9891\u52A0\u8F7D\u5931\u8D25",textLoadError:"\u6587\u4EF6\u52A0\u8F7D\u5931\u8D25",converting:"\u6B63\u5728\u8F6C\u6362\u6587\u6863",convertError:"\u6587\u6863\u8F6C\u6362\u5931\u8D25",converterNotConfigured:"\u8BF7\u914D\u7F6E\u6587\u6863\u8F6C\u6362\u670D\u52A1",notSupported:"\u6682\u4E0D\u652F\u6301\u8BE5\u6587\u4EF6\u7C7B\u578B\u9884\u89C8",previewMode:"\u9884\u89C8"}}};return u});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! Next UI v1.5.
|
|
1
|
+
/*! Next UI v1.5.7 */var u={name:"zh-cn",nt:{common:{loadingText:"\u6B63\u5728\u52A0\u8F7D",loading:"\u6B63\u5728\u52A0\u8F7D...",loadError:"\u52A0\u8F7D\u5931\u8D25\uFF0C\u70B9\u51FB\u91CD\u8BD5",empty:"\u6682\u65E0\u6570\u636E",noMatch:"\u6682\u65E0\u5339\u914D\u6570\u636E",success:"\u64CD\u4F5C\u6210\u529F",checkAll:"\u5168\u9009",all:"\u5168\u90E8",more:"\u66F4\u591A",pleaseInput:"\u8BF7\u8F93\u5165{label}",pleaseSelect:"\u8BF7\u9009\u62E9{label}",to:"\u81F3",startDate:"\u5F00\u59CB\u65E5\u671F",endDate:"\u7ED3\u675F\u65E5\u671F",startTime:"\u5F00\u59CB\u65F6\u95F4",endTime:"\u7ED3\u675F\u65F6\u95F4",systemPrompt:"\u7CFB\u7EDF\u63D0\u793A",confirm:"\u786E\u8BA4",cancel:"\u53D6\u6D88"},building:{text:"\u6B63\u5728\u5EFA\u8BBE\u4E2D..."},datePicker:{quarter:{year:"{year}\u5E74",firstQuarter:"\u7B2C\u4E00\u5B63\u5EA6",secondQuarter:"\u7B2C\u4E8C\u5B63\u5EA6",thirdQuarter:"\u7B2C\u4E09\u5B63\u5EA6",fourthQuarter:"\u7B2C\u56DB\u5B63\u5EA6",first:"\u4E00",second:"\u4E8C",third:"\u4E09",fourth:"\u56DB",format:"YYYY\u5E74\u7B2Cq\u5B63\u5EA6"},semiAnnual:{year:"{year}\u5E74",firstHalf:"\u4E0A\u534A\u5E74",secondHalf:"\u4E0B\u534A\u5E74"}},downloadButton:{downloadError:"\u4E0B\u8F7D\u5931\u8D25"},fileSelect:{dragAndDrop:"\u62D6\u62FD\u6587\u4EF6\u81F3\u6B64\uFF0C\u6216\u8005",selectFile:"\u9009\u62E9\u6587\u4EF6",changeFile:"\u66F4\u6362\u6587\u4EF6",supportFileTypes:"\u53EA\u652F\u6301 {fileTypes} \u683C\u5F0F\u7684\u6587\u4EF6",maxFileSize:"\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 {maxSize}",maxFileCount:"\u6700\u591A\u9009\u62E9 {maxCount} \u4E2A\u6587\u4EF6"},fileUpload:{drop:"\u91CA\u653E\u6587\u4EF6\u5230\u6B64\u5904\u4E0A\u4F20",drag:"\u70B9\u51FB\u6216\u62D6\u62FD\u6587\u4EF6\u5230\u6B64\u5904\u4E0A\u4F20",unsupportedFileType:"\u4E0D\u652F\u6301\u4E0A\u4F20{ext}\u6587\u4EF6\uFF0C\u5F53\u524D\u9009\u4E2D\u6587\u4EF6{filename}\u5DF2\u4F5C\u5E9F",maxFileSize:"\u6587\u4EF6\u6700\u5927\u4E0D\u8D85\u8FC7{maxSize}\uFF0C\u5F53\u524D\u9009\u4E2D\u6587\u4EF6{filename}\u5DF2\u4F5C\u5E9F",maxFileCount:"\u6587\u4EF6\u603B\u6570\u4E0D\u80FD\u8D85\u8FC7{maxCount}\u4E2A\uFF0C\u8D85\u51FA\u7684\u6587\u4EF6\u5DF2\u5E9F\u5F03",someFilesFailed:"\u8FD8\u6709\u6587\u4EF6\u672A\u6210\u529F\u4E0A\u4F20",uploadFailed:"\u4E0A\u4F20\u5931\u8D25",retryTip:"\u4E0A\u4F20\u5931\u8D25\uFF0C\u70B9\u51FB\u91CD\u8BD5",allFiles:"\u5168\u90E8 ({count})",uploadingFiles:"\u4E0A\u4F20\u4E2D ({count})",failedFiles:"\u4E0A\u4F20\u5931\u8D25 ({count})",uploadedFiles:"\u4E0A\u4F20\u6210\u529F ({count})",retryAll:"\u5168\u90E8\u91CD\u8BD5",removeAll:"\u5168\u90E8\u79FB\u9664",confirmRemoveAll:"\u786E\u5B9A\u8981\u79FB\u9664\u5F53\u524D\u9875\u7B7E\u4E0B\u6240\u6709\u6587\u4EF6\uFF08\u5171{count}\u4E2A\uFF09\u5417\uFF1F"},filter:{search:"\u641C\u7D22",reset:"\u91CD\u7F6E",expand:"\u5C55\u5F00",collapse:"\u6536\u8D77"},form:{requiredInput:"\u8BF7\u8F93\u5165{label}",requiredSelect:"\u8BF7\u9009\u62E9{label}"},table:{confirm:"\u786E\u8BA4",reset:"\u91CD\u7F6E"},treePanel:{filterPlaceholder:"\u8BF7\u8F93\u5165\u5173\u952E\u5B57",currentSelected:"\u5F53\u524D\u9009\u4E2D"},upload:{upload:"\u4E0A\u4F20",uploadFailed:"\u4E0A\u4F20\u5931\u8D25",supportFileTypes:"\u53EA\u652F\u6301 {fileTypes} \u683C\u5F0F\u7684\u6587\u4EF6",maxFileSize:"\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 {maxSize}",maxFileCount:"\u6700\u591A\u9009\u62E9 {maxCount} \u4E2A\u6587\u4EF6"},preview:{scaleUp:"\u653E\u5927",scaleDown:"\u7F29\u5C0F",scaleReset:"\u91CD\u7F6E",prevPage:"\u4E0A\u4E00\u9875",nextPage:"\u4E0B\u4E00\u9875",noDoc:"\u6682\u65E0\u6587\u6863",loadPdfError:"\u52A0\u8F7DPDF\u5931\u8D25",copy:"\u590D\u5236",copySuccess:"\u590D\u5236\u6210\u529F",lineNumbers:"\u663E\u793A\u884C\u53F7",wordWrap:"\u81EA\u52A8\u6362\u884C",fileTooLarge:"\u6587\u4EF6\u8FC7\u5927\uFF0C\u65E0\u6CD5\u9884\u89C8\uFF08\u6700\u5927 {maxSize}\uFF09",noAudio:"\u6682\u65E0\u97F3\u9891\u6587\u4EF6",noVideo:"\u6682\u65E0\u89C6\u9891\u6587\u4EF6",play:"\u64AD\u653E",pause:"\u6682\u505C",mute:"\u9759\u97F3",unmute:"\u53D6\u6D88\u9759\u97F3",fullscreen:"\u5168\u5C4F",exitFullscreen:"\u9000\u51FA\u5168\u5C4F",imageLoadError:"\u56FE\u7247\u52A0\u8F7D\u5931\u8D25",audioLoadError:"\u97F3\u9891\u52A0\u8F7D\u5931\u8D25",videoLoadError:"\u89C6\u9891\u52A0\u8F7D\u5931\u8D25",textLoadError:"\u6587\u4EF6\u52A0\u8F7D\u5931\u8D25",converting:"\u6B63\u5728\u8F6C\u6362\u6587\u6863",convertError:"\u6587\u6863\u8F6C\u6362\u5931\u8D25",converterNotConfigured:"\u8BF7\u914D\u7F6E\u6587\u6863\u8F6C\u6362\u670D\u52A1",notSupported:"\u6682\u4E0D\u652F\u6301\u8BE5\u6587\u4EF6\u7C7B\u578B\u9884\u89C8",previewMode:"\u9884\u89C8"}}};export{u as default};
|
package/dist/utils/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! Next UI utils v1.5.
|
|
2
|
-
`);i=d.pop()||"";for(let h of d)if(h=h.trim(),!!h)if(r)yield h;else{if(h==="event: ping")continue;const F=h.match(/^(?:(\w*):)?(.*)$/);if(!F){console.error("[BufferedReader] parse line failed:",h);continue}const E=F[1],I=z(F[2].trim());if(!I){console.error("[BufferedReader] parse json failed:",F[2].trim());continue}yield{event:E,data:I}}}}const We=e=>{let{url:n,filename:t}=e;if(t=t||"\u672A\u547D\u540D",n||e.blob&&(n=URL.createObjectURL(e.blob),setTimeout(()=>{URL.revokeObjectURL(n)},1e4)),!n)throw new Error("No URL provided");const r=document.createElement("a");r.href=n,r.download=t,r.click()};function Ge(e,n,t){let r,i,o,u,d,h,F=0,E=!1,I=!1,C=!0;if(typeof e!="function")throw new TypeError("Expected a function");n=+n||0,t&&A(t)&&(E=!!t.leading,I="maxWait"in t,o=I?Math.max(+t.maxWait||0,n):o,C="trailing"in t?!!t.trailing:C);function T(p){const O=r,D=i;return r=i=void 0,F=p,u=e.apply(D,O),u}function P(p,O){return setTimeout(p,O)}function a(p){clearTimeout(p)}function f(p){return F=p,d=P(m,n),E?T(p):u}function c(p){const O=p-h,D=p-F,B=n-O;return I?Math.min(B,o-D):B}function s(p){const O=p-h,D=p-F;return h===void 0||O>=n||O<0||I&&D>=o}function m(){const p=Date.now();if(s(p))return w(p);d=P(m,c(p))}function w(p){return d=void 0,C&&r?T(p):(r=i=void 0,u)}function v(){d!==void 0&&a(d),F=0,r=h=i=d=void 0}function g(){return d===void 0?u:w(Date.now())}function b(){return d!==void 0}function y(...p){const O=Date.now(),D=s(O);if(r=p,i=this,h=O,D){if(d===void 0)return f(h);if(I)return d=P(m,n),T(h)}return d===void 0&&(d=P(m,n)),u}return y.cancel=v,y.flush=g,y.pending=b,y}function ze(e){const{el:n,msg:t}=e||{},r=t===void 0?"\u8BF7\u5B8C\u5584\u8868\u5355\u5185\u5BB9":t;if(r&&_.ElMessage.error(r),!n)return;const i=n.querySelector(".is-error");i&&i.scrollIntoView({behavior:"smooth",inline:"nearest",block:"center"})}async function Ve(e,n={successText:"\u590D\u5236\u6210\u529F"}){const{successText:t}=n||{};try{if(navigator.clipboard){await navigator.clipboard.writeText(e),t&&_.ElMessage.success(t);return}}catch(i){}const r=document.createElement("textarea");document.body.appendChild(r),r.style.position="fixed",r.style.clip="rect(0 0 0 0)",r.style.top="10px",r.value=e,r.select(),document.execCommand("copy",!0),document.body.removeChild(r),t&&_.ElMessage.success(t)}function Ye(e,...n){if(!e)return;const t=document.createElement("a");t.addEventListener("click",r=>{r.preventDefault(),window.open(e,...n)}),t.click()}function Je(e){if(!e)return[];const n=[`${e.slice(0,2)}0000`,`${e.slice(0,4)}00`,e.slice(0,6),e.slice(0,9),e.slice(0,12)],t=0,r=n.indexOf(e)+1;return n.slice(t,r)}class N{constructor(n){this._enumItems={};var t;if(n)if(Array.isArray(n))for(const[r,i]of n.entries())this.add((t=i.key)!=null?t:`${r}`,i);else for(const r in n){const i=n[r];this.add(r,i)}}add(n,t){if(this[n])throw new Error(`\u679A\u4E3E\u9879 ${n} \u5DF2\u5B58\u5728`);const r=t.value;return this[n]=r,this._enumItems[r]={...t},this}keys(){return Object.keys(this).filter(n=>n!=="_enumItems")}*[Symbol.iterator](){for(const n of this.keys())yield this.getItem(this[n])}getItem(n){return this._enumItems[n]}getLabel(n){var t;return(t=this.getItem(n))==null?void 0:t.label}getProps(n){var t;return(t=this.getItem(n))==null?void 0:t.props}filter(n){const t=new N;for(const r of this.keys()){const i=this.getItem(this[r]);n(i,r)&&t.add(r,i)}return t}clone(){return this.filter(()=>!0)}set(n,t){const r=this.getItem(this[n]);return r&&Object.assign(r,t),this}remove(n){const t=this[n];return t!==void 0&&(delete this[n],delete this._enumItems[t]),this}forEach(n){for(const t of this.keys())n(this.getItem(this[t]),t)}}const Ke=(e,n)=>{if(!e||!n)return!1;if(n.includes(" "))throw new Error("className should not contain space.");return e.classList.contains(n)},Xe=(e,n,t)=>{var r,i,o,u,d,h,F,E;if(!e)return!1;const I=e.getBoundingClientRect();let C=0,T=0,P=window.innerHeight,a=window.innerWidth;if(n){const w=n.getBoundingClientRect();C=w.top,T=w.left,P=w.bottom,a=w.right}let f=0,c=0,s=0,m=0;return t&&(f=(i=(r=t.topGap)!=null?r:t.gap)!=null?i:0,c=(u=(o=t.leftGap)!=null?o:t.gap)!=null?u:0,s=(h=(d=t.bottomGap)!=null?d:t.gap)!=null?h:0,m=(E=(F=t.rightGap)!=null?F:t.gap)!=null?E:0),I.top>=C+f&&I.left>=T+c&&I.bottom<=P-s&&I.right<=a-m};function Ze(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J={exports:{}},R={exports:{}},K;function xe(){return K||(K=1,function(e,n){(function(t,r){e.exports=r()})(window,function(){return function(t){var r={};function i(o){if(r[o])return r[o].exports;var u=r[o]={i:o,l:!1,exports:{}};return t[o].call(u.exports,u,u.exports,i),u.l=!0,u.exports}return i.m=t,i.c=r,i.d=function(o,u,d){i.o(o,u)||Object.defineProperty(o,u,{enumerable:!0,get:d})},i.r=function(o){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,u){if(1&u&&(o=i(o)),8&u||4&u&&typeof o=="object"&&o&&o.__esModule)return o;var d=Object.create(null);if(i.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:o}),2&u&&typeof o!="string")for(var h in o)i.d(d,h,function(F){return o[F]}.bind(null,h));return d},i.n=function(o){var u=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(u,"a",u),u},i.o=function(o,u){return Object.prototype.hasOwnProperty.call(o,u)},i.p="",i(i.s=0)}([function(t,r,i){i.r(r);var o=window,u=/^image\//,d=/\.\w+$/,h={},F={file:null,quality:.8,convertSize:2048e3,loose:!0,redressOrientation:!0},E=function(a){return typeof a=="function"},I=function(a){return u.test(a)};function C(a){a=Object.assign({},F,a),this.options=a,this.file=a.file,this.image=null,this.ParsedOrientationInfo=null,this.init()}var T=C.prototype;for(var P in r.default=C,T.init=function(){var a=this,f=this.file,c=this.options;f&&I(f.type)?(I(c.mimeType)||(c.mimeType=f.type),h.file2Image(f,function(s){E(a.beforeCompress)&&(a.image=s,f.width=s.naturalWidth,f.height=s.naturalHeight,a.beforeCompress(f)),f.type==="image/jpeg"&&c.redressOrientation?a.getParsedOrientationInfo(function(m){a.parsedOrientationInfo=m,a.rendCanvas()}):(a.parsedOrientationInfo={rotate:0,scaleX:1,scaleY:1},a.rendCanvas())},a.error)):a.error("\u8BF7\u4E0A\u4F20\u56FE\u7247\u6587\u4EF6!")},T.rendCanvas=function(){var a=this,f=this.options,c=this.image,s=this.getExpectedEdge(),m=s.dWidth,w=s.dHeight,v=s.width,g=s.height,b=h.image2Canvas(c,m,w,a.beforeDraw.bind(a),a.afterDraw.bind(a),v,g);h.canvas2Blob(b,function(y){y&&(y.width=b.width,y.height=b.height),a.success(y)},f.quality,f.mimeType)},T.beforeCompress=function(){E(this.options.beforeCompress)&&this.options.beforeCompress(this.file)},T.getExpectedEdge=function(){var a,f=this.image,c=this.parsedOrientationInfo.rotate,s=this.options,m=f.naturalWidth,w=f.naturalHeight,v=Math.abs(c)%180==90;v&&(a=w,w=m,m=a);var g=m/w,b=Math.max(s.maxWidth,0)||1/0,y=Math.max(s.maxHeight,0)||1/0,p=Math.max(s.minWidth,0)||0,O=Math.max(s.minHeight,0)||0,D=Math.max(s.width,0)||m,B=Math.max(s.height,0)||w;b<1/0&&y<1/0?y*g>b?y=b/g:b=y*g:b<1/0?y=b/g:y<1/0&&(b=y*g),p>0&&O>0?O*g>p?O=p/g:p=O*g:p>0?O=p/g:O>0&&(p=O*g),B*g>D?B=D/g:D=B*g;var j=D=Math.floor(Math.min(Math.max(D,p),b)),q=B=Math.floor(Math.min(Math.max(B,O),y));return v&&(a=q,q=j,j=a),{dWidth:j,dHeight:q,width:D,height:B}},T.getParsedOrientationInfo=function(a){var f=this;this.getOrientation(function(c){E(a)&&a(f.parseOrientation(c))})},T.getOrientation=function(a){var f=this;h.file2ArrayBuffer(this.file,function(c){E(a)&&a(f.resetAndGetOrientation(c))})},T.resetAndGetOrientation=function(a){var f,c=new DataView(a);try{var s,m,w;if(c.getUint8(0)===255&&c.getUint8(1)===216)for(var v=c.byteLength,g=2;g+1<v;){if(c.getUint8(g)===255&&c.getUint8(g+1)===225){m=g;break}g+=1}if(m){var b=m+4,y=m+10;if(h.getStringFromCharCode(c,b,4)==="Exif"){var p=c.getUint16(y);if(((s=p===18761)||p===19789)&&c.getUint16(y+2,s)===42){var O=c.getUint32(y+4,s);O>=8&&(w=y+O)}}}if(w){var D;for(v=c.getUint16(w,s),D=0;D<v;D+=1)if(g=w+12*D+2,c.getUint16(g,s)===274){g+=8,f=c.getUint16(g,s),c.setUint16(g,1,s);break}}}catch(B){console.error(B),f=1}return f},T.parseOrientation=function(a){var f=0,c=1,s=1;switch(a){case 2:c=-1;break;case 3:f=-180;break;case 4:s=-1;break;case 5:f=90,s=-1;break;case 6:f=90;break;case 7:f=90,c=-1;break;case 8:f=-90}return{rotate:f,scaleX:c,scaleY:s}},T.beforeDraw=function(a,f){var c=this.parsedOrientationInfo,s=c.rotate,m=c.scaleX,w=c.scaleY,v=this.file,g=this.options,b="transparent",y=f.width,p=f.height;switch(v.size>g.convertSize&&g.mimeType==="image/png"&&(b="#fff",g.mimeType="image/jpeg"),a.fillStyle=b,a.fillRect(0,0,y,p),E(g.beforeDraw)&&g.beforeDraw.call(this,a,f),a.save(),s){case 90:a.translate(y,0);break;case-90:a.translate(0,p);break;case-180:a.translate(y,p)}a.rotate(s*Math.PI/180),a.scale(m,w)},T.afterDraw=function(a,f){var c=this.options;E(c.afterDraw)&&c.afterDraw.call(this,a,f)},T.error=function(a){var f=this.options;if(!E(f.error))throw new Error(a);f.error.call(this,a)},T.success=function(a){var f,c,s=this.options,m=this.file,w=this.image,v=this.getExpectedEdge(),g=w.naturalHeight,b=w.naturalWidth;if(a&&a.size)if(!s.loose&&a.size>m.size&&!(v.width>b||v.height>g))console.warn("\u5F53\u524D\u8BBE\u7F6E\u7684\u662F\u975E\u5BBD\u677E\u6A21\u5F0F\uFF0C\u538B\u7F29\u7ED3\u679C\u5927\u4E8E\u6E90\u56FE\u7247\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"),a=m;else{var y=new Date;a.lastModified=y.getTime(),a.lastModifiedDate=y,a.name=m.name,a.name&&a.type!==m.type&&(a.name=a.name.replace(d,(f=a.type,(c=I(f)?f.substr(6):"")==="jpeg"&&(c="jpg"),"."+c)))}else console.warn("\u56FE\u7247\u538B\u7F29\u51FA\u4E86\u70B9\u610F\u5916\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"),a=m;E(s.success)&&s.success.call(this,a)},h.file2DataUrl=function(a,f,c){var s=new FileReader;s.onload=function(){f(s.result)},s.onerror=function(){E(c)&&c("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01")},s.readAsDataURL(a)},h.file2ArrayBuffer=function(a,f,c){var s=new FileReader;s.onload=function(m){f(m.target.result)},s.onerror=function(){E(c)&&c("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01")},s.readAsArrayBuffer(a)},h.getStringFromCharCode=function(a,f,c){var s,m="";for(c+=f,s=f;s<c;s+=1)m+=String.fromCharCode(a.getUint8(s));return m},h.file2Image=function(a,f,c){var s=new Image,m=o.URL||o.webkitURL;if(o.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(o.navigator.userAgent)&&(s.crossOrigin="anonymous"),s.alt=a.name,s.onerror=function(){E(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")},m){var w=m.createObjectURL(a);s.onload=function(){f(s),m.revokeObjectURL(w)},s.src=w}else this.file2DataUrl(a,function(v){s.onload=function(){f(s)},s.src=v},c)},h.url2Image=function(a,f,c){var s=new Image;s.src=a,s.onload=function(){f(s)},s.onerror=function(){E(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")}},h.image2Canvas=function(a,f,c,s,m,w,v){var g=document.createElement("canvas"),b=g.getContext("2d");return g.width=w||a.naturalWidth,g.height=v||a.naturalHeight,E(s)&&s(b,g),b.save(),b.drawImage(a,0,0,f,c),b.restore(),E(m)&&m(b,g),g},h.canvas2DataUrl=function(a,f,c){return a.toDataURL(c||"image/jpeg",f)},h.dataUrl2Image=function(a,f,c){var s=new Image;s.onload=function(){f(s)},s.error=function(){E(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")},s.src=a},h.dataUrl2Blob=function(a,f){for(var c=a.split(",")[1],s=a.match(/^data:(.*?)(;base64)?,/)[1],m=atob(c),w=c.length,v=new Uint8Array(w),g=0;g<w;g++)v[g]=m.charCodeAt(g);return new Blob([v],{type:f||s})},h.blob2DataUrl=function(a,f,c){this.file2DataUrl(a,f,c)},h.blob2Image=function(a,f,c){this.file2Image(a,f,c)},h.canvas2Blob=function(a,f,c,s){var m=this;HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(w,v,g){var b=this.toDataURL(v,g);w(m.dataUrl2Blob(b))}}),a.toBlob(function(w){f(w)},s||"image/jpeg",c||.8)},h.upload=function(a,f,c){var s=new XMLHttpRequest,m=new FormData;m.append("file",f),s.onreadystatechange=function(){if(s.readyState!==4||s.status!==200)throw new Error(s);c&&c(s.responseText)},s.open("POST",a,!0),s.send(m)},h)h.hasOwnProperty(P)&&(C[P]=h[P])}]).default})}(R)),R.exports}(function(e){e.exports=xe()})(J);var Qe=Ze(J.exports);const et=e=>{if(!e.file)throw new Error("file is required");const n=e.file.size/1024;let t=e.quality;if(t===void 0){if(n<200)return e.file;n>200&&n<=512?t=.9:n>512&&n<=1024?t=.8:n>1024&&n<=2048?t=.85:n>2048&&n<=10240?t=.8:n>10240&&n<=20480&&(t=.75)}return new Promise((r,i)=>{var o;new Qe({...e,quality:t,convertSize:(o=e.convertSize)!=null?o:1024,success:u=>{r(u)},error:u=>{i(u)}})})},X=e=>e&&e.split("?")[0].split("/").pop()||"",tt=e=>{if(e=X(e),!e)return"";const n=e.lastIndexOf(".");return n===-1?"":e.slice(n+1).toLowerCase()},nt=(e,n,t)=>Math.min(Math.max(t,e),n),U=new Map,rt=(e,n=3)=>{if(!e)throw new Error("name is required");let t;return U.has(e)?t=U.get(e):(t={maxNum:n,currentNum:0,queue:[]},U.set(e,t)),{acquire:async()=>new Promise((d,h)=>{t.currentNum>=t.maxNum?t.queue.push({resolve:d,reject:h}):(t.currentNum++,d(!0))}),release:()=>{if(t.queue.length>0){const{resolve:d}=t.queue.shift();d(!0)}else t.currentNum--},destroy:async()=>{U.delete(e)},getMaxNum:()=>t.maxNum}};l.Enum=N,l.arrayDiff=ie,l.arrayEquals=$,l.assign=de,l.buildTree=we,l.buildUrl=je,l.clamp=nt,l.combineByField=Fe,l.compressImage=et,l.copyText=Ve,l.createLock=rt,l.createStreamIterator=He,l.createTimer=Ae,l.debounce=Ge,l.decodeHTMLEntities=$e,l.deepAssign=G,l.deepClone=ge,l.delayWhen=Me,l.downloadFile=We,l.encodeHTMLEntities=qe,l.fileToBlob=Se,l.fileToDataURL=ke,l.fileToObjectURL=Le,l.filterTree=Y,l.findNode=ye,l.findNodeWithPath=be,l.findParentAndIndex=Ee,l.flatTree=Oe,l.formatBytes=Pe,l.formatDate=Ie,l.formatInterval=De,l.formatNumber=Te,l.formatPx=Be,l.getFileExt=tt,l.getFilename=X,l.getNearestNumbers=se,l.getProp=pe,l.getProperty=L,l.getRandInt=_e,l.groupBy=ue,l.handleFormValidateError=ze,l.hasClass=Ke,l.isBlob=ee,l.isChildClassOf=ne,l.isElementInViewport=Xe,l.isEmpty=M,l.isEqual=re,l.isIframe=Q,l.isImage=te,l.isObject=x,l.isPlainObject=A,l.looseEqual=k,l.mergeDefaultOptions=V,l.omit=fe,l.omitEmpty=he,l.openPage=Ye,l.parseAreaCode=Je,l.parseJson=z,l.pick=W,l.runAtLeastTime=Ce,l.setProperty=me,l.sleep=S,l.toArray=ae,l.toCamelCase=le,l.toKebabCase=H,l.toUnderscore=ce,l.urlToBlob=Ne,l.urlToDataURL=Ue,l.urlToPngBlob=Re,l.walkTree=ve,l.withInstall=Z,l.without=oe,Object.defineProperty(l,"__esModule",{value:!0})});
|
|
1
|
+
/*! Next UI utils v1.5.7 */(function(l,S){typeof exports=="object"&&typeof module!="undefined"?S(exports,require("element-plus")):typeof define=="function"&&define.amd?define(["exports","element-plus"],S):(l=typeof globalThis!="undefined"?globalThis:l||self,S(l.NextUI={},l.ElementPlus))})(this,function(l,S){"use strict";const Z=(e,n)=>{try{if(e.install=t=>{for(const r of[e,...Object.values(n!=null?n:{})])r.name&&t.component(r.name,r)},n)for(const[t,r]of Object.entries(n))e[t]=r;return e}catch(t){}};function x(e){const n=typeof e;return e!=null&&(n==="object"||n==="function")}function C(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"}function A(e){if(typeof e=="boolean"||typeof e=="number")return!1;if(Array.isArray(e)){if(e.length===0)return!0}else if(e instanceof Object&&JSON.stringify(e)==="{}")return!0;return e==null||e==="null"||e==="undefined"||e===""}function Q(){return window.top!==window}function ee(e){return toString.call(e)==="[object Blob]"}function te(e){if(e.startsWith("data:image"))return!0;const n=e.lastIndexOf("."),t=n>=0?e.slice(n+1).toLowerCase():"";return["png","jpg","jpeg","gif","bmp","webp","svg"].includes(t)}function ne(e,n){for(;e;){if(e===n)return!0;e=Object.getPrototypeOf(e)}return!1}const U=(e,n)=>{const t=C(e),r=C(n);return t&&r?JSON.stringify(e)===JSON.stringify(n):!t&&!r?String(e)===String(n):!1},q=(e,n)=>{if(e=e||[],n=n||[],e.length!==n.length)return!1;for(const[t,r]of e.entries())if(!U(r,n[t]))return!1;return!0},re=(e,n)=>Array.isArray(e)&&Array.isArray(n)?q(e,n):U(e,n);function ie(e,n,t){const r={};let i;typeof t=="function"?i=t:t?i=d=>d[t]:i=d=>d,(e||[]).forEach(d=>{const h=i(d);r[h]={item:d,count:-1}}),(n||[]).forEach(d=>{const h=i(d);r[h]?r[h].count=0:r[h]={item:d,count:1}});const o=[],u=[];for(const d in r)Object.prototype.hasOwnProperty.call(r,d)&&(r[d].count===1?u.push(r[d].item):r[d].count===-1&&o.push(r[d].item));return{changed:o.length+u.length>0,removed:o.length>0,added:u.length>0,removedItems:o,addedItems:u}}const oe=(e,...n)=>{const t=[];return e.forEach(r=>{n.includes(r)||t.push(r)}),t},ae=e=>A(e)?[]:Array.isArray(e)?e:[e],ue=(e,n)=>{if(typeof n!="function"){const t=n;n=r=>String(r[t])}return(e||[]).reduce((t,r)=>{const i=n(r);return t[i]||(t[i]=[]),t[i].push(r),t},{})},se=(e,n,t,r)=>{r=r||(()=>!0);const[i,o]=n,u=[];if(t<=0||e>=i&&e<=o&&r(e)&&(u.push(e),u.length>=t))return u;let d=1;for(;u.length<t;){const h=e-d,T=e+d,E=h>=i,F=T<=o;if(!E&&!F||E&&r(h)&&(u.push(h),u.length>=t)||F&&r(T)&&(u.push(T),u.length>=t))break;d++}return u};function ce(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase()}function H(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase()}function le(e){return e.replace(/-([a-z])/g,(n,t)=>t.toUpperCase()).replace(/_([a-z])/g,(n,t)=>t.toUpperCase())}const W=(e,n,...t)=>{const r={};return n=(n?[].concat(n):[]).concat(t),e&&n.forEach(i=>{Object.hasOwnProperty.call(e,i)&&(r[i]=e[i])}),r},fe=(e,n,...t)=>{const r={};return n=(n?[].concat(n):[]).concat(t),e&&Object.keys(e).forEach(i=>{n.includes(i)||(r[i]=e[i])}),r},de=(e,...n)=>{for(const t of n)Object.assign(e,W(t,Object.keys(e)));return e};function G(e,...n){C(e)||(e={});for(const t of n)if(C(t))for(const r in t)r==="__proto__"||e===t[r]||(C(t[r])?e[r]=G(e[r],t[r]):e[r]=t[r]);return e}const he=e=>{const n={};if(e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A(e[t])||(n[t]=e[t]));return n};function me(e){const n=new WeakMap,t=r=>{if(typeof r=="object"&&r!==null){if(n.has(r))return n.get(r);const i=Array.isArray(r)?[]:{};n.set(r,i);for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=t(r[o]));return i}return r};return t(e)}function z(e,n){try{return JSON.parse(e)}catch(t){return console.error("parse json error:",e),n}}function ge(e,n,t){if(!e||!n)return;const r=n.split(".");let i;for(;(i=r.shift())!==void 0&&r.length!==0;)e[i]||(e[i]={}),e=e[i];i&&(e[i]=t)}function k(e,n){if(!e||!n)return;const t=n.split(".");for(const r of t){if(!e)return;e=e[r]}return e}const V=(e,n)=>{for(const t in e)Object.getOwnPropertyDescriptor(n,t)?C(e[t])&&V(e[t],n[t]):n[t]=e[t];return n},pe=(e,n)=>{var t;return(t=e[n])!=null?t:e[H(n)]};function we(e,n){let{key:t,parentKey:r}=n||{};t=t||"id",r=r||"pid";const i=(e||[]).reduce((u,d)=>(u[k(d,t)]=d,u),{}),o=[];return(e||[]).forEach(u=>{const d=i[k(u,r)];d?(d.children||(d.children=[])).push(u):o.push(u)}),o}function Y(e,n){const t=[];return(e||[]).forEach(r=>{let{children:i,...o}=r;i&&i.length>0&&(i=Y(i,n),i.length>0&&(o.children=i)),n(o)&&t.push(o)}),t}function ye(e,n){const t=e?[...e]:[];for(;t.length>0;){const r=t.shift();if(n(r))return r;r.children&&r.children.length>0&&t.push(...r.children)}return null}function be(e,n){const t=(r,i)=>{for(const o of r){if(n(o))return[...i,o];if(o.children&&o.children.length>0){const u=t(o.children,[...i,o]);if(u)return u}}return null};return t(e||[],[])}function Ee(e,n){const t={children:e||[]},r=[t];let i,o=-1;for(;r.length>0;){i=r.shift();const{children:u}=i;if(u&&u.length>0){for(const[d,h]of u.entries())if(n(h)){o=d;break}if(o!==-1)break;r.push(...u)}}return{found:o!==-1,parent:i===t?null:i,index:o}}function ve(e,n){const t=(e||[]).map(r=>({node:r,parent:null}));for(;t.length>0;){const r=t.shift(),{node:i,parent:o}=r;if(n(i,o)===!1)break;i.children&&i.children.length>0&&t.push(...i.children.map(d=>({node:d,parent:i})))}}function Oe(e){const n=[];if(e&&e.length>0){n.push(...e);let t=0;for(;t<n.length;){const{children:r}=n[t];r&&r.length>0&&n.push(...r),t++}}return n}function Te(e,n,t){t||(t=n);const r=i=>(i||[]).reduce((o,u)=>(u[t]=u[n]+(u.children?r(u.children):0),o+u[t]),0);r(e)}function Fe(e,n){if(!e)return"";const t=new Date(e);if(t.getTime()===0)return"";n=n||"yyyy-MM-dd";let r;const i={"Y+":t.getFullYear().toString(),"y+":t.getFullYear().toString(),"M+":(t.getMonth()+1).toString(),"D+":t.getDate().toString(),"d+":t.getDate().toString(),"h+":(t.getHours()%12||12).toString(),"H+":t.getHours().toString(),"m+":t.getMinutes().toString(),"s+":t.getSeconds().toString(),a:t.getHours()<12?"am":"pm",A:t.getHours()<12?"AM":"PM"};for(const o in i)r=new RegExp(`(${o})`).exec(n),r&&(n=n.replace(r[1],r[1].length===1?i[o]:i[o].padStart(r[1].length,"0")));return n}function Ie(e,n){if(A(e))return"";let{minPrecision:t,maxPrecision:r,decimalPoint:i,thousandSeparator:o,grouping:u}=n||{};t=t!=null?t:0,r=r!=null?r:2,i=i||".",o=o!=null?o:",",u=u!=null?u:3;let[d,h]=`${e}`.split(".");return d=d.replace(new RegExp(`(?<!^-?)(?=(\\d{${u}})+$)`,"g"),o),h=(h||"").slice(0,r).padEnd(t,"0"),h&&(h=i+h),d+h}function De(e,n){if(n){const i=A(e[0])||e[0]===Number.NEGATIVE_INFINITY?"-\u221E":e[0],o=A(e[1])||e[1]===+Number.POSITIVE_INFINITY?"+\u221E":e[1];return`${i+(i==="-\u221E"?" < ":" \u2264 ")+n} < ${o}`}const t=A(e[0])||e[0]==="-\u221E"||e[0]==="-Infinity"?"-\u221E":e[0],r=A(e[1])||e[1]==="+\u221E"||e[1]==="Infinity"?"+\u221E":e[1];return`${t==="-\u221E"?"(":"["} ${t}, ${r} )`}function Pe(e){if(e=Number(e),Number.isNaN(e))return"";const n=["B","KB","MB","GB","TB","PB"];let t=0;for(;e>=1024&&t<n.length-1;)e/=1024,t++;return e=Math.round(e*100)/100,`${e} ${n[t]}`}function Be(e){return Number.isNaN(Number(e))?e||"":`${Number(e)}px`}function Me(e){if(e=Number(e),!Number.isFinite(e)||Number.isNaN(e))return"00:00";const n=Math.floor(e),t=n%60,r=String(t).padStart(2,"0");if(n<3600){const d=Math.floor(n/60);return`${String(d).padStart(2,"0")}:${r}`}const i=Math.floor(n/3600),o=Math.floor(n%3600/60),u=String(o).padStart(2,"0");return`${i}:${u}:${r}`}const L=e=>new Promise(n=>{setTimeout(n,e)}),Ce=(e,n)=>new Promise((t,r)=>{(async()=>{try{const o=Date.now(),u=await e(),d=Date.now()-o;d<n&&await L(n-d),t(u)}catch(o){r(o)}})()}),Ae=()=>{const e=Date.now();return{delayTo:async t=>{const r=Date.now()-e;r<t&&await L(t-r)}}},Se=(e,n,t)=>{let r,i=!1,o;const u=()=>{if(i||e()){r(void 0),clearTimeout(o);return}requestAnimationFrame(u)};return t&&(o=setTimeout(()=>{i=!0},t)),new Promise(d=>{r=d,n?setTimeout(u,n):requestAnimationFrame(u)})},_e=(e,n)=>Math.floor(e+Math.random()*(n-e));function Ue(e){return new Promise((n,t)=>{const r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=()=>{if(r.status===200){const i=new FileReader;i.readAsDataURL(r.response),i.onload=o=>{n(o.target.result)},i.onerror=o=>t(o)}else t(new Error("Failed to load file"))},r.onerror=()=>{t(new Error("Failed to load file"))},r.send()})}function ke(e){return new Promise((n,t)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=i=>{n(i.target.result)},r.onerror=i=>t(i)})}function Le(e){return URL.createObjectURL(e)}function Ne(e){return new Promise((n,t)=>{const r=new FileReader;r.readAsArrayBuffer(e),r.onload=i=>{n(new Blob([i.target.result]))},r.onerror=i=>t(i)})}async function Re(e){if(!e)throw new Error("url is empty");return(await fetch(e)).blob()}async function je(e){if(!e)throw new Error("url is empty");return new Promise((n,t)=>{const r=new Image;r.onload=()=>{const i=document.createElement("canvas");i.width=r.width,i.height=r.height;const o=i.getContext("2d");o==null||o.drawImage(r,0,0,r.width,r.height),i.toBlob(u=>{u?n(u):t(new Error("transform image to blob failed"))},"image/png")},r.onerror=t,r.src=e})}function $e(e,n){if(!e)return"";if(typeof e=="string"&&(e=new URL(e)),n)for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e.searchParams.append(t,n[t]);return e.toString()}function qe(e){return e.replace(/[<>&"]/g,n=>`&#${n.charCodeAt(0)};`)}function He(e){const n=document.createElement("div");return n.innerHTML=e,n.textContent||n.innerText}async function*We(e,n){const t=new TextDecoder("utf-8"),{original:r}=n||{};let i="";for(;;){const{value:o,done:u}=await e.read();if(u)return;i+=t.decode(o);const d=i.split(`
|
|
2
|
+
`);i=d.pop()||"";for(let h of d)if(h=h.trim(),!!h)if(r)yield h;else{if(h==="event: ping")continue;const T=h.match(/^(?:(\w*):)?(.*)$/);if(!T){console.error("[BufferedReader] parse line failed:",h);continue}const E=T[1],F=z(T[2].trim());if(!F){console.error("[BufferedReader] parse json failed:",T[2].trim());continue}yield{event:E,data:F}}}}const Ge=e=>{let{url:n,filename:t}=e;if(t=t||"\u672A\u547D\u540D",n||e.blob&&(n=URL.createObjectURL(e.blob),setTimeout(()=>{URL.revokeObjectURL(n)},1e4)),!n)throw new Error("No URL provided");const r=document.createElement("a");r.href=n,r.download=t,r.click()};function ze(e,n,t){let r,i,o,u,d,h,T=0,E=!1,F=!1,M=!0;if(typeof e!="function")throw new TypeError("Expected a function");n=+n||0,t&&C(t)&&(E=!!t.leading,F="maxWait"in t,o=F?Math.max(+t.maxWait||0,n):o,M="trailing"in t?!!t.trailing:M);function I(p){const O=r,D=i;return r=i=void 0,T=p,u=e.apply(D,O),u}function P(p,O){return setTimeout(p,O)}function a(p){clearTimeout(p)}function f(p){return T=p,d=P(g,n),E?I(p):u}function c(p){const O=p-h,D=p-T,B=n-O;return F?Math.min(B,o-D):B}function s(p){const O=p-h,D=p-T;return h===void 0||O>=n||O<0||F&&D>=o}function g(){const p=Date.now();if(s(p))return w(p);d=P(g,c(p))}function w(p){return d=void 0,M&&r?I(p):(r=i=void 0,u)}function v(){d!==void 0&&a(d),T=0,r=h=i=d=void 0}function m(){return d===void 0?u:w(Date.now())}function b(){return d!==void 0}function y(...p){const O=Date.now(),D=s(O);if(r=p,i=this,h=O,D){if(d===void 0)return f(h);if(F)return d=P(g,n),I(h)}return d===void 0&&(d=P(g,n)),u}return y.cancel=v,y.flush=m,y.pending=b,y}function Ve(e){const{el:n,msg:t}=e||{},r=t===void 0?"\u8BF7\u5B8C\u5584\u8868\u5355\u5185\u5BB9":t;if(r&&S.ElMessage.error(r),!n)return;const i=n.querySelector(".is-error");i&&i.scrollIntoView({behavior:"smooth",inline:"nearest",block:"center"})}async function Ye(e,n={successText:"\u590D\u5236\u6210\u529F"}){const{successText:t}=n||{};try{if(navigator.clipboard){await navigator.clipboard.writeText(e),t&&S.ElMessage.success(t);return}}catch(i){}const r=document.createElement("textarea");document.body.appendChild(r),r.style.position="fixed",r.style.clip="rect(0 0 0 0)",r.style.top="10px",r.value=e,r.select(),document.execCommand("copy",!0),document.body.removeChild(r),t&&S.ElMessage.success(t)}function Je(e,...n){if(!e)return;const t=document.createElement("a");t.addEventListener("click",r=>{r.preventDefault(),window.open(e,...n)}),t.click()}function Ke(e){if(!e)return[];const n=[`${e.slice(0,2)}0000`,`${e.slice(0,4)}00`,e.slice(0,6),e.slice(0,9),e.slice(0,12)],t=0,r=n.indexOf(e)+1;return n.slice(t,r)}class N{constructor(n){this._enumItems={};var t;if(n)if(Array.isArray(n))for(const[r,i]of n.entries())this.add((t=i.key)!=null?t:`${r}`,i);else for(const r in n){const i=n[r];this.add(r,i)}}add(n,t){if(this[n])throw new Error(`\u679A\u4E3E\u9879 ${n} \u5DF2\u5B58\u5728`);const r=t.value;return this[n]=r,this._enumItems[r]={...t},this}keys(){return Object.keys(this).filter(n=>n!=="_enumItems")}*[Symbol.iterator](){for(const n of this.keys())yield this.getItem(this[n])}getItem(n){return this._enumItems[n]}getLabel(n){var t;return(t=this.getItem(n))==null?void 0:t.label}getProps(n){var t;return(t=this.getItem(n))==null?void 0:t.props}filter(n){const t=new N;for(const r of this.keys()){const i=this.getItem(this[r]);n(i,r)&&t.add(r,i)}return t}clone(){return this.filter(()=>!0)}set(n,t){const r=this.getItem(this[n]);return r&&Object.assign(r,t),this}remove(n){const t=this[n];return t!==void 0&&(delete this[n],delete this._enumItems[t]),this}forEach(n){for(const t of this.keys())n(this.getItem(this[t]),t)}}const Xe=(e,n)=>{if(!e||!n)return!1;if(n.includes(" "))throw new Error("className should not contain space.");return e.classList.contains(n)},Ze=(e,n,t)=>{var r,i,o,u,d,h,T,E;if(!e)return!1;const F=e.getBoundingClientRect();let M=0,I=0,P=window.innerHeight,a=window.innerWidth;if(n){const w=n.getBoundingClientRect();M=w.top,I=w.left,P=w.bottom,a=w.right}let f=0,c=0,s=0,g=0;return t&&(f=(i=(r=t.topGap)!=null?r:t.gap)!=null?i:0,c=(u=(o=t.leftGap)!=null?o:t.gap)!=null?u:0,s=(h=(d=t.bottomGap)!=null?d:t.gap)!=null?h:0,g=(E=(T=t.rightGap)!=null?T:t.gap)!=null?E:0),F.top>=M+f&&F.left>=I+c&&F.bottom<=P-s&&F.right<=a-g};function xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J={exports:{}},R={exports:{}},K;function Qe(){return K||(K=1,function(e,n){(function(t,r){e.exports=r()})(window,function(){return function(t){var r={};function i(o){if(r[o])return r[o].exports;var u=r[o]={i:o,l:!1,exports:{}};return t[o].call(u.exports,u,u.exports,i),u.l=!0,u.exports}return i.m=t,i.c=r,i.d=function(o,u,d){i.o(o,u)||Object.defineProperty(o,u,{enumerable:!0,get:d})},i.r=function(o){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,u){if(1&u&&(o=i(o)),8&u||4&u&&typeof o=="object"&&o&&o.__esModule)return o;var d=Object.create(null);if(i.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:o}),2&u&&typeof o!="string")for(var h in o)i.d(d,h,function(T){return o[T]}.bind(null,h));return d},i.n=function(o){var u=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(u,"a",u),u},i.o=function(o,u){return Object.prototype.hasOwnProperty.call(o,u)},i.p="",i(i.s=0)}([function(t,r,i){i.r(r);var o=window,u=/^image\//,d=/\.\w+$/,h={},T={file:null,quality:.8,convertSize:2048e3,loose:!0,redressOrientation:!0},E=function(a){return typeof a=="function"},F=function(a){return u.test(a)};function M(a){a=Object.assign({},T,a),this.options=a,this.file=a.file,this.image=null,this.ParsedOrientationInfo=null,this.init()}var I=M.prototype;for(var P in r.default=M,I.init=function(){var a=this,f=this.file,c=this.options;f&&F(f.type)?(F(c.mimeType)||(c.mimeType=f.type),h.file2Image(f,function(s){E(a.beforeCompress)&&(a.image=s,f.width=s.naturalWidth,f.height=s.naturalHeight,a.beforeCompress(f)),f.type==="image/jpeg"&&c.redressOrientation?a.getParsedOrientationInfo(function(g){a.parsedOrientationInfo=g,a.rendCanvas()}):(a.parsedOrientationInfo={rotate:0,scaleX:1,scaleY:1},a.rendCanvas())},a.error)):a.error("\u8BF7\u4E0A\u4F20\u56FE\u7247\u6587\u4EF6!")},I.rendCanvas=function(){var a=this,f=this.options,c=this.image,s=this.getExpectedEdge(),g=s.dWidth,w=s.dHeight,v=s.width,m=s.height,b=h.image2Canvas(c,g,w,a.beforeDraw.bind(a),a.afterDraw.bind(a),v,m);h.canvas2Blob(b,function(y){y&&(y.width=b.width,y.height=b.height),a.success(y)},f.quality,f.mimeType)},I.beforeCompress=function(){E(this.options.beforeCompress)&&this.options.beforeCompress(this.file)},I.getExpectedEdge=function(){var a,f=this.image,c=this.parsedOrientationInfo.rotate,s=this.options,g=f.naturalWidth,w=f.naturalHeight,v=Math.abs(c)%180==90;v&&(a=w,w=g,g=a);var m=g/w,b=Math.max(s.maxWidth,0)||1/0,y=Math.max(s.maxHeight,0)||1/0,p=Math.max(s.minWidth,0)||0,O=Math.max(s.minHeight,0)||0,D=Math.max(s.width,0)||g,B=Math.max(s.height,0)||w;b<1/0&&y<1/0?y*m>b?y=b/m:b=y*m:b<1/0?y=b/m:y<1/0&&(b=y*m),p>0&&O>0?O*m>p?O=p/m:p=O*m:p>0?O=p/m:O>0&&(p=O*m),B*m>D?B=D/m:D=B*m;var j=D=Math.floor(Math.min(Math.max(D,p),b)),$=B=Math.floor(Math.min(Math.max(B,O),y));return v&&(a=$,$=j,j=a),{dWidth:j,dHeight:$,width:D,height:B}},I.getParsedOrientationInfo=function(a){var f=this;this.getOrientation(function(c){E(a)&&a(f.parseOrientation(c))})},I.getOrientation=function(a){var f=this;h.file2ArrayBuffer(this.file,function(c){E(a)&&a(f.resetAndGetOrientation(c))})},I.resetAndGetOrientation=function(a){var f,c=new DataView(a);try{var s,g,w;if(c.getUint8(0)===255&&c.getUint8(1)===216)for(var v=c.byteLength,m=2;m+1<v;){if(c.getUint8(m)===255&&c.getUint8(m+1)===225){g=m;break}m+=1}if(g){var b=g+4,y=g+10;if(h.getStringFromCharCode(c,b,4)==="Exif"){var p=c.getUint16(y);if(((s=p===18761)||p===19789)&&c.getUint16(y+2,s)===42){var O=c.getUint32(y+4,s);O>=8&&(w=y+O)}}}if(w){var D;for(v=c.getUint16(w,s),D=0;D<v;D+=1)if(m=w+12*D+2,c.getUint16(m,s)===274){m+=8,f=c.getUint16(m,s),c.setUint16(m,1,s);break}}}catch(B){console.error(B),f=1}return f},I.parseOrientation=function(a){var f=0,c=1,s=1;switch(a){case 2:c=-1;break;case 3:f=-180;break;case 4:s=-1;break;case 5:f=90,s=-1;break;case 6:f=90;break;case 7:f=90,c=-1;break;case 8:f=-90}return{rotate:f,scaleX:c,scaleY:s}},I.beforeDraw=function(a,f){var c=this.parsedOrientationInfo,s=c.rotate,g=c.scaleX,w=c.scaleY,v=this.file,m=this.options,b="transparent",y=f.width,p=f.height;switch(v.size>m.convertSize&&m.mimeType==="image/png"&&(b="#fff",m.mimeType="image/jpeg"),a.fillStyle=b,a.fillRect(0,0,y,p),E(m.beforeDraw)&&m.beforeDraw.call(this,a,f),a.save(),s){case 90:a.translate(y,0);break;case-90:a.translate(0,p);break;case-180:a.translate(y,p)}a.rotate(s*Math.PI/180),a.scale(g,w)},I.afterDraw=function(a,f){var c=this.options;E(c.afterDraw)&&c.afterDraw.call(this,a,f)},I.error=function(a){var f=this.options;if(!E(f.error))throw new Error(a);f.error.call(this,a)},I.success=function(a){var f,c,s=this.options,g=this.file,w=this.image,v=this.getExpectedEdge(),m=w.naturalHeight,b=w.naturalWidth;if(a&&a.size)if(!s.loose&&a.size>g.size&&!(v.width>b||v.height>m))console.warn("\u5F53\u524D\u8BBE\u7F6E\u7684\u662F\u975E\u5BBD\u677E\u6A21\u5F0F\uFF0C\u538B\u7F29\u7ED3\u679C\u5927\u4E8E\u6E90\u56FE\u7247\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"),a=g;else{var y=new Date;a.lastModified=y.getTime(),a.lastModifiedDate=y,a.name=g.name,a.name&&a.type!==g.type&&(a.name=a.name.replace(d,(f=a.type,(c=F(f)?f.substr(6):"")==="jpeg"&&(c="jpg"),"."+c)))}else console.warn("\u56FE\u7247\u538B\u7F29\u51FA\u4E86\u70B9\u610F\u5916\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"),a=g;E(s.success)&&s.success.call(this,a)},h.file2DataUrl=function(a,f,c){var s=new FileReader;s.onload=function(){f(s.result)},s.onerror=function(){E(c)&&c("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01")},s.readAsDataURL(a)},h.file2ArrayBuffer=function(a,f,c){var s=new FileReader;s.onload=function(g){f(g.target.result)},s.onerror=function(){E(c)&&c("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01")},s.readAsArrayBuffer(a)},h.getStringFromCharCode=function(a,f,c){var s,g="";for(c+=f,s=f;s<c;s+=1)g+=String.fromCharCode(a.getUint8(s));return g},h.file2Image=function(a,f,c){var s=new Image,g=o.URL||o.webkitURL;if(o.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(o.navigator.userAgent)&&(s.crossOrigin="anonymous"),s.alt=a.name,s.onerror=function(){E(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")},g){var w=g.createObjectURL(a);s.onload=function(){f(s),g.revokeObjectURL(w)},s.src=w}else this.file2DataUrl(a,function(v){s.onload=function(){f(s)},s.src=v},c)},h.url2Image=function(a,f,c){var s=new Image;s.src=a,s.onload=function(){f(s)},s.onerror=function(){E(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")}},h.image2Canvas=function(a,f,c,s,g,w,v){var m=document.createElement("canvas"),b=m.getContext("2d");return m.width=w||a.naturalWidth,m.height=v||a.naturalHeight,E(s)&&s(b,m),b.save(),b.drawImage(a,0,0,f,c),b.restore(),E(g)&&g(b,m),m},h.canvas2DataUrl=function(a,f,c){return a.toDataURL(c||"image/jpeg",f)},h.dataUrl2Image=function(a,f,c){var s=new Image;s.onload=function(){f(s)},s.error=function(){E(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")},s.src=a},h.dataUrl2Blob=function(a,f){for(var c=a.split(",")[1],s=a.match(/^data:(.*?)(;base64)?,/)[1],g=atob(c),w=c.length,v=new Uint8Array(w),m=0;m<w;m++)v[m]=g.charCodeAt(m);return new Blob([v],{type:f||s})},h.blob2DataUrl=function(a,f,c){this.file2DataUrl(a,f,c)},h.blob2Image=function(a,f,c){this.file2Image(a,f,c)},h.canvas2Blob=function(a,f,c,s){var g=this;HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(w,v,m){var b=this.toDataURL(v,m);w(g.dataUrl2Blob(b))}}),a.toBlob(function(w){f(w)},s||"image/jpeg",c||.8)},h.upload=function(a,f,c){var s=new XMLHttpRequest,g=new FormData;g.append("file",f),s.onreadystatechange=function(){if(s.readyState!==4||s.status!==200)throw new Error(s);c&&c(s.responseText)},s.open("POST",a,!0),s.send(g)},h)h.hasOwnProperty(P)&&(M[P]=h[P])}]).default})}(R)),R.exports}(function(e){e.exports=Qe()})(J);var et=xe(J.exports);const tt=e=>{if(!e.file)throw new Error("file is required");const n=e.file.size/1024;let t=e.quality;if(t===void 0){if(n<200)return e.file;n>200&&n<=512?t=.9:n>512&&n<=1024?t=.8:n>1024&&n<=2048?t=.85:n>2048&&n<=10240?t=.8:n>10240&&n<=20480&&(t=.75)}return new Promise((r,i)=>{var o;new et({...e,quality:t,convertSize:(o=e.convertSize)!=null?o:1024,success:u=>{r(u)},error:u=>{i(u)}})})},X=e=>e&&e.split("?")[0].split("/").pop()||"",nt=e=>{if(e=X(e),!e)return"";const n=e.lastIndexOf(".");return n===-1?"":e.slice(n+1).toLowerCase()},rt=(e,n,t)=>Math.min(Math.max(t,e),n),_=new Map,it=(e,n=3)=>{if(!e)throw new Error("name is required");let t;return _.has(e)?t=_.get(e):(t={maxNum:n,currentNum:0,queue:[]},_.set(e,t)),{acquire:async()=>new Promise((d,h)=>{t.currentNum>=t.maxNum?t.queue.push({resolve:d,reject:h}):(t.currentNum++,d(!0))}),release:()=>{if(t.queue.length>0){const{resolve:d}=t.queue.shift();d(!0)}else t.currentNum--},destroy:async()=>{_.delete(e)},getMaxNum:()=>t.maxNum}};l.Enum=N,l.arrayDiff=ie,l.arrayEquals=q,l.assign=de,l.buildTree=we,l.buildUrl=$e,l.clamp=rt,l.combineByField=Te,l.compressImage=tt,l.copyText=Ye,l.createLock=it,l.createStreamIterator=We,l.createTimer=Ae,l.debounce=ze,l.decodeHTMLEntities=He,l.deepAssign=G,l.deepClone=me,l.delayWhen=Se,l.downloadFile=Ge,l.encodeHTMLEntities=qe,l.fileToBlob=Ne,l.fileToDataURL=ke,l.fileToObjectURL=Le,l.filterTree=Y,l.findNode=ye,l.findNodeWithPath=be,l.findParentAndIndex=Ee,l.flatTree=Oe,l.formatBytes=Pe,l.formatDate=Fe,l.formatInterval=De,l.formatNumber=Ie,l.formatPx=Be,l.formatTime=Me,l.getFileExt=nt,l.getFilename=X,l.getNearestNumbers=se,l.getProp=pe,l.getProperty=k,l.getRandInt=_e,l.groupBy=ue,l.handleFormValidateError=Ve,l.hasClass=Xe,l.isBlob=ee,l.isChildClassOf=ne,l.isElementInViewport=Ze,l.isEmpty=A,l.isEqual=re,l.isIframe=Q,l.isImage=te,l.isObject=x,l.isPlainObject=C,l.looseEqual=U,l.mergeDefaultOptions=V,l.omit=fe,l.omitEmpty=he,l.openPage=Je,l.parseAreaCode=Ke,l.parseJson=z,l.pick=W,l.runAtLeastTime=Ce,l.setProperty=ge,l.sleep=L,l.toArray=ae,l.toCamelCase=le,l.toKebabCase=H,l.toUnderscore=ce,l.urlToBlob=Re,l.urlToDataURL=Ue,l.urlToPngBlob=je,l.walkTree=ve,l.withInstall=Z,l.without=oe,Object.defineProperty(l,"__esModule",{value:!0})});
|
package/dist/utils/index.min.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! Next UI utils v1.5.
|
|
2
|
-
`);i=f.pop()||"";for(let d of f)if(d=d.trim(),!!d)if(r)yield d;else{if(d==="event: ping")continue;const O=d.match(/^(?:(\w*):)?(.*)$/);if(!O){console.error("[BufferedReader] parse line failed:",d);continue}const b=O[1],F=W(O[2].trim());if(!F){console.error("[BufferedReader] parse json failed:",O[2].trim());continue}yield{event:b,data:F}}}}const qe=e=>{let{url:n,filename:t}=e;if(t=t||"\u672A\u547D\u540D",n||e.blob&&(n=URL.createObjectURL(e.blob),setTimeout(()=>{URL.revokeObjectURL(n)},1e4)),!n)throw new Error("No URL provided");const r=document.createElement("a");r.href=n,r.download=t,r.click()};function He(e,n,t){let r,i,o,u,f,d,O=0,b=!1,F=!1,P=!0;if(typeof e!="function")throw new TypeError("Expected a function");n=+n||0,t&&B(t)&&(b=!!t.leading,F="maxWait"in t,o=F?Math.max(+t.maxWait||0,n):o,P="trailing"in t?!!t.trailing:P);function x(p){const E=r,I=i;return r=i=void 0,O=p,u=e.apply(I,E),u}function T(p,E){return setTimeout(p,E)}function s(p){clearTimeout(p)}function l(p){return O=p,f=T(g,n),b?x(p):u}function c(p){const E=p-d,I=p-O,D=n-E;return F?Math.min(D,o-I):D}function a(p){const E=p-d,I=p-O;return d===void 0||E>=n||E<0||F&&I>=o}function g(){const p=Date.now();if(a(p))return m(p);f=T(g,c(p))}function m(p){return f=void 0,P&&r?x(p):(r=i=void 0,u)}function v(){f!==void 0&&s(f),O=0,r=d=i=f=void 0}function h(){return f===void 0?u:m(Date.now())}function y(){return f!==void 0}function w(...p){const E=Date.now(),I=a(E);if(r=p,i=this,d=E,I){if(f===void 0)return l(d);if(F)return f=T(g,n),x(d)}return f===void 0&&(f=T(g,n)),u}return w.cancel=v,w.flush=h,w.pending=y,w}function We(e){const{el:n,msg:t}=e||{},r=t===void 0?"\u8BF7\u5B8C\u5584\u8868\u5355\u5185\u5BB9":t;if(r&&k.error(r),!n)return;const i=n.querySelector(".is-error");i&&i.scrollIntoView({behavior:"smooth",inline:"nearest",block:"center"})}async function Ge(e,n={successText:"\u590D\u5236\u6210\u529F"}){const{successText:t}=n||{};try{if(navigator.clipboard){await navigator.clipboard.writeText(e),t&&k.success(t);return}}catch(i){}const r=document.createElement("textarea");document.body.appendChild(r),r.style.position="fixed",r.style.clip="rect(0 0 0 0)",r.style.top="10px",r.value=e,r.select(),document.execCommand("copy",!0),document.body.removeChild(r),t&&k.success(t)}function ze(e,...n){if(!e)return;const t=document.createElement("a");t.addEventListener("click",r=>{r.preventDefault(),window.open(e,...n)}),t.click()}function Ve(e){if(!e)return[];const n=[`${e.slice(0,2)}0000`,`${e.slice(0,4)}00`,e.slice(0,6),e.slice(0,9),e.slice(0,12)],t=0,r=n.indexOf(e)+1;return n.slice(t,r)}class N{constructor(n){this._enumItems={};var t;if(n)if(Array.isArray(n))for(const[r,i]of n.entries())this.add((t=i.key)!=null?t:`${r}`,i);else for(const r in n){const i=n[r];this.add(r,i)}}add(n,t){if(this[n])throw new Error(`\u679A\u4E3E\u9879 ${n} \u5DF2\u5B58\u5728`);const r=t.value;return this[n]=r,this._enumItems[r]={...t},this}keys(){return Object.keys(this).filter(n=>n!=="_enumItems")}*[Symbol.iterator](){for(const n of this.keys())yield this.getItem(this[n])}getItem(n){return this._enumItems[n]}getLabel(n){var t;return(t=this.getItem(n))==null?void 0:t.label}getProps(n){var t;return(t=this.getItem(n))==null?void 0:t.props}filter(n){const t=new N;for(const r of this.keys()){const i=this.getItem(this[r]);n(i,r)&&t.add(r,i)}return t}clone(){return this.filter(()=>!0)}set(n,t){const r=this.getItem(this[n]);return r&&Object.assign(r,t),this}remove(n){const t=this[n];return t!==void 0&&(delete this[n],delete this._enumItems[t]),this}forEach(n){for(const t of this.keys())n(this.getItem(this[t]),t)}}const Ye=(e,n)=>{if(!e||!n)return!1;if(n.includes(" "))throw new Error("className should not contain space.");return e.classList.contains(n)},Je=(e,n,t)=>{var r,i,o,u,f,d,O,b;if(!e)return!1;const F=e.getBoundingClientRect();let P=0,x=0,T=window.innerHeight,s=window.innerWidth;if(n){const m=n.getBoundingClientRect();P=m.top,x=m.left,T=m.bottom,s=m.right}let l=0,c=0,a=0,g=0;return t&&(l=(i=(r=t.topGap)!=null?r:t.gap)!=null?i:0,c=(u=(o=t.leftGap)!=null?o:t.gap)!=null?u:0,a=(d=(f=t.bottomGap)!=null?f:t.gap)!=null?d:0,g=(b=(O=t.rightGap)!=null?O:t.gap)!=null?b:0),F.top>=P+l&&F.left>=x+c&&F.bottom<=T-a&&F.right<=s-g};function Xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var V={exports:{}},R={exports:{}},Y;function Ke(){return Y||(Y=1,function(e,n){(function(t,r){e.exports=r()})(window,function(){return function(t){var r={};function i(o){if(r[o])return r[o].exports;var u=r[o]={i:o,l:!1,exports:{}};return t[o].call(u.exports,u,u.exports,i),u.l=!0,u.exports}return i.m=t,i.c=r,i.d=function(o,u,f){i.o(o,u)||Object.defineProperty(o,u,{enumerable:!0,get:f})},i.r=function(o){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,u){if(1&u&&(o=i(o)),8&u||4&u&&typeof o=="object"&&o&&o.__esModule)return o;var f=Object.create(null);if(i.r(f),Object.defineProperty(f,"default",{enumerable:!0,value:o}),2&u&&typeof o!="string")for(var d in o)i.d(f,d,function(O){return o[O]}.bind(null,d));return f},i.n=function(o){var u=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(u,"a",u),u},i.o=function(o,u){return Object.prototype.hasOwnProperty.call(o,u)},i.p="",i(i.s=0)}([function(t,r,i){i.r(r);var o=window,u=/^image\//,f=/\.\w+$/,d={},O={file:null,quality:.8,convertSize:2048e3,loose:!0,redressOrientation:!0},b=function(s){return typeof s=="function"},F=function(s){return u.test(s)};function P(s){s=Object.assign({},O,s),this.options=s,this.file=s.file,this.image=null,this.ParsedOrientationInfo=null,this.init()}var x=P.prototype;for(var T in r.default=P,x.init=function(){var s=this,l=this.file,c=this.options;l&&F(l.type)?(F(c.mimeType)||(c.mimeType=l.type),d.file2Image(l,function(a){b(s.beforeCompress)&&(s.image=a,l.width=a.naturalWidth,l.height=a.naturalHeight,s.beforeCompress(l)),l.type==="image/jpeg"&&c.redressOrientation?s.getParsedOrientationInfo(function(g){s.parsedOrientationInfo=g,s.rendCanvas()}):(s.parsedOrientationInfo={rotate:0,scaleX:1,scaleY:1},s.rendCanvas())},s.error)):s.error("\u8BF7\u4E0A\u4F20\u56FE\u7247\u6587\u4EF6!")},x.rendCanvas=function(){var s=this,l=this.options,c=this.image,a=this.getExpectedEdge(),g=a.dWidth,m=a.dHeight,v=a.width,h=a.height,y=d.image2Canvas(c,g,m,s.beforeDraw.bind(s),s.afterDraw.bind(s),v,h);d.canvas2Blob(y,function(w){w&&(w.width=y.width,w.height=y.height),s.success(w)},l.quality,l.mimeType)},x.beforeCompress=function(){b(this.options.beforeCompress)&&this.options.beforeCompress(this.file)},x.getExpectedEdge=function(){var s,l=this.image,c=this.parsedOrientationInfo.rotate,a=this.options,g=l.naturalWidth,m=l.naturalHeight,v=Math.abs(c)%180==90;v&&(s=m,m=g,g=s);var h=g/m,y=Math.max(a.maxWidth,0)||1/0,w=Math.max(a.maxHeight,0)||1/0,p=Math.max(a.minWidth,0)||0,E=Math.max(a.minHeight,0)||0,I=Math.max(a.width,0)||g,D=Math.max(a.height,0)||m;y<1/0&&w<1/0?w*h>y?w=y/h:y=w*h:y<1/0?w=y/h:w<1/0&&(y=w*h),p>0&&E>0?E*h>p?E=p/h:p=E*h:p>0?E=p/h:E>0&&(p=E*h),D*h>I?D=I/h:I=D*h;var C=I=Math.floor(Math.min(Math.max(I,p),y)),M=D=Math.floor(Math.min(Math.max(D,E),w));return v&&(s=M,M=C,C=s),{dWidth:C,dHeight:M,width:I,height:D}},x.getParsedOrientationInfo=function(s){var l=this;this.getOrientation(function(c){b(s)&&s(l.parseOrientation(c))})},x.getOrientation=function(s){var l=this;d.file2ArrayBuffer(this.file,function(c){b(s)&&s(l.resetAndGetOrientation(c))})},x.resetAndGetOrientation=function(s){var l,c=new DataView(s);try{var a,g,m;if(c.getUint8(0)===255&&c.getUint8(1)===216)for(var v=c.byteLength,h=2;h+1<v;){if(c.getUint8(h)===255&&c.getUint8(h+1)===225){g=h;break}h+=1}if(g){var y=g+4,w=g+10;if(d.getStringFromCharCode(c,y,4)==="Exif"){var p=c.getUint16(w);if(((a=p===18761)||p===19789)&&c.getUint16(w+2,a)===42){var E=c.getUint32(w+4,a);E>=8&&(m=w+E)}}}if(m){var I;for(v=c.getUint16(m,a),I=0;I<v;I+=1)if(h=m+12*I+2,c.getUint16(h,a)===274){h+=8,l=c.getUint16(h,a),c.setUint16(h,1,a);break}}}catch(D){console.error(D),l=1}return l},x.parseOrientation=function(s){var l=0,c=1,a=1;switch(s){case 2:c=-1;break;case 3:l=-180;break;case 4:a=-1;break;case 5:l=90,a=-1;break;case 6:l=90;break;case 7:l=90,c=-1;break;case 8:l=-90}return{rotate:l,scaleX:c,scaleY:a}},x.beforeDraw=function(s,l){var c=this.parsedOrientationInfo,a=c.rotate,g=c.scaleX,m=c.scaleY,v=this.file,h=this.options,y="transparent",w=l.width,p=l.height;switch(v.size>h.convertSize&&h.mimeType==="image/png"&&(y="#fff",h.mimeType="image/jpeg"),s.fillStyle=y,s.fillRect(0,0,w,p),b(h.beforeDraw)&&h.beforeDraw.call(this,s,l),s.save(),a){case 90:s.translate(w,0);break;case-90:s.translate(0,p);break;case-180:s.translate(w,p)}s.rotate(a*Math.PI/180),s.scale(g,m)},x.afterDraw=function(s,l){var c=this.options;b(c.afterDraw)&&c.afterDraw.call(this,s,l)},x.error=function(s){var l=this.options;if(!b(l.error))throw new Error(s);l.error.call(this,s)},x.success=function(s){var l,c,a=this.options,g=this.file,m=this.image,v=this.getExpectedEdge(),h=m.naturalHeight,y=m.naturalWidth;if(s&&s.size)if(!a.loose&&s.size>g.size&&!(v.width>y||v.height>h))console.warn("\u5F53\u524D\u8BBE\u7F6E\u7684\u662F\u975E\u5BBD\u677E\u6A21\u5F0F\uFF0C\u538B\u7F29\u7ED3\u679C\u5927\u4E8E\u6E90\u56FE\u7247\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"),s=g;else{var w=new Date;s.lastModified=w.getTime(),s.lastModifiedDate=w,s.name=g.name,s.name&&s.type!==g.type&&(s.name=s.name.replace(f,(l=s.type,(c=F(l)?l.substr(6):"")==="jpeg"&&(c="jpg"),"."+c)))}else console.warn("\u56FE\u7247\u538B\u7F29\u51FA\u4E86\u70B9\u610F\u5916\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"),s=g;b(a.success)&&a.success.call(this,s)},d.file2DataUrl=function(s,l,c){var a=new FileReader;a.onload=function(){l(a.result)},a.onerror=function(){b(c)&&c("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01")},a.readAsDataURL(s)},d.file2ArrayBuffer=function(s,l,c){var a=new FileReader;a.onload=function(g){l(g.target.result)},a.onerror=function(){b(c)&&c("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01")},a.readAsArrayBuffer(s)},d.getStringFromCharCode=function(s,l,c){var a,g="";for(c+=l,a=l;a<c;a+=1)g+=String.fromCharCode(s.getUint8(a));return g},d.file2Image=function(s,l,c){var a=new Image,g=o.URL||o.webkitURL;if(o.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(o.navigator.userAgent)&&(a.crossOrigin="anonymous"),a.alt=s.name,a.onerror=function(){b(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")},g){var m=g.createObjectURL(s);a.onload=function(){l(a),g.revokeObjectURL(m)},a.src=m}else this.file2DataUrl(s,function(v){a.onload=function(){l(a)},a.src=v},c)},d.url2Image=function(s,l,c){var a=new Image;a.src=s,a.onload=function(){l(a)},a.onerror=function(){b(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")}},d.image2Canvas=function(s,l,c,a,g,m,v){var h=document.createElement("canvas"),y=h.getContext("2d");return h.width=m||s.naturalWidth,h.height=v||s.naturalHeight,b(a)&&a(y,h),y.save(),y.drawImage(s,0,0,l,c),y.restore(),b(g)&&g(y,h),h},d.canvas2DataUrl=function(s,l,c){return s.toDataURL(c||"image/jpeg",l)},d.dataUrl2Image=function(s,l,c){var a=new Image;a.onload=function(){l(a)},a.error=function(){b(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")},a.src=s},d.dataUrl2Blob=function(s,l){for(var c=s.split(",")[1],a=s.match(/^data:(.*?)(;base64)?,/)[1],g=atob(c),m=c.length,v=new Uint8Array(m),h=0;h<m;h++)v[h]=g.charCodeAt(h);return new Blob([v],{type:l||a})},d.blob2DataUrl=function(s,l,c){this.file2DataUrl(s,l,c)},d.blob2Image=function(s,l,c){this.file2Image(s,l,c)},d.canvas2Blob=function(s,l,c,a){var g=this;HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(m,v,h){var y=this.toDataURL(v,h);m(g.dataUrl2Blob(y))}}),s.toBlob(function(m){l(m)},a||"image/jpeg",c||.8)},d.upload=function(s,l,c){var a=new XMLHttpRequest,g=new FormData;g.append("file",l),a.onreadystatechange=function(){if(a.readyState!==4||a.status!==200)throw new Error(a);c&&c(a.responseText)},a.open("POST",s,!0),a.send(g)},d)d.hasOwnProperty(T)&&(P[T]=d[T])}]).default})}(R)),R.exports}(function(e){e.exports=Ke()})(V);var Ze=Xe(V.exports);const Qe=e=>{if(!e.file)throw new Error("file is required");const n=e.file.size/1024;let t=e.quality;if(t===void 0){if(n<200)return e.file;n>200&&n<=512?t=.9:n>512&&n<=1024?t=.8:n>1024&&n<=2048?t=.85:n>2048&&n<=10240?t=.8:n>10240&&n<=20480&&(t=.75)}return new Promise((r,i)=>{var o;new Ze({...e,quality:t,convertSize:(o=e.convertSize)!=null?o:1024,success:u=>{r(u)},error:u=>{i(u)}})})},J=e=>e&&e.split("?")[0].split("/").pop()||"",et=e=>{if(e=J(e),!e)return"";const n=e.lastIndexOf(".");return n===-1?"":e.slice(n+1).toLowerCase()},tt=(e,n,t)=>Math.min(Math.max(t,e),n),A=new Map,nt=(e,n=3)=>{if(!e)throw new Error("name is required");let t;return A.has(e)?t=A.get(e):(t={maxNum:n,currentNum:0,queue:[]},A.set(e,t)),{acquire:async()=>new Promise((f,d)=>{t.currentNum>=t.maxNum?t.queue.push({resolve:f,reject:d}):(t.currentNum++,f(!0))}),release:()=>{if(t.queue.length>0){const{resolve:f}=t.queue.shift();f(!0)}else t.currentNum--},destroy:async()=>{A.delete(e)},getMaxNum:()=>t.maxNum}};export{N as Enum,re as arrayDiff,j as arrayEquals,fe as assign,me as buildTree,Re as buildUrl,tt as clamp,Oe as combineByField,Qe as compressImage,Ge as copyText,nt as createLock,$e as createStreamIterator,Be as createTimer,He as debounce,je as decodeHTMLEntities,H as deepAssign,he as deepClone,_e as delayWhen,qe as downloadFile,Ne as encodeHTMLEntities,Se as fileToBlob,Me as fileToDataURL,ke as fileToObjectURL,z as filterTree,we as findNode,ye as findNodeWithPath,be as findParentAndIndex,Ee as flatTree,Te as formatBytes,Fe as formatDate,Ie as formatInterval,xe as formatNumber,De as formatPx,et as getFileExt,J as getFilename,ue as getNearestNumbers,pe as getProp,U as getProperty,Ae as getRandInt,se as groupBy,We as handleFormValidateError,Ye as hasClass,Q as isBlob,te as isChildClassOf,Je as isElementInViewport,_ as isEmpty,ne as isEqual,Z as isIframe,ee as isImage,K as isObject,B as isPlainObject,S as looseEqual,G as mergeDefaultOptions,le as omit,de as omitEmpty,ze as openPage,Ve as parseAreaCode,W as parseJson,q as pick,Pe as runAtLeastTime,ge as setProperty,L as sleep,oe as toArray,ce as toCamelCase,$ as toKebabCase,ae as toUnderscore,Ue as urlToBlob,Ce as urlToDataURL,Le as urlToPngBlob,ve as walkTree,X as withInstall,ie as without};
|
|
1
|
+
/*! Next UI utils v1.5.7 */import{ElMessage as C}from"element-plus";const X=(e,n)=>{try{if(e.install=t=>{for(const r of[e,...Object.values(n!=null?n:{})])r.name&&t.component(r.name,r)},n)for(const[t,r]of Object.entries(n))e[t]=r;return e}catch(t){}};function K(e){const n=typeof e;return e!=null&&(n==="object"||n==="function")}function M(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"}function P(e){if(typeof e=="boolean"||typeof e=="number")return!1;if(Array.isArray(e)){if(e.length===0)return!0}else if(e instanceof Object&&JSON.stringify(e)==="{}")return!0;return e==null||e==="null"||e==="undefined"||e===""}function Z(){return window.top!==window}function Q(e){return toString.call(e)==="[object Blob]"}function ee(e){if(e.startsWith("data:image"))return!0;const n=e.lastIndexOf("."),t=n>=0?e.slice(n+1).toLowerCase():"";return["png","jpg","jpeg","gif","bmp","webp","svg"].includes(t)}function te(e,n){for(;e;){if(e===n)return!0;e=Object.getPrototypeOf(e)}return!1}const k=(e,n)=>{const t=M(e),r=M(n);return t&&r?JSON.stringify(e)===JSON.stringify(n):!t&&!r?String(e)===String(n):!1},j=(e,n)=>{if(e=e||[],n=n||[],e.length!==n.length)return!1;for(const[t,r]of e.entries())if(!k(r,n[t]))return!1;return!0},ne=(e,n)=>Array.isArray(e)&&Array.isArray(n)?j(e,n):k(e,n);function re(e,n,t){const r={};let i;typeof t=="function"?i=t:t?i=f=>f[t]:i=f=>f,(e||[]).forEach(f=>{const h=i(f);r[h]={item:f,count:-1}}),(n||[]).forEach(f=>{const h=i(f);r[h]?r[h].count=0:r[h]={item:f,count:1}});const o=[],u=[];for(const f in r)Object.prototype.hasOwnProperty.call(r,f)&&(r[f].count===1?u.push(r[f].item):r[f].count===-1&&o.push(r[f].item));return{changed:o.length+u.length>0,removed:o.length>0,added:u.length>0,removedItems:o,addedItems:u}}const ie=(e,...n)=>{const t=[];return e.forEach(r=>{n.includes(r)||t.push(r)}),t},oe=e=>P(e)?[]:Array.isArray(e)?e:[e],se=(e,n)=>{if(typeof n!="function"){const t=n;n=r=>String(r[t])}return(e||[]).reduce((t,r)=>{const i=n(r);return t[i]||(t[i]=[]),t[i].push(r),t},{})},ue=(e,n,t,r)=>{r=r||(()=>!0);const[i,o]=n,u=[];if(t<=0||e>=i&&e<=o&&r(e)&&(u.push(e),u.length>=t))return u;let f=1;for(;u.length<t;){const h=e-f,F=e+f,b=h>=i,O=F<=o;if(!b&&!O||b&&r(h)&&(u.push(h),u.length>=t)||O&&r(F)&&(u.push(F),u.length>=t))break;f++}return u};function ae(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase()}function $(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase()}function ce(e){return e.replace(/-([a-z])/g,(n,t)=>t.toUpperCase()).replace(/_([a-z])/g,(n,t)=>t.toUpperCase())}const q=(e,n,...t)=>{const r={};return n=(n?[].concat(n):[]).concat(t),e&&n.forEach(i=>{Object.hasOwnProperty.call(e,i)&&(r[i]=e[i])}),r},le=(e,n,...t)=>{const r={};return n=(n?[].concat(n):[]).concat(t),e&&Object.keys(e).forEach(i=>{n.includes(i)||(r[i]=e[i])}),r},fe=(e,...n)=>{for(const t of n)Object.assign(e,q(t,Object.keys(e)));return e};function H(e,...n){M(e)||(e={});for(const t of n)if(M(t))for(const r in t)r==="__proto__"||e===t[r]||(M(t[r])?e[r]=H(e[r],t[r]):e[r]=t[r]);return e}const he=e=>{const n={};if(e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(P(e[t])||(n[t]=e[t]));return n};function de(e){const n=new WeakMap,t=r=>{if(typeof r=="object"&&r!==null){if(n.has(r))return n.get(r);const i=Array.isArray(r)?[]:{};n.set(r,i);for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=t(r[o]));return i}return r};return t(e)}function W(e,n){try{return JSON.parse(e)}catch(t){return console.error("parse json error:",e),n}}function ge(e,n,t){if(!e||!n)return;const r=n.split(".");let i;for(;(i=r.shift())!==void 0&&r.length!==0;)e[i]||(e[i]={}),e=e[i];i&&(e[i]=t)}function U(e,n){if(!e||!n)return;const t=n.split(".");for(const r of t){if(!e)return;e=e[r]}return e}const G=(e,n)=>{for(const t in e)Object.getOwnPropertyDescriptor(n,t)?M(e[t])&&G(e[t],n[t]):n[t]=e[t];return n},me=(e,n)=>{var t;return(t=e[n])!=null?t:e[$(n)]};function pe(e,n){let{key:t,parentKey:r}=n||{};t=t||"id",r=r||"pid";const i=(e||[]).reduce((u,f)=>(u[U(f,t)]=f,u),{}),o=[];return(e||[]).forEach(u=>{const f=i[U(u,r)];f?(f.children||(f.children=[])).push(u):o.push(u)}),o}function z(e,n){const t=[];return(e||[]).forEach(r=>{let{children:i,...o}=r;i&&i.length>0&&(i=z(i,n),i.length>0&&(o.children=i)),n(o)&&t.push(o)}),t}function we(e,n){const t=e?[...e]:[];for(;t.length>0;){const r=t.shift();if(n(r))return r;r.children&&r.children.length>0&&t.push(...r.children)}return null}function ye(e,n){const t=(r,i)=>{for(const o of r){if(n(o))return[...i,o];if(o.children&&o.children.length>0){const u=t(o.children,[...i,o]);if(u)return u}}return null};return t(e||[],[])}function be(e,n){const t={children:e||[]},r=[t];let i,o=-1;for(;r.length>0;){i=r.shift();const{children:u}=i;if(u&&u.length>0){for(const[f,h]of u.entries())if(n(h)){o=f;break}if(o!==-1)break;r.push(...u)}}return{found:o!==-1,parent:i===t?null:i,index:o}}function ve(e,n){const t=(e||[]).map(r=>({node:r,parent:null}));for(;t.length>0;){const r=t.shift(),{node:i,parent:o}=r;if(n(i,o)===!1)break;i.children&&i.children.length>0&&t.push(...i.children.map(f=>({node:f,parent:i})))}}function Ee(e){const n=[];if(e&&e.length>0){n.push(...e);let t=0;for(;t<n.length;){const{children:r}=n[t];r&&r.length>0&&n.push(...r),t++}}return n}function Fe(e,n,t){t||(t=n);const r=i=>(i||[]).reduce((o,u)=>(u[t]=u[n]+(u.children?r(u.children):0),o+u[t]),0);r(e)}function Oe(e,n){if(!e)return"";const t=new Date(e);if(t.getTime()===0)return"";n=n||"yyyy-MM-dd";let r;const i={"Y+":t.getFullYear().toString(),"y+":t.getFullYear().toString(),"M+":(t.getMonth()+1).toString(),"D+":t.getDate().toString(),"d+":t.getDate().toString(),"h+":(t.getHours()%12||12).toString(),"H+":t.getHours().toString(),"m+":t.getMinutes().toString(),"s+":t.getSeconds().toString(),a:t.getHours()<12?"am":"pm",A:t.getHours()<12?"AM":"PM"};for(const o in i)r=new RegExp(`(${o})`).exec(n),r&&(n=n.replace(r[1],r[1].length===1?i[o]:i[o].padStart(r[1].length,"0")));return n}function xe(e,n){if(P(e))return"";let{minPrecision:t,maxPrecision:r,decimalPoint:i,thousandSeparator:o,grouping:u}=n||{};t=t!=null?t:0,r=r!=null?r:2,i=i||".",o=o!=null?o:",",u=u!=null?u:3;let[f,h]=`${e}`.split(".");return f=f.replace(new RegExp(`(?<!^-?)(?=(\\d{${u}})+$)`,"g"),o),h=(h||"").slice(0,r).padEnd(t,"0"),h&&(h=i+h),f+h}function Ie(e,n){if(n){const i=P(e[0])||e[0]===Number.NEGATIVE_INFINITY?"-\u221E":e[0],o=P(e[1])||e[1]===+Number.POSITIVE_INFINITY?"+\u221E":e[1];return`${i+(i==="-\u221E"?" < ":" \u2264 ")+n} < ${o}`}const t=P(e[0])||e[0]==="-\u221E"||e[0]==="-Infinity"?"-\u221E":e[0],r=P(e[1])||e[1]==="+\u221E"||e[1]==="Infinity"?"+\u221E":e[1];return`${t==="-\u221E"?"(":"["} ${t}, ${r} )`}function Te(e){if(e=Number(e),Number.isNaN(e))return"";const n=["B","KB","MB","GB","TB","PB"];let t=0;for(;e>=1024&&t<n.length-1;)e/=1024,t++;return e=Math.round(e*100)/100,`${e} ${n[t]}`}function De(e){return Number.isNaN(Number(e))?e||"":`${Number(e)}px`}function Se(e){if(e=Number(e),!Number.isFinite(e)||Number.isNaN(e))return"00:00";const n=Math.floor(e),t=n%60,r=String(t).padStart(2,"0");if(n<3600){const f=Math.floor(n/60);return`${String(f).padStart(2,"0")}:${r}`}const i=Math.floor(n/3600),o=Math.floor(n%3600/60),u=String(o).padStart(2,"0");return`${i}:${u}:${r}`}const L=e=>new Promise(n=>{setTimeout(n,e)}),Me=(e,n)=>new Promise((t,r)=>{(async()=>{try{const o=Date.now(),u=await e(),f=Date.now()-o;f<n&&await L(n-f),t(u)}catch(o){r(o)}})()}),Pe=()=>{const e=Date.now();return{delayTo:async t=>{const r=Date.now()-e;r<t&&await L(t-r)}}},Be=(e,n,t)=>{let r,i=!1,o;const u=()=>{if(i||e()){r(void 0),clearTimeout(o);return}requestAnimationFrame(u)};return t&&(o=setTimeout(()=>{i=!0},t)),new Promise(f=>{r=f,n?setTimeout(u,n):requestAnimationFrame(u)})},_e=(e,n)=>Math.floor(e+Math.random()*(n-e));function Ae(e){return new Promise((n,t)=>{const r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=()=>{if(r.status===200){const i=new FileReader;i.readAsDataURL(r.response),i.onload=o=>{n(o.target.result)},i.onerror=o=>t(o)}else t(new Error("Failed to load file"))},r.onerror=()=>{t(new Error("Failed to load file"))},r.send()})}function Ce(e){return new Promise((n,t)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=i=>{n(i.target.result)},r.onerror=i=>t(i)})}function ke(e){return URL.createObjectURL(e)}function Ue(e){return new Promise((n,t)=>{const r=new FileReader;r.readAsArrayBuffer(e),r.onload=i=>{n(new Blob([i.target.result]))},r.onerror=i=>t(i)})}async function Le(e){if(!e)throw new Error("url is empty");return(await fetch(e)).blob()}async function Ne(e){if(!e)throw new Error("url is empty");return new Promise((n,t)=>{const r=new Image;r.onload=()=>{const i=document.createElement("canvas");i.width=r.width,i.height=r.height;const o=i.getContext("2d");o==null||o.drawImage(r,0,0,r.width,r.height),i.toBlob(u=>{u?n(u):t(new Error("transform image to blob failed"))},"image/png")},r.onerror=t,r.src=e})}function Re(e,n){if(!e)return"";if(typeof e=="string"&&(e=new URL(e)),n)for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e.searchParams.append(t,n[t]);return e.toString()}function je(e){return e.replace(/[<>&"]/g,n=>`&#${n.charCodeAt(0)};`)}function $e(e){const n=document.createElement("div");return n.innerHTML=e,n.textContent||n.innerText}async function*qe(e,n){const t=new TextDecoder("utf-8"),{original:r}=n||{};let i="";for(;;){const{value:o,done:u}=await e.read();if(u)return;i+=t.decode(o);const f=i.split(`
|
|
2
|
+
`);i=f.pop()||"";for(let h of f)if(h=h.trim(),!!h)if(r)yield h;else{if(h==="event: ping")continue;const F=h.match(/^(?:(\w*):)?(.*)$/);if(!F){console.error("[BufferedReader] parse line failed:",h);continue}const b=F[1],O=W(F[2].trim());if(!O){console.error("[BufferedReader] parse json failed:",F[2].trim());continue}yield{event:b,data:O}}}}const He=e=>{let{url:n,filename:t}=e;if(t=t||"\u672A\u547D\u540D",n||e.blob&&(n=URL.createObjectURL(e.blob),setTimeout(()=>{URL.revokeObjectURL(n)},1e4)),!n)throw new Error("No URL provided");const r=document.createElement("a");r.href=n,r.download=t,r.click()};function We(e,n,t){let r,i,o,u,f,h,F=0,b=!1,O=!1,S=!0;if(typeof e!="function")throw new TypeError("Expected a function");n=+n||0,t&&M(t)&&(b=!!t.leading,O="maxWait"in t,o=O?Math.max(+t.maxWait||0,n):o,S="trailing"in t?!!t.trailing:S);function x(m){const E=r,I=i;return r=i=void 0,F=m,u=e.apply(I,E),u}function T(m,E){return setTimeout(m,E)}function s(m){clearTimeout(m)}function l(m){return F=m,f=T(g,n),b?x(m):u}function c(m){const E=m-h,I=m-F,D=n-E;return O?Math.min(D,o-I):D}function a(m){const E=m-h,I=m-F;return h===void 0||E>=n||E<0||O&&I>=o}function g(){const m=Date.now();if(a(m))return p(m);f=T(g,c(m))}function p(m){return f=void 0,S&&r?x(m):(r=i=void 0,u)}function v(){f!==void 0&&s(f),F=0,r=h=i=f=void 0}function d(){return f===void 0?u:p(Date.now())}function y(){return f!==void 0}function w(...m){const E=Date.now(),I=a(E);if(r=m,i=this,h=E,I){if(f===void 0)return l(h);if(O)return f=T(g,n),x(h)}return f===void 0&&(f=T(g,n)),u}return w.cancel=v,w.flush=d,w.pending=y,w}function Ge(e){const{el:n,msg:t}=e||{},r=t===void 0?"\u8BF7\u5B8C\u5584\u8868\u5355\u5185\u5BB9":t;if(r&&C.error(r),!n)return;const i=n.querySelector(".is-error");i&&i.scrollIntoView({behavior:"smooth",inline:"nearest",block:"center"})}async function ze(e,n={successText:"\u590D\u5236\u6210\u529F"}){const{successText:t}=n||{};try{if(navigator.clipboard){await navigator.clipboard.writeText(e),t&&C.success(t);return}}catch(i){}const r=document.createElement("textarea");document.body.appendChild(r),r.style.position="fixed",r.style.clip="rect(0 0 0 0)",r.style.top="10px",r.value=e,r.select(),document.execCommand("copy",!0),document.body.removeChild(r),t&&C.success(t)}function Ve(e,...n){if(!e)return;const t=document.createElement("a");t.addEventListener("click",r=>{r.preventDefault(),window.open(e,...n)}),t.click()}function Ye(e){if(!e)return[];const n=[`${e.slice(0,2)}0000`,`${e.slice(0,4)}00`,e.slice(0,6),e.slice(0,9),e.slice(0,12)],t=0,r=n.indexOf(e)+1;return n.slice(t,r)}class R{constructor(n){this._enumItems={};var t;if(n)if(Array.isArray(n))for(const[r,i]of n.entries())this.add((t=i.key)!=null?t:`${r}`,i);else for(const r in n){const i=n[r];this.add(r,i)}}add(n,t){if(this[n])throw new Error(`\u679A\u4E3E\u9879 ${n} \u5DF2\u5B58\u5728`);const r=t.value;return this[n]=r,this._enumItems[r]={...t},this}keys(){return Object.keys(this).filter(n=>n!=="_enumItems")}*[Symbol.iterator](){for(const n of this.keys())yield this.getItem(this[n])}getItem(n){return this._enumItems[n]}getLabel(n){var t;return(t=this.getItem(n))==null?void 0:t.label}getProps(n){var t;return(t=this.getItem(n))==null?void 0:t.props}filter(n){const t=new R;for(const r of this.keys()){const i=this.getItem(this[r]);n(i,r)&&t.add(r,i)}return t}clone(){return this.filter(()=>!0)}set(n,t){const r=this.getItem(this[n]);return r&&Object.assign(r,t),this}remove(n){const t=this[n];return t!==void 0&&(delete this[n],delete this._enumItems[t]),this}forEach(n){for(const t of this.keys())n(this.getItem(this[t]),t)}}const Je=(e,n)=>{if(!e||!n)return!1;if(n.includes(" "))throw new Error("className should not contain space.");return e.classList.contains(n)},Xe=(e,n,t)=>{var r,i,o,u,f,h,F,b;if(!e)return!1;const O=e.getBoundingClientRect();let S=0,x=0,T=window.innerHeight,s=window.innerWidth;if(n){const p=n.getBoundingClientRect();S=p.top,x=p.left,T=p.bottom,s=p.right}let l=0,c=0,a=0,g=0;return t&&(l=(i=(r=t.topGap)!=null?r:t.gap)!=null?i:0,c=(u=(o=t.leftGap)!=null?o:t.gap)!=null?u:0,a=(h=(f=t.bottomGap)!=null?f:t.gap)!=null?h:0,g=(b=(F=t.rightGap)!=null?F:t.gap)!=null?b:0),O.top>=S+l&&O.left>=x+c&&O.bottom<=T-a&&O.right<=s-g};function Ke(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var V={exports:{}},N={exports:{}},Y;function Ze(){return Y||(Y=1,function(e,n){(function(t,r){e.exports=r()})(window,function(){return function(t){var r={};function i(o){if(r[o])return r[o].exports;var u=r[o]={i:o,l:!1,exports:{}};return t[o].call(u.exports,u,u.exports,i),u.l=!0,u.exports}return i.m=t,i.c=r,i.d=function(o,u,f){i.o(o,u)||Object.defineProperty(o,u,{enumerable:!0,get:f})},i.r=function(o){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,u){if(1&u&&(o=i(o)),8&u||4&u&&typeof o=="object"&&o&&o.__esModule)return o;var f=Object.create(null);if(i.r(f),Object.defineProperty(f,"default",{enumerable:!0,value:o}),2&u&&typeof o!="string")for(var h in o)i.d(f,h,function(F){return o[F]}.bind(null,h));return f},i.n=function(o){var u=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(u,"a",u),u},i.o=function(o,u){return Object.prototype.hasOwnProperty.call(o,u)},i.p="",i(i.s=0)}([function(t,r,i){i.r(r);var o=window,u=/^image\//,f=/\.\w+$/,h={},F={file:null,quality:.8,convertSize:2048e3,loose:!0,redressOrientation:!0},b=function(s){return typeof s=="function"},O=function(s){return u.test(s)};function S(s){s=Object.assign({},F,s),this.options=s,this.file=s.file,this.image=null,this.ParsedOrientationInfo=null,this.init()}var x=S.prototype;for(var T in r.default=S,x.init=function(){var s=this,l=this.file,c=this.options;l&&O(l.type)?(O(c.mimeType)||(c.mimeType=l.type),h.file2Image(l,function(a){b(s.beforeCompress)&&(s.image=a,l.width=a.naturalWidth,l.height=a.naturalHeight,s.beforeCompress(l)),l.type==="image/jpeg"&&c.redressOrientation?s.getParsedOrientationInfo(function(g){s.parsedOrientationInfo=g,s.rendCanvas()}):(s.parsedOrientationInfo={rotate:0,scaleX:1,scaleY:1},s.rendCanvas())},s.error)):s.error("\u8BF7\u4E0A\u4F20\u56FE\u7247\u6587\u4EF6!")},x.rendCanvas=function(){var s=this,l=this.options,c=this.image,a=this.getExpectedEdge(),g=a.dWidth,p=a.dHeight,v=a.width,d=a.height,y=h.image2Canvas(c,g,p,s.beforeDraw.bind(s),s.afterDraw.bind(s),v,d);h.canvas2Blob(y,function(w){w&&(w.width=y.width,w.height=y.height),s.success(w)},l.quality,l.mimeType)},x.beforeCompress=function(){b(this.options.beforeCompress)&&this.options.beforeCompress(this.file)},x.getExpectedEdge=function(){var s,l=this.image,c=this.parsedOrientationInfo.rotate,a=this.options,g=l.naturalWidth,p=l.naturalHeight,v=Math.abs(c)%180==90;v&&(s=p,p=g,g=s);var d=g/p,y=Math.max(a.maxWidth,0)||1/0,w=Math.max(a.maxHeight,0)||1/0,m=Math.max(a.minWidth,0)||0,E=Math.max(a.minHeight,0)||0,I=Math.max(a.width,0)||g,D=Math.max(a.height,0)||p;y<1/0&&w<1/0?w*d>y?w=y/d:y=w*d:y<1/0?w=y/d:w<1/0&&(y=w*d),m>0&&E>0?E*d>m?E=m/d:m=E*d:m>0?E=m/d:E>0&&(m=E*d),D*d>I?D=I/d:I=D*d;var _=I=Math.floor(Math.min(Math.max(I,m),y)),A=D=Math.floor(Math.min(Math.max(D,E),w));return v&&(s=A,A=_,_=s),{dWidth:_,dHeight:A,width:I,height:D}},x.getParsedOrientationInfo=function(s){var l=this;this.getOrientation(function(c){b(s)&&s(l.parseOrientation(c))})},x.getOrientation=function(s){var l=this;h.file2ArrayBuffer(this.file,function(c){b(s)&&s(l.resetAndGetOrientation(c))})},x.resetAndGetOrientation=function(s){var l,c=new DataView(s);try{var a,g,p;if(c.getUint8(0)===255&&c.getUint8(1)===216)for(var v=c.byteLength,d=2;d+1<v;){if(c.getUint8(d)===255&&c.getUint8(d+1)===225){g=d;break}d+=1}if(g){var y=g+4,w=g+10;if(h.getStringFromCharCode(c,y,4)==="Exif"){var m=c.getUint16(w);if(((a=m===18761)||m===19789)&&c.getUint16(w+2,a)===42){var E=c.getUint32(w+4,a);E>=8&&(p=w+E)}}}if(p){var I;for(v=c.getUint16(p,a),I=0;I<v;I+=1)if(d=p+12*I+2,c.getUint16(d,a)===274){d+=8,l=c.getUint16(d,a),c.setUint16(d,1,a);break}}}catch(D){console.error(D),l=1}return l},x.parseOrientation=function(s){var l=0,c=1,a=1;switch(s){case 2:c=-1;break;case 3:l=-180;break;case 4:a=-1;break;case 5:l=90,a=-1;break;case 6:l=90;break;case 7:l=90,c=-1;break;case 8:l=-90}return{rotate:l,scaleX:c,scaleY:a}},x.beforeDraw=function(s,l){var c=this.parsedOrientationInfo,a=c.rotate,g=c.scaleX,p=c.scaleY,v=this.file,d=this.options,y="transparent",w=l.width,m=l.height;switch(v.size>d.convertSize&&d.mimeType==="image/png"&&(y="#fff",d.mimeType="image/jpeg"),s.fillStyle=y,s.fillRect(0,0,w,m),b(d.beforeDraw)&&d.beforeDraw.call(this,s,l),s.save(),a){case 90:s.translate(w,0);break;case-90:s.translate(0,m);break;case-180:s.translate(w,m)}s.rotate(a*Math.PI/180),s.scale(g,p)},x.afterDraw=function(s,l){var c=this.options;b(c.afterDraw)&&c.afterDraw.call(this,s,l)},x.error=function(s){var l=this.options;if(!b(l.error))throw new Error(s);l.error.call(this,s)},x.success=function(s){var l,c,a=this.options,g=this.file,p=this.image,v=this.getExpectedEdge(),d=p.naturalHeight,y=p.naturalWidth;if(s&&s.size)if(!a.loose&&s.size>g.size&&!(v.width>y||v.height>d))console.warn("\u5F53\u524D\u8BBE\u7F6E\u7684\u662F\u975E\u5BBD\u677E\u6A21\u5F0F\uFF0C\u538B\u7F29\u7ED3\u679C\u5927\u4E8E\u6E90\u56FE\u7247\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"),s=g;else{var w=new Date;s.lastModified=w.getTime(),s.lastModifiedDate=w,s.name=g.name,s.name&&s.type!==g.type&&(s.name=s.name.replace(f,(l=s.type,(c=O(l)?l.substr(6):"")==="jpeg"&&(c="jpg"),"."+c)))}else console.warn("\u56FE\u7247\u538B\u7F29\u51FA\u4E86\u70B9\u610F\u5916\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"),s=g;b(a.success)&&a.success.call(this,s)},h.file2DataUrl=function(s,l,c){var a=new FileReader;a.onload=function(){l(a.result)},a.onerror=function(){b(c)&&c("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01")},a.readAsDataURL(s)},h.file2ArrayBuffer=function(s,l,c){var a=new FileReader;a.onload=function(g){l(g.target.result)},a.onerror=function(){b(c)&&c("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01")},a.readAsArrayBuffer(s)},h.getStringFromCharCode=function(s,l,c){var a,g="";for(c+=l,a=l;a<c;a+=1)g+=String.fromCharCode(s.getUint8(a));return g},h.file2Image=function(s,l,c){var a=new Image,g=o.URL||o.webkitURL;if(o.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(o.navigator.userAgent)&&(a.crossOrigin="anonymous"),a.alt=s.name,a.onerror=function(){b(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")},g){var p=g.createObjectURL(s);a.onload=function(){l(a),g.revokeObjectURL(p)},a.src=p}else this.file2DataUrl(s,function(v){a.onload=function(){l(a)},a.src=v},c)},h.url2Image=function(s,l,c){var a=new Image;a.src=s,a.onload=function(){l(a)},a.onerror=function(){b(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")}},h.image2Canvas=function(s,l,c,a,g,p,v){var d=document.createElement("canvas"),y=d.getContext("2d");return d.width=p||s.naturalWidth,d.height=v||s.naturalHeight,b(a)&&a(y,d),y.save(),y.drawImage(s,0,0,l,c),y.restore(),b(g)&&g(y,d),d},h.canvas2DataUrl=function(s,l,c){return s.toDataURL(c||"image/jpeg",l)},h.dataUrl2Image=function(s,l,c){var a=new Image;a.onload=function(){l(a)},a.error=function(){b(c)&&c("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01")},a.src=s},h.dataUrl2Blob=function(s,l){for(var c=s.split(",")[1],a=s.match(/^data:(.*?)(;base64)?,/)[1],g=atob(c),p=c.length,v=new Uint8Array(p),d=0;d<p;d++)v[d]=g.charCodeAt(d);return new Blob([v],{type:l||a})},h.blob2DataUrl=function(s,l,c){this.file2DataUrl(s,l,c)},h.blob2Image=function(s,l,c){this.file2Image(s,l,c)},h.canvas2Blob=function(s,l,c,a){var g=this;HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(p,v,d){var y=this.toDataURL(v,d);p(g.dataUrl2Blob(y))}}),s.toBlob(function(p){l(p)},a||"image/jpeg",c||.8)},h.upload=function(s,l,c){var a=new XMLHttpRequest,g=new FormData;g.append("file",l),a.onreadystatechange=function(){if(a.readyState!==4||a.status!==200)throw new Error(a);c&&c(a.responseText)},a.open("POST",s,!0),a.send(g)},h)h.hasOwnProperty(T)&&(S[T]=h[T])}]).default})}(N)),N.exports}(function(e){e.exports=Ze()})(V);var Qe=Ke(V.exports);const et=e=>{if(!e.file)throw new Error("file is required");const n=e.file.size/1024;let t=e.quality;if(t===void 0){if(n<200)return e.file;n>200&&n<=512?t=.9:n>512&&n<=1024?t=.8:n>1024&&n<=2048?t=.85:n>2048&&n<=10240?t=.8:n>10240&&n<=20480&&(t=.75)}return new Promise((r,i)=>{var o;new Qe({...e,quality:t,convertSize:(o=e.convertSize)!=null?o:1024,success:u=>{r(u)},error:u=>{i(u)}})})},J=e=>e&&e.split("?")[0].split("/").pop()||"",tt=e=>{if(e=J(e),!e)return"";const n=e.lastIndexOf(".");return n===-1?"":e.slice(n+1).toLowerCase()},nt=(e,n,t)=>Math.min(Math.max(t,e),n),B=new Map,rt=(e,n=3)=>{if(!e)throw new Error("name is required");let t;return B.has(e)?t=B.get(e):(t={maxNum:n,currentNum:0,queue:[]},B.set(e,t)),{acquire:async()=>new Promise((f,h)=>{t.currentNum>=t.maxNum?t.queue.push({resolve:f,reject:h}):(t.currentNum++,f(!0))}),release:()=>{if(t.queue.length>0){const{resolve:f}=t.queue.shift();f(!0)}else t.currentNum--},destroy:async()=>{B.delete(e)},getMaxNum:()=>t.maxNum}};export{R as Enum,re as arrayDiff,j as arrayEquals,fe as assign,pe as buildTree,Re as buildUrl,nt as clamp,Fe as combineByField,et as compressImage,ze as copyText,rt as createLock,qe as createStreamIterator,Pe as createTimer,We as debounce,$e as decodeHTMLEntities,H as deepAssign,de as deepClone,Be as delayWhen,He as downloadFile,je as encodeHTMLEntities,Ue as fileToBlob,Ce as fileToDataURL,ke as fileToObjectURL,z as filterTree,we as findNode,ye as findNodeWithPath,be as findParentAndIndex,Ee as flatTree,Te as formatBytes,Oe as formatDate,Ie as formatInterval,xe as formatNumber,De as formatPx,Se as formatTime,tt as getFileExt,J as getFilename,ue as getNearestNumbers,me as getProp,U as getProperty,_e as getRandInt,se as groupBy,Ge as handleFormValidateError,Je as hasClass,Q as isBlob,te as isChildClassOf,Xe as isElementInViewport,P as isEmpty,ne as isEqual,Z as isIframe,ee as isImage,K as isObject,M as isPlainObject,k as looseEqual,G as mergeDefaultOptions,le as omit,he as omitEmpty,Ve as openPage,Ye as parseAreaCode,W as parseJson,q as pick,Me as runAtLeastTime,ge as setProperty,L as sleep,oe as toArray,ce as toCamelCase,$ as toKebabCase,ae as toUnderscore,Le as urlToBlob,Ae as urlToDataURL,Ne as urlToPngBlob,ve as walkTree,X as withInstall,ie as without};
|
package/es/components/index.d.ts
CHANGED
|
@@ -4,11 +4,14 @@ type __VLS_Props = {
|
|
|
4
4
|
emptyText?: string;
|
|
5
5
|
autoplay?: boolean;
|
|
6
6
|
loop?: boolean;
|
|
7
|
+
/** 控制条配色:深色底栏 / 浅色底栏 */
|
|
8
|
+
theme?: 'light' | 'dark';
|
|
7
9
|
};
|
|
8
10
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
9
11
|
showEmpty: boolean;
|
|
10
12
|
autoplay: boolean;
|
|
11
13
|
loop: boolean;
|
|
14
|
+
theme: string;
|
|
12
15
|
}>, {
|
|
13
16
|
play: () => Promise<void>;
|
|
14
17
|
pause: () => void;
|
|
@@ -17,9 +20,11 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
17
20
|
showEmpty: boolean;
|
|
18
21
|
autoplay: boolean;
|
|
19
22
|
loop: boolean;
|
|
23
|
+
theme: string;
|
|
20
24
|
}>>>, {
|
|
21
25
|
loop: boolean;
|
|
22
26
|
showEmpty: boolean;
|
|
27
|
+
theme: "light" | "dark";
|
|
23
28
|
autoplay: boolean;
|
|
24
29
|
}>;
|
|
25
30
|
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
url: string;
|
|
3
|
+
ext?: string;
|
|
4
|
+
language?: string;
|
|
5
|
+
theme?: 'light' | 'dark';
|
|
6
|
+
showCopyButton?: boolean;
|
|
7
|
+
maxFileSize?: number;
|
|
8
|
+
showToolbar?: boolean;
|
|
9
|
+
showEmpty?: boolean;
|
|
10
|
+
emptyText?: string;
|
|
11
|
+
};
|
|
12
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
13
|
+
theme: string;
|
|
14
|
+
showCopyButton: boolean;
|
|
15
|
+
maxFileSize: number;
|
|
16
|
+
showToolbar: boolean;
|
|
17
|
+
showEmpty: boolean;
|
|
18
|
+
}>, {
|
|
19
|
+
copyContent: () => Promise<void>;
|
|
20
|
+
scrollToLine: (line: number) => void;
|
|
21
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
22
|
+
theme: string;
|
|
23
|
+
showCopyButton: boolean;
|
|
24
|
+
maxFileSize: number;
|
|
25
|
+
showToolbar: boolean;
|
|
26
|
+
showEmpty: boolean;
|
|
27
|
+
}>>>, {
|
|
28
|
+
maxFileSize: number;
|
|
29
|
+
showToolbar: boolean;
|
|
30
|
+
showEmpty: boolean;
|
|
31
|
+
theme: "light" | "dark";
|
|
32
|
+
showCopyButton: boolean;
|
|
33
|
+
}>;
|
|
34
|
+
export default _default;
|
|
35
|
+
type __VLS_WithDefaults<P, D> = {
|
|
36
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
37
|
+
default: D[K];
|
|
38
|
+
}> : P[K];
|
|
39
|
+
};
|
|
40
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
41
|
+
type __VLS_TypePropsToOption<T> = {
|
|
42
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
43
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
44
|
+
} : {
|
|
45
|
+
type: import('vue').PropType<T[K]>;
|
|
46
|
+
required: true;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
type __VLS_PrettifyLocal<T> = {
|
|
50
|
+
[K in keyof T]: T[K];
|
|
51
|
+
} & {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FILE_TYPES } from 'next-ui3/es/config';
|
|
2
2
|
import type { IFileLoader } from 'next-ui3/es/next-ui3';
|
|
3
3
|
type __VLS_Props = {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
ext?: string | ((url: string) => string);
|
|
5
|
+
type?: FILE_TYPES | ((ext: string) => FILE_TYPES | undefined);
|
|
6
6
|
url: string | IFileLoader;
|
|
7
7
|
options?: Record<FILE_TYPES, any>;
|
|
8
8
|
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
url: string;
|
|
3
|
+
theme?: 'light' | 'dark';
|
|
4
|
+
showCopyButton?: boolean;
|
|
5
|
+
maxFileSize?: number;
|
|
6
|
+
showToolbar?: boolean;
|
|
7
|
+
showEmpty?: boolean;
|
|
8
|
+
emptyText?: string;
|
|
9
|
+
defaultMode?: 'preview' | 'source';
|
|
10
|
+
previewer?: any;
|
|
11
|
+
previewerProps?: Record<string, any>;
|
|
12
|
+
};
|
|
13
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
14
|
+
theme: string;
|
|
15
|
+
showCopyButton: boolean;
|
|
16
|
+
maxFileSize: number;
|
|
17
|
+
showToolbar: boolean;
|
|
18
|
+
showEmpty: boolean;
|
|
19
|
+
defaultMode: string;
|
|
20
|
+
}>, {
|
|
21
|
+
copyContent: () => Promise<void>;
|
|
22
|
+
scrollToLine: (line: number) => void;
|
|
23
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
24
|
+
theme: string;
|
|
25
|
+
showCopyButton: boolean;
|
|
26
|
+
maxFileSize: number;
|
|
27
|
+
showToolbar: boolean;
|
|
28
|
+
showEmpty: boolean;
|
|
29
|
+
defaultMode: string;
|
|
30
|
+
}>>>, {
|
|
31
|
+
maxFileSize: number;
|
|
32
|
+
showToolbar: boolean;
|
|
33
|
+
showEmpty: boolean;
|
|
34
|
+
theme: "light" | "dark";
|
|
35
|
+
showCopyButton: boolean;
|
|
36
|
+
defaultMode: "preview" | "source";
|
|
37
|
+
}>;
|
|
38
|
+
export default _default;
|
|
39
|
+
type __VLS_WithDefaults<P, D> = {
|
|
40
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
41
|
+
default: D[K];
|
|
42
|
+
}> : P[K];
|
|
43
|
+
};
|
|
44
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
45
|
+
type __VLS_TypePropsToOption<T> = {
|
|
46
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
47
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
48
|
+
} : {
|
|
49
|
+
type: import('vue').PropType<T[K]>;
|
|
50
|
+
required: true;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
type __VLS_PrettifyLocal<T> = {
|
|
54
|
+
[K in keyof T]: T[K];
|
|
55
|
+
} & {};
|
|
@@ -8,6 +8,7 @@ type __VLS_Props = {
|
|
|
8
8
|
muted?: boolean;
|
|
9
9
|
preload?: 'none' | 'metadata' | 'auto';
|
|
10
10
|
};
|
|
11
|
+
declare function toggleFullscreen(): void;
|
|
11
12
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
12
13
|
showEmpty: boolean;
|
|
13
14
|
autoplay: boolean;
|
|
@@ -15,10 +16,10 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
15
16
|
muted: boolean;
|
|
16
17
|
preload: string;
|
|
17
18
|
}>, {
|
|
18
|
-
play: () => Promise<void
|
|
19
|
-
pause: () => void
|
|
19
|
+
play: () => Promise<void>;
|
|
20
|
+
pause: () => void;
|
|
20
21
|
seek: (time: number) => void;
|
|
21
|
-
toggleFullscreen:
|
|
22
|
+
toggleFullscreen: typeof toggleFullscreen;
|
|
22
23
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
23
24
|
showEmpty: boolean;
|
|
24
25
|
autoplay: boolean;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** 当前进度 0–100 */
|
|
3
|
+
modelValue: number;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
}>>>, {
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithDefaults<P, D> = {
|
|
15
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
16
|
+
default: D[K];
|
|
17
|
+
}> : P[K];
|
|
18
|
+
};
|
|
19
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
20
|
+
type __VLS_TypePropsToOption<T> = {
|
|
21
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
22
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
23
|
+
} : {
|
|
24
|
+
type: import('vue').PropType<T[K]>;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
type __VLS_PrettifyLocal<T> = {
|
|
29
|
+
[K in keyof T]: T[K];
|
|
30
|
+
} & {};
|
package/es/config/enums.d.ts
CHANGED
package/es/config/preview.d.ts
CHANGED
package/es/hooks/index.d.ts
CHANGED