WXL
7 小时以前 d79ce11fcd47db138764557d214f4ea2169fb90a
1
2
3
/*! For license information please see 7436.13013159cb8e117efb79.js.LICENSE.txt */
"use strict";(self.webpackChunkhunyuan_bot=self.webpackChunkhunyuan_bot||[]).push([[7436],{47436:(e,r,t)=>{t.d(r,{A8:()=>x,dl:()=>j});var n=t(28619),o=t(8687),i=t(66031),u=t(47066),a=t.n(u),l=t(7378),c=t(79815),s=t(45042),f=t(10440),d=t(75e3),p=t(26796),v=t(27991),h=t(85803);function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function m(){m=function(){return r};var e,r={},t=Object.prototype,n=t.hasOwnProperty,o=Object.defineProperty||function(e,r,t){e[r]=t.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(e,r,t){return Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[r]}try{c({},"")}catch(e){c=function(e,r,t){return e[r]=t}}function s(e,r,t,n){var i=r&&r.prototype instanceof b?r:b,u=Object.create(i.prototype),a=new D(n||[]);return o(u,"_invoke",{value:k(e,t,a)}),u}function f(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}r.wrap=s;var d="suspendedStart",p="suspendedYield",v="executing",h="completed",g={};function b(){}function w(){}function _(){}var Y={};c(Y,u,(function(){return this}));var H=Object.getPrototypeOf,I=H&&H(H(L([])));I&&I!==t&&n.call(I,u)&&(Y=I);var O=_.prototype=b.prototype=Object.create(Y);function x(e){["next","throw","return"].forEach((function(r){c(e,r,(function(e){return this._invoke(r,e)}))}))}function S(e,r){function t(o,i,u,a){var l=f(e[o],e,i);if("throw"!==l.type){var c=l.arg,s=c.value;return s&&"object"==y(s)&&n.call(s,"__await")?r.resolve(s.__await).then((function(e){t("next",e,u,a)}),(function(e){t("throw",e,u,a)})):r.resolve(s).then((function(e){c.value=e,u(c)}),(function(e){return t("throw",e,u,a)}))}a(l.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new r((function(r,o){t(e,n,r,o)}))}return i=i?i.then(o,o):o()}})}function k(r,t,n){var o=d;return function(i,u){if(o===v)throw Error("Generator is already running");if(o===h){if("throw"===i)throw u;return{value:e,done:!0}}for(n.method=i,n.arg=u;;){var a=n.delegate;if(a){var l=E(a,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=f(r,t,n);if("normal"===c.type){if(o=n.done?h:p,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=h,n.method="throw",n.arg=c.arg)}}}function E(r,t){var n=t.method,o=r.iterator[n];if(o===e)return t.delegate=null,"throw"===n&&r.iterator.return&&(t.method="return",t.arg=e,E(r,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=f(o,r.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,g;var u=i.arg;return u?u.done?(t[r.resultName]=u.value,t.next=r.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,g):u:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function j(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function T(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function L(r){if(r||""===r){var t=r[u];if(t)return t.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,i=function t(){for(;++o<r.length;)if(n.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return i.next=i}}throw new TypeError(y(r)+" is not iterable")}return w.prototype=_,o(O,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:w,configurable:!0}),w.displayName=c(_,l,"GeneratorFunction"),r.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===w||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,c(e,l,"GeneratorFunction")),e.prototype=Object.create(O),e},r.awrap=function(e){return{__await:e}},x(S.prototype),c(S.prototype,a,(function(){return this})),r.AsyncIterator=S,r.async=function(e,t,n,o,i){void 0===i&&(i=Promise);var u=new S(s(e,t,n,o),i);return r.isGeneratorFunction(t)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},x(O),c(O,l,"Generator"),c(O,u,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var r=Object(e),t=[];for(var n in r)t.push(n);return t.reverse(),function e(){for(;t.length;){var n=t.pop();if(n in r)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=L,D.prototype={constructor:D,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!r)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function o(n,o){return a.type="throw",a.arg=r,t.next=n,o&&(t.method="next",t.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var u=this.tryEntries[i],a=u.completion;if("root"===u.tryLoc)return o("end");if(u.tryLoc<=this.prev){var l=n.call(u,"catchLoc"),c=n.call(u,"finallyLoc");if(l&&c){if(this.prev<u.catchLoc)return o(u.catchLoc,!0);if(this.prev<u.finallyLoc)return o(u.finallyLoc)}else if(l){if(this.prev<u.catchLoc)return o(u.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return o(u.finallyLoc)}}}},abrupt:function(e,r){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=e,u.arg=r,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(u)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),g},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),T(t),g}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.tryLoc===e){var n=t.completion;if("throw"===n.type){var o=n.arg;T(t)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,t,n){return this.delegate={iterator:L(r),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=e),g}},r}function g(e,r,t,n,o,i,u){try{var a=e[i](u),l=a.value}catch(e){return void t(e)}a.done?r(l):Promise.resolve(l).then(n,o)}function b(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,i,u,a=[],l=!0,c=!1;try{if(i=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=i.call(t)).done)&&(a.push(n.value),a.length!==r);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(c)throw o}}return a}}(e,r)||I(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function _(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?w(Object(t),!0).forEach((function(r){Y(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function Y(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=y(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r||"default");if("object"!=y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==y(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function H(e){return function(e){if(Array.isArray(e))return O(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||I(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(e,r){if(e){if("string"==typeof e)return O(e,r);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?O(e,r):void 0}}function O(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}var x=function(e){return e.loading="loading",e.pause="pause",e.finish="finish",e.wait="wait",e.error="error",e.cancel="cancel",e.parsing="parsing",e.parsing_failed="parsing_failed",e}(x||{});function S(e,r){var t=e.findIndex((function(e){return e.id===r.id}));return-1===t?[].concat(H(e),[r]):(e[t]=r,H(e))}function k(e,r){return e.filter((function(e){return e.id===r}))}function E(e,r){var t=r.reportData,n=void 0===t?{}:t,o=r.traceId;(0,f.lJ)({latitudes:_(_({},n),{},{err_code:null==e?void 0:e.code,err_msg:null==e?void 0:e.message,request_id:null==e?void 0:e.requestId}),indicators:{fail_count:1},traceId:o})}function j(){var e=(0,l.useRef)([]),r=(0,l.useRef)(null),t=(0,l.useRef)([]),u=b((0,l.useState)([]),2),y=u[0],w=u[1],Y=b((0,l.useState)([]),2),H=Y[0],I=Y[1],O=(0,l.useRef)([]),j=b((0,l.useState)(!1),2),T=j[0],D=j[1],L=(0,l.useRef)(""),A=(0,d.vK)().upload_file_fail_toast,P=(0,n.$)(function(){var n,u=(n=m().mark((function n(u){var a,l,d,y,g,b,Y,H,j,T,D,P,N,q,z,R,Q,U,C,G,$,F,J,K,B,V,W,X,Z,ee,re,te,ne,oe,ie,ue,ae,le,ce,se,fe,de,pe,ve,he,ye,me,ge,be,we,_e,Ye,He,Ie,Oe,xe,Se,ke,Ee,je,Te,De,Le,Ae,Pe,Ne,qe,ze,Re,Me=arguments;return m().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(g=Me.length>1&&void 0!==Me[1]?Me[1]:{},b=u.file,Y=u.filename,H=u.errMsg,j=void 0===H?"文档上传失败":H,T=u.fileId,D=u.from,P=void 0===D?"localDoc":D,N=g.report,q=g.reportData,z=JSON.parse(localStorage.getItem("oneIDAuthInfo_".concat(p.ud.docs))||"[]"),R={openID:null==z||null===(a=z[0])||void 0===a?void 0:a.openID},Q=g.startTime||Date.now(),null===(l=h.fQ.ins)||void 0===l||l.infoAll({type:"start_upload",payload:{type:null==b?void 0:b.type,name:null==b?void 0:b.name,size:null==b?void 0:b.size,filename:Y,from:P,fileId:T}}),r.current){n.next=13;break}throw F={code:1e4,message:"cos未实例化"},N&&E(F,{reportData:q,traceId:""}),null===(U=h.fQ.ins)||void 0===U||U.error({type:"cos_init_fail",error:F}),v.M.report("file_upload_qua",{HY502:"10000",HY503:"cos未实例化",HY504:(null==b?void 0:b.type)||"",HY506:(null!==(C=null==b?void 0:b.size)&&void 0!==C?C:0)/1024,HY507:0,HY508:0,HY509:null!==(G=null===($=g.reportData)||void 0===$?void 0:$.compressTime)&&void 0!==G?G:0}),F;case 13:return u.id||M(),J=u.id||(0,s.YJ)(),O.current=S(O.current,{id:J,file:b,filename:Y,errMsg:j,fileId:T,from:P}),K=null,B=Date.now(),V=Date.now(),null===(d=h.fQ.ins)||void 0===d||d.infoAll({type:"start_get_upload_info",payload:{fileName:Y,fileId:T,docFrom:P,docOpenId:(null==R?void 0:R.openID)||""}}),n.prev=20,n.next=23,(0,o.Em)({apiType:i.Bd.API_GENERATE_COS_KEY,data:{fileName:Y,fileId:T,docFrom:P,docOpenId:(null==R?void 0:R.openID)||""},hideTip:!0,returnHeaders:!0});case 23:if(W=n.sent,X=W.data,V=Date.now(),K=_({id:J},X),e.current=S(e.current,K),"tencentDoc"!==P){n.next=32;break}return w((function(e){return S(e,{id:J,value:100})})),I((function(e){return S(e,{id:J,value:x.finish})})),n.abrupt("return",{id:J,url:K.resourceUrl,filename:Y,signUrl:"",size:(null==b?void 0:b.size)||0});case 32:n.next=49;break;case 34:if(n.prev=34,n.t0=n.catch(20),null!=A&&null!==(Z=A.props)&&void 0!==Z&&Z.text&&(0,c.Ax)(A.props.text),te=n.t0.error||{},null!==(ee=te.response)&&void 0!==ee&&ee.data){n.next=44;break}throw ae={code:10001,sensitive:!1,message:(0,f.kA)(te,"获取文件上传信息失败")},N&&E(ae,{reportData:q,traceId:te.traceId}),null===(ne=h.fQ.ins)||void 0===ne||ne.error({type:"get_upload_info_fail",error:ae,originError:n.t0}),v.M.report("file_upload_qua",{HY502:"10001",HY503:"获取文件上传信息失败",HY504:(null==b?void 0:b.type)||"",HY506:(null!==(oe=null==b?void 0:b.size)&&void 0!==oe?oe:0)/1024,HY507:0,HY508:V-B,HY509:null!==(ie=null===(ue=g.reportData)||void 0===ue?void 0:ue.compressTime)&&void 0!==ie?ie:0}),ae;case 44:throw le=te.response.data.error,ce={code:le.code,sensitive:20010===Number(le.code),message:(0,f.kA)(te,"获取文件上传信息失败-后台")},null===(re=h.fQ.ins)||void 0===re||re.error({type:"get_upload_info_fail",error:ce,originError:n.t0}),N&&(E(ce,{reportData:q,traceId:te.traceId}),v.M.report("file_upload_qua",{HY502:le.code,HY503:(0,f.kA)(te,"获取文件上传信息失败-后台"),HY504:(null==b?void 0:b.type)||"",HY506:(null!==(se=null==b?void 0:b.size)&&void 0!==se?se:0)/1024,HY507:0,HY508:V-B,HY509:null!==(fe=null===(de=g.reportData)||void 0===de?void 0:de.compressTime)&&void 0!==fe?fe:0})),ce;case 49:if(K){n.next=55;break}throw me={code:10003,sensitive:!1,message:"文件上传信息为空"},N&&E(me,{reportData:q,traceId:""}),null===(pe=h.fQ.ins)||void 0===pe||pe.error({type:"get_upload_info_fail",error:me}),v.M.report("file_upload_qua",{HY502:me.code,HY503:"文件上传信息为空",HY504:(null==b?void 0:b.type)||"",HY506:(null!==(ve=null==b?void 0:b.size)&&void 0!==ve?ve:0)/1024,HY507:0,HY508:V-B,HY509:null!==(he=null===(ye=g.reportData)||void 0===ye?void 0:ye.compressTime)&&void 0!==he?he:0}),me;case 55:return w((function(e){return S(e,{id:J,value:0})})),I((function(e){return S(e,{id:J,value:x.loading})})),be=((null==b?void 0:b.name.split(".").pop())||"").toLowerCase(),we=/image\//.test((null==b?void 0:b.type)||""),ge=["png","jpg","jpeg","webp","bmp","heic"].includes(be)||we?{"Content-Type":(null==b?void 0:b.type)||"image/".concat(be),"Pic-Operations":JSON.stringify({is_pic_info:1,rules:[{fileid:K.location,rule:"imageMogr2/format/jpg"}]})}:{"Content-Type":"application/octet-stream"},_e=Date.now(),null===(y=h.fQ.ins)||void 0===y||y.infoAll({type:"start_upload_by_cos",payload:{bucket:K.bucketName,region:K.region,headers:ge,location:K.location}}),n.prev=62,L.current=J,Se="",n.next=67,null===(Ye=r.current)||void 0===Ye?void 0:Ye.putObject({Bucket:K.bucketName,Region:K.region,Body:b,Headers:ge,Key:K.location,onTaskReady:function(e){t.current=S(t.current,{id:J,value:e})},onProgress:function(e){w((function(r){return S(r,{id:J,value:Math.round(1e4*e.percent)/100})}))}});case 67:if(ke=n.sent,O.current=k(O.current,J),I((function(e){return S(e,{id:J,value:x.finish})})),!u.sign){n.next=75;break}return n.next=74,new Promise((function(e,t){var n;null===(n=r.current)||void 0===n||n.getObjectUrl({Bucket:K.bucketName,Region:K.region,Key:K.location,Sign:!0},(function(r,n){var o;null===(o=h.fQ.ins)||void 0===o||o.error({type:"get_cos_url_by_sign_fail",error:r,payload:n}),r?t(r):e(n.Url)}))}));case 74:Se=n.sent;case 75:return N&&(0,f.lJ)({latitudes:_(_({},q),{},{request_id:ke.RequestId||""}),indicators:{total_time:Date.now()-Q,success_count:1},traceId:ke.RequestId||""}),Ee=Date.now(),null===(He=h.fQ.ins)||void 0===He||He.infoAll({type:"upload_success",payload:{url:K.resourceUrl,filename:Y,signUrl:Se,size:(null==b?void 0:b.size)||0,requestId:ke.RequestId||""}}),v.M.report("file_upload_qua",{HY502:"0",HY503:"",HY504:be,HY506:(null!==(Ie=null==b?void 0:b.size)&&void 0!==Ie?Ie:0)/1024,HY507:Ee-_e,HY508:V-B,HY509:null!==(Oe=null===(xe=g.reportData)||void 0===xe?void 0:xe.compressTime)&&void 0!==Oe?Oe:0}),n.abrupt("return",{id:J,url:K.resourceUrl,filename:Y,signUrl:Se,size:(null==b?void 0:b.size)||0});case 82:if(n.prev=82,n.t1=n.catch(62),(0,c.Ax)(j),I((function(e){return S(e,{id:J,value:x.error})})),!n.t1.error){n.next=93;break}throw ze={code:n.t1.error.Code||n.t1.error.code,sensitive:!1,message:JSON.stringify(n.t1),requestId:n.t1.error.RequestId},N&&E(ze,{reportData:q,traceId:n.t1.error.RequestId}),null===(Ae=h.fQ.ins)||void 0===Ae||Ae.error({type:"upload_error",error:ze,originError:n.t1}),v.M.report("file_upload_qua",{HY502:n.t1.error.Code||n.t1.error.code,HY503:JSON.stringify(n.t1),HY504:(null==b?void 0:b.type)||"",HY506:(null!==(Pe=null==b?void 0:b.size)&&void 0!==Pe?Pe:0)/1024,HY507:0,HY508:V-B,HY509:null!==(Ne=null===(qe=g.reportData)||void 0===qe?void 0:qe.compressTime)&&void 0!==Ne?Ne:0}),ze;case 93:throw Re={code:10004,sensitive:!1,message:(0,f.kA)(n.t1,"cos上传失败")},N&&E(Re,{reportData:q,traceId:""}),null===(je=h.fQ.ins)||void 0===je||je.error({type:"upload_error",error:Re,originError:n.t1}),v.M.report("file_upload_qua",{HY502:10004,HY503:(0,f.kA)(n.t1,"cos上传失败"),HY504:(null==b?void 0:b.type)||"",HY506:(null!==(Te=null==b?void 0:b.size)&&void 0!==Te?Te:0)/1024,HY507:0,HY508:V-B,HY509:null!==(De=null===(Le=g.reportData)||void 0===Le?void 0:Le.compressTime)&&void 0!==De?De:0}),Re;case 98:return n.prev=98,t.current=k(t.current,J),n.finish(98);case 101:case"end":return n.stop()}}),n,null,[[20,34],[62,82,98,101]])})),function(){var e=this,r=arguments;return new Promise((function(t,o){var i=n.apply(e,r);function u(e){g(i,t,o,u,a,"next",e)}function a(e){g(i,t,o,u,a,"throw",e)}u(void 0)}))});return function(e){return u.apply(this,arguments)}}()),N=(0,n.$)((function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=n.id;if(!n.keepStatus){var i=H.find((function(e){return e.id===o}))||H[0];I(S(H,{id:null==i?void 0:i.id,value:x.cancel}))}if(0!==t.current.length&&r.current){var u=t.current.find((function(e){return e.id===o}))||t.current[0];null===(e=r.current)||void 0===e||e.cancelTask(u.value)}})),q=(0,n.$)((function(e){var n,o=H.find((function(r){return r.id===e}))||H[0];if(I(S(H,{id:o.id,value:x.pause})),0!==t.current.length&&r.current){var i=t.current.find((function(r){return r.id===e}))||t.current[0];null===(n=r.current)||void 0===n||n.pauseTask(i.value)}})),z=(0,n.$)((function(e){var n,o=H.find((function(r){return r.id===e}))||H[0];if(I(S(H,{id:o.id,value:x.loading})),0!==t.current.length&&r.current){var i=t.current.find((function(r){return r.id===e}))||t.current[0];null===(n=r.current)||void 0===n||n.restartTask(i.value)}})),R=(0,n.$)((function(e){var r=O.current.find((function(r){return r.id===e}))||O.current[0];return r?P(r):Promise.reject({sensitive:!1,message:"文件异常,请重试检查后重新上传"})})),M=(0,n.$)((function(){e.current=[],t.current=[],w([]),I([]),O.current=[]})),Q=(0,n.$)((function(r){r?(e.current=k(e.current,r),t.current=k(t.current,r),w((function(e){return k(e,r)})),I((function(e){return k(e,r)})),O.current=k(O.current,r)):M()}));(0,l.useEffect)((function(){var n=new(a())({FileParallelLimit:50,getAuthorization:function(r,n){if(L.current){var o=e.current.find((function(e){return e.id===L.current}));if(!o)return I((function(e){return S(e,{id:L.current,value:x.error})})),void(t.current=k(t.current,L.current));n({TmpSecretId:o.encryptTmpSecretId,TmpSecretKey:o.encryptTmpSecretKey,SecurityToken:o.encryptToken,StartTime:o.startTime,ExpiredTime:o.expiredTime,ScopeLimit:!0})}},UseAccelerate:!0});r.current=n,D(!0)}),[]);var U=(0,n.$)((function(){}));return{upload:P,progress:y,status:H,cancel:N,pause:q,start:z,restart:R,isReady:T,setStatus:U,reset:M,delete:Q}}}}]);
//# sourceMappingURL=sourcemap/7436.13013159cb8e117efb79.js.map