import{d as ae,b as D,z as q,I as Fe,A as xe,a8 as be,h as k,R as U,az as tt,Q as P,aA as nt,W as H,S as E,U as rt,aB as Be,aC as ot,$ as He,aD as at,aE as j,a0 as N,aF as it,T as Me,X as he,ab as De,aG as st,a2 as B,Z as qe,aH as lt,aI as ut,af as je,ag as ct,aJ as ft,aK as ht,aL as dt,aM as pt,ad as gt,aN as Ce,aO as vt,au as mt,aP as bt,aQ as yt,aR as _t,aS as wt,ak as de,aT as _e,ay as xt,aq as Ct,aU as Tt,o as O,c as ue,a as pe,n as kt,r as Te,B as F,w as z,f as R,F as ke,q as St,g as M,j as se,i as X,t as Se,as as It,_ as At,m as zt,k as Rt,x as Ut}from"./index-bb1600c6.js";import{g as Ot}from"./TaskData-ccc03cdb.js";import{_ as Pt}from"./DatePicker-fecabd38.js";import{c as Lt,_ as $t,d as Et,e as Ft}from"./VerifyTemplateMapData-6648ebab.js";import{_ as Bt}from"./Space-6807f258.js";const Ie=ae({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=D(null),e=D(r.value),a=D(r.value),o=D("up"),t=D(!1),u=q(()=>t.value?`${r.clsPrefix}-base-slot-machine-current-number--${o.value}-scroll`:null),d=q(()=>t.value?`${r.clsPrefix}-base-slot-machine-old-number--${o.value}-scroll`:null);Fe(be(r,"value"),(h,m)=>{e.value=m,a.value=h,xe(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,xe(()=>{var m;(m=n.value)===null||m===void 0||m.offsetWidth,t.value=!0})}return()=>{const{clsPrefix:h}=r;return k("span",{ref:n,class:`${h}-base-slot-machine-number`},e.value!==null?k("span",{class:[`${h}-base-slot-machine-old-number ${h}-base-slot-machine-old-number--top`,d.value]},e.value):null,k("span",{class:[`${h}-base-slot-machine-current-number`,u.value]},k("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?k("span",{class:[`${h}-base-slot-machine-old-number ${h}-base-slot-machine-old-number--bottom`,d.value]},e.value):null)}}}),{cubicBezierEaseOut:Y}=tt;function Ht({duration:r=".2s"}={}){return[U("&.fade-up-width-expand-transition-leave-active",{transition:`
 opacity ${r} ${Y},
 max-width ${r} ${Y},
 transform ${r} ${Y}
 `}),U("&.fade-up-width-expand-transition-enter-active",{transition:`
 opacity ${r} ${Y},
 max-width ${r} ${Y},
 transform ${r} ${Y}
 `}),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 Mt=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;
 }
 `),P("base-slot-machine",`
 overflow: hidden;
 white-space: nowrap;
 display: inline-block;
 height: 18px;
 line-height: 18px;
 `,[P("base-slot-machine-number",`
 display: inline-block;
 position: relative;
 height: 18px;
 width: .6em;
 max-width: .6em;
 `,[Ht({duration:".2s"}),nt({duration:".2s",delay:"0s"}),P("base-slot-machine-old-number",`
 display: inline-block;
 opacity: 0;
 position: absolute;
 left: 0;
 right: 0;
 `,[H("top",{transform:"translateY(-100%)"}),H("bottom",{transform:"translateY(100%)"}),H("down-scroll",{animation:"n-base-slot-machine-fade-down-out .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1}),H("up-scroll",{animation:"n-base-slot-machine-fade-up-out .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1})]),P("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;
 `,[H("down-scroll",{animation:"n-base-slot-machine-fade-down-in .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1}),H("up-scroll",{animation:"n-base-slot-machine-fade-up-in .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1}),E("inner",`
 display: inline-block;
 position: absolute;
 right: 0;
 top: 0;
 width: .6em;
 `,[H("not-number",`
 right: unset;
 left: 0;
 `)])])])])]),Dt=ae({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){rt("-base-slot-machine",Mt,be(r,"clsPrefix"));const n=D(),e=D(),a=q(()=>{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 Fe(be(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"?k("span",{class:`${t}-base-slot-machine`},k(ot,{name:"fade-up-width-expand-transition",tag:"span"},{default:()=>a.value.map((u,d)=>k(Ie,{clsPrefix:t,key:a.value.length-d-1,oldOriginalNumber:n.value,newOriginalNumber:e.value,value:u}))}),k(Be,{key:"+",width:!0},{default:()=>r.max!==void 0&&r.max<o?k(Ie,{clsPrefix:t,value:"+"}):null})):k("span",{class:`${t}-base-slot-machine`},o)}}}),qt=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:C,closeIconColorPressed:b,infoColor:_,successColor:T,warningColor:y,errorColor:g,fontSize:p}=r;return Object.assign(Object.assign({},at),{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:C,closeIconColorPressed:b,borderInfo:`1px solid ${j(o,N(_,{alpha:.25}))}`,colorInfo:j(o,N(_,{alpha:.08})),titleTextColorInfo:d,iconColorInfo:_,contentTextColorInfo:v,closeColorHoverInfo:i,closeColorPressedInfo:h,closeIconColorInfo:m,closeIconColorHoverInfo:C,closeIconColorPressedInfo:b,borderSuccess:`1px solid ${j(o,N(T,{alpha:.25}))}`,colorSuccess:j(o,N(T,{alpha:.08})),titleTextColorSuccess:d,iconColorSuccess:T,contentTextColorSuccess:v,closeColorHoverSuccess:i,closeColorPressedSuccess:h,closeIconColorSuccess:m,closeIconColorHoverSuccess:C,closeIconColorPressedSuccess:b,borderWarning:`1px solid ${j(o,N(y,{alpha:.33}))}`,colorWarning:j(o,N(y,{alpha:.08})),titleTextColorWarning:d,iconColorWarning:y,contentTextColorWarning:v,closeColorHoverWarning:i,closeColorPressedWarning:h,closeIconColorWarning:m,closeIconColorHoverWarning:C,closeIconColorPressedWarning:b,borderError:`1px solid ${j(o,N(g,{alpha:.25}))}`,colorError:j(o,N(g,{alpha:.08})),titleTextColorError:d,iconColorError:g,contentTextColorError:v,closeColorHoverError:i,closeColorPressedError:h,closeIconColorError:m,closeIconColorHoverError:C,closeIconColorPressedError:b})},jt={name:"Alert",common:He,self:qt},Nt=jt,Vt=P("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;
`,[E("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;
 `),H("closable",[P("alert-body",[E("title",`
 padding-right: 24px;
 `)])]),E("icon",{color:"var(--n-icon-color)"}),P("alert-body",{padding:"var(--n-padding)"},[E("title",{color:"var(--n-title-text-color)"}),E("content",{color:"var(--n-content-text-color)"})]),it({originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.9)"}}),E("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);
 `),E("close",`
 transition:
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier);
 position: absolute;
 right: 0;
 top: 0;
 margin: var(--n-close-margin);
 `),H("show-icon",[P("alert-body",{paddingLeft:"calc(var(--n-icon-margin-left) + var(--n-icon-size) + var(--n-icon-margin-right))"})]),P("alert-body",`
 border-radius: var(--n-border-radius);
 transition: border-color .3s var(--n-bezier);
 `,[E("title",`
 transition: color .3s var(--n-bezier);
 font-size: 16px;
 line-height: 19px;
 font-weight: var(--n-title-font-weight);
 `,[U("& +",[E("content",{marginTop:"9px"})])]),E("content",{transition:"color .3s var(--n-bezier)",fontSize:"var(--n-font-size)"})]),E("icon",{transition:"color .3s var(--n-bezier)"})]),Wt=Object.assign(Object.assign({},he.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}),yr=ae({name:"Alert",inheritAttrs:!1,props:Wt,setup(r){const{mergedClsPrefixRef:n,mergedBorderedRef:e,inlineThemeDisabled:a,mergedRtlRef:o}=Me(r),t=he("Alert","-alert",Vt,Nt,r,n),u=De("Alert",o,n),d=q(()=>{const{common:{cubicBezierEaseInOut:b},self:_}=t.value,{fontSize:T,borderRadius:y,titleFontWeight:g,lineHeight:p,iconSize:l,iconMargin:s,iconMarginRtl:f,closeIconSize:c,closeBorderRadius:A,closeSize:L,closeMargin:$,closeMarginRtl:w,padding:G}=_,{type:x}=r,{left:Qe,right:et}=st(s);return{"--n-bezier":b,"--n-color":_[B("color",x)],"--n-close-icon-size":c,"--n-close-border-radius":A,"--n-close-color-hover":_[B("closeColorHover",x)],"--n-close-color-pressed":_[B("closeColorPressed",x)],"--n-close-icon-color":_[B("closeIconColor",x)],"--n-close-icon-color-hover":_[B("closeIconColorHover",x)],"--n-close-icon-color-pressed":_[B("closeIconColorPressed",x)],"--n-icon-color":_[B("iconColor",x)],"--n-border":_[B("border",x)],"--n-title-text-color":_[B("titleTextColor",x)],"--n-content-text-color":_[B("contentTextColor",x)],"--n-line-height":p,"--n-border-radius":y,"--n-font-size":T,"--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":w,"--n-padding":G,"--n-icon-margin-left":Qe,"--n-icon-margin-right":et}}),v=a?qe("alert",q(()=>r.type[0]),d,r):void 0,i=D(!0),h=()=>{const{onAfterLeave:b,onAfterHide:_}=r;b&&b(),_&&_()};return{rtlEnabled:u,mergedClsPrefix:n,mergedBordered:e,visible:i,handleCloseClick:()=>{var b;Promise.resolve((b=r.onClose)===null||b===void 0?void 0:b.call(r)).then(_=>{_!==!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),k(Be,{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?k("div",Object.assign({},lt(this.$attrs,a)),this.closable&&k(ut,{clsPrefix:n,class:`${n}-alert__close`,onClick:this.handleCloseClick}),this.bordered&&k("div",{class:`${n}-alert__border`}),this.showIcon&&k("div",{class:`${n}-alert__icon`,"aria-hidden":"true"},je(e.icon,()=>[k(ct,{clsPrefix:n},{default:()=>{switch(this.type){case"success":return k(pt,null);case"info":return k(dt,null);case"warning":return k(ht,null);case"error":return k(ft,null);default:return null}}})])),k("div",{class:[`${n}-alert-body`,this.mergedBordered&&`${n}-alert-body--bordered`]},gt(e.header,o=>{const t=o||this.title;return t?k("div",{class:`${n}-alert-body__title`},t):null}),e.default&&k("div",{class:`${n}-alert-body__content`},e))):null}})}}),Gt=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}},Xt={name:"Badge",common:He,self:Gt},Yt=Xt,Jt=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}}),P("badge",`
 display: inline-flex;
 position: relative;
 vertical-align: middle;
 color: var(--n-color);
 font-family: var(--n-font-family);
 `,[H("as-is",[P("badge-sup",{position:"static",transform:"translateX(0)"},[Ce({transformOrigin:"left bottom",originalTransform:"translateX(0)"})])]),H("dot",[P("badge-sup",`
 height: 8px;
 width: 8px;
 padding: 0;
 min-width: 8px;
 left: 100%;
 bottom: calc(100% - 4px);
 `,[U("::before","border-radius: 4px;")])]),P("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;
 `,[Ce({transformOrigin:"left bottom",originalTransform:"translateX(-50%)"}),P("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;
 `)])])]),Kt=Object.assign(Object.assign({},he.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}),_r=ae({name:"Badge",props:Kt,setup(r,{slots:n}){const{mergedClsPrefixRef:e,inlineThemeDisabled:a,mergedRtlRef:o}=Me(r),t=he("Badge","-badge",Jt,Yt,r,e),u=D(!1),d=()=>{u.value=!0},v=()=>{u.value=!1},i=q(()=>r.show&&(r.dot||r.value!==void 0&&!(!r.showZero&&Number(r.value)<=0)||!vt(n.value)));mt(()=>{i.value&&(u.value=!0)});const h=De("Badge",o,e),m=q(()=>{const{type:_,color:T}=r,{common:{cubicBezierEaseInOut:y,cubicBezierEaseOut:g},self:{[B("color",_)]:p,fontFamily:l,fontSize:s}}=t.value;return{"--n-font-size":s,"--n-font-family":l,"--n-color":T||p,"--n-ripple-color":T||p,"--n-bezier":y,"--n-ripple-bezier":g}}),C=a?qe("badge",q(()=>{let _="";const{type:T,color:y}=r;return T&&(_+=T[0]),y&&(_+=bt(y)),_}),m,r):void 0,b=q(()=>{const{offset:_}=r;if(!_)return;const[T,y]=_,g=typeof T=="number"?`${T}px`:T,p=typeof y=="number"?`${y}px`:y;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:C==null?void 0:C.themeClass,onRender:C==null?void 0:C.onRender,offsetStyle:b}},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 k("div",{class:[`${n}-badge`,this.rtlEnabled&&`${n}-badge--rtl`,a,{[`${n}-badge--dot`]:this.dot,[`${n}-badge--as-is`]:!t}],style:this.cssVars},t,k(yt,{name:"fade-in-scale-up-transition",onAfterEnter:this.handleAfterEnter,onAfterLeave:this.handleAfterLeave},{default:()=>this.showBadge?k("sup",{class:`${n}-badge-sup`,title:_t(this.value),style:this.offsetStyle},je(o.value,()=>[this.dot?null:k(Dt,{clsPrefix:n,appeared:this.appeared,max:this.max,value:this.value})]),this.processing?k(wt,{clsPrefix:n}):null):null}))}}),wr=r=>de.request({method:"POST",url:"/GenerateReport/Generate_scheme",data:r,baseURL:_e}),xr=r=>de.request({method:"POST",url:"/GenerateReport/Generate_report",data:r,baseURL:_e}),Cr=r=>de.request({method:"POST",url:"/GenerateReport/Generate_key",data:r,baseURL:_e}),Tr=r=>de.request({method:"POST",url:"/VerifyTemplateMapData/Copy",data:r,baseURL:xt});var Ne=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 I=function(){function r(n,e){this.name=n,this.message=e,this.stack=new Error().stack}return r}(),oe=function(r){Ne(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}(I),Zt=function(r){Ne(n,r);function n(e,a){return a===void 0&&(a=""),r.call(this,0,a,e)||this}return n}(oe),Qt=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}(),en=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)}}(),ne=globalThis&&globalThis.__assign||function(){return ne=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},ne.apply(this,arguments)},tn=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}(),nn=function(r){en(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=ne(ne(ne({},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}(tn),rn=function(){function r(n){this._subscribe=n}return r.prototype.subscribe=function(n,e,a){var o=new nn(n,e,a);return o.add(this._subscribe(o)),o},r}();function on(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 an(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 sn(r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e,a,o,t,u,d,v,i,h=0,m=0,C="",b=[];if(!r)return r;r=on(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,b[m++]=n.charAt(t)+n.charAt(u)+n.charAt(d)+n.charAt(v);while(h<r.length);switch(C=b.join(""),r.length%3){case 1:C=C.slice(0,-2)+"==";break;case 2:C=C.slice(0,-1)+"=";break}return C}function ln(r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e,a,o,t,u,d,v,i,h=0,m=0,C="",b=[];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?b[m++]=String.fromCharCode(e):v===64?b[m++]=String.fromCharCode(e,a):b[m++]=String.fromCharCode(e,a,o);while(h<r.length);return C=b.join(""),an(C)}function Ve(r){return r=sn(r),r.replace(/\//g,"_").replace(/\+/g,"-")}function un(r){return r=r.replace(/_/g,"/").replace(/-/g,"+"),ln(r)}var We={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,A,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 A=p*8,A=A.toString(16).match(/(.*?)(.{0,8})$/),L=parseInt(A[2],16),$=parseInt(A[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,A,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 A=p*8,A=A.toString(16).match(/(.*?)(.{0,8})$/),L=parseInt(A[2],16),$=parseInt(A[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,A,L,$,w;return l!==e&&(c=g(l,s)),f>c?new ArrayBuffer(0):(A=c-f,L=new ArrayBuffer(A),$=new Uint8Array(L),w=new Uint8Array(this,f,A),$.set(w),L)}}();function m(g){return/[\u0080-\uFFFF]/.test(g)&&(g=unescape(encodeURIComponent(g))),g}function C(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 b(g){return String.fromCharCode.apply(null,new Uint8Array(g))}function _(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 T(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 y(){this.reset()}return y.prototype.append=function(g){return this.appendBinary(m(g)),this},y.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},y.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=T(c)),this.reset(),c},y.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},y.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},y.prototype.setState=function(g){return this._buff=g.buff,this._length=g.length,this._hash=g.hash,this},y.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},y.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)},y.hash=function(g,p){return y.hashBinary(m(g),p)},y.hashBinary=function(g,p){var l=d(g),s=h(l);return p?T(s):s},y.ArrayBuffer=function(){this.reset()},y.ArrayBuffer.prototype.append=function(g){var p=_(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},y.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=T(c)),this.reset(),c},y.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},y.ArrayBuffer.prototype.getState=function(){var g=y.prototype.getState.call(this);return g.buff=b(g.buff),g},y.ArrayBuffer.prototype.setState=function(g){return g.buff=C(g.buff,!0),y.prototype.setState.call(this,g)},y.ArrayBuffer.prototype.destroy=y.prototype.destroy,y.ArrayBuffer.prototype._finish=y.prototype._finish,y.ArrayBuffer.hash=function(g,p){var l=v(new Uint8Array(g)),s=h(l);return p?T(s):s},y})})(We);var cn=We.exports;const fn=Ct(cn);var ce=globalThis&&globalThis.__assign||function(){return ce=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},ce.apply(this,arguments)},hn=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())})},dn=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}}},K=Math.pow(1024,2);function pn(r,n){var e=n*K;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 gn(r){return Object.keys(r).every(function(n){return n.indexOf("x-qn-meta-")===0})}function vn(r){return Object.keys(r).every(function(n){return n.indexOf("x:")===0})}function mn(r){return r.reduce(function(n,e){return n+e},0)}function bn(r,n,e){try{localStorage.setItem(r,JSON.stringify(n))}catch{e.warn(new I(S.WriteCacheFailed,"setLocalFileInfo failed: "+r))}}function yn(r,n,e){var a=n==null?"_":"_key_"+n+"_";return"qiniu_js_sdk_upload_file_name_"+r+a+"size_"+e}function ye(r,n){try{localStorage.removeItem(r)}catch{n.warn(new I(S.RemoveCacheFailed,"removeLocalFileInfo failed. key: "+r))}}function _n(r,n){var e=null;try{e=localStorage.getItem(r)}catch{n.warn(new I(S.ReadCacheFailed,"getLocalFileInfo failed. key: "+r))}if(e==null)return null;var a=null;try{a=JSON.parse(e)}catch{ye(r,n),n.warn(new I(S.InvalidCacheData,"getLocalFileInfo failed to parse. key: "+r))}return a}function ge(r){var n="UpToken "+r;return{Authorization:n}}function wn(r){var n=ge(r);return ce({"content-type":"application/octet-stream"},n)}function xn(r){var n=ge(r);return ce({"content-type":"application/json"},n)}function Ge(){if(window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)return new window.ActiveXObject("Microsoft.XMLHTTP");throw new I(S.NotAvailableXMLHttpRequest,"the current environment does not support.")}function Cn(r){return hn(this,void 0,void 0,function(){var n,e;return dn(this,function(a){switch(a.label){case 0:return[4,Tn(r)];case 1:return n=a.sent(),e=new fn.ArrayBuffer,e.append(n),[2,e.end()]}})})}function Tn(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 I(S.InvalidProgressEventTarget,"progress event target is undefined"))},a.onerror=function(){e(new I(S.FileReaderReadFailed,"fileReader read failed"))},a.readAsArrayBuffer(r)})}function ie(r,n){return new Promise(function(e,a){var o=Ge();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 Zt("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 oe(o.status,d,v,i));return}try{e({data:JSON.parse(u),reqId:d})}catch(h){a(h)}}},o.send(n.body)})}function kn(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 Sn(r){if(r&&r.match){var n=r.match(/^https?:\/\/([^:^/]*)/);return n?n[1]:""}return""}function we(r){if(!r)throw new I(S.InvalidToken,"invalid token.");var n=r.split(":");if(n.length===1)throw new I(S.InvalidToken,"invalid token segments.");var e=n.length>3?n[1]:n[0];if(!e)throw new I(S.InvalidToken,"missing assess key field.");var a=null;try{a=JSON.parse(un(n[n.length-1]))}catch{throw new I(S.InvalidToken,"token parse failed.")}if(a==null)throw new I(S.InvalidToken,"putPolicy is null.");if(a.scope==null)throw new I(S.InvalidToken,"scope field is null.");var o=a.scope.split(":")[0];if(!o)throw new I(S.InvalidToken,"resolve bucketName failed.");return{assessKey:e,bucketName:o,scope:a.scope}}var V,J={z0:"z0",z1:"z1",z2:"z2",na0:"na0",as0:"as0",cnEast2:"cn-east-2"},In=(V={},V[J.z0]={srcUphost:["up.qiniup.com"],cdnUphost:["upload.qiniup.com"]},V[J.z1]={srcUphost:["up-z1.qiniup.com"],cdnUphost:["upload-z1.qiniup.com"]},V[J.z2]={srcUphost:["up-z2.qiniup.com"],cdnUphost:["upload-z2.qiniup.com"]},V[J.na0]={srcUphost:["up-na0.qiniup.com"],cdnUphost:["upload-na0.qiniup.com"]},V[J.as0]={srcUphost:["up-as0.qiniup.com"],cdnUphost:["upload-as0.qiniup.com"]},V[J.cnEast2]={srcUphost:["up-cn-east-2.qiniup.com"],cdnUphost:["upload-cn-east-2.qiniup.com"]},V),Q=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}},An=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(Q(o))+e;return Array.isArray(r[o])?r[o].map(function(u){return t+encodeURIComponent(Q(u))}).join(n):t+encodeURIComponent(Q(r[o]))}).filter(Boolean).join(n):a?encodeURIComponent(Q(a))+e+encodeURIComponent(Q(r)):""},Xe;Xe=An;var W=globalThis&&globalThis.__assign||function(){return W=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},W.apply(this,arguments)},zn=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())})},Rn=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 Un(r,n,e){return zn(this,void 0,void 0,function(){var a,o;return Rn(this,function(t){return a=Xe({ak:r,bucket:n}),o=e+"://api.qiniu.com/v2/query?"+a,[2,ie(o,{method:"GET"})]})})}function Ye(r,n,e){var a=e.url,o=e.id;return a+"/buckets/"+r+"/objects/"+(n!=null?Ve(n):"~")+"/uploads/"+o}function On(r,n,e,a){var o=a+"/buckets/"+n+"/objects/"+(e!=null?Ve(e):"~")+"/uploads";return ie(o,{method:"POST",headers:ge(r)})}function Pn(r,n,e,a,o){var t=we(r).bucketName,u=Ye(t,n,a)+("/"+e),d=wn(r);return o.md5&&(d["Content-MD5"]=o.md5),ie(u,W(W({},o),{method:"PUT",headers:d}))}function Ln(r,n,e,a){var o=we(r).bucketName,t=Ye(o,n,e);return ie(t,W(W({},a),{method:"POST",headers:xn(r)}))}function $n(r,n,e){return ie(r,W({method:"POST",body:n},e))}var fe=globalThis&&globalThis.__assign||function(){return fe=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},fe.apply(this,arguments)},Ae=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())})},ze=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}}},En=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},Fn=globalThis&&globalThis.__spread||function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(En(arguments[n]));return r},Bn=4,Je=[0,502,503,504,599],Hn=Fn(Je,[612]),Mn=Math.pow(1024,3),Ke=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=fe({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=we(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 Ae(this,void 0,void 0,function(){var n;return ze(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 I(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 oe&&this.uploadHost!=null&&Je.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 Ae(this,void 0,void 0,function(){var n,e,a,o;return ze(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*Mn)return this.handleError(new I(S.InvalidFile,"file size exceed maximum value 10000G")),[2];if(this.putExtra.customVars&&!vn(this.putExtra.customVars))return this.handleError(new I(S.InvalidCustomVars,"customVars key should start width x:")),[2];if(this.putExtra.metadata&&!gn(this.putExtra.metadata))return this.handleError(new I(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 oe&&(this.sendLog(e.reqId,e.code),this.checkAndFreezeHost(e),a=++this.retryCount<=this.config.retryCount,o=Hn.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:kn((a=this.uploadHost)===null||a===void 0?void 0:a.getUrl()),host:Sn((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 fe({size:e,loaded:n,percent:n/e*100},a==null?{}:{fromCache:a})},r}(),Dn=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)}}(),re=globalThis&&globalThis.__assign||function(){return re=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},re.apply(this,arguments)},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())})},te=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 qn(r){var n=/^[1-9]\d*$/;return n.test(String(r))}var jn=function(r){Dn(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}return n.prototype.run=function(){return ee(this,void 0,void 0,function(){var e,a,o,t,u,d=this;return te(this,function(v){switch(v.label){case 0:if(this.logger.info("start run Resume."),!this.config.chunkSize||!qn(this.config.chunkSize))throw new I(S.InvalidChunkSize,"chunkSize must be a positive integer");if(this.config.chunkSize>1024)throw new I(S.InvalidChunkSize,"chunkSize maximum value is 1024");return[4,this.initBeforeUploadChunks()];case 1:v.sent(),e=new Qt(function(i){return ee(d,void 0,void 0,function(){return te(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 oe&&(u.code===612||u.code===400)&&ye(o,this.logger),u;case 6:return ye(o,this.logger),[2,a]}})})},n.prototype.uploadChunk=function(e){return ee(this,void 0,void 0,function(){var a,o,t,u,d,v,i,h,m,C=this;return te(this,function(b){switch(b.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(){C.usedCacheList[a]=!0,C.updateChunkProgress(o.size,a),C.uploadedList[a]=t,C.updateLocalCache()},t&&!u?(d(),[2]):[4,Cn(o)];case 1:return v=b.sent(),this.logger.info("computed part md5.",v),t&&v===t.md5?(d(),[2]):(this.usedCacheList[a]=!1,i=function(_){C.updateChunkProgress(_.loaded,a)},h={body:o,md5:this.config.checkByServer?v:void 0,onProgress:i,onCreate:function(_){return C.addXhr(_)}},this.logger.info("part "+a+" start uploading."),[4,Pn(this.token,this.key,e.index+1,this.getUploadInfo(),h)]);case 2:return m=b.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 ee(this,void 0,void 0,function(){var e,a,o=this;return te(this,function(t){switch(t.label){case 0:return e=re(re(re({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,Ln(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 ee(this,void 0,void 0,function(){var e,a,o;return te(this,function(t){switch(t.label){case 0:return this.uploadedList=[],this.usedCacheList=[],e=_n(this.getLocalKey(),this.logger),e?[3,2]:(this.logger.info("init upload parts from api."),[4,On(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=pn(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 yn(this.file.name,this.key,this.file.size)},n.prototype.updateLocalCache=function(){bn(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(mn(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}(Ke),Re=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())})},Ue=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}}},Nn=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 Re(this,void 0,void 0,function(){var e;return Ue(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 Re(this,void 0,void 0,function(){var e,a,o,t,u,d;return Ue(this,function(v){switch(v.label){case 0:return n.size<=K?(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/K),o=0,v.label=3;case 3:return o<a?(t=o*K,u=o===a-1?n.size:t+K,[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}(),Vn=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)}}(),Wn=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}}},Oe=function(r){Vn(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}return n.prototype.run=function(){return Wn(this,void 0,void 0,function(){var e,a,o,t,u=this;return Gn(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,Nn.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,$n(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}(Ke);function Ze(r,n,e){e===void 0&&(e=3);var a=Ge();a.open("POST","https://uplog.qbox.me/log/3"),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.setRequestHeader("Authorization",ge(r).Authorization),a.onreadystatechange=function(){a.readyState===4&&a.status!==200&&e>0&&Ze(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 Xn=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},ve=globalThis&&globalThis.__spread||function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Xn(arguments[n]));return r},Yn=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{Ze(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,ve([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,ve([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,ve([this.getPrintPrefix("ERROR")],n))},r.id=0,r}(),Pe=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}}},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},Kn=globalThis&&globalThis.__spread||function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Jn(arguments[n]));return r},le=new Map,Zn=function(){function r(n,e){this.host=n,this.protocol=e}return r.prototype.isFrozen=function(){var n=new Date().getTime(),e=le.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;le.set(this.host,e)},r.prototype.unfreeze=function(){le.delete(this.host)},r.prototype.getUrl=function(){return this.protocol+"://"+this.host},r.prototype.getUnfreezeTime=function(){return le.get(this.host)},r}(),Qn=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 Zn(t,o)}))},r.prototype.refresh=function(n,e,a){var o,t,u,d;return Pe(this,void 0,void 0,function(){var v,i,h;return Le(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,Un(n,e,a)];case 1:return i=m.sent(),(i==null?void 0:i.data)!=null&&(h=Kn(((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 Pe(this,void 0,void 0,function(){var o,t,u;return Le(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 er(r,n,e,a){return r.config&&r.config.forceDirect?(a.info("ues forceDirect mode."),new Oe(r,n,e,a)):r.file.size>4*K?(a.info("file size over 4M, use Resume."),new jn(r,n,e,a)):(a.info("file size less or equal than 4M, use Direct."),new Oe(r,n,e,a))}function tr(r,n,e,a,o){var t=new Yn(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:or(o,t)},d=new Qn(u.config.uphost);return new rn(function(v){var i=er(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 Z=globalThis&&globalThis.__assign||function(){return Z=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},Z.apply(this,arguments)},nr=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},rr=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},me=globalThis&&globalThis.__spread||function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(rr(arguments[n]));return r};function or(r,n){var e=Z({},r),a=e.upprotocol,o=e.uphost,t=nr(e,["upprotocol","uphost"]),u=Z({uphost:[],retryCount:3,checkByMD5:!1,forceDirect:!1,useCdnDomain:!0,checkByServer:!1,concurrentRequestLimit:3,chunkSize:Bn,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,me(o)):d.push(o);else if(u!=null&&u.region){var v=In[u==null?void 0:u.region];u.useCdnDomain?d.push.apply(d,me(v.cdnUphost)):d.push.apply(d,me(v.srcUphost))}return Z(Z({},u),{uphost:d.filter(Boolean)})}var $e=globalThis&&globalThis.__assign||function(){return $e=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},$e.apply(this,arguments)};globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var Ee={PNG:"image/png",JPEG:"image/jpeg",WEBP:"image/webp",BMP:"image/bmp"};Object.keys(Ee).map(function(r){return Ee[r]});const ar=async r=>{const{data:n}=await Tt({T_suffix:r});return n.Data},ir={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},sr=pe("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),lr=pe("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),ur=pe("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),cr=pe("path",{d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26z",fill:"currentColor"},null,-1),fr=[sr,lr,ur,cr],hr=ae({name:"InformationCircleOutline",render:function(n,e){return O(),ue("svg",ir,fr)}}),dr={key:5,style:{display:"flex",flex:"1","align-items":"center"}},kr={__name:"FormList",props:{formList:{type:Array,default:()=>[]}},setup(r){const n=r,e=kt(),a=window.sessionStorage.getItem("task")?JSON.parse(window.sessionStorage.getItem("task")):{},o=Te({pdf:""});o.formList=q(()=>n.formList);const t=Te({T_source:2,T_task_id:a.T_task_id,T_VerifyTemplate_id:a.T_VerifyTemplate_id}),u=D([]),d=b=>{console.log("cad",o.formList),o.formList[b].T_value="",o.formList[b].T_value=`http://coldverifylocal.coldbaozhida.com/CAD/download?type=upload&filename=${t.T_task_id}_${t.T_VerifyTemplate_id}_${o.formList[b].T_id}.png&xxx=${Math.random()}`},v=b=>{window.open(`http://coldverifylocal.coldbaozhida.com/CAD/?task_id=${t.T_task_id}&vt_id=${t.T_VerifyTemplate_id}&key_id=${b.T_id}`)},i=async({file:b},_)=>{const T=await ar(b.name.split(".")[1]);tr(b.file,b.name,T,{},{useCdnDomain:!0}).subscribe({next:g=>{console.warn(g)},error:()=>{e.error("上传失败")},complete:g=>{o.formList[_].T_value=g.key}})},h=b=>{n.formList[b].T_value.length==u.value.length?n.formList[b].T_value=[]:n.formList[b].T_value=u.value.map(_=>_.T_sn)},m=b=>{let _=u.value.map(T=>T.T_sn);n.formList[b].T_value=n.formList[b].T_value.concat(_).filter((T,y,g)=>g.indexOf(T)===g.lastIndexOf(T))};return(async()=>{try{const{data:b}=await Ot({T_class:a.T_class});console.log("******",b),u.value=b.Data.List||[]}catch(b){console.log(b)}})(),(b,_)=>{const T=Bt,y=It,g=Pt,p=Lt,l=$t,s=At,f=zt,c=Rt,A=Et,L=Ft,$=Ut;return O(),F($,{"label-width":"auto"},{default:z(()=>[R(L,{cols:12,"x-gap":12},{default:z(()=>[(O(!0),ue(ke,null,St(r.formList,(w,G)=>(O(),F(A,{key:w.T_VerifyTemplateMap_id,span:4,label:w.T_name},{default:z(()=>[w.T_label===3?(O(),F(y,{key:0,value:w.T_value,"onUpdate:value":x=>w.T_value=x,multiple:"","label-field":"T_id","value-field":"T_sn","max-tag-count":"responsive",options:M(u)},{action:z(()=>[R(T,null,{default:z(()=>[R(M(se),{disabled:M(u).length==0,class:"underline",text:"",onClick:x=>h(G)},{default:z(()=>[X(Se(w.T_value.length==M(u).length?"取消":"全选"),1)]),_:2},1032,["disabled","onClick"]),R(M(se),{disabled:M(u).length==0,class:"underline",text:"",onClick:x=>m(G)},{default:z(()=>[X("反选")]),_:2},1032,["disabled","onClick"])]),_:2},1024)]),_:2},1032,["value","onUpdate:value","options"])):w.T_label===4?(O(),F(y,{key:1,value:w.T_value,"onUpdate:value":x=>w.T_value=x,"label-field":"T_id","value-field":"T_sn",options:M(u)},null,8,["value","onUpdate:value","options"])):w.T_label===7?(O(),F(g,{key:2,"formatted-value":w.T_value,"onUpdate:formattedValue":[x=>w.T_value=x,x=>w.T_value=x],type:"datetime",format:"yyyy-MM-dd HH:mm",datetime:"",clearable:"",class:"w-full"},null,8,["formatted-value","onUpdate:formattedValue"])):w.T_label===9?(O(),F(g,{key:3,"formatted-value":w.T_value,"onUpdate:formattedValue":x=>w.T_value=x,type:"datetimerange",format:"yyyy-MM-dd HH:mm",clearable:"",class:"w-full"},null,8,["formatted-value","onUpdate:formattedValue"])):w.T_label===10?(O(),ue(ke,{key:4},[R(p,{class:"mr-5",width:"100",src:w.T_value},null,8,["src"]),R(l,{"list-type":"image-card",onChange:x=>i(x,G),"default-upload":!1,max:1},{default:z(()=>[X(" 点击上传 ")]),_:2},1032,["onChange"])],64)):w.T_label===11?(O(),ue("div",dr,[R(p,{class:"mr-5",width:"100",src:w.T_value},null,8,["src"]),R(T,{class:"mr-5"},{default:z(()=>[R(M(se),{onClick:()=>v(w)},{default:z(()=>[X("编辑")]),_:2},1032,["onClick"]),R(M(se),{onClick:()=>d(G)},{default:z(()=>[X("刷新")]),_:2},1032,["onClick"])]),_:2},1024)])):w.T_label===12?(O(),F(T,{key:6,vertical:"",class:"w-full"},{default:z(()=>[R(g,{"formatted-value":w.T_value[0],"onUpdate:formattedValue":x=>w.T_value[0]=x,format:"yyyy-MM-dd HH:mm","time-picker-props":{format:"HH:mm"},type:"datetime",clearable:""},null,8,["formatted-value","onUpdate:formattedValue"]),R(s,{value:w.T_value[1],"onUpdate:value":x=>w.T_value[1]=x,type:"text"},null,8,["value","onUpdate:value"])]),_:2},1024)):w.T_label===13?(O(),F(T,{key:7,vertical:"",class:"w-full"},{default:z(()=>[R(g,{"formatted-value":w.T_value[0],"onUpdate:formattedValue":x=>w.T_value[0]=x,format:"yyyy-MM-dd HH:mm",type:"datetimerange",clearable:""},null,8,["formatted-value","onUpdate:formattedValue"]),R(s,{value:w.T_value[1],"onUpdate:value":x=>w.T_value[1]=x,type:"text"},null,8,["value","onUpdate:value"])]),_:2},1024)):(O(),F(s,{key:8,value:w.T_value,"onUpdate:value":x=>w.T_value=x,type:"text"},null,8,["value","onUpdate:value"])),w.T_label===10||w.T_label===11?(O(),F(p,{key:9,width:"100",src:w.T_text,style:{"margin-right":"36px"}},null,8,["src"])):(O(),F(c,{key:10,trigger:"hover"},{trigger:z(()=>[R(f,{size:"24",class:"ml-3"},{default:z(()=>[R(M(hr))]),_:1})]),default:z(()=>[X(" "+Se(w.T_text),1)]),_:2},1024))]),_:2},1032,["label"]))),128))]),_:1})]),_:1})}}};export{Tr as T,kr as _,yr as a,wr as b,Cr as c,_r as d,xr as e,ar as g,tr as u};
