@vunk/form 1.1.73 → 1.1.75
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.
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
|
|
2
|
-
import { openBlock, createElementBlock, createElementVNode, defineComponent, watchEffect, ref, watch, onBeforeUnmount, resolveComponent, createBlock, mergeProps, withCtx, createVNode, Fragment, renderList,
|
|
2
|
+
import { openBlock, createElementBlock, createElementVNode, defineComponent, watchEffect, ref, watch, computed, onBeforeUnmount, resolveComponent, createBlock, mergeProps, withCtx, createVNode, normalizeClass, Fragment, renderList, normalizeStyle, createCommentVNode, createTextVNode } from 'vue';
|
|
3
3
|
import { rFile } from '@skzz/platform/api/basic';
|
|
4
4
|
import { restFetch as restFetch$1 } from '@skzz/platform/shared/fetch/platform';
|
|
5
|
-
import { ElButtonGroup, ElButton, ElInput } from 'element-plus';
|
|
5
|
+
import { ElButtonGroup, ElButton, ElInput, ElMessage } from 'element-plus';
|
|
6
6
|
import { RestFetch } from '@vunk/core/shared/utils-fetch';
|
|
7
7
|
import { useModelComputed } from '@vunk/core/composables';
|
|
8
|
+
import { ToggleHandler } from '@vunk/core/shared/utils-class';
|
|
8
9
|
|
|
9
10
|
const props = {
|
|
10
11
|
..._VkfFormItemCtx.props,
|
|
@@ -108,7 +109,11 @@ const downChunk = (params, init) => {
|
|
|
108
109
|
xhr.onerror = () => {
|
|
109
110
|
reject(xhr.response);
|
|
110
111
|
};
|
|
111
|
-
|
|
112
|
+
try {
|
|
113
|
+
xhr.send();
|
|
114
|
+
} catch (err) {
|
|
115
|
+
reject(err);
|
|
116
|
+
}
|
|
112
117
|
init?.xhrs?.push(xhr);
|
|
113
118
|
});
|
|
114
119
|
};
|
|
@@ -123,6 +128,25 @@ var export_helper_default = (sfc, props) => {
|
|
|
123
128
|
return target;
|
|
124
129
|
};
|
|
125
130
|
|
|
131
|
+
// unplugin-vue:/home/runner/work/element-plus-icons/element-plus-icons/packages/vue/src/components/circle-close-filled.vue?vue&type=script&lang.ts
|
|
132
|
+
var circle_close_filled_vue_vue_type_script_lang_default = {
|
|
133
|
+
name: "CircleCloseFilled"
|
|
134
|
+
};
|
|
135
|
+
var _hoisted_150 = {
|
|
136
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
137
|
+
viewBox: "0 0 1024 1024"
|
|
138
|
+
},
|
|
139
|
+
_hoisted_250 = /* @__PURE__ */createElementVNode("path", {
|
|
140
|
+
fill: "currentColor",
|
|
141
|
+
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336L512 457.664z"
|
|
142
|
+
}, null, -1
|
|
143
|
+
/* HOISTED */),
|
|
144
|
+
_hoisted_349 = [_hoisted_250];
|
|
145
|
+
function _sfc_render50(_ctx, _cache, $props, $setup, $data, $options) {
|
|
146
|
+
return openBlock(), createElementBlock("svg", _hoisted_150, _hoisted_349);
|
|
147
|
+
}
|
|
148
|
+
var circle_close_filled_default = /* @__PURE__ */export_helper_default(circle_close_filled_vue_vue_type_script_lang_default, [["render", _sfc_render50], ["__file", "circle-close-filled.vue"]]);
|
|
149
|
+
|
|
126
150
|
// unplugin-vue:/home/runner/work/element-plus-icons/element-plus-icons/packages/vue/src/components/download.vue?vue&type=script&lang.ts
|
|
127
151
|
var download_vue_vue_type_script_lang_default = {
|
|
128
152
|
name: "Download"
|
|
@@ -142,6 +166,12 @@ function _sfc_render91(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
142
166
|
}
|
|
143
167
|
var download_default = /* @__PURE__ */export_helper_default(download_vue_vue_type_script_lang_default, [["render", _sfc_render91], ["__file", "download.vue"]]);
|
|
144
168
|
|
|
169
|
+
var __defProp = Object.defineProperty;
|
|
170
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
171
|
+
var __publicField = (obj, key, value) => {
|
|
172
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
173
|
+
return value;
|
|
174
|
+
};
|
|
145
175
|
var script = defineComponent({
|
|
146
176
|
name: "VkfDownloadPlus",
|
|
147
177
|
components: {
|
|
@@ -172,6 +202,12 @@ var script = defineComponent({
|
|
|
172
202
|
fileInfo.value = res;
|
|
173
203
|
});
|
|
174
204
|
}
|
|
205
|
+
const filePrefixIcon = computed(() => {
|
|
206
|
+
if (fileStatus.value === Status.error) {
|
|
207
|
+
return circle_close_filled_default;
|
|
208
|
+
}
|
|
209
|
+
return download_default;
|
|
210
|
+
});
|
|
175
211
|
const chunks = ref([]);
|
|
176
212
|
const downloadingXhrs = ref([]);
|
|
177
213
|
const fileStatus = useModelComputed({
|
|
@@ -225,6 +261,7 @@ var script = defineComponent({
|
|
|
225
261
|
fileStatus.value = Status.done;
|
|
226
262
|
}).catch(() => {
|
|
227
263
|
fileStatus.value = Status.error;
|
|
264
|
+
ElMessage.error("\u4E0B\u8F7D\u5931\u8D25");
|
|
228
265
|
});
|
|
229
266
|
};
|
|
230
267
|
watch(() => fileStatus.value, (newVal) => {
|
|
@@ -299,6 +336,28 @@ var script = defineComponent({
|
|
|
299
336
|
onBeforeUnmount(() => {
|
|
300
337
|
handlePause();
|
|
301
338
|
});
|
|
339
|
+
class OnlineToggle extends ToggleHandler {
|
|
340
|
+
constructor(listener) {
|
|
341
|
+
super();
|
|
342
|
+
__publicField(this, "listener");
|
|
343
|
+
this.listener = listener;
|
|
344
|
+
}
|
|
345
|
+
add() {
|
|
346
|
+
window.addEventListener("online", this.listener);
|
|
347
|
+
this.removeHandler = () => {
|
|
348
|
+
window.removeEventListener("online", this.listener);
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
const onlineToggle = new OnlineToggle(() => {
|
|
353
|
+
if (fileStatus.value === Status.error) {
|
|
354
|
+
fileStatus.value = Status.doDownload;
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
onlineToggle.add();
|
|
358
|
+
onBeforeUnmount(() => {
|
|
359
|
+
onlineToggle.remove();
|
|
360
|
+
});
|
|
302
361
|
return {
|
|
303
362
|
formItemBindProps,
|
|
304
363
|
fileInfo,
|
|
@@ -307,7 +366,7 @@ var script = defineComponent({
|
|
|
307
366
|
Status,
|
|
308
367
|
chunks,
|
|
309
368
|
fileStatus,
|
|
310
|
-
|
|
369
|
+
filePrefixIcon
|
|
311
370
|
};
|
|
312
371
|
}
|
|
313
372
|
});
|
|
@@ -334,10 +393,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
334
393
|
}),
|
|
335
394
|
{
|
|
336
395
|
default: withCtx(() => [createElementVNode("div", _hoisted_1, [createElementVNode("label", _hoisted_2, [createVNode(_component_ElInput, {
|
|
337
|
-
|
|
396
|
+
class: normalizeClass({
|
|
397
|
+
"is-error": _ctx.fileStatus === _ctx.Status.error
|
|
398
|
+
}),
|
|
399
|
+
"prefix-icon": _ctx.filePrefixIcon,
|
|
338
400
|
"model-value": _ctx.fileInfo?.realName,
|
|
339
401
|
readonly: ""
|
|
340
|
-
}, null, 8, ["prefix-icon", "model-value"]), _ctx.fileStatus === _ctx.Status.downloading || _ctx.fileStatus === _ctx.Status.pause ? (openBlock(), createElementBlock("div", _hoisted_3, [(openBlock(true), createElementBlock(
|
|
402
|
+
}, null, 8, ["class", "prefix-icon", "model-value"]), _ctx.fileStatus === _ctx.Status.downloading || _ctx.fileStatus === _ctx.Status.pause ? (openBlock(), createElementBlock("div", _hoisted_3, [(openBlock(true), createElementBlock(
|
|
341
403
|
Fragment,
|
|
342
404
|
null,
|
|
343
405
|
renderList(_ctx.chunks, (chunk) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{RestFetch as l}from"@vunk/core/shared/utils-fetch";import{restFetch as u}from"@skzz/platform/shared/fetch/platform";const T={TokenKey:"VUNK_SKZZ_REST_TOKEN",ApplicationKey:"VUNK_SKZZ_REST_APPLICATION",TenantKey:"VUNK_SKZZ_REST_TENANT"};function
|
|
1
|
+
import{RestFetch as l}from"@vunk/core/shared/utils-fetch";import{restFetch as u}from"@skzz/platform/shared/fetch/platform";const T={TokenKey:"VUNK_SKZZ_REST_TOKEN",ApplicationKey:"VUNK_SKZZ_REST_APPLICATION",TenantKey:"VUNK_SKZZ_REST_TENANT"};function i(){return localStorage.getItem(T.TokenKey)||""}const p=new l({baseURL:u.baseURL,presetRequestInit:t=>{const s=t.headers,r=i();return r&&s.set("Token",r),t}}),R=(t,s)=>new Promise((r,n)=>{const e=new XMLHttpRequest;let a=`${p.baseURL}/file/downloadByRange?fileId=${t.fileId}`;t.fileServiceType&&(a+=`&fileServiceType=${t.fileServiceType}`,e.setRequestHeader("fileServiceType",t.fileServiceType)),s?.onprogress&&(e.onprogress=s?.onprogress),e.open("GET",a,!0),e.responseType="blob",e.setRequestHeader("Token",i()),e.setRequestHeader("tenant","default"),e.setRequestHeader("application","platform"),e.setRequestHeader("Content-Range",`bytes=${t.start}-${t.end}`),e.setRequestHeader("Accept-Ranges","bytes"),e.onreadystatechange=o=>{const c=o.target;if(e.readyState===4)if(e.status===200||e.status===206){if(s?.xhrs){const d=s.xhrs.findIndex(f=>f===e);s.xhrs.splice(d,1)}r({data:c.response})}else e.status===500&&n(c.response)},e.onerror=()=>{n(e.response)};try{e.send()}catch(o){n(o)}s?.xhrs?.push(e)});export{R as downChunk,p as restFetch};
|
|
@@ -105,7 +105,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
105
105
|
data?: Blob;
|
|
106
106
|
}[]>;
|
|
107
107
|
fileStatus: import("vue").WritableComputedRef<Status>;
|
|
108
|
-
|
|
108
|
+
filePrefixIcon: import("vue").ComputedRef<import("vue").DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
109
109
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
110
110
|
'update:fileStatus': any;
|
|
111
111
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -7,6 +7,7 @@ import '@vunk/core/shared/utils-promise';
|
|
|
7
7
|
import { isPlainObject as isPlainObject$1 } from '@vunk/core/shared/utils-object';
|
|
8
8
|
import { restFetch as restFetch$1 } from '@skzz/platform/shared/fetch/platform';
|
|
9
9
|
import { useModelComputed } from '@vunk/core/composables';
|
|
10
|
+
import { ToggleHandler } from '@vunk/core/shared/utils-class';
|
|
10
11
|
|
|
11
12
|
const props = {
|
|
12
13
|
..._VkfFormItemCtx.props,
|
|
@@ -9534,10 +9535,13 @@ const verify = async (data) => {
|
|
|
9534
9535
|
return config;
|
|
9535
9536
|
}
|
|
9536
9537
|
}).then((res) => {
|
|
9538
|
+
if (res.code !== 200) {
|
|
9539
|
+
throw res;
|
|
9540
|
+
}
|
|
9537
9541
|
return res.datas ?? res.data;
|
|
9538
9542
|
}).then((data2) => {
|
|
9539
9543
|
return {
|
|
9540
|
-
uploadedList: data2.chunkList.map((item) => item.identifier + "-" + item.chunkNumber),
|
|
9544
|
+
uploadedList: data2.chunkList.map((item) => item.identifier + "-" + (item.chunkNumber - 1)),
|
|
9541
9545
|
uploaded: data2.alreadyUploaded,
|
|
9542
9546
|
mergedFile: data2.mergedFile
|
|
9543
9547
|
};
|
|
@@ -9564,6 +9568,9 @@ const upload = async (data, fileServiceType, init) => {
|
|
|
9564
9568
|
if (fileServiceType) {
|
|
9565
9569
|
form.append("fileServiceType", fileServiceType);
|
|
9566
9570
|
}
|
|
9571
|
+
xhr.onerror = (e) => {
|
|
9572
|
+
reject(e);
|
|
9573
|
+
};
|
|
9567
9574
|
xhr.send(form);
|
|
9568
9575
|
xhr.onreadystatechange = (e) => {
|
|
9569
9576
|
const target = e.target;
|
|
@@ -9677,6 +9684,12 @@ function _sfc_render274(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
9677
9684
|
}
|
|
9678
9685
|
var upload_filled_default = /* @__PURE__ */export_helper_default(upload_filled_vue_vue_type_script_lang_default, [["render", _sfc_render274], ["__file", "upload-filled.vue"]]);
|
|
9679
9686
|
|
|
9687
|
+
var __defProp = Object.defineProperty;
|
|
9688
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9689
|
+
var __publicField = (obj, key, value) => {
|
|
9690
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
9691
|
+
return value;
|
|
9692
|
+
};
|
|
9680
9693
|
var script = defineComponent({
|
|
9681
9694
|
name: "VkfUploadPlus",
|
|
9682
9695
|
components: {
|
|
@@ -9748,13 +9761,24 @@ var script = defineComponent({
|
|
|
9748
9761
|
const chunkFiles = createFileChunk(containerFile.value, props2.chunkSize);
|
|
9749
9762
|
const hash = await calculateFileHashSample(containerFile.value);
|
|
9750
9763
|
containerHash.value = hash;
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
-
|
|
9754
|
-
|
|
9755
|
-
|
|
9756
|
-
|
|
9757
|
-
|
|
9764
|
+
let uploadedList = [];
|
|
9765
|
+
let uploaded = false;
|
|
9766
|
+
let mergedFile;
|
|
9767
|
+
try {
|
|
9768
|
+
const res = await verify({
|
|
9769
|
+
identifier: hash
|
|
9770
|
+
});
|
|
9771
|
+
uploadedList = res.uploadedList;
|
|
9772
|
+
uploaded = res.uploaded;
|
|
9773
|
+
mergedFile = res.mergedFile;
|
|
9774
|
+
} catch (err) {
|
|
9775
|
+
fileStatus.value = Status.error;
|
|
9776
|
+
ElMessage({
|
|
9777
|
+
type: "error",
|
|
9778
|
+
message: "\u4E0A\u4F20\u5931\u8D25"
|
|
9779
|
+
});
|
|
9780
|
+
return;
|
|
9781
|
+
}
|
|
9758
9782
|
if (uploaded) {
|
|
9759
9783
|
ElMessage({
|
|
9760
9784
|
type: "success",
|
|
@@ -9788,6 +9812,10 @@ var script = defineComponent({
|
|
|
9788
9812
|
fileStatus.value = Status.done;
|
|
9789
9813
|
}).catch(() => {
|
|
9790
9814
|
fileStatus.value = Status.error;
|
|
9815
|
+
ElMessage({
|
|
9816
|
+
type: "error",
|
|
9817
|
+
message: "\u4E0A\u4F20\u5931\u8D25"
|
|
9818
|
+
});
|
|
9791
9819
|
});
|
|
9792
9820
|
};
|
|
9793
9821
|
const handlePause = () => {
|
|
@@ -9874,6 +9902,28 @@ var script = defineComponent({
|
|
|
9874
9902
|
onBeforeUnmount(() => {
|
|
9875
9903
|
handlePause();
|
|
9876
9904
|
});
|
|
9905
|
+
class OnlineToggle extends ToggleHandler {
|
|
9906
|
+
constructor(listener) {
|
|
9907
|
+
super();
|
|
9908
|
+
__publicField(this, "listener");
|
|
9909
|
+
this.listener = listener;
|
|
9910
|
+
}
|
|
9911
|
+
add() {
|
|
9912
|
+
window.addEventListener("online", this.listener);
|
|
9913
|
+
this.removeHandler = () => {
|
|
9914
|
+
window.removeEventListener("online", this.listener);
|
|
9915
|
+
};
|
|
9916
|
+
}
|
|
9917
|
+
}
|
|
9918
|
+
const offlineToggle = new OnlineToggle(() => {
|
|
9919
|
+
if (fileStatus.value === Status.error) {
|
|
9920
|
+
fileStatus.value = Status.doUpload;
|
|
9921
|
+
}
|
|
9922
|
+
});
|
|
9923
|
+
offlineToggle.add();
|
|
9924
|
+
onBeforeUnmount(() => {
|
|
9925
|
+
offlineToggle.remove();
|
|
9926
|
+
});
|
|
9877
9927
|
return {
|
|
9878
9928
|
formItemBindProps,
|
|
9879
9929
|
handleFileChange,
|
|
@@ -25,4 +25,4 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
25
25
|
* Released under MIT license <https://lodash.com/license>
|
|
26
26
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
27
27
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
28
|
-
*/var y$="4.17.21",x$=2,b$=1,w$=3,Kf=4294967295,T$=Array.prototype,m$=Object.prototype,zf=m$.hasOwnProperty,Xf=H?H.iterator:void 0,E$=Math.max,Zf=Math.min,vr=function(n){return function(e,t,r){if(r==null){var i=F(t),u=i&&D(t),a=u&&u.length&&Ke(t,u);(a?a.length:i)||(r=t,t=e,e=this)}return n(e,t,r)}}(df);f.after=B.after,f.ary=B.ary,f.assign=$.assign,f.assignIn=$.assignIn,f.assignInWith=$.assignInWith,f.assignWith=$.assignWith,f.at=$.at,f.before=B.before,f.bind=B.bind,f.bindAll=P.bindAll,f.bindKey=B.bindKey,f.castArray=_.castArray,f.chain=yn.chain,f.chunk=p.chunk,f.compact=p.compact,f.concat=p.concat,f.cond=P.cond,f.conforms=P.conforms,f.constant=P.constant,f.countBy=I.countBy,f.create=$.create,f.curry=B.curry,f.curryRight=B.curryRight,f.debounce=B.debounce,f.defaults=$.defaults,f.defaultsDeep=$.defaultsDeep,f.defer=B.defer,f.delay=B.delay,f.difference=p.difference,f.differenceBy=p.differenceBy,f.differenceWith=p.differenceWith,f.drop=p.drop,f.dropRight=p.dropRight,f.dropRightWhile=p.dropRightWhile,f.dropWhile=p.dropWhile,f.fill=p.fill,f.filter=I.filter,f.flatMap=I.flatMap,f.flatMapDeep=I.flatMapDeep,f.flatMapDepth=I.flatMapDepth,f.flatten=p.flatten,f.flattenDeep=p.flattenDeep,f.flattenDepth=p.flattenDepth,f.flip=B.flip,f.flow=P.flow,f.flowRight=P.flowRight,f.fromPairs=p.fromPairs,f.functions=$.functions,f.functionsIn=$.functionsIn,f.groupBy=I.groupBy,f.initial=p.initial,f.intersection=p.intersection,f.intersectionBy=p.intersectionBy,f.intersectionWith=p.intersectionWith,f.invert=$.invert,f.invertBy=$.invertBy,f.invokeMap=I.invokeMap,f.iteratee=P.iteratee,f.keyBy=I.keyBy,f.keys=D,f.keysIn=$.keysIn,f.map=I.map,f.mapKeys=$.mapKeys,f.mapValues=$.mapValues,f.matches=P.matches,f.matchesProperty=P.matchesProperty,f.memoize=B.memoize,f.merge=$.merge,f.mergeWith=$.mergeWith,f.method=P.method,f.methodOf=P.methodOf,f.mixin=vr,f.negate=$e,f.nthArg=P.nthArg,f.omit=$.omit,f.omitBy=$.omitBy,f.once=B.once,f.orderBy=I.orderBy,f.over=P.over,f.overArgs=B.overArgs,f.overEvery=P.overEvery,f.overSome=P.overSome,f.partial=B.partial,f.partialRight=B.partialRight,f.partition=I.partition,f.pick=$.pick,f.pickBy=$.pickBy,f.property=P.property,f.propertyOf=P.propertyOf,f.pull=p.pull,f.pullAll=p.pullAll,f.pullAllBy=p.pullAllBy,f.pullAllWith=p.pullAllWith,f.pullAt=p.pullAt,f.range=P.range,f.rangeRight=P.rangeRight,f.rearg=B.rearg,f.reject=I.reject,f.remove=p.remove,f.rest=B.rest,f.reverse=p.reverse,f.sampleSize=I.sampleSize,f.set=$.set,f.setWith=$.setWith,f.shuffle=I.shuffle,f.slice=p.slice,f.sortBy=I.sortBy,f.sortedUniq=p.sortedUniq,f.sortedUniqBy=p.sortedUniqBy,f.split=O.split,f.spread=B.spread,f.tail=p.tail,f.take=p.take,f.takeRight=p.takeRight,f.takeRightWhile=p.takeRightWhile,f.takeWhile=p.takeWhile,f.tap=yn.tap,f.throttle=B.throttle,f.thru=ye,f.toArray=_.toArray,f.toPairs=$.toPairs,f.toPairsIn=$.toPairsIn,f.toPath=P.toPath,f.toPlainObject=_.toPlainObject,f.transform=$.transform,f.unary=B.unary,f.union=p.union,f.unionBy=p.unionBy,f.unionWith=p.unionWith,f.uniq=p.uniq,f.uniqBy=p.uniqBy,f.uniqWith=p.uniqWith,f.unset=$.unset,f.unzip=p.unzip,f.unzipWith=p.unzipWith,f.update=$.update,f.updateWith=$.updateWith,f.values=$.values,f.valuesIn=$.valuesIn,f.without=p.without,f.words=O.words,f.wrap=B.wrap,f.xor=p.xor,f.xorBy=p.xorBy,f.xorWith=p.xorWith,f.zip=p.zip,f.zipObject=p.zipObject,f.zipObjectDeep=p.zipObjectDeep,f.zipWith=p.zipWith,f.entries=$.toPairs,f.entriesIn=$.toPairsIn,f.extend=$.assignIn,f.extendWith=$.assignInWith,vr(f,f),f.add=X.add,f.attempt=P.attempt,f.camelCase=O.camelCase,f.capitalize=O.capitalize,f.ceil=X.ceil,f.clamp=_r.clamp,f.clone=_.clone,f.cloneDeep=_.cloneDeep,f.cloneDeepWith=_.cloneDeepWith,f.cloneWith=_.cloneWith,f.conformsTo=_.conformsTo,f.deburr=O.deburr,f.defaultTo=P.defaultTo,f.divide=X.divide,f.endsWith=O.endsWith,f.eq=_.eq,f.escape=O.escape,f.escapeRegExp=O.escapeRegExp,f.every=I.every,f.find=I.find,f.findIndex=p.findIndex,f.findKey=$.findKey,f.findLast=I.findLast,f.findLastIndex=p.findLastIndex,f.findLastKey=$.findLastKey,f.floor=X.floor,f.forEach=I.forEach,f.forEachRight=I.forEachRight,f.forIn=$.forIn,f.forInRight=$.forInRight,f.forOwn=$.forOwn,f.forOwnRight=$.forOwnRight,f.get=$.get,f.gt=_.gt,f.gte=_.gte,f.has=$.has,f.hasIn=$.hasIn,f.head=p.head,f.identity=K,f.includes=I.includes,f.indexOf=p.indexOf,f.inRange=_r.inRange,f.invoke=$.invoke,f.isArguments=_.isArguments,f.isArray=y,f.isArrayBuffer=_.isArrayBuffer,f.isArrayLike=_.isArrayLike,f.isArrayLikeObject=_.isArrayLikeObject,f.isBoolean=_.isBoolean,f.isBuffer=_.isBuffer,f.isDate=_.isDate,f.isElement=_.isElement,f.isEmpty=_.isEmpty,f.isEqual=_.isEqual,f.isEqualWith=_.isEqualWith,f.isError=_.isError,f.isFinite=_.isFinite,f.isFunction=_.isFunction,f.isInteger=_.isInteger,f.isLength=_.isLength,f.isMap=_.isMap,f.isMatch=_.isMatch,f.isMatchWith=_.isMatchWith,f.isNaN=_.isNaN,f.isNative=_.isNative,f.isNil=_.isNil,f.isNull=_.isNull,f.isNumber=_.isNumber,f.isObject=F,f.isObjectLike=_.isObjectLike,f.isPlainObject=_.isPlainObject,f.isRegExp=_.isRegExp,f.isSafeInteger=_.isSafeInteger,f.isSet=_.isSet,f.isString=_.isString,f.isSymbol=_.isSymbol,f.isTypedArray=_.isTypedArray,f.isUndefined=_.isUndefined,f.isWeakMap=_.isWeakMap,f.isWeakSet=_.isWeakSet,f.join=p.join,f.kebabCase=O.kebabCase,f.last=un,f.lastIndexOf=p.lastIndexOf,f.lowerCase=O.lowerCase,f.lowerFirst=O.lowerFirst,f.lt=_.lt,f.lte=_.lte,f.max=X.max,f.maxBy=X.maxBy,f.mean=X.mean,f.meanBy=X.meanBy,f.min=X.min,f.minBy=X.minBy,f.stubArray=P.stubArray,f.stubFalse=P.stubFalse,f.stubObject=P.stubObject,f.stubString=P.stubString,f.stubTrue=P.stubTrue,f.multiply=X.multiply,f.nth=p.nth,f.noop=P.noop,f.now=c$.now,f.pad=O.pad,f.padEnd=O.padEnd,f.padStart=O.padStart,f.parseInt=O.parseInt,f.random=_r.random,f.reduce=I.reduce,f.reduceRight=I.reduceRight,f.repeat=O.repeat,f.replace=O.replace,f.result=$.result,f.round=X.round,f.sample=I.sample,f.size=I.size,f.snakeCase=O.snakeCase,f.some=I.some,f.sortedIndex=p.sortedIndex,f.sortedIndexBy=p.sortedIndexBy,f.sortedIndexOf=p.sortedIndexOf,f.sortedLastIndex=p.sortedLastIndex,f.sortedLastIndexBy=p.sortedLastIndexBy,f.sortedLastIndexOf=p.sortedLastIndexOf,f.startCase=O.startCase,f.startsWith=O.startsWith,f.subtract=X.subtract,f.sum=X.sum,f.sumBy=X.sumBy,f.template=O.template,f.times=P.times,f.toFinite=_.toFinite,f.toInteger=x,f.toLength=_.toLength,f.toLower=O.toLower,f.toNumber=_.toNumber,f.toSafeInteger=_.toSafeInteger,f.toString=_.toString,f.toUpper=O.toUpper,f.trim=O.trim,f.trimEnd=O.trimEnd,f.trimStart=O.trimStart,f.truncate=O.truncate,f.unescape=O.unescape,f.uniqueId=P.uniqueId,f.upperCase=O.upperCase,f.upperFirst=O.upperFirst,f.each=I.forEach,f.eachRight=I.forEachRight,f.first=p.head,vr(f,function(){var n={};return $n(f,function(e,t){zf.call(f.prototype,t)||(n[t]=e)}),n}(),{chain:!1}),f.VERSION=y$,(f.templateSettings=O.templateSettings).imports._=f,on(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){f[n].placeholder=f}),on(["drop","take"],function(n,e){m.prototype[n]=function(t){t=t===void 0?1:E$(x(t),0);var r=this.__filtered__&&!e?new m(this):this.clone();return r.__filtered__?r.__takeCount__=Zf(t,r.__takeCount__):r.__views__.push({size:Zf(t,Kf),type:n+(r.__dir__<0?"Right":"")}),r},m.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),on(["filter","map","takeWhile"],function(n,e){var t=e+1,r=t==b$||t==w$;m.prototype[n]=function(i){var u=this.clone();return u.__iteratees__.push({iteratee:R(i),type:t}),u.__filtered__=u.__filtered__||r,u}}),on(["head","last"],function(n,e){var t="take"+(e?"Right":"");m.prototype[n]=function(){return this[t](1).value()[0]}}),on(["initial","tail"],function(n,e){var t="drop"+(e?"":"Right");m.prototype[n]=function(){return this.__filtered__?new m(this):this[t](1)}}),m.prototype.compact=function(){return this.filter(K)},m.prototype.find=function(n){return this.filter(n).head()},m.prototype.findLast=function(n){return this.reverse().find(n)},m.prototype.invokeMap=w(function(n,e){return typeof n=="function"?new m(this):this.map(function(t){return Ae(t,n,e)})}),m.prototype.reject=function(n){return this.filter($e(R(n)))},m.prototype.slice=function(n,e){n=x(n);var t=this;return t.__filtered__&&(n>0||e<0)?new m(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==void 0&&(e=x(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},m.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},m.prototype.toArray=function(){return this.take(Kf)},$n(m.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=f[r?"take"+(e=="last"?"Right":""):e],u=r||/^find/.test(e);i&&(f.prototype[e]=function(){var a=this.__wrapped__,o=r?[1]:arguments,s=a instanceof m,l=o[0],c=s||y(a),d=function(T){var E=i.apply(f,Mn([T],o));return r&&h?E[0]:E};c&&t&&typeof l=="function"&&l.length!=1&&(s=c=!1);var h=this.__chain__,g=!!this.__actions__.length,v=u&&!h,b=s&&!g;if(!u&&c){a=b?a:new m(this);var A=n.apply(a,o);return A.__actions__.push({func:ye,args:[d],thisArg:void 0}),new an(A,h)}return v&&b?n.apply(this,o):(A=this.thru(d),v?r?A.value()[0]:A.value():A)})}),on(["pop","push","shift","sort","splice","unshift"],function(n){var e=T$[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);f.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var u=this.value();return e.apply(y(u)?u:[],i)}return this[t](function(a){return e.apply(y(a)?a:[],i)})}}),$n(m.prototype,function(n,e){var t=f[e];if(t){var r=t.name+"";zf.call(Xn,r)||(Xn[r]=[]),Xn[r].push({name:e,func:t})}}),Xn[Pe(void 0,x$).name]=[{name:"wrapper",func:void 0}],m.prototype.clone=d$,m.prototype.reverse=h$,m.prototype.value=R$,f.prototype.at=yn.at,f.prototype.chain=yn.wrapperChain,f.prototype.commit=yn.commit,f.prototype.next=yn.next,f.prototype.plant=yn.plant,f.prototype.reverse=yn.reverse,f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=yn.value,f.prototype.first=f.prototype.head,Xf&&(f.prototype[Xf]=yn.toIterator),Bf(n=>{let e="\u7CFB\u7EDF\u9519\u8BEF";if(!(n instanceof Error&&(e={"Failed to fetch":"\u8BF7\u6C42\u5931\u8D25","The user aborted a request.":"\u8BF7\u6C42\u88AB\u7EC8\u6B62"}[n.message]||n.message,n.name==="AbortError"&&n.message.includes("user")))){if(typeof n=="string"&&(e=n),Vf(n)){const t=n?.msg;t&&(e=t)}Qf({type:"error",message:e})}},500,{trailing:!1});const Jf=n=>{const e=n.headers;return e.set("application","platform"),e.set("tenant","default"),n},et=new kf({baseURL:na.baseURL,presetRequestInit:n=>{const e=n.headers,t=$r();return t&&e.set("Token",t),n}}),O$=async n=>et.request({method:"POST",url:"/file/chunk/verify",data:n,setRequestInit(e){return Jf(e),e}}).then(e=>e.datas??e.data).then(e=>({uploadedList:e.chunkList.map(t=>t.identifier+"-"+t.chunkNumber),uploaded:e.alreadyUploaded,mergedFile:e.mergedFile})),L$=async(n,e,t)=>new Promise((r,i)=>{const u=new XMLHttpRequest;u.upload.onprogress=t?.onprogress||null,u.open("post",et.baseURL+"/file/chunk/upload"),u.setRequestHeader("Tenant","default"),u.setRequestHeader("Application","platform"),u.setRequestHeader("Token",$r());const a=new FormData;a.append("file",n.chunk),a.append("identifier",n.fileHash),a.append("filename",n.fileName),a.append("chunkNumber",n.index+1+""),a.append("chunkIdentifier",n.hash+""),a.append("totalChunk",n.chunksLength+""),a.append("chunkSize",n.sliceSize+""),a.append("currentChunkSize",n.chunk.size+""),a.append("totalSize",n.fileSize+""),e&&a.append("fileServiceType",e),u.send(a),u.onreadystatechange=o=>{const s=o.target;if(u.readyState===4)if(u.status===200){if(t?.xhrs){const l=t.xhrs.findIndex(c=>c===u);t.xhrs.splice(l,1)}r({data:s.response})}else u.status===500&&i(s.response)},u.timeout=5*1e3,u.ontimeout=o=>{i(o)},t?.xhrs?.push(u)}),P$=async n=>et.request({method:"POST",url:"/file/chunk/merge",data:n,setRequestInit:Jf}).then(e=>{if(e.code!==200)throw new Error(e.message);return e.datas??e.data});export{P$ as merge,et as restFetch,L$ as upload,O$ as verify};
|
|
28
|
+
*/var y$="4.17.21",x$=2,b$=1,w$=3,Kf=4294967295,T$=Array.prototype,m$=Object.prototype,zf=m$.hasOwnProperty,Xf=H?H.iterator:void 0,E$=Math.max,Zf=Math.min,vr=function(n){return function(e,t,r){if(r==null){var i=F(t),u=i&&D(t),a=u&&u.length&&Ke(t,u);(a?a.length:i)||(r=t,t=e,e=this)}return n(e,t,r)}}(df);f.after=B.after,f.ary=B.ary,f.assign=$.assign,f.assignIn=$.assignIn,f.assignInWith=$.assignInWith,f.assignWith=$.assignWith,f.at=$.at,f.before=B.before,f.bind=B.bind,f.bindAll=P.bindAll,f.bindKey=B.bindKey,f.castArray=_.castArray,f.chain=yn.chain,f.chunk=p.chunk,f.compact=p.compact,f.concat=p.concat,f.cond=P.cond,f.conforms=P.conforms,f.constant=P.constant,f.countBy=I.countBy,f.create=$.create,f.curry=B.curry,f.curryRight=B.curryRight,f.debounce=B.debounce,f.defaults=$.defaults,f.defaultsDeep=$.defaultsDeep,f.defer=B.defer,f.delay=B.delay,f.difference=p.difference,f.differenceBy=p.differenceBy,f.differenceWith=p.differenceWith,f.drop=p.drop,f.dropRight=p.dropRight,f.dropRightWhile=p.dropRightWhile,f.dropWhile=p.dropWhile,f.fill=p.fill,f.filter=I.filter,f.flatMap=I.flatMap,f.flatMapDeep=I.flatMapDeep,f.flatMapDepth=I.flatMapDepth,f.flatten=p.flatten,f.flattenDeep=p.flattenDeep,f.flattenDepth=p.flattenDepth,f.flip=B.flip,f.flow=P.flow,f.flowRight=P.flowRight,f.fromPairs=p.fromPairs,f.functions=$.functions,f.functionsIn=$.functionsIn,f.groupBy=I.groupBy,f.initial=p.initial,f.intersection=p.intersection,f.intersectionBy=p.intersectionBy,f.intersectionWith=p.intersectionWith,f.invert=$.invert,f.invertBy=$.invertBy,f.invokeMap=I.invokeMap,f.iteratee=P.iteratee,f.keyBy=I.keyBy,f.keys=D,f.keysIn=$.keysIn,f.map=I.map,f.mapKeys=$.mapKeys,f.mapValues=$.mapValues,f.matches=P.matches,f.matchesProperty=P.matchesProperty,f.memoize=B.memoize,f.merge=$.merge,f.mergeWith=$.mergeWith,f.method=P.method,f.methodOf=P.methodOf,f.mixin=vr,f.negate=$e,f.nthArg=P.nthArg,f.omit=$.omit,f.omitBy=$.omitBy,f.once=B.once,f.orderBy=I.orderBy,f.over=P.over,f.overArgs=B.overArgs,f.overEvery=P.overEvery,f.overSome=P.overSome,f.partial=B.partial,f.partialRight=B.partialRight,f.partition=I.partition,f.pick=$.pick,f.pickBy=$.pickBy,f.property=P.property,f.propertyOf=P.propertyOf,f.pull=p.pull,f.pullAll=p.pullAll,f.pullAllBy=p.pullAllBy,f.pullAllWith=p.pullAllWith,f.pullAt=p.pullAt,f.range=P.range,f.rangeRight=P.rangeRight,f.rearg=B.rearg,f.reject=I.reject,f.remove=p.remove,f.rest=B.rest,f.reverse=p.reverse,f.sampleSize=I.sampleSize,f.set=$.set,f.setWith=$.setWith,f.shuffle=I.shuffle,f.slice=p.slice,f.sortBy=I.sortBy,f.sortedUniq=p.sortedUniq,f.sortedUniqBy=p.sortedUniqBy,f.split=O.split,f.spread=B.spread,f.tail=p.tail,f.take=p.take,f.takeRight=p.takeRight,f.takeRightWhile=p.takeRightWhile,f.takeWhile=p.takeWhile,f.tap=yn.tap,f.throttle=B.throttle,f.thru=ye,f.toArray=_.toArray,f.toPairs=$.toPairs,f.toPairsIn=$.toPairsIn,f.toPath=P.toPath,f.toPlainObject=_.toPlainObject,f.transform=$.transform,f.unary=B.unary,f.union=p.union,f.unionBy=p.unionBy,f.unionWith=p.unionWith,f.uniq=p.uniq,f.uniqBy=p.uniqBy,f.uniqWith=p.uniqWith,f.unset=$.unset,f.unzip=p.unzip,f.unzipWith=p.unzipWith,f.update=$.update,f.updateWith=$.updateWith,f.values=$.values,f.valuesIn=$.valuesIn,f.without=p.without,f.words=O.words,f.wrap=B.wrap,f.xor=p.xor,f.xorBy=p.xorBy,f.xorWith=p.xorWith,f.zip=p.zip,f.zipObject=p.zipObject,f.zipObjectDeep=p.zipObjectDeep,f.zipWith=p.zipWith,f.entries=$.toPairs,f.entriesIn=$.toPairsIn,f.extend=$.assignIn,f.extendWith=$.assignInWith,vr(f,f),f.add=X.add,f.attempt=P.attempt,f.camelCase=O.camelCase,f.capitalize=O.capitalize,f.ceil=X.ceil,f.clamp=_r.clamp,f.clone=_.clone,f.cloneDeep=_.cloneDeep,f.cloneDeepWith=_.cloneDeepWith,f.cloneWith=_.cloneWith,f.conformsTo=_.conformsTo,f.deburr=O.deburr,f.defaultTo=P.defaultTo,f.divide=X.divide,f.endsWith=O.endsWith,f.eq=_.eq,f.escape=O.escape,f.escapeRegExp=O.escapeRegExp,f.every=I.every,f.find=I.find,f.findIndex=p.findIndex,f.findKey=$.findKey,f.findLast=I.findLast,f.findLastIndex=p.findLastIndex,f.findLastKey=$.findLastKey,f.floor=X.floor,f.forEach=I.forEach,f.forEachRight=I.forEachRight,f.forIn=$.forIn,f.forInRight=$.forInRight,f.forOwn=$.forOwn,f.forOwnRight=$.forOwnRight,f.get=$.get,f.gt=_.gt,f.gte=_.gte,f.has=$.has,f.hasIn=$.hasIn,f.head=p.head,f.identity=K,f.includes=I.includes,f.indexOf=p.indexOf,f.inRange=_r.inRange,f.invoke=$.invoke,f.isArguments=_.isArguments,f.isArray=y,f.isArrayBuffer=_.isArrayBuffer,f.isArrayLike=_.isArrayLike,f.isArrayLikeObject=_.isArrayLikeObject,f.isBoolean=_.isBoolean,f.isBuffer=_.isBuffer,f.isDate=_.isDate,f.isElement=_.isElement,f.isEmpty=_.isEmpty,f.isEqual=_.isEqual,f.isEqualWith=_.isEqualWith,f.isError=_.isError,f.isFinite=_.isFinite,f.isFunction=_.isFunction,f.isInteger=_.isInteger,f.isLength=_.isLength,f.isMap=_.isMap,f.isMatch=_.isMatch,f.isMatchWith=_.isMatchWith,f.isNaN=_.isNaN,f.isNative=_.isNative,f.isNil=_.isNil,f.isNull=_.isNull,f.isNumber=_.isNumber,f.isObject=F,f.isObjectLike=_.isObjectLike,f.isPlainObject=_.isPlainObject,f.isRegExp=_.isRegExp,f.isSafeInteger=_.isSafeInteger,f.isSet=_.isSet,f.isString=_.isString,f.isSymbol=_.isSymbol,f.isTypedArray=_.isTypedArray,f.isUndefined=_.isUndefined,f.isWeakMap=_.isWeakMap,f.isWeakSet=_.isWeakSet,f.join=p.join,f.kebabCase=O.kebabCase,f.last=un,f.lastIndexOf=p.lastIndexOf,f.lowerCase=O.lowerCase,f.lowerFirst=O.lowerFirst,f.lt=_.lt,f.lte=_.lte,f.max=X.max,f.maxBy=X.maxBy,f.mean=X.mean,f.meanBy=X.meanBy,f.min=X.min,f.minBy=X.minBy,f.stubArray=P.stubArray,f.stubFalse=P.stubFalse,f.stubObject=P.stubObject,f.stubString=P.stubString,f.stubTrue=P.stubTrue,f.multiply=X.multiply,f.nth=p.nth,f.noop=P.noop,f.now=c$.now,f.pad=O.pad,f.padEnd=O.padEnd,f.padStart=O.padStart,f.parseInt=O.parseInt,f.random=_r.random,f.reduce=I.reduce,f.reduceRight=I.reduceRight,f.repeat=O.repeat,f.replace=O.replace,f.result=$.result,f.round=X.round,f.sample=I.sample,f.size=I.size,f.snakeCase=O.snakeCase,f.some=I.some,f.sortedIndex=p.sortedIndex,f.sortedIndexBy=p.sortedIndexBy,f.sortedIndexOf=p.sortedIndexOf,f.sortedLastIndex=p.sortedLastIndex,f.sortedLastIndexBy=p.sortedLastIndexBy,f.sortedLastIndexOf=p.sortedLastIndexOf,f.startCase=O.startCase,f.startsWith=O.startsWith,f.subtract=X.subtract,f.sum=X.sum,f.sumBy=X.sumBy,f.template=O.template,f.times=P.times,f.toFinite=_.toFinite,f.toInteger=x,f.toLength=_.toLength,f.toLower=O.toLower,f.toNumber=_.toNumber,f.toSafeInteger=_.toSafeInteger,f.toString=_.toString,f.toUpper=O.toUpper,f.trim=O.trim,f.trimEnd=O.trimEnd,f.trimStart=O.trimStart,f.truncate=O.truncate,f.unescape=O.unescape,f.uniqueId=P.uniqueId,f.upperCase=O.upperCase,f.upperFirst=O.upperFirst,f.each=I.forEach,f.eachRight=I.forEachRight,f.first=p.head,vr(f,function(){var n={};return $n(f,function(e,t){zf.call(f.prototype,t)||(n[t]=e)}),n}(),{chain:!1}),f.VERSION=y$,(f.templateSettings=O.templateSettings).imports._=f,on(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){f[n].placeholder=f}),on(["drop","take"],function(n,e){m.prototype[n]=function(t){t=t===void 0?1:E$(x(t),0);var r=this.__filtered__&&!e?new m(this):this.clone();return r.__filtered__?r.__takeCount__=Zf(t,r.__takeCount__):r.__views__.push({size:Zf(t,Kf),type:n+(r.__dir__<0?"Right":"")}),r},m.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),on(["filter","map","takeWhile"],function(n,e){var t=e+1,r=t==b$||t==w$;m.prototype[n]=function(i){var u=this.clone();return u.__iteratees__.push({iteratee:R(i),type:t}),u.__filtered__=u.__filtered__||r,u}}),on(["head","last"],function(n,e){var t="take"+(e?"Right":"");m.prototype[n]=function(){return this[t](1).value()[0]}}),on(["initial","tail"],function(n,e){var t="drop"+(e?"":"Right");m.prototype[n]=function(){return this.__filtered__?new m(this):this[t](1)}}),m.prototype.compact=function(){return this.filter(K)},m.prototype.find=function(n){return this.filter(n).head()},m.prototype.findLast=function(n){return this.reverse().find(n)},m.prototype.invokeMap=w(function(n,e){return typeof n=="function"?new m(this):this.map(function(t){return Ae(t,n,e)})}),m.prototype.reject=function(n){return this.filter($e(R(n)))},m.prototype.slice=function(n,e){n=x(n);var t=this;return t.__filtered__&&(n>0||e<0)?new m(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==void 0&&(e=x(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},m.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},m.prototype.toArray=function(){return this.take(Kf)},$n(m.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=f[r?"take"+(e=="last"?"Right":""):e],u=r||/^find/.test(e);i&&(f.prototype[e]=function(){var a=this.__wrapped__,o=r?[1]:arguments,s=a instanceof m,l=o[0],c=s||y(a),d=function(T){var E=i.apply(f,Mn([T],o));return r&&h?E[0]:E};c&&t&&typeof l=="function"&&l.length!=1&&(s=c=!1);var h=this.__chain__,g=!!this.__actions__.length,v=u&&!h,b=s&&!g;if(!u&&c){a=b?a:new m(this);var A=n.apply(a,o);return A.__actions__.push({func:ye,args:[d],thisArg:void 0}),new an(A,h)}return v&&b?n.apply(this,o):(A=this.thru(d),v?r?A.value()[0]:A.value():A)})}),on(["pop","push","shift","sort","splice","unshift"],function(n){var e=T$[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);f.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var u=this.value();return e.apply(y(u)?u:[],i)}return this[t](function(a){return e.apply(y(a)?a:[],i)})}}),$n(m.prototype,function(n,e){var t=f[e];if(t){var r=t.name+"";zf.call(Xn,r)||(Xn[r]=[]),Xn[r].push({name:e,func:t})}}),Xn[Pe(void 0,x$).name]=[{name:"wrapper",func:void 0}],m.prototype.clone=d$,m.prototype.reverse=h$,m.prototype.value=R$,f.prototype.at=yn.at,f.prototype.chain=yn.wrapperChain,f.prototype.commit=yn.commit,f.prototype.next=yn.next,f.prototype.plant=yn.plant,f.prototype.reverse=yn.reverse,f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=yn.value,f.prototype.first=f.prototype.head,Xf&&(f.prototype[Xf]=yn.toIterator),Bf(n=>{let e="\u7CFB\u7EDF\u9519\u8BEF";if(!(n instanceof Error&&(e={"Failed to fetch":"\u8BF7\u6C42\u5931\u8D25","The user aborted a request.":"\u8BF7\u6C42\u88AB\u7EC8\u6B62"}[n.message]||n.message,n.name==="AbortError"&&n.message.includes("user")))){if(typeof n=="string"&&(e=n),Vf(n)){const t=n?.msg;t&&(e=t)}Qf({type:"error",message:e})}},500,{trailing:!1});const Jf=n=>{const e=n.headers;return e.set("application","platform"),e.set("tenant","default"),n},et=new kf({baseURL:na.baseURL,presetRequestInit:n=>{const e=n.headers,t=$r();return t&&e.set("Token",t),n}}),O$=async n=>et.request({method:"POST",url:"/file/chunk/verify",data:n,setRequestInit(e){return Jf(e),e}}).then(e=>{if(e.code!==200)throw e;return e.datas??e.data}).then(e=>({uploadedList:e.chunkList.map(t=>t.identifier+"-"+(t.chunkNumber-1)),uploaded:e.alreadyUploaded,mergedFile:e.mergedFile})),L$=async(n,e,t)=>new Promise((r,i)=>{const u=new XMLHttpRequest;u.upload.onprogress=t?.onprogress||null,u.open("post",et.baseURL+"/file/chunk/upload"),u.setRequestHeader("Tenant","default"),u.setRequestHeader("Application","platform"),u.setRequestHeader("Token",$r());const a=new FormData;a.append("file",n.chunk),a.append("identifier",n.fileHash),a.append("filename",n.fileName),a.append("chunkNumber",n.index+1+""),a.append("chunkIdentifier",n.hash+""),a.append("totalChunk",n.chunksLength+""),a.append("chunkSize",n.sliceSize+""),a.append("currentChunkSize",n.chunk.size+""),a.append("totalSize",n.fileSize+""),e&&a.append("fileServiceType",e),u.onerror=o=>{i(o)},u.send(a),u.onreadystatechange=o=>{const s=o.target;if(u.readyState===4)if(u.status===200){if(t?.xhrs){const l=t.xhrs.findIndex(c=>c===u);t.xhrs.splice(l,1)}r({data:s.response})}else u.status===500&&i(s.response)},u.timeout=5*1e3,u.ontimeout=o=>{i(o)},t?.xhrs?.push(u)}),P$=async n=>et.request({method:"POST",url:"/file/chunk/merge",data:n,setRequestInit:Jf}).then(e=>{if(e.code!==200)throw new Error(e.message);return e.datas??e.data});export{P$ as merge,et as restFetch,L$ as upload,O$ as verify};
|