@vunk/form 1.1.72 → 1.1.74

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 { restFetch as restFetch$1 } from '@skzz/platform/shared/fetch/platform';
3
- import { defineComponent, ref, watch, onBeforeUnmount, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createElementVNode, createVNode, createElementBlock, Fragment, renderList, normalizeClass, normalizeStyle, createCommentVNode, createTextVNode } from 'vue';
2
+ import { openBlock, createElementBlock, createElementVNode, defineComponent, watchEffect, ref, watch, computed, onBeforeUnmount, resolveComponent, createBlock, mergeProps, withCtx, createVNode, normalizeClass, Fragment, renderList, normalizeStyle, createCommentVNode, createTextVNode } from 'vue';
4
3
  import { rFile } from '@skzz/platform/api/basic';
5
- import { ElButtonGroup, ElButton, ElInput } from 'element-plus';
4
+ import { restFetch as restFetch$1 } from '@skzz/platform/shared/fetch/platform';
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,
@@ -14,7 +15,7 @@ const props = {
14
15
  },
15
16
  url: {
16
17
  type: String,
17
- default: restFetch$1.baseURL
18
+ default: void 0
18
19
  },
19
20
  /**
20
21
  * @description 分片大小
@@ -108,11 +109,69 @@ const downChunk = (params, init) => {
108
109
  xhr.onerror = () => {
109
110
  reject(xhr.response);
110
111
  };
111
- xhr.send();
112
+ try {
113
+ xhr.send();
114
+ } catch (err) {
115
+ reject(err);
116
+ }
112
117
  init?.xhrs?.push(xhr);
113
118
  });
114
119
  };
115
120
 
121
+ /*! Element Plus Icons Vue v2.1.0 */
122
+
123
+
124
+ // unplugin-vue:/plugin-vue/export-helper
125
+ var export_helper_default = (sfc, props) => {
126
+ let target = sfc.__vccOpts || sfc;
127
+ for (let [key, val] of props) target[key] = val;
128
+ return target;
129
+ };
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
+
150
+ // unplugin-vue:/home/runner/work/element-plus-icons/element-plus-icons/packages/vue/src/components/download.vue?vue&type=script&lang.ts
151
+ var download_vue_vue_type_script_lang_default = {
152
+ name: "Download"
153
+ };
154
+ var _hoisted_191 = {
155
+ xmlns: "http://www.w3.org/2000/svg",
156
+ viewBox: "0 0 1024 1024"
157
+ },
158
+ _hoisted_291 = /* @__PURE__ */createElementVNode("path", {
159
+ fill: "currentColor",
160
+ d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64zm384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64v450.304z"
161
+ }, null, -1
162
+ /* HOISTED */),
163
+ _hoisted_390 = [_hoisted_291];
164
+ function _sfc_render91(_ctx, _cache, $props, $setup, $data, $options) {
165
+ return openBlock(), createElementBlock("svg", _hoisted_191, _hoisted_390);
166
+ }
167
+ var download_default = /* @__PURE__ */export_helper_default(download_vue_vue_type_script_lang_default, [["render", _sfc_render91], ["__file", "download.vue"]]);
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
+ };
116
175
  var script = defineComponent({
117
176
  name: "VkfDownloadPlus",
118
177
  components: {
@@ -127,6 +186,9 @@ var script = defineComponent({
127
186
  emit
128
187
  }) {
129
188
  const formItemBindProps = _VkfFormItemCtx.createBindProps(props2);
189
+ watchEffect(() => {
190
+ restFetch.baseURL = props2.url || restFetch$1.baseURL;
191
+ });
130
192
  const fileInfo = ref();
131
193
  rFileInfo();
132
194
  watch(() => props2.fileId, rFileInfo);
@@ -140,6 +202,12 @@ var script = defineComponent({
140
202
  fileInfo.value = res;
141
203
  });
142
204
  }
205
+ const filePrefixIcon = computed(() => {
206
+ if (fileStatus.value === Status.error) {
207
+ return circle_close_filled_default;
208
+ }
209
+ return download_default;
210
+ });
143
211
  const chunks = ref([]);
144
212
  const downloadingXhrs = ref([]);
145
213
  const fileStatus = useModelComputed({
@@ -193,6 +261,7 @@ var script = defineComponent({
193
261
  fileStatus.value = Status.done;
194
262
  }).catch(() => {
195
263
  fileStatus.value = Status.error;
264
+ ElMessage.error("\u4E0B\u8F7D\u5931\u8D25");
196
265
  });
197
266
  };
198
267
  watch(() => fileStatus.value, (newVal) => {
@@ -267,6 +336,28 @@ var script = defineComponent({
267
336
  onBeforeUnmount(() => {
268
337
  handlePause();
269
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
+ });
270
361
  return {
271
362
  formItemBindProps,
272
363
  fileInfo,
@@ -274,7 +365,8 @@ var script = defineComponent({
274
365
  handlePause,
275
366
  Status,
276
367
  chunks,
277
- fileStatus
368
+ fileStatus,
369
+ filePrefixIcon
278
370
  };
279
371
  }
280
372
  });
@@ -301,9 +393,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
301
393
  }),
302
394
  {
303
395
  default: withCtx(() => [createElementVNode("div", _hoisted_1, [createElementVNode("label", _hoisted_2, [createVNode(_component_ElInput, {
396
+ class: normalizeClass({
397
+ "is-error": _ctx.fileStatus === _ctx.Status.error
398
+ }),
399
+ "prefix-icon": _ctx.filePrefixIcon,
304
400
  "model-value": _ctx.fileInfo?.realName,
305
401
  readonly: ""
306
- }, null, 8, ["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(
307
403
  Fragment,
308
404
  null,
309
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 c(){return localStorage.getItem(T.TokenKey)||""}const i=new l({baseURL:u.baseURL,presetRequestInit:t=>{const s=t.headers,r=c();return r&&s.set("Token",r),t}}),R=(t,s)=>new Promise((r,n)=>{const e=new XMLHttpRequest;let o=`${i.baseURL}/file/downloadByRange?fileId=${t.fileId}`;t.fileServiceType&&(o+=`&fileServiceType=${t.fileServiceType}`,e.setRequestHeader("fileServiceType",t.fileServiceType)),s?.onprogress&&(e.onprogress=s?.onprogress),e.open("GET",o,!0),e.responseType="blob",e.setRequestHeader("Token",c()),e.setRequestHeader("tenant","default"),e.setRequestHeader("application","platform"),e.setRequestHeader("Content-Range",`bytes=${t.start}-${t.end}`),e.setRequestHeader("Accept-Ranges","bytes"),e.onreadystatechange=p=>{const a=p.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:a.response})}else e.status===500&&n(a.response)},e.onerror=()=>{n(e.response)},e.send(),s?.xhrs?.push(e)});export{R as downChunk,i as restFetch};
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};
@@ -1,5 +1,5 @@
1
- import { PropType } from 'vue';
2
1
  import { Status } from './const';
2
+ import { PropType } from 'vue';
3
3
  export declare const props: {
4
4
  fileId: {
5
5
  type: StringConstructor;
@@ -7,7 +7,7 @@ export declare const props: {
7
7
  };
8
8
  url: {
9
9
  type: StringConstructor;
10
- default: string;
10
+ default: any;
11
11
  };
12
12
  /**
13
13
  * @description 分片大小
@@ -1 +1 @@
1
- import{_VkfFormItemCtx as t}from"@vunk/form/components/form-item";import{restFetch as e}from"@skzz/platform/shared/fetch/platform";const r={...t.props,fileId:{type:String,default:""},url:{type:String,default:e.baseURL},chunkSize:{type:Number,default:1024*1024*10},fileServiceType:{type:String,default:void 0},fileStatus:{type:String,default:void 0}},i={"update:fileStatus":null};export{i as emits,r as props};
1
+ import{_VkfFormItemCtx as t}from"@vunk/form/components/form-item";const e={...t.props,fileId:{type:String,default:""},url:{type:String,default:void 0},chunkSize:{type:Number,default:1024*1024*10},fileServiceType:{type:String,default:void 0},fileStatus:{type:String,default:void 0}},i={"update:fileStatus":null};export{i as emits,e as props};
@@ -6,7 +6,7 @@ declare const _default: import("vue").DefineComponent<{
6
6
  };
7
7
  url: {
8
8
  type: StringConstructor;
9
- default: string;
9
+ default: any;
10
10
  };
11
11
  chunkSize: {
12
12
  type: NumberConstructor;
@@ -105,6 +105,7 @@ declare const _default: import("vue").DefineComponent<{
105
105
  data?: Blob;
106
106
  }[]>;
107
107
  fileStatus: import("vue").WritableComputedRef<Status>;
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<{}>>, {}>>;
108
109
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
109
110
  'update:fileStatus': any;
110
111
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -114,7 +115,7 @@ declare const _default: import("vue").DefineComponent<{
114
115
  };
115
116
  url: {
116
117
  type: StringConstructor;
117
- default: string;
118
+ default: any;
118
119
  };
119
120
  chunkSize: {
120
121
  type: NumberConstructor;
@@ -1,5 +1,5 @@
1
1
  import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
2
- import { openBlock, createElementBlock, createElementVNode, defineComponent, watch, ref, computed, watchEffect, onBeforeUnmount, resolveComponent, resolveDirective, createBlock, mergeProps, withCtx, createVNode, normalizeClass, createCommentVNode, Fragment, renderList, normalizeStyle, withDirectives, createTextVNode } from 'vue';
2
+ import { openBlock, createElementBlock, createElementVNode, defineComponent, watchEffect, watch, ref, computed, onBeforeUnmount, resolveComponent, resolveDirective, createBlock, mergeProps, withCtx, createVNode, normalizeClass, createCommentVNode, Fragment, renderList, normalizeStyle, withDirectives, createTextVNode } from 'vue';
3
3
  import { ElMessage, ElInput, ElButtonGroup, ElButton, ElIcon, vLoading } from 'element-plus';
4
4
  import { createFileChunk, calculateFileHashSample } from '@vunk/form/shared/upload';
5
5
  import { RestFetch } from '@vunk/core/shared/utils-fetch';
@@ -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,6 +9535,9 @@ 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 {
@@ -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: {
@@ -9705,6 +9718,9 @@ var script = defineComponent({
9705
9718
  default: Status.wait,
9706
9719
  key: "fileStatus"
9707
9720
  }, props2, emit);
9721
+ watchEffect(() => {
9722
+ restFetch.baseURL = props2.url || restFetch$1.baseURL;
9723
+ });
9708
9724
  watch(() => fileStatus.value, (v, ov) => {
9709
9725
  if (v === Status.doUpload) {
9710
9726
  handleUpload();
@@ -9729,10 +9745,6 @@ var script = defineComponent({
9729
9745
  }
9730
9746
  return upload_filled_default;
9731
9747
  });
9732
- watchEffect(() => {
9733
- if (props2.url)
9734
- restFetch.baseURL = props2.url;
9735
- });
9736
9748
  const handleFileChange = (e) => {
9737
9749
  handlePause();
9738
9750
  const target = e.target;
@@ -9749,19 +9761,31 @@ var script = defineComponent({
9749
9761
  const chunkFiles = createFileChunk(containerFile.value, props2.chunkSize);
9750
9762
  const hash = await calculateFileHashSample(containerFile.value);
9751
9763
  containerHash.value = hash;
9752
- const {
9753
- uploadedList,
9754
- uploaded,
9755
- mergedFile
9756
- } = await verify({
9757
- identifier: hash
9758
- });
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
+ }
9759
9782
  if (uploaded) {
9760
9783
  ElMessage({
9761
9784
  type: "success",
9762
9785
  message: "\u4E0A\u4F20\u6210\u529F"
9763
9786
  });
9764
9787
  emit("success", mergedFile);
9788
+ fileStatus.value = Status.done;
9765
9789
  return;
9766
9790
  }
9767
9791
  const sliceSize = chunkFiles[0].size;
@@ -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),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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/form",
3
- "version": "1.1.72",
3
+ "version": "1.1.74",
4
4
  "description": "",
5
5
  "main": "index.esm.js",
6
6
  "scripts": {