From 911efd41dd3d91ca39d884b0b8ae4d12ff62cf8d Mon Sep 17 00:00:00 2001 From: HAL <328961630@qq.com> Date: Sun, 8 Sep 2024 17:42:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E5=8C=96=E8=BF=9B=E5=BA=A6=E6=9D=A1?= =?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.go | 2 +- .../{index.beba636e.js => index.54b86a81.js} | 2 +- frontend/dist/index.html | 2 +- pkg/wechat/wechat.go | 135 ++++++++++++++++-- 4 files changed, 127 insertions(+), 14 deletions(-) rename frontend/dist/assets/{index.beba636e.js => index.54b86a81.js} (99%) diff --git a/app.go b/app.go index 648b4a7..df22e08 100644 --- a/app.go +++ b/app.go @@ -18,7 +18,7 @@ const ( defaultConfig = "config" configDefaultUserKey = "userConfig.defaultUser" configUsersKey = "userConfig.users" - appVersion = "v1.0.0" + appVersion = "v1.0.1" ) // App struct diff --git a/frontend/dist/assets/index.beba636e.js b/frontend/dist/assets/index.54b86a81.js similarity index 99% rename from frontend/dist/assets/index.beba636e.js rename to frontend/dist/assets/index.54b86a81.js index 009d820..a5fe459 100644 --- a/frontend/dist/assets/index.beba636e.js +++ b/frontend/dist/assets/index.54b86a81.js @@ -334,7 +334,7 @@ html body { top:0 !important; right:0 !important; pointer-events: none !important; -`,f7=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],Ev={},dr;function v7(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&Ev[n])return Ev[n];var r=window.getComputedStyle(e),o=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),i=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),a=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),l=f7.map(function(c){return"".concat(c,":").concat(r.getPropertyValue(c))}).join(";"),s={sizingStyle:l,paddingSize:i,borderSize:a,boxSizing:o};return t&&n&&(Ev[n]=s),s}function p7(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;dr||(dr=document.createElement("textarea"),dr.setAttribute("tab-index","-1"),dr.setAttribute("aria-hidden","true"),document.body.appendChild(dr)),e.getAttribute("wrap")?dr.setAttribute("wrap",e.getAttribute("wrap")):dr.removeAttribute("wrap");var o=v7(e,t),i=o.paddingSize,a=o.borderSize,l=o.boxSizing,s=o.sizingStyle;dr.setAttribute("style","".concat(s,";").concat(d7)),dr.value=e.value||e.placeholder||"";var c=void 0,u=void 0,d,v=dr.scrollHeight;if(l==="border-box"?v+=a:l==="content-box"&&(v-=i),n!==null||r!==null){dr.value=" ";var h=dr.scrollHeight-i;n!==null&&(c=h*n,l==="border-box"&&(c=c+i+a),v=Math.max(c,v)),r!==null&&(u=h*r,l==="border-box"&&(u=u+i+a),d=v>u?"":"hidden",v=Math.min(u,v))}var g={height:v,overflowY:d,resize:"none"};return c&&(g.minHeight=c),u&&(g.maxHeight=u),g}var g7=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Mv=0,Ov=1,Rv=2,h7=f.exports.forwardRef(function(e,t){var n=e,r=n.prefixCls;n.onPressEnter;var o=n.defaultValue,i=n.value,a=n.autoSize,l=n.onResize,s=n.className,c=n.style,u=n.disabled,d=n.onChange;n.onInternalAutoSize;var v=Je(n,g7),h=kt(o,{value:i,postState:function(H){return H!=null?H:""}}),g=G(h,2),p=g[0],b=g[1],m=function(H){b(H.target.value),d==null||d(H)},y=f.exports.useRef();f.exports.useImperativeHandle(t,function(){return{textArea:y.current}});var S=f.exports.useMemo(function(){return a&&Qe(a)==="object"?[a.minRows,a.maxRows]:[]},[a]),x=G(S,2),$=x[0],E=x[1],w=!!a,R=function(){try{if(document.activeElement===y.current){var H=y.current,W=H.selectionStart,Y=H.selectionEnd,K=H.scrollTop;y.current.setSelectionRange(W,Y),y.current.scrollTop=K}}catch{}},P=f.exports.useState(Rv),N=G(P,2),I=N[0],z=N[1],F=f.exports.useState(),T=G(F,2),D=T[0],_=T[1],O=function(){z(Mv)};Nt(function(){w&&O()},[i,$,E,w]),Nt(function(){if(I===Mv)z(Ov);else if(I===Ov){var j=p7(y.current,!1,$,E);z(Rv),_(j)}else R()},[I]);var M=f.exports.useRef(),L=function(){St.cancel(M.current)},A=function(H){I===Rv&&(l==null||l(H),a&&(L(),M.current=St(function(){O()})))};f.exports.useEffect(function(){return L},[]);var B=w?D:null,k=U(U({},c),B);return(I===Mv||I===Ov)&&(k.overflowY="hidden",k.overflowX="hidden"),C(mr,{onResize:A,disabled:!(a||l),children:C("textarea",{...v,ref:y,style:k,className:te(r,s,V({},"".concat(r,"-disabled"),u)),disabled:u,value:p,onChange:m})})}),m7=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize"],y7=lt.forwardRef(function(e,t){var n,r,o=e.defaultValue,i=e.value,a=e.onFocus,l=e.onBlur,s=e.onChange,c=e.allowClear,u=e.maxLength,d=e.onCompositionStart,v=e.onCompositionEnd,h=e.suffix,g=e.prefixCls,p=g===void 0?"rc-textarea":g,b=e.showCount,m=e.count,y=e.className,S=e.style,x=e.disabled,$=e.hidden,E=e.classNames,w=e.styles,R=e.onResize,P=Je(e,m7),N=kt(o,{value:i,defaultValue:o}),I=G(N,2),z=I[0],F=I[1],T=z==null?"":String(z),D=lt.useState(!1),_=G(D,2),O=_[0],M=_[1],L=lt.useRef(!1),A=lt.useState(null),B=G(A,2),k=B[0],j=B[1],H=f.exports.useRef(null),W=function(){var ge;return(ge=H.current)===null||ge===void 0?void 0:ge.textArea},Y=function(){W().focus()};f.exports.useImperativeHandle(t,function(){return{resizableTextArea:H.current,focus:Y,blur:function(){W().blur()}}}),f.exports.useEffect(function(){M(function(we){return!x&&we})},[x]);var K=lt.useState(null),q=G(K,2),ee=q[0],Z=q[1];lt.useEffect(function(){if(ee){var we;(we=W()).setSelectionRange.apply(we,Oe(ee))}},[ee]);var Q=b$(m,b),ne=(n=Q.max)!==null&&n!==void 0?n:u,ae=Number(ne)>0,J=Q.strategy(T),re=!!ne&&J>ne,fe=function(ge,Pe){var Se=Pe;!L.current&&Q.exceedFormatter&&Q.max&&Q.strategy(Pe)>Q.max&&(Se=Q.exceedFormatter(Pe,{max:Q.max}),Pe!==Se&&Z([W().selectionStart||0,W().selectionEnd||0])),F(Se),od(ge.currentTarget,ge,s,Se)},ve=function(ge){L.current=!0,d==null||d(ge)},pe=function(ge){L.current=!1,fe(ge,ge.currentTarget.value),v==null||v(ge)},oe=function(ge){fe(ge,ge.target.value)},se=function(ge){var Pe=P.onPressEnter,Se=P.onKeyDown;ge.key==="Enter"&&Pe&&Pe(ge),Se==null||Se(ge)},le=function(ge){M(!0),a==null||a(ge)},Ce=function(ge){M(!1),l==null||l(ge)},ce=function(ge){F(""),Y(),od(W(),ge,s)},de=h,xe;Q.show&&(Q.showFormatter?xe=Q.showFormatter({value:T,count:J,maxLength:ne}):xe="".concat(J).concat(ae?" / ".concat(ne):""),de=ie(Tt,{children:[de,C("span",{className:te("".concat(p,"-data-count"),E==null?void 0:E.count),style:w==null?void 0:w.count,children:xe})]}));var he=function(ge){var Pe;R==null||R(ge),(Pe=W())!==null&&Pe!==void 0&&Pe.style.height&&j(!0)},ke=!P.autoSize&&!b&&!c;return C(y$,{value:T,allowClear:c,handleReset:ce,suffix:de,prefixCls:p,classNames:U(U({},E),{},{affixWrapper:te(E==null?void 0:E.affixWrapper,(r={},V(r,"".concat(p,"-show-count"),b),V(r,"".concat(p,"-textarea-allow-clear"),c),r))}),disabled:x,focused:O,className:te(y,re&&"".concat(p,"-out-of-range")),style:U(U({},S),k&&!ke?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof xe=="string"?xe:void 0}},hidden:$,children:C(h7,{...P,maxLength:u,onKeyDown:se,onChange:oe,onFocus:le,onBlur:Ce,onCompositionStart:ve,onCompositionEnd:pe,className:te(E==null?void 0:E.textarea),style:U(U({},w==null?void 0:w.textarea),{},{resize:S==null?void 0:S.resize}),disabled:x,prefixCls:p,onResize:he,ref:H})})}),b7=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o{var n;const{prefixCls:r,bordered:o=!0,size:i,disabled:a,status:l,allowClear:s,classNames:c,rootClassName:u,className:d,variant:v}=e,h=b7(e,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","variant"]),{getPrefixCls:g,direction:p}=f.exports.useContext(ot),b=So(i),m=f.exports.useContext(rl),y=a!=null?a:m,{status:S,hasFeedback:x,feedbackIcon:$}=f.exports.useContext(Jr),E=dm(S,l),w=f.exports.useRef(null);f.exports.useImperativeHandle(t,()=>{var _;return{resizableTextArea:(_=w.current)===null||_===void 0?void 0:_.resizableTextArea,focus:O=>{var M,L;t7((L=(M=w.current)===null||M===void 0?void 0:M.resizableTextArea)===null||L===void 0?void 0:L.textArea,O)},blur:()=>{var O;return(O=w.current)===null||O===void 0?void 0:O.blur()}}});const R=g("input",r);let P;typeof s=="object"&&(s==null?void 0:s.clearIcon)?P=s:s&&(P={clearIcon:C(Nd,{})});const N=no(R),[I,z,F]=Im(R,N),[T,D]=vm(v,o);return I(C(y7,{...Object.assign({},h,{disabled:y,allowClear:P,className:te(F,N,d,u),classNames:Object.assign(Object.assign({},c),{textarea:te({[`${R}-sm`]:b==="small",[`${R}-lg`]:b==="large"},z,c==null?void 0:c.textarea),variant:te({[`${R}-${T}`]:D},ed(R,E)),affixWrapper:te(`${R}-textarea-affix-wrapper`,{[`${R}-affix-wrapper-rtl`]:p==="rtl",[`${R}-affix-wrapper-sm`]:b==="small",[`${R}-affix-wrapper-lg`]:b==="large",[`${R}-textarea-show-count`]:e.showCount||((n=e.count)===null||n===void 0?void 0:n.show)},z)}),prefixCls:R,suffix:x&&C("span",{className:`${R}-textarea-suffix`,children:$}),ref:w})}))}),C7=S7,Js=Tm;Js.Group=Xk;Js.Search=u7;Js.TextArea=C7;Js.Password=l7;const C$=Js;function x$(){var e=document.documentElement.clientWidth,t=window.innerHeight||document.documentElement.clientHeight;return{width:e,height:t}}function x7(e){var t=e.getBoundingClientRect(),n=document.documentElement;return{left:t.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:t.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}var Pg=["crossOrigin","decoding","draggable","loading","referrerPolicy","sizes","srcSet","useMap","alt"],ec=f.exports.createContext(null),a1=0;function w7(e,t){var n=f.exports.useState(function(){return a1+=1,String(a1)}),r=G(n,1),o=r[0],i=f.exports.useContext(ec),a={data:t,canPreview:e};return f.exports.useEffect(function(){if(i)return i.register(o,a)},[]),f.exports.useEffect(function(){i&&i.register(o,a)},[e,t]),o}function $7(e){return new Promise(function(t){var n=document.createElement("img");n.onerror=function(){return t(!1)},n.onload=function(){return t(!0)},n.src=e})}function w$(e){var t=e.src,n=e.isCustomPlaceholder,r=e.fallback,o=f.exports.useState(n?"loading":"normal"),i=G(o,2),a=i[0],l=i[1],s=f.exports.useRef(!1),c=a==="error";f.exports.useEffect(function(){var h=!0;return $7(t).then(function(g){!g&&h&&l("error")}),function(){h=!1}},[t]),f.exports.useEffect(function(){n&&!s.current?l("loading"):c&&l("normal")},[t]);var u=function(){l("normal")},d=function(g){s.current=!1,a==="loading"&&g!==null&&g!==void 0&&g.complete&&(g.naturalWidth||g.naturalHeight)&&(s.current=!0,u())},v=c&&r?{src:r}:{onLoad:u,src:t};return[d,v,a]}function $a(e,t,n,r){var o=zu.unstable_batchedUpdates?function(a){zu.unstable_batchedUpdates(n,a)}:n;return e!=null&&e.addEventListener&&e.addEventListener(t,o,r),{remove:function(){e!=null&&e.removeEventListener&&e.removeEventListener(t,o,r)}}}var kc={x:0,y:0,rotate:0,scale:1,flipX:!1,flipY:!1};function E7(e,t,n,r){var o=f.exports.useRef(null),i=f.exports.useRef([]),a=f.exports.useState(kc),l=G(a,2),s=l[0],c=l[1],u=function(g){c(kc),r&&!Vs(kc,s)&&r({transform:kc,action:g})},d=function(g,p){o.current===null&&(i.current=[],o.current=St(function(){c(function(b){var m=b;return i.current.forEach(function(y){m=U(U({},m),y)}),o.current=null,r==null||r({transform:m,action:p}),m})})),i.current.push(U(U({},s),g))},v=function(g,p,b,m,y){var S=e.current,x=S.width,$=S.height,E=S.offsetWidth,w=S.offsetHeight,R=S.offsetLeft,P=S.offsetTop,N=g,I=s.scale*g;I>n?(I=n,N=n/s.scale):Ir){if(t>0)return V({},e,i);if(t<0&&or)return V({},e,t<0?i:-i);return{}}function $$(e,t,n,r){var o=x$(),i=o.width,a=o.height,l=null;return e<=i&&t<=a?l={x:0,y:0}:(e>i||t>a)&&(l=U(U({},l1("x",n,e,i)),l1("y",r,t,a))),l}var Ea=1,M7=1;function O7(e,t,n,r,o,i,a){var l=o.rotate,s=o.scale,c=o.x,u=o.y,d=f.exports.useState(!1),v=G(d,2),h=v[0],g=v[1],p=f.exports.useRef({diffX:0,diffY:0,transformX:0,transformY:0}),b=function($){!t||$.button!==0||($.preventDefault(),$.stopPropagation(),p.current={diffX:$.pageX-c,diffY:$.pageY-u,transformX:c,transformY:u},g(!0))},m=function($){n&&h&&i({x:$.pageX-p.current.diffX,y:$.pageY-p.current.diffY},"move")},y=function(){if(n&&h){g(!1);var $=p.current,E=$.transformX,w=$.transformY,R=c!==E&&u!==w;if(!R)return;var P=e.current.offsetWidth*s,N=e.current.offsetHeight*s,I=e.current.getBoundingClientRect(),z=I.left,F=I.top,T=l%180!==0,D=$$(T?N:P,T?P:N,z,F);D&&i(U({},D),"dragRebound")}},S=function($){if(!(!n||$.deltaY==0)){var E=Math.abs($.deltaY/100),w=Math.min(E,M7),R=Ea+w*r;$.deltaY>0&&(R=Ea/R),a(R,"wheel",$.clientX,$.clientY)}};return f.exports.useEffect(function(){var x,$,E,w;if(t){E=$a(window,"mouseup",y,!1),w=$a(window,"mousemove",m,!1);try{window.top!==window.self&&(x=$a(window.top,"mouseup",y,!1),$=$a(window.top,"mousemove",m,!1))}catch{}}return function(){var R,P,N,I;(R=E)===null||R===void 0||R.remove(),(P=w)===null||P===void 0||P.remove(),(N=x)===null||N===void 0||N.remove(),(I=$)===null||I===void 0||I.remove()}},[n,h,c,u,l,t]),{isMoving:h,onMouseDown:b,onMouseMove:m,onMouseUp:y,onWheel:S}}function id(e,t){var n=e.x-t.x,r=e.y-t.y;return Math.hypot(n,r)}function R7(e,t,n,r){var o=id(e,n),i=id(t,r);if(o===0&&i===0)return[e.x,e.y];var a=o/(o+i),l=e.x+a*(t.x-e.x),s=e.y+a*(t.y-e.y);return[l,s]}function I7(e,t,n,r,o,i,a){var l=o.rotate,s=o.scale,c=o.x,u=o.y,d=f.exports.useState(!1),v=G(d,2),h=v[0],g=v[1],p=f.exports.useRef({point1:{x:0,y:0},point2:{x:0,y:0},eventType:"none"}),b=function($){p.current=U(U({},p.current),$)},m=function($){if(!!t){$.stopPropagation(),g(!0);var E=$.touches,w=E===void 0?[]:E;w.length>1?b({point1:{x:w[0].clientX,y:w[0].clientY},point2:{x:w[1].clientX,y:w[1].clientY},eventType:"touchZoom"}):b({point1:{x:w[0].clientX-c,y:w[0].clientY-u},eventType:"move"})}},y=function($){var E=$.touches,w=E===void 0?[]:E,R=p.current,P=R.point1,N=R.point2,I=R.eventType;if(w.length>1&&I==="touchZoom"){var z={x:w[0].clientX,y:w[0].clientY},F={x:w[1].clientX,y:w[1].clientY},T=R7(P,N,z,F),D=G(T,2),_=D[0],O=D[1],M=id(z,F)/id(P,N);a(M,"touchZoom",_,O,!0),b({point1:z,point2:F,eventType:"touchZoom"})}else I==="move"&&(i({x:w[0].clientX-P.x,y:w[0].clientY-P.y},"move"),b({eventType:"move"}))},S=function(){if(!!n){if(h&&g(!1),b({eventType:"none"}),r>s)return i({x:0,y:0,scale:r},"touchZoom");var $=e.current.offsetWidth*s,E=e.current.offsetHeight*s,w=e.current.getBoundingClientRect(),R=w.left,P=w.top,N=l%180!==0,I=$$(N?E:$,N?$:E,R,P);I&&i(U({},I),"dragRebound")}};return f.exports.useEffect(function(){var x;return n&&t&&(x=$a(window,"touchmove",function($){return $.preventDefault()},{passive:!1})),function(){var $;($=x)===null||$===void 0||$.remove()}},[n,t]),{isTouching:h,onTouchStart:m,onTouchMove:y,onTouchEnd:S}}var P7=function(t){var n=t.visible,r=t.maskTransitionName,o=t.getContainer,i=t.prefixCls,a=t.rootClassName,l=t.icons,s=t.countRender,c=t.showSwitch,u=t.showProgress,d=t.current,v=t.transform,h=t.count,g=t.scale,p=t.minScale,b=t.maxScale,m=t.closeIcon,y=t.onSwitchLeft,S=t.onSwitchRight,x=t.onClose,$=t.onZoomIn,E=t.onZoomOut,w=t.onRotateRight,R=t.onRotateLeft,P=t.onFlipX,N=t.onFlipY,I=t.toolbarRender,z=t.zIndex,F=f.exports.useContext(ec),T=l.rotateLeft,D=l.rotateRight,_=l.zoomIn,O=l.zoomOut,M=l.close,L=l.left,A=l.right,B=l.flipX,k=l.flipY,j="".concat(i,"-operations-operation");f.exports.useEffect(function(){var K=function(ee){ee.keyCode===ue.ESC&&x()};return n&&window.addEventListener("keydown",K),function(){window.removeEventListener("keydown",K)}},[n]);var H=[{icon:k,onClick:N,type:"flipY"},{icon:B,onClick:P,type:"flipX"},{icon:T,onClick:R,type:"rotateLeft"},{icon:D,onClick:w,type:"rotateRight"},{icon:O,onClick:E,type:"zoomOut",disabled:g<=p},{icon:_,onClick:$,type:"zoomIn",disabled:g===b}],W=H.map(function(K){var q,ee=K.icon,Z=K.onClick,Q=K.type,ne=K.disabled;return C("div",{className:te(j,(q={},V(q,"".concat(i,"-operations-operation-").concat(Q),!0),V(q,"".concat(i,"-operations-operation-disabled"),!!ne),q)),onClick:Z,children:ee},Q)}),Y=C("div",{className:"".concat(i,"-operations"),children:W});return C(to,{visible:n,motionName:r,children:function(K){var q=K.className,ee=K.style;return C(nf,{open:!0,getContainer:o!=null?o:document.body,children:ie("div",{className:te("".concat(i,"-operations-wrapper"),q,a),style:U(U({},ee),{},{zIndex:z}),children:[m===null?null:C("button",{className:"".concat(i,"-close"),onClick:x,children:m||M}),c&&ie(Tt,{children:[C("div",{className:te("".concat(i,"-switch-left"),V({},"".concat(i,"-switch-left-disabled"),d===0)),onClick:y,children:L}),C("div",{className:te("".concat(i,"-switch-right"),V({},"".concat(i,"-switch-right-disabled"),d===h-1)),onClick:S,children:A})]}),ie("div",{className:"".concat(i,"-footer"),children:[u&&C("div",{className:"".concat(i,"-progress"),children:s?s(d+1,h):"".concat(d+1," / ").concat(h)}),I?I(Y,U({icons:{flipYIcon:W[0],flipXIcon:W[1],rotateLeftIcon:W[2],rotateRightIcon:W[3],zoomOutIcon:W[4],zoomInIcon:W[5]},actions:{onFlipY:N,onFlipX:P,onRotateLeft:R,onRotateRight:w,onZoomOut:E,onZoomIn:$},transform:v},F?{current:d,total:h}:{})):Y]})]})})}})},T7=["fallback","src","imgRef"],N7=["prefixCls","src","alt","fallback","movable","onClose","visible","icons","rootClassName","closeIcon","getContainer","current","count","countRender","scaleStep","minScale","maxScale","transitionName","maskTransitionName","imageRender","imgCommonProps","toolbarRender","onTransform","onChange"],_7=function(t){var n=t.fallback,r=t.src,o=t.imgRef,i=Je(t,T7),a=w$({src:r,fallback:n}),l=G(a,2),s=l[0],c=l[1];return C("img",{ref:function(d){o.current=d,s(d)},...i,...c})},E$=function(t){var n=t.prefixCls,r=t.src,o=t.alt,i=t.fallback,a=t.movable,l=a===void 0?!0:a,s=t.onClose,c=t.visible,u=t.icons,d=u===void 0?{}:u,v=t.rootClassName,h=t.closeIcon,g=t.getContainer,p=t.current,b=p===void 0?0:p,m=t.count,y=m===void 0?1:m,S=t.countRender,x=t.scaleStep,$=x===void 0?.5:x,E=t.minScale,w=E===void 0?1:E,R=t.maxScale,P=R===void 0?50:R,N=t.transitionName,I=N===void 0?"zoom":N,z=t.maskTransitionName,F=z===void 0?"fade":z,T=t.imageRender,D=t.imgCommonProps,_=t.toolbarRender,O=t.onTransform,M=t.onChange,L=Je(t,N7),A=f.exports.useRef(),B=f.exports.useContext(ec),k=B&&y>1,j=B&&y>=1,H=f.exports.useState(!0),W=G(H,2),Y=W[0],K=W[1],q=E7(A,w,P,O),ee=q.transform,Z=q.resetTransform,Q=q.updateTransform,ne=q.dispatchZoomChange,ae=O7(A,l,c,$,ee,Q,ne),J=ae.isMoving,re=ae.onMouseDown,fe=ae.onWheel,ve=I7(A,l,c,w,ee,Q,ne),pe=ve.isTouching,oe=ve.onTouchStart,se=ve.onTouchMove,le=ve.onTouchEnd,Ce=ee.rotate,ce=ee.scale,de=te(V({},"".concat(n,"-moving"),J));f.exports.useEffect(function(){Y||K(!0)},[Y]);var xe=function(){Z("close")},he=function(){ne(Ea+$,"zoomIn")},ke=function(){ne(Ea/(Ea+$),"zoomOut")},we=function(){Q({rotate:Ce+90},"rotateRight")},ge=function(){Q({rotate:Ce-90},"rotateLeft")},Pe=function(){Q({flipX:!ee.flipX},"flipX")},Se=function(){Q({flipY:!ee.flipY},"flipY")},st=function(qe){qe==null||qe.preventDefault(),qe==null||qe.stopPropagation(),b>0&&(K(!1),Z("prev"),M==null||M(b-1,b))},nt=function(qe){qe==null||qe.preventDefault(),qe==null||qe.stopPropagation(),b({position:e||"absolute",inset:0}),B7=e=>{const{iconCls:t,motionDurationSlow:n,paddingXXS:r,marginXXS:o,prefixCls:i,colorTextLightSolid:a}=e;return{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:a,background:new Mt("#000").setAlpha(.5).toRgbString(),cursor:"pointer",opacity:0,transition:`opacity ${n}`,[`.${i}-mask-info`]:Object.assign(Object.assign({},ei),{padding:`0 ${X(r)}`,[t]:{marginInlineEnd:o,svg:{verticalAlign:"baseline"}}})}},j7=e=>{const{previewCls:t,modalMaskBg:n,paddingSM:r,marginXL:o,margin:i,paddingLG:a,previewOperationColorDisabled:l,previewOperationHoverColor:s,motionDurationSlow:c,iconCls:u,colorTextLightSolid:d}=e,v=new Mt(n).setAlpha(.1),h=v.clone().setAlpha(.2);return{[`${t}-footer`]:{position:"fixed",bottom:o,left:{_skip_check_:!0,value:0},width:"100%",display:"flex",flexDirection:"column",alignItems:"center",color:e.previewOperationColor},[`${t}-progress`]:{marginBottom:i},[`${t}-close`]:{position:"fixed",top:o,right:{_skip_check_:!0,value:o},display:"flex",color:d,backgroundColor:v.toRgbString(),borderRadius:"50%",padding:r,outline:0,border:0,cursor:"pointer",transition:`all ${c}`,"&:hover":{backgroundColor:h.toRgbString()},[`& > ${u}`]:{fontSize:e.previewOperationSize}},[`${t}-operations`]:{display:"flex",alignItems:"center",padding:`0 ${X(a)}`,backgroundColor:v.toRgbString(),borderRadius:100,"&-operation":{marginInlineStart:r,padding:r,cursor:"pointer",transition:`all ${c}`,userSelect:"none",[`&:not(${t}-operations-operation-disabled):hover > ${u}`]:{color:s},"&-disabled":{color:l,cursor:"not-allowed"},"&:first-of-type":{marginInlineStart:0},[`& > ${u}`]:{fontSize:e.previewOperationSize}}}}},H7=e=>{const{modalMaskBg:t,iconCls:n,previewOperationColorDisabled:r,previewCls:o,zIndexPopup:i,motionDurationSlow:a}=e,l=new Mt(t).setAlpha(.1),s=l.clone().setAlpha(.2);return{[`${o}-switch-left, ${o}-switch-right`]:{position:"fixed",insetBlockStart:"50%",zIndex:e.calc(i).add(1).equal({unit:!1}),display:"flex",alignItems:"center",justifyContent:"center",width:e.imagePreviewSwitchSize,height:e.imagePreviewSwitchSize,marginTop:e.calc(e.imagePreviewSwitchSize).mul(-1).div(2).equal(),color:e.previewOperationColor,background:l.toRgbString(),borderRadius:"50%",transform:"translateY(-50%)",cursor:"pointer",transition:`all ${a}`,userSelect:"none","&:hover":{background:s.toRgbString()},["&-disabled"]:{"&, &:hover":{color:r,background:"transparent",cursor:"not-allowed",[`> ${n}`]:{cursor:"not-allowed"}}},[`> ${n}`]:{fontSize:e.previewOperationSize}},[`${o}-switch-left`]:{insetInlineStart:e.marginSM},[`${o}-switch-right`]:{insetInlineEnd:e.marginSM}}},W7=e=>{const{motionEaseOut:t,previewCls:n,motionDurationSlow:r,componentCls:o}=e;return[{[`${o}-preview-root`]:{[n]:{height:"100%",textAlign:"center",pointerEvents:"none"},[`${n}-body`]:Object.assign(Object.assign({},Tg()),{overflow:"hidden"}),[`${n}-img`]:{maxWidth:"100%",maxHeight:"70%",verticalAlign:"middle",transform:"scale3d(1, 1, 1)",cursor:"grab",transition:`transform ${r} ${t} 0s`,userSelect:"none","&-wrapper":Object.assign(Object.assign({},Tg()),{transition:`transform ${r} ${t} 0s`,display:"flex",justifyContent:"center",alignItems:"center","& > *":{pointerEvents:"auto"},"&::before":{display:"inline-block",width:1,height:"50%",marginInlineEnd:-1,content:'""'}})},[`${n}-moving`]:{[`${n}-preview-img`]:{cursor:"grabbing","&-wrapper":{transitionDuration:"0s"}}}}},{[`${o}-preview-root`]:{[`${n}-wrap`]:{zIndex:e.zIndexPopup}}},{[`${o}-preview-operations-wrapper`]:{position:"fixed",zIndex:e.calc(e.zIndexPopup).add(1).equal({unit:!1})},"&":[j7(e),H7(e)]}]},V7=e=>{const{componentCls:t}=e;return{[t]:{position:"relative",display:"inline-block",[`${t}-img`]:{width:"100%",height:"auto",verticalAlign:"middle"},[`${t}-img-placeholder`]:{backgroundColor:e.colorBgContainerDisabled,backgroundImage:"url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundSize:"30%"},[`${t}-mask`]:Object.assign({},B7(e)),[`${t}-mask:hover`]:{opacity:1},[`${t}-placeholder`]:Object.assign({},Tg())}}},U7=e=>{const{previewCls:t}=e;return{[`${t}-root`]:of(e,"zoom"),["&"]:zw(e,!0)}},Y7=e=>({zIndexPopup:e.zIndexPopupBase+80,previewOperationColor:new Mt(e.colorTextLightSolid).setAlpha(.65).toRgbString(),previewOperationHoverColor:new Mt(e.colorTextLightSolid).setAlpha(.85).toRgbString(),previewOperationColorDisabled:new Mt(e.colorTextLightSolid).setAlpha(.25).toRgbString(),previewOperationSize:e.fontSizeIcon*1.5}),M$=vn("Image",e=>{const t=`${e.componentCls}-preview`,n=$t(e,{previewCls:t,modalMaskBg:new Mt("#000").setAlpha(.45).toRgbString(),imagePreviewSwitchSize:e.controlHeightLG});return[V7(n),W7(n),Fw($t(n,{componentCls:t})),U7(n)]},Y7);var G7=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o{var{previewPrefixCls:t,preview:n}=e,r=G7(e,["previewPrefixCls","preview"]);const{getPrefixCls:o}=f.exports.useContext(ot),i=o("image",t),a=`${i}-preview`,l=o(),s=no(i),[c,u,d]=M$(i,s),[v]=Qd("ImagePreview",typeof n=="object"?n.zIndex:void 0),h=f.exports.useMemo(()=>{var g;if(n===!1)return n;const p=typeof n=="object"?n:{},b=te(u,d,s,(g=p.rootClassName)!==null&&g!==void 0?g:"");return Object.assign(Object.assign({},p),{transitionName:ni(l,"zoom",p.transitionName),maskTransitionName:ni(l,"fade",p.maskTransitionName),rootClassName:b,zIndex:v})},[n]);return c(C(hf.PreviewGroup,{...Object.assign({preview:h,previewPrefixCls:a,icons:O$},r)}))},q7=K7;var s1=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o{var t;const{prefixCls:n,preview:r,className:o,rootClassName:i,style:a}=e,l=s1(e,["prefixCls","preview","className","rootClassName","style"]),{getPrefixCls:s,locale:c=Jo,getPopupContainer:u,image:d}=f.exports.useContext(ot),v=s("image",n),h=s(),g=c.Image||Jo.Image,p=no(v),[b,m,y]=M$(v,p),S=te(i,m,y,p),x=te(o,m,d==null?void 0:d.className),[$]=Qd("ImagePreview",typeof r=="object"?r.zIndex:void 0),E=f.exports.useMemo(()=>{var R;if(r===!1)return r;const P=typeof r=="object"?r:{},{getContainer:N,closeIcon:I}=P,z=s1(P,["getContainer","closeIcon"]);return Object.assign(Object.assign({mask:ie("div",{className:`${v}-mask-info`,children:[C(sx,{}),g==null?void 0:g.preview]}),icons:O$},z),{getContainer:N!=null?N:u,transitionName:ni(h,"zoom",P.transitionName),maskTransitionName:ni(h,"fade",P.maskTransitionName),zIndex:$,closeIcon:I!=null?I:(R=d==null?void 0:d.preview)===null||R===void 0?void 0:R.closeIcon})},[r,g,(t=d==null?void 0:d.preview)===null||t===void 0?void 0:t.closeIcon]),w=Object.assign(Object.assign({},d==null?void 0:d.style),a);return b(C(hf,{...Object.assign({prefixCls:v,preview:E,rootClassName:S,className:x,style:w},l)}))};R$.PreviewGroup=q7;const cu=R$,X7=new Ct("antSpinMove",{to:{opacity:1}}),Q7=new Ct("antRotate",{to:{transform:"rotate(405deg)"}}),Z7=e=>{const{componentCls:t,calc:n}=e;return{[`${t}`]:Object.assign(Object.assign({},Qt(e)),{position:"absolute",display:"none",color:e.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`,"&-spinning":{position:"static",display:"inline-block",opacity:1},[`${t}-text`]:{fontSize:e.fontSize,paddingTop:n(n(e.dotSize).sub(e.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:`all ${e.motionDurationMid}`,"&-show":{opacity:1,visibility:"visible"},[`${t}-dot ${t}-dot-item`]:{backgroundColor:e.colorWhite},[`${t}-text`]:{color:e.colorTextLightSolid}},"&-nested-loading":{position:"relative",[`> div > ${t}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:e.contentHeight,[`${t}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(e.dotSize).mul(-1).div(2).equal()},[`${t}-text`]:{position:"absolute",top:"50%",width:"100%",textShadow:`0 1px 2px ${e.colorBgContainer}`},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{[`${t}-dot`]:{margin:n(e.dotSizeSM).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:n(n(e.dotSizeSM).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{[`${t}-dot`]:{margin:n(e.dotSizeLG).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:n(n(e.dotSizeLG).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},[`${t}-container`]:{position:"relative",transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${t}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none",["&::after"]:{opacity:.4,pointerEvents:"auto"}}},["&-tip"]:{color:e.spinDotDefault},[`${t}-dot`]:{position:"relative",display:"inline-block",fontSize:e.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),height:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),backgroundColor:e.colorPrimary,borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:X7,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:Q7,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&-sm ${t}-dot`]:{fontSize:e.dotSizeSM,i:{width:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal(),height:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal()}},[`&-lg ${t}-dot`]:{fontSize:e.dotSizeLG,i:{width:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal(),height:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal()}},[`&${t}-show-text ${t}-text`]:{display:"block"}})}},J7=e=>{const{controlHeightLG:t,controlHeight:n}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:t*.35,dotSizeLG:n}},eB=vn("Spin",e=>{const t=$t(e,{spinDotDefault:e.colorTextDescription});return[Z7(t)]},J7);var tB=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o{const{prefixCls:t,spinning:n=!0,delay:r=0,className:o,rootClassName:i,size:a="default",tip:l,wrapperClassName:s,style:c,children:u,fullscreen:d=!1}=e,v=tB(e,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen"]),{getPrefixCls:h}=f.exports.useContext(ot),g=h("spin",t),[p,b,m]=eB(g),[y,S]=f.exports.useState(()=>n&&!rB(n,r));f.exports.useEffect(()=>{if(n){const z=Hk(r,()=>{S(!0)});return z(),()=>{var F;(F=z==null?void 0:z.cancel)===null||F===void 0||F.call(z)}}S(!1)},[r,n]);const x=f.exports.useMemo(()=>typeof u<"u"&&!d,[u,d]),{direction:$,spin:E}=f.exports.useContext(ot),w=te(g,E==null?void 0:E.className,{[`${g}-sm`]:a==="small",[`${g}-lg`]:a==="large",[`${g}-spinning`]:y,[`${g}-show-text`]:!!l,[`${g}-fullscreen`]:d,[`${g}-fullscreen-show`]:d&&y,[`${g}-rtl`]:$==="rtl"},o,i,b,m),R=te(`${g}-container`,{[`${g}-blur`]:y}),P=lr(v,["indicator"]),N=Object.assign(Object.assign({},E==null?void 0:E.style),c),I=ie("div",{...Object.assign({},P,{style:N,className:w,"aria-live":"polite","aria-busy":y}),children:[nB(g,e),l&&(x||d)?C("div",{className:`${g}-text`,children:l}):null]});return p(x?ie("div",{...Object.assign({},P,{className:te(`${g}-nested-loading`,s,b,m)}),children:[y&&C("div",{children:I},"loading"),C("div",{className:R,children:u},"container")]}):I)};I$.setDefaultIndicator=e=>{uu=e};const oB=I$;var iB={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},aB=function(){var t=f.exports.useRef([]),n=f.exports.useRef(null);return f.exports.useEffect(function(){var r=Date.now(),o=!1;t.current.forEach(function(i){if(!!i){o=!0;var a=i.style;a.transitionDuration=".3s, .3s, .3s, .06s",n.current&&r-n.current<100&&(a.transitionDuration="0s, 0s")}}),o&&(n.current=Date.now())}),t.current},c1=0,lB=Rn();function sB(){var e;return lB?(e=c1,c1+=1):e="TEST_OR_SSR",e}const cB=function(e){var t=f.exports.useState(),n=G(t,2),r=n[0],o=n[1];return f.exports.useEffect(function(){o("rc_progress_".concat(sB()))},[]),e||r};var u1=function(t){var n=t.bg,r=t.children;return C("div",{style:{width:"100%",height:"100%",background:n},children:r})};function d1(e,t){return Object.keys(e).map(function(n){var r=parseFloat(n),o="".concat(Math.floor(r*t),"%");return"".concat(e[n]," ").concat(o)})}var uB=f.exports.forwardRef(function(e,t){var n=e.prefixCls,r=e.color,o=e.gradientId,i=e.radius,a=e.style,l=e.ptg,s=e.strokeLinecap,c=e.strokeWidth,u=e.size,d=e.gapDegree,v=r&&Qe(r)==="object",h=v?"#FFF":void 0,g=u/2,p=C("circle",{className:"".concat(n,"-circle-path"),r:i,cx:g,cy:g,stroke:h,strokeLinecap:s,strokeWidth:c,opacity:l===0?0:1,style:a,ref:t});if(!v)return p;var b="".concat(o,"-conic"),m=d?"".concat(180+d/2,"deg"):"0deg",y=d1(r,(360-d)/360),S=d1(r,1),x="conic-gradient(from ".concat(m,", ").concat(y.join(", "),")"),$="linear-gradient(to ".concat(d?"bottom":"top",", ").concat(S.join(", "),")");return ie(Tt,{children:[C("mask",{id:b,children:p}),C("foreignObject",{x:0,y:0,width:u,height:u,mask:"url(#".concat(b,")"),children:C(u1,{bg:$,children:C(u1,{bg:x})})})]})}),Dl=100,Iv=function(t,n,r,o,i,a,l,s,c,u){var d=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,v=r/100*360*((360-a)/360),h=a===0?0:{bottom:0,top:180,left:90,right:-90}[l],g=(100-o)/100*n;c==="round"&&o!==100&&(g+=u/2,g>=n&&(g=n-.01));var p=Dl/2;return{stroke:typeof s=="string"?s:void 0,strokeDasharray:"".concat(n,"px ").concat(t),strokeDashoffset:g+d,transform:"rotate(".concat(i+v+h,"deg)"),transformOrigin:"".concat(p,"px ").concat(p,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},dB=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function f1(e){var t=e!=null?e:[];return Array.isArray(t)?t:[t]}var fB=function(t){var n=U(U({},iB),t),r=n.id,o=n.prefixCls,i=n.steps,a=n.strokeWidth,l=n.trailWidth,s=n.gapDegree,c=s===void 0?0:s,u=n.gapPosition,d=n.trailColor,v=n.strokeLinecap,h=n.style,g=n.className,p=n.strokeColor,b=n.percent,m=Je(n,dB),y=Dl/2,S=cB(r),x="".concat(S,"-gradient"),$=y-a/2,E=Math.PI*2*$,w=c>0?90+c/2:-90,R=E*((360-c)/360),P=Qe(i)==="object"?i:{count:i,space:2},N=P.count,I=P.space,z=f1(b),F=f1(p),T=F.find(function(B){return B&&Qe(B)==="object"}),D=T&&Qe(T)==="object",_=D?"butt":v,O=Iv(E,R,0,100,w,c,u,d,_,a),M=aB(),L=function(){var k=0;return z.map(function(j,H){var W=F[H]||F[F.length-1],Y=Iv(E,R,k,j,w,c,u,W,_,a);return k+=j,C(uB,{color:W,ptg:j,radius:$,prefixCls:o,gradientId:x,style:Y,strokeLinecap:_,strokeWidth:a,gapDegree:c,ref:function(q){M[H]=q},size:Dl},H)}).reverse()},A=function(){var k=Math.round(N*(z[0]/100)),j=100/N,H=0;return new Array(N).fill(null).map(function(W,Y){var K=Y<=k-1?F[0]:d,q=K&&Qe(K)==="object"?"url(#".concat(x,")"):void 0,ee=Iv(E,R,H,j,w,c,u,K,"butt",a,I);return H+=(R-ee.strokeDashoffset+I)*100/R,C("circle",{className:"".concat(o,"-circle-path"),r:$,cx:y,cy:y,stroke:q,strokeWidth:a,opacity:1,style:ee,ref:function(Q){M[Y]=Q}},Y)})};return ie("svg",{className:te("".concat(o,"-circle"),g),viewBox:"0 0 ".concat(Dl," ").concat(Dl),style:h,id:r,role:"presentation",...m,children:[!N&&C("circle",{className:"".concat(o,"-circle-trail"),r:$,cx:y,cy:y,stroke:d,strokeLinecap:_,strokeWidth:l||a,style:O}),N?A():L()]})};function Go(e){return!e||e<0?0:e>100?100:e}function ad(e){let{success:t,successPercent:n}=e,r=n;return t&&"progress"in t&&(r=t.progress),t&&"percent"in t&&(r=t.percent),r}const vB=e=>{let{percent:t,success:n,successPercent:r}=e;const o=Go(ad({success:n,successPercent:r}));return[o,Go(Go(t)-o)]},pB=e=>{let{success:t={},strokeColor:n}=e;const{strokeColor:r}=t;return[r||Na.green,n||null]},mf=(e,t,n)=>{var r,o,i,a;let l=-1,s=-1;if(t==="step"){const c=n.steps,u=n.strokeWidth;typeof e=="string"||typeof e>"u"?(l=e==="small"?2:14,s=u!=null?u:8):typeof e=="number"?[l,s]=[e,e]:[l=14,s=8]=e,l*=c}else if(t==="line"){const c=n==null?void 0:n.strokeWidth;typeof e=="string"||typeof e>"u"?s=c||(e==="small"?6:8):typeof e=="number"?[l,s]=[e,e]:[l=-1,s=8]=e}else(t==="circle"||t==="dashboard")&&(typeof e=="string"||typeof e>"u"?[l,s]=e==="small"?[60,60]:[120,120]:typeof e=="number"?[l,s]=[e,e]:(l=(o=(r=e[0])!==null&&r!==void 0?r:e[1])!==null&&o!==void 0?o:120,s=(a=(i=e[0])!==null&&i!==void 0?i:e[1])!==null&&a!==void 0?a:120));return[l,s]},gB=3,hB=e=>gB/e*100,mB=e=>{const{prefixCls:t,trailColor:n=null,strokeLinecap:r="round",gapPosition:o,gapDegree:i,width:a=120,type:l,children:s,success:c,size:u=a}=e,[d,v]=mf(u,"circle");let{strokeWidth:h}=e;h===void 0&&(h=Math.max(hB(d),6));const g={width:d,height:v,fontSize:d*.15+6},p=f.exports.useMemo(()=>{if(i||i===0)return i;if(l==="dashboard")return 75},[i,l]),b=o||l==="dashboard"&&"bottom"||void 0,m=Object.prototype.toString.call(e.strokeColor)==="[object Object]",y=pB({success:c,strokeColor:e.strokeColor}),S=te(`${t}-inner`,{[`${t}-circle-gradient`]:m}),x=C(fB,{percent:vB(e),strokeWidth:h,trailWidth:h,strokeColor:y,strokeLinecap:r,trailColor:n,prefixCls:t,gapDegree:p,gapPosition:b});return C("div",{className:S,style:g,children:d<=20?C(p2,{title:s,children:C("span",{children:x})}):ie(Tt,{children:[x,s]})})},yB=mB,ld="--progress-line-stroke-color",P$="--progress-percent",v1=e=>{const t=e?"100%":"-100%";return new Ct(`antProgress${e?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${t}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${t}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},bB=e=>{const{componentCls:t,iconCls:n}=e;return{[t]:Object.assign(Object.assign({},Qt(e)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:e.fontSize},[`${t}-outer`]:{display:"inline-block",width:"100%"},[`&${t}-show-info`]:{[`${t}-outer`]:{marginInlineEnd:`calc(-2em - ${X(e.marginXS)})`,paddingInlineEnd:`calc(2em + ${X(e.paddingXS)})`}},[`${t}-inner`]:{position:"relative",display:"inline-block",width:"100%",overflow:"hidden",verticalAlign:"middle",backgroundColor:e.remainingColor,borderRadius:e.lineBorderRadius},[`${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.defaultColor}},[`${t}-success-bg, ${t}-bg`]:{position:"relative",background:e.defaultColor,borderRadius:e.lineBorderRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${t}-bg`]:{overflow:"hidden","&::after":{content:'""',background:{_multi_value_:!0,value:["inherit",`var(${ld})`]},height:"100%",width:`calc(1 / var(${P$}) * 100%)`,display:"block"}},[`${t}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${t}-text`]:{display:"inline-block",width:"2em",marginInlineStart:e.marginXS,color:e.colorText,lineHeight:1,whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[n]:{fontSize:e.fontSize}},[`&${t}-status-active`]:{[`${t}-bg::before`]:{position:"absolute",inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.lineBorderRadius,opacity:0,animationName:v1(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${t}-rtl${t}-status-active`]:{[`${t}-bg::before`]:{animationName:v1(!0)}},[`&${t}-status-exception`]:{[`${t}-bg`]:{backgroundColor:e.colorError},[`${t}-text`]:{color:e.colorError}},[`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorError}},[`&${t}-status-success`]:{[`${t}-bg`]:{backgroundColor:e.colorSuccess},[`${t}-text`]:{color:e.colorSuccess}},[`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorSuccess}}})}},SB=e=>{const{componentCls:t,iconCls:n}=e;return{[t]:{[`${t}-circle-trail`]:{stroke:e.remainingColor},[`&${t}-circle ${t}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${t}-circle ${t}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:e.circleTextColor,fontSize:e.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[n]:{fontSize:e.circleIconFontSize}},[`${t}-circle&-status-exception`]:{[`${t}-text`]:{color:e.colorError}},[`${t}-circle&-status-success`]:{[`${t}-text`]:{color:e.colorSuccess}}},[`${t}-inline-circle`]:{lineHeight:1,[`${t}-inner`]:{verticalAlign:"bottom"}}}},CB=e=>{const{componentCls:t}=e;return{[t]:{[`${t}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.remainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.defaultColor}}}}}},xB=e=>{const{componentCls:t,iconCls:n}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-text ${n}`]:{fontSize:e.fontSizeSM}}}},wB=e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em",circleIconFontSize:`${e.fontSize/e.fontSizeSM}em`}),$B=vn("Progress",e=>{const t=e.calc(e.marginXXS).div(2).equal(),n=$t(e,{progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:"2.4s"});return[bB(n),SB(n),CB(n),xB(n)]},wB);var EB=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o{let t=[];return Object.keys(e).forEach(n=>{const r=parseFloat(n.replace(/%/g,""));isNaN(r)||t.push({key:r,value:e[n]})}),t=t.sort((n,r)=>n.key-r.key),t.map(n=>{let{key:r,value:o}=n;return`${o} ${r}%`}).join(", ")},OB=(e,t)=>{const{from:n=Na.blue,to:r=Na.blue,direction:o=t==="rtl"?"to left":"to right"}=e,i=EB(e,["from","to","direction"]);if(Object.keys(i).length!==0){const l=MB(i),s=`linear-gradient(${o}, ${l})`;return{background:s,[ld]:s}}const a=`linear-gradient(${o}, ${n}, ${r})`;return{background:a,[ld]:a}},RB=e=>{const{prefixCls:t,direction:n,percent:r,size:o,strokeWidth:i,strokeColor:a,strokeLinecap:l="round",children:s,trailColor:c=null,success:u}=e,d=a&&typeof a!="string"?OB(a,n):{[ld]:a,background:a},v=l==="square"||l==="butt"?0:void 0,h=o!=null?o:[-1,i||(o==="small"?6:8)],[g,p]=mf(h,"line",{strokeWidth:i}),b={backgroundColor:c||void 0,borderRadius:v},m=Object.assign(Object.assign({width:`${Go(r)}%`,height:p,borderRadius:v},d),{[P$]:Go(r)/100}),y=ad(e),S={width:`${Go(y)}%`,height:p,borderRadius:v,backgroundColor:u==null?void 0:u.strokeColor},x={width:g<0?"100%":g,height:p};return ie(Tt,{children:[C("div",{className:`${t}-outer`,style:x,children:ie("div",{className:`${t}-inner`,style:b,children:[C("div",{className:`${t}-bg`,style:m}),y!==void 0?C("div",{className:`${t}-success-bg`,style:S}):null]})}),s]})},IB=RB,PB=e=>{const{size:t,steps:n,percent:r=0,strokeWidth:o=8,strokeColor:i,trailColor:a=null,prefixCls:l,children:s}=e,c=Math.round(n*(r/100)),u=t==="small"?2:14,d=t!=null?t:[u,o],[v,h]=mf(d,"step",{steps:n,strokeWidth:o}),g=v/n,p=new Array(n);for(let b=0;b{const{prefixCls:n,className:r,rootClassName:o,steps:i,strokeColor:a,percent:l=0,size:s="default",showInfo:c=!0,type:u="line",status:d,format:v,style:h}=e,g=NB(e,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style"]),p=f.exports.useMemo(()=>{var F,T;const D=ad(e);return parseInt(D!==void 0?(F=D!=null?D:0)===null||F===void 0?void 0:F.toString():(T=l!=null?l:0)===null||T===void 0?void 0:T.toString(),10)},[l,e.success,e.successPercent]),b=f.exports.useMemo(()=>!_B.includes(d)&&p>=100?"success":d||"normal",[d,p]),{getPrefixCls:m,direction:y,progress:S}=f.exports.useContext(ot),x=m("progress",n),[$,E,w]=$B(x),R=f.exports.useMemo(()=>{if(!c)return null;const F=ad(e);let T;const D=v||(O=>`${O}%`),_=u==="line";return v||b!=="exception"&&b!=="success"?T=D(Go(l),Go(F)):b==="exception"?T=_?C(Nd,{}):C(eo,{}):b==="success"&&(T=_?C(NI,{}):C(lx,{})),C("span",{className:`${x}-text`,title:typeof T=="string"?T:void 0,children:T})},[c,l,p,b,u,x,v]),P=Array.isArray(a)?a[0]:a,N=typeof a=="string"||Array.isArray(a)?a:void 0;let I;u==="line"?I=i?C(TB,{...Object.assign({},e,{strokeColor:N,prefixCls:x,steps:i}),children:R}):C(IB,{...Object.assign({},e,{strokeColor:P,prefixCls:x,direction:y}),children:R}):(u==="circle"||u==="dashboard")&&(I=C(yB,{...Object.assign({},e,{strokeColor:P,prefixCls:x,progressStatus:b}),children:R}));const z=te(x,`${x}-status-${b}`,`${x}-${u==="dashboard"&&"circle"||i&&"steps"||u}`,{[`${x}-inline-circle`]:u==="circle"&&mf(s,"circle")[0]<=20,[`${x}-show-info`]:c,[`${x}-${s}`]:typeof s=="string",[`${x}-rtl`]:y==="rtl"},S==null?void 0:S.className,r,o,E,w);return $(C("div",{...Object.assign({ref:t,style:Object.assign(Object.assign({},S==null?void 0:S.style),h),className:z,role:"progressbar","aria-valuenow":p},lr(g,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),children:I}))}),DB=AB,LB=e=>{const{paddingXXS:t,lineWidth:n,tagPaddingHorizontal:r,componentCls:o,calc:i}=e,a=i(r).sub(n).equal(),l=i(t).sub(n).equal();return{[o]:Object.assign(Object.assign({},Qt(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:a,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${X(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${o}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${o}-close-icon`]:{marginInlineStart:l,fontSize:e.tagIconSize,color:e.colorTextDescription,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${o}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},["&-checkable"]:{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${o}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},["&-hidden"]:{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:a}}),[`${o}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}},Nm=e=>{const{lineWidth:t,fontSizeIcon:n,calc:r}=e,o=e.fontSizeSM;return $t(e,{tagFontSize:o,tagLineHeight:X(r(e.lineHeightSM).mul(o).equal()),tagIconSize:r(n).sub(r(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},_m=e=>({defaultBg:new Mt(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText}),T$=vn("Tag",e=>{const t=Nm(e);return LB(t)},_m);var zB=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o{const{prefixCls:n,style:r,className:o,checked:i,onChange:a,onClick:l}=e,s=zB(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:c,tag:u}=f.exports.useContext(ot),d=m=>{a==null||a(!i),l==null||l(m)},v=c("tag",n),[h,g,p]=T$(v),b=te(v,`${v}-checkable`,{[`${v}-checkable-checked`]:i},u==null?void 0:u.className,o,g,p);return h(C("span",{...Object.assign({},s,{ref:t,style:Object.assign(Object.assign({},r),u==null?void 0:u.style),className:b,onClick:d})}))}),kB=FB,BB=e=>ow(e,(t,n)=>{let{textColor:r,lightBorderColor:o,lightColor:i,darkColor:a}=n;return{[`${e.componentCls}${e.componentCls}-${t}`]:{color:r,background:i,borderColor:o,"&-inverse":{color:e.colorTextLightSolid,background:a,borderColor:a},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}}),jB=Kh(["Tag","preset"],e=>{const t=Nm(e);return BB(t)},_m);function HB(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}const Bc=(e,t,n)=>{const r=HB(n);return{[`${e.componentCls}${e.componentCls}-${t}`]:{color:e[`color${n}`],background:e[`color${r}Bg`],borderColor:e[`color${r}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}},WB=Kh(["Tag","status"],e=>{const t=Nm(e);return[Bc(t,"success","Success"),Bc(t,"processing","Info"),Bc(t,"error","Error"),Bc(t,"warning","Warning")]},_m);var VB=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o{const{prefixCls:n,className:r,rootClassName:o,style:i,children:a,icon:l,color:s,onClose:c,closeIcon:u,closable:d,bordered:v=!0}=e,h=VB(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:g,direction:p,tag:b}=f.exports.useContext(ot),[m,y]=f.exports.useState(!0);f.exports.useEffect(()=>{"visible"in h&&y(h.visible)},[h.visible]);const S=d2(s),x=ID(s),$=S||x,E=Object.assign(Object.assign({backgroundColor:s&&!$?s:void 0},b==null?void 0:b.style),i),w=g("tag",n),[R,P,N]=T$(w),I=te(w,b==null?void 0:b.className,{[`${w}-${s}`]:$,[`${w}-has-color`]:s&&!$,[`${w}-hidden`]:!m,[`${w}-rtl`]:p==="rtl",[`${w}-borderless`]:!v},r,o,P,N),z=M=>{M.stopPropagation(),c==null||c(M),!M.defaultPrevented&&y(!1)},[,F]=m6(d,u!=null?u:b==null?void 0:b.closeIcon,M=>M===null?C(eo,{className:`${w}-close-icon`,onClick:z}):C("span",{className:`${w}-close-icon`,onClick:z,children:M}),null,!1),T=typeof h.onClick=="function"||a&&a.type==="a",D=l||null,_=D?ie(Tt,{children:[D,a&&C("span",{children:a})]}):a,O=ie("span",{...Object.assign({},h,{ref:t,className:I,style:E}),children:[_,F,S&&C(jB,{prefixCls:w},"preset"),x&&C(WB,{prefixCls:w},"status")]});return R(T?C(Qh,{component:"Tag",children:O}):O)},N$=f.exports.forwardRef(UB);N$.CheckableTag=kB;const oa=N$;function YB(e){return window.go.main.App.ExportWeChatAllData(e)}function GB(){return window.go.main.App.GetAppVersion()}function KB(){return window.go.main.App.GetWeChatAllInfo()}function qB(e){return window.go.main.App.GetWeChatRoomUserList(e)}function XB(e){return window.go.main.App.GetWechatMessageDate(e)}function QB(e,t,n,r,o){return window.go.main.App.GetWechatMessageListByKeyWord(e,t,n,r,o)}function p1(e,t,n,r){return window.go.main.App.GetWechatMessageListByTime(e,t,n,r)}function ZB(e,t){return window.go.main.App.GetWechatSessionList(e,t)}function JB(e,t){return window.go.main.App.OpenFileOrExplorer(e,t)}function e9(){return window.go.main.App.WeChatInit()}const t9="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Am=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=t9[n[e]&63];return t};function Ts(e){window.runtime.LogInfo(e)}function n9(e,t,n){return window.runtime.EventsOnMultiple(e,t,n)}function _$(e,t){return n9(e,t,-1)}function A$(e,...t){return window.runtime.EventsOff(e,...t)}function r9(){window.runtime.WindowToggleMaximise()}function o9(){window.runtime.WindowMinimise()}function i9(e){window.runtime.BrowserOpenURL(e)}function a9(){window.runtime.Quit()}function l9(e,t){let n;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}}function s9(e){return C("div",{className:"wechat-SearchBar",children:C(ai,{theme:{components:{Input:{activeBorderColor:"#E3E4E5",activeShadow:"#E3E4E5",hoverBorderColor:"#E3E4E5"}}},children:C(C$,{className:"wechat-SearchBar-Input",placeholder:"\u641C\u7D22",prefix:C(_d,{}),allowClear:!0,onChange:t=>e.onChange(t.target.value)})})})}function c9(e){return ie("div",{className:`${e.className} wechat-UserItem`,onClick:e.onClick,tabIndex:"0",children:[C(Yo,{id:"wechat-UserItem-content-Avatar-id",className:"wechat-UserItem-content-Avatar",src:e.Avatar,size:{xs:45,sm:45,md:45,lg:45,xl:45,xxl:45},shape:"square",alt:"\u65E0\u6CD5\u52A0\u8F7D\u5934\u50CF"}),ie("div",{className:"wechat-UserItem-content",children:[C("div",{className:"wechat-UserItem-content-text wechat-UserItem-content-name",children:e.name}),C("div",{className:"wechat-UserItem-content-text wechat-UserItem-content-msg",children:e.msg})]}),C("div",{className:"wechat-UserItem-date",children:e.date})]})}function u9(e){const t=new Date(e*1e3),n=t.getFullYear(),r=t.getMonth()+1,o=t.getDate();return t.getHours(),t.getMinutes(),t.getSeconds(),`${n-2e3}/${r}/${o}`}function d9(e){const[t,n]=f.exports.useState(null),[r,o]=f.exports.useState(0),[i,a]=f.exports.useState(!0),[l,s]=f.exports.useState([]),[c,u]=f.exports.useState(""),d=(g,p)=>{n(g),e.onClickItem&&e.onClickItem(p)};f.exports.useEffect(()=>{i&&e.selfName!==""&&ZB(r,20).then(g=>{var p=JSON.parse(g);if(p.Total>0){let b=[];p.Rows.forEach(m=>{m.UserName.startsWith("gh_")||b.push(m)}),s(m=>[...m,...b]),o(m=>m+1)}else a(!1)})},[r,i,e.selfName]);const v=f.exports.useCallback(l9(g=>{console.log(g),u(g)},400),[]),h=l.filter(g=>g.NickName.includes(c));return ie("div",{className:"wechat-UserList",onClick:e.onClick,children:[C(s9,{onChange:v}),C("div",{className:"wechat-UserList-Items",children:h.map((g,p)=>C(c9,{className:t===p?"selectedItem":"",onClick:()=>{d(p,g)},name:g.NickName,msg:g.Content,date:u9(g.Time),Avatar:g.UserInfo.SmallHeadImgUrl},Am()))})]})}const ia={INIT:"normal",START:"active",END:"success",ERROR:"exception"};function f9({info:e,appVersion:t}){const[n,r]=f.exports.useState({});return f.exports.useEffect(()=>{r({PID:e.PID,path:e.FilePath,version:e.Version!==""?e.Version+" "+(e.Is64Bits?"64bits":"32bits"):"\u7248\u672C\u83B7\u53D6\u5931\u8D25",userName:e.AcountName,result:e.DBkey&&e.DBkey.length>0?"success":"failed"})},[e]),ie(Tt,{children:[C("div",{children:"\u5F53\u524D\u767B\u9646\u7684\u5FAE\u4FE1\u4FE1\u606F"}),ie("div",{className:"WechatInfoTable",children:[ie("div",{className:"WechatInfoTable-column",children:[C("div",{children:"wechatDataBackup \u7248\u672C:"}),C(oa,{className:"WechatInfoTable-column-tag",color:"success",children:t})]}),ie("div",{className:"WechatInfoTable-column",children:[C("div",{children:"\u8FDB\u7A0BPID:"}),C(oa,{className:"WechatInfoTable-column-tag",color:n.PID===0?"red":"success",children:n.PID===0?"\u5F53\u524D\u6CA1\u6709\u6253\u5F00\u5FAE\u4FE1":n.PID})]}),ie("div",{className:"WechatInfoTable-column",children:[C("div",{children:"\u6587\u4EF6\u5B58\u50A8\u8DEF\u5F84:"}),C(oa,{className:"WechatInfoTable-column-tag",color:"success",children:n.path})]}),ie("div",{className:"WechatInfoTable-column",children:[C("div",{children:"\u5FAE\u4FE1\u8F6F\u4EF6\u7248\u672C:"}),C(oa,{className:"WechatInfoTable-column-tag",color:"success",children:n.version})]}),ie("div",{className:"WechatInfoTable-column",children:[C("div",{children:"\u5FAE\u4FE1ID:"}),C(oa,{className:"WechatInfoTable-column-tag",color:n.userName===""?"red":"success",children:n.userName===""?"\u5F53\u524D\u6CA1\u6709\u767B\u9646\u5FAE\u4FE1":n.userName})]}),ie("div",{className:"WechatInfoTable-column",children:[C("div",{children:"\u89E3\u5BC6\u7ED3\u679C:"}),C(oa,{className:"WechatInfoTable-column-tag",color:n.result==="success"?"green":"red",children:n.result==="success"?"\u89E3\u5BC6\u6210\u529F":"\u89E3\u5BC6\u5931\u8D25"})]})]})]})}function v9(e){const[t,n]=f.exports.useState(!1),[r,o]=f.exports.useState({}),[i,a]=f.exports.useState(-1),[l,s]=f.exports.useState(ia.INIT),[c,u]=f.exports.useState(""),d=p=>{console.log(p);const b=JSON.parse(p);b.status==="error"?(s(ia.ERROR),a(100)):(s(b.progress!==100?ia.START:ia.END),a(b.progress))},v=()=>{console.log("showModal"),n(!0),KB().then(p=>{console.log(p),o(JSON.parse(p))}),GB().then(p=>{u(p)}),_$("exportData",d)},h=p=>{n(!1),a(-1),s(ia.INIT),A$("exportData"),e.onModalExit&&e.onModalExit()},g=p=>{YB(p),a(0),s(ia.START)};return ie("div",{className:"Setting-Modal-Parent",children:[C("div",{onClick:v,children:e.children}),ie(js,{className:"Setting-Modal",overlayClassName:"Setting-Modal-Overlay",isOpen:t,onRequestClose:h,children:[C("div",{className:"Setting-Modal-button",title:"\u5173\u95ED",onClick:()=>h(),children:C(eo,{className:"Setting-Modal-button-icon"})}),C(f9,{info:r,appVersion:c}),r.DBkey&&r.DBkey.length>0&&C(p9,{onClickExport:g,children:C(Xu,{className:"Setting-Modal-export-button",type:"primary",children:"\u5BFC\u51FA\u6B64\u8D26\u53F7\u6570\u636E"})}),i>-1&&C(DB,{percent:i,status:l})]})]})}const p9=e=>{const[t,n]=f.exports.useState(!1),r=i=>{n(!1)},o=i=>{n(!1),e.onClickExport&&e.onClickExport(i)};return ie("div",{className:"Setting-Modal-confirm-Parent",children:[C("div",{onClick:()=>n(!0),children:e.children}),ie(js,{className:"Setting-Modal-confirm",overlayClassName:"Setting-Modal-confirm-Overlay",isOpen:t,onRequestClose:r,children:[C("div",{className:"Setting-Modal-confirm-title",children:"\u9009\u62E9\u5BFC\u51FA\u65B9\u5F0F"}),ie("div",{className:"Setting-Modal-confirm-buttons",children:[C(Xu,{className:"Setting-Modal-export-button",type:"primary",onClick:()=>o(!0),children:"\u5168\u91CF\u5BFC\u51FA\uFF08\u901F\u5EA6\u6162\uFF09"}),C(Xu,{className:"Setting-Modal-export-button",type:"primary",onClick:()=>o(!1),children:"\u589E\u91CF\u5BFC\u51FA\uFF08\u901F\u5EA6\u5FEB\uFF09"})]})]})]})};function g9(e){const[t,n]=f.exports.useState("chat"),r=o=>{o!=="avatar"&&n(o),e.onClickItem&&e.onClickItem(o)};return ie("div",{className:"wechat-menu",children:[C(Yo,{id:"wechat-menu-item-Avatar",className:"wechat-menu-item wechat-menu-item-Avatar",src:e.Avatar,size:"large",shape:"square",alt:"\u65E0\u6CD5\u52A0\u8F7D\u5934\u50CF",onClick:()=>r("avatar")}),C(Yo,{icon:C($4,{}),title:"\u67E5\u770B\u804A\u5929",className:`wechat-menu-item wechat-menu-item-icon ${t==="chat"?"wechat-menu-selectedColor":""}`,size:"default",onClick:()=>r("chat")}),C(v9,{onModalExit:()=>e.onClickItem("exit"),children:C(Yo,{icon:C(c4,{}),title:"\u8BBE\u7F6E",className:`wechat-menu-item wechat-menu-item-icon ${t==="setting"?"wechat-menu-selectedColor":""}`,size:"default"})})]})}var Ng=function(e,t){return Ng=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)r.hasOwnProperty(o)&&(n[o]=r[o])},Ng(e,t)};function h9(e,t){Ng(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var es=function(){return es=Object.assign||function(t){for(var n,r=1,o=arguments.length;re?h():t!==!0&&(o=setTimeout(r?g:h,r===void 0?e-d:e))}return c.cancel=s,c}var La={Pixel:"Pixel",Percent:"Percent"},g1={unit:La.Percent,value:.8};function h1(e){return typeof e=="number"?{unit:La.Percent,value:e*100}:typeof e=="string"?e.match(/^(\d*(\.\d+)?)px$/)?{unit:La.Pixel,value:parseFloat(e)}:e.match(/^(\d*(\.\d+)?)%$/)?{unit:La.Percent,value:parseFloat(e)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),g1):(console.warn("scrollThreshold should be string or number"),g1)}var D$=function(e){h9(t,e);function t(n){var r=e.call(this,n)||this;return r.lastScrollTop=0,r.actionTriggered=!1,r.startY=0,r.currentY=0,r.dragging=!1,r.maxPullDownDistance=0,r.getScrollableTarget=function(){return r.props.scrollableTarget instanceof HTMLElement?r.props.scrollableTarget:typeof r.props.scrollableTarget=="string"?document.getElementById(r.props.scrollableTarget):(r.props.scrollableTarget===null&&console.warn(`You are trying to pass scrollableTarget but it is null. This might +`,f7=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],Ev={},dr;function v7(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&Ev[n])return Ev[n];var r=window.getComputedStyle(e),o=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),i=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),a=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),l=f7.map(function(c){return"".concat(c,":").concat(r.getPropertyValue(c))}).join(";"),s={sizingStyle:l,paddingSize:i,borderSize:a,boxSizing:o};return t&&n&&(Ev[n]=s),s}function p7(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;dr||(dr=document.createElement("textarea"),dr.setAttribute("tab-index","-1"),dr.setAttribute("aria-hidden","true"),document.body.appendChild(dr)),e.getAttribute("wrap")?dr.setAttribute("wrap",e.getAttribute("wrap")):dr.removeAttribute("wrap");var o=v7(e,t),i=o.paddingSize,a=o.borderSize,l=o.boxSizing,s=o.sizingStyle;dr.setAttribute("style","".concat(s,";").concat(d7)),dr.value=e.value||e.placeholder||"";var c=void 0,u=void 0,d,v=dr.scrollHeight;if(l==="border-box"?v+=a:l==="content-box"&&(v-=i),n!==null||r!==null){dr.value=" ";var h=dr.scrollHeight-i;n!==null&&(c=h*n,l==="border-box"&&(c=c+i+a),v=Math.max(c,v)),r!==null&&(u=h*r,l==="border-box"&&(u=u+i+a),d=v>u?"":"hidden",v=Math.min(u,v))}var g={height:v,overflowY:d,resize:"none"};return c&&(g.minHeight=c),u&&(g.maxHeight=u),g}var g7=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Mv=0,Ov=1,Rv=2,h7=f.exports.forwardRef(function(e,t){var n=e,r=n.prefixCls;n.onPressEnter;var o=n.defaultValue,i=n.value,a=n.autoSize,l=n.onResize,s=n.className,c=n.style,u=n.disabled,d=n.onChange;n.onInternalAutoSize;var v=Je(n,g7),h=kt(o,{value:i,postState:function(H){return H!=null?H:""}}),g=G(h,2),p=g[0],b=g[1],m=function(H){b(H.target.value),d==null||d(H)},y=f.exports.useRef();f.exports.useImperativeHandle(t,function(){return{textArea:y.current}});var S=f.exports.useMemo(function(){return a&&Qe(a)==="object"?[a.minRows,a.maxRows]:[]},[a]),x=G(S,2),$=x[0],E=x[1],w=!!a,R=function(){try{if(document.activeElement===y.current){var H=y.current,W=H.selectionStart,Y=H.selectionEnd,K=H.scrollTop;y.current.setSelectionRange(W,Y),y.current.scrollTop=K}}catch{}},P=f.exports.useState(Rv),N=G(P,2),I=N[0],z=N[1],F=f.exports.useState(),T=G(F,2),D=T[0],_=T[1],O=function(){z(Mv)};Nt(function(){w&&O()},[i,$,E,w]),Nt(function(){if(I===Mv)z(Ov);else if(I===Ov){var j=p7(y.current,!1,$,E);z(Rv),_(j)}else R()},[I]);var M=f.exports.useRef(),L=function(){St.cancel(M.current)},A=function(H){I===Rv&&(l==null||l(H),a&&(L(),M.current=St(function(){O()})))};f.exports.useEffect(function(){return L},[]);var B=w?D:null,k=U(U({},c),B);return(I===Mv||I===Ov)&&(k.overflowY="hidden",k.overflowX="hidden"),C(mr,{onResize:A,disabled:!(a||l),children:C("textarea",{...v,ref:y,style:k,className:te(r,s,V({},"".concat(r,"-disabled"),u)),disabled:u,value:p,onChange:m})})}),m7=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize"],y7=lt.forwardRef(function(e,t){var n,r,o=e.defaultValue,i=e.value,a=e.onFocus,l=e.onBlur,s=e.onChange,c=e.allowClear,u=e.maxLength,d=e.onCompositionStart,v=e.onCompositionEnd,h=e.suffix,g=e.prefixCls,p=g===void 0?"rc-textarea":g,b=e.showCount,m=e.count,y=e.className,S=e.style,x=e.disabled,$=e.hidden,E=e.classNames,w=e.styles,R=e.onResize,P=Je(e,m7),N=kt(o,{value:i,defaultValue:o}),I=G(N,2),z=I[0],F=I[1],T=z==null?"":String(z),D=lt.useState(!1),_=G(D,2),O=_[0],M=_[1],L=lt.useRef(!1),A=lt.useState(null),B=G(A,2),k=B[0],j=B[1],H=f.exports.useRef(null),W=function(){var ge;return(ge=H.current)===null||ge===void 0?void 0:ge.textArea},Y=function(){W().focus()};f.exports.useImperativeHandle(t,function(){return{resizableTextArea:H.current,focus:Y,blur:function(){W().blur()}}}),f.exports.useEffect(function(){M(function(we){return!x&&we})},[x]);var K=lt.useState(null),q=G(K,2),ee=q[0],Z=q[1];lt.useEffect(function(){if(ee){var we;(we=W()).setSelectionRange.apply(we,Oe(ee))}},[ee]);var Q=b$(m,b),ne=(n=Q.max)!==null&&n!==void 0?n:u,ae=Number(ne)>0,J=Q.strategy(T),re=!!ne&&J>ne,fe=function(ge,Pe){var Se=Pe;!L.current&&Q.exceedFormatter&&Q.max&&Q.strategy(Pe)>Q.max&&(Se=Q.exceedFormatter(Pe,{max:Q.max}),Pe!==Se&&Z([W().selectionStart||0,W().selectionEnd||0])),F(Se),od(ge.currentTarget,ge,s,Se)},ve=function(ge){L.current=!0,d==null||d(ge)},pe=function(ge){L.current=!1,fe(ge,ge.currentTarget.value),v==null||v(ge)},oe=function(ge){fe(ge,ge.target.value)},se=function(ge){var Pe=P.onPressEnter,Se=P.onKeyDown;ge.key==="Enter"&&Pe&&Pe(ge),Se==null||Se(ge)},le=function(ge){M(!0),a==null||a(ge)},Ce=function(ge){M(!1),l==null||l(ge)},ce=function(ge){F(""),Y(),od(W(),ge,s)},de=h,xe;Q.show&&(Q.showFormatter?xe=Q.showFormatter({value:T,count:J,maxLength:ne}):xe="".concat(J).concat(ae?" / ".concat(ne):""),de=ie(Tt,{children:[de,C("span",{className:te("".concat(p,"-data-count"),E==null?void 0:E.count),style:w==null?void 0:w.count,children:xe})]}));var he=function(ge){var Pe;R==null||R(ge),(Pe=W())!==null&&Pe!==void 0&&Pe.style.height&&j(!0)},ke=!P.autoSize&&!b&&!c;return C(y$,{value:T,allowClear:c,handleReset:ce,suffix:de,prefixCls:p,classNames:U(U({},E),{},{affixWrapper:te(E==null?void 0:E.affixWrapper,(r={},V(r,"".concat(p,"-show-count"),b),V(r,"".concat(p,"-textarea-allow-clear"),c),r))}),disabled:x,focused:O,className:te(y,re&&"".concat(p,"-out-of-range")),style:U(U({},S),k&&!ke?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof xe=="string"?xe:void 0}},hidden:$,children:C(h7,{...P,maxLength:u,onKeyDown:se,onChange:oe,onFocus:le,onBlur:Ce,onCompositionStart:ve,onCompositionEnd:pe,className:te(E==null?void 0:E.textarea),style:U(U({},w==null?void 0:w.textarea),{},{resize:S==null?void 0:S.resize}),disabled:x,prefixCls:p,onResize:he,ref:H})})}),b7=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o{var n;const{prefixCls:r,bordered:o=!0,size:i,disabled:a,status:l,allowClear:s,classNames:c,rootClassName:u,className:d,variant:v}=e,h=b7(e,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","variant"]),{getPrefixCls:g,direction:p}=f.exports.useContext(ot),b=So(i),m=f.exports.useContext(rl),y=a!=null?a:m,{status:S,hasFeedback:x,feedbackIcon:$}=f.exports.useContext(Jr),E=dm(S,l),w=f.exports.useRef(null);f.exports.useImperativeHandle(t,()=>{var _;return{resizableTextArea:(_=w.current)===null||_===void 0?void 0:_.resizableTextArea,focus:O=>{var M,L;t7((L=(M=w.current)===null||M===void 0?void 0:M.resizableTextArea)===null||L===void 0?void 0:L.textArea,O)},blur:()=>{var O;return(O=w.current)===null||O===void 0?void 0:O.blur()}}});const R=g("input",r);let P;typeof s=="object"&&(s==null?void 0:s.clearIcon)?P=s:s&&(P={clearIcon:C(Nd,{})});const N=no(R),[I,z,F]=Im(R,N),[T,D]=vm(v,o);return I(C(y7,{...Object.assign({},h,{disabled:y,allowClear:P,className:te(F,N,d,u),classNames:Object.assign(Object.assign({},c),{textarea:te({[`${R}-sm`]:b==="small",[`${R}-lg`]:b==="large"},z,c==null?void 0:c.textarea),variant:te({[`${R}-${T}`]:D},ed(R,E)),affixWrapper:te(`${R}-textarea-affix-wrapper`,{[`${R}-affix-wrapper-rtl`]:p==="rtl",[`${R}-affix-wrapper-sm`]:b==="small",[`${R}-affix-wrapper-lg`]:b==="large",[`${R}-textarea-show-count`]:e.showCount||((n=e.count)===null||n===void 0?void 0:n.show)},z)}),prefixCls:R,suffix:x&&C("span",{className:`${R}-textarea-suffix`,children:$}),ref:w})}))}),C7=S7,Js=Tm;Js.Group=Xk;Js.Search=u7;Js.TextArea=C7;Js.Password=l7;const C$=Js;function x$(){var e=document.documentElement.clientWidth,t=window.innerHeight||document.documentElement.clientHeight;return{width:e,height:t}}function x7(e){var t=e.getBoundingClientRect(),n=document.documentElement;return{left:t.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:t.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}var Pg=["crossOrigin","decoding","draggable","loading","referrerPolicy","sizes","srcSet","useMap","alt"],ec=f.exports.createContext(null),a1=0;function w7(e,t){var n=f.exports.useState(function(){return a1+=1,String(a1)}),r=G(n,1),o=r[0],i=f.exports.useContext(ec),a={data:t,canPreview:e};return f.exports.useEffect(function(){if(i)return i.register(o,a)},[]),f.exports.useEffect(function(){i&&i.register(o,a)},[e,t]),o}function $7(e){return new Promise(function(t){var n=document.createElement("img");n.onerror=function(){return t(!1)},n.onload=function(){return t(!0)},n.src=e})}function w$(e){var t=e.src,n=e.isCustomPlaceholder,r=e.fallback,o=f.exports.useState(n?"loading":"normal"),i=G(o,2),a=i[0],l=i[1],s=f.exports.useRef(!1),c=a==="error";f.exports.useEffect(function(){var h=!0;return $7(t).then(function(g){!g&&h&&l("error")}),function(){h=!1}},[t]),f.exports.useEffect(function(){n&&!s.current?l("loading"):c&&l("normal")},[t]);var u=function(){l("normal")},d=function(g){s.current=!1,a==="loading"&&g!==null&&g!==void 0&&g.complete&&(g.naturalWidth||g.naturalHeight)&&(s.current=!0,u())},v=c&&r?{src:r}:{onLoad:u,src:t};return[d,v,a]}function $a(e,t,n,r){var o=zu.unstable_batchedUpdates?function(a){zu.unstable_batchedUpdates(n,a)}:n;return e!=null&&e.addEventListener&&e.addEventListener(t,o,r),{remove:function(){e!=null&&e.removeEventListener&&e.removeEventListener(t,o,r)}}}var kc={x:0,y:0,rotate:0,scale:1,flipX:!1,flipY:!1};function E7(e,t,n,r){var o=f.exports.useRef(null),i=f.exports.useRef([]),a=f.exports.useState(kc),l=G(a,2),s=l[0],c=l[1],u=function(g){c(kc),r&&!Vs(kc,s)&&r({transform:kc,action:g})},d=function(g,p){o.current===null&&(i.current=[],o.current=St(function(){c(function(b){var m=b;return i.current.forEach(function(y){m=U(U({},m),y)}),o.current=null,r==null||r({transform:m,action:p}),m})})),i.current.push(U(U({},s),g))},v=function(g,p,b,m,y){var S=e.current,x=S.width,$=S.height,E=S.offsetWidth,w=S.offsetHeight,R=S.offsetLeft,P=S.offsetTop,N=g,I=s.scale*g;I>n?(I=n,N=n/s.scale):Ir){if(t>0)return V({},e,i);if(t<0&&or)return V({},e,t<0?i:-i);return{}}function $$(e,t,n,r){var o=x$(),i=o.width,a=o.height,l=null;return e<=i&&t<=a?l={x:0,y:0}:(e>i||t>a)&&(l=U(U({},l1("x",n,e,i)),l1("y",r,t,a))),l}var Ea=1,M7=1;function O7(e,t,n,r,o,i,a){var l=o.rotate,s=o.scale,c=o.x,u=o.y,d=f.exports.useState(!1),v=G(d,2),h=v[0],g=v[1],p=f.exports.useRef({diffX:0,diffY:0,transformX:0,transformY:0}),b=function($){!t||$.button!==0||($.preventDefault(),$.stopPropagation(),p.current={diffX:$.pageX-c,diffY:$.pageY-u,transformX:c,transformY:u},g(!0))},m=function($){n&&h&&i({x:$.pageX-p.current.diffX,y:$.pageY-p.current.diffY},"move")},y=function(){if(n&&h){g(!1);var $=p.current,E=$.transformX,w=$.transformY,R=c!==E&&u!==w;if(!R)return;var P=e.current.offsetWidth*s,N=e.current.offsetHeight*s,I=e.current.getBoundingClientRect(),z=I.left,F=I.top,T=l%180!==0,D=$$(T?N:P,T?P:N,z,F);D&&i(U({},D),"dragRebound")}},S=function($){if(!(!n||$.deltaY==0)){var E=Math.abs($.deltaY/100),w=Math.min(E,M7),R=Ea+w*r;$.deltaY>0&&(R=Ea/R),a(R,"wheel",$.clientX,$.clientY)}};return f.exports.useEffect(function(){var x,$,E,w;if(t){E=$a(window,"mouseup",y,!1),w=$a(window,"mousemove",m,!1);try{window.top!==window.self&&(x=$a(window.top,"mouseup",y,!1),$=$a(window.top,"mousemove",m,!1))}catch{}}return function(){var R,P,N,I;(R=E)===null||R===void 0||R.remove(),(P=w)===null||P===void 0||P.remove(),(N=x)===null||N===void 0||N.remove(),(I=$)===null||I===void 0||I.remove()}},[n,h,c,u,l,t]),{isMoving:h,onMouseDown:b,onMouseMove:m,onMouseUp:y,onWheel:S}}function id(e,t){var n=e.x-t.x,r=e.y-t.y;return Math.hypot(n,r)}function R7(e,t,n,r){var o=id(e,n),i=id(t,r);if(o===0&&i===0)return[e.x,e.y];var a=o/(o+i),l=e.x+a*(t.x-e.x),s=e.y+a*(t.y-e.y);return[l,s]}function I7(e,t,n,r,o,i,a){var l=o.rotate,s=o.scale,c=o.x,u=o.y,d=f.exports.useState(!1),v=G(d,2),h=v[0],g=v[1],p=f.exports.useRef({point1:{x:0,y:0},point2:{x:0,y:0},eventType:"none"}),b=function($){p.current=U(U({},p.current),$)},m=function($){if(!!t){$.stopPropagation(),g(!0);var E=$.touches,w=E===void 0?[]:E;w.length>1?b({point1:{x:w[0].clientX,y:w[0].clientY},point2:{x:w[1].clientX,y:w[1].clientY},eventType:"touchZoom"}):b({point1:{x:w[0].clientX-c,y:w[0].clientY-u},eventType:"move"})}},y=function($){var E=$.touches,w=E===void 0?[]:E,R=p.current,P=R.point1,N=R.point2,I=R.eventType;if(w.length>1&&I==="touchZoom"){var z={x:w[0].clientX,y:w[0].clientY},F={x:w[1].clientX,y:w[1].clientY},T=R7(P,N,z,F),D=G(T,2),_=D[0],O=D[1],M=id(z,F)/id(P,N);a(M,"touchZoom",_,O,!0),b({point1:z,point2:F,eventType:"touchZoom"})}else I==="move"&&(i({x:w[0].clientX-P.x,y:w[0].clientY-P.y},"move"),b({eventType:"move"}))},S=function(){if(!!n){if(h&&g(!1),b({eventType:"none"}),r>s)return i({x:0,y:0,scale:r},"touchZoom");var $=e.current.offsetWidth*s,E=e.current.offsetHeight*s,w=e.current.getBoundingClientRect(),R=w.left,P=w.top,N=l%180!==0,I=$$(N?E:$,N?$:E,R,P);I&&i(U({},I),"dragRebound")}};return f.exports.useEffect(function(){var x;return n&&t&&(x=$a(window,"touchmove",function($){return $.preventDefault()},{passive:!1})),function(){var $;($=x)===null||$===void 0||$.remove()}},[n,t]),{isTouching:h,onTouchStart:m,onTouchMove:y,onTouchEnd:S}}var P7=function(t){var n=t.visible,r=t.maskTransitionName,o=t.getContainer,i=t.prefixCls,a=t.rootClassName,l=t.icons,s=t.countRender,c=t.showSwitch,u=t.showProgress,d=t.current,v=t.transform,h=t.count,g=t.scale,p=t.minScale,b=t.maxScale,m=t.closeIcon,y=t.onSwitchLeft,S=t.onSwitchRight,x=t.onClose,$=t.onZoomIn,E=t.onZoomOut,w=t.onRotateRight,R=t.onRotateLeft,P=t.onFlipX,N=t.onFlipY,I=t.toolbarRender,z=t.zIndex,F=f.exports.useContext(ec),T=l.rotateLeft,D=l.rotateRight,_=l.zoomIn,O=l.zoomOut,M=l.close,L=l.left,A=l.right,B=l.flipX,k=l.flipY,j="".concat(i,"-operations-operation");f.exports.useEffect(function(){var K=function(ee){ee.keyCode===ue.ESC&&x()};return n&&window.addEventListener("keydown",K),function(){window.removeEventListener("keydown",K)}},[n]);var H=[{icon:k,onClick:N,type:"flipY"},{icon:B,onClick:P,type:"flipX"},{icon:T,onClick:R,type:"rotateLeft"},{icon:D,onClick:w,type:"rotateRight"},{icon:O,onClick:E,type:"zoomOut",disabled:g<=p},{icon:_,onClick:$,type:"zoomIn",disabled:g===b}],W=H.map(function(K){var q,ee=K.icon,Z=K.onClick,Q=K.type,ne=K.disabled;return C("div",{className:te(j,(q={},V(q,"".concat(i,"-operations-operation-").concat(Q),!0),V(q,"".concat(i,"-operations-operation-disabled"),!!ne),q)),onClick:Z,children:ee},Q)}),Y=C("div",{className:"".concat(i,"-operations"),children:W});return C(to,{visible:n,motionName:r,children:function(K){var q=K.className,ee=K.style;return C(nf,{open:!0,getContainer:o!=null?o:document.body,children:ie("div",{className:te("".concat(i,"-operations-wrapper"),q,a),style:U(U({},ee),{},{zIndex:z}),children:[m===null?null:C("button",{className:"".concat(i,"-close"),onClick:x,children:m||M}),c&&ie(Tt,{children:[C("div",{className:te("".concat(i,"-switch-left"),V({},"".concat(i,"-switch-left-disabled"),d===0)),onClick:y,children:L}),C("div",{className:te("".concat(i,"-switch-right"),V({},"".concat(i,"-switch-right-disabled"),d===h-1)),onClick:S,children:A})]}),ie("div",{className:"".concat(i,"-footer"),children:[u&&C("div",{className:"".concat(i,"-progress"),children:s?s(d+1,h):"".concat(d+1," / ").concat(h)}),I?I(Y,U({icons:{flipYIcon:W[0],flipXIcon:W[1],rotateLeftIcon:W[2],rotateRightIcon:W[3],zoomOutIcon:W[4],zoomInIcon:W[5]},actions:{onFlipY:N,onFlipX:P,onRotateLeft:R,onRotateRight:w,onZoomOut:E,onZoomIn:$},transform:v},F?{current:d,total:h}:{})):Y]})]})})}})},T7=["fallback","src","imgRef"],N7=["prefixCls","src","alt","fallback","movable","onClose","visible","icons","rootClassName","closeIcon","getContainer","current","count","countRender","scaleStep","minScale","maxScale","transitionName","maskTransitionName","imageRender","imgCommonProps","toolbarRender","onTransform","onChange"],_7=function(t){var n=t.fallback,r=t.src,o=t.imgRef,i=Je(t,T7),a=w$({src:r,fallback:n}),l=G(a,2),s=l[0],c=l[1];return C("img",{ref:function(d){o.current=d,s(d)},...i,...c})},E$=function(t){var n=t.prefixCls,r=t.src,o=t.alt,i=t.fallback,a=t.movable,l=a===void 0?!0:a,s=t.onClose,c=t.visible,u=t.icons,d=u===void 0?{}:u,v=t.rootClassName,h=t.closeIcon,g=t.getContainer,p=t.current,b=p===void 0?0:p,m=t.count,y=m===void 0?1:m,S=t.countRender,x=t.scaleStep,$=x===void 0?.5:x,E=t.minScale,w=E===void 0?1:E,R=t.maxScale,P=R===void 0?50:R,N=t.transitionName,I=N===void 0?"zoom":N,z=t.maskTransitionName,F=z===void 0?"fade":z,T=t.imageRender,D=t.imgCommonProps,_=t.toolbarRender,O=t.onTransform,M=t.onChange,L=Je(t,N7),A=f.exports.useRef(),B=f.exports.useContext(ec),k=B&&y>1,j=B&&y>=1,H=f.exports.useState(!0),W=G(H,2),Y=W[0],K=W[1],q=E7(A,w,P,O),ee=q.transform,Z=q.resetTransform,Q=q.updateTransform,ne=q.dispatchZoomChange,ae=O7(A,l,c,$,ee,Q,ne),J=ae.isMoving,re=ae.onMouseDown,fe=ae.onWheel,ve=I7(A,l,c,w,ee,Q,ne),pe=ve.isTouching,oe=ve.onTouchStart,se=ve.onTouchMove,le=ve.onTouchEnd,Ce=ee.rotate,ce=ee.scale,de=te(V({},"".concat(n,"-moving"),J));f.exports.useEffect(function(){Y||K(!0)},[Y]);var xe=function(){Z("close")},he=function(){ne(Ea+$,"zoomIn")},ke=function(){ne(Ea/(Ea+$),"zoomOut")},we=function(){Q({rotate:Ce+90},"rotateRight")},ge=function(){Q({rotate:Ce-90},"rotateLeft")},Pe=function(){Q({flipX:!ee.flipX},"flipX")},Se=function(){Q({flipY:!ee.flipY},"flipY")},st=function(qe){qe==null||qe.preventDefault(),qe==null||qe.stopPropagation(),b>0&&(K(!1),Z("prev"),M==null||M(b-1,b))},nt=function(qe){qe==null||qe.preventDefault(),qe==null||qe.stopPropagation(),b({position:e||"absolute",inset:0}),B7=e=>{const{iconCls:t,motionDurationSlow:n,paddingXXS:r,marginXXS:o,prefixCls:i,colorTextLightSolid:a}=e;return{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:a,background:new Mt("#000").setAlpha(.5).toRgbString(),cursor:"pointer",opacity:0,transition:`opacity ${n}`,[`.${i}-mask-info`]:Object.assign(Object.assign({},ei),{padding:`0 ${X(r)}`,[t]:{marginInlineEnd:o,svg:{verticalAlign:"baseline"}}})}},j7=e=>{const{previewCls:t,modalMaskBg:n,paddingSM:r,marginXL:o,margin:i,paddingLG:a,previewOperationColorDisabled:l,previewOperationHoverColor:s,motionDurationSlow:c,iconCls:u,colorTextLightSolid:d}=e,v=new Mt(n).setAlpha(.1),h=v.clone().setAlpha(.2);return{[`${t}-footer`]:{position:"fixed",bottom:o,left:{_skip_check_:!0,value:0},width:"100%",display:"flex",flexDirection:"column",alignItems:"center",color:e.previewOperationColor},[`${t}-progress`]:{marginBottom:i},[`${t}-close`]:{position:"fixed",top:o,right:{_skip_check_:!0,value:o},display:"flex",color:d,backgroundColor:v.toRgbString(),borderRadius:"50%",padding:r,outline:0,border:0,cursor:"pointer",transition:`all ${c}`,"&:hover":{backgroundColor:h.toRgbString()},[`& > ${u}`]:{fontSize:e.previewOperationSize}},[`${t}-operations`]:{display:"flex",alignItems:"center",padding:`0 ${X(a)}`,backgroundColor:v.toRgbString(),borderRadius:100,"&-operation":{marginInlineStart:r,padding:r,cursor:"pointer",transition:`all ${c}`,userSelect:"none",[`&:not(${t}-operations-operation-disabled):hover > ${u}`]:{color:s},"&-disabled":{color:l,cursor:"not-allowed"},"&:first-of-type":{marginInlineStart:0},[`& > ${u}`]:{fontSize:e.previewOperationSize}}}}},H7=e=>{const{modalMaskBg:t,iconCls:n,previewOperationColorDisabled:r,previewCls:o,zIndexPopup:i,motionDurationSlow:a}=e,l=new Mt(t).setAlpha(.1),s=l.clone().setAlpha(.2);return{[`${o}-switch-left, ${o}-switch-right`]:{position:"fixed",insetBlockStart:"50%",zIndex:e.calc(i).add(1).equal({unit:!1}),display:"flex",alignItems:"center",justifyContent:"center",width:e.imagePreviewSwitchSize,height:e.imagePreviewSwitchSize,marginTop:e.calc(e.imagePreviewSwitchSize).mul(-1).div(2).equal(),color:e.previewOperationColor,background:l.toRgbString(),borderRadius:"50%",transform:"translateY(-50%)",cursor:"pointer",transition:`all ${a}`,userSelect:"none","&:hover":{background:s.toRgbString()},["&-disabled"]:{"&, &:hover":{color:r,background:"transparent",cursor:"not-allowed",[`> ${n}`]:{cursor:"not-allowed"}}},[`> ${n}`]:{fontSize:e.previewOperationSize}},[`${o}-switch-left`]:{insetInlineStart:e.marginSM},[`${o}-switch-right`]:{insetInlineEnd:e.marginSM}}},W7=e=>{const{motionEaseOut:t,previewCls:n,motionDurationSlow:r,componentCls:o}=e;return[{[`${o}-preview-root`]:{[n]:{height:"100%",textAlign:"center",pointerEvents:"none"},[`${n}-body`]:Object.assign(Object.assign({},Tg()),{overflow:"hidden"}),[`${n}-img`]:{maxWidth:"100%",maxHeight:"70%",verticalAlign:"middle",transform:"scale3d(1, 1, 1)",cursor:"grab",transition:`transform ${r} ${t} 0s`,userSelect:"none","&-wrapper":Object.assign(Object.assign({},Tg()),{transition:`transform ${r} ${t} 0s`,display:"flex",justifyContent:"center",alignItems:"center","& > *":{pointerEvents:"auto"},"&::before":{display:"inline-block",width:1,height:"50%",marginInlineEnd:-1,content:'""'}})},[`${n}-moving`]:{[`${n}-preview-img`]:{cursor:"grabbing","&-wrapper":{transitionDuration:"0s"}}}}},{[`${o}-preview-root`]:{[`${n}-wrap`]:{zIndex:e.zIndexPopup}}},{[`${o}-preview-operations-wrapper`]:{position:"fixed",zIndex:e.calc(e.zIndexPopup).add(1).equal({unit:!1})},"&":[j7(e),H7(e)]}]},V7=e=>{const{componentCls:t}=e;return{[t]:{position:"relative",display:"inline-block",[`${t}-img`]:{width:"100%",height:"auto",verticalAlign:"middle"},[`${t}-img-placeholder`]:{backgroundColor:e.colorBgContainerDisabled,backgroundImage:"url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundSize:"30%"},[`${t}-mask`]:Object.assign({},B7(e)),[`${t}-mask:hover`]:{opacity:1},[`${t}-placeholder`]:Object.assign({},Tg())}}},U7=e=>{const{previewCls:t}=e;return{[`${t}-root`]:of(e,"zoom"),["&"]:zw(e,!0)}},Y7=e=>({zIndexPopup:e.zIndexPopupBase+80,previewOperationColor:new Mt(e.colorTextLightSolid).setAlpha(.65).toRgbString(),previewOperationHoverColor:new Mt(e.colorTextLightSolid).setAlpha(.85).toRgbString(),previewOperationColorDisabled:new Mt(e.colorTextLightSolid).setAlpha(.25).toRgbString(),previewOperationSize:e.fontSizeIcon*1.5}),M$=vn("Image",e=>{const t=`${e.componentCls}-preview`,n=$t(e,{previewCls:t,modalMaskBg:new Mt("#000").setAlpha(.45).toRgbString(),imagePreviewSwitchSize:e.controlHeightLG});return[V7(n),W7(n),Fw($t(n,{componentCls:t})),U7(n)]},Y7);var G7=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o{var{previewPrefixCls:t,preview:n}=e,r=G7(e,["previewPrefixCls","preview"]);const{getPrefixCls:o}=f.exports.useContext(ot),i=o("image",t),a=`${i}-preview`,l=o(),s=no(i),[c,u,d]=M$(i,s),[v]=Qd("ImagePreview",typeof n=="object"?n.zIndex:void 0),h=f.exports.useMemo(()=>{var g;if(n===!1)return n;const p=typeof n=="object"?n:{},b=te(u,d,s,(g=p.rootClassName)!==null&&g!==void 0?g:"");return Object.assign(Object.assign({},p),{transitionName:ni(l,"zoom",p.transitionName),maskTransitionName:ni(l,"fade",p.maskTransitionName),rootClassName:b,zIndex:v})},[n]);return c(C(hf.PreviewGroup,{...Object.assign({preview:h,previewPrefixCls:a,icons:O$},r)}))},q7=K7;var s1=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o{var t;const{prefixCls:n,preview:r,className:o,rootClassName:i,style:a}=e,l=s1(e,["prefixCls","preview","className","rootClassName","style"]),{getPrefixCls:s,locale:c=Jo,getPopupContainer:u,image:d}=f.exports.useContext(ot),v=s("image",n),h=s(),g=c.Image||Jo.Image,p=no(v),[b,m,y]=M$(v,p),S=te(i,m,y,p),x=te(o,m,d==null?void 0:d.className),[$]=Qd("ImagePreview",typeof r=="object"?r.zIndex:void 0),E=f.exports.useMemo(()=>{var R;if(r===!1)return r;const P=typeof r=="object"?r:{},{getContainer:N,closeIcon:I}=P,z=s1(P,["getContainer","closeIcon"]);return Object.assign(Object.assign({mask:ie("div",{className:`${v}-mask-info`,children:[C(sx,{}),g==null?void 0:g.preview]}),icons:O$},z),{getContainer:N!=null?N:u,transitionName:ni(h,"zoom",P.transitionName),maskTransitionName:ni(h,"fade",P.maskTransitionName),zIndex:$,closeIcon:I!=null?I:(R=d==null?void 0:d.preview)===null||R===void 0?void 0:R.closeIcon})},[r,g,(t=d==null?void 0:d.preview)===null||t===void 0?void 0:t.closeIcon]),w=Object.assign(Object.assign({},d==null?void 0:d.style),a);return b(C(hf,{...Object.assign({prefixCls:v,preview:E,rootClassName:S,className:x,style:w},l)}))};R$.PreviewGroup=q7;const cu=R$,X7=new Ct("antSpinMove",{to:{opacity:1}}),Q7=new Ct("antRotate",{to:{transform:"rotate(405deg)"}}),Z7=e=>{const{componentCls:t,calc:n}=e;return{[`${t}`]:Object.assign(Object.assign({},Qt(e)),{position:"absolute",display:"none",color:e.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`,"&-spinning":{position:"static",display:"inline-block",opacity:1},[`${t}-text`]:{fontSize:e.fontSize,paddingTop:n(n(e.dotSize).sub(e.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:`all ${e.motionDurationMid}`,"&-show":{opacity:1,visibility:"visible"},[`${t}-dot ${t}-dot-item`]:{backgroundColor:e.colorWhite},[`${t}-text`]:{color:e.colorTextLightSolid}},"&-nested-loading":{position:"relative",[`> div > ${t}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:e.contentHeight,[`${t}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(e.dotSize).mul(-1).div(2).equal()},[`${t}-text`]:{position:"absolute",top:"50%",width:"100%",textShadow:`0 1px 2px ${e.colorBgContainer}`},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{[`${t}-dot`]:{margin:n(e.dotSizeSM).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:n(n(e.dotSizeSM).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{[`${t}-dot`]:{margin:n(e.dotSizeLG).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:n(n(e.dotSizeLG).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},[`${t}-container`]:{position:"relative",transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${t}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none",["&::after"]:{opacity:.4,pointerEvents:"auto"}}},["&-tip"]:{color:e.spinDotDefault},[`${t}-dot`]:{position:"relative",display:"inline-block",fontSize:e.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),height:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),backgroundColor:e.colorPrimary,borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:X7,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:Q7,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&-sm ${t}-dot`]:{fontSize:e.dotSizeSM,i:{width:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal(),height:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal()}},[`&-lg ${t}-dot`]:{fontSize:e.dotSizeLG,i:{width:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal(),height:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal()}},[`&${t}-show-text ${t}-text`]:{display:"block"}})}},J7=e=>{const{controlHeightLG:t,controlHeight:n}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:t*.35,dotSizeLG:n}},eB=vn("Spin",e=>{const t=$t(e,{spinDotDefault:e.colorTextDescription});return[Z7(t)]},J7);var tB=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o{const{prefixCls:t,spinning:n=!0,delay:r=0,className:o,rootClassName:i,size:a="default",tip:l,wrapperClassName:s,style:c,children:u,fullscreen:d=!1}=e,v=tB(e,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen"]),{getPrefixCls:h}=f.exports.useContext(ot),g=h("spin",t),[p,b,m]=eB(g),[y,S]=f.exports.useState(()=>n&&!rB(n,r));f.exports.useEffect(()=>{if(n){const z=Hk(r,()=>{S(!0)});return z(),()=>{var F;(F=z==null?void 0:z.cancel)===null||F===void 0||F.call(z)}}S(!1)},[r,n]);const x=f.exports.useMemo(()=>typeof u<"u"&&!d,[u,d]),{direction:$,spin:E}=f.exports.useContext(ot),w=te(g,E==null?void 0:E.className,{[`${g}-sm`]:a==="small",[`${g}-lg`]:a==="large",[`${g}-spinning`]:y,[`${g}-show-text`]:!!l,[`${g}-fullscreen`]:d,[`${g}-fullscreen-show`]:d&&y,[`${g}-rtl`]:$==="rtl"},o,i,b,m),R=te(`${g}-container`,{[`${g}-blur`]:y}),P=lr(v,["indicator"]),N=Object.assign(Object.assign({},E==null?void 0:E.style),c),I=ie("div",{...Object.assign({},P,{style:N,className:w,"aria-live":"polite","aria-busy":y}),children:[nB(g,e),l&&(x||d)?C("div",{className:`${g}-text`,children:l}):null]});return p(x?ie("div",{...Object.assign({},P,{className:te(`${g}-nested-loading`,s,b,m)}),children:[y&&C("div",{children:I},"loading"),C("div",{className:R,children:u},"container")]}):I)};I$.setDefaultIndicator=e=>{uu=e};const oB=I$;var iB={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},aB=function(){var t=f.exports.useRef([]),n=f.exports.useRef(null);return f.exports.useEffect(function(){var r=Date.now(),o=!1;t.current.forEach(function(i){if(!!i){o=!0;var a=i.style;a.transitionDuration=".3s, .3s, .3s, .06s",n.current&&r-n.current<100&&(a.transitionDuration="0s, 0s")}}),o&&(n.current=Date.now())}),t.current},c1=0,lB=Rn();function sB(){var e;return lB?(e=c1,c1+=1):e="TEST_OR_SSR",e}const cB=function(e){var t=f.exports.useState(),n=G(t,2),r=n[0],o=n[1];return f.exports.useEffect(function(){o("rc_progress_".concat(sB()))},[]),e||r};var u1=function(t){var n=t.bg,r=t.children;return C("div",{style:{width:"100%",height:"100%",background:n},children:r})};function d1(e,t){return Object.keys(e).map(function(n){var r=parseFloat(n),o="".concat(Math.floor(r*t),"%");return"".concat(e[n]," ").concat(o)})}var uB=f.exports.forwardRef(function(e,t){var n=e.prefixCls,r=e.color,o=e.gradientId,i=e.radius,a=e.style,l=e.ptg,s=e.strokeLinecap,c=e.strokeWidth,u=e.size,d=e.gapDegree,v=r&&Qe(r)==="object",h=v?"#FFF":void 0,g=u/2,p=C("circle",{className:"".concat(n,"-circle-path"),r:i,cx:g,cy:g,stroke:h,strokeLinecap:s,strokeWidth:c,opacity:l===0?0:1,style:a,ref:t});if(!v)return p;var b="".concat(o,"-conic"),m=d?"".concat(180+d/2,"deg"):"0deg",y=d1(r,(360-d)/360),S=d1(r,1),x="conic-gradient(from ".concat(m,", ").concat(y.join(", "),")"),$="linear-gradient(to ".concat(d?"bottom":"top",", ").concat(S.join(", "),")");return ie(Tt,{children:[C("mask",{id:b,children:p}),C("foreignObject",{x:0,y:0,width:u,height:u,mask:"url(#".concat(b,")"),children:C(u1,{bg:$,children:C(u1,{bg:x})})})]})}),Dl=100,Iv=function(t,n,r,o,i,a,l,s,c,u){var d=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,v=r/100*360*((360-a)/360),h=a===0?0:{bottom:0,top:180,left:90,right:-90}[l],g=(100-o)/100*n;c==="round"&&o!==100&&(g+=u/2,g>=n&&(g=n-.01));var p=Dl/2;return{stroke:typeof s=="string"?s:void 0,strokeDasharray:"".concat(n,"px ").concat(t),strokeDashoffset:g+d,transform:"rotate(".concat(i+v+h,"deg)"),transformOrigin:"".concat(p,"px ").concat(p,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},dB=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function f1(e){var t=e!=null?e:[];return Array.isArray(t)?t:[t]}var fB=function(t){var n=U(U({},iB),t),r=n.id,o=n.prefixCls,i=n.steps,a=n.strokeWidth,l=n.trailWidth,s=n.gapDegree,c=s===void 0?0:s,u=n.gapPosition,d=n.trailColor,v=n.strokeLinecap,h=n.style,g=n.className,p=n.strokeColor,b=n.percent,m=Je(n,dB),y=Dl/2,S=cB(r),x="".concat(S,"-gradient"),$=y-a/2,E=Math.PI*2*$,w=c>0?90+c/2:-90,R=E*((360-c)/360),P=Qe(i)==="object"?i:{count:i,space:2},N=P.count,I=P.space,z=f1(b),F=f1(p),T=F.find(function(B){return B&&Qe(B)==="object"}),D=T&&Qe(T)==="object",_=D?"butt":v,O=Iv(E,R,0,100,w,c,u,d,_,a),M=aB(),L=function(){var k=0;return z.map(function(j,H){var W=F[H]||F[F.length-1],Y=Iv(E,R,k,j,w,c,u,W,_,a);return k+=j,C(uB,{color:W,ptg:j,radius:$,prefixCls:o,gradientId:x,style:Y,strokeLinecap:_,strokeWidth:a,gapDegree:c,ref:function(q){M[H]=q},size:Dl},H)}).reverse()},A=function(){var k=Math.round(N*(z[0]/100)),j=100/N,H=0;return new Array(N).fill(null).map(function(W,Y){var K=Y<=k-1?F[0]:d,q=K&&Qe(K)==="object"?"url(#".concat(x,")"):void 0,ee=Iv(E,R,H,j,w,c,u,K,"butt",a,I);return H+=(R-ee.strokeDashoffset+I)*100/R,C("circle",{className:"".concat(o,"-circle-path"),r:$,cx:y,cy:y,stroke:q,strokeWidth:a,opacity:1,style:ee,ref:function(Q){M[Y]=Q}},Y)})};return ie("svg",{className:te("".concat(o,"-circle"),g),viewBox:"0 0 ".concat(Dl," ").concat(Dl),style:h,id:r,role:"presentation",...m,children:[!N&&C("circle",{className:"".concat(o,"-circle-trail"),r:$,cx:y,cy:y,stroke:d,strokeLinecap:_,strokeWidth:l||a,style:O}),N?A():L()]})};function Go(e){return!e||e<0?0:e>100?100:e}function ad(e){let{success:t,successPercent:n}=e,r=n;return t&&"progress"in t&&(r=t.progress),t&&"percent"in t&&(r=t.percent),r}const vB=e=>{let{percent:t,success:n,successPercent:r}=e;const o=Go(ad({success:n,successPercent:r}));return[o,Go(Go(t)-o)]},pB=e=>{let{success:t={},strokeColor:n}=e;const{strokeColor:r}=t;return[r||Na.green,n||null]},mf=(e,t,n)=>{var r,o,i,a;let l=-1,s=-1;if(t==="step"){const c=n.steps,u=n.strokeWidth;typeof e=="string"||typeof e>"u"?(l=e==="small"?2:14,s=u!=null?u:8):typeof e=="number"?[l,s]=[e,e]:[l=14,s=8]=e,l*=c}else if(t==="line"){const c=n==null?void 0:n.strokeWidth;typeof e=="string"||typeof e>"u"?s=c||(e==="small"?6:8):typeof e=="number"?[l,s]=[e,e]:[l=-1,s=8]=e}else(t==="circle"||t==="dashboard")&&(typeof e=="string"||typeof e>"u"?[l,s]=e==="small"?[60,60]:[120,120]:typeof e=="number"?[l,s]=[e,e]:(l=(o=(r=e[0])!==null&&r!==void 0?r:e[1])!==null&&o!==void 0?o:120,s=(a=(i=e[0])!==null&&i!==void 0?i:e[1])!==null&&a!==void 0?a:120));return[l,s]},gB=3,hB=e=>gB/e*100,mB=e=>{const{prefixCls:t,trailColor:n=null,strokeLinecap:r="round",gapPosition:o,gapDegree:i,width:a=120,type:l,children:s,success:c,size:u=a}=e,[d,v]=mf(u,"circle");let{strokeWidth:h}=e;h===void 0&&(h=Math.max(hB(d),6));const g={width:d,height:v,fontSize:d*.15+6},p=f.exports.useMemo(()=>{if(i||i===0)return i;if(l==="dashboard")return 75},[i,l]),b=o||l==="dashboard"&&"bottom"||void 0,m=Object.prototype.toString.call(e.strokeColor)==="[object Object]",y=pB({success:c,strokeColor:e.strokeColor}),S=te(`${t}-inner`,{[`${t}-circle-gradient`]:m}),x=C(fB,{percent:vB(e),strokeWidth:h,trailWidth:h,strokeColor:y,strokeLinecap:r,trailColor:n,prefixCls:t,gapDegree:p,gapPosition:b});return C("div",{className:S,style:g,children:d<=20?C(p2,{title:s,children:C("span",{children:x})}):ie(Tt,{children:[x,s]})})},yB=mB,ld="--progress-line-stroke-color",P$="--progress-percent",v1=e=>{const t=e?"100%":"-100%";return new Ct(`antProgress${e?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${t}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${t}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},bB=e=>{const{componentCls:t,iconCls:n}=e;return{[t]:Object.assign(Object.assign({},Qt(e)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:e.fontSize},[`${t}-outer`]:{display:"inline-block",width:"100%"},[`&${t}-show-info`]:{[`${t}-outer`]:{marginInlineEnd:`calc(-2em - ${X(e.marginXS)})`,paddingInlineEnd:`calc(2em + ${X(e.paddingXS)})`}},[`${t}-inner`]:{position:"relative",display:"inline-block",width:"100%",overflow:"hidden",verticalAlign:"middle",backgroundColor:e.remainingColor,borderRadius:e.lineBorderRadius},[`${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.defaultColor}},[`${t}-success-bg, ${t}-bg`]:{position:"relative",background:e.defaultColor,borderRadius:e.lineBorderRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${t}-bg`]:{overflow:"hidden","&::after":{content:'""',background:{_multi_value_:!0,value:["inherit",`var(${ld})`]},height:"100%",width:`calc(1 / var(${P$}) * 100%)`,display:"block"}},[`${t}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${t}-text`]:{display:"inline-block",width:"2em",marginInlineStart:e.marginXS,color:e.colorText,lineHeight:1,whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[n]:{fontSize:e.fontSize}},[`&${t}-status-active`]:{[`${t}-bg::before`]:{position:"absolute",inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.lineBorderRadius,opacity:0,animationName:v1(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${t}-rtl${t}-status-active`]:{[`${t}-bg::before`]:{animationName:v1(!0)}},[`&${t}-status-exception`]:{[`${t}-bg`]:{backgroundColor:e.colorError},[`${t}-text`]:{color:e.colorError}},[`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorError}},[`&${t}-status-success`]:{[`${t}-bg`]:{backgroundColor:e.colorSuccess},[`${t}-text`]:{color:e.colorSuccess}},[`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorSuccess}}})}},SB=e=>{const{componentCls:t,iconCls:n}=e;return{[t]:{[`${t}-circle-trail`]:{stroke:e.remainingColor},[`&${t}-circle ${t}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${t}-circle ${t}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:e.circleTextColor,fontSize:e.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[n]:{fontSize:e.circleIconFontSize}},[`${t}-circle&-status-exception`]:{[`${t}-text`]:{color:e.colorError}},[`${t}-circle&-status-success`]:{[`${t}-text`]:{color:e.colorSuccess}}},[`${t}-inline-circle`]:{lineHeight:1,[`${t}-inner`]:{verticalAlign:"bottom"}}}},CB=e=>{const{componentCls:t}=e;return{[t]:{[`${t}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.remainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.defaultColor}}}}}},xB=e=>{const{componentCls:t,iconCls:n}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-text ${n}`]:{fontSize:e.fontSizeSM}}}},wB=e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em",circleIconFontSize:`${e.fontSize/e.fontSizeSM}em`}),$B=vn("Progress",e=>{const t=e.calc(e.marginXXS).div(2).equal(),n=$t(e,{progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:"2.4s"});return[bB(n),SB(n),CB(n),xB(n)]},wB);var EB=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o{let t=[];return Object.keys(e).forEach(n=>{const r=parseFloat(n.replace(/%/g,""));isNaN(r)||t.push({key:r,value:e[n]})}),t=t.sort((n,r)=>n.key-r.key),t.map(n=>{let{key:r,value:o}=n;return`${o} ${r}%`}).join(", ")},OB=(e,t)=>{const{from:n=Na.blue,to:r=Na.blue,direction:o=t==="rtl"?"to left":"to right"}=e,i=EB(e,["from","to","direction"]);if(Object.keys(i).length!==0){const l=MB(i),s=`linear-gradient(${o}, ${l})`;return{background:s,[ld]:s}}const a=`linear-gradient(${o}, ${n}, ${r})`;return{background:a,[ld]:a}},RB=e=>{const{prefixCls:t,direction:n,percent:r,size:o,strokeWidth:i,strokeColor:a,strokeLinecap:l="round",children:s,trailColor:c=null,success:u}=e,d=a&&typeof a!="string"?OB(a,n):{[ld]:a,background:a},v=l==="square"||l==="butt"?0:void 0,h=o!=null?o:[-1,i||(o==="small"?6:8)],[g,p]=mf(h,"line",{strokeWidth:i}),b={backgroundColor:c||void 0,borderRadius:v},m=Object.assign(Object.assign({width:`${Go(r)}%`,height:p,borderRadius:v},d),{[P$]:Go(r)/100}),y=ad(e),S={width:`${Go(y)}%`,height:p,borderRadius:v,backgroundColor:u==null?void 0:u.strokeColor},x={width:g<0?"100%":g,height:p};return ie(Tt,{children:[C("div",{className:`${t}-outer`,style:x,children:ie("div",{className:`${t}-inner`,style:b,children:[C("div",{className:`${t}-bg`,style:m}),y!==void 0?C("div",{className:`${t}-success-bg`,style:S}):null]})}),s]})},IB=RB,PB=e=>{const{size:t,steps:n,percent:r=0,strokeWidth:o=8,strokeColor:i,trailColor:a=null,prefixCls:l,children:s}=e,c=Math.round(n*(r/100)),u=t==="small"?2:14,d=t!=null?t:[u,o],[v,h]=mf(d,"step",{steps:n,strokeWidth:o}),g=v/n,p=new Array(n);for(let b=0;b{const{prefixCls:n,className:r,rootClassName:o,steps:i,strokeColor:a,percent:l=0,size:s="default",showInfo:c=!0,type:u="line",status:d,format:v,style:h}=e,g=NB(e,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style"]),p=f.exports.useMemo(()=>{var F,T;const D=ad(e);return parseInt(D!==void 0?(F=D!=null?D:0)===null||F===void 0?void 0:F.toString():(T=l!=null?l:0)===null||T===void 0?void 0:T.toString(),10)},[l,e.success,e.successPercent]),b=f.exports.useMemo(()=>!_B.includes(d)&&p>=100?"success":d||"normal",[d,p]),{getPrefixCls:m,direction:y,progress:S}=f.exports.useContext(ot),x=m("progress",n),[$,E,w]=$B(x),R=f.exports.useMemo(()=>{if(!c)return null;const F=ad(e);let T;const D=v||(O=>`${O}%`),_=u==="line";return v||b!=="exception"&&b!=="success"?T=D(Go(l),Go(F)):b==="exception"?T=_?C(Nd,{}):C(eo,{}):b==="success"&&(T=_?C(NI,{}):C(lx,{})),C("span",{className:`${x}-text`,title:typeof T=="string"?T:void 0,children:T})},[c,l,p,b,u,x,v]),P=Array.isArray(a)?a[0]:a,N=typeof a=="string"||Array.isArray(a)?a:void 0;let I;u==="line"?I=i?C(TB,{...Object.assign({},e,{strokeColor:N,prefixCls:x,steps:i}),children:R}):C(IB,{...Object.assign({},e,{strokeColor:P,prefixCls:x,direction:y}),children:R}):(u==="circle"||u==="dashboard")&&(I=C(yB,{...Object.assign({},e,{strokeColor:P,prefixCls:x,progressStatus:b}),children:R}));const z=te(x,`${x}-status-${b}`,`${x}-${u==="dashboard"&&"circle"||i&&"steps"||u}`,{[`${x}-inline-circle`]:u==="circle"&&mf(s,"circle")[0]<=20,[`${x}-show-info`]:c,[`${x}-${s}`]:typeof s=="string",[`${x}-rtl`]:y==="rtl"},S==null?void 0:S.className,r,o,E,w);return $(C("div",{...Object.assign({ref:t,style:Object.assign(Object.assign({},S==null?void 0:S.style),h),className:z,role:"progressbar","aria-valuenow":p},lr(g,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),children:I}))}),DB=AB,LB=e=>{const{paddingXXS:t,lineWidth:n,tagPaddingHorizontal:r,componentCls:o,calc:i}=e,a=i(r).sub(n).equal(),l=i(t).sub(n).equal();return{[o]:Object.assign(Object.assign({},Qt(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:a,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${X(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${o}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${o}-close-icon`]:{marginInlineStart:l,fontSize:e.tagIconSize,color:e.colorTextDescription,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${o}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},["&-checkable"]:{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${o}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},["&-hidden"]:{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:a}}),[`${o}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}},Nm=e=>{const{lineWidth:t,fontSizeIcon:n,calc:r}=e,o=e.fontSizeSM;return $t(e,{tagFontSize:o,tagLineHeight:X(r(e.lineHeightSM).mul(o).equal()),tagIconSize:r(n).sub(r(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},_m=e=>({defaultBg:new Mt(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText}),T$=vn("Tag",e=>{const t=Nm(e);return LB(t)},_m);var zB=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o{const{prefixCls:n,style:r,className:o,checked:i,onChange:a,onClick:l}=e,s=zB(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:c,tag:u}=f.exports.useContext(ot),d=m=>{a==null||a(!i),l==null||l(m)},v=c("tag",n),[h,g,p]=T$(v),b=te(v,`${v}-checkable`,{[`${v}-checkable-checked`]:i},u==null?void 0:u.className,o,g,p);return h(C("span",{...Object.assign({},s,{ref:t,style:Object.assign(Object.assign({},r),u==null?void 0:u.style),className:b,onClick:d})}))}),kB=FB,BB=e=>ow(e,(t,n)=>{let{textColor:r,lightBorderColor:o,lightColor:i,darkColor:a}=n;return{[`${e.componentCls}${e.componentCls}-${t}`]:{color:r,background:i,borderColor:o,"&-inverse":{color:e.colorTextLightSolid,background:a,borderColor:a},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}}),jB=Kh(["Tag","preset"],e=>{const t=Nm(e);return BB(t)},_m);function HB(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}const Bc=(e,t,n)=>{const r=HB(n);return{[`${e.componentCls}${e.componentCls}-${t}`]:{color:e[`color${n}`],background:e[`color${r}Bg`],borderColor:e[`color${r}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}},WB=Kh(["Tag","status"],e=>{const t=Nm(e);return[Bc(t,"success","Success"),Bc(t,"processing","Info"),Bc(t,"error","Error"),Bc(t,"warning","Warning")]},_m);var VB=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o{const{prefixCls:n,className:r,rootClassName:o,style:i,children:a,icon:l,color:s,onClose:c,closeIcon:u,closable:d,bordered:v=!0}=e,h=VB(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:g,direction:p,tag:b}=f.exports.useContext(ot),[m,y]=f.exports.useState(!0);f.exports.useEffect(()=>{"visible"in h&&y(h.visible)},[h.visible]);const S=d2(s),x=ID(s),$=S||x,E=Object.assign(Object.assign({backgroundColor:s&&!$?s:void 0},b==null?void 0:b.style),i),w=g("tag",n),[R,P,N]=T$(w),I=te(w,b==null?void 0:b.className,{[`${w}-${s}`]:$,[`${w}-has-color`]:s&&!$,[`${w}-hidden`]:!m,[`${w}-rtl`]:p==="rtl",[`${w}-borderless`]:!v},r,o,P,N),z=M=>{M.stopPropagation(),c==null||c(M),!M.defaultPrevented&&y(!1)},[,F]=m6(d,u!=null?u:b==null?void 0:b.closeIcon,M=>M===null?C(eo,{className:`${w}-close-icon`,onClick:z}):C("span",{className:`${w}-close-icon`,onClick:z,children:M}),null,!1),T=typeof h.onClick=="function"||a&&a.type==="a",D=l||null,_=D?ie(Tt,{children:[D,a&&C("span",{children:a})]}):a,O=ie("span",{...Object.assign({},h,{ref:t,className:I,style:E}),children:[_,F,S&&C(jB,{prefixCls:w},"preset"),x&&C(WB,{prefixCls:w},"status")]});return R(T?C(Qh,{component:"Tag",children:O}):O)},N$=f.exports.forwardRef(UB);N$.CheckableTag=kB;const oa=N$;function YB(e){return window.go.main.App.ExportWeChatAllData(e)}function GB(){return window.go.main.App.GetAppVersion()}function KB(){return window.go.main.App.GetWeChatAllInfo()}function qB(e){return window.go.main.App.GetWeChatRoomUserList(e)}function XB(e){return window.go.main.App.GetWechatMessageDate(e)}function QB(e,t,n,r,o){return window.go.main.App.GetWechatMessageListByKeyWord(e,t,n,r,o)}function p1(e,t,n,r){return window.go.main.App.GetWechatMessageListByTime(e,t,n,r)}function ZB(e,t){return window.go.main.App.GetWechatSessionList(e,t)}function JB(e,t){return window.go.main.App.OpenFileOrExplorer(e,t)}function e9(){return window.go.main.App.WeChatInit()}const t9="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Am=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=t9[n[e]&63];return t};function Ts(e){window.runtime.LogInfo(e)}function n9(e,t,n){return window.runtime.EventsOnMultiple(e,t,n)}function _$(e,t){return n9(e,t,-1)}function A$(e,...t){return window.runtime.EventsOff(e,...t)}function r9(){window.runtime.WindowToggleMaximise()}function o9(){window.runtime.WindowMinimise()}function i9(e){window.runtime.BrowserOpenURL(e)}function a9(){window.runtime.Quit()}function l9(e,t){let n;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}}function s9(e){return C("div",{className:"wechat-SearchBar",children:C(ai,{theme:{components:{Input:{activeBorderColor:"#E3E4E5",activeShadow:"#E3E4E5",hoverBorderColor:"#E3E4E5"}}},children:C(C$,{className:"wechat-SearchBar-Input",placeholder:"\u641C\u7D22",prefix:C(_d,{}),allowClear:!0,onChange:t=>e.onChange(t.target.value)})})})}function c9(e){return ie("div",{className:`${e.className} wechat-UserItem`,onClick:e.onClick,tabIndex:"0",children:[C(Yo,{id:"wechat-UserItem-content-Avatar-id",className:"wechat-UserItem-content-Avatar",src:e.Avatar,size:{xs:45,sm:45,md:45,lg:45,xl:45,xxl:45},shape:"square",alt:"\u65E0\u6CD5\u52A0\u8F7D\u5934\u50CF"}),ie("div",{className:"wechat-UserItem-content",children:[C("div",{className:"wechat-UserItem-content-text wechat-UserItem-content-name",children:e.name}),C("div",{className:"wechat-UserItem-content-text wechat-UserItem-content-msg",children:e.msg})]}),C("div",{className:"wechat-UserItem-date",children:e.date})]})}function u9(e){const t=new Date(e*1e3),n=t.getFullYear(),r=t.getMonth()+1,o=t.getDate();return t.getHours(),t.getMinutes(),t.getSeconds(),`${n-2e3}/${r}/${o}`}function d9(e){const[t,n]=f.exports.useState(null),[r,o]=f.exports.useState(0),[i,a]=f.exports.useState(!0),[l,s]=f.exports.useState([]),[c,u]=f.exports.useState(""),d=(g,p)=>{n(g),e.onClickItem&&e.onClickItem(p)};f.exports.useEffect(()=>{i&&e.selfName!==""&&ZB(r,100).then(g=>{var p=JSON.parse(g);if(p.Total>0){let b=[];p.Rows.forEach(m=>{m.UserName.startsWith("gh_")||b.push(m)}),s(m=>[...m,...b]),o(m=>m+1)}else a(!1)})},[r,i,e.selfName]);const v=f.exports.useCallback(l9(g=>{console.log(g),u(g)},400),[]),h=l.filter(g=>g.NickName.includes(c));return ie("div",{className:"wechat-UserList",onClick:e.onClick,children:[C(s9,{onChange:v}),C("div",{className:"wechat-UserList-Items",children:h.map((g,p)=>C(c9,{className:t===p?"selectedItem":"",onClick:()=>{d(p,g)},name:g.NickName,msg:g.Content,date:u9(g.Time),Avatar:g.UserInfo.SmallHeadImgUrl},Am()))})]})}const ia={INIT:"normal",START:"active",END:"success",ERROR:"exception"};function f9({info:e,appVersion:t}){const[n,r]=f.exports.useState({});return f.exports.useEffect(()=>{r({PID:e.PID,path:e.FilePath,version:e.Version!==""?e.Version+" "+(e.Is64Bits?"64bits":"32bits"):"\u7248\u672C\u83B7\u53D6\u5931\u8D25",userName:e.AcountName,result:e.DBkey&&e.DBkey.length>0?"success":"failed"})},[e]),ie(Tt,{children:[C("div",{children:"\u5F53\u524D\u767B\u9646\u7684\u5FAE\u4FE1\u4FE1\u606F"}),ie("div",{className:"WechatInfoTable",children:[ie("div",{className:"WechatInfoTable-column",children:[C("div",{children:"wechatDataBackup \u7248\u672C:"}),C(oa,{className:"WechatInfoTable-column-tag",color:"success",children:t})]}),ie("div",{className:"WechatInfoTable-column",children:[C("div",{children:"\u8FDB\u7A0BPID:"}),C(oa,{className:"WechatInfoTable-column-tag",color:n.PID===0?"red":"success",children:n.PID===0?"\u5F53\u524D\u6CA1\u6709\u6253\u5F00\u5FAE\u4FE1":n.PID})]}),ie("div",{className:"WechatInfoTable-column",children:[C("div",{children:"\u6587\u4EF6\u5B58\u50A8\u8DEF\u5F84:"}),C(oa,{className:"WechatInfoTable-column-tag",color:"success",children:n.path})]}),ie("div",{className:"WechatInfoTable-column",children:[C("div",{children:"\u5FAE\u4FE1\u8F6F\u4EF6\u7248\u672C:"}),C(oa,{className:"WechatInfoTable-column-tag",color:"success",children:n.version})]}),ie("div",{className:"WechatInfoTable-column",children:[C("div",{children:"\u5FAE\u4FE1ID:"}),C(oa,{className:"WechatInfoTable-column-tag",color:n.userName===""?"red":"success",children:n.userName===""?"\u5F53\u524D\u6CA1\u6709\u767B\u9646\u5FAE\u4FE1":n.userName})]}),ie("div",{className:"WechatInfoTable-column",children:[C("div",{children:"\u89E3\u5BC6\u7ED3\u679C:"}),C(oa,{className:"WechatInfoTable-column-tag",color:n.result==="success"?"green":"red",children:n.result==="success"?"\u89E3\u5BC6\u6210\u529F":"\u89E3\u5BC6\u5931\u8D25"})]})]})]})}function v9(e){const[t,n]=f.exports.useState(!1),[r,o]=f.exports.useState(!1),[i,a]=f.exports.useState({}),[l,s]=f.exports.useState(-1),[c,u]=f.exports.useState(ia.INIT),[d,v]=f.exports.useState(""),h=m=>{console.log(m);const y=JSON.parse(m);y.status==="error"?(u(ia.ERROR),s(100),o(!1)):(u(y.progress!==100?ia.START:ia.END),s(y.progress),o(y.progress!==100))},g=()=>{console.log("showModal"),n(!0),KB().then(m=>{console.log(m),a(JSON.parse(m))}),GB().then(m=>{v(m)}),_$("exportData",h)},p=m=>{r!=!0&&(n(!1),s(-1),u(ia.INIT),A$("exportData"),e.onModalExit&&e.onModalExit())},b=m=>{o(!0),YB(m),s(0),u(ia.START)};return ie("div",{className:"Setting-Modal-Parent",children:[C("div",{onClick:g,children:e.children}),ie(js,{className:"Setting-Modal",overlayClassName:"Setting-Modal-Overlay",isOpen:t,onRequestClose:p,children:[C("div",{className:"Setting-Modal-button",title:"\u5173\u95ED",onClick:()=>p(),children:C(eo,{className:"Setting-Modal-button-icon"})}),C(f9,{info:i,appVersion:d}),i.DBkey&&i.DBkey.length>0&&C(p9,{onClickExport:b,children:C(Xu,{className:"Setting-Modal-export-button",type:"primary",disabled:r==!0,children:"\u5BFC\u51FA\u6B64\u8D26\u53F7\u6570\u636E"})}),l>-1&&C(DB,{percent:l,status:c})]})]})}const p9=e=>{const[t,n]=f.exports.useState(!1),r=i=>{n(!1)},o=i=>{n(!1),e.onClickExport&&e.onClickExport(i)};return ie("div",{className:"Setting-Modal-confirm-Parent",children:[C("div",{onClick:()=>n(!0),children:e.children}),ie(js,{className:"Setting-Modal-confirm",overlayClassName:"Setting-Modal-confirm-Overlay",isOpen:t,onRequestClose:r,children:[C("div",{className:"Setting-Modal-confirm-title",children:"\u9009\u62E9\u5BFC\u51FA\u65B9\u5F0F"}),ie("div",{className:"Setting-Modal-confirm-buttons",children:[C(Xu,{className:"Setting-Modal-export-button",type:"primary",onClick:()=>o(!0),children:"\u5168\u91CF\u5BFC\u51FA\uFF08\u901F\u5EA6\u6162\uFF09"}),C(Xu,{className:"Setting-Modal-export-button",type:"primary",onClick:()=>o(!1),children:"\u589E\u91CF\u5BFC\u51FA\uFF08\u901F\u5EA6\u5FEB\uFF09"})]})]})]})};function g9(e){const[t,n]=f.exports.useState("chat"),r=o=>{o!=="avatar"&&n(o),e.onClickItem&&e.onClickItem(o)};return ie("div",{className:"wechat-menu",children:[C(Yo,{id:"wechat-menu-item-Avatar",className:"wechat-menu-item wechat-menu-item-Avatar",src:e.Avatar,size:"large",shape:"square",alt:"\u65E0\u6CD5\u52A0\u8F7D\u5934\u50CF",onClick:()=>r("avatar")}),C(Yo,{icon:C($4,{}),title:"\u67E5\u770B\u804A\u5929",className:`wechat-menu-item wechat-menu-item-icon ${t==="chat"?"wechat-menu-selectedColor":""}`,size:"default",onClick:()=>r("chat")}),C(v9,{onModalExit:()=>e.onClickItem("exit"),children:C(Yo,{icon:C(c4,{}),title:"\u8BBE\u7F6E",className:`wechat-menu-item wechat-menu-item-icon ${t==="setting"?"wechat-menu-selectedColor":""}`,size:"default"})})]})}var Ng=function(e,t){return Ng=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)r.hasOwnProperty(o)&&(n[o]=r[o])},Ng(e,t)};function h9(e,t){Ng(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var es=function(){return es=Object.assign||function(t){for(var n,r=1,o=arguments.length;re?h():t!==!0&&(o=setTimeout(r?g:h,r===void 0?e-d:e))}return c.cancel=s,c}var La={Pixel:"Pixel",Percent:"Percent"},g1={unit:La.Percent,value:.8};function h1(e){return typeof e=="number"?{unit:La.Percent,value:e*100}:typeof e=="string"?e.match(/^(\d*(\.\d+)?)px$/)?{unit:La.Pixel,value:parseFloat(e)}:e.match(/^(\d*(\.\d+)?)%$/)?{unit:La.Percent,value:parseFloat(e)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),g1):(console.warn("scrollThreshold should be string or number"),g1)}var D$=function(e){h9(t,e);function t(n){var r=e.call(this,n)||this;return r.lastScrollTop=0,r.actionTriggered=!1,r.startY=0,r.currentY=0,r.dragging=!1,r.maxPullDownDistance=0,r.getScrollableTarget=function(){return r.props.scrollableTarget instanceof HTMLElement?r.props.scrollableTarget:typeof r.props.scrollableTarget=="string"?document.getElementById(r.props.scrollableTarget):(r.props.scrollableTarget===null&&console.warn(`You are trying to pass scrollableTarget but it is null. This might happen because the element may not have been added to DOM yet. See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info. `),null)},r.onStart=function(o){r.lastScrollTop||(r.dragging=!0,o instanceof MouseEvent?r.startY=o.pageY:o instanceof TouchEvent&&(r.startY=o.touches[0].pageY),r.currentY=r.startY,r._infScroll&&(r._infScroll.style.willChange="transform",r._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},r.onMove=function(o){!r.dragging||(o instanceof MouseEvent?r.currentY=o.pageY:o instanceof TouchEvent&&(r.currentY=o.touches[0].pageY),!(r.currentY=Number(r.props.pullDownToRefreshThreshold)&&r.setState({pullToRefreshThresholdBreached:!0}),!(r.currentY-r.startY>r.maxPullDownDistance*1.5)&&r._infScroll&&(r._infScroll.style.overflow="visible",r._infScroll.style.transform="translate3d(0px, "+(r.currentY-r.startY)+"px, 0px)")))},r.onEnd=function(){r.startY=0,r.currentY=0,r.dragging=!1,r.state.pullToRefreshThresholdBreached&&(r.props.refreshFunction&&r.props.refreshFunction(),r.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame(function(){r._infScroll&&(r._infScroll.style.overflow="auto",r._infScroll.style.transform="none",r._infScroll.style.willChange="unset")})},r.onScrollListener=function(o){typeof r.props.onScroll=="function"&&setTimeout(function(){return r.props.onScroll&&r.props.onScroll(o)},0);var i=r.props.height||r._scrollableNode?o.target:document.documentElement.scrollTop?document.documentElement:document.body;if(!r.actionTriggered){var a=r.props.inverse?r.isElementAtTop(i,r.props.scrollThreshold):r.isElementAtBottom(i,r.props.scrollThreshold);a&&r.props.hasMore&&(r.actionTriggered=!0,r.setState({showLoader:!0}),r.props.next&&r.props.next()),r.lastScrollTop=i.scrollTop}},r.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:n.dataLength},r.throttledOnScrollListener=m9(150,r.onScrollListener).bind(r),r.onStart=r.onStart.bind(r),r.onMove=r.onMove.bind(r),r.onEnd=r.onEnd.bind(r),r}return t.prototype.componentDidMount=function(){if(typeof this.props.dataLength>"u")throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),typeof this.props.initialScrollY=="number"&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),typeof this.props.refreshFunction!="function"))throw new Error(`Mandatory prop "refreshFunction" missing. diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 5a21f74..a8f0e42 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -4,7 +4,7 @@ wechatDataBackup - + diff --git a/pkg/wechat/wechat.go b/pkg/wechat/wechat.go index 2815392..07cbc61 100644 --- a/pkg/wechat/wechat.go +++ b/pkg/wechat/wechat.go @@ -16,6 +16,8 @@ import ( "path/filepath" "strings" "sync" + "sync/atomic" + "time" "unsafe" "wechatDataBackup/pkg/lame" "wechatDataBackup/pkg/silk" @@ -82,8 +84,21 @@ func exportWeChatVoice(info WeChatInfo, expPath string, progress chan<- string) } } + handleNumber := int64(0) + fileNumber := int64(0) + index := 0 + for { + mediaMSGDB := fmt.Sprintf("%s\\Msg\\Multi\\MediaMSG%d.db", expPath, index) + _, err := os.Stat(mediaMSGDB) + if err != nil { + break + } + index += 1 + fileNumber += 1 + } + var wg sync.WaitGroup - index := -1 + index = -1 MSGChan := make(chan wechatMediaMSG, 100) go func() { for { @@ -117,6 +132,7 @@ func exportWeChatVoice(info WeChatInfo, expPath string, progress chan<- string) MSGChan <- msg } + atomic.AddInt64(&handleNumber, 1) } close(MSGChan) }() @@ -139,6 +155,22 @@ func exportWeChatVoice(info WeChatInfo, expPath string, progress chan<- string) } }() } + + wg.Add(1) + go func() { + defer wg.Done() + for { + if handleNumber >= fileNumber { + break + } + filePercent := float64(handleNumber) / float64(fileNumber) + totalPercent := 61 + (filePercent * (100 - 61)) + totalPercentStr := fmt.Sprintf("{\"status\":\"processing\", \"result\":\"export WeChat voice doing\", \"progress\": %d}", int(totalPercent)) + progress <- totalPercentStr + time.Sleep(time.Second) + } + }() + wg.Wait() progress <- "{\"status\":\"processing\", \"result\":\"export WeChat voice end\", \"progress\": 100}" } @@ -149,6 +181,14 @@ func exportWeChatVideoAndFile(info WeChatInfo, expPath string, progress chan<- s fileRootPath := info.FilePath + "\\FileStorage\\File" cacheRootPath := info.FilePath + "\\FileStorage\\Cache" rootPaths := []string{videoRootPath, fileRootPath, cacheRootPath} + + handleNumber := int64(0) + fileNumber := int64(0) + for _, path := range rootPaths { + fileNumber += getPathFileNumber(path, "") + } + log.Println("VideoAndFile ", fileNumber) + var wg sync.WaitGroup taskChan := make(chan [2]string, 100) go func() { @@ -167,10 +207,6 @@ func exportWeChatVideoAndFile(info WeChatInfo, expPath string, progress chan<- s os.MkdirAll(filepath.Dir(expFile), 0644) } - _, err = os.Stat(expFile) - if err == nil { - return nil - } task := [2]string{path, expFile} taskChan <- task return nil @@ -191,14 +227,34 @@ func exportWeChatVideoAndFile(info WeChatInfo, expPath string, progress chan<- s go func() { defer wg.Done() for task := range taskChan { - _, err := copyFile(task[0], task[1]) + _, err := os.Stat(task[1]) + if err == nil { + atomic.AddInt64(&handleNumber, 1) + continue + } + _, err = copyFile(task[0], task[1]) if err != nil { log.Println("DecryptDat:", err) progress <- fmt.Sprintf("{\"status\":\"error\", \"result\":\"copyFile %v\"}", err) } + atomic.AddInt64(&handleNumber, 1) } }() } + wg.Add(1) + go func() { + defer wg.Done() + for { + if handleNumber >= fileNumber { + break + } + filePercent := float64(handleNumber) / float64(fileNumber) + totalPercent := 41 + (filePercent * (60 - 41)) + totalPercentStr := fmt.Sprintf("{\"status\":\"processing\", \"result\":\"export WeChat Video and File doing\", \"progress\": %d}", int(totalPercent)) + progress <- totalPercentStr + time.Sleep(time.Second) + } + }() wg.Wait() progress <- "{\"status\":\"processing\", \"result\":\"export WeChat Video and File end\", \"progress\": 60}" } @@ -212,6 +268,8 @@ func exportWeChatBat(info WeChatInfo, expPath string, progress chan<- string) { return } + handleNumber := int64(0) + fileNumber := getPathFileNumber(datRootPath, ".dat") var wg sync.WaitGroup taskChan := make(chan [2]string, 100) go func() { @@ -228,11 +286,6 @@ func exportWeChatBat(info WeChatInfo, expPath string, progress chan<- string) { os.MkdirAll(filepath.Dir(expFile), 0644) } - _, err = os.Stat(expFile) - if err == nil { - return nil - } - task := [2]string{path, expFile} taskChan <- task return nil @@ -253,14 +306,35 @@ func exportWeChatBat(info WeChatInfo, expPath string, progress chan<- string) { go func() { defer wg.Done() for task := range taskChan { + _, err = os.Stat(task[1]) + if err == nil { + atomic.AddInt64(&handleNumber, 1) + continue + } err = DecryptDat(task[0], task[1]) if err != nil { log.Println("DecryptDat:", err) progress <- fmt.Sprintf("{\"status\":\"error\", \"result\":\"DecryptDat %v\"}", err) } + atomic.AddInt64(&handleNumber, 1) } }() } + wg.Add(1) + go func() { + defer wg.Done() + for { + if handleNumber >= fileNumber { + break + } + + filePercent := float64(handleNumber) / float64(fileNumber) + totalPercent := 21 + (filePercent * (40 - 21)) + totalPercentStr := fmt.Sprintf("{\"status\":\"processing\", \"result\":\"export WeChat Dat doing\", \"progress\": %d}", int(totalPercent)) + progress <- totalPercentStr + time.Sleep(time.Second) + } + }() wg.Wait() progress <- "{\"status\":\"processing\", \"result\":\"export WeChat Dat end\", \"progress\": 40}" } @@ -276,6 +350,8 @@ func exportWeChatDateBase(info WeChatInfo, expPath string, progress chan<- strin return false } + handleNumber := int64(0) + fileNumber := getPathFileNumber(info.FilePath+"\\Msg", ".db") var wg sync.WaitGroup taskChan := make(chan [2]string, 20) go func() { @@ -318,9 +394,25 @@ func exportWeChatDateBase(info WeChatInfo, expPath string, progress chan<- strin progress <- fmt.Sprintf("{\"status\":\"error\", \"result\":\"%s %v\"}", task[0], err) } } + atomic.AddInt64(&handleNumber, 1) } }() } + + wg.Add(1) + go func() { + defer wg.Done() + for { + if handleNumber >= fileNumber { + break + } + filePercent := float64(handleNumber) / float64(fileNumber) + totalPercent := 1 + (filePercent * (20 - 1)) + totalPercentStr := fmt.Sprintf("{\"status\":\"processing\", \"result\":\"export WeChat DateBase doing\", \"progress\": %d}", int(totalPercent)) + progress <- totalPercentStr + time.Sleep(time.Second) + } + }() wg.Wait() progress <- "{\"status\":\"processing\", \"result\":\"export WeChat DateBase end\", \"progress\": 20}" return true @@ -651,3 +743,24 @@ func silkToMp3(amrBuf []byte, mp3Path string) error { return nil } + +func getPathFileNumber(targetPath string, fileSuffix string) int64 { + + number := int64(0) + err := filepath.Walk(targetPath, func(path string, finfo os.FileInfo, err error) error { + if err != nil { + log.Printf("filepath.Walk:%v\n", err) + return err + } + if !finfo.IsDir() && strings.HasSuffix(path, fileSuffix) { + number += 1 + } + + return nil + }) + if err != nil { + log.Println("filepath.Walk:", err) + } + + return number +}