123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- import{d as se,b as q,z as j,I as Me,A as ke,a9 as xe,h as T,S as U,az as nt,R as O,aA as rt,X as M,T as F,V as ot,aB as De,aC as at,a0 as qe,aD as it,aE as N,a1 as V,aF as st,U as je,Y as ge,ac as Ne,aG as lt,a3 as H,$ as Ve,aH as ut,aI as ct,ag as We,ah as ft,aJ as ht,aK as dt,aL as pt,aM as gt,ae as vt,aN as Se,aO as mt,au as bt,aP as yt,aQ as _t,aR as wt,aS as xt,al as le,aT as ve,ay as Ct,ar as Tt,aU as kt,o as P,c as he,a as me,n as St,r as Ie,B,w as z,f as R,F as Ae,q as It,g as D,j as ce,i as G,t as ze,as as At,_ as zt,m as Rt,k as Ut,x as Pt}from"./index-aa2e1a24.js";import{m as Ot}from"./TaskData-b55f69c7.js";import{_ as Lt}from"./DatePicker-5afdde58.js";import{c as $t,_ as Et,d as Ft,e as Bt}from"./VerifyTemplateMapData-09a76291.js";import{_ as Ht}from"./Space-51cd76a1.js";import{_ as Mt}from"./Popconfirm-9aa2c8f4.js";const Re=se({name:"SlotMachineNumber",props:{clsPrefix:{type:String,required:!0},value:{type:[Number,String],required:!0},oldOriginalNumber:{type:Number,default:void 0},newOriginalNumber:{type:Number,default:void 0}},setup(r){const n=q(null),e=q(r.value),a=q(r.value),o=q("up"),t=q(!1),u=j(()=>t.value?`${r.clsPrefix}-base-slot-machine-current-number--${o.value}-scroll`:null),d=j(()=>t.value?`${r.clsPrefix}-base-slot-machine-old-number--${o.value}-scroll`:null);Me(xe(r,"value"),(h,m)=>{e.value=m,a.value=h,ke(v)});function v(){const h=r.newOriginalNumber,m=r.oldOriginalNumber;m===void 0||h===void 0||(h>m?i("up"):m>h&&i("down"))}function i(h){o.value=h,t.value=!1,ke(()=>{var m;(m=n.value)===null||m===void 0||m.offsetWidth,t.value=!0})}return()=>{const{clsPrefix:h}=r;return T("span",{ref:n,class:`${h}-base-slot-machine-number`},e.value!==null?T("span",{class:[`${h}-base-slot-machine-old-number ${h}-base-slot-machine-old-number--top`,d.value]},e.value):null,T("span",{class:[`${h}-base-slot-machine-current-number`,u.value]},T("span",{ref:"numberWrapper",class:[`${h}-base-slot-machine-current-number__inner`,typeof r.value!="number"&&`${h}-base-slot-machine-current-number__inner--not-number`]},a.value)),e.value!==null?T("span",{class:[`${h}-base-slot-machine-old-number ${h}-base-slot-machine-old-number--bottom`,d.value]},e.value):null)}}}),{cubicBezierEaseOut:K}=nt;function Dt({duration:r=".2s"}={}){return[U("&.fade-up-width-expand-transition-leave-active",{transition:`
- opacity ${r} ${K},
- max-width ${r} ${K},
- transform ${r} ${K}
- `}),U("&.fade-up-width-expand-transition-enter-active",{transition:`
- opacity ${r} ${K},
- max-width ${r} ${K},
- transform ${r} ${K}
- `}),U("&.fade-up-width-expand-transition-enter-to",{opacity:1,transform:"translateX(0) translateY(0)"}),U("&.fade-up-width-expand-transition-enter-from",{maxWidth:"0 !important",opacity:0,transform:"translateY(60%)"}),U("&.fade-up-width-expand-transition-leave-from",{opacity:1,transform:"translateY(0)"}),U("&.fade-up-width-expand-transition-leave-to",{maxWidth:"0 !important",opacity:0,transform:"translateY(60%)"})]}const qt=U([U("@keyframes n-base-slot-machine-fade-up-in",`
- from {
- transform: translateY(60%);
- opacity: 0;
- }
- to {
- transform: translateY(0);
- opacity: 1;
- }
- `),U("@keyframes n-base-slot-machine-fade-down-in",`
- from {
- transform: translateY(-60%);
- opacity: 0;
- }
- to {
- transform: translateY(0);
- opacity: 1;
- }
- `),U("@keyframes n-base-slot-machine-fade-up-out",`
- from {
- transform: translateY(0%);
- opacity: 1;
- }
- to {
- transform: translateY(-60%);
- opacity: 0;
- }
- `),U("@keyframes n-base-slot-machine-fade-down-out",`
- from {
- transform: translateY(0%);
- opacity: 1;
- }
- to {
- transform: translateY(60%);
- opacity: 0;
- }
- `),O("base-slot-machine",`
- overflow: hidden;
- white-space: nowrap;
- display: inline-block;
- height: 18px;
- line-height: 18px;
- `,[O("base-slot-machine-number",`
- display: inline-block;
- position: relative;
- height: 18px;
- width: .6em;
- max-width: .6em;
- `,[Dt({duration:".2s"}),rt({duration:".2s",delay:"0s"}),O("base-slot-machine-old-number",`
- display: inline-block;
- opacity: 0;
- position: absolute;
- left: 0;
- right: 0;
- `,[M("top",{transform:"translateY(-100%)"}),M("bottom",{transform:"translateY(100%)"}),M("down-scroll",{animation:"n-base-slot-machine-fade-down-out .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1}),M("up-scroll",{animation:"n-base-slot-machine-fade-up-out .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1})]),O("base-slot-machine-current-number",`
- display: inline-block;
- position: absolute;
- left: 0;
- top: 0;
- bottom: 0;
- right: 0;
- opacity: 1;
- transform: translateY(0);
- width: .6em;
- `,[M("down-scroll",{animation:"n-base-slot-machine-fade-down-in .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1}),M("up-scroll",{animation:"n-base-slot-machine-fade-up-in .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1}),F("inner",`
- display: inline-block;
- position: absolute;
- right: 0;
- top: 0;
- width: .6em;
- `,[M("not-number",`
- right: unset;
- left: 0;
- `)])])])])]),jt=se({name:"BaseSlotMachine",props:{clsPrefix:{type:String,required:!0},value:{type:[Number,String],default:0},max:{type:Number,default:void 0},appeared:{type:Boolean,required:!0}},setup(r){ot("-base-slot-machine",qt,xe(r,"clsPrefix"));const n=q(),e=q(),a=j(()=>{if(typeof r.value=="string")return[];if(r.value<1)return[0];const o=[];let t=r.value;for(r.max!==void 0&&(t=Math.min(r.max,t));t>=1;)o.push(t%10),t/=10,t=Math.floor(t);return o.reverse(),o});return Me(xe(r,"value"),(o,t)=>{typeof o=="string"?(e.value=void 0,n.value=void 0):typeof t=="string"?(e.value=o,n.value=void 0):(e.value=o,n.value=t)}),()=>{const{value:o,clsPrefix:t}=r;return typeof o=="number"?T("span",{class:`${t}-base-slot-machine`},T(at,{name:"fade-up-width-expand-transition",tag:"span"},{default:()=>a.value.map((u,d)=>T(Re,{clsPrefix:t,key:a.value.length-d-1,oldOriginalNumber:n.value,newOriginalNumber:e.value,value:u}))}),T(De,{key:"+",width:!0},{default:()=>r.max!==void 0&&r.max<o?T(Re,{clsPrefix:t,value:"+"}):null})):T("span",{class:`${t}-base-slot-machine`},o)}}}),Nt=r=>{const{lineHeight:n,borderRadius:e,fontWeightStrong:a,baseColor:o,dividerColor:t,actionColor:u,textColor1:d,textColor2:v,closeColorHover:i,closeColorPressed:h,closeIconColor:m,closeIconColorHover:x,closeIconColorPressed:C,infoColor:w,successColor:y,warningColor:b,errorColor:g,fontSize:p}=r;return Object.assign(Object.assign({},it),{fontSize:p,lineHeight:n,titleFontWeight:a,borderRadius:e,border:`1px solid ${t}`,color:u,titleTextColor:d,iconColor:v,contentTextColor:v,closeBorderRadius:e,closeColorHover:i,closeColorPressed:h,closeIconColor:m,closeIconColorHover:x,closeIconColorPressed:C,borderInfo:`1px solid ${N(o,V(w,{alpha:.25}))}`,colorInfo:N(o,V(w,{alpha:.08})),titleTextColorInfo:d,iconColorInfo:w,contentTextColorInfo:v,closeColorHoverInfo:i,closeColorPressedInfo:h,closeIconColorInfo:m,closeIconColorHoverInfo:x,closeIconColorPressedInfo:C,borderSuccess:`1px solid ${N(o,V(y,{alpha:.25}))}`,colorSuccess:N(o,V(y,{alpha:.08})),titleTextColorSuccess:d,iconColorSuccess:y,contentTextColorSuccess:v,closeColorHoverSuccess:i,closeColorPressedSuccess:h,closeIconColorSuccess:m,closeIconColorHoverSuccess:x,closeIconColorPressedSuccess:C,borderWarning:`1px solid ${N(o,V(b,{alpha:.33}))}`,colorWarning:N(o,V(b,{alpha:.08})),titleTextColorWarning:d,iconColorWarning:b,contentTextColorWarning:v,closeColorHoverWarning:i,closeColorPressedWarning:h,closeIconColorWarning:m,closeIconColorHoverWarning:x,closeIconColorPressedWarning:C,borderError:`1px solid ${N(o,V(g,{alpha:.25}))}`,colorError:N(o,V(g,{alpha:.08})),titleTextColorError:d,iconColorError:g,contentTextColorError:v,closeColorHoverError:i,closeColorPressedError:h,closeIconColorError:m,closeIconColorHoverError:x,closeIconColorPressedError:C})},Vt={name:"Alert",common:qe,self:Nt},Wt=Vt,Gt=O("alert",`
- line-height: var(--n-line-height);
- border-radius: var(--n-border-radius);
- position: relative;
- transition: background-color .3s var(--n-bezier);
- background-color: var(--n-color);
- text-align: start;
- word-break: break-word;
- `,[F("border",`
- border-radius: inherit;
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- transition: border-color .3s var(--n-bezier);
- border: var(--n-border);
- pointer-events: none;
- `),M("closable",[O("alert-body",[F("title",`
- padding-right: 24px;
- `)])]),F("icon",{color:"var(--n-icon-color)"}),O("alert-body",{padding:"var(--n-padding)"},[F("title",{color:"var(--n-title-text-color)"}),F("content",{color:"var(--n-content-text-color)"})]),st({originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.9)"}}),F("icon",`
- position: absolute;
- left: 0;
- top: 0;
- align-items: center;
- justify-content: center;
- display: flex;
- width: var(--n-icon-size);
- height: var(--n-icon-size);
- font-size: var(--n-icon-size);
- margin: var(--n-icon-margin);
- `),F("close",`
- transition:
- color .3s var(--n-bezier),
- background-color .3s var(--n-bezier);
- position: absolute;
- right: 0;
- top: 0;
- margin: var(--n-close-margin);
- `),M("show-icon",[O("alert-body",{paddingLeft:"calc(var(--n-icon-margin-left) + var(--n-icon-size) + var(--n-icon-margin-right))"})]),O("alert-body",`
- border-radius: var(--n-border-radius);
- transition: border-color .3s var(--n-bezier);
- `,[F("title",`
- transition: color .3s var(--n-bezier);
- font-size: 16px;
- line-height: 19px;
- font-weight: var(--n-title-font-weight);
- `,[U("& +",[F("content",{marginTop:"9px"})])]),F("content",{transition:"color .3s var(--n-bezier)",fontSize:"var(--n-font-size)"})]),F("icon",{transition:"color .3s var(--n-bezier)"})]),Xt=Object.assign(Object.assign({},ge.props),{title:String,showIcon:{type:Boolean,default:!0},type:{type:String,default:"default"},bordered:{type:Boolean,default:!0},closable:Boolean,onClose:Function,onAfterLeave:Function,onAfterHide:Function}),xr=se({name:"Alert",inheritAttrs:!1,props:Xt,setup(r){const{mergedClsPrefixRef:n,mergedBorderedRef:e,inlineThemeDisabled:a,mergedRtlRef:o}=je(r),t=ge("Alert","-alert",Gt,Wt,r,n),u=Ne("Alert",o,n),d=j(()=>{const{common:{cubicBezierEaseInOut:C},self:w}=t.value,{fontSize:y,borderRadius:b,titleFontWeight:g,lineHeight:p,iconSize:l,iconMargin:s,iconMarginRtl:f,closeIconSize:c,closeBorderRadius:I,closeSize:L,closeMargin:$,closeMarginRtl:Y,padding:ye}=w,{type:E}=r,{left:_,right:J}=lt(s);return{"--n-bezier":C,"--n-color":w[H("color",E)],"--n-close-icon-size":c,"--n-close-border-radius":I,"--n-close-color-hover":w[H("closeColorHover",E)],"--n-close-color-pressed":w[H("closeColorPressed",E)],"--n-close-icon-color":w[H("closeIconColor",E)],"--n-close-icon-color-hover":w[H("closeIconColorHover",E)],"--n-close-icon-color-pressed":w[H("closeIconColorPressed",E)],"--n-icon-color":w[H("iconColor",E)],"--n-border":w[H("border",E)],"--n-title-text-color":w[H("titleTextColor",E)],"--n-content-text-color":w[H("contentTextColor",E)],"--n-line-height":p,"--n-border-radius":b,"--n-font-size":y,"--n-title-font-weight":g,"--n-icon-size":l,"--n-icon-margin":s,"--n-icon-margin-rtl":f,"--n-close-size":L,"--n-close-margin":$,"--n-close-margin-rtl":Y,"--n-padding":ye,"--n-icon-margin-left":_,"--n-icon-margin-right":J}}),v=a?Ve("alert",j(()=>r.type[0]),d,r):void 0,i=q(!0),h=()=>{const{onAfterLeave:C,onAfterHide:w}=r;C&&C(),w&&w()};return{rtlEnabled:u,mergedClsPrefix:n,mergedBordered:e,visible:i,handleCloseClick:()=>{var C;Promise.resolve((C=r.onClose)===null||C===void 0?void 0:C.call(r)).then(w=>{w!==!1&&(i.value=!1)})},handleAfterLeave:()=>{h()},mergedTheme:t,cssVars:a?void 0:d,themeClass:v==null?void 0:v.themeClass,onRender:v==null?void 0:v.onRender}},render(){var r;return(r=this.onRender)===null||r===void 0||r.call(this),T(De,{onAfterLeave:this.handleAfterLeave},{default:()=>{const{mergedClsPrefix:n,$slots:e}=this,a={class:[`${n}-alert`,this.themeClass,this.closable&&`${n}-alert--closable`,this.showIcon&&`${n}-alert--show-icon`,this.rtlEnabled&&`${n}-alert--rtl`],style:this.cssVars,role:"alert"};return this.visible?T("div",Object.assign({},ut(this.$attrs,a)),this.closable&&T(ct,{clsPrefix:n,class:`${n}-alert__close`,onClick:this.handleCloseClick}),this.bordered&&T("div",{class:`${n}-alert__border`}),this.showIcon&&T("div",{class:`${n}-alert__icon`,"aria-hidden":"true"},We(e.icon,()=>[T(ft,{clsPrefix:n},{default:()=>{switch(this.type){case"success":return T(gt,null);case"info":return T(pt,null);case"warning":return T(dt,null);case"error":return T(ht,null);default:return null}}})])),T("div",{class:[`${n}-alert-body`,this.mergedBordered&&`${n}-alert-body--bordered`]},vt(e.header,o=>{const t=o||this.title;return t?T("div",{class:`${n}-alert-body__title`},t):null}),e.default&&T("div",{class:`${n}-alert-body__content`},e))):null}})}}),Yt=r=>{const{errorColor:n,infoColor:e,successColor:a,warningColor:o,fontFamily:t}=r;return{color:n,colorInfo:e,colorSuccess:a,colorError:n,colorWarning:o,fontSize:"12px",fontFamily:t}},Jt={name:"Badge",common:qe,self:Yt},Kt=Jt,Zt=U([U("@keyframes badge-wave-spread",{from:{boxShadow:"0 0 0.5px 0px var(--n-ripple-color)",opacity:.6},to:{boxShadow:"0 0 0.5px 4.5px var(--n-ripple-color)",opacity:0}}),O("badge",`
- display: inline-flex;
- position: relative;
- vertical-align: middle;
- color: var(--n-color);
- font-family: var(--n-font-family);
- `,[M("as-is",[O("badge-sup",{position:"static",transform:"translateX(0)"},[Se({transformOrigin:"left bottom",originalTransform:"translateX(0)"})])]),M("dot",[O("badge-sup",`
- height: 8px;
- width: 8px;
- padding: 0;
- min-width: 8px;
- left: 100%;
- bottom: calc(100% - 4px);
- `,[U("::before","border-radius: 4px;")])]),O("badge-sup",`
- background: var(--n-color);
- transition:
- background-color .3s var(--n-bezier),
- color .3s var(--n-bezier);
- color: #FFF;
- position: absolute;
- height: 18px;
- line-height: 18px;
- border-radius: 9px;
- padding: 0 6px;
- text-align: center;
- font-size: var(--n-font-size);
- transform: translateX(-50%);
- left: 100%;
- bottom: calc(100% - 9px);
- font-variant-numeric: tabular-nums;
- z-index: 1;
- display: flex;
- align-items: center;
- `,[Se({transformOrigin:"left bottom",originalTransform:"translateX(-50%)"}),O("base-wave",{zIndex:1,animationDuration:"2s",animationIterationCount:"infinite",animationDelay:"1s",animationTimingFunction:"var(--n-ripple-bezier)",animationName:"badge-wave-spread"}),U("&::before",`
- opacity: 0;
- transform: scale(1);
- border-radius: 9px;
- content: "";
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- `)])])]),Qt=Object.assign(Object.assign({},ge.props),{value:[String,Number],max:Number,dot:Boolean,type:{type:String,default:"default"},show:{type:Boolean,default:!0},showZero:Boolean,processing:Boolean,color:String,offset:Array}),Cr=se({name:"Badge",props:Qt,setup(r,{slots:n}){const{mergedClsPrefixRef:e,inlineThemeDisabled:a,mergedRtlRef:o}=je(r),t=ge("Badge","-badge",Zt,Kt,r,e),u=q(!1),d=()=>{u.value=!0},v=()=>{u.value=!1},i=j(()=>r.show&&(r.dot||r.value!==void 0&&!(!r.showZero&&Number(r.value)<=0)||!mt(n.value)));bt(()=>{i.value&&(u.value=!0)});const h=Ne("Badge",o,e),m=j(()=>{const{type:w,color:y}=r,{common:{cubicBezierEaseInOut:b,cubicBezierEaseOut:g},self:{[H("color",w)]:p,fontFamily:l,fontSize:s}}=t.value;return{"--n-font-size":s,"--n-font-family":l,"--n-color":y||p,"--n-ripple-color":y||p,"--n-bezier":b,"--n-ripple-bezier":g}}),x=a?Ve("badge",j(()=>{let w="";const{type:y,color:b}=r;return y&&(w+=y[0]),b&&(w+=yt(b)),w}),m,r):void 0,C=j(()=>{const{offset:w}=r;if(!w)return;const[y,b]=w,g=typeof y=="number"?`${y}px`:y,p=typeof b=="number"?`${b}px`:b;return{transform:`translate(calc(${h!=null&&h.value?"50%":"-50%"} + ${g}), ${p})`}});return{rtlEnabled:h,mergedClsPrefix:e,appeared:u,showBadge:i,handleAfterEnter:d,handleAfterLeave:v,cssVars:a?void 0:m,themeClass:x==null?void 0:x.themeClass,onRender:x==null?void 0:x.onRender,offsetStyle:C}},render(){var r;const{mergedClsPrefix:n,onRender:e,themeClass:a,$slots:o}=this;e==null||e();const t=(r=o.default)===null||r===void 0?void 0:r.call(o);return T("div",{class:[`${n}-badge`,this.rtlEnabled&&`${n}-badge--rtl`,a,{[`${n}-badge--dot`]:this.dot,[`${n}-badge--as-is`]:!t}],style:this.cssVars},t,T(_t,{name:"fade-in-scale-up-transition",onAfterEnter:this.handleAfterEnter,onAfterLeave:this.handleAfterLeave},{default:()=>this.showBadge?T("sup",{class:`${n}-badge-sup`,title:wt(this.value),style:this.offsetStyle},We(o.value,()=>[this.dot?null:T(jt,{clsPrefix:n,appeared:this.appeared,max:this.max,value:this.value})]),this.processing?T(xt,{clsPrefix:n}):null):null}))}}),Tr=r=>le.request({method:"POST",url:"/GenerateReport/Generate_scheme",data:r,baseURL:ve}),kr=r=>le.request({method:"POST",url:"/GenerateReport/Generate_report",data:r,baseURL:ve}),Sr=r=>le.request({method:"POST",url:"/GenerateReport/Generate_inspect",data:r,baseURL:ve}),Ir=r=>le.request({method:"POST",url:"/GenerateReport/Generate_key",data:r,baseURL:ve}),Ar=r=>le.request({method:"POST",url:"/VerifyTemplateMapData/Copy",data:r,baseURL:Ct});var Ge=globalThis&&globalThis.__extends||function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,o){a.__proto__=o}||function(a,o){for(var t in o)o.hasOwnProperty(t)&&(a[t]=o[t])},r(n,e)};return function(n,e){r(n,e);function a(){this.constructor=n}n.prototype=e===null?Object.create(e):(a.prototype=e.prototype,new a)}}(),S;(function(r){r.InvalidFile="InvalidFile",r.InvalidToken="InvalidToken",r.InvalidMetadata="InvalidMetadata",r.InvalidChunkSize="InvalidChunkSize",r.InvalidCustomVars="InvalidCustomVars",r.NotAvailableUploadHost="NotAvailableUploadHost",r.ReadCacheFailed="ReadCacheFailed",r.InvalidCacheData="InvalidCacheData",r.WriteCacheFailed="WriteCacheFailed",r.RemoveCacheFailed="RemoveCacheFailed",r.GetCanvasContextFailed="GetCanvasContextFailed",r.UnsupportedFileType="UnsupportedFileType",r.FileReaderReadFailed="FileReaderReadFailed",r.NotAvailableXMLHttpRequest="NotAvailableXMLHttpRequest",r.InvalidProgressEventTarget="InvalidProgressEventTarget",r.RequestError="RequestError"})(S||(S={}));var A=function(){function r(n,e){this.name=n,this.message=e,this.stack=new Error().stack}return r}(),ie=function(r){Ge(n,r);function n(e,a,o,t){var u=r.call(this,S.RequestError,o)||this;return u.code=e,u.reqId=a,u.isRequestError=!0,u.data=t,u}return n}(A),en=function(r){Ge(n,r);function n(e,a){return a===void 0&&(a=""),r.call(this,0,a,e)||this}return n}(ie),tn=function(){function r(n,e){this.runTask=n,this.limit=e,this.aborted=!1,this.queue=[],this.processing=[]}return r.prototype.enqueue=function(n){var e=this;return new Promise(function(a,o){e.queue.push({task:n,resolve:a,reject:o}),e.check()})},r.prototype.run=function(n){var e=this;this.queue=this.queue.filter(function(a){return a!==n}),this.processing.push(n),this.runTask(n.task).then(function(){e.processing=e.processing.filter(function(a){return a!==n}),n.resolve(),e.check()},function(a){return n.reject(a)})},r.prototype.check=function(){var n=this;if(!this.aborted){var e=this.processing.length,a=this.limit-e;this.queue.slice(0,a).forEach(function(o){n.run(o)})}},r.prototype.abort=function(){this.queue=[],this.aborted=!0},r}(),nn=globalThis&&globalThis.__extends||function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,o){a.__proto__=o}||function(a,o){for(var t in o)o.hasOwnProperty(t)&&(a[t]=o[t])},r(n,e)};return function(n,e){r(n,e);function a(){this.constructor=n}n.prototype=e===null?Object.create(e):(a.prototype=e.prototype,new a)}}(),oe=globalThis&&globalThis.__assign||function(){return oe=Object.assign||function(r){for(var n,e=1,a=arguments.length;e<a;e++){n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])}return r},oe.apply(this,arguments)},rn=function(){function r(){this.closed=!1}return r.prototype.unsubscribe=function(){this.closed||(this.closed=!0,this._unsubscribe&&this._unsubscribe())},r.prototype.add=function(n){this._unsubscribe=n},r}(),on=function(r){nn(n,r);function n(e,a,o){var t=r.call(this)||this;return t.isStopped=!1,e&&typeof e=="object"?t.destination=e:t.destination=oe(oe(oe({},e&&{next:e}),a&&{error:a}),o&&{complete:o}),t}return n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this))},n.prototype.next=function(e){!this.isStopped&&this.destination.next&&this.destination.next(e)},n.prototype.error=function(e){!this.isStopped&&this.destination.error&&(this.isStopped=!0,this.destination.error(e))},n.prototype.complete=function(e){!this.isStopped&&this.destination.complete&&(this.isStopped=!0,this.destination.complete(e))},n}(rn),an=function(){function r(n){this._subscribe=n}return r.prototype.subscribe=function(n,e,a){var o=new on(n,e,a);return o.add(this._subscribe(o)),o},r}();function sn(r){if(r===null||typeof r>"u")return"";var n=r+"",e="",a,o,t=0;a=o=0,t=n.length;for(var u=0;u<t;u++){var d=n.charCodeAt(u),v=null;if(d<128)o++;else if(d>127&&d<2048)v=String.fromCharCode(d>>6|192,d&63|128);else if((d&63488^55296)>0)v=String.fromCharCode(d>>12|224,d>>6&63|128,d&63|128);else{if((d&64512^55296)>0)throw new RangeError("Unmatched trail surrogate at "+u);var i=n.charCodeAt(++u);if((i&64512^56320)>0)throw new RangeError("Unmatched lead surrogate at "+(u-1));d=((d&1023)<<10)+(i&1023)+65536,v=String.fromCharCode(d>>18|240,d>>12&63|128,d>>6&63|128,d&63|128)}v!==null&&(o>a&&(e+=n.slice(a,o)),e+=v,a=o=u+1)}return o>a&&(e+=n.slice(a,t)),e}function ln(r){var n=[],e=0,a=0,o=0;for(r+="";e<r.length;){a=r.charCodeAt(e)&255,o=0,a<=191?(a=a&127,o=1):a<=223?(a=a&31,o=2):a<=239?(a=a&15,o=3):(a=a&7,o=4);for(var t=1;t<o;++t)a=a<<6|r.charCodeAt(t+e)&63;o===4?(a-=65536,n.push(String.fromCharCode(55296|a>>10&1023)),n.push(String.fromCharCode(56320|a&1023))):n.push(String.fromCharCode(a)),e+=o}return n.join("")}function un(r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e,a,o,t,u,d,v,i,h=0,m=0,x="",C=[];if(!r)return r;r=sn(r+"");do e=r.charCodeAt(h++),a=r.charCodeAt(h++),o=r.charCodeAt(h++),i=e<<16|a<<8|o,t=i>>18&63,u=i>>12&63,d=i>>6&63,v=i&63,C[m++]=n.charAt(t)+n.charAt(u)+n.charAt(d)+n.charAt(v);while(h<r.length);switch(x=C.join(""),r.length%3){case 1:x=x.slice(0,-2)+"==";break;case 2:x=x.slice(0,-1)+"=";break}return x}function cn(r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e,a,o,t,u,d,v,i,h=0,m=0,x="",C=[];if(!r)return r;r+="";do t=n.indexOf(r.charAt(h++)),u=n.indexOf(r.charAt(h++)),d=n.indexOf(r.charAt(h++)),v=n.indexOf(r.charAt(h++)),i=t<<18|u<<12|d<<6|v,e=i>>16&255,a=i>>8&255,o=i&255,d===64?C[m++]=String.fromCharCode(e):v===64?C[m++]=String.fromCharCode(e,a):C[m++]=String.fromCharCode(e,a,o);while(h<r.length);return x=C.join(""),ln(x)}function Xe(r){return r=un(r),r.replace(/\//g,"_").replace(/\+/g,"-")}function fn(r){return r=r.replace(/_/g,"/").replace(/-/g,"+"),cn(r)}var Ye={exports:{}};(function(r,n){(function(e){r.exports=e()})(function(e){var a=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function o(g,p){var l=g[0],s=g[1],f=g[2],c=g[3];l+=(s&f|~s&c)+p[0]-680876936|0,l=(l<<7|l>>>25)+s|0,c+=(l&s|~l&f)+p[1]-389564586|0,c=(c<<12|c>>>20)+l|0,f+=(c&l|~c&s)+p[2]+606105819|0,f=(f<<17|f>>>15)+c|0,s+=(f&c|~f&l)+p[3]-1044525330|0,s=(s<<22|s>>>10)+f|0,l+=(s&f|~s&c)+p[4]-176418897|0,l=(l<<7|l>>>25)+s|0,c+=(l&s|~l&f)+p[5]+1200080426|0,c=(c<<12|c>>>20)+l|0,f+=(c&l|~c&s)+p[6]-1473231341|0,f=(f<<17|f>>>15)+c|0,s+=(f&c|~f&l)+p[7]-45705983|0,s=(s<<22|s>>>10)+f|0,l+=(s&f|~s&c)+p[8]+1770035416|0,l=(l<<7|l>>>25)+s|0,c+=(l&s|~l&f)+p[9]-1958414417|0,c=(c<<12|c>>>20)+l|0,f+=(c&l|~c&s)+p[10]-42063|0,f=(f<<17|f>>>15)+c|0,s+=(f&c|~f&l)+p[11]-1990404162|0,s=(s<<22|s>>>10)+f|0,l+=(s&f|~s&c)+p[12]+1804603682|0,l=(l<<7|l>>>25)+s|0,c+=(l&s|~l&f)+p[13]-40341101|0,c=(c<<12|c>>>20)+l|0,f+=(c&l|~c&s)+p[14]-1502002290|0,f=(f<<17|f>>>15)+c|0,s+=(f&c|~f&l)+p[15]+1236535329|0,s=(s<<22|s>>>10)+f|0,l+=(s&c|f&~c)+p[1]-165796510|0,l=(l<<5|l>>>27)+s|0,c+=(l&f|s&~f)+p[6]-1069501632|0,c=(c<<9|c>>>23)+l|0,f+=(c&s|l&~s)+p[11]+643717713|0,f=(f<<14|f>>>18)+c|0,s+=(f&l|c&~l)+p[0]-373897302|0,s=(s<<20|s>>>12)+f|0,l+=(s&c|f&~c)+p[5]-701558691|0,l=(l<<5|l>>>27)+s|0,c+=(l&f|s&~f)+p[10]+38016083|0,c=(c<<9|c>>>23)+l|0,f+=(c&s|l&~s)+p[15]-660478335|0,f=(f<<14|f>>>18)+c|0,s+=(f&l|c&~l)+p[4]-405537848|0,s=(s<<20|s>>>12)+f|0,l+=(s&c|f&~c)+p[9]+568446438|0,l=(l<<5|l>>>27)+s|0,c+=(l&f|s&~f)+p[14]-1019803690|0,c=(c<<9|c>>>23)+l|0,f+=(c&s|l&~s)+p[3]-187363961|0,f=(f<<14|f>>>18)+c|0,s+=(f&l|c&~l)+p[8]+1163531501|0,s=(s<<20|s>>>12)+f|0,l+=(s&c|f&~c)+p[13]-1444681467|0,l=(l<<5|l>>>27)+s|0,c+=(l&f|s&~f)+p[2]-51403784|0,c=(c<<9|c>>>23)+l|0,f+=(c&s|l&~s)+p[7]+1735328473|0,f=(f<<14|f>>>18)+c|0,s+=(f&l|c&~l)+p[12]-1926607734|0,s=(s<<20|s>>>12)+f|0,l+=(s^f^c)+p[5]-378558|0,l=(l<<4|l>>>28)+s|0,c+=(l^s^f)+p[8]-2022574463|0,c=(c<<11|c>>>21)+l|0,f+=(c^l^s)+p[11]+1839030562|0,f=(f<<16|f>>>16)+c|0,s+=(f^c^l)+p[14]-35309556|0,s=(s<<23|s>>>9)+f|0,l+=(s^f^c)+p[1]-1530992060|0,l=(l<<4|l>>>28)+s|0,c+=(l^s^f)+p[4]+1272893353|0,c=(c<<11|c>>>21)+l|0,f+=(c^l^s)+p[7]-155497632|0,f=(f<<16|f>>>16)+c|0,s+=(f^c^l)+p[10]-1094730640|0,s=(s<<23|s>>>9)+f|0,l+=(s^f^c)+p[13]+681279174|0,l=(l<<4|l>>>28)+s|0,c+=(l^s^f)+p[0]-358537222|0,c=(c<<11|c>>>21)+l|0,f+=(c^l^s)+p[3]-722521979|0,f=(f<<16|f>>>16)+c|0,s+=(f^c^l)+p[6]+76029189|0,s=(s<<23|s>>>9)+f|0,l+=(s^f^c)+p[9]-640364487|0,l=(l<<4|l>>>28)+s|0,c+=(l^s^f)+p[12]-421815835|0,c=(c<<11|c>>>21)+l|0,f+=(c^l^s)+p[15]+530742520|0,f=(f<<16|f>>>16)+c|0,s+=(f^c^l)+p[2]-995338651|0,s=(s<<23|s>>>9)+f|0,l+=(f^(s|~c))+p[0]-198630844|0,l=(l<<6|l>>>26)+s|0,c+=(s^(l|~f))+p[7]+1126891415|0,c=(c<<10|c>>>22)+l|0,f+=(l^(c|~s))+p[14]-1416354905|0,f=(f<<15|f>>>17)+c|0,s+=(c^(f|~l))+p[5]-57434055|0,s=(s<<21|s>>>11)+f|0,l+=(f^(s|~c))+p[12]+1700485571|0,l=(l<<6|l>>>26)+s|0,c+=(s^(l|~f))+p[3]-1894986606|0,c=(c<<10|c>>>22)+l|0,f+=(l^(c|~s))+p[10]-1051523|0,f=(f<<15|f>>>17)+c|0,s+=(c^(f|~l))+p[1]-2054922799|0,s=(s<<21|s>>>11)+f|0,l+=(f^(s|~c))+p[8]+1873313359|0,l=(l<<6|l>>>26)+s|0,c+=(s^(l|~f))+p[15]-30611744|0,c=(c<<10|c>>>22)+l|0,f+=(l^(c|~s))+p[6]-1560198380|0,f=(f<<15|f>>>17)+c|0,s+=(c^(f|~l))+p[13]+1309151649|0,s=(s<<21|s>>>11)+f|0,l+=(f^(s|~c))+p[4]-145523070|0,l=(l<<6|l>>>26)+s|0,c+=(s^(l|~f))+p[11]-1120210379|0,c=(c<<10|c>>>22)+l|0,f+=(l^(c|~s))+p[2]+718787259|0,f=(f<<15|f>>>17)+c|0,s+=(c^(f|~l))+p[9]-343485551|0,s=(s<<21|s>>>11)+f|0,g[0]=l+g[0]|0,g[1]=s+g[1]|0,g[2]=f+g[2]|0,g[3]=c+g[3]|0}function t(g){var p=[],l;for(l=0;l<64;l+=4)p[l>>2]=g.charCodeAt(l)+(g.charCodeAt(l+1)<<8)+(g.charCodeAt(l+2)<<16)+(g.charCodeAt(l+3)<<24);return p}function u(g){var p=[],l;for(l=0;l<64;l+=4)p[l>>2]=g[l]+(g[l+1]<<8)+(g[l+2]<<16)+(g[l+3]<<24);return p}function d(g){var p=g.length,l=[1732584193,-271733879,-1732584194,271733878],s,f,c,I,L,$;for(s=64;s<=p;s+=64)o(l,t(g.substring(s-64,s)));for(g=g.substring(s-64),f=g.length,c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s=0;s<f;s+=1)c[s>>2]|=g.charCodeAt(s)<<(s%4<<3);if(c[s>>2]|=128<<(s%4<<3),s>55)for(o(l,c),s=0;s<16;s+=1)c[s]=0;return I=p*8,I=I.toString(16).match(/(.*?)(.{0,8})$/),L=parseInt(I[2],16),$=parseInt(I[1],16)||0,c[14]=L,c[15]=$,o(l,c),l}function v(g){var p=g.length,l=[1732584193,-271733879,-1732584194,271733878],s,f,c,I,L,$;for(s=64;s<=p;s+=64)o(l,u(g.subarray(s-64,s)));for(g=s-64<p?g.subarray(s-64):new Uint8Array(0),f=g.length,c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s=0;s<f;s+=1)c[s>>2]|=g[s]<<(s%4<<3);if(c[s>>2]|=128<<(s%4<<3),s>55)for(o(l,c),s=0;s<16;s+=1)c[s]=0;return I=p*8,I=I.toString(16).match(/(.*?)(.{0,8})$/),L=parseInt(I[2],16),$=parseInt(I[1],16)||0,c[14]=L,c[15]=$,o(l,c),l}function i(g){var p="",l;for(l=0;l<4;l+=1)p+=a[g>>l*8+4&15]+a[g>>l*8&15];return p}function h(g){var p;for(p=0;p<g.length;p+=1)g[p]=i(g[p]);return g.join("")}h(d("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function g(p,l){return p=p|0||0,p<0?Math.max(p+l,0):Math.min(p,l)}ArrayBuffer.prototype.slice=function(p,l){var s=this.byteLength,f=g(p,s),c=s,I,L,$,Y;return l!==e&&(c=g(l,s)),f>c?new ArrayBuffer(0):(I=c-f,L=new ArrayBuffer(I),$=new Uint8Array(L),Y=new Uint8Array(this,f,I),$.set(Y),L)}}();function m(g){return/[\u0080-\uFFFF]/.test(g)&&(g=unescape(encodeURIComponent(g))),g}function x(g,p){var l=g.length,s=new ArrayBuffer(l),f=new Uint8Array(s),c;for(c=0;c<l;c+=1)f[c]=g.charCodeAt(c);return p?f:s}function C(g){return String.fromCharCode.apply(null,new Uint8Array(g))}function w(g,p,l){var s=new Uint8Array(g.byteLength+p.byteLength);return s.set(new Uint8Array(g)),s.set(new Uint8Array(p),g.byteLength),l?s:s.buffer}function y(g){var p=[],l=g.length,s;for(s=0;s<l-1;s+=2)p.push(parseInt(g.substr(s,2),16));return String.fromCharCode.apply(String,p)}function b(){this.reset()}return b.prototype.append=function(g){return this.appendBinary(m(g)),this},b.prototype.appendBinary=function(g){this._buff+=g,this._length+=g.length;var p=this._buff.length,l;for(l=64;l<=p;l+=64)o(this._hash,t(this._buff.substring(l-64,l)));return this._buff=this._buff.substring(l-64),this},b.prototype.end=function(g){var p=this._buff,l=p.length,s,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c;for(s=0;s<l;s+=1)f[s>>2]|=p.charCodeAt(s)<<(s%4<<3);return this._finish(f,l),c=h(this._hash),g&&(c=y(c)),this.reset(),c},b.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},b.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},b.prototype.setState=function(g){return this._buff=g.buff,this._length=g.length,this._hash=g.hash,this},b.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},b.prototype._finish=function(g,p){var l=p,s,f,c;if(g[l>>2]|=128<<(l%4<<3),l>55)for(o(this._hash,g),l=0;l<16;l+=1)g[l]=0;s=this._length*8,s=s.toString(16).match(/(.*?)(.{0,8})$/),f=parseInt(s[2],16),c=parseInt(s[1],16)||0,g[14]=f,g[15]=c,o(this._hash,g)},b.hash=function(g,p){return b.hashBinary(m(g),p)},b.hashBinary=function(g,p){var l=d(g),s=h(l);return p?y(s):s},b.ArrayBuffer=function(){this.reset()},b.ArrayBuffer.prototype.append=function(g){var p=w(this._buff.buffer,g,!0),l=p.length,s;for(this._length+=g.byteLength,s=64;s<=l;s+=64)o(this._hash,u(p.subarray(s-64,s)));return this._buff=s-64<l?new Uint8Array(p.buffer.slice(s-64)):new Uint8Array(0),this},b.ArrayBuffer.prototype.end=function(g){var p=this._buff,l=p.length,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],f,c;for(f=0;f<l;f+=1)s[f>>2]|=p[f]<<(f%4<<3);return this._finish(s,l),c=h(this._hash),g&&(c=y(c)),this.reset(),c},b.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},b.ArrayBuffer.prototype.getState=function(){var g=b.prototype.getState.call(this);return g.buff=C(g.buff),g},b.ArrayBuffer.prototype.setState=function(g){return g.buff=x(g.buff,!0),b.prototype.setState.call(this,g)},b.ArrayBuffer.prototype.destroy=b.prototype.destroy,b.ArrayBuffer.prototype._finish=b.prototype._finish,b.ArrayBuffer.hash=function(g,p){var l=v(new Uint8Array(g)),s=h(l);return p?y(s):s},b})})(Ye);var hn=Ye.exports;const dn=Tt(hn);var de=globalThis&&globalThis.__assign||function(){return de=Object.assign||function(r){for(var n,e=1,a=arguments.length;e<a;e++){n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])}return r},de.apply(this,arguments)},pn=globalThis&&globalThis.__awaiter||function(r,n,e,a){function o(t){return t instanceof e?t:new e(function(u){u(t)})}return new(e||(e=Promise))(function(t,u){function d(h){try{i(a.next(h))}catch(m){u(m)}}function v(h){try{i(a.throw(h))}catch(m){u(m)}}function i(h){h.done?t(h.value):o(h.value).then(d,v)}i((a=a.apply(r,n||[])).next())})},gn=globalThis&&globalThis.__generator||function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,o,t,u;return u={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function d(i){return function(h){return v([i,h])}}function v(i){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,o&&(t=i[0]&2?o.return:i[0]?o.throw||((t=o.return)&&t.call(o),0):o.next)&&!(t=t.call(o,i[1])).done)return t;switch(o=0,t&&(i=[i[0]&2,t.value]),i[0]){case 0:case 1:t=i;break;case 4:return e.label++,{value:i[1],done:!1};case 5:e.label++,o=i[1],i=[0];continue;case 7:i=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(i[0]===6||i[0]===2)){e=0;continue}if(i[0]===3&&(!t||i[1]>t[0]&&i[1]<t[3])){e.label=i[1];break}if(i[0]===6&&e.label<t[1]){e.label=t[1],t=i;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(i);break}t[2]&&e.ops.pop(),e.trys.pop();continue}i=n.call(r,e)}catch(h){i=[6,h],o=0}finally{a=t=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},Q=Math.pow(1024,2);function vn(r,n){var e=n*Q;if(e>r.size)e=r.size;else for(;r.size>e*1e4;)e*=2;for(var a=[],o=Math.ceil(r.size/e),t=0;t<o;t++){var u=r.slice(e*t,t===o-1?r.size:e*(t+1));a.push(u)}return a}function mn(r){return Object.keys(r).every(function(n){return n.indexOf("x-qn-meta-")===0})}function bn(r){return Object.keys(r).every(function(n){return n.indexOf("x:")===0})}function yn(r){return r.reduce(function(n,e){return n+e},0)}function _n(r,n,e){try{localStorage.setItem(r,JSON.stringify(n))}catch{e.warn(new A(S.WriteCacheFailed,"setLocalFileInfo failed: "+r))}}function wn(r,n,e){var a=n==null?"_":"_key_"+n+"_";return"qiniu_js_sdk_upload_file_name_"+r+a+"size_"+e}function Ce(r,n){try{localStorage.removeItem(r)}catch{n.warn(new A(S.RemoveCacheFailed,"removeLocalFileInfo failed. key: "+r))}}function xn(r,n){var e=null;try{e=localStorage.getItem(r)}catch{n.warn(new A(S.ReadCacheFailed,"getLocalFileInfo failed. key: "+r))}if(e==null)return null;var a=null;try{a=JSON.parse(e)}catch{Ce(r,n),n.warn(new A(S.InvalidCacheData,"getLocalFileInfo failed to parse. key: "+r))}return a}function be(r){var n="UpToken "+r;return{Authorization:n}}function Cn(r){var n=be(r);return de({"content-type":"application/octet-stream"},n)}function Tn(r){var n=be(r);return de({"content-type":"application/json"},n)}function Je(){if(window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)return new window.ActiveXObject("Microsoft.XMLHTTP");throw new A(S.NotAvailableXMLHttpRequest,"the current environment does not support.")}function kn(r){return pn(this,void 0,void 0,function(){var n,e;return gn(this,function(a){switch(a.label){case 0:return[4,Sn(r)];case 1:return n=a.sent(),e=new dn.ArrayBuffer,e.append(n),[2,e.end()]}})})}function Sn(r){return new Promise(function(n,e){var a=new FileReader;a.onload=function(o){if(o.target){var t=o.target.result;n(t)}else e(new A(S.InvalidProgressEventTarget,"progress event target is undefined"))},a.onerror=function(){e(new A(S.FileReaderReadFailed,"fileReader read failed"))},a.readAsArrayBuffer(r)})}function ue(r,n){return new Promise(function(e,a){var o=Je();if(o.open(n.method,r),n.onCreate&&n.onCreate(o),n.headers){var t=n.headers;Object.keys(t).forEach(function(u){o.setRequestHeader(u,t[u])})}o.upload.addEventListener("progress",function(u){u.lengthComputable&&n.onProgress&&n.onProgress({loaded:u.loaded,total:u.total})}),o.onreadystatechange=function(){var u=o.responseText;if(o.readyState===4){var d=o.getResponseHeader("x-reqId")||"";if(o.status===0){a(new en("network error.",d));return}if(o.status!==200){var v="xhr request failed, code: "+o.status;u&&(v+=" response: "+u);var i=void 0;try{i=JSON.parse(u)}catch{}a(new ie(o.status,d,v,i));return}try{e({data:JSON.parse(u),reqId:d})}catch(h){a(h)}}},o.send(n.body)})}function In(r){if(r&&r.match){var n=r.match(/(^https?)/);if(!n)return"";var e=n[1];return n=r.match(/^https?:\/\/([^:^/]*):(\d*)/),n?n[2]:e==="http"?"80":"443"}return""}function An(r){if(r&&r.match){var n=r.match(/^https?:\/\/([^:^/]*)/);return n?n[1]:""}return""}function Te(r){if(!r)throw new A(S.InvalidToken,"invalid token.");var n=r.split(":");if(n.length===1)throw new A(S.InvalidToken,"invalid token segments.");var e=n.length>3?n[1]:n[0];if(!e)throw new A(S.InvalidToken,"missing assess key field.");var a=null;try{a=JSON.parse(fn(n[n.length-1]))}catch{throw new A(S.InvalidToken,"token parse failed.")}if(a==null)throw new A(S.InvalidToken,"putPolicy is null.");if(a.scope==null)throw new A(S.InvalidToken,"scope field is null.");var o=a.scope.split(":")[0];if(!o)throw new A(S.InvalidToken,"resolve bucketName failed.");return{assessKey:e,bucketName:o,scope:a.scope}}var W,Z={z0:"z0",z1:"z1",z2:"z2",na0:"na0",as0:"as0",cnEast2:"cn-east-2"},zn=(W={},W[Z.z0]={srcUphost:["up.qiniup.com"],cdnUphost:["upload.qiniup.com"]},W[Z.z1]={srcUphost:["up-z1.qiniup.com"],cdnUphost:["upload-z1.qiniup.com"]},W[Z.z2]={srcUphost:["up-z2.qiniup.com"],cdnUphost:["upload-z2.qiniup.com"]},W[Z.na0]={srcUphost:["up-na0.qiniup.com"],cdnUphost:["upload-na0.qiniup.com"]},W[Z.as0]={srcUphost:["up-as0.qiniup.com"],cdnUphost:["upload-as0.qiniup.com"]},W[Z.cnEast2]={srcUphost:["up-cn-east-2.qiniup.com"],cdnUphost:["upload-cn-east-2.qiniup.com"]},W),te=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}},Rn=function(r,n,e,a){return n=n||"&",e=e||"=",r===null&&(r=void 0),typeof r=="object"?Object.keys(r).map(function(o){var t=encodeURIComponent(te(o))+e;return Array.isArray(r[o])?r[o].map(function(u){return t+encodeURIComponent(te(u))}).join(n):t+encodeURIComponent(te(r[o]))}).filter(Boolean).join(n):a?encodeURIComponent(te(a))+e+encodeURIComponent(te(r)):""},Ke;Ke=Rn;var X=globalThis&&globalThis.__assign||function(){return X=Object.assign||function(r){for(var n,e=1,a=arguments.length;e<a;e++){n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])}return r},X.apply(this,arguments)},Un=globalThis&&globalThis.__awaiter||function(r,n,e,a){function o(t){return t instanceof e?t:new e(function(u){u(t)})}return new(e||(e=Promise))(function(t,u){function d(h){try{i(a.next(h))}catch(m){u(m)}}function v(h){try{i(a.throw(h))}catch(m){u(m)}}function i(h){h.done?t(h.value):o(h.value).then(d,v)}i((a=a.apply(r,n||[])).next())})},Pn=globalThis&&globalThis.__generator||function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,o,t,u;return u={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function d(i){return function(h){return v([i,h])}}function v(i){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,o&&(t=i[0]&2?o.return:i[0]?o.throw||((t=o.return)&&t.call(o),0):o.next)&&!(t=t.call(o,i[1])).done)return t;switch(o=0,t&&(i=[i[0]&2,t.value]),i[0]){case 0:case 1:t=i;break;case 4:return e.label++,{value:i[1],done:!1};case 5:e.label++,o=i[1],i=[0];continue;case 7:i=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(i[0]===6||i[0]===2)){e=0;continue}if(i[0]===3&&(!t||i[1]>t[0]&&i[1]<t[3])){e.label=i[1];break}if(i[0]===6&&e.label<t[1]){e.label=t[1],t=i;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(i);break}t[2]&&e.ops.pop(),e.trys.pop();continue}i=n.call(r,e)}catch(h){i=[6,h],o=0}finally{a=t=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}};function On(r,n,e){return Un(this,void 0,void 0,function(){var a,o;return Pn(this,function(t){return a=Ke({ak:r,bucket:n}),o=e+"://api.qiniu.com/v2/query?"+a,[2,ue(o,{method:"GET"})]})})}function Ze(r,n,e){var a=e.url,o=e.id;return a+"/buckets/"+r+"/objects/"+(n!=null?Xe(n):"~")+"/uploads/"+o}function Ln(r,n,e,a){var o=a+"/buckets/"+n+"/objects/"+(e!=null?Xe(e):"~")+"/uploads";return ue(o,{method:"POST",headers:be(r)})}function $n(r,n,e,a,o){var t=Te(r).bucketName,u=Ze(t,n,a)+("/"+e),d=Cn(r);return o.md5&&(d["Content-MD5"]=o.md5),ue(u,X(X({},o),{method:"PUT",headers:d}))}function En(r,n,e,a){var o=Te(r).bucketName,t=Ze(o,n,e);return ue(t,X(X({},a),{method:"POST",headers:Tn(r)}))}function Fn(r,n,e){return ue(r,X({method:"POST",body:n},e))}var pe=globalThis&&globalThis.__assign||function(){return pe=Object.assign||function(r){for(var n,e=1,a=arguments.length;e<a;e++){n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])}return r},pe.apply(this,arguments)},Ue=globalThis&&globalThis.__awaiter||function(r,n,e,a){function o(t){return t instanceof e?t:new e(function(u){u(t)})}return new(e||(e=Promise))(function(t,u){function d(h){try{i(a.next(h))}catch(m){u(m)}}function v(h){try{i(a.throw(h))}catch(m){u(m)}}function i(h){h.done?t(h.value):o(h.value).then(d,v)}i((a=a.apply(r,n||[])).next())})},Pe=globalThis&&globalThis.__generator||function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,o,t,u;return u={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function d(i){return function(h){return v([i,h])}}function v(i){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,o&&(t=i[0]&2?o.return:i[0]?o.throw||((t=o.return)&&t.call(o),0):o.next)&&!(t=t.call(o,i[1])).done)return t;switch(o=0,t&&(i=[i[0]&2,t.value]),i[0]){case 0:case 1:t=i;break;case 4:return e.label++,{value:i[1],done:!1};case 5:e.label++,o=i[1],i=[0];continue;case 7:i=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(i[0]===6||i[0]===2)){e=0;continue}if(i[0]===3&&(!t||i[1]>t[0]&&i[1]<t[3])){e.label=i[1];break}if(i[0]===6&&e.label<t[1]){e.label=t[1],t=i;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(i);break}t[2]&&e.ops.pop(),e.trys.pop();continue}i=n.call(r,e)}catch(h){i=[6,h],o=0}finally{a=t=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},Bn=globalThis&&globalThis.__read||function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var a=e.call(r),o,t=[],u;try{for(;(n===void 0||n-- >0)&&!(o=a.next()).done;)t.push(o.value)}catch(d){u={error:d}}finally{try{o&&!o.done&&(e=a.return)&&e.call(a)}finally{if(u)throw u.error}}return t},Hn=globalThis&&globalThis.__spread||function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Bn(arguments[n]));return r},Mn=4,Qe=[0,502,503,504,599],Dn=Hn(Qe,[612]),qn=Math.pow(1024,3),et=function(){function r(n,e,a,o){this.hostPool=a,this.logger=o,this.aborted=!1,this.retryCount=0,this.xhrList=[],this.config=n.config,o.info("config inited.",this.config),this.putExtra=pe({fname:""},n.putExtra),o.info("putExtra inited.",this.putExtra),this.key=n.key,this.file=n.file,this.token=n.token,this.onData=e.onData,this.onError=e.onError,this.onComplete=e.onComplete;try{var t=Te(this.token);this.bucketName=t.bucketName,this.assessKey=t.assessKey}catch(u){o.error("get putPolicy from token failed.",u),this.onError(u)}}return r.prototype.checkAndUpdateUploadHost=function(){return Ue(this,void 0,void 0,function(){var n;return Pe(this,function(e){switch(e.label){case 0:return this.logger.info("get available upload host."),[4,this.hostPool.getUp(this.assessKey,this.bucketName,this.config.upprotocol)];case 1:if(n=e.sent(),n==null)throw new A(S.NotAvailableUploadHost,"no available upload host.");return this.uploadHost!=null&&this.uploadHost.host!==n.host?this.logger.warn("host switches from "+this.uploadHost.host+" to "+n.host+"."):this.logger.info("use host "+n.host+"."),this.uploadHost=n,[2]}})})},r.prototype.checkAndUnfreezeHost=function(){this.logger.info("check unfreeze host."),this.uploadHost!=null&&this.uploadHost.isFrozen()&&(this.logger.warn(this.uploadHost.host+" will be unfrozen."),this.uploadHost.unfreeze())},r.prototype.checkAndFreezeHost=function(n){this.logger.info("check freeze host."),n instanceof ie&&this.uploadHost!=null&&Qe.includes(n.code)&&(this.logger.warn(this.uploadHost.host+" will be temporarily frozen."),this.uploadHost.freeze())},r.prototype.handleError=function(n){this.logger.error(n.message),this.onError(n)},r.prototype.putFile=function(){return Ue(this,void 0,void 0,function(){var n,e,a,o;return Pe(this,function(t){switch(t.label){case 0:if(this.aborted=!1,this.putExtra.fname||(this.logger.info("use file.name as fname."),this.putExtra.fname=this.file.name),this.file.size>1e4*qn)return this.handleError(new A(S.InvalidFile,"file size exceed maximum value 10000G")),[2];if(this.putExtra.customVars&&!bn(this.putExtra.customVars))return this.handleError(new A(S.InvalidCustomVars,"customVars key should start width x:")),[2];if(this.putExtra.metadata&&!mn(this.putExtra.metadata))return this.handleError(new A(S.InvalidMetadata,"metadata key should start with x-qn-meta-")),[2];t.label=1;case 1:return t.trys.push([1,4,,5]),this.uploadAt=new Date().getTime(),[4,this.checkAndUpdateUploadHost()];case 2:return t.sent(),[4,this.run()];case 3:return n=t.sent(),this.onComplete(n.data),this.checkAndUnfreezeHost(),this.sendLog(n.reqId,200),[2];case 4:return e=t.sent(),this.aborted?(this.logger.warn("upload is aborted."),this.sendLog("",-2),[2]):(this.clear(),this.logger.error(e),e instanceof ie&&(this.sendLog(e.reqId,e.code),this.checkAndFreezeHost(e),a=++this.retryCount<=this.config.retryCount,o=Dn.includes(e.code),o&&a)?(this.logger.warn("error auto retry: "+this.retryCount+"/"+this.config.retryCount+"."),this.putFile(),[2]):(this.onError(e),[3,5]));case 5:return[2]}})})},r.prototype.clear=function(){this.xhrList.forEach(function(n){n.onreadystatechange=null,n.abort()}),this.xhrList=[],this.logger.info("cleanup uploading xhr.")},r.prototype.stop=function(){this.logger.info("aborted."),this.clear(),this.aborted=!0},r.prototype.addXhr=function(n){this.xhrList.push(n)},r.prototype.sendLog=function(n,e){var a,o;this.logger.report({code:e,reqId:n,remoteIp:"",upType:"jssdk-h5",size:this.file.size,time:Math.floor(this.uploadAt/1e3),port:In((a=this.uploadHost)===null||a===void 0?void 0:a.getUrl()),host:An((o=this.uploadHost)===null||o===void 0?void 0:o.getUrl()),bytesSent:this.progress?this.progress.total.loaded:0,duration:Math.floor((new Date().getTime()-this.uploadAt)/1e3)})},r.prototype.getProgressInfoItem=function(n,e,a){return pe({size:e,loaded:n,percent:n/e*100},a==null?{}:{fromCache:a})},r}(),jn=globalThis&&globalThis.__extends||function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,o){a.__proto__=o}||function(a,o){for(var t in o)o.hasOwnProperty(t)&&(a[t]=o[t])},r(n,e)};return function(n,e){r(n,e);function a(){this.constructor=n}n.prototype=e===null?Object.create(e):(a.prototype=e.prototype,new a)}}(),ae=globalThis&&globalThis.__assign||function(){return ae=Object.assign||function(r){for(var n,e=1,a=arguments.length;e<a;e++){n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])}return r},ae.apply(this,arguments)},ne=globalThis&&globalThis.__awaiter||function(r,n,e,a){function o(t){return t instanceof e?t:new e(function(u){u(t)})}return new(e||(e=Promise))(function(t,u){function d(h){try{i(a.next(h))}catch(m){u(m)}}function v(h){try{i(a.throw(h))}catch(m){u(m)}}function i(h){h.done?t(h.value):o(h.value).then(d,v)}i((a=a.apply(r,n||[])).next())})},re=globalThis&&globalThis.__generator||function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,o,t,u;return u={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function d(i){return function(h){return v([i,h])}}function v(i){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,o&&(t=i[0]&2?o.return:i[0]?o.throw||((t=o.return)&&t.call(o),0):o.next)&&!(t=t.call(o,i[1])).done)return t;switch(o=0,t&&(i=[i[0]&2,t.value]),i[0]){case 0:case 1:t=i;break;case 4:return e.label++,{value:i[1],done:!1};case 5:e.label++,o=i[1],i=[0];continue;case 7:i=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(i[0]===6||i[0]===2)){e=0;continue}if(i[0]===3&&(!t||i[1]>t[0]&&i[1]<t[3])){e.label=i[1];break}if(i[0]===6&&e.label<t[1]){e.label=t[1],t=i;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(i);break}t[2]&&e.ops.pop(),e.trys.pop();continue}i=n.call(r,e)}catch(h){i=[6,h],o=0}finally{a=t=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}};function Nn(r){var n=/^[1-9]\d*$/;return n.test(String(r))}var Vn=function(r){jn(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}return n.prototype.run=function(){return ne(this,void 0,void 0,function(){var e,a,o,t,u,d=this;return re(this,function(v){switch(v.label){case 0:if(this.logger.info("start run Resume."),!this.config.chunkSize||!Nn(this.config.chunkSize))throw new A(S.InvalidChunkSize,"chunkSize must be a positive integer");if(this.config.chunkSize>1024)throw new A(S.InvalidChunkSize,"chunkSize maximum value is 1024");return[4,this.initBeforeUploadChunks()];case 1:v.sent(),e=new tn(function(i){return ne(d,void 0,void 0,function(){return re(this,function(h){switch(h.label){case 0:if(this.aborted)throw e.abort(),new Error("pool is aborted");return[4,this.uploadChunk(i)];case 1:return h.sent(),[2]}})})},this.config.concurrentRequestLimit),a=null,o=this.getLocalKey(),t=this.chunks.map(function(i,h){return e.enqueue({chunk:i,index:h})}),v.label=2;case 2:return v.trys.push([2,5,,6]),[4,Promise.all(t)];case 3:return v.sent(),[4,this.mkFileReq()];case 4:return a=v.sent(),[3,6];case 5:throw u=v.sent(),u instanceof ie&&(u.code===612||u.code===400)&&Ce(o,this.logger),u;case 6:return Ce(o,this.logger),[2,a]}})})},n.prototype.uploadChunk=function(e){return ne(this,void 0,void 0,function(){var a,o,t,u,d,v,i,h,m,x=this;return re(this,function(C){switch(C.label){case 0:return a=e.index,o=e.chunk,t=this.cachedUploadedList[a],this.logger.info("upload part "+a+", cache:",t),u=this.config.checkByMD5,d=function(){x.usedCacheList[a]=!0,x.updateChunkProgress(o.size,a),x.uploadedList[a]=t,x.updateLocalCache()},t&&!u?(d(),[2]):[4,kn(o)];case 1:return v=C.sent(),this.logger.info("computed part md5.",v),t&&v===t.md5?(d(),[2]):(this.usedCacheList[a]=!1,i=function(w){x.updateChunkProgress(w.loaded,a)},h={body:o,md5:this.config.checkByServer?v:void 0,onProgress:i,onCreate:function(w){return x.addXhr(w)}},this.logger.info("part "+a+" start uploading."),[4,$n(this.token,this.key,e.index+1,this.getUploadInfo(),h)]);case 2:return m=C.sent(),this.logger.info("part "+a+" upload completed."),i({loaded:o.size,total:o.size}),this.uploadedList[a]={etag:m.data.etag,md5:m.data.md5,size:o.size},this.updateLocalCache(),[2]}})})},n.prototype.mkFileReq=function(){return ne(this,void 0,void 0,function(){var e,a,o=this;return re(this,function(t){switch(t.label){case 0:return e=ae(ae(ae({parts:this.uploadedList.map(function(u,d){return{etag:u.etag,partNumber:d+1}}),fname:this.putExtra.fname},this.putExtra.mimeType&&{mimeType:this.putExtra.mimeType}),this.putExtra.customVars&&{customVars:this.putExtra.customVars}),this.putExtra.metadata&&{metadata:this.putExtra.metadata}),this.logger.info("parts upload completed, make file.",e),[4,En(this.token,this.key,this.getUploadInfo(),{onCreate:function(u){return o.addXhr(u)},body:JSON.stringify(e)})];case 1:return a=t.sent(),this.logger.info("finish Resume Progress."),this.updateMkFileProgress(1),[2,a]}})})},n.prototype.initBeforeUploadChunks=function(){return ne(this,void 0,void 0,function(){var e,a,o;return re(this,function(t){switch(t.label){case 0:return this.uploadedList=[],this.usedCacheList=[],e=xn(this.getLocalKey(),this.logger),e?[3,2]:(this.logger.info("init upload parts from api."),[4,Ln(this.token,this.bucketName,this.key,this.uploadHost.getUrl())]);case 1:return a=t.sent(),this.logger.info("initd upload parts of id: "+a.data.uploadId+"."),this.uploadId=a.data.uploadId,this.cachedUploadedList=[],[3,3];case 2:o=["resume upload parts from local cache,","total "+e.data.length+" part,","id is "+e.id+"."],this.logger.info(o.join(" ")),this.cachedUploadedList=e.data,this.uploadId=e.id,t.label=3;case 3:return this.chunks=vn(this.file,this.config.chunkSize),this.loaded={mkFileProgress:0,chunks:this.chunks.map(function(u){return 0})},this.notifyResumeProgress(),[2]}})})},n.prototype.getUploadInfo=function(){return{id:this.uploadId,url:this.uploadHost.getUrl()}},n.prototype.getLocalKey=function(){return wn(this.file.name,this.key,this.file.size)},n.prototype.updateLocalCache=function(){_n(this.getLocalKey(),{id:this.uploadId,data:this.uploadedList},this.logger)},n.prototype.updateChunkProgress=function(e,a){this.loaded.chunks[a]=e,this.notifyResumeProgress()},n.prototype.updateMkFileProgress=function(e){this.loaded.mkFileProgress=e,this.notifyResumeProgress()},n.prototype.notifyResumeProgress=function(){var e=this;this.progress={total:this.getProgressInfoItem(yn(this.loaded.chunks)+this.loaded.mkFileProgress,this.file.size+1),chunks:this.chunks.map(function(a,o){var t=e.usedCacheList[o];return e.getProgressInfoItem(e.loaded.chunks[o],a.size,t)}),uploadInfo:{id:this.uploadId,url:this.uploadHost.getUrl()}},this.onData(this.progress)},n}(et),Oe=globalThis&&globalThis.__awaiter||function(r,n,e,a){function o(t){return t instanceof e?t:new e(function(u){u(t)})}return new(e||(e=Promise))(function(t,u){function d(h){try{i(a.next(h))}catch(m){u(m)}}function v(h){try{i(a.throw(h))}catch(m){u(m)}}function i(h){h.done?t(h.value):o(h.value).then(d,v)}i((a=a.apply(r,n||[])).next())})},Le=globalThis&&globalThis.__generator||function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,o,t,u;return u={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function d(i){return function(h){return v([i,h])}}function v(i){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,o&&(t=i[0]&2?o.return:i[0]?o.throw||((t=o.return)&&t.call(o),0):o.next)&&!(t=t.call(o,i[1])).done)return t;switch(o=0,t&&(i=[i[0]&2,t.value]),i[0]){case 0:case 1:t=i;break;case 4:return e.label++,{value:i[1],done:!1};case 5:e.label++,o=i[1],i=[0];continue;case 7:i=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(i[0]===6||i[0]===2)){e=0;continue}if(i[0]===3&&(!t||i[1]>t[0]&&i[1]<t[3])){e.label=i[1];break}if(i[0]===6&&e.label<t[1]){e.label=t[1],t=i;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(i);break}t[2]&&e.ops.pop(),e.trys.pop();continue}i=n.call(r,e)}catch(h){i=[6,h],o=0}finally{a=t=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},Wn=function(){function r(){this.crc=-1,this.table=this.makeTable()}return r.prototype.makeTable=function(){for(var n=new Array,e=0;e<256;e++){for(var a=e,o=0;o<8;o++)a&1?a=a>>>1^3988292384:a>>>=1;n[e]=a}return n},r.prototype.append=function(n){for(var e=this.crc,a=0;a<n.byteLength;a++)e=e>>>8^this.table[(e^n[a])&255];this.crc=e},r.prototype.compute=function(){return(this.crc^-1)>>>0},r.prototype.readAsUint8Array=function(n){return Oe(this,void 0,void 0,function(){var e;return Le(this,function(a){switch(a.label){case 0:return typeof n.arrayBuffer!="function"?[3,2]:(e=Uint8Array.bind,[4,n.arrayBuffer()]);case 1:return[2,new(e.apply(Uint8Array,[void 0,a.sent()]))];case 2:return[2,new Promise(function(o,t){var u=new FileReader;u.onload=function(){if(u.result==null){t();return}if(typeof u.result=="string"){t();return}o(new Uint8Array(u.result))},u.readAsArrayBuffer(n)})]}})})},r.prototype.file=function(n){return Oe(this,void 0,void 0,function(){var e,a,o,t,u,d;return Le(this,function(v){switch(v.label){case 0:return n.size<=Q?(e=this.append,[4,this.readAsUint8Array(n)]):[3,2];case 1:return e.apply(this,[v.sent()]),[2,this.compute()];case 2:a=Math.ceil(n.size/Q),o=0,v.label=3;case 3:return o<a?(t=o*Q,u=o===a-1?n.size:t+Q,[4,this.readAsUint8Array(n.slice(t,u))]):[3,6];case 4:d=v.sent(),this.append(new Uint8Array(d)),v.label=5;case 5:return o++,[3,3];case 6:return[2,this.compute()]}})})},r.file=function(n){var e=new r;return e.file(n)},r}(),Gn=globalThis&&globalThis.__extends||function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,o){a.__proto__=o}||function(a,o){for(var t in o)o.hasOwnProperty(t)&&(a[t]=o[t])},r(n,e)};return function(n,e){r(n,e);function a(){this.constructor=n}n.prototype=e===null?Object.create(e):(a.prototype=e.prototype,new a)}}(),Xn=globalThis&&globalThis.__awaiter||function(r,n,e,a){function o(t){return t instanceof e?t:new e(function(u){u(t)})}return new(e||(e=Promise))(function(t,u){function d(h){try{i(a.next(h))}catch(m){u(m)}}function v(h){try{i(a.throw(h))}catch(m){u(m)}}function i(h){h.done?t(h.value):o(h.value).then(d,v)}i((a=a.apply(r,n||[])).next())})},Yn=globalThis&&globalThis.__generator||function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,o,t,u;return u={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function d(i){return function(h){return v([i,h])}}function v(i){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,o&&(t=i[0]&2?o.return:i[0]?o.throw||((t=o.return)&&t.call(o),0):o.next)&&!(t=t.call(o,i[1])).done)return t;switch(o=0,t&&(i=[i[0]&2,t.value]),i[0]){case 0:case 1:t=i;break;case 4:return e.label++,{value:i[1],done:!1};case 5:e.label++,o=i[1],i=[0];continue;case 7:i=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(i[0]===6||i[0]===2)){e=0;continue}if(i[0]===3&&(!t||i[1]>t[0]&&i[1]<t[3])){e.label=i[1];break}if(i[0]===6&&e.label<t[1]){e.label=t[1],t=i;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(i);break}t[2]&&e.ops.pop(),e.trys.pop();continue}i=n.call(r,e)}catch(h){i=[6,h],o=0}finally{a=t=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},$e=function(r){Gn(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}return n.prototype.run=function(){return Xn(this,void 0,void 0,function(){var e,a,o,t,u=this;return Yn(this,function(d){switch(d.label){case 0:return this.logger.info("start run Direct."),e=new FormData,e.append("file",this.file),e.append("token",this.token),this.key!=null&&e.append("key",this.key),e.append("fname",this.putExtra.fname),this.config.checkByServer?[4,Wn.file(this.file)]:[3,2];case 1:a=d.sent(),e.append("crc32",a.toString()),d.label=2;case 2:return this.putExtra.customVars&&(this.logger.info("init customVars."),o=this.putExtra.customVars,Object.keys(o).forEach(function(v){return e.append(v,o[v].toString())}),this.logger.info("customVars inited.")),this.logger.info("formData inited."),[4,Fn(this.uploadHost.getUrl(),e,{onProgress:function(v){u.updateDirectProgress(v.loaded,v.total)},onCreate:function(v){return u.addXhr(v)}})];case 3:return t=d.sent(),this.logger.info("Direct progress finish."),this.finishDirectProgress(),[2,t]}})})},n.prototype.updateDirectProgress=function(e,a){this.progress={total:this.getProgressInfoItem(e,a+1)},this.onData(this.progress)},n.prototype.finishDirectProgress=function(){if(!this.progress){this.logger.warn("progress is null."),this.progress={total:this.getProgressInfoItem(this.file.size,this.file.size)},this.onData(this.progress);return}var e=this.progress.total;this.progress={total:this.getProgressInfoItem(e.loaded+1,e.size)},this.onData(this.progress)},n}(et);function tt(r,n,e){e===void 0&&(e=3);var a=Je();a.open("POST","https://uplog.qbox.me/log/3"),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.setRequestHeader("Authorization",be(r).Authorization),a.onreadystatechange=function(){a.readyState===4&&a.status!==200&&e>0&&tt(r,n,e-1)};var o=[n.code||"",n.reqId||"",n.host||"",n.remoteIp||"",n.port||"",n.duration||"",n.time||"",n.bytesSent||"",n.upType||"",n.size||""].join(",");a.send(o)}var Jn=globalThis&&globalThis.__read||function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var a=e.call(r),o,t=[],u;try{for(;(n===void 0||n-- >0)&&!(o=a.next()).done;)t.push(o.value)}catch(d){u={error:d}}finally{try{o&&!o.done&&(e=a.return)&&e.call(a)}finally{if(u)throw u.error}}return t},_e=globalThis&&globalThis.__spread||function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Jn(arguments[n]));return r},Kn=function(){function r(n,e,a,o){e===void 0&&(e=!0),a===void 0&&(a="OFF"),o===void 0&&(o="UPLOAD"),this.token=n,this.disableReport=e,this.level=a,this.prefix=o,this.id=++r.id}return r.prototype.getPrintPrefix=function(n){return"Qiniu-JS-SDK ["+n+"]["+this.prefix+"#"+this.id+"]:"},r.prototype.report=function(n,e){if(!this.disableReport)try{tt(this.token,n,e)}catch(a){this.warn(a)}},r.prototype.info=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var a=["INFO"];a.includes(this.level)&&console.log.apply(console,_e([this.getPrintPrefix("INFO")],n))},r.prototype.warn=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var a=["INFO","WARN"];a.includes(this.level)&&console.warn.apply(console,_e([this.getPrintPrefix("WARN")],n))},r.prototype.error=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var a=["INFO","WARN","ERROR"];a.includes(this.level)&&console.error.apply(console,_e([this.getPrintPrefix("ERROR")],n))},r.id=0,r}(),Ee=globalThis&&globalThis.__awaiter||function(r,n,e,a){function o(t){return t instanceof e?t:new e(function(u){u(t)})}return new(e||(e=Promise))(function(t,u){function d(h){try{i(a.next(h))}catch(m){u(m)}}function v(h){try{i(a.throw(h))}catch(m){u(m)}}function i(h){h.done?t(h.value):o(h.value).then(d,v)}i((a=a.apply(r,n||[])).next())})},Fe=globalThis&&globalThis.__generator||function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,o,t,u;return u={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function d(i){return function(h){return v([i,h])}}function v(i){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,o&&(t=i[0]&2?o.return:i[0]?o.throw||((t=o.return)&&t.call(o),0):o.next)&&!(t=t.call(o,i[1])).done)return t;switch(o=0,t&&(i=[i[0]&2,t.value]),i[0]){case 0:case 1:t=i;break;case 4:return e.label++,{value:i[1],done:!1};case 5:e.label++,o=i[1],i=[0];continue;case 7:i=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(i[0]===6||i[0]===2)){e=0;continue}if(i[0]===3&&(!t||i[1]>t[0]&&i[1]<t[3])){e.label=i[1];break}if(i[0]===6&&e.label<t[1]){e.label=t[1],t=i;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(i);break}t[2]&&e.ops.pop(),e.trys.pop();continue}i=n.call(r,e)}catch(h){i=[6,h],o=0}finally{a=t=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},Zn=globalThis&&globalThis.__read||function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var a=e.call(r),o,t=[],u;try{for(;(n===void 0||n-- >0)&&!(o=a.next()).done;)t.push(o.value)}catch(d){u={error:d}}finally{try{o&&!o.done&&(e=a.return)&&e.call(a)}finally{if(u)throw u.error}}return t},Qn=globalThis&&globalThis.__spread||function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Zn(arguments[n]));return r},fe=new Map,er=function(){function r(n,e){this.host=n,this.protocol=e}return r.prototype.isFrozen=function(){var n=new Date().getTime(),e=fe.get(this.host);return e!=null&&e>=n},r.prototype.freeze=function(n){n===void 0&&(n=20);var e=new Date().getTime()+n*1e3;fe.set(this.host,e)},r.prototype.unfreeze=function(){fe.delete(this.host)},r.prototype.getUrl=function(){return this.protocol+"://"+this.host},r.prototype.getUnfreezeTime=function(){return fe.get(this.host)},r}(),tr=function(){function r(n){n===void 0&&(n=[]),this.initHosts=n,this.cachedHostsMap=new Map}return r.prototype.register=function(n,e,a,o){this.cachedHostsMap.set(n+"@"+e,a.map(function(t){return new er(t,o)}))},r.prototype.refresh=function(n,e,a){var o,t,u,d;return Ee(this,void 0,void 0,function(){var v,i,h;return Fe(this,function(m){switch(m.label){case 0:return v=this.cachedHostsMap.get(n+"@"+e)||[],v.length>0?[2]:this.initHosts.length>0?(this.register(n,e,this.initHosts,a),[2]):[4,On(n,e,a)];case 1:return i=m.sent(),(i==null?void 0:i.data)!=null&&(h=Qn(((t=(o=i.data.up)===null||o===void 0?void 0:o.acc)===null||t===void 0?void 0:t.main)||[],((d=(u=i.data.up)===null||u===void 0?void 0:u.acc)===null||d===void 0?void 0:d.backup)||[]),this.register(n,e,h,a)),[2]}})})},r.prototype.getUp=function(n,e,a){return Ee(this,void 0,void 0,function(){var o,t,u;return Fe(this,function(d){switch(d.label){case 0:return[4,this.refresh(n,e,a)];case 1:return d.sent(),o=this.cachedHostsMap.get(n+"@"+e)||[],o.length===0?[2,null]:(t=o.filter(function(v){return!v.isFrozen()}),t.length>0?[2,t[0]]:(u=o.slice().sort(function(v,i){return(v.getUnfreezeTime()||0)-(i.getUnfreezeTime()||0)}),[2,u[0]]))}})})},r}();function nr(r,n,e,a){return r.config&&r.config.forceDirect?(a.info("ues forceDirect mode."),new $e(r,n,e,a)):r.file.size>4*Q?(a.info("file size over 4M, use Resume."),new Vn(r,n,e,a)):(a.info("file size less or equal than 4M, use Direct."),new $e(r,n,e,a))}function rr(r,n,e,a,o){var t=new Kn(e,o==null?void 0:o.disableStatisticsReport,o==null?void 0:o.debugLogLevel,r.name),u={file:r,key:n,token:e,putExtra:a,config:ir(o,t)},d=new tr(u.config.uphost);return new an(function(v){var i=nr(u,{onData:function(h){return v.next(h)},onError:function(h){return v.error(h)},onComplete:function(h){return v.complete(h)}},d,t);return i.putFile(),i.stop.bind(i)})}var ee=globalThis&&globalThis.__assign||function(){return ee=Object.assign||function(r){for(var n,e=1,a=arguments.length;e<a;e++){n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])}return r},ee.apply(this,arguments)},or=globalThis&&globalThis.__rest||function(r,n){var e={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&n.indexOf(a)<0&&(e[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(r);o<a.length;o++)n.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(r,a[o])&&(e[a[o]]=r[a[o]]);return e},ar=globalThis&&globalThis.__read||function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var a=e.call(r),o,t=[],u;try{for(;(n===void 0||n-- >0)&&!(o=a.next()).done;)t.push(o.value)}catch(d){u={error:d}}finally{try{o&&!o.done&&(e=a.return)&&e.call(a)}finally{if(u)throw u.error}}return t},we=globalThis&&globalThis.__spread||function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(ar(arguments[n]));return r};function ir(r,n){var e=ee({},r),a=e.upprotocol,o=e.uphost,t=or(e,["upprotocol","uphost"]),u=ee({uphost:[],retryCount:3,checkByMD5:!1,forceDirect:!1,useCdnDomain:!0,checkByServer:!1,concurrentRequestLimit:3,chunkSize:Mn,upprotocol:"https",debugLogLevel:"OFF",disableStatisticsReport:!1},t);a&&(u.upprotocol=a.replace(/:$/,""));var d=[];if(n&&(r==null?void 0:r.uphost)!=null&&(r==null?void 0:r.region)!=null&&n.warn("do not use both the uphost and region config."),o)Array.isArray(o)?d.push.apply(d,we(o)):d.push(o);else if(u!=null&&u.region){var v=zn[u==null?void 0:u.region];u.useCdnDomain?d.push.apply(d,we(v.cdnUphost)):d.push.apply(d,we(v.srcUphost))}return ee(ee({},u),{uphost:d.filter(Boolean)})}var Be=globalThis&&globalThis.__assign||function(){return Be=Object.assign||function(r){for(var n,e=1,a=arguments.length;e<a;e++){n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])}return r},Be.apply(this,arguments)};globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var He={PNG:"image/png",JPEG:"image/jpeg",WEBP:"image/webp",BMP:"image/bmp"};Object.keys(He).map(function(r){return He[r]});const sr=async r=>{const{data:n}=await kt({T_suffix:r});return n.Data},lr={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},ur=me("path",{d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),cr=me("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),fr=me("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),hr=me("path",{d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26z",fill:"currentColor"},null,-1),dr=[ur,cr,fr,hr],pr=se({name:"InformationCircleOutline",render:function(n,e){return P(),he("svg",lr,dr)}}),gr={key:5,style:{display:"flex",flex:"1","align-items":"center"}},zr={__name:"FormList",props:{formList:{type:Array,default:()=>[]}},setup(r){const n=r,e=St(),a=window.sessionStorage.getItem("task")?JSON.parse(window.sessionStorage.getItem("task")):{},o=Ie({pdf:""});o.formList=j(()=>n.formList);const t=Ie({T_source:2,T_task_id:a.T_task_id,T_VerifyTemplate_id:a.T_VerifyTemplate_id}),u=q([]),d=y=>{console.log("cad",o.formList),o.formList[y].T_value="",o.formList[y].T_value=`http://coldverifylocal.coldbaozhida.com/CAD/download?type=upload&filename=${t.T_task_id}_${t.T_VerifyTemplate_id}_${o.formList[y].T_id}.png&xxx=${Math.random()}`},v=y=>{window.open(`http://coldverifylocal.coldbaozhida.com/CAD2/?task_id=${t.T_task_id}&vt_id=${t.T_VerifyTemplate_id}&key_id=${y.T_id}`)},i=y=>{window.open(`http://coldverifylocal.coldbaozhida.com/CAD/?task_id=${t.T_task_id}&vt_id=${t.T_VerifyTemplate_id}&key_id=${y.T_id}`)},h=y=>{},m=async({file:y},b)=>{const g=await sr(y.name.split(".")[1]);rr(y.file,y.name,g,{},{useCdnDomain:!0}).subscribe({next:l=>{console.warn(l)},error:()=>{e.error("上传失败")},complete:l=>{o.formList[b].T_value=l.key}})},x=y=>{n.formList[y].T_value.length==u.value.length?n.formList[y].T_value=[]:n.formList[y].T_value=u.value.map(b=>b.T_sn)},C=y=>{let b=u.value.map(g=>g.T_sn);n.formList[y].T_value=n.formList[y].T_value.concat(b).filter((g,p,l)=>l.indexOf(g)===l.lastIndexOf(g))};return(async()=>{try{const{data:y}=await Ot({T_class:a.T_class});console.log("******",y),u.value=y.Data.List||[]}catch(y){console.log(y)}})(),(y,b)=>{const g=Ht,p=At,l=Lt,s=$t,f=Et,c=Mt,I=zt,L=Rt,$=Ut,Y=Ft,ye=Bt,E=Pt;return P(),B(E,{"label-width":"auto"},{default:z(()=>[R(ye,{cols:12,"x-gap":12},{default:z(()=>[(P(!0),he(Ae,null,It(r.formList,(_,J)=>(P(),B(Y,{key:_.T_VerifyTemplateMap_id,span:4,label:_.T_name},{default:z(()=>[_.T_label===3?(P(),B(p,{key:0,value:_.T_value,"onUpdate:value":k=>_.T_value=k,multiple:"","label-field":"T_id","value-field":"T_sn","max-tag-count":"responsive",options:D(u)},{action:z(()=>[R(g,null,{default:z(()=>[R(D(ce),{disabled:D(u).length==0,class:"underline",text:"",onClick:k=>x(J)},{default:z(()=>[G(ze(_.T_value.length==D(u).length?"取消":"全选"),1)]),_:2},1032,["disabled","onClick"]),R(D(ce),{disabled:D(u).length==0,class:"underline",text:"",onClick:k=>C(J)},{default:z(()=>[G("反选")]),_:2},1032,["disabled","onClick"])]),_:2},1024)]),_:2},1032,["value","onUpdate:value","options"])):_.T_label===4?(P(),B(p,{key:1,value:_.T_value,"onUpdate:value":k=>_.T_value=k,"label-field":"T_id","value-field":"T_sn",options:D(u)},null,8,["value","onUpdate:value","options"])):_.T_label===7?(P(),B(l,{key:2,"formatted-value":_.T_value,"onUpdate:formattedValue":[k=>_.T_value=k,k=>_.T_value=k],type:"datetime",format:"yyyy-MM-dd HH:mm",datetime:"",clearable:"",class:"w-full"},null,8,["formatted-value","onUpdate:formattedValue"])):_.T_label===9?(P(),B(l,{key:3,"formatted-value":_.T_value,"onUpdate:formattedValue":k=>_.T_value=k,type:"datetimerange",format:"yyyy-MM-dd HH:mm",clearable:"",class:"w-full"},null,8,["formatted-value","onUpdate:formattedValue"])):_.T_label===10?(P(),he(Ae,{key:4},[R(s,{class:"mr-5",width:"100",src:_.T_value},null,8,["src"]),R(f,{"list-type":"image-card",onChange:k=>m(k,J),"default-upload":!1,max:1},{default:z(()=>[G(" 点击上传 ")]),_:2},1032,["onChange"])],64)):_.T_label===11?(P(),he("div",gr,[R(s,{class:"mr-5",width:"100",src:_.T_value},null,8,["src"]),R(g,{class:"mr-5"},{default:z(()=>[R(c,{"positive-text":"新版","negative-text":"旧版",onPositiveClick:k=>v(_),onNegativeClick:k=>i(_)},{trigger:z(()=>[R(D(ce),{onClick:()=>h(_)},{default:z(()=>[G("编辑")]),_:2},1032,["onClick"])]),default:z(()=>[G(" 请选择CAD新版/旧版 ")]),_:2},1032,["onPositiveClick","onNegativeClick"]),R(D(ce),{onClick:()=>d(J)},{default:z(()=>[G("刷新")]),_:2},1032,["onClick"])]),_:2},1024)])):_.T_label===12?(P(),B(g,{key:6,vertical:"",class:"w-full"},{default:z(()=>[R(l,{"formatted-value":_.T_value[0],"onUpdate:formattedValue":k=>_.T_value[0]=k,format:"yyyy-MM-dd HH:mm","time-picker-props":{format:"HH:mm"},type:"datetime",clearable:""},null,8,["formatted-value","onUpdate:formattedValue"]),R(I,{value:_.T_value[1],"onUpdate:value":k=>_.T_value[1]=k,type:"text"},null,8,["value","onUpdate:value"])]),_:2},1024)):_.T_label===13?(P(),B(g,{key:7,vertical:"",class:"w-full"},{default:z(()=>[R(l,{"formatted-value":_.T_value[0],"onUpdate:formattedValue":k=>_.T_value[0]=k,format:"yyyy-MM-dd HH:mm",type:"datetimerange",clearable:""},null,8,["formatted-value","onUpdate:formattedValue"]),R(I,{value:_.T_value[1],"onUpdate:value":k=>_.T_value[1]=k,type:"text"},null,8,["value","onUpdate:value"])]),_:2},1024)):(P(),B(I,{key:8,value:_.T_value,"onUpdate:value":k=>_.T_value=k,type:"text"},null,8,["value","onUpdate:value"])),_.T_label===10||_.T_label===11?(P(),B(s,{key:9,width:"100",src:_.T_text,style:{"margin-right":"36px"}},null,8,["src"])):(P(),B($,{key:10,trigger:"hover"},{trigger:z(()=>[R(L,{size:"24",class:"ml-3"},{default:z(()=>[R(D(pr))]),_:1})]),default:z(()=>[G(" "+ze(_.T_text),1)]),_:2},1024))]),_:2},1032,["label"]))),128))]),_:1})]),_:1})}}};export{Ar as T,zr as _,xr as a,Tr as b,Ir as c,Cr as d,kr as e,Sr as f,sr as g,rr as u};
|