pixivflow 2.34.0 → 2.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/download/novelMarkers.d.ts +18 -2
  2. package/dist/package.json +1 -1
  3. package/dist/version.js +1 -1
  4. package/dist/webui/package.json +1 -1
  5. package/dist/webui/routes/handlers/scheduler-handlers.d.ts +17 -0
  6. package/dist/webui/routes/handlers/scheduler-handlers.js +99 -0
  7. package/dist/webui/routes/scheduler.js +2 -0
  8. package/dist/webui/utils/error-codes.d.ts +2 -0
  9. package/dist/webui/utils/error-codes.js +2 -0
  10. package/package.json +1 -1
  11. package/webui-frontend/dist/assets/ActionButton-bmITMO8t.js +2 -0
  12. package/webui-frontend/dist/assets/{CheckCircleOutlined-H3DnUyMO.js → CheckCircleOutlined-DXxMdP08.js} +2 -2
  13. package/webui-frontend/dist/assets/{ClearOutlined-BpODq7I7.js → ClearOutlined-CVkP1OPo.js} +2 -2
  14. package/webui-frontend/dist/assets/{CloseCircleOutlined-BFfS5iXd.js → CloseCircleOutlined-DGYEx-rx.js} +2 -2
  15. package/webui-frontend/dist/assets/{Config-DRElCeDC.js → Config-BFBZgSvI.js} +3 -3
  16. package/webui-frontend/dist/assets/Dashboard-CHiRV77D.js +2 -0
  17. package/webui-frontend/dist/assets/{DeleteOutlined-BFmW1oWe.js → DeleteOutlined-DwsLtl_I.js} +2 -2
  18. package/webui-frontend/dist/assets/Download-BY0RQ0yW.js +2 -0
  19. package/webui-frontend/dist/assets/{Files-nNoRY5tl.js → Files-qrEyGaCr.js} +3 -3
  20. package/webui-frontend/dist/assets/{PictureOutlined-U51jGr2U.js → PictureOutlined-B5UcfS3J.js} +2 -2
  21. package/webui-frontend/dist/assets/{SortDescendingOutlined-CckVuL_b.js → SortDescendingOutlined-CIPBhzNI.js} +2 -2
  22. package/webui-frontend/dist/assets/{useErrorHandler-BOvHue1w.js → Table-COdSkj3k.js} +31 -31
  23. package/webui-frontend/dist/assets/ThunderboltOutlined-BlHGTLpd.js +2 -0
  24. package/webui-frontend/dist/assets/UrlDownload-Dxj1MDnw.js +3 -0
  25. package/webui-frontend/dist/assets/{dateUtils-gQt2uAjS.js → dateUtils-Dh-zVUtr.js} +2 -2
  26. package/webui-frontend/dist/assets/errorCodeTranslator-D5vahyqQ.js +2 -0
  27. package/webui-frontend/dist/assets/{index-DPigBPWX.js → index-B84Vd9_M.js} +2 -2
  28. package/webui-frontend/dist/assets/index-BhmvYPFd.js +19 -0
  29. package/webui-frontend/dist/assets/{index-CDrp3NIf.js → index-Bp5yfy4e.js} +2 -2
  30. package/webui-frontend/dist/assets/{index-DG6kGbYq.js → index-BtXc5-H2.js} +37 -37
  31. package/webui-frontend/dist/assets/index-BvQQNYa5.js +22 -0
  32. package/webui-frontend/dist/assets/index-C2qRwckx.js +2 -0
  33. package/webui-frontend/dist/assets/index-CFWcxkyB.js +2 -0
  34. package/webui-frontend/dist/assets/index-CZ44NQeD.js +2 -0
  35. package/webui-frontend/dist/assets/index-CZXbP5HB.js +3 -0
  36. package/webui-frontend/dist/assets/{index-CJln3zA7.js → index-CZlT-55J.js} +3 -3
  37. package/webui-frontend/dist/assets/index-Cfg0ICF_.js +20 -0
  38. package/webui-frontend/dist/assets/index-D1KRxkVR.js +2 -0
  39. package/webui-frontend/dist/assets/{index-B2ns27ii.js → index-D8iUeVsP.js} +2 -2
  40. package/webui-frontend/dist/assets/{index-B7yYDv10.js → index-DcqvG64t.js} +2 -2
  41. package/webui-frontend/dist/assets/index-eeF42ACG.js +2 -0
  42. package/webui-frontend/dist/assets/{index-_EG4kaKN.js → index-xZubvNRw.js} +6 -6
  43. package/webui-frontend/dist/assets/row-DaMDSIar.js +2 -0
  44. package/webui-frontend/dist/assets/{useAuth-wCjAOx6S.js → useAuth-BfM9bg0I.js} +4 -4
  45. package/webui-frontend/dist/assets/{useConfig-Ds7RpIL1.js → useConfig-nFBmSW5k.js} +2 -2
  46. package/webui-frontend/dist/assets/{useDownload-BlxvZNEm.js → useDownload-ChmDqdbc.js} +2 -2
  47. package/webui-frontend/dist/assets/useErrorHandler-MJ8OxkB4.js +2 -0
  48. package/webui-frontend/dist/index.html +1 -1
  49. package/webui-frontend/dist/assets/Dashboard-aqPMquSO.js +0 -2
  50. package/webui-frontend/dist/assets/Download-DCKDU51K.js +0 -2
  51. package/webui-frontend/dist/assets/ThunderboltOutlined-ulcCd7ui.js +0 -2
  52. package/webui-frontend/dist/assets/UrlDownload-Bzs0AZN0.js +0 -3
  53. package/webui-frontend/dist/assets/errorCodeTranslator-BqIackMm.js +0 -3
  54. package/webui-frontend/dist/assets/index-Bbsa44oT.js +0 -2
  55. package/webui-frontend/dist/assets/index-C2ANILg9.js +0 -19
  56. package/webui-frontend/dist/assets/index-CFtP5lqo.js +0 -22
  57. package/webui-frontend/dist/assets/index-CZhfhXvc.js +0 -2
  58. package/webui-frontend/dist/assets/index-CfHs6AUn.js +0 -2
  59. package/webui-frontend/dist/assets/index-DarObP-C.js +0 -2
  60. package/webui-frontend/dist/assets/row-_c51T55h.js +0 -20
@@ -1,4 +1,4 @@
1
- import{a2 as h,i as Z,n as G,h as H,o as ee,a3 as U,_ as j,a4 as re,a5 as se,a6 as ne,a7 as le,w as ce,a8 as de,p as ue,a9 as ge,r as M,D as fe,v as me,x as ye,A as _,aa as Ce,z as pe,ab as ve,C as he,ac as be,J as Ie,ad as xe,ae as W,af as $e,ag as J,I as Se,a as I,U as Q,u as Y,Q as R}from"./index-DG6kGbYq.js";import{u as B}from"./errorCodeTranslator-BqIackMm.js";import{u as V}from"./useErrorHandler-BOvHue1w.js";var ae=h.forwardRef(function(e,n){var a=e.prefixCls,t=e.forceRender,d=e.className,u=e.style,s=e.children,r=e.isActive,o=e.role,i=e.classNames,m=e.styles,g=h.useState(r||t),C=Z(g,2),c=C[0],f=C[1];return h.useEffect(function(){(t||r)&&f(!0)},[t,r]),c?h.createElement("div",{ref:n,className:G("".concat(a,"-content"),H(H({},"".concat(a,"-content-active"),r),"".concat(a,"-content-inactive"),!r),d),style:u,role:o},h.createElement("div",{className:G("".concat(a,"-content-box"),i?.body),style:m?.body},s)):null});ae.displayName="PanelContent";var we=["showArrow","headerClass","isActive","onItemClick","forceRender","className","classNames","styles","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],te=h.forwardRef(function(e,n){var a=e.showArrow,t=a===void 0?!0:a,d=e.headerClass,u=e.isActive,s=e.onItemClick,r=e.forceRender,o=e.className,i=e.classNames,m=i===void 0?{}:i,g=e.styles,C=g===void 0?{}:g,c=e.prefixCls,f=e.collapsible,p=e.accordion,x=e.panelKey,y=e.extra,v=e.header,b=e.expandIcon,l=e.openMotion,w=e.destroyInactivePanel,$=e.children,A=ee(e,we),S=f==="disabled",P=y!=null&&typeof y!="boolean",N=H(H(H({onClick:function(){s?.(x)},onKeyDown:function(O){(O.key==="Enter"||O.keyCode===U.ENTER||O.which===U.ENTER)&&s?.(x)},role:p?"tab":"button"},"aria-expanded",u),"aria-disabled",S),"tabIndex",S?-1:0),k=typeof b=="function"?b(e):h.createElement("i",{className:"arrow"}),z=k&&h.createElement("div",j({className:"".concat(c,"-expand-icon")},["header","icon"].includes(f)?N:{}),k),T=G("".concat(c,"-item"),H(H({},"".concat(c,"-item-active"),u),"".concat(c,"-item-disabled"),S),o),D=G(d,"".concat(c,"-header"),H({},"".concat(c,"-collapsible-").concat(f),!!f),m.header),F=re({className:D,style:C.header},["header","icon"].includes(f)?{}:N);return h.createElement("div",j({},A,{ref:n,className:T}),h.createElement("div",F,t&&z,h.createElement("span",j({className:"".concat(c,"-header-text")},f==="header"?N:{}),v),P&&h.createElement("div",{className:"".concat(c,"-extra")},y)),h.createElement(se,j({visible:u,leavedClassName:"".concat(c,"-content-hidden")},l,{forceRender:r,removeOnLeave:w}),function(E,O){var L=E.className,q=E.style;return h.createElement(ae,{ref:O,prefixCls:c,className:L,classNames:m,style:q,styles:C,isActive:u,forceRender:r,role:p?"tabpanel":void 0},$)}))}),Pe=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],Ne=function(n,a){var t=a.prefixCls,d=a.accordion,u=a.collapsible,s=a.destroyInactivePanel,r=a.onItemClick,o=a.activeKey,i=a.openMotion,m=a.expandIcon;return n.map(function(g,C){var c=g.children,f=g.label,p=g.key,x=g.collapsible,y=g.onItemClick,v=g.destroyInactivePanel,b=ee(g,Pe),l=String(p??C),w=x??u,$=v??s,A=function(N){w!=="disabled"&&(r(N),y?.(N))},S=!1;return d?S=o[0]===l:S=o.indexOf(l)>-1,h.createElement(te,j({},b,{prefixCls:t,key:l,panelKey:l,isActive:S,accordion:d,openMotion:i,expandIcon:m,header:f,collapsible:w,onItemClick:A,destroyInactivePanel:$}),c)})},Ae=function(n,a,t){if(!n)return null;var d=t.prefixCls,u=t.accordion,s=t.collapsible,r=t.destroyInactivePanel,o=t.onItemClick,i=t.activeKey,m=t.openMotion,g=t.expandIcon,C=n.key||String(a),c=n.props,f=c.header,p=c.headerClass,x=c.destroyInactivePanel,y=c.collapsible,v=c.onItemClick,b=!1;u?b=i[0]===C:b=i.indexOf(C)>-1;var l=y??s,w=function(S){l!=="disabled"&&(o(S),v?.(S))},$={key:C,panelKey:C,header:f,headerClass:p,isActive:b,prefixCls:d,destroyInactivePanel:x??r,openMotion:m,accordion:u,children:n.props.children,onItemClick:w,expandIcon:g,collapsible:l};return typeof n.type=="string"?n:(Object.keys($).forEach(function(A){typeof $[A]>"u"&&delete $[A]}),h.cloneElement(n,$))};function Fe(e,n,a){return Array.isArray(e)?Ne(e,a):ne(n).map(function(t,d){return Ae(t,d,a)})}function Ee(e){var n=e;if(!Array.isArray(n)){var a=ue(n);n=a==="number"||a==="string"?[n]:[]}return n.map(function(t){return String(t)})}var Oe=h.forwardRef(function(e,n){var a=e.prefixCls,t=a===void 0?"rc-collapse":a,d=e.destroyInactivePanel,u=d===void 0?!1:d,s=e.style,r=e.accordion,o=e.className,i=e.children,m=e.collapsible,g=e.openMotion,C=e.expandIcon,c=e.activeKey,f=e.defaultActiveKey,p=e.onChange,x=e.items,y=G(t,o),v=le([],{value:c,onChange:function(P){return p?.(P)},defaultValue:f,postState:Ee}),b=Z(v,2),l=b[0],w=b[1],$=function(P){return w(function(){if(r)return l[0]===P?[]:[P];var N=l.indexOf(P),k=N>-1;return k?l.filter(function(z){return z!==P}):[].concat(ge(l),[P])})};ce(!i,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var A=Fe(x,i,{prefixCls:t,accordion:r,openMotion:g,expandIcon:C,collapsible:m,destroyInactivePanel:u,onItemClick:$,activeKey:l});return h.createElement("div",j({ref:n,className:y,style:s,role:r?"tablist":void 0},de(e,{aria:!0,data:!0})),A)});const X=Object.assign(Oe,{Panel:te});X.Panel;const Me=M.forwardRef((e,n)=>{const{getPrefixCls:a}=M.useContext(fe),{prefixCls:t,className:d,showArrow:u=!0}=e,s=a("collapse",t),r=G({[`${s}-no-arrow`]:!u},d);return M.createElement(X.Panel,Object.assign({ref:n},e,{prefixCls:s,className:r}))}),Re=e=>{const{componentCls:n,contentBg:a,padding:t,headerBg:d,headerPadding:u,collapseHeaderPaddingSM:s,collapseHeaderPaddingLG:r,collapsePanelBorderRadius:o,lineWidth:i,lineType:m,colorBorder:g,colorText:C,colorTextHeading:c,colorTextDisabled:f,fontSizeLG:p,lineHeight:x,lineHeightLG:y,marginSM:v,paddingSM:b,paddingLG:l,paddingXS:w,motionDurationSlow:$,fontSizeIcon:A,contentPadding:S,fontHeight:P,fontHeightLG:N}=e,k=`${_(i)} ${m} ${g}`;return{[n]:Object.assign(Object.assign({},pe(e)),{backgroundColor:d,border:k,borderRadius:o,"&-rtl":{direction:"rtl"},[`& > ${n}-item`]:{borderBottom:k,"&:first-child":{[`
1
+ import{a2 as h,i as Z,n as G,h as H,o as ee,a3 as U,_ as j,a4 as re,a5 as se,a6 as ne,a7 as le,w as ce,a8 as de,p as ue,a9 as ge,r as M,D as fe,v as me,x as ye,A as _,aa as Ce,z as pe,ab as ve,C as he,ac as be,J as Ie,ad as xe,ae as W,af as $e,ag as J,I as Se,a as I,U as Q,u as Y,Q as R}from"./index-BtXc5-H2.js";import{u as B}from"./errorCodeTranslator-D5vahyqQ.js";import{u as V}from"./useErrorHandler-MJ8OxkB4.js";var ae=h.forwardRef(function(e,n){var a=e.prefixCls,t=e.forceRender,d=e.className,u=e.style,s=e.children,r=e.isActive,o=e.role,i=e.classNames,m=e.styles,g=h.useState(r||t),C=Z(g,2),c=C[0],f=C[1];return h.useEffect(function(){(t||r)&&f(!0)},[t,r]),c?h.createElement("div",{ref:n,className:G("".concat(a,"-content"),H(H({},"".concat(a,"-content-active"),r),"".concat(a,"-content-inactive"),!r),d),style:u,role:o},h.createElement("div",{className:G("".concat(a,"-content-box"),i?.body),style:m?.body},s)):null});ae.displayName="PanelContent";var we=["showArrow","headerClass","isActive","onItemClick","forceRender","className","classNames","styles","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],te=h.forwardRef(function(e,n){var a=e.showArrow,t=a===void 0?!0:a,d=e.headerClass,u=e.isActive,s=e.onItemClick,r=e.forceRender,o=e.className,i=e.classNames,m=i===void 0?{}:i,g=e.styles,C=g===void 0?{}:g,c=e.prefixCls,f=e.collapsible,p=e.accordion,x=e.panelKey,y=e.extra,v=e.header,b=e.expandIcon,l=e.openMotion,w=e.destroyInactivePanel,$=e.children,A=ee(e,we),S=f==="disabled",P=y!=null&&typeof y!="boolean",N=H(H(H({onClick:function(){s?.(x)},onKeyDown:function(O){(O.key==="Enter"||O.keyCode===U.ENTER||O.which===U.ENTER)&&s?.(x)},role:p?"tab":"button"},"aria-expanded",u),"aria-disabled",S),"tabIndex",S?-1:0),k=typeof b=="function"?b(e):h.createElement("i",{className:"arrow"}),z=k&&h.createElement("div",j({className:"".concat(c,"-expand-icon")},["header","icon"].includes(f)?N:{}),k),T=G("".concat(c,"-item"),H(H({},"".concat(c,"-item-active"),u),"".concat(c,"-item-disabled"),S),o),D=G(d,"".concat(c,"-header"),H({},"".concat(c,"-collapsible-").concat(f),!!f),m.header),F=re({className:D,style:C.header},["header","icon"].includes(f)?{}:N);return h.createElement("div",j({},A,{ref:n,className:T}),h.createElement("div",F,t&&z,h.createElement("span",j({className:"".concat(c,"-header-text")},f==="header"?N:{}),v),P&&h.createElement("div",{className:"".concat(c,"-extra")},y)),h.createElement(se,j({visible:u,leavedClassName:"".concat(c,"-content-hidden")},l,{forceRender:r,removeOnLeave:w}),function(E,O){var L=E.className,q=E.style;return h.createElement(ae,{ref:O,prefixCls:c,className:L,classNames:m,style:q,styles:C,isActive:u,forceRender:r,role:p?"tabpanel":void 0},$)}))}),Pe=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],Ne=function(n,a){var t=a.prefixCls,d=a.accordion,u=a.collapsible,s=a.destroyInactivePanel,r=a.onItemClick,o=a.activeKey,i=a.openMotion,m=a.expandIcon;return n.map(function(g,C){var c=g.children,f=g.label,p=g.key,x=g.collapsible,y=g.onItemClick,v=g.destroyInactivePanel,b=ee(g,Pe),l=String(p??C),w=x??u,$=v??s,A=function(N){w!=="disabled"&&(r(N),y?.(N))},S=!1;return d?S=o[0]===l:S=o.indexOf(l)>-1,h.createElement(te,j({},b,{prefixCls:t,key:l,panelKey:l,isActive:S,accordion:d,openMotion:i,expandIcon:m,header:f,collapsible:w,onItemClick:A,destroyInactivePanel:$}),c)})},Ae=function(n,a,t){if(!n)return null;var d=t.prefixCls,u=t.accordion,s=t.collapsible,r=t.destroyInactivePanel,o=t.onItemClick,i=t.activeKey,m=t.openMotion,g=t.expandIcon,C=n.key||String(a),c=n.props,f=c.header,p=c.headerClass,x=c.destroyInactivePanel,y=c.collapsible,v=c.onItemClick,b=!1;u?b=i[0]===C:b=i.indexOf(C)>-1;var l=y??s,w=function(S){l!=="disabled"&&(o(S),v?.(S))},$={key:C,panelKey:C,header:f,headerClass:p,isActive:b,prefixCls:d,destroyInactivePanel:x??r,openMotion:m,accordion:u,children:n.props.children,onItemClick:w,expandIcon:g,collapsible:l};return typeof n.type=="string"?n:(Object.keys($).forEach(function(A){typeof $[A]>"u"&&delete $[A]}),h.cloneElement(n,$))};function Fe(e,n,a){return Array.isArray(e)?Ne(e,a):ne(n).map(function(t,d){return Ae(t,d,a)})}function Ee(e){var n=e;if(!Array.isArray(n)){var a=ue(n);n=a==="number"||a==="string"?[n]:[]}return n.map(function(t){return String(t)})}var Oe=h.forwardRef(function(e,n){var a=e.prefixCls,t=a===void 0?"rc-collapse":a,d=e.destroyInactivePanel,u=d===void 0?!1:d,s=e.style,r=e.accordion,o=e.className,i=e.children,m=e.collapsible,g=e.openMotion,C=e.expandIcon,c=e.activeKey,f=e.defaultActiveKey,p=e.onChange,x=e.items,y=G(t,o),v=le([],{value:c,onChange:function(P){return p?.(P)},defaultValue:f,postState:Ee}),b=Z(v,2),l=b[0],w=b[1],$=function(P){return w(function(){if(r)return l[0]===P?[]:[P];var N=l.indexOf(P),k=N>-1;return k?l.filter(function(z){return z!==P}):[].concat(ge(l),[P])})};ce(!i,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var A=Fe(x,i,{prefixCls:t,accordion:r,openMotion:g,expandIcon:C,collapsible:m,destroyInactivePanel:u,onItemClick:$,activeKey:l});return h.createElement("div",j({ref:n,className:y,style:s,role:r?"tablist":void 0},de(e,{aria:!0,data:!0})),A)});const X=Object.assign(Oe,{Panel:te});X.Panel;const Me=M.forwardRef((e,n)=>{const{getPrefixCls:a}=M.useContext(fe),{prefixCls:t,className:d,showArrow:u=!0}=e,s=a("collapse",t),r=G({[`${s}-no-arrow`]:!u},d);return M.createElement(X.Panel,Object.assign({ref:n},e,{prefixCls:s,className:r}))}),Re=e=>{const{componentCls:n,contentBg:a,padding:t,headerBg:d,headerPadding:u,collapseHeaderPaddingSM:s,collapseHeaderPaddingLG:r,collapsePanelBorderRadius:o,lineWidth:i,lineType:m,colorBorder:g,colorText:C,colorTextHeading:c,colorTextDisabled:f,fontSizeLG:p,lineHeight:x,lineHeightLG:y,marginSM:v,paddingSM:b,paddingLG:l,paddingXS:w,motionDurationSlow:$,fontSizeIcon:A,contentPadding:S,fontHeight:P,fontHeightLG:N}=e,k=`${_(i)} ${m} ${g}`;return{[n]:Object.assign(Object.assign({},pe(e)),{backgroundColor:d,border:k,borderRadius:o,"&-rtl":{direction:"rtl"},[`& > ${n}-item`]:{borderBottom:k,"&:first-child":{[`
2
2
  &,
3
3
  & > ${n}-header`]:{borderRadius:`${_(o)} ${_(o)} 0 0`}},"&:last-child":{[`
4
4
  &,
@@ -6,4 +6,4 @@ import{a2 as h,i as Z,n as G,h as H,o as ee,a3 as U,_ as j,a4 as re,a5 as se,a6
6
6
  > ${n}-item:last-child,
7
7
  > ${n}-item:last-child ${n}-header
8
8
  `]:{borderRadius:0},[`> ${n}-item:last-child`]:{borderBottom:0},[`> ${n}-item > ${n}-content`]:{backgroundColor:d,borderTop:0},[`> ${n}-item > ${n}-content > ${n}-content-box`]:{padding:t}}}},ke=e=>{const{componentCls:n,paddingSM:a}=e;return{[`${n}-ghost`]:{backgroundColor:"transparent",border:0,[`> ${n}-item`]:{borderBottom:0,[`> ${n}-content`]:{backgroundColor:"transparent",border:0,[`> ${n}-content-box`]:{paddingBlock:a}}}}}},He=e=>({headerPadding:`${e.paddingSM}px ${e.padding}px`,headerBg:e.colorFillAlter,contentPadding:`${e.padding}px 16px`,contentBg:e.colorBgContainer,borderlessContentPadding:`${e.paddingXXS}px 16px ${e.padding}px`,borderlessContentBg:"transparent"}),Be=me("Collapse",e=>{const n=ye(e,{collapseHeaderPaddingSM:`${_(e.paddingXS)} ${_(e.paddingSM)}`,collapseHeaderPaddingLG:`${_(e.padding)} ${_(e.paddingLG)}`,collapsePanelBorderRadius:e.borderRadiusLG});return[Re(n),Ke(n),ke(n),_e(n),Ce(n)]},He),Ge=M.forwardRef((e,n)=>{const{getPrefixCls:a,direction:t,expandIcon:d,className:u,style:s}=be("collapse"),{prefixCls:r,className:o,rootClassName:i,style:m,bordered:g=!0,ghost:C,size:c,expandIconPosition:f="start",children:p,destroyInactivePanel:x,destroyOnHidden:y,expandIcon:v}=e,b=Ie(F=>{var E;return(E=c??F)!==null&&E!==void 0?E:"middle"}),l=a("collapse",r),w=a(),[$,A,S]=Be(l),P=M.useMemo(()=>f==="left"?"start":f==="right"?"end":f,[f]),N=v??d,k=M.useCallback((F={})=>{const E=typeof N=="function"?N(F):M.createElement(xe,{rotate:F.isActive?t==="rtl"?-90:90:void 0,"aria-label":F.isActive?"expanded":"collapsed"});return W(E,()=>{var O;return{className:G((O=E.props)===null||O===void 0?void 0:O.className,`${l}-arrow`)}})},[N,l,t]),z=G(`${l}-icon-position-${P}`,{[`${l}-borderless`]:!g,[`${l}-rtl`]:t==="rtl",[`${l}-ghost`]:!!C,[`${l}-${b}`]:b!=="middle"},u,o,i,A,S),T=M.useMemo(()=>Object.assign(Object.assign({},$e(w)),{motionAppear:!1,leavedClassName:`${l}-content-hidden`}),[w,l]),D=M.useMemo(()=>p?ne(p).map((F,E)=>{var O,L;const q=F.props;if(q?.disabled){const ie=(O=F.key)!==null&&O!==void 0?O:String(E),oe=Object.assign(Object.assign({},J(F.props,["disabled"])),{key:ie,collapsible:(L=q.collapsible)!==null&&L!==void 0?L:"disabled"});return W(F,oe)}return F}):null,[p]);return $(M.createElement(X,Object.assign({ref:n,openMotion:T},J(e,["rootClassName"]),{expandIcon:k,prefixCls:l,className:z,style:Object.assign(Object.assign({},s),m),destroyInactivePanel:y??x}),D))}),De=Object.assign(Ge,{Panel:Me});var je={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M719.4 499.1l-296.1-215A15.9 15.9 0 00398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 000-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z"}}]},name:"play-circle",theme:"outlined"},qe=function(n,a){return M.createElement(Se,j({},n,{ref:a,icon:je}))},Qe=M.forwardRef(qe);const K={async getConfig(){return(await I.getConfig()).data.data},async updateConfig(e){return(await I.updateConfig(e)).data.data},async validateConfig(e){return(await I.validateConfig(e)).data.data},async backupConfig(){return(await I.backupConfig()).data.data},async restoreConfig(e){return(await I.restoreConfig(e)).data.data},async getConfigHistory(){return(await I.getConfigHistory()).data.data},async saveConfigHistory(e,n,a){return{id:(await I.saveConfigHistory(e,n,a)).data.data.id,name:e,description:a??null,config:n,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),is_active:0}},async applyConfigHistory(e){await I.applyConfigHistory(e)},async deleteConfigHistory(e){await I.deleteConfigHistory(e)},async listConfigFiles(){return(await I.listConfigFiles()).data.data},async switchConfigFile(e){await I.switchConfigFile(e)},async importConfigFile(e,n){const t=(await I.importConfigFile(e,n)).data.data;return{filename:t.filename,path:t.path,pathRelative:t.pathRelative,modifiedTime:new Date().toISOString(),size:0,isActive:!1}},async deleteConfigFile(e){await I.deleteConfigFile(e)},async getConfigFileContent(e){return(await I.getConfigFileContent(e)).data.data},async updateConfigFileContent(e,n){await I.updateConfigFileContent(e,n)},async diagnoseConfig(){return(await I.diagnoseConfig()).data.data},async repairConfig(e=!0){return(await I.repairConfig(e)).data.data}};function Ye(){const e=Q(),{handleError:n}=V(),{data:a,isLoading:t,error:d,refetch:u}=Y({queryKey:R.CONFIG,queryFn:()=>K.getConfig()}),s=B({mutationFn:o=>K.updateConfig(o),onSuccess:()=>{e.invalidateQueries({queryKey:R.CONFIG})},onError:o=>n(o)}),r=B({mutationFn:o=>K.validateConfig(o),onError:o=>n(o)});return{config:a,isLoading:t,error:d,refetch:u,update:s.mutate,updateAsync:s.mutateAsync,isUpdating:s.isPending,validate:r.mutate,validateAsync:r.mutateAsync,isValidating:r.isPending,validationResult:r.data}}function Ve(){const e=Q(),{handleError:n}=V(),{data:a,isLoading:t,error:d,refetch:u}=Y({queryKey:R.CONFIG_FILES,queryFn:()=>K.listConfigFiles()}),s=B({mutationFn:i=>K.switchConfigFile(i),onSuccess:()=>{e.invalidateQueries({queryKey:R.CONFIG_FILES}),e.invalidateQueries({queryKey:R.CONFIG})},onError:i=>n(i)}),r=B({mutationFn:({config:i,name:m})=>K.importConfigFile(i,m),onSuccess:()=>{e.invalidateQueries({queryKey:R.CONFIG_FILES})},onError:i=>n(i)}),o=B({mutationFn:i=>K.deleteConfigFile(i),onSuccess:()=>{e.invalidateQueries({queryKey:R.CONFIG_FILES})},onError:i=>n(i)});return{configFiles:a||[],isLoading:t,error:d,refetch:u,switchFile:s.mutate,switchFileAsync:s.mutateAsync,isSwitching:s.isPending,importFile:r.mutate,importFileAsync:r.mutateAsync,isImporting:r.isPending,deleteFile:o.mutate,deleteFileAsync:o.mutateAsync,isDeleting:o.isPending}}function Xe(){const e=Q(),{handleError:n}=V(),{data:a,isLoading:t,error:d,refetch:u}=Y({queryKey:R.CONFIG_HISTORY,queryFn:()=>K.getConfigHistory()}),s=B({mutationFn:({name:i,config:m,description:g})=>K.saveConfigHistory(i,m,g),onSuccess:()=>{e.invalidateQueries({queryKey:R.CONFIG_HISTORY})},onError:i=>n(i)}),r=B({mutationFn:i=>K.applyConfigHistory(i),onSuccess:()=>{e.invalidateQueries({queryKey:R.CONFIG_HISTORY}),e.invalidateQueries({queryKey:R.CONFIG})},onError:i=>n(i)}),o=B({mutationFn:i=>K.deleteConfigHistory(i),onSuccess:()=>{e.invalidateQueries({queryKey:R.CONFIG_HISTORY})},onError:i=>n(i)});return{history:a||[],isLoading:t,error:d,refetch:u,save:s.mutate,saveAsync:s.mutateAsync,isSaving:s.isPending,apply:r.mutate,applyAsync:r.mutateAsync,isApplying:r.isPending,delete:o.mutate,deleteAsync:o.mutateAsync,isDeleting:o.isPending}}export{De as C,Qe as R,Ve as a,Xe as b,K as c,Ye as u};
9
- //# sourceMappingURL=useConfig-Ds7RpIL1.js.map
9
+ //# sourceMappingURL=useConfig-nFBmSW5k.js.map
@@ -1,2 +1,2 @@
1
- import{r as A,I as v,_ as O,a as r,U as S,u as D,Q as o}from"./index-DG6kGbYq.js";import{u as T}from"./errorCodeTranslator-BqIackMm.js";import{a as f,r as L}from"./socket-oqYz9cKb.js";import{u as g}from"./useErrorHandler-BOvHue1w.js";var E={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},q=function(t,a){return A.createElement(v,O({},t,{ref:a,icon:E}))},I=A.forwardRef(q);const c={async startDownload(e,t,a){return(await r.startDownload(e,t,a)).data.data},async stopDownload(e){await r.stopDownload(e)},async getDownloadStatus(e){return(await r.getDownloadStatus(e)).data.data},async getTaskLogs(e,t){return(await r.getTaskLogs(e,t)).data.data},async getDownloadHistory(e){return(await r.getDownloadHistory(e)).data.data},async runAllDownloads(e){return(await r.runAllDownloads(e)).data.data},async randomDownload(e){return(await r.randomDownload(e)).data.data},async getIncompleteTasks(){return(await r.getIncompleteTasks()).data.data},async resumeDownload(e,t){return(await r.resumeDownload(e,t)).data.data},async deleteIncompleteTask(e){await r.deleteIncompleteTask(e)},async deleteAllIncompleteTasks(){return(await r.deleteAllIncompleteTasks()).data.data},async deleteTaskHistory(e){return(await r.deleteTaskHistory(e)).data.data},async deleteAllTaskHistory(){return(await r.deleteAllTaskHistory()).data.data}};function Q(){const e=S(),{handleError:t}=g(),a=T({mutationFn:({targetId:n,config:u,configPaths:l})=>c.startDownload(n,u,l),onSuccess:()=>{e.invalidateQueries({queryKey:o.DOWNLOAD_STATUS()})},onError:n=>t(n)}),s=T({mutationFn:n=>c.stopDownload(n),onSuccess:()=>{e.invalidateQueries({queryKey:o.DOWNLOAD_STATUS()})},onError:n=>t(n)});return{start:a.mutate,startAsync:a.mutateAsync,isStarting:a.isPending,stop:s.mutate,stopAsync:s.mutateAsync,isStopping:s.isPending}}function N(e,t){const a=S(),{data:s,isLoading:n,error:u,refetch:l}=D({queryKey:o.DOWNLOAD_STATUS(e),queryFn:()=>c.getDownloadStatus(e),refetchInterval:t});return A.useEffect(()=>{const d=f(),y=()=>a.getQueryData(o.DOWNLOAD_STATUS(void 0))?.activeTask?.status??null,i=(...m)=>{const p=m[0];if(!p||p.kind!=="snapshot")return;const w=y(),k=p.status.activeTask;a.setQueryData(o.DOWNLOAD_STATUS(void 0),p.status),w==="running"&&k===null&&!p.status.hasActiveTask&&(a.invalidateQueries({queryKey:["stats"]}),a.invalidateQueries({queryKey:o.DOWNLOAD_HISTORY()}),a.invalidateQueries({queryKey:o.INCOMPLETE_TASKS}))};return d.on("download",i),()=>{d.off("download",i),L()}},[a,e]),{status:s,isLoading:n,error:u,refetch:l,hasActiveTask:s?.hasActiveTask??!1,activeTask:s?.activeTask,allTasks:s?.allTasks??[]}}function M(e,t,a){const{data:s,isLoading:n,error:u,refetch:l}=D({queryKey:o.DOWNLOAD_LOGS(e),queryFn:()=>c.getTaskLogs(e,t),enabled:!!e,refetchInterval:e&&a?a:!1});return{logs:s?.logs??[],isLoading:n,error:u,refetch:l}}function H(e){const{data:t,isLoading:a,error:s,refetch:n}=D({queryKey:o.DOWNLOAD_HISTORY(e),queryFn:()=>c.getDownloadHistory(e)});return{items:t?.items??[],total:t?.total??0,page:t?.page??1,limit:t?.limit??20,isLoading:a,error:s,refetch:n}}function P(){const e=S(),{handleError:t}=g(),{data:a,isLoading:s,error:n,refetch:u}=D({queryKey:o.INCOMPLETE_TASKS,queryFn:()=>c.getIncompleteTasks()}),l=T({mutationFn:({tag:i,type:m})=>c.resumeDownload(i,m),onSuccess:()=>{e.invalidateQueries({queryKey:o.INCOMPLETE_TASKS}),e.invalidateQueries({queryKey:o.DOWNLOAD_STATUS()})},onError:i=>t(i)}),d=T({mutationFn:i=>c.deleteIncompleteTask(i),onSuccess:()=>{e.invalidateQueries({queryKey:o.INCOMPLETE_TASKS})},onError:i=>t(i)}),y=T({mutationFn:()=>c.deleteAllIncompleteTasks(),onSuccess:()=>{e.invalidateQueries({queryKey:o.INCOMPLETE_TASKS})},onError:i=>t(i)});return{tasks:a?.tasks??[],isLoading:s,error:n,refetch:u,resume:l.mutate,resumeAsync:l.mutateAsync,isResuming:l.isPending,delete:d.mutate,deleteAsync:d.mutateAsync,isDeleting:d.isPending,deleteAll:y.mutate,deleteAllAsync:y.mutateAsync,isDeletingAll:y.isPending}}export{I as R,N as a,M as b,P as c,c as d,H as e,Q as u};
2
- //# sourceMappingURL=useDownload-BlxvZNEm.js.map
1
+ import{r as A,I as v,_ as O,a as r,U as S,u as D,Q as o}from"./index-BtXc5-H2.js";import{u as T}from"./errorCodeTranslator-D5vahyqQ.js";import{a as f,r as L}from"./socket-oqYz9cKb.js";import{u as g}from"./useErrorHandler-MJ8OxkB4.js";var E={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},q=function(t,a){return A.createElement(v,O({},t,{ref:a,icon:E}))},I=A.forwardRef(q);const c={async startDownload(e,t,a){return(await r.startDownload(e,t,a)).data.data},async stopDownload(e){await r.stopDownload(e)},async getDownloadStatus(e){return(await r.getDownloadStatus(e)).data.data},async getTaskLogs(e,t){return(await r.getTaskLogs(e,t)).data.data},async getDownloadHistory(e){return(await r.getDownloadHistory(e)).data.data},async runAllDownloads(e){return(await r.runAllDownloads(e)).data.data},async randomDownload(e){return(await r.randomDownload(e)).data.data},async getIncompleteTasks(){return(await r.getIncompleteTasks()).data.data},async resumeDownload(e,t){return(await r.resumeDownload(e,t)).data.data},async deleteIncompleteTask(e){await r.deleteIncompleteTask(e)},async deleteAllIncompleteTasks(){return(await r.deleteAllIncompleteTasks()).data.data},async deleteTaskHistory(e){return(await r.deleteTaskHistory(e)).data.data},async deleteAllTaskHistory(){return(await r.deleteAllTaskHistory()).data.data}};function Q(){const e=S(),{handleError:t}=g(),a=T({mutationFn:({targetId:n,config:u,configPaths:l})=>c.startDownload(n,u,l),onSuccess:()=>{e.invalidateQueries({queryKey:o.DOWNLOAD_STATUS()})},onError:n=>t(n)}),s=T({mutationFn:n=>c.stopDownload(n),onSuccess:()=>{e.invalidateQueries({queryKey:o.DOWNLOAD_STATUS()})},onError:n=>t(n)});return{start:a.mutate,startAsync:a.mutateAsync,isStarting:a.isPending,stop:s.mutate,stopAsync:s.mutateAsync,isStopping:s.isPending}}function N(e,t){const a=S(),{data:s,isLoading:n,error:u,refetch:l}=D({queryKey:o.DOWNLOAD_STATUS(e),queryFn:()=>c.getDownloadStatus(e),refetchInterval:t});return A.useEffect(()=>{const d=f(),y=()=>a.getQueryData(o.DOWNLOAD_STATUS(void 0))?.activeTask?.status??null,i=(...m)=>{const p=m[0];if(!p||p.kind!=="snapshot")return;const w=y(),k=p.status.activeTask;a.setQueryData(o.DOWNLOAD_STATUS(void 0),p.status),w==="running"&&k===null&&!p.status.hasActiveTask&&(a.invalidateQueries({queryKey:["stats"]}),a.invalidateQueries({queryKey:o.DOWNLOAD_HISTORY()}),a.invalidateQueries({queryKey:o.INCOMPLETE_TASKS}))};return d.on("download",i),()=>{d.off("download",i),L()}},[a,e]),{status:s,isLoading:n,error:u,refetch:l,hasActiveTask:s?.hasActiveTask??!1,activeTask:s?.activeTask,allTasks:s?.allTasks??[]}}function M(e,t,a){const{data:s,isLoading:n,error:u,refetch:l}=D({queryKey:o.DOWNLOAD_LOGS(e),queryFn:()=>c.getTaskLogs(e,t),enabled:!!e,refetchInterval:e&&a?a:!1});return{logs:s?.logs??[],isLoading:n,error:u,refetch:l}}function H(e){const{data:t,isLoading:a,error:s,refetch:n}=D({queryKey:o.DOWNLOAD_HISTORY(e),queryFn:()=>c.getDownloadHistory(e)});return{items:t?.items??[],total:t?.total??0,page:t?.page??1,limit:t?.limit??20,isLoading:a,error:s,refetch:n}}function P(){const e=S(),{handleError:t}=g(),{data:a,isLoading:s,error:n,refetch:u}=D({queryKey:o.INCOMPLETE_TASKS,queryFn:()=>c.getIncompleteTasks()}),l=T({mutationFn:({tag:i,type:m})=>c.resumeDownload(i,m),onSuccess:()=>{e.invalidateQueries({queryKey:o.INCOMPLETE_TASKS}),e.invalidateQueries({queryKey:o.DOWNLOAD_STATUS()})},onError:i=>t(i)}),d=T({mutationFn:i=>c.deleteIncompleteTask(i),onSuccess:()=>{e.invalidateQueries({queryKey:o.INCOMPLETE_TASKS})},onError:i=>t(i)}),y=T({mutationFn:()=>c.deleteAllIncompleteTasks(),onSuccess:()=>{e.invalidateQueries({queryKey:o.INCOMPLETE_TASKS})},onError:i=>t(i)});return{tasks:a?.tasks??[],isLoading:s,error:n,refetch:u,resume:l.mutate,resumeAsync:l.mutateAsync,isResuming:l.isPending,delete:d.mutate,deleteAsync:d.mutateAsync,isDeleting:d.isPending,deleteAll:y.mutate,deleteAllAsync:y.mutateAsync,isDeletingAll:y.isPending}}export{I as R,N as a,M as b,P as c,c as d,H as e,Q as u};
2
+ //# sourceMappingURL=useDownload-ChmDqdbc.js.map
@@ -0,0 +1,2 @@
1
+ import{b as f,r as e,b0 as m,V as b,s as n}from"./index-BtXc5-H2.js";import{t as g}from"./errorCodeTranslator-D5vahyqQ.js";function C(){const{t:o}=f(),t=e.useCallback((s,a)=>{if(a)return a;const r=g(s.code,o,s.params,s.message);return r||s.message||o("common.error.unknown")},[o]),c=e.useCallback((s,a)=>{const r=s instanceof m?s:b(s),d=t(r,a);return n.error(d),r},[t]),l=e.useCallback(s=>{n.success(s)},[]),u=e.useCallback(s=>{n.warning(s)},[]),i=e.useCallback(s=>{n.info(s)},[]);return{handleError:c,handleSuccess:l,handleWarning:u,handleInfo:i}}export{C as u};
2
+ //# sourceMappingURL=useErrorHandler-MJ8OxkB4.js.map
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>PixivFlow - WebUI</title>
8
- <script type="module" crossorigin src="./assets/index-DG6kGbYq.js"></script>
8
+ <script type="module" crossorigin src="./assets/index-BtXc5-H2.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="./assets/index-DHwJxrFi.css">
10
10
  </head>
11
11
  <body>
@@ -1,2 +0,0 @@
1
- import{a as o,R as x,u as p,Q as f,b as S,r as g,s as c,j as s,S as j,B as y,c as w,d as v,e as R}from"./index-DG6kGbYq.js";import{R as u,C as i,a as d}from"./row-_c51T55h.js";import{S as h}from"./index-DarObP-C.js";import{R as m}from"./PictureOutlined-U51jGr2U.js";const b={async getStatsOverview(){return(await o.getStatsOverview()).data.data},async getDownloadStats(t){return(await o.getDownloadStats(t)).data.data},async getTagStats(t){return(await o.getTagStats(t)).data.data},async getAuthorStats(t){return(await o.getAuthorStats(t)).data.data}};function D(t=x.STATS_OVERVIEW){const{data:a,isLoading:e,error:r,refetch:l}=p({queryKey:f.STATS_OVERVIEW,queryFn:()=>b.getStatsOverview(),refetchInterval:t});return{stats:a,isLoading:e,error:r,refetch:l}}function C(){const{t}=S(),{stats:a,isLoading:e,refetch:r}=D(),l=g.useCallback(async()=>{c.loading({content:t("dashboard.refreshingStats"),key:"refresh-stats"});try{await r(),c.success({content:t("dashboard.statsRefreshed"),key:"refresh-stats",duration:2})}catch{c.error({content:t("dashboard.refreshStatsFailed"),key:"refresh-stats",duration:2})}},[r,t]);if(e)return s.jsx(j,{size:"large",style:{display:"block",textAlign:"center",marginTop:50}});const n=a||{totalDownloads:0,illustrations:0,novels:0,recentDownloads:0};return s.jsxs("div",{children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[s.jsx("h2",{style:{margin:0},children:t("dashboard.title")}),s.jsx(y,{icon:s.jsx(w,{}),onClick:l,loading:e,children:t("dashboard.refreshStats")})]}),s.jsxs(u,{gutter:16,style:{marginTop:24},children:[s.jsx(i,{span:8,children:s.jsx(d,{children:s.jsx(h,{title:t("dashboard.totalDownloads"),value:n.totalDownloads,prefix:s.jsx(v,{})})})}),s.jsx(i,{span:8,children:s.jsx(d,{children:s.jsx(h,{title:t("dashboard.illustrations"),value:n.illustrations,prefix:s.jsx(m,{})})})}),s.jsx(i,{span:8,children:s.jsx(d,{children:s.jsx(h,{title:t("dashboard.novels"),value:n.novels,prefix:s.jsx(R,{})})})})]}),s.jsx(u,{gutter:16,style:{marginTop:16},children:s.jsx(i,{span:24,children:s.jsx(d,{title:t("dashboard.recentDownloads"),children:s.jsx("p",{children:t("dashboard.recentDownloadsDesc",{count:n.recentDownloads})})})})})]})}export{C as default};
2
- //# sourceMappingURL=Dashboard-aqPMquSO.js.map
@@ -1,2 +0,0 @@
1
- import{r as g,I as G,_ as X,b as C,j as e,d as fe,W as y,Y as oe,B as k,c as Q,Z as D,U as je,S as ye,s as f,Q as U,X as K,a as ae,u as Te}from"./index-DG6kGbYq.js";import{R as W,d as se,u as ke,a as Ce,b as Ie,c as ve}from"./useDownload-BlxvZNEm.js";import{R as re,C as Se,u as De}from"./useConfig-Ds7RpIL1.js";import{a as O,R as be,C as H}from"./row-_c51T55h.js";import{S as B}from"./index-DarObP-C.js";import{R as Z}from"./CheckCircleOutlined-H3DnUyMO.js";import{R as J}from"./CloseCircleOutlined-BFfS5iXd.js";import{u as Re,P as Ae,F as E}from"./useAuth-wCjAOx6S.js";import{T as R}from"./index-_EG4kaKN.js";import{f as b}from"./dateUtils-gQt2uAjS.js";import{D as I}from"./index-Bbsa44oT.js";import{T as F}from"./index-CJln3zA7.js";import{M as Y}from"./index-CDrp3NIf.js";import{R as V}from"./DeleteOutlined-BFmW1oWe.js";import{F as de}from"./useErrorHandler-BOvHue1w.js";import{P as ne}from"./index-CfHs6AUn.js";import{R as $e}from"./ClearOutlined-BpODq7I7.js";import{e as v,t as S}from"./errorCodeTranslator-BqIackMm.js";import"./socket-oqYz9cKb.js";var Me={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"},Fe=function(p,m){return g.createElement(G,X({},p,{ref:m,icon:Me}))},q=g.forwardRef(Fe),ze={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"}}]},name:"redo",theme:"outlined"},Oe=function(p,m){return g.createElement(G,X({},p,{ref:m,icon:ze}))},Le=g.forwardRef(Oe),Pe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"},He=function(p,m){return g.createElement(G,X({},p,{ref:m,icon:Pe}))},z=g.forwardRef(He);const Be=({total:o,completed:p,failed:m,stopped:n})=>{const{t:l}=C();return e.jsx(O,{style:{marginBottom:16},children:e.jsxs(be,{gutter:16,children:[e.jsx(H,{span:6,children:e.jsx(B,{title:l("download.totalTasks"),value:o,prefix:e.jsx(fe,{})})}),e.jsx(H,{span:6,children:e.jsx(B,{title:l("download.completed"),value:p,valueStyle:{color:"#3f8600"},prefix:e.jsx(Z,{})})}),e.jsx(H,{span:6,children:e.jsx(B,{title:l("download.failed"),value:m,valueStyle:{color:"#cf1322"},prefix:e.jsx(J,{})})}),e.jsx(H,{span:6,children:e.jsx(B,{title:l("download.stopped"),value:n,valueStyle:{color:"#8c8c8c"},prefix:e.jsx(z,{})})})]})})},{Text:$}=R,Ee=({hasActiveTask:o,onStartClick:p,onRunAllClick:m,onStopClick:n,isStarting:l,isRunningAll:s,isStopping:d,storage:i,onRefreshConfig:u})=>{const{t}=C(),{authenticated:w}=Re(),r=!w,h=t("common.loginRequired"),a=i?.illustrationDirectory||(i?.downloadDirectory?`${i.downloadDirectory}/illustrations`:"./downloads/illustrations"),c=i?.novelDirectory||(i?.downloadDirectory?`${i.downloadDirectory}/novels`:"./downloads/novels");return e.jsxs(O,{title:e.jsxs(y,{children:[e.jsx(q,{}),e.jsx("span",{children:t("download.taskOperations")})]}),style:{marginBottom:16},children:[e.jsxs(y,{wrap:!0,children:[e.jsx(oe,{title:r?h:void 0,children:e.jsx(k,{type:"primary",size:"large",icon:e.jsx(re,{}),onClick:p,disabled:o||r,loading:l,children:t("download.startDownload")})}),e.jsx(oe,{title:r?h:void 0,children:e.jsx(k,{size:"large",icon:e.jsx(Q,{}),onClick:m,disabled:o||r,loading:s,children:t("download.downloadAll")})}),e.jsx(k,{danger:!0,size:"large",icon:e.jsx(z,{}),onClick:n,disabled:!o,loading:d,children:t("download.stopCurrent")})]}),o&&e.jsx(D,{message:t("download.hasActiveTask"),description:t("download.hasActiveTaskDesc"),type:"info",showIcon:!0,style:{marginTop:16}}),i&&e.jsx(D,{message:e.jsxs(y,{children:[e.jsx("span",{children:t("download.fileSavePath")}),u&&e.jsx(k,{type:"text",size:"small",icon:e.jsx(Q,{}),onClick:u,title:t("download.refreshPath")})]}),description:e.jsxs(y,{direction:"vertical",size:"small",style:{width:"100%"},children:[e.jsxs($,{children:[e.jsx($,{strong:!0,children:t("download.illustrationPath")}),a]}),e.jsxs($,{children:[e.jsx($,{strong:!0,children:t("download.novelPath")}),c]}),e.jsx($,{type:"secondary",style:{fontSize:"12px"},children:t("download.pathTip")})]}),type:"info",showIcon:!0,style:{marginTop:16}})]})},_e=({logs:o,isRunning:p=!1})=>{const{t:m}=C(),n=g.useRef(null);if(g.useEffect(()=>{n.current&&o.length>0&&n.current.scrollIntoView({behavior:"smooth"})},[o]),!o||o.length===0)return null;const l={error:"#ff4d4f",warn:"#faad14",info:"#1890ff",debug:"#8c8c8c"};return e.jsx("div",{style:{marginTop:16},children:e.jsx(Se,{items:[{key:"logs",label:e.jsxs(y,{children:[e.jsx(q,{}),e.jsxs("span",{children:[m("download.realtimeLogs")," (",o.length," ",m("download.entries"),")"]})]}),children:e.jsxs("div",{style:{maxHeight:"400px",overflowY:"auto",backgroundColor:"#1f1f1f",padding:"12px",borderRadius:"4px",fontFamily:"monospace",fontSize:"12px",lineHeight:"1.6"},children:[o.map((s,d)=>{const i=b(s.timestamp,{hour:"2-digit",minute:"2-digit",second:"2-digit"});return e.jsxs("div",{style:{marginBottom:"4px",color:l[s.level]||"#ffffff"},children:[e.jsxs("span",{style:{color:"#8c8c8c",marginRight:"8px"},children:["[",i,"]"]}),e.jsxs("span",{style:{color:l[s.level]||"#ffffff",marginRight:"8px",fontWeight:"bold"},children:["[",s.level.toUpperCase(),"]"]}),e.jsx("span",{children:s.message})]},d)}),e.jsx("div",{ref:n})]})}],defaultActiveKey:p?["logs"]:[]})})},{Text:N}=R,qe=({task:o,logs:p,onStop:m,isStopping:n})=>{const{t:l}=C(),s=i=>{const u={running:{color:"processing",icon:e.jsx(W,{}),text:l("download.statusRunning")},completed:{color:"success",icon:e.jsx(Z,{}),text:l("download.statusCompleted")},failed:{color:"error",icon:e.jsx(J,{}),text:l("download.statusFailed")},stopped:{color:"default",icon:e.jsx(z,{}),text:l("download.statusStopped")}},t=u[i]||u.running;return t?e.jsx(F,{color:t.color,icon:t.icon,children:t.text}):null},d=(i,u)=>{const t=new Date(i).getTime(),w=u?new Date(u).getTime():Date.now(),r=Math.floor((w-t)/1e3);if(r<60)return`${r} ${l("download.seconds")}`;if(r<3600){const h=Math.floor(r/60),a=r%60;return`${h} ${l("download.minutes")} ${a} ${l("download.seconds")}`}else{const h=Math.floor(r/3600),a=Math.floor(r%3600/60);return`${h} ${l("download.hours")} ${a} ${l("download.minutes")}`}};return e.jsxs(O,{title:e.jsxs(y,{children:[e.jsx(W,{}),e.jsx("span",{children:l("download.currentTask")})]}),style:{marginBottom:16},extra:e.jsx(k,{danger:!0,icon:e.jsx(z,{}),onClick:m,loading:n,children:l("download.stopTask")}),children:[e.jsxs(I,{column:2,bordered:!0,children:[e.jsx(I.Item,{label:l("download.taskId"),span:1,children:e.jsx(N,{code:!0,children:o.taskId})}),e.jsx(I.Item,{label:l("download.status"),span:1,children:s(o.status)}),e.jsx(I.Item,{label:l("download.startTime"),span:1,children:b(o.startTime)}),e.jsx(I.Item,{label:l("download.duration"),span:1,children:e.jsx(N,{strong:!0,children:d(new Date(o.startTime),o.endTime?new Date(o.endTime):void 0)})}),o.progress&&e.jsxs(I.Item,{label:l("download.progress"),span:2,children:[e.jsx(Ae,{percent:Math.round(o.progress.current/o.progress.total*100),status:o.status==="running"?"active":"success",format:()=>`${o.progress?.current||0} / ${o.progress?.total||0}`}),o.progress.message&&e.jsx(N,{type:"secondary",style:{display:"block",marginTop:8},children:o.progress.message})]}),o.endTime&&e.jsx(I.Item,{label:l("download.endTime"),span:2,children:b(o.endTime)}),o.error&&e.jsx(I.Item,{label:l("download.errorInfo"),span:2,children:e.jsx(D,{message:o.error,type:"error",showIcon:!0})})]}),p&&p.length>0&&e.jsx(_e,{logs:p,isRunning:o.status==="running"})]})},{Text:_}=R,Ke=({tasks:o,hasActiveTask:p,onRefresh:m,onResume:n,onDelete:l,onDeleteAll:s,isResuming:d,isDeleting:i,isDeletingAll:u})=>{const{t}=C();if(!o||o.length===0)return null;const w=[{title:t("download.tag"),dataIndex:"tag",key:"tag",width:150,render:r=>e.jsx(_,{strong:!0,children:r})},{title:t("download.type"),dataIndex:"type",key:"type",width:100,render:r=>e.jsx(F,{color:r==="illustration"?"blue":"purple",children:t(r==="illustration"?"download.typeIllustration":"download.typeNovel")})},{title:t("download.incompleteStatus"),dataIndex:"status",key:"status",width:120,render:r=>{const a={failed:{color:"error",text:t("download.statusFailed")},partial:{color:"warning",text:t("download.statusPartial")}}[r]||{color:"default",text:r};return e.jsx(F,{color:a.color,children:a.text})}},{title:t("download.errorMessage"),dataIndex:"message",key:"message",ellipsis:{showTitle:!1},width:300,render:r=>{if(!r)return e.jsx(_,{type:"secondary",children:"-"});const h=r.toLowerCase();let a=null;return h.includes("401")||h.includes("unauthorized")?a=t("download.error401"):h.includes("403")||h.includes("forbidden")?a=t("download.error403"):h.includes("timeout")||h.includes("timed out")?a=t("download.errorTimeout"):h.includes("failed after")&&(a=t("download.errorRetries")),e.jsxs("div",{children:[e.jsx(_,{type:"danger",ellipsis:{tooltip:r},children:r}),a&&e.jsx("div",{style:{marginTop:4},children:e.jsxs(_,{type:"secondary",style:{fontSize:"12px"},children:["💡 ",a]})})]})}},{title:t("download.executedAt"),dataIndex:"executedAt",key:"executedAt",width:180,render:r=>b(r)},{title:t("download.actions"),key:"action",width:150,fixed:"right",render:(r,h)=>e.jsxs(y,{children:[e.jsx(k,{type:"link",icon:e.jsx(Le,{}),onClick:()=>n(h.tag,h.type),disabled:p||d,loading:d,children:t("download.resumeDownload")}),e.jsx(k,{type:"link",danger:!0,icon:e.jsx(V,{}),onClick:()=>{Y.confirm({title:t("download.confirmDelete"),content:t("download.confirmDeleteDesc",{tag:h.tag,type:h.type==="illustration"?t("download.typeIllustration"):t("download.typeNovel")}),okText:t("common.delete"),okType:"danger",cancelText:t("common.cancel"),onOk:()=>l(h.id)})},disabled:i,loading:i,children:t("download.deleteTask")})]})}];return e.jsxs(O,{title:e.jsxs(y,{children:[e.jsx(q,{}),e.jsx("span",{children:t("download.incompleteTasks")})]}),style:{marginBottom:16},extra:e.jsxs(y,{children:[e.jsx(k,{size:"small",icon:e.jsx(Q,{}),onClick:m,children:t("download.refreshList")}),e.jsx(k,{size:"small",danger:!0,icon:e.jsx(V,{}),onClick:()=>{Y.confirm({title:t("download.confirmDeleteAll"),content:t("download.confirmDeleteAllDesc",{count:o.length}),okText:t("common.delete"),okType:"danger",cancelText:t("common.cancel"),onOk:s})},loading:u,disabled:u,children:t("download.deleteAll")})]}),children:[e.jsx(D,{message:t("download.incompleteTasksFound",{count:o.length}),description:t("download.incompleteTasksDesc"),type:"warning",showIcon:!0,style:{marginBottom:16}}),e.jsx(de,{columns:w,dataSource:o,rowKey:"id",pagination:{pageSize:10,showSizeChanger:!0,showTotal:r=>t("download.totalEntries",{total:r})},size:"small",scroll:{x:800}})]})},{Text:M}=R,Ne=({tasks:o,isLoading:p,calculateDuration:m})=>{const{t:n}=C(),l=je(),[s,d]=g.useState(null),[i,u]=g.useState(!1),t=async a=>{try{d(a),await se.deleteTaskHistory(a),f.success(n("download.deleteTaskHistorySuccess")),l.invalidateQueries({queryKey:U.DOWNLOAD_STATUS()})}catch(c){const x=c?.response?.data?.data?.message||c?.message||n("download.deleteTaskHistoryFailed");f.error(x)}finally{d(null)}},w=async()=>{try{u(!0);const a=await se.deleteAllTaskHistory();f.success(n("download.deleteAllTaskHistorySuccess",{count:a.deletedCount})),l.invalidateQueries({queryKey:U.DOWNLOAD_STATUS()})}catch(a){const c=a?.response?.data?.data?.message||a?.message||n("download.deleteAllTaskHistoryFailed");f.error(c)}finally{u(!1)}},r=a=>{const c={running:{color:"processing",icon:e.jsx(W,{}),text:n("download.statusRunning")},completed:{color:"success",icon:e.jsx(Z,{}),text:n("download.statusCompleted")},failed:{color:"error",icon:e.jsx(J,{}),text:n("download.statusFailed")},stopped:{color:"default",icon:e.jsx(z,{}),text:n("download.statusStopped")}},x=c[a]||c.running;return x?e.jsx(F,{color:x.color,icon:x.icon,children:x.text}):null},h=[{title:n("download.taskId"),dataIndex:"taskId",key:"taskId",width:120,render:a=>e.jsxs(M,{code:!0,children:[a.slice(0,8),"..."]})},{title:n("download.status"),dataIndex:"status",key:"status",width:100,render:a=>r(a)},{title:n("download.duration"),key:"duration",width:120,render:(a,c)=>m(new Date(c.startTime),c.endTime?new Date(c.endTime):void 0)},{title:n("download.startTime"),dataIndex:"startTime",key:"startTime",width:180,render:a=>b(a)},{title:n("download.endTime"),dataIndex:"endTime",key:"endTime",width:180,render:a=>b(a)},{title:n("download.errorInfo"),dataIndex:"error",key:"error",ellipsis:!0,render:a=>a?e.jsx(M,{type:"danger",ellipsis:{tooltip:a},children:a}):e.jsx(M,{type:"secondary",children:"-"})},{title:n("download.actions"),key:"actions",width:100,fixed:"right",render:(a,c)=>e.jsx(ne,{title:n("download.deleteTaskHistoryConfirm"),description:n("download.deleteTaskHistoryConfirmDesc",{taskId:c.taskId.slice(0,8)}),onConfirm:()=>t(c.taskId),okText:n("common.confirm"),cancelText:n("common.cancel"),okButtonProps:{danger:!0},children:e.jsx(k,{type:"link",danger:!0,size:"small",icon:e.jsx(V,{}),loading:s===c.taskId,disabled:c.status==="running",children:n("common.delete")})})}];return e.jsx(O,{title:e.jsxs(y,{children:[e.jsx(q,{}),e.jsx("span",{children:n("download.taskHistory")})]}),extra:o&&o.length>0?e.jsx(ne,{title:n("download.deleteAllTaskHistoryConfirm"),description:n("download.deleteAllTaskHistoryConfirmDesc",{count:o.length}),onConfirm:w,okText:n("common.confirm"),cancelText:n("common.cancel"),okButtonProps:{danger:!0},children:e.jsx(k,{danger:!0,size:"small",icon:e.jsx($e,{}),loading:i,children:n("download.deleteAll")})}):null,children:p?e.jsxs("div",{style:{textAlign:"center",padding:"40px 0"},children:[e.jsx(ye,{size:"large"}),e.jsx("div",{style:{marginTop:16},children:e.jsx(M,{type:"secondary",children:n("download.loadingHistory")})})]}):o&&o.length>0?e.jsx(de,{columns:h,dataSource:o,rowKey:"taskId",pagination:{pageSize:10,showSizeChanger:!0,showTotal:a=>n("download.taskRecords",{total:a}),pageSizeOptions:["10","20","50","100"]},size:"middle",scroll:{x:1e3}}):e.jsx("div",{style:{textAlign:"center",padding:"40px 0"},children:e.jsx(M,{type:"secondary",children:n("download.noHistory")})})})},{Text:le}=R,Qe=({open:o,onCancel:p,onFinish:m,isSubmitting:n,configFiles:l=[],targets:s=[]})=>{const{t:d}=C(),[i]=E.useForm(),u=()=>{i.resetFields(),p()};return e.jsxs(Y,{title:e.jsxs(y,{children:[e.jsx(re,{}),e.jsx("span",{children:d("download.startDownloadModal")})]}),open:o,onCancel:u,onOk:()=>i.submit(),confirmLoading:n,okText:d("common.start"),cancelText:d("common.cancel"),width:600,children:[e.jsx(D,{message:d("download.startDownloadTip"),description:d("download.startDownloadTipDesc"),type:"info",showIcon:!0,style:{marginBottom:24}}),e.jsxs(E,{form:i,onFinish:m,layout:"vertical",children:[e.jsx(E.Item,{name:"configPaths",label:d("download.selectConfigFiles"),tooltip:d("download.selectConfigFilesTooltip"),extra:d("download.selectConfigFilesExtra"),children:e.jsx(K,{mode:"multiple",placeholder:d("download.selectConfigFilesPlaceholder"),allowClear:!0,size:"large",showSearch:!0,filterOption:(t,w)=>w?.label?.toLowerCase().includes(t.toLowerCase())||!1,options:l.map(t=>({label:`${t.filename}${t.isActive?` (${d("config.activeConfig")})`:""}`,value:t.path}))})}),e.jsx(E.Item,{name:"targetId",label:d("download.selectTarget"),tooltip:d("download.selectTargetTooltip"),extra:d("download.selectTargetExtra"),children:e.jsx(K,{placeholder:d("download.selectTargetPlaceholder"),allowClear:!0,size:"large",showSearch:!0,filterOption:(t,w)=>{const r=w?.children;return(typeof r=="string"?r:String(r||"")).toLowerCase().includes(t.toLowerCase())},children:s.map((t,w)=>e.jsx(K.Option,{value:w.toString(),children:e.jsxs(y,{children:[e.jsx(F,{color:t.type==="illustration"?"blue":"purple",children:t.type==="illustration"?d("download.typeIllustration"):d("download.typeNovel")}),e.jsx(le,{strong:!0,children:t.tag||`Target ${w+1}`}),t.limit&&e.jsxs(le,{type:"secondary",children:["(",d("download.limit"),": ",t.limit," ",d("download.entries"),")"]})]})},w))})}),s.length===0&&e.jsx(D,{message:d("download.noTargetsFound"),description:d("download.noTargetsFoundDesc"),type:"warning",showIcon:!0})]})]})};function Ue(o,p,m,n,l){const{t:s}=C(),[d,i]=g.useState(!1),u=g.useCallback(async c=>{try{await o({targetId:c.targetId,configPaths:c.configPaths}),f.success(s("download.taskStarted")),i(!1)}catch(x){const{errorCode:j,message:T}=v(x);f.error(S(j,s,void 0,T||s("download.startFailed")))}},[o,s]),t=g.useCallback(async c=>{try{await p(c),f.success(s("download.taskStopped"))}catch(x){const{errorCode:j,message:T}=v(x);f.error(S(j,s,void 0,T||s("download.stopFailed")))}},[p,s]),w=g.useCallback(()=>{ae.runAllDownloads().then(()=>{f.success(s("download.allTargetsStarted"))}).catch(c=>{const{errorCode:x,message:j}=v(c);f.error(S(x,s,void 0,j||s("download.startFailed")))})},[s]),r=g.useCallback(async(c,x)=>{try{await m({tag:c,type:x}),f.success(s("download.taskResumedWithTag",{tag:c,type:s(x==="illustration"?"download.typeIllustration":"download.typeNovel")}))}catch(j){const{errorCode:T,message:A,params:L}=v(j);f.error(S(T,s,L,A||s("download.resumeFailed")))}},[m,s]),h=g.useCallback(async c=>{try{await n(c),f.success(s("download.incompleteTaskDeleted"))}catch(x){const{errorCode:j,message:T,params:A}=v(x);f.error(S(j,s,A,T||s("download.deleteFailed")))}},[n,s]),a=g.useCallback(async()=>{try{const x=(await l())?.deletedCount||0;x===0?f.info(s("download.noIncompleteTasks")):f.success(s("download.allIncompleteTasksDeleted",{count:x}))}catch(c){const{errorCode:x,message:j,params:T}=v(c);x?f.error(S(x,s,T,j||s("download.deleteAllFailed"))):f.error(j||s("download.deleteAllFailed")),console.error("Delete all incomplete tasks error:",c)}},[l,s]);return{showStartModal:d,setShowStartModal:i,handleStart:u,handleStop:t,handleRunAll:w,handleResume:r,handleDelete:h,handleDeleteAll:a}}function We(o){const{t:p}=C(),m=g.useMemo(()=>{const l=o||[],s=l.filter(u=>u.status==="completed").length,d=l.filter(u=>u.status==="failed").length,i=l.filter(u=>u.status==="stopped").length;return{total:l.length,completed:s,failed:d,stopped:i}},[o]),n=g.useCallback((l,s)=>{const d=new Date(l).getTime(),i=s?new Date(s).getTime():Date.now(),u=Math.floor((i-d)/1e3);if(u<60)return`${u} ${p("download.seconds")}`;if(u<3600){const t=Math.floor(u/60),w=u%60;return`${t} ${p("download.minutes")} ${w} ${p("download.seconds")}`}else{const t=Math.floor(u/3600),w=Math.floor(u%3600/60);return`${t} ${p("download.hours")} ${w} ${p("download.minutes")}`}},[p]);return{taskStats:m,calculateDuration:n}}const{Title:Ye,Paragraph:Ve}=R;function xt(){const{t:o}=C(),{startAsync:p,isStarting:m,stopAsync:n,isStopping:l}=ke(),{isLoading:s,hasActiveTask:d,activeTask:i,allTasks:u}=Ce(void 0,2e3),t=i?.taskId,{logs:w}=Ie(t,void 0,2e3),{tasks:r,refetch:h,resumeAsync:a,deleteAsync:c,deleteAllAsync:x,isResuming:j,isDeleting:T,isDeletingAll:A}=ve(),{config:L,refetch:ie}=De(),{data:ce}=Te({queryKey:U.CONFIG_FILES,queryFn:()=>ae.listConfigFiles()}),{showStartModal:ue,setShowStartModal:ee,handleStart:pe,handleStop:te,handleRunAll:me,handleResume:he,handleDelete:xe,handleDeleteAll:we}=Ue(p,n,a,c,x),{taskStats:P,calculateDuration:ge}=We(u);return e.jsxs("div",{children:[e.jsx(Ye,{level:2,children:o("download.title")}),e.jsx(Ve,{type:"secondary",style:{marginBottom:24},children:o("download.description")}),e.jsx(Be,{total:P.total,completed:P.completed,failed:P.failed,stopped:P.stopped}),e.jsx(Ee,{hasActiveTask:d,onStartClick:()=>ee(!0),onRunAllClick:me,onStopClick:()=>i?.taskId&&te(i.taskId),isStarting:m,isRunningAll:!1,isStopping:l,storage:L?.storage,onRefreshConfig:ie}),i&&e.jsx(qe,{task:i,logs:w,onStop:()=>i.taskId&&te(i.taskId),isStopping:l}),r&&r.length>0&&e.jsx(Ke,{tasks:r,hasActiveTask:d,onRefresh:h,onResume:he,onDelete:xe,onDeleteAll:we,isResuming:j,isDeleting:T,isDeletingAll:A}),e.jsx(Ne,{tasks:u||[],isLoading:s,calculateDuration:ge}),e.jsx(Qe,{open:ue,onCancel:()=>ee(!1),onFinish:pe,isSubmitting:m,configFiles:ce?.data?.data||[],targets:L?.targets||[]})]})}export{xt as default};
2
- //# sourceMappingURL=Download-DCKDU51K.js.map
@@ -1,2 +0,0 @@
1
- import{o as Q,n as A,h as b,a4 as Z,r as c,_ as X,a3 as Y,a2 as U,A as a,aA as ri,v as ai,x as li,z as ci,bn as si,a6 as di,ac as mi,J as gi,aS as pi,$ as ui,Y as $i,I as hi}from"./index-DG6kGbYq.js";import{u as Si}from"./row-_c51T55h.js";import{P as fi}from"./useAuth-wCjAOx6S.js";var bi=["className","prefixCls","style","active","status","iconPrefix","icon","wrapperStyle","stepNumber","disabled","description","title","subTitle","progressDot","stepIcon","tailContent","icons","stepIndex","onStepClick","onClick","render"];function J(i){return typeof i=="string"}function k(i){var e,t=i.className,n=i.prefixCls,o=i.style,r=i.active,l=i.status,g=i.iconPrefix,s=i.icon;i.wrapperStyle;var d=i.stepNumber,$=i.disabled,h=i.description,w=i.title,v=i.subTitle,q=i.progressDot,E=i.stepIcon,O=i.tailContent,u=i.icons,T=i.stepIndex,p=i.onStepClick,I=i.onClick,D=i.render,_=Q(i,bi),N=!!p&&!$,y={};N&&(y.role="button",y.tabIndex=0,y.onClick=function(z){I?.(z),p(T)},y.onKeyDown=function(z){var S=z.which;(S===Y.ENTER||S===Y.SPACE)&&p(T)});var B=function(){var S,m,C=A("".concat(n,"-icon"),"".concat(g,"icon"),(S={},b(S,"".concat(g,"icon-").concat(s),s&&J(s)),b(S,"".concat(g,"icon-check"),!s&&l==="finish"&&(u&&!u.finish||!u)),b(S,"".concat(g,"icon-cross"),!s&&l==="error"&&(u&&!u.error||!u)),S)),P=c.createElement("span",{className:"".concat(n,"-icon-dot")});return q?typeof q=="function"?m=c.createElement("span",{className:"".concat(n,"-icon")},q(P,{index:d-1,status:l,title:w,description:h})):m=c.createElement("span",{className:"".concat(n,"-icon")},P):s&&!J(s)?m=c.createElement("span",{className:"".concat(n,"-icon")},s):u&&u.finish&&l==="finish"?m=c.createElement("span",{className:"".concat(n,"-icon")},u.finish):u&&u.error&&l==="error"?m=c.createElement("span",{className:"".concat(n,"-icon")},u.error):s||l==="finish"||l==="error"?m=c.createElement("span",{className:C}):m=c.createElement("span",{className:"".concat(n,"-icon")},d),E&&(m=E({index:d-1,status:l,title:w,description:h,node:m})),m},x=l||"wait",M=A("".concat(n,"-item"),"".concat(n,"-item-").concat(x),t,(e={},b(e,"".concat(n,"-item-custom"),s),b(e,"".concat(n,"-item-active"),r),b(e,"".concat(n,"-item-disabled"),$===!0),e)),W=Z({},o),H=c.createElement("div",X({},_,{className:M,style:W}),c.createElement("div",X({onClick:I},y,{className:"".concat(n,"-item-container")}),c.createElement("div",{className:"".concat(n,"-item-tail")},O),c.createElement("div",{className:"".concat(n,"-item-icon")},B()),c.createElement("div",{className:"".concat(n,"-item-content")},c.createElement("div",{className:"".concat(n,"-item-title")},w,v&&c.createElement("div",{title:typeof v=="string"?v:void 0,className:"".concat(n,"-item-subtitle")},v)),h&&c.createElement("div",{className:"".concat(n,"-item-description")},h))));return D&&(H=D(H)||null),H}var vi=["prefixCls","style","className","children","direction","type","labelPlacement","iconPrefix","status","size","current","progressDot","stepIcon","initial","icons","onChange","itemRender","items"];function F(i){var e,t=i.prefixCls,n=t===void 0?"rc-steps":t,o=i.style,r=o===void 0?{}:o,l=i.className;i.children;var g=i.direction,s=g===void 0?"horizontal":g,d=i.type,$=d===void 0?"default":d,h=i.labelPlacement,w=h===void 0?"horizontal":h,v=i.iconPrefix,q=v===void 0?"rc":v,E=i.status,O=E===void 0?"process":E,u=i.size,T=i.current,p=T===void 0?0:T,I=i.progressDot,D=I===void 0?!1:I,_=i.stepIcon,N=i.initial,y=N===void 0?0:N,B=i.icons,x=i.onChange,M=i.itemRender,W=i.items,H=W===void 0?[]:W,z=Q(i,vi),S=$==="navigation",m=$==="inline",C=m||D,P=m?"horizontal":s,K=m?void 0:u,ii=C?"vertical":w,ei=A(n,"".concat(n,"-").concat(P),l,(e={},b(e,"".concat(n,"-").concat(K),K),b(e,"".concat(n,"-label-").concat(ii),P==="horizontal"),b(e,"".concat(n,"-dot"),!!C),b(e,"".concat(n,"-navigation"),S),b(e,"".concat(n,"-inline"),m),e)),ti=function(R){x&&p!==R&&x(R)},ni=function(R,V){var f=Z({},R),j=y+V;return O==="error"&&V===p-1&&(f.className="".concat(n,"-next-error")),f.status||(j===p?f.status=O:j<p?f.status="finish":f.status="wait"),m&&(f.icon=void 0,f.subTitle=void 0),!f.render&&M&&(f.render=function(oi){return M(f,oi)}),U.createElement(k,X({},f,{active:j===p,stepNumber:j+1,stepIndex:j,key:j,prefixCls:n,iconPrefix:q,wrapperStyle:r,progressDot:C,stepIcon:_,icons:B,onStepClick:x&&ti}))};return U.createElement("div",X({className:ei,style:r},z),H.filter(function(G){return G}).map(ni))}F.Step=k;const Ci=i=>{const{componentCls:e,customIconTop:t,customIconSize:n,customIconFontSize:o}=i;return{[`${e}-item-custom`]:{[`> ${e}-item-container > ${e}-item-icon`]:{height:"auto",background:"none",border:0,[`> ${e}-icon`]:{top:t,width:n,height:n,fontSize:o,lineHeight:a(n)}}},[`&:not(${e}-vertical)`]:{[`${e}-item-custom`]:{[`${e}-item-icon`]:{width:"auto",background:"none"}}}}},Ii=i=>{const{componentCls:e}=i,t=`${e}-item`;return{[`${e}-horizontal`]:{[`${t}-tail`]:{transform:"translateY(-50%)"}}}},yi=i=>{const{componentCls:e,inlineDotSize:t,inlineTitleColor:n,inlineTailColor:o}=i,r=i.calc(i.paddingXS).add(i.lineWidth).equal(),l={[`${e}-item-container ${e}-item-content ${e}-item-title`]:{color:n}};return{[`&${e}-inline`]:{width:"auto",display:"inline-flex",[`${e}-item`]:{flex:"none","&-container":{padding:`${a(r)} ${a(i.paddingXXS)} 0`,margin:`0 ${a(i.calc(i.marginXXS).div(2).equal())}`,borderRadius:i.borderRadiusSM,cursor:"pointer",transition:`background-color ${i.motionDurationMid}`,"&:hover":{background:i.controlItemBgHover},"&[role='button']:hover":{opacity:1}},"&-icon":{width:t,height:t,marginInlineStart:`calc(50% - ${a(i.calc(t).div(2).equal())})`,[`> ${e}-icon`]:{top:0},[`${e}-icon-dot`]:{borderRadius:i.calc(i.fontSizeSM).div(4).equal(),"&::after":{display:"none"}}},"&-content":{width:"auto",marginTop:i.calc(i.marginXS).sub(i.lineWidth).equal()},"&-title":{color:n,fontSize:i.fontSizeSM,lineHeight:i.lineHeightSM,fontWeight:"normal",marginBottom:i.calc(i.marginXXS).div(2).equal()},"&-description":{display:"none"},"&-tail":{marginInlineStart:0,top:i.calc(t).div(2).add(r).equal(),transform:"translateY(-50%)","&:after":{width:"100%",height:i.lineWidth,borderRadius:0,marginInlineStart:0,background:o}},[`&:first-child ${e}-item-tail`]:{width:"50%",marginInlineStart:"50%"},[`&:last-child ${e}-item-tail`]:{display:"block",width:"50%"},"&-wait":Object.assign({[`${e}-item-icon ${e}-icon ${e}-icon-dot`]:{backgroundColor:i.colorBorderBg,border:`${a(i.lineWidth)} ${i.lineType} ${o}`}},l),"&-finish":Object.assign({[`${e}-item-tail::after`]:{backgroundColor:o},[`${e}-item-icon ${e}-icon ${e}-icon-dot`]:{backgroundColor:o,border:`${a(i.lineWidth)} ${i.lineType} ${o}`}},l),"&-error":l,"&-active, &-process":Object.assign({[`${e}-item-icon`]:{width:t,height:t,marginInlineStart:`calc(50% - ${a(i.calc(t).div(2).equal())})`,top:0}},l),[`&:not(${e}-item-active) > ${e}-item-container[role='button']:hover`]:{[`${e}-item-title`]:{color:n}}}}}},xi=i=>{const{componentCls:e,iconSize:t,lineHeight:n,iconSizeSM:o}=i;return{[`&${e}-label-vertical`]:{[`${e}-item`]:{overflow:"visible","&-tail":{marginInlineStart:i.calc(t).div(2).add(i.controlHeightLG).equal(),padding:`0 ${a(i.paddingLG)}`},"&-content":{display:"block",width:i.calc(t).div(2).add(i.controlHeightLG).mul(2).equal(),marginTop:i.marginSM,textAlign:"center"},"&-icon":{display:"inline-block",marginInlineStart:i.controlHeightLG},"&-title":{paddingInlineEnd:0,paddingInlineStart:0,"&::after":{display:"none"}},"&-subtitle":{display:"block",marginBottom:i.marginXXS,marginInlineStart:0,lineHeight:n}},[`&${e}-small:not(${e}-dot)`]:{[`${e}-item`]:{"&-icon":{marginInlineStart:i.calc(t).sub(o).div(2).add(i.controlHeightLG).equal()}}}}}},wi=i=>{const{componentCls:e,navContentMaxWidth:t,navArrowColor:n,stepsNavActiveColor:o,motionDurationSlow:r}=i;return{[`&${e}-navigation`]:{paddingTop:i.paddingSM,[`&${e}-small`]:{[`${e}-item`]:{"&-container":{marginInlineStart:i.calc(i.marginSM).mul(-1).equal()}}},[`${e}-item`]:{overflow:"visible",textAlign:"center","&-container":{display:"inline-block",height:"100%",marginInlineStart:i.calc(i.margin).mul(-1).equal(),paddingBottom:i.paddingSM,textAlign:"start",transition:`opacity ${r}`,[`${e}-item-content`]:{maxWidth:t},[`${e}-item-title`]:Object.assign(Object.assign({maxWidth:"100%",paddingInlineEnd:0},ri),{"&::after":{display:"none"}})},[`&:not(${e}-item-active)`]:{[`${e}-item-container[role='button']`]:{cursor:"pointer","&:hover":{opacity:.85}}},"&:last-child":{flex:1,"&::after":{display:"none"}},"&::after":{position:"absolute",top:`calc(50% - ${a(i.calc(i.paddingSM).div(2).equal())})`,insetInlineStart:"100%",display:"inline-block",width:i.fontSizeIcon,height:i.fontSizeIcon,borderTop:`${a(i.lineWidth)} ${i.lineType} ${n}`,borderBottom:"none",borderInlineStart:"none",borderInlineEnd:`${a(i.lineWidth)} ${i.lineType} ${n}`,transform:"translateY(-50%) translateX(-50%) rotate(45deg)",content:'""'},"&::before":{position:"absolute",bottom:0,insetInlineStart:"50%",display:"inline-block",width:0,height:i.lineWidthBold,backgroundColor:o,transition:`width ${r}, inset-inline-start ${r}`,transitionTimingFunction:"ease-out",content:'""'}},[`${e}-item${e}-item-active::before`]:{insetInlineStart:0,width:"100%"}},[`&${e}-navigation${e}-vertical`]:{[`> ${e}-item`]:{marginInlineEnd:0,"&::before":{display:"none"},[`&${e}-item-active::before`]:{top:0,insetInlineEnd:0,insetInlineStart:"unset",display:"block",width:i.calc(i.lineWidth).mul(3).equal(),height:`calc(100% - ${a(i.marginLG)})`},"&::after":{position:"relative",insetInlineStart:"50%",display:"block",width:i.calc(i.controlHeight).mul(.25).equal(),height:i.calc(i.controlHeight).mul(.25).equal(),marginBottom:i.marginXS,textAlign:"center",transform:"translateY(-50%) translateX(-50%) rotate(135deg)"},"&:last-child":{"&::after":{display:"none"}},[`> ${e}-item-container > ${e}-item-tail`]:{visibility:"hidden"}}},[`&${e}-navigation${e}-horizontal`]:{[`> ${e}-item > ${e}-item-container > ${e}-item-tail`]:{visibility:"hidden"}}}},Ti=i=>{const{antCls:e,componentCls:t,iconSize:n,iconSizeSM:o,processIconColor:r,marginXXS:l,lineWidthBold:g,lineWidth:s,paddingXXS:d}=i,$=i.calc(n).add(i.calc(g).mul(4).equal()).equal(),h=i.calc(o).add(i.calc(i.lineWidth).mul(4).equal()).equal();return{[`&${t}-with-progress`]:{[`${t}-item`]:{paddingTop:d,[`&-process ${t}-item-container ${t}-item-icon ${t}-icon`]:{color:r}},[`&${t}-vertical > ${t}-item `]:{paddingInlineStart:d,[`> ${t}-item-container > ${t}-item-tail`]:{top:l,insetInlineStart:i.calc(n).div(2).sub(s).add(d).equal()}},[`&, &${t}-small`]:{[`&${t}-horizontal ${t}-item:first-child`]:{paddingBottom:d,paddingInlineStart:d}},[`&${t}-small${t}-vertical > ${t}-item > ${t}-item-container > ${t}-item-tail`]:{insetInlineStart:i.calc(o).div(2).sub(s).add(d).equal()},[`&${t}-label-vertical ${t}-item ${t}-item-tail`]:{top:i.calc(n).div(2).add(d).equal()},[`${t}-item-icon`]:{position:"relative",[`${e}-progress`]:{position:"absolute",insetInlineStart:"50%",top:"50%",transform:"translate(-50%, -50%)","&-inner":{width:`${a($)} !important`,height:`${a($)} !important`}}},[`&${t}-small`]:{[`&${t}-label-vertical ${t}-item ${t}-item-tail`]:{top:i.calc(o).div(2).add(d).equal()},[`${t}-item-icon ${e}-progress-inner`]:{width:`${a(h)} !important`,height:`${a(h)} !important`}}}}},zi=i=>{const{componentCls:e,descriptionMaxWidth:t,lineHeight:n,dotCurrentSize:o,dotSize:r,motionDurationSlow:l}=i;return{[`&${e}-dot, &${e}-dot${e}-small`]:{[`${e}-item`]:{"&-title":{lineHeight:n},"&-tail":{top:i.calc(i.dotSize).sub(i.calc(i.lineWidth).mul(3).equal()).div(2).equal(),width:"100%",marginTop:0,marginBottom:0,marginInline:`${a(i.calc(t).div(2).equal())} 0`,padding:0,"&::after":{width:`calc(100% - ${a(i.calc(i.marginSM).mul(2).equal())})`,height:i.calc(i.lineWidth).mul(3).equal(),marginInlineStart:i.marginSM}},"&-icon":{width:r,height:r,marginInlineStart:i.calc(i.descriptionMaxWidth).sub(r).div(2).equal(),paddingInlineEnd:0,lineHeight:a(r),background:"transparent",border:0,[`${e}-icon-dot`]:{position:"relative",float:"left",width:"100%",height:"100%",borderRadius:100,transition:`all ${l}`,"&::after":{position:"absolute",top:i.calc(i.marginSM).mul(-1).equal(),insetInlineStart:i.calc(r).sub(i.calc(i.controlHeightLG).mul(1.5).equal()).div(2).equal(),width:i.calc(i.controlHeightLG).mul(1.5).equal(),height:i.controlHeight,background:"transparent",content:'""'}}},"&-content":{width:t},[`&-process ${e}-item-icon`]:{position:"relative",top:i.calc(r).sub(o).div(2).equal(),width:o,height:o,lineHeight:a(o),background:"none",marginInlineStart:i.calc(i.descriptionMaxWidth).sub(o).div(2).equal()},[`&-process ${e}-icon`]:{[`&:first-child ${e}-icon-dot`]:{insetInlineStart:0}}}},[`&${e}-vertical${e}-dot`]:{[`${e}-item-icon`]:{marginTop:i.calc(i.controlHeight).sub(r).div(2).equal(),marginInlineStart:0,background:"none"},[`${e}-item-process ${e}-item-icon`]:{marginTop:i.calc(i.controlHeight).sub(o).div(2).equal(),top:0,insetInlineStart:i.calc(r).sub(o).div(2).equal(),marginInlineStart:0},[`${e}-item > ${e}-item-container > ${e}-item-tail`]:{top:i.calc(i.controlHeight).sub(r).div(2).equal(),insetInlineStart:0,margin:0,padding:`${a(i.calc(r).add(i.paddingXS).equal())} 0 ${a(i.paddingXS)}`,"&::after":{marginInlineStart:i.calc(r).sub(i.lineWidth).div(2).equal()}},[`&${e}-small`]:{[`${e}-item-icon`]:{marginTop:i.calc(i.controlHeightSM).sub(r).div(2).equal()},[`${e}-item-process ${e}-item-icon`]:{marginTop:i.calc(i.controlHeightSM).sub(o).div(2).equal()},[`${e}-item > ${e}-item-container > ${e}-item-tail`]:{top:i.calc(i.controlHeightSM).sub(r).div(2).equal()}},[`${e}-item:first-child ${e}-icon-dot`]:{insetInlineStart:0},[`${e}-item-content`]:{width:"inherit"}}}},qi=i=>{const{componentCls:e}=i;return{[`&${e}-rtl`]:{direction:"rtl",[`${e}-item`]:{"&-subtitle":{float:"left"}},[`&${e}-navigation`]:{[`${e}-item::after`]:{transform:"rotate(-45deg)"}},[`&${e}-vertical`]:{[`> ${e}-item`]:{"&::after":{transform:"rotate(225deg)"},[`${e}-item-icon`]:{float:"right"}}},[`&${e}-dot`]:{[`${e}-item-icon ${e}-icon-dot, &${e}-small ${e}-item-icon ${e}-icon-dot`]:{float:"right"}}}}},Ei=i=>{const{componentCls:e,iconSizeSM:t,fontSizeSM:n,fontSize:o,colorTextDescription:r}=i;return{[`&${e}-small`]:{[`&${e}-horizontal:not(${e}-label-vertical) ${e}-item`]:{paddingInlineStart:i.paddingSM,"&:first-child":{paddingInlineStart:0}},[`${e}-item-icon`]:{width:t,height:t,marginTop:0,marginBottom:0,marginInline:`0 ${a(i.marginXS)}`,fontSize:n,lineHeight:a(t),textAlign:"center",borderRadius:t},[`${e}-item-title`]:{paddingInlineEnd:i.paddingSM,fontSize:o,lineHeight:a(t),"&::after":{top:i.calc(t).div(2).equal()}},[`${e}-item-description`]:{color:r,fontSize:o},[`${e}-item-tail`]:{top:i.calc(t).div(2).sub(i.paddingXXS).equal()},[`${e}-item-custom ${e}-item-icon`]:{width:"inherit",height:"inherit",lineHeight:"inherit",background:"none",border:0,borderRadius:0,[`> ${e}-icon`]:{fontSize:t,lineHeight:a(t),transform:"none"}}}}},Ni=i=>{const{componentCls:e,iconSizeSM:t,iconSize:n}=i;return{[`&${e}-vertical`]:{display:"flex",flexDirection:"column",[`> ${e}-item`]:{display:"block",flex:"1 0 auto",paddingInlineStart:0,overflow:"visible",[`${e}-item-icon`]:{float:"left",marginInlineEnd:i.margin},[`${e}-item-content`]:{display:"block",minHeight:i.calc(i.controlHeight).mul(1.5).equal(),overflow:"hidden"},[`${e}-item-title`]:{lineHeight:a(n)},[`${e}-item-description`]:{paddingBottom:i.paddingSM}},[`> ${e}-item > ${e}-item-container > ${e}-item-tail`]:{position:"absolute",top:0,insetInlineStart:i.calc(n).div(2).sub(i.lineWidth).equal(),width:i.lineWidth,height:"100%",padding:`${a(i.calc(i.marginXXS).mul(1.5).add(n).equal())} 0 ${a(i.calc(i.marginXXS).mul(1.5).equal())}`,"&::after":{width:i.lineWidth,height:"100%"}},[`> ${e}-item:not(:last-child) > ${e}-item-container > ${e}-item-tail`]:{display:"block"},[` > ${e}-item > ${e}-item-container > ${e}-item-content > ${e}-item-title`]:{"&::after":{display:"none"}},[`&${e}-small ${e}-item-container`]:{[`${e}-item-tail`]:{position:"absolute",top:0,insetInlineStart:i.calc(t).div(2).sub(i.lineWidth).equal(),padding:`${a(i.calc(i.marginXXS).mul(1.5).add(t).equal())} 0 ${a(i.calc(i.marginXXS).mul(1.5).equal())}`},[`${e}-item-title`]:{lineHeight:a(t)}}}}},Hi="wait",Pi="process",Oi="finish",Di="error",L=(i,e)=>{const t=`${e.componentCls}-item`,n=`${i}IconColor`,o=`${i}TitleColor`,r=`${i}DescriptionColor`,l=`${i}TailColor`,g=`${i}IconBgColor`,s=`${i}IconBorderColor`,d=`${i}DotColor`;return{[`${t}-${i} ${t}-icon`]:{backgroundColor:e[g],borderColor:e[s],[`> ${e.componentCls}-icon`]:{color:e[n],[`${e.componentCls}-icon-dot`]:{background:e[d]}}},[`${t}-${i}${t}-custom ${t}-icon`]:{[`> ${e.componentCls}-icon`]:{color:e[d]}},[`${t}-${i} > ${t}-container > ${t}-content > ${t}-title`]:{color:e[o],"&::after":{backgroundColor:e[l]}},[`${t}-${i} > ${t}-container > ${t}-content > ${t}-description`]:{color:e[r]},[`${t}-${i} > ${t}-container > ${t}-tail::after`]:{backgroundColor:e[l]}}},Mi=i=>{const{componentCls:e,motionDurationSlow:t}=i,n=`${e}-item`,o=`${n}-icon`;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[n]:{position:"relative",display:"inline-block",flex:1,overflow:"hidden",verticalAlign:"top","&:last-child":{flex:"none",[`> ${n}-container > ${n}-tail, > ${n}-container > ${n}-content > ${n}-title::after`]:{display:"none"}}},[`${n}-container`]:{outline:"none",[`&:focus-visible ${o}`]:si(i)},[`${o}, ${n}-content`]:{display:"inline-block",verticalAlign:"top"},[o]:{width:i.iconSize,height:i.iconSize,marginTop:0,marginBottom:0,marginInlineStart:0,marginInlineEnd:i.marginXS,fontSize:i.iconFontSize,fontFamily:i.fontFamily,lineHeight:a(i.iconSize),textAlign:"center",borderRadius:i.iconSize,border:`${a(i.lineWidth)} ${i.lineType} transparent`,transition:`background-color ${t}, border-color ${t}`,[`${e}-icon`]:{position:"relative",top:i.iconTop,color:i.colorPrimary,lineHeight:1}},[`${n}-tail`]:{position:"absolute",top:i.calc(i.iconSize).div(2).equal(),insetInlineStart:0,width:"100%","&::after":{display:"inline-block",width:"100%",height:i.lineWidth,background:i.colorSplit,borderRadius:i.lineWidth,transition:`background ${t}`,content:'""'}},[`${n}-title`]:{position:"relative",display:"inline-block",paddingInlineEnd:i.padding,color:i.colorText,fontSize:i.fontSizeLG,lineHeight:a(i.titleLineHeight),"&::after":{position:"absolute",top:i.calc(i.titleLineHeight).div(2).equal(),insetInlineStart:"100%",display:"block",width:9999,height:i.lineWidth,background:i.processTailColor,content:'""'}},[`${n}-subtitle`]:{display:"inline",marginInlineStart:i.marginXS,color:i.colorTextDescription,fontWeight:"normal",fontSize:i.fontSize},[`${n}-description`]:{color:i.colorTextDescription,fontSize:i.fontSize}},L(Hi,i)),L(Pi,i)),{[`${n}-process > ${n}-container > ${n}-title`]:{fontWeight:i.fontWeightStrong}}),L(Oi,i)),L(Di,i)),{[`${n}${e}-next-error > ${e}-item-title::after`]:{background:i.colorError},[`${n}-disabled`]:{cursor:"not-allowed"}})},Wi=i=>{const{componentCls:e,motionDurationSlow:t}=i;return{[`& ${e}-item`]:{[`&:not(${e}-item-active)`]:{[`& > ${e}-item-container[role='button']`]:{cursor:"pointer",[`${e}-item`]:{[`&-title, &-subtitle, &-description, &-icon ${e}-icon`]:{transition:`color ${t}`}},"&:hover":{[`${e}-item`]:{"&-title, &-subtitle, &-description":{color:i.colorPrimary}}}},[`&:not(${e}-item-process)`]:{[`& > ${e}-item-container[role='button']:hover`]:{[`${e}-item`]:{"&-icon":{borderColor:i.colorPrimary,[`${e}-icon`]:{color:i.colorPrimary}}}}}}},[`&${e}-horizontal:not(${e}-label-vertical)`]:{[`${e}-item`]:{paddingInlineStart:i.padding,whiteSpace:"nowrap","&:first-child":{paddingInlineStart:0},[`&:last-child ${e}-item-title`]:{paddingInlineEnd:0},"&-tail":{display:"none"},"&-description":{maxWidth:i.descriptionMaxWidth,whiteSpace:"normal"}}}}},ji=i=>{const{componentCls:e}=i;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ci(i)),{display:"flex",width:"100%",fontSize:0,textAlign:"initial"}),Mi(i)),Wi(i)),Ci(i)),Ei(i)),Ni(i)),Ii(i)),xi(i)),zi(i)),wi(i)),qi(i)),Ti(i)),yi(i))}},_i=i=>({titleLineHeight:i.controlHeight,customIconSize:i.controlHeight,customIconTop:0,customIconFontSize:i.controlHeightSM,iconSize:i.controlHeight,iconTop:-.5,iconFontSize:i.fontSize,iconSizeSM:i.fontSizeHeading3,dotSize:i.controlHeight/4,dotCurrentSize:i.controlHeightLG/4,navArrowColor:i.colorTextDisabled,navContentMaxWidth:"unset",descriptionMaxWidth:140,waitIconColor:i.wireframe?i.colorTextDisabled:i.colorTextLabel,waitIconBgColor:i.wireframe?i.colorBgContainer:i.colorFillContent,waitIconBorderColor:i.wireframe?i.colorTextDisabled:"transparent",finishIconBgColor:i.wireframe?i.colorBgContainer:i.controlItemBgActive,finishIconBorderColor:i.wireframe?i.colorPrimary:i.controlItemBgActive}),Bi=ai("Steps",i=>{const{colorTextDisabled:e,controlHeightLG:t,colorTextLightSolid:n,colorText:o,colorPrimary:r,colorTextDescription:l,colorTextQuaternary:g,colorError:s,colorBorderSecondary:d,colorSplit:$}=i,h=li(i,{processIconColor:n,processTitleColor:o,processDescriptionColor:o,processIconBgColor:r,processIconBorderColor:r,processDotColor:r,processTailColor:$,waitTitleColor:l,waitDescriptionColor:l,waitTailColor:$,waitDotColor:e,finishIconColor:r,finishTitleColor:o,finishDescriptionColor:l,finishTailColor:r,finishDotColor:r,errorIconColor:n,errorTitleColor:s,errorDescriptionColor:s,errorTailColor:$,errorIconBgColor:s,errorIconBorderColor:s,errorDotColor:s,stepsNavActiveColor:r,stepsProgressSize:t,inlineDotSize:6,inlineTitleColor:g,inlineTailColor:d});return ji(h)},_i);function Xi(i){return i.filter(e=>e)}function Ri(i,e){if(i)return i;const t=di(e).map(n=>{if(c.isValidElement(n)){const{props:o}=n;return Object.assign({},o)}return null});return Xi(t)}var Li=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(i);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(i,n[o])&&(t[n[o]]=i[n[o]]);return t};const Ai=i=>{const{percent:e,size:t,className:n,rootClassName:o,direction:r,items:l,responsive:g=!0,current:s=0,children:d,style:$}=i,h=Li(i,["percent","size","className","rootClassName","direction","items","responsive","current","children","style"]),{xs:w}=Si(g),{getPrefixCls:v,direction:q,className:E,style:O}=mi("steps"),u=c.useMemo(()=>g&&w?"vertical":r,[g,w,r]),T=gi(t),p=v("steps",i.prefixCls),[I,D,_]=Bi(p),N=i.type==="inline",y=v("",i.iconPrefix),B=Ri(l,d),x=N?void 0:e,M=Object.assign(Object.assign({},O),$),W=A(E,{[`${p}-rtl`]:q==="rtl",[`${p}-with-progress`]:x!==void 0},n,o,D,_),H={finish:c.createElement(ui,{className:`${p}-finish-icon`}),error:c.createElement(pi,{className:`${p}-error-icon`})},z=({node:m,status:C})=>{if(C==="process"&&x!==void 0){const P=T==="small"?32:40;return c.createElement("div",{className:`${p}-progress-icon`},c.createElement(fi,{type:"circle",percent:x,size:P,strokeWidth:4,format:()=>null}),m)}return m},S=(m,C)=>m.description?c.createElement($i,{title:m.description},C):C;return I(c.createElement(F,Object.assign({icons:H},h,{style:M,current:s,size:T,items:B,itemRender:N?S:void 0,stepIcon:z,direction:u,prefixCls:p,iconPrefix:y,className:W})))};Ai.Step=F.Step;var Gi={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M848 359.3H627.7L825.8 109c4.1-5.3.4-13-6.3-13H436c-2.8 0-5.5 1.5-6.9 4L170 547.5c-3.1 5.3.7 12 6.9 12h174.4l-89.4 357.6c-1.9 7.8 7.5 13.3 13.3 7.7L853.5 373c5.2-4.9 1.7-13.7-5.5-13.7zM378.2 732.5l60.3-241H281.1l189.6-327.4h224.6L487 427.4h211L378.2 732.5z"}}]},name:"thunderbolt",theme:"outlined"},Fi=function(e,t){return c.createElement(hi,X({},e,{ref:t,icon:Gi}))},Ui=c.forwardRef(Fi);export{Ui as R,Ai as S};
2
- //# sourceMappingURL=ThunderboltOutlined-ulcCd7ui.js.map
@@ -1,3 +0,0 @@
1
- import{a2 as D,r as c,D as oe,n as k,ae as Ue,v as Le,x as Re,A as v,z as ke,ac as He,J as We,a9 as se,ah as Ae,S as ue,b as _e,ai as Ge,j as t,aj as de,W as _,B as H,Z as te,d as ce,s as z,ak as V}from"./index-DG6kGbYq.js";import{T as Fe}from"./index-_EG4kaKN.js";import{C as ne,u as Je,r as me,R as we,a as X,b as Ve}from"./row-_c51T55h.js";import{I as he}from"./index-DPigBPWX.js";import{m as Xe,P as qe,T as W}from"./index-CJln3zA7.js";import{R as ge}from"./DeleteOutlined-BFmW1oWe.js";import{D as pe}from"./index-B2ns27ii.js";import{R as Ke}from"./CheckCircleOutlined-H3DnUyMO.js";import{R as Ye}from"./CloseCircleOutlined-BFfS5iXd.js";const re=D.createContext({});re.Consumer;var fe=function(e,n){var o={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(o[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(e);s<a.length;s++)n.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(e,a[s])&&(o[a[s]]=e[a[s]]);return o};const Ze=e=>{var{prefixCls:n,className:o,avatar:a,title:s,description:u}=e,m=fe(e,["prefixCls","className","avatar","title","description"]);const{getPrefixCls:h}=c.useContext(oe),g=h("list",n),f=k(`${g}-item-meta`,o),x=D.createElement("div",{className:`${g}-item-meta-content`},s&&D.createElement("h4",{className:`${g}-item-meta-title`},s),u&&D.createElement("div",{className:`${g}-item-meta-description`},u));return D.createElement("div",Object.assign({},m,{className:f}),a&&D.createElement("div",{className:`${g}-item-meta-avatar`},a),(s||u)&&x)},Qe=D.forwardRef((e,n)=>{const{prefixCls:o,children:a,actions:s,extra:u,styles:m,className:h,classNames:g,colStyle:f}=e,x=fe(e,["prefixCls","children","actions","extra","styles","className","classNames","colStyle"]),{grid:E,itemLayout:$}=c.useContext(re),{getPrefixCls:O,list:S}=c.useContext(oe),N=r=>{var p,y;return k((y=(p=S?.item)===null||p===void 0?void 0:p.classNames)===null||y===void 0?void 0:y[r],g?.[r])},B=r=>{var p,y;return Object.assign(Object.assign({},(y=(p=S?.item)===null||p===void 0?void 0:p.styles)===null||y===void 0?void 0:y[r]),m?.[r])},L=()=>{let r=!1;return c.Children.forEach(a,p=>{typeof p=="string"&&(r=!0)}),r&&c.Children.count(a)>1},I=()=>$==="vertical"?!!u:!L(),C=O("list",o),l=s&&s.length>0&&D.createElement("ul",{className:k(`${C}-item-action`,N("actions")),key:"actions",style:B("actions")},s.map((r,p)=>D.createElement("li",{key:`${C}-item-action-${p}`},r,p!==s.length-1&&D.createElement("em",{className:`${C}-item-action-split`})))),d=E?"div":"li",i=D.createElement(d,Object.assign({},x,E?{}:{ref:n},{className:k(`${C}-item`,{[`${C}-item-no-flex`]:!I()},h)}),$==="vertical"&&u?[D.createElement("div",{className:`${C}-item-main`,key:"content"},a,l),D.createElement("div",{className:k(`${C}-item-extra`,N("extra")),key:"extra",style:B("extra")},u)]:[a,l,Ue(u,{key:"extra"})]);return E?D.createElement(ne,{ref:n,flex:1,style:f},i):i}),xe=Qe;xe.Meta=Ze;const et=e=>{const{listBorderedCls:n,componentCls:o,paddingLG:a,margin:s,itemPaddingSM:u,itemPaddingLG:m,marginLG:h,borderRadiusLG:g}=e,f=v(e.calc(g).sub(e.lineWidth).equal());return{[n]:{border:`${v(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:g,[`${o}-header`]:{borderRadius:`${f} ${f} 0 0`},[`${o}-footer`]:{borderRadius:`0 0 ${f} ${f}`},[`${o}-header,${o}-footer,${o}-item`]:{paddingInline:a},[`${o}-pagination`]:{margin:`${v(s)} ${v(h)}`}},[`${n}${o}-sm`]:{[`${o}-item,${o}-header,${o}-footer`]:{padding:u}},[`${n}${o}-lg`]:{[`${o}-item,${o}-header,${o}-footer`]:{padding:m}}}},tt=e=>{const{componentCls:n,screenSM:o,screenMD:a,marginLG:s,marginSM:u,margin:m}=e;return{[`@media screen and (max-width:${a}px)`]:{[n]:{[`${n}-item`]:{[`${n}-item-action`]:{marginInlineStart:s}}},[`${n}-vertical`]:{[`${n}-item`]:{[`${n}-item-extra`]:{marginInlineStart:s}}}},[`@media screen and (max-width: ${o}px)`]:{[n]:{[`${n}-item`]:{flexWrap:"wrap",[`${n}-action`]:{marginInlineStart:u}}},[`${n}-vertical`]:{[`${n}-item`]:{flexWrap:"wrap-reverse",[`${n}-item-main`]:{minWidth:e.contentWidth},[`${n}-item-extra`]:{margin:`auto auto ${v(m)}`}}}}}},nt=e=>{const{componentCls:n,antCls:o,controlHeight:a,minHeight:s,paddingSM:u,marginLG:m,padding:h,itemPadding:g,colorPrimary:f,itemPaddingSM:x,itemPaddingLG:E,paddingXS:$,margin:O,colorText:S,colorTextDescription:N,motionDurationSlow:B,lineWidth:L,headerBg:I,footerBg:C,emptyTextPadding:l,metaMarginBottom:d,avatarMarginRight:i,titleMarginBottom:r,descriptionFontSize:p}=e;return{[n]:Object.assign(Object.assign({},ke(e)),{position:"relative","--rc-virtual-list-scrollbar-bg":e.colorSplit,"*":{outline:"none"},[`${n}-header`]:{background:I},[`${n}-footer`]:{background:C},[`${n}-header, ${n}-footer`]:{paddingBlock:u},[`${n}-pagination`]:{marginBlockStart:m,[`${o}-pagination-options`]:{textAlign:"start"}},[`${n}-spin`]:{minHeight:s,textAlign:"center"},[`${n}-items`]:{margin:0,padding:0,listStyle:"none"},[`${n}-item`]:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:g,color:S,[`${n}-item-meta`]:{display:"flex",flex:1,alignItems:"flex-start",maxWidth:"100%",[`${n}-item-meta-avatar`]:{marginInlineEnd:i},[`${n}-item-meta-content`]:{flex:"1 0",width:0,color:S},[`${n}-item-meta-title`]:{margin:`0 0 ${v(e.marginXXS)} 0`,color:S,fontSize:e.fontSize,lineHeight:e.lineHeight,"> a":{color:S,transition:`all ${B}`,"&:hover":{color:f}}},[`${n}-item-meta-description`]:{color:N,fontSize:p,lineHeight:e.lineHeight}},[`${n}-item-action`]:{flex:"0 0 auto",marginInlineStart:e.marginXXL,padding:0,fontSize:0,listStyle:"none","& > li":{position:"relative",display:"inline-block",padding:`0 ${v($)}`,color:N,fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"center","&:first-child":{paddingInlineStart:0}},[`${n}-item-action-split`]:{position:"absolute",insetBlockStart:"50%",insetInlineEnd:0,width:L,height:e.calc(e.fontHeight).sub(e.calc(e.marginXXS).mul(2)).equal(),transform:"translateY(-50%)",backgroundColor:e.colorSplit}}},[`${n}-empty`]:{padding:`${v(h)} 0`,color:N,fontSize:e.fontSizeSM,textAlign:"center"},[`${n}-empty-text`]:{padding:l,color:e.colorTextDisabled,fontSize:e.fontSize,textAlign:"center"},[`${n}-item-no-flex`]:{display:"block"}}),[`${n}-grid ${o}-col > ${n}-item`]:{display:"block",maxWidth:"100%",marginBlockEnd:O,paddingBlock:0,borderBlockEnd:"none"},[`${n}-vertical ${n}-item`]:{alignItems:"initial",[`${n}-item-main`]:{display:"block",flex:1},[`${n}-item-extra`]:{marginInlineStart:m},[`${n}-item-meta`]:{marginBlockEnd:d,[`${n}-item-meta-title`]:{marginBlockStart:0,marginBlockEnd:r,color:S,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}},[`${n}-item-action`]:{marginBlockStart:h,marginInlineStart:"auto","> li":{padding:`0 ${v(h)}`,"&:first-child":{paddingInlineStart:0}}}},[`${n}-split ${n}-item`]:{borderBlockEnd:`${v(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderBlockEnd:"none"}},[`${n}-split ${n}-header`]:{borderBlockEnd:`${v(e.lineWidth)} ${e.lineType} ${e.colorSplit}`},[`${n}-split${n}-empty ${n}-footer`]:{borderTop:`${v(e.lineWidth)} ${e.lineType} ${e.colorSplit}`},[`${n}-loading ${n}-spin-nested-loading`]:{minHeight:a},[`${n}-split${n}-something-after-last-item ${o}-spin-container > ${n}-items > ${n}-item:last-child`]:{borderBlockEnd:`${v(e.lineWidth)} ${e.lineType} ${e.colorSplit}`},[`${n}-lg ${n}-item`]:{padding:E},[`${n}-sm ${n}-item`]:{padding:x},[`${n}:not(${n}-vertical)`]:{[`${n}-item-no-flex`]:{[`${n}-item-action`]:{float:"right"}}}}},ot=e=>({contentWidth:220,itemPadding:`${v(e.paddingContentVertical)} 0`,itemPaddingSM:`${v(e.paddingContentVerticalSM)} ${v(e.paddingContentHorizontal)}`,itemPaddingLG:`${v(e.paddingContentVerticalLG)} ${v(e.paddingContentHorizontalLG)}`,headerBg:"transparent",footerBg:"transparent",emptyTextPadding:e.padding,metaMarginBottom:e.padding,avatarMarginRight:e.padding,titleMarginBottom:e.paddingSM,descriptionFontSize:e.fontSize}),rt=Le("List",e=>{const n=Re(e,{listBorderedCls:`${e.componentCls}-bordered`,minHeight:e.controlHeightLG});return[nt(n),et(n),tt(n)]},ot);var at=function(e,n){var o={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(o[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(e);s<a.length;s++)n.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(e,a[s])&&(o[a[s]]=e[a[s]]);return o};function lt(e,n){const{pagination:o=!1,prefixCls:a,bordered:s=!1,split:u=!0,className:m,rootClassName:h,style:g,children:f,itemLayout:x,loadMore:E,grid:$,dataSource:O=[],size:S,header:N,footer:B,loading:L=!1,rowKey:I,renderItem:C,locale:l}=e,d=at(e,["pagination","prefixCls","bordered","split","className","rootClassName","style","children","itemLayout","loadMore","grid","dataSource","size","header","footer","loading","rowKey","renderItem","locale"]),i=o&&typeof o=="object"?o:{},[r,p]=c.useState(i.defaultCurrent||1),[y,j]=c.useState(i.defaultPageSize||10),{getPrefixCls:A,direction:$e,className:ye,style:ve}=He("list"),{renderEmpty:K}=c.useContext(oe),Se={current:1,total:0,position:"bottom"},ae=w=>(P,U)=>{var ee;p(P),j(U),o&&((ee=o?.[w])===null||ee===void 0||ee.call(o,P,U))},je=ae("onChange"),be=ae("onShowSizeChange"),Ce=(w,P)=>{if(!C)return null;let U;return typeof I=="function"?U=I(w):I?U=w[I]:U=w.key,U||(U=`list-item-${P}`),c.createElement(c.Fragment,{key:U},C(w,P))},De=!!(E||o||B),b=A("list",a),[Ee,Ie,Pe]=rt(b);let R=L;typeof R=="boolean"&&(R={spinning:R});const Y=!!R?.spinning,ze=We(S);let G="";switch(ze){case"large":G="lg";break;case"small":G="sm";break}const Ne=k(b,{[`${b}-vertical`]:x==="vertical",[`${b}-${G}`]:G,[`${b}-split`]:u,[`${b}-bordered`]:s,[`${b}-loading`]:Y,[`${b}-grid`]:!!$,[`${b}-something-after-last-item`]:De,[`${b}-rtl`]:$e==="rtl"},ye,m,h,Ie,Pe),M=Xe(Se,{total:O.length,current:r,pageSize:y},o||{}),Me=Math.ceil(M.total/M.pageSize);M.current=Math.min(M.current,Me);const le=o&&c.createElement("div",{className:k(`${b}-pagination`)},c.createElement(qe,Object.assign({align:"end"},M,{onChange:je,onShowSizeChange:be})));let Z=se(O);o&&O.length>(M.current-1)*M.pageSize&&(Z=se(O).splice((M.current-1)*M.pageSize,M.pageSize));const Oe=Object.keys($||{}).some(w=>["xs","sm","md","lg","xl","xxl"].includes(w)),ie=Je(Oe),F=c.useMemo(()=>{for(let w=0;w<me.length;w+=1){const P=me[w];if(ie[P])return P}},[ie]),Be=c.useMemo(()=>{if(!$)return;const w=F&&$[F]?$[F]:$.column;if(w)return{width:`${100/w}%`,maxWidth:`${100/w}%`}},[JSON.stringify($),F]);let Q=Y&&c.createElement("div",{style:{minHeight:53}});if(Z.length>0){const w=Z.map(Ce);Q=$?c.createElement(we,{gutter:$.gutter},c.Children.map(w,P=>c.createElement("div",{key:P?.key,style:Be},P))):c.createElement("ul",{className:`${b}-items`},w)}else!f&&!Y&&(Q=c.createElement("div",{className:`${b}-empty-text`},l?.emptyText||K?.("List")||c.createElement(Ae,{componentName:"List"})));const J=M.position,Te=c.useMemo(()=>({grid:$,itemLayout:x}),[JSON.stringify($),x]);return Ee(c.createElement(re.Provider,{value:Te},c.createElement("div",Object.assign({ref:n,style:Object.assign(Object.assign({},ve),g),className:Ne},d),(J==="top"||J==="both")&&le,N&&c.createElement("div",{className:`${b}-header`},N),c.createElement(ue,Object.assign({},R),Q,f),B&&c.createElement("div",{className:`${b}-footer`},B),E||(J==="bottom"||J==="both")&&le)))}const it=c.forwardRef(lt),q=it;q.Item=xe;const{Title:st,Text:T,Paragraph:dt}=Fe,{TextArea:ct}=he,yt=()=>{const{t:e}=_e(),n=Ge(),[o,a]=c.useState(""),[s,u]=c.useState(""),[m,h]=c.useState([]),[g,f]=c.useState(!1),[x,E]=c.useState(!1),$=async()=>{if(!o.trim()){z.warning(e("download.urlDownload.enterUrl"));return}f(!0);try{const d=(await V.parseUrl(o.trim())).data.data;if(d?.success)z.success(e("download.urlDownload.parseSuccess")),h([{url:o.trim(),workId:d.workId,workType:d.workType,valid:!0}]);else{const i=d?.message||e("download.urlDownload.invalidUrl"),r=typeof i=="string"?i:typeof i=="object"&&i!==null?JSON.stringify(i):String(i||e("download.urlDownload.invalidUrl"));z.error(r),h([{url:o.trim(),valid:!1,error:r}])}}catch(l){const d=l,i=d.response?.data?.data?.message||d.response?.data?.message||d.message||e("download.urlDownload.parseError"),r=typeof i=="string"?i:typeof i=="object"&&i!==null?JSON.stringify(i):String(i||e("download.urlDownload.parseError"));z.error(r),h([{url:o.trim(),valid:!1,error:r}])}finally{f(!1)}},O=async()=>{const l=s.split(`
2
- `).map(r=>r.trim()).filter(r=>r.length>0);if(l.length===0){z.warning(e("download.urlDownload.enterUrls"));return}f(!0);const d=[];for(const r of l)try{const y=(await V.parseUrl(r)).data.data;if(y?.success)d.push({url:r,workId:y.workId,workType:y.workType,valid:!0});else{const j=y?.message||e("download.urlDownload.invalidUrl"),A=typeof j=="string"?j:typeof j=="object"&&j!==null?JSON.stringify(j):String(j||e("download.urlDownload.invalidUrl"));d.push({url:r,valid:!1,error:A})}}catch(p){const y=p,j=y.response?.data?.data?.message||y.response?.data?.message||y.message||e("download.urlDownload.parseError"),A=typeof j=="string"?j:typeof j=="object"&&j!==null?JSON.stringify(j):String(j||e("download.urlDownload.parseError"));d.push({url:r,valid:!1,error:A})}h(d),f(!1);const i=d.filter(r=>r.valid).length;i>0?z.success(e("download.urlDownload.parsedCount",{count:i,total:l.length})):z.error(e("download.urlDownload.noValidUrls"))},S=async()=>{if(!o.trim()){z.warning(e("download.urlDownload.enterUrl"));return}E(!0);try{await V.downloadFromUrl(o.trim()),z.success(e("download.urlDownload.downloadStarted")),setTimeout(()=>{n("/download")},1e3)}catch(l){const d=l,i=d.response?.data?.message||d.message||e("download.urlDownload.downloadError"),r=typeof i=="string"?i:typeof i=="object"&&i!==null?JSON.stringify(i):String(i||e("download.urlDownload.downloadError"));z.error(r)}finally{E(!1)}},N=async()=>{const l=m.filter(d=>d.valid).map(d=>d.url);if(l.length===0){z.warning(e("download.urlDownload.noValidUrls"));return}E(!0);try{const i=(await V.downloadFromBatchUrls(l)).data.data;z.success(e("download.urlDownload.batchDownloadStarted",{count:i?.validUrls||l.length})),setTimeout(()=>{n("/download")},1e3)}catch(d){const i=d,r=i.response?.data?.message||i.message||e("download.urlDownload.downloadError"),p=typeof r=="string"?r:typeof r=="object"&&r!==null?JSON.stringify(r):String(r||e("download.urlDownload.downloadError"));z.error(p)}finally{E(!1)}},B=l=>{h(d=>d.filter((i,r)=>r!==l))},L=()=>{a(""),u(""),h([])},I=m.filter(l=>l.valid).length,C=m.length-I;return t.jsxs("div",{style:{padding:"24px"},children:[t.jsxs(st,{level:2,children:[t.jsx(de,{})," ",e("download.urlDownload.title")]}),t.jsx(dt,{type:"secondary",children:e("download.urlDownload.description")}),t.jsxs(we,{gutter:[24,24],children:[t.jsx(ne,{xs:24,lg:12,children:t.jsx(X,{title:e("download.urlDownload.singleDownload"),extra:t.jsx(H,{type:"primary",icon:t.jsx(ce,{}),onClick:S,loading:x,disabled:g,children:e("download.urlDownload.download")}),children:t.jsxs(_,{direction:"vertical",style:{width:"100%"},size:"large",children:[t.jsxs("div",{children:[t.jsx(T,{strong:!0,children:e("download.urlDownload.inputLabel")}),t.jsx(he,{placeholder:e("download.urlDownload.placeholder"),value:o,onChange:l=>a(l.target.value),onPressEnter:S,size:"large",prefix:t.jsx(de,{}),disabled:g||x})]}),t.jsx(H,{block:!0,onClick:$,loading:g,disabled:x,children:e("download.urlDownload.parseUrl")}),m.length===1&&m[0]&&t.jsx(te,{message:m[0].valid?e("download.urlDownload.validUrl"):e("download.urlDownload.invalidUrl"),description:m[0].valid?t.jsxs("div",{children:[t.jsxs(T,{children:[e("download.urlDownload.workId"),": ",t.jsx(W,{children:m[0].workId||""})]}),t.jsx("br",{}),t.jsxs(T,{children:[e("download.urlDownload.workType"),":"," ",t.jsx(W,{color:m[0].workType==="illustration"?"blue":"green",children:e(`download.urlDownload.${m[0].workType||"illustration"}`)})]})]}):t.jsx("div",{children:t.jsx(T,{type:"danger",style:{whiteSpace:"pre-line"},children:m[0].error||""})}),type:m[0].valid?"success":"error",showIcon:!0})]})})}),t.jsx(ne,{xs:24,lg:12,children:t.jsx(X,{title:e("download.urlDownload.batchDownload"),extra:t.jsxs(_,{children:[t.jsx(H,{icon:t.jsx(ge,{}),onClick:L,disabled:g||x,children:e("download.urlDownload.clear")}),t.jsxs(H,{type:"primary",icon:t.jsx(ce,{}),onClick:N,loading:x,disabled:g||I===0,children:[e("download.urlDownload.downloadAll")," (",I,")"]})]}),children:t.jsxs(_,{direction:"vertical",style:{width:"100%"},size:"large",children:[t.jsxs("div",{children:[t.jsx(T,{strong:!0,children:e("download.urlDownload.batchInputLabel")}),t.jsx(ct,{placeholder:e("download.urlDownload.batchPlaceholder"),value:s,onChange:l=>u(l.target.value),rows:6,disabled:g||x})]}),t.jsx(H,{block:!0,icon:t.jsx(Ve,{}),onClick:O,loading:g,disabled:x,children:e("download.urlDownload.parseUrls")}),m.length>1&&t.jsx(te,{message:e("download.urlDownload.parseResult"),description:t.jsxs("div",{children:[t.jsxs(T,{children:[e("download.urlDownload.validUrls"),": ",t.jsx(W,{color:"success",children:I})]}),t.jsxs(T,{style:{marginLeft:16},children:[e("download.urlDownload.invalidUrls"),": ",t.jsx(W,{color:"error",children:C})]})]}),type:"info",showIcon:!0})]})})})]}),m.length>1&&t.jsxs(t.Fragment,{children:[t.jsx(pe,{}),t.jsx(X,{title:e("download.urlDownload.urlList"),children:t.jsx(ue,{spinning:g,children:t.jsx(q,{dataSource:m,renderItem:(l,d)=>t.jsx(q.Item,{actions:[t.jsx(H,{type:"text",danger:!0,icon:t.jsx(ge,{}),onClick:()=>B(d),disabled:g||x,children:e("download.urlDownload.remove")})],children:t.jsx(q.Item.Meta,{avatar:l.valid?t.jsx(Ke,{style:{fontSize:24,color:"#52c41a"}}):t.jsx(Ye,{style:{fontSize:24,color:"#ff4d4f"}}),title:t.jsxs(_,{children:[t.jsx(T,{ellipsis:!0,style:{maxWidth:400},children:l.url}),l.valid&&t.jsxs(t.Fragment,{children:[t.jsx(W,{children:l.workId}),t.jsx(W,{color:l.workType==="illustration"?"blue":"green",children:e(`download.urlDownload.${l.workType}`)})]})]}),description:!l.valid&&t.jsx(T,{type:"danger",children:l.error})})})})})})]}),t.jsx(pe,{}),t.jsx(X,{title:e("download.urlDownload.helpTitle"),children:t.jsxs(_,{direction:"vertical",style:{width:"100%"},children:[t.jsxs("div",{children:[t.jsx(T,{strong:!0,children:e("download.urlDownload.supportedFormats")}),t.jsxs("ul",{children:[t.jsxs("li",{children:[t.jsx("code",{children:"https://www.pixiv.net/artworks/123456"})," — ",e("download.urlDownload.fmtStandard")]}),t.jsxs("li",{children:[t.jsx("code",{children:"https://www.pixiv.net/en/artworks/123456"})," — ",e("download.urlDownload.fmtLangPrefix")]}),t.jsxs("li",{children:[t.jsx("code",{children:"https://pixiv.net/i/123456"})," — ",e("download.urlDownload.fmtShort")]}),t.jsxs("li",{children:[t.jsx("code",{children:"https://www.pixiv.net/member_illust.php?illust_id=123456"})," — ",e("download.urlDownload.fmtLegacy")]}),t.jsxs("li",{children:[t.jsx("code",{children:"https://www.pixiv.net/novel/show.php?id=123456"})," — ",e("download.urlDownload.fmtNovel")]}),t.jsxs("li",{children:[t.jsx("code",{children:"https://www.pixiv.net/novel/series/123456"})," — ",e("download.urlDownload.fmtSeries")]}),t.jsxs("li",{children:[t.jsx("code",{children:"https://www.pixiv.net/users/123456"})," — ",e("download.urlDownload.fmtUserProfile")]}),t.jsxs("li",{children:[t.jsx("code",{children:"https://www.pixiv.net/users/123456/artworks/789012"})," — ",e("download.urlDownload.fmtUserArtwork")]}),t.jsxs("li",{children:[t.jsx("code",{children:"https://www.pixiv.net/users/123456/novels/123456"})," — ",e("download.urlDownload.fmtUserNovel")]}),t.jsxs("li",{children:[t.jsx("code",{children:"123456"})," — ",e("download.urlDownload.directId")]})]})]}),t.jsx(te,{message:e("download.urlDownload.tip"),description:e("download.urlDownload.tipDescription"),type:"info",showIcon:!0})]})})]})};export{yt as UrlDownload,yt as default};
3
- //# sourceMappingURL=UrlDownload-Bzs0AZN0.js.map
@@ -1,3 +0,0 @@
1
- import{c2 as Re,c3 as Ee,c4 as ce,c5 as Oe,c6 as me,U as Ie,r as a,c7 as Pe,c8 as Be,o as Me,a7 as Ce,i as _e,n as Z,h as de,_ as je,a4 as ue,a2 as Ne,m as he,v as De,x as Te,A as L,z as re,bn as ve,D as ie,t as ze,H as ye,E as Se,K as Fe,aM as We,bo as He,c9 as Le,bw as Ae,aX as Ve,J as qe,a8 as Ge,bF as Ke,V as Xe}from"./index-DG6kGbYq.js";var Ue=class extends Re{#t;#r=void 0;#e;#o;constructor(e,r){super(),this.#t=e,this.setOptions(r),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const r=this.options;this.options=this.#t.defaultMutationOptions(e),Ee(this.options,r)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#e,observer:this}),r?.mutationKey&&this.options.mutationKey&&ce(r.mutationKey)!==ce(this.options.mutationKey)?this.reset():this.#e?.state.status==="pending"&&this.#e.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#e&&(this.#e.addObserver(this),this.#n())}onUnsubscribe(){this.hasListeners()||this.#e?.removeObserver(this)}onMutationUpdate(e){this.#n(),this.#i(e)}getCurrentResult(){return this.#r}reset(){this.#e?.removeObserver(this),this.#e=void 0,this.#n(),this.#i()}mutate(e,r){return this.#o=r,this.#e?.removeObserver(this),this.#e=this.#t.getMutationCache().build(this.#t,this.options),this.#e.addObserver(this),this.#e.execute(e)}#n(){const e=this.#e?.state??Oe();this.#r={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#i(e){me.batch(()=>{if(this.#o&&this.hasListeners()){const r=this.#r.variables,n=this.#r.context,o={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#o.onSuccess?.(e.data,r,n,o)}catch(t){Promise.reject(t)}try{this.#o.onSettled?.(e.data,null,r,n,o)}catch(t){Promise.reject(t)}}else if(e?.type==="error"){try{this.#o.onError?.(e.error,r,n,o)}catch(t){Promise.reject(t)}try{this.#o.onSettled?.(void 0,e.error,r,n,o)}catch(t){Promise.reject(t)}}}this.listeners.forEach(r=>{r(this.#r)})})}};function yt(e,r){const n=Ie(),[o]=a.useState(()=>new Ue(n,e));a.useEffect(()=>{o.setOptions(e)},[o,e]);const t=a.useSyncExternalStore(a.useCallback(s=>o.subscribe(me.batchCalls(s)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),i=a.useCallback((...s)=>{o.mutate(s[0],s[1]).catch(Pe)},[o]);if(t.error&&Be(o.options.throwOnError,[t.error]))throw t.error;return{...t,mutate:i,mutateAsync:t.mutate}}const be=e=>typeof e=="object"&&e!=null&&e.nodeType===1,fe=(e,r)=>(!r||e!=="hidden")&&e!=="visible"&&e!=="clip",J=(e,r)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return fe(n.overflowY,r)||fe(n.overflowX,r)||(o=>{const t=(i=>{if(!i.ownerDocument||!i.ownerDocument.defaultView)return null;try{return i.ownerDocument.defaultView.frameElement}catch{return null}})(o);return!!t&&(t.clientHeight<o.scrollHeight||t.clientWidth<o.scrollWidth)})(e)}return!1},Q=(e,r,n,o,t,i,s,l)=>i<e&&s>r||i>e&&s<r?0:i<=e&&l<=n||s>=r&&l>=n?i-e-o:s>r&&l<n||i<e&&l>n?s-r+t:0,Ye=e=>{const r=e.parentElement;return r??(e.getRootNode().host||null)},pe=(e,r)=>{var n,o,t,i;if(typeof document>"u")return[];const{scrollMode:s,block:l,inline:c,boundary:E,skipOverflowHiddenElements:P}=r,$=typeof E=="function"?E:_=>_!==E;if(!be(e))throw new TypeError("Invalid target");const O=document.scrollingElement||document.documentElement,x=[];let p=e;for(;be(p)&&$(p);){if(p=Ye(p),p===O){x.push(p);break}p!=null&&p===document.body&&J(p)&&!J(document.documentElement)||p!=null&&J(p,P)&&x.push(p)}const b=(o=(n=window.visualViewport)==null?void 0:n.width)!=null?o:innerWidth,f=(i=(t=window.visualViewport)==null?void 0:t.height)!=null?i:innerHeight,{scrollX:S,scrollY:k}=window,{height:C,width:w,top:R,right:g,bottom:M,left:h}=e.getBoundingClientRect(),{top:I,right:B,bottom:v,left:j}=(_=>{const d=window.getComputedStyle(_);return{top:parseFloat(d.scrollMarginTop)||0,right:parseFloat(d.scrollMarginRight)||0,bottom:parseFloat(d.scrollMarginBottom)||0,left:parseFloat(d.scrollMarginLeft)||0}})(e);let y=l==="start"||l==="nearest"?R-I:l==="end"?M+v:R+C/2-I+v,u=c==="center"?h+w/2-j+B:c==="end"?g+B:h-j;const D=[];for(let _=0;_<x.length;_++){const d=x[_],{height:N,width:F,top:W,right:V,bottom:q,left:m}=d.getBoundingClientRect();if(s==="if-needed"&&R>=0&&h>=0&&M<=f&&g<=b&&(d===O&&!J(d)||R>=W&&M<=q&&h>=m&&g<=V))return D;const A=getComputedStyle(d),H=parseInt(A.borderLeftWidth,10),G=parseInt(A.borderTopWidth,10),K=parseInt(A.borderRightWidth,10),X=parseInt(A.borderBottomWidth,10);let T=0,z=0;const U="offsetWidth"in d?d.offsetWidth-d.clientWidth-H-K:0,Y="offsetHeight"in d?d.offsetHeight-d.clientHeight-G-X:0,te="offsetWidth"in d?d.offsetWidth===0?0:F/d.offsetWidth:0,oe="offsetHeight"in d?d.offsetHeight===0?0:N/d.offsetHeight:0;if(O===d)T=l==="start"?y:l==="end"?y-f:l==="nearest"?Q(k,k+f,f,G,X,k+y,k+y+C,C):y-f/2,z=c==="start"?u:c==="center"?u-b/2:c==="end"?u-b:Q(S,S+b,b,H,K,S+u,S+u+w,w),T=Math.max(0,T+k),z=Math.max(0,z+S);else{T=l==="start"?y-W-G:l==="end"?y-q+X+Y:l==="nearest"?Q(W,q,N,G,X+Y,y,y+C,C):y-(W+N/2)+Y/2,z=c==="start"?u-m-H:c==="center"?u-(m+F/2)+U/2:c==="end"?u-V+K+U:Q(m,V,F,H,K+U,u,u+w,w);const{scrollLeft:le,scrollTop:ae}=d;T=oe===0?0:Math.max(0,Math.min(ae+T/oe,d.scrollHeight-N/oe+Y)),z=te===0?0:Math.max(0,Math.min(le+z/te,d.scrollWidth-F/te+U)),y+=ae-T,u+=le-z}D.push({el:d,top:T,left:z})}return D},Je=e=>e===!1?{block:"end",inline:"nearest"}:(r=>r===Object(r)&&Object.keys(r).length!==0)(e)?e:{block:"start",inline:"nearest"};function Qe(e,r){if(!e.isConnected||!(t=>{let i=t;for(;i&&i.parentNode;){if(i.parentNode===document)return!0;i=i.parentNode instanceof ShadowRoot?i.parentNode.host:i.parentNode}return!1})(e))return;const n=(t=>{const i=window.getComputedStyle(t);return{top:parseFloat(i.scrollMarginTop)||0,right:parseFloat(i.scrollMarginRight)||0,bottom:parseFloat(i.scrollMarginBottom)||0,left:parseFloat(i.scrollMarginLeft)||0}})(e);if((t=>typeof t=="object"&&typeof t.behavior=="function")(r))return r.behavior(pe(e,r));const o=typeof r=="boolean"||r==null?void 0:r.behavior;for(const{el:t,top:i,left:s}of pe(e,Je(r))){const l=i-n.top+n.bottom,c=s-n.left+n.right;t.scroll({top:l,left:c,behavior:o})}}const ke=a.createContext(null),Ze=ke.Provider,xe=a.createContext(null),et=xe.Provider;var tt=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],ot=a.forwardRef(function(e,r){var n=e.prefixCls,o=n===void 0?"rc-checkbox":n,t=e.className,i=e.style,s=e.checked,l=e.disabled,c=e.defaultChecked,E=c===void 0?!1:c,P=e.type,$=P===void 0?"checkbox":P,O=e.title,x=e.onChange,p=Me(e,tt),b=a.useRef(null),f=a.useRef(null),S=Ce(E,{value:s}),k=_e(S,2),C=k[0],w=k[1];a.useImperativeHandle(r,function(){return{focus:function(h){var I;(I=b.current)===null||I===void 0||I.focus(h)},blur:function(){var h;(h=b.current)===null||h===void 0||h.blur()},input:b.current,nativeElement:f.current}});var R=Z(o,t,de(de({},"".concat(o,"-checked"),C),"".concat(o,"-disabled"),l)),g=function(h){l||("checked"in e||w(h.target.checked),x?.({target:ue(ue({},e),{},{type:$,checked:h.target.checked}),stopPropagation:function(){h.stopPropagation()},preventDefault:function(){h.preventDefault()},nativeEvent:h.nativeEvent}))};return a.createElement("span",{className:R,title:O,style:i,ref:f},a.createElement("input",je({},p,{className:"".concat(o,"-input"),ref:b,onChange:g,disabled:l,checked:!!C,type:$})),a.createElement("span",{className:"".concat(o,"-inner")}))});function rt(e){const r=Ne.useRef(null),n=()=>{he.cancel(r.current),r.current=null};return[()=>{n(),r.current=he(()=>{r.current=null})},i=>{r.current&&(i.stopPropagation(),n()),e?.(i)}]}const nt=e=>{const{componentCls:r,antCls:n}=e,o=`${r}-group`;return{[o]:Object.assign(Object.assign({},re(e)),{display:"inline-block",fontSize:0,[`&${o}-rtl`]:{direction:"rtl"},[`&${o}-block`]:{display:"flex"},[`${n}-badge ${n}-badge-count`]:{zIndex:1},[`> ${n}-badge:not(:first-child) > ${n}-button-wrapper`]:{borderInlineStart:"none"}})}},it=e=>{const{componentCls:r,wrapperMarginInlineEnd:n,colorPrimary:o,radioSize:t,motionDurationSlow:i,motionDurationMid:s,motionEaseInOutCirc:l,colorBgContainer:c,colorBorder:E,lineWidth:P,colorBgContainerDisabled:$,colorTextDisabled:O,paddingXS:x,dotColorDisabled:p,lineType:b,radioColor:f,radioBgColor:S,calc:k}=e,C=`${r}-inner`,R=k(t).sub(k(4).mul(2)),g=k(1).mul(t).equal({unit:!0});return{[`${r}-wrapper`]:Object.assign(Object.assign({},re(e)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:n,cursor:"pointer","&:last-child":{marginInlineEnd:0},[`&${r}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:e.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},"&-block":{flex:1,justifyContent:"center"},[`${r}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${L(P)} ${b} ${o}`,borderRadius:"50%",visibility:"hidden",opacity:0,content:'""'},[r]:Object.assign(Object.assign({},re(e)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${r}-wrapper:hover &,
2
- &:hover ${C}`]:{borderColor:o},[`${r}-input:focus-visible + ${C}`]:ve(e),[`${r}:hover::after, ${r}-wrapper:hover &::after`]:{visibility:"visible"},[`${r}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:g,height:g,marginBlockStart:k(1).mul(t).div(-2).equal({unit:!0}),marginInlineStart:k(1).mul(t).div(-2).equal({unit:!0}),backgroundColor:f,borderBlockStart:0,borderInlineStart:0,borderRadius:g,transform:"scale(0)",opacity:0,transition:`all ${i} ${l}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:g,height:g,backgroundColor:c,borderColor:E,borderStyle:"solid",borderWidth:P,borderRadius:"50%",transition:`all ${s}`},[`${r}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${r}-checked`]:{[C]:{borderColor:o,backgroundColor:S,"&::after":{transform:`scale(${e.calc(e.dotSize).div(t).equal()})`,opacity:1,transition:`all ${i} ${l}`}}},[`${r}-disabled`]:{cursor:"not-allowed",[C]:{backgroundColor:$,borderColor:E,cursor:"not-allowed","&::after":{backgroundColor:p}},[`${r}-input`]:{cursor:"not-allowed"},[`${r}-disabled + span`]:{color:O,cursor:"not-allowed"},[`&${r}-checked`]:{[C]:{"&::after":{transform:`scale(${k(R).div(t).equal()})`}}}},[`span${r} + *`]:{paddingInlineStart:x,paddingInlineEnd:x}})}},st=e=>{const{buttonColor:r,controlHeight:n,componentCls:o,lineWidth:t,lineType:i,colorBorder:s,motionDurationMid:l,buttonPaddingInline:c,fontSize:E,buttonBg:P,fontSizeLG:$,controlHeightLG:O,controlHeightSM:x,paddingXS:p,borderRadius:b,borderRadiusSM:f,borderRadiusLG:S,buttonCheckedBg:k,buttonSolidCheckedColor:C,colorTextDisabled:w,colorBgContainerDisabled:R,buttonCheckedBgDisabled:g,buttonCheckedColorDisabled:M,colorPrimary:h,colorPrimaryHover:I,colorPrimaryActive:B,buttonSolidCheckedBg:v,buttonSolidCheckedHoverBg:j,buttonSolidCheckedActiveBg:y,calc:u}=e;return{[`${o}-button-wrapper`]:{position:"relative",display:"inline-block",height:n,margin:0,paddingInline:c,paddingBlock:0,color:r,fontSize:E,lineHeight:L(u(n).sub(u(t).mul(2)).equal()),background:P,border:`${L(t)} ${i} ${s}`,borderBlockStartWidth:u(t).add(.02).equal(),borderInlineEndWidth:t,cursor:"pointer",transition:[`color ${l}`,`background ${l}`,`box-shadow ${l}`].join(","),a:{color:r},[`> ${o}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:last-child)":{marginInlineEnd:u(t).mul(-1).equal()},"&:first-child":{borderInlineStart:`${L(t)} ${i} ${s}`,borderStartStartRadius:b,borderEndStartRadius:b},"&:last-child":{borderStartEndRadius:b,borderEndEndRadius:b},"&:first-child:last-child":{borderRadius:b},[`${o}-group-large &`]:{height:O,fontSize:$,lineHeight:L(u(O).sub(u(t).mul(2)).equal()),"&:first-child":{borderStartStartRadius:S,borderEndStartRadius:S},"&:last-child":{borderStartEndRadius:S,borderEndEndRadius:S}},[`${o}-group-small &`]:{height:x,paddingInline:u(p).sub(t).equal(),paddingBlock:0,lineHeight:L(u(x).sub(u(t).mul(2)).equal()),"&:first-child":{borderStartStartRadius:f,borderEndStartRadius:f},"&:last-child":{borderStartEndRadius:f,borderEndEndRadius:f}},"&:hover":{position:"relative",color:h},"&:has(:focus-visible)":ve(e),[`${o}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${o}-button-wrapper-disabled)`]:{zIndex:1,color:h,background:k,borderColor:h,"&::before":{backgroundColor:h},"&:first-child":{borderColor:h},"&:hover":{color:I,borderColor:I,"&::before":{backgroundColor:I}},"&:active":{color:B,borderColor:B,"&::before":{backgroundColor:B}}},[`${o}-group-solid &-checked:not(${o}-button-wrapper-disabled)`]:{color:C,background:v,borderColor:v,"&:hover":{color:C,background:j,borderColor:j},"&:active":{color:C,background:y,borderColor:y}},"&-disabled":{color:w,backgroundColor:R,borderColor:s,cursor:"not-allowed","&:first-child, &:hover":{color:w,backgroundColor:R,borderColor:s}},[`&-disabled${o}-button-wrapper-checked`]:{color:M,backgroundColor:g,borderColor:s,boxShadow:"none"},"&-block":{flex:1,textAlign:"center"}}}},lt=e=>{const{wireframe:r,padding:n,marginXS:o,lineWidth:t,fontSizeLG:i,colorText:s,colorBgContainer:l,colorTextDisabled:c,controlItemBgActiveDisabled:E,colorTextLightSolid:P,colorPrimary:$,colorPrimaryHover:O,colorPrimaryActive:x,colorWhite:p}=e,b=4,f=i,S=r?f-b*2:f-(b+t)*2;return{radioSize:f,dotSize:S,dotColorDisabled:c,buttonSolidCheckedColor:P,buttonSolidCheckedBg:$,buttonSolidCheckedHoverBg:O,buttonSolidCheckedActiveBg:x,buttonBg:l,buttonCheckedBg:l,buttonColor:s,buttonCheckedBgDisabled:E,buttonCheckedColorDisabled:c,buttonPaddingInline:n-t,wrapperMarginInlineEnd:o,radioColor:r?$:p,radioBgColor:r?l:$}},we=De("Radio",e=>{const{controlOutline:r,controlOutlineWidth:n}=e,o=`0 0 0 ${L(n)} ${r}`,i=Te(e,{radioFocusShadow:o,radioButtonFocusShadow:o});return[nt(i),it(i),st(i)]},lt,{unitless:{radioSize:!0,dotSize:!0}});var at=function(e,r){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,o=Object.getOwnPropertySymbols(e);t<o.length;t++)r.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(e,o[t])&&(n[o[t]]=e[o[t]]);return n};const ct=(e,r)=>{var n,o;const t=a.useContext(ke),i=a.useContext(xe),{getPrefixCls:s,direction:l,radio:c}=a.useContext(ie),E=a.useRef(null),P=ze(r,E),{isFormItemInput:$}=a.useContext(ye),O=_=>{var d,N;(d=e.onChange)===null||d===void 0||d.call(e,_),(N=t?.onChange)===null||N===void 0||N.call(t,_)},{prefixCls:x,className:p,rootClassName:b,children:f,style:S,title:k}=e,C=at(e,["prefixCls","className","rootClassName","children","style","title"]),w=s("radio",x),R=(t?.optionType||i)==="button",g=R?`${w}-button`:w,M=Se(w),[h,I,B]=we(w,M),v=Object.assign({},C),j=a.useContext(Fe);t&&(v.name=t.name,v.onChange=O,v.checked=e.value===t.value,v.disabled=(n=v.disabled)!==null&&n!==void 0?n:t.disabled),v.disabled=(o=v.disabled)!==null&&o!==void 0?o:j;const y=Z(`${g}-wrapper`,{[`${g}-wrapper-checked`]:v.checked,[`${g}-wrapper-disabled`]:v.disabled,[`${g}-wrapper-rtl`]:l==="rtl",[`${g}-wrapper-in-form-item`]:$,[`${g}-wrapper-block`]:!!t?.block},c?.className,p,b,I,B,M),[u,D]=rt(v.onClick);return h(a.createElement(We,{component:"Radio",disabled:v.disabled},a.createElement("label",{className:y,style:Object.assign(Object.assign({},c?.style),S),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,title:k,onClick:u},a.createElement(ot,Object.assign({},v,{className:Z(v.className,{[He]:!R}),type:"radio",prefixCls:g,ref:P,onClick:D})),f!==void 0?a.createElement("span",{className:`${g}-label`},f):null)))},ee=a.forwardRef(ct),dt=["parentNode"],ut="form_item";function $e(e){return e===void 0||e===!1?[]:Array.isArray(e)?e:[e]}function ht(e,r){if(!e.length)return;const n=e.join("_");return r?`${r}_${n}`:dt.includes(n)?`${ut}_${n}`:n}function St(e,r,n,o,t,i){let s=o;return i!==void 0?s=i:n.validating?s="validating":e.length?s="error":r.length?s="warning":(n.touched||t&&n.validated)&&(s="success"),s}var bt=function(e,r){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,o=Object.getOwnPropertySymbols(e);t<o.length;t++)r.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(e,o[t])&&(n[o[t]]=e[o[t]]);return n};function ne(e){return $e(e).join("_")}function ge(e,r){const n=r.getFieldInstance(e),o=Ae(n);if(o)return o;const t=ht($e(e),r.__INTERNAL__.name);if(t)return document.getElementById(t)}function kt(e){const[r]=Le(),n=a.useRef({}),o=a.useMemo(()=>e??Object.assign(Object.assign({},r),{__INTERNAL__:{itemRef:t=>i=>{const s=ne(t);i?n.current[s]=i:delete n.current[s]}},scrollToField:(t,i={})=>{const{focus:s}=i,l=bt(i,["focus"]),c=ge(t,o);c&&(Qe(c,Object.assign({scrollMode:"if-needed",block:"nearest"},l)),s&&o.focusField(t))},focusField:t=>{var i,s;const l=o.getFieldInstance(t);typeof l?.focus=="function"?l.focus():(s=(i=ge(t,o))===null||i===void 0?void 0:i.focus)===null||s===void 0||s.call(i)},getFieldInstance:t=>{const i=ne(t);return n.current[i]}}),[e,r]);return[o]}const ft=a.forwardRef((e,r)=>{const{getPrefixCls:n,direction:o}=a.useContext(ie),{name:t}=a.useContext(ye),i=Ve(ne(t)),{prefixCls:s,className:l,rootClassName:c,options:E,buttonStyle:P="outline",disabled:$,children:O,size:x,style:p,id:b,optionType:f,name:S=i,defaultValue:k,value:C,block:w=!1,onChange:R,onMouseEnter:g,onMouseLeave:M,onFocus:h,onBlur:I}=e,[B,v]=Ce(k,{value:C}),j=a.useCallback(m=>{const A=B,H=m.target.value;"value"in e||v(H),H!==A&&R?.(m)},[B,v,R]),y=n("radio",s),u=`${y}-group`,D=Se(y),[_,d,N]=we(y,D);let F=O;E&&E.length>0&&(F=E.map(m=>typeof m=="string"||typeof m=="number"?a.createElement(ee,{key:m.toString(),prefixCls:y,disabled:$,value:m,checked:B===m},m):a.createElement(ee,{key:`radio-group-value-options-${m.value}`,prefixCls:y,disabled:m.disabled||$,value:m.value,checked:B===m.value,title:m.title,style:m.style,className:m.className,id:m.id,required:m.required},m.label)));const W=qe(x),V=Z(u,`${u}-${P}`,{[`${u}-${W}`]:W,[`${u}-rtl`]:o==="rtl",[`${u}-block`]:w},l,c,d,N,D),q=a.useMemo(()=>({onChange:j,value:B,disabled:$,name:S,optionType:f,block:w}),[j,B,$,S,f,w]);return _(a.createElement("div",Object.assign({},Ge(e,{aria:!0,data:!0}),{className:V,style:p,onMouseEnter:g,onMouseLeave:M,onFocus:h,onBlur:I,id:b,ref:r}),a.createElement(Ze,{value:q},F)))}),pt=a.memo(ft);var gt=function(e,r){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,o=Object.getOwnPropertySymbols(e);t<o.length;t++)r.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(e,o[t])&&(n[o[t]]=e[o[t]]);return n};const mt=(e,r)=>{const{getPrefixCls:n}=a.useContext(ie),{prefixCls:o}=e,t=gt(e,["prefixCls"]),i=n("radio",o);return a.createElement(et,{value:"button"},a.createElement(ee,Object.assign({prefixCls:i},t,{type:"radio",ref:r})))},Ct=a.forwardRef(mt),se=ee;se.Button=Ct;se.Group=pt;se.__ANT_RADIO=!0;function xt(e,r,n,o){if(!e)return o||r("common.error");const t=`errorCodes.${e}`,i=r(t,{...n,defaultValue:e});return i===t?o||e:i}function wt(e){if(!e)return{};const r=e instanceof Ke?e:Xe(e),{code:n,message:o,params:t,details:i,statusCode:s}=r;return{errorCode:n,message:o,params:t,details:i,statusCode:s}}export{ot as C,se as R,rt as a,kt as b,$e as c,ht as d,wt as e,St as g,xt as t,yt as u};
3
- //# sourceMappingURL=errorCodeTranslator-BqIackMm.js.map
@@ -1,2 +0,0 @@
1
- import{a2 as V,r as a,a6 as U,n as $,v as J,x as q,z as K,A as v,aA as Q,ac as Y,J as Z}from"./index-DG6kGbYq.js";import{m as T,u as k}from"./row-_c51T55h.js";const ee={xxl:3,xl:3,lg:3,md:3,sm:2,xs:1},M=V.createContext({});var te=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(i[n[l]]=e[n[l]]);return i};const ne=e=>U(e).map(t=>Object.assign(Object.assign({},t?.props),{key:t.key}));function le(e,t,i){const n=a.useMemo(()=>t||ne(i),[t,i]);return a.useMemo(()=>n.map(r=>{var{span:s}=r,p=te(r,["span"]);return s==="filled"?Object.assign(Object.assign({},p),{filled:!0}):Object.assign(Object.assign({},p),{span:typeof s=="number"?s:T(e,s)})}),[n,e])}var ie=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(i[n[l]]=e[n[l]]);return i};function ae(e,t){let i=[],n=[],l=!1,r=0;return e.filter(s=>s).forEach(s=>{const{filled:p}=s,g=ie(s,["filled"]);if(p){n.push(g),i.push(n),n=[],r=0;return}const u=t-r;r+=s.span||1,r>=t?(r>t?(l=!0,n.push(Object.assign(Object.assign({},g),{span:u}))):n.push(g),i.push(n),n=[],r=0):n.push(g)}),n.length>0&&i.push(n),i=i.map(s=>{const p=s.reduce((g,u)=>g+(u.span||1),0);if(p<t){const g=s[s.length-1];return g.span=t-(p-(g.span||1)),s}return s}),[i,l]}const se=(e,t)=>{const[i,n]=a.useMemo(()=>ae(t,e),[t,e]);return i},oe=({children:e})=>e;function R(e){return e!=null}const B=e=>{const{itemPrefixCls:t,component:i,span:n,className:l,style:r,labelStyle:s,contentStyle:p,bordered:g,label:u,content:d,colon:C,type:j,styles:m}=e,y=i,o=a.useContext(M),{classNames:b}=o;return g?a.createElement(y,{className:$({[`${t}-item-label`]:j==="label",[`${t}-item-content`]:j==="content",[`${b?.label}`]:j==="label",[`${b?.content}`]:j==="content"},l),style:r,colSpan:n},R(u)&&a.createElement("span",{style:Object.assign(Object.assign({},s),m?.label)},u),R(d)&&a.createElement("span",{style:Object.assign(Object.assign({},s),m?.content)},d)):a.createElement(y,{className:$(`${t}-item`,l),style:r,colSpan:n},a.createElement("div",{className:`${t}-item-container`},(u||u===0)&&a.createElement("span",{className:$(`${t}-item-label`,b?.label,{[`${t}-item-no-colon`]:!C}),style:Object.assign(Object.assign({},s),m?.label)},u),(d||d===0)&&a.createElement("span",{className:$(`${t}-item-content`,b?.content),style:Object.assign(Object.assign({},p),m?.content)},d)))};function z(e,{colon:t,prefixCls:i,bordered:n},{component:l,type:r,showLabel:s,showContent:p,labelStyle:g,contentStyle:u,styles:d}){return e.map(({label:C,children:j,prefixCls:m=i,className:y,style:o,labelStyle:b,contentStyle:c,span:N=1,key:S,styles:f},E)=>typeof l=="string"?a.createElement(B,{key:`${r}-${S||E}`,className:y,style:o,styles:{label:Object.assign(Object.assign(Object.assign(Object.assign({},g),d?.label),b),f?.label),content:Object.assign(Object.assign(Object.assign(Object.assign({},u),d?.content),c),f?.content)},span:N,colon:t,component:l,itemPrefixCls:m,bordered:n,label:s?C:null,content:p?j:null,type:r}):[a.createElement(B,{key:`label-${S||E}`,className:y,style:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},g),d?.label),o),b),f?.label),span:1,colon:t,component:l[0],itemPrefixCls:m,bordered:n,label:C,type:"label"}),a.createElement(B,{key:`content-${S||E}`,className:y,style:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},u),d?.content),o),c),f?.content),span:N*2-1,component:l[1],itemPrefixCls:m,bordered:n,content:j,type:"content"})])}const re=e=>{const t=a.useContext(M),{prefixCls:i,vertical:n,row:l,index:r,bordered:s}=e;return n?a.createElement(a.Fragment,null,a.createElement("tr",{key:`label-${r}`,className:`${i}-row`},z(l,e,Object.assign({component:"th",type:"label",showLabel:!0},t))),a.createElement("tr",{key:`content-${r}`,className:`${i}-row`},z(l,e,Object.assign({component:"td",type:"content",showContent:!0},t)))):a.createElement("tr",{key:r,className:`${i}-row`},z(l,e,Object.assign({component:s?["th","td"]:"td",type:"item",showLabel:!0,showContent:!0},t)))},ce=e=>{const{componentCls:t,labelBg:i}=e;return{[`&${t}-bordered`]:{[`> ${t}-view`]:{border:`${v(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"> table":{tableLayout:"auto"},[`${t}-row`]:{borderBottom:`${v(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:first-child":{"> th:first-child, > td:first-child":{borderStartStartRadius:e.borderRadiusLG}},"&:last-child":{borderBottom:"none","> th:first-child, > td:first-child":{borderEndStartRadius:e.borderRadiusLG}},[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${v(e.padding)} ${v(e.paddingLG)}`,borderInlineEnd:`${v(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderInlineEnd:"none"}},[`> ${t}-item-label`]:{color:e.colorTextSecondary,backgroundColor:i,"&::after":{display:"none"}}}},[`&${t}-middle`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${v(e.paddingSM)} ${v(e.paddingLG)}`}}},[`&${t}-small`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${v(e.paddingXS)} ${v(e.padding)}`}}}}}},de=e=>{const{componentCls:t,extraColor:i,itemPaddingBottom:n,itemPaddingEnd:l,colonMarginRight:r,colonMarginLeft:s,titleMarginBottom:p}=e;return{[t]:Object.assign(Object.assign(Object.assign({},K(e)),ce(e)),{"&-rtl":{direction:"rtl"},[`${t}-header`]:{display:"flex",alignItems:"center",marginBottom:p},[`${t}-title`]:Object.assign(Object.assign({},Q),{flex:"auto",color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}),[`${t}-extra`]:{marginInlineStart:"auto",color:i,fontSize:e.fontSize},[`${t}-view`]:{width:"100%",borderRadius:e.borderRadiusLG,table:{width:"100%",tableLayout:"fixed",borderCollapse:"collapse"}},[`${t}-row`]:{"> th, > td":{paddingBottom:n,paddingInlineEnd:l},"> th:last-child, > td:last-child":{paddingInlineEnd:0},"&:last-child":{borderBottom:"none","> th, > td":{paddingBottom:0}}},[`${t}-item-label`]:{color:e.labelColor,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"start","&::after":{content:'":"',position:"relative",top:-.5,marginInline:`${v(s)} ${v(r)}`},[`&${t}-item-no-colon::after`]:{content:'""'}},[`${t}-item-no-label`]:{"&::after":{margin:0,content:'""'}},[`${t}-item-content`]:{display:"table-cell",flex:1,color:e.contentColor,fontSize:e.fontSize,lineHeight:e.lineHeight,wordBreak:"break-word",overflowWrap:"break-word"},[`${t}-item`]:{paddingBottom:0,verticalAlign:"top","&-container":{display:"flex",[`${t}-item-label`]:{display:"inline-flex",alignItems:"baseline"},[`${t}-item-content`]:{display:"inline-flex",alignItems:"baseline",minWidth:"1em"}}},"&-middle":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingSM}}},"&-small":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingXS}}}})}},me=e=>({labelBg:e.colorFillAlter,labelColor:e.colorTextTertiary,titleColor:e.colorText,titleMarginBottom:e.fontSizeSM*e.lineHeightSM,itemPaddingBottom:e.padding,itemPaddingEnd:e.padding,colonMarginRight:e.marginXS,colonMarginLeft:e.marginXXS/2,contentColor:e.colorText,extraColor:e.colorText}),be=J("Descriptions",e=>{const t=q(e,{});return de(t)},me);var ge=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(i[n[l]]=e[n[l]]);return i};const pe=e=>{const{prefixCls:t,title:i,extra:n,column:l,colon:r=!0,bordered:s,layout:p,children:g,className:u,rootClassName:d,style:C,size:j,labelStyle:m,contentStyle:y,styles:o,items:b,classNames:c}=e,N=ge(e,["prefixCls","title","extra","column","colon","bordered","layout","children","className","rootClassName","style","size","labelStyle","contentStyle","styles","items","classNames"]),{getPrefixCls:S,direction:f,className:E,style:_,classNames:h,styles:x}=Y("descriptions"),O=S("descriptions",t),I=k(),A=a.useMemo(()=>{var w;return typeof l=="number"?l:(w=T(I,Object.assign(Object.assign({},ee),l)))!==null&&w!==void 0?w:3},[I,l]),H=le(I,b,g),P=Z(j),W=se(A,H),[D,G,X]=be(O),F=a.useMemo(()=>({labelStyle:m,contentStyle:y,styles:{content:Object.assign(Object.assign({},x.content),o?.content),label:Object.assign(Object.assign({},x.label),o?.label)},classNames:{label:$(h.label,c?.label),content:$(h.content,c?.content)}}),[m,y,o,c,h,x]);return D(a.createElement(M.Provider,{value:F},a.createElement("div",Object.assign({className:$(O,E,h.root,c?.root,{[`${O}-${P}`]:P&&P!=="default",[`${O}-bordered`]:!!s,[`${O}-rtl`]:f==="rtl"},u,d,G,X),style:Object.assign(Object.assign(Object.assign(Object.assign({},_),x.root),o?.root),C)},N),(i||n)&&a.createElement("div",{className:$(`${O}-header`,h.header,c?.header),style:Object.assign(Object.assign({},x.header),o?.header)},i&&a.createElement("div",{className:$(`${O}-title`,h.title,c?.title),style:Object.assign(Object.assign({},x.title),o?.title)},i),n&&a.createElement("div",{className:$(`${O}-extra`,h.extra,c?.extra),style:Object.assign(Object.assign({},x.extra),o?.extra)},n)),a.createElement("div",{className:`${O}-view`},a.createElement("table",null,a.createElement("tbody",null,W.map((w,L)=>a.createElement(re,{key:L,index:L,colon:r,prefixCls:O,vertical:p==="vertical",bordered:s,row:w}))))))))};pe.Item=oe;export{pe as D};
2
- //# sourceMappingURL=index-Bbsa44oT.js.map
@@ -1,19 +0,0 @@
1
- import{v as $e,x as Ue,aJ as we,z as Oe,aK as D,A as z,r as l,D as ce,aL as Ne,n as I,ae as Re,a5 as _e,I as Ze,_ as qe,a as he,U as Ee,u as Ve,Q as ae,b as _,j as n,e as Ge,W as Te,B as H,c as Qe,Y as ie,d as Ke,aH as Xe,X as le,s as Y}from"./index-DG6kGbYq.js";import{u as Ye}from"./errorCodeTranslator-BqIackMm.js";import{u as Je,F as et}from"./useErrorHandler-BOvHue1w.js";import{a as tt,r as ot}from"./socket-oqYz9cKb.js";import{R as de,C as L,a as U}from"./row-_c51T55h.js";import{S as K}from"./index-DarObP-C.js";import{S as xe}from"./index-B7yYDv10.js";import{P as nt}from"./index-CfHs6AUn.js";import{R as rt}from"./ClearOutlined-BpODq7I7.js";import{I as st}from"./index-DPigBPWX.js";import{f as ve}from"./dateUtils-gQt2uAjS.js";import{T as ye}from"./index-CJln3zA7.js";import{T as Le,R as at}from"./index-_EG4kaKN.js";const it=new D("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),lt=new D("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),ct=new D("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),dt=new D("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),ut=new D("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),gt=new D("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),mt=e=>{const{componentCls:t,iconCls:s,antCls:r,badgeShadowSize:o,textFontSize:c,textFontSizeSM:d,statusSize:m,dotSize:f,textFontWeight:S,indicatorHeight:p,indicatorHeightSM:i,marginXS:h,calc:y}=e,x=`${r}-scroll-number`,a=we(e,(u,{darkColor:j})=>({[`&${t} ${t}-color-${u}`]:{background:j,[`&:not(${t}-count)`]:{color:j},"a:hover &":{background:j}}}));return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},Oe(e)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,[`${t}-count`]:{display:"inline-flex",justifyContent:"center",zIndex:e.indicatorZIndex,minWidth:p,height:p,color:e.badgeTextColor,fontWeight:S,fontSize:c,lineHeight:z(p),whiteSpace:"nowrap",textAlign:"center",background:e.badgeColor,borderRadius:y(p).div(2).equal(),boxShadow:`0 0 0 ${z(o)} ${e.badgeShadowColor}`,transition:`background ${e.motionDurationMid}`,a:{color:e.badgeTextColor},"a:hover":{color:e.badgeTextColor},"a:hover &":{background:e.badgeColorHover}},[`${t}-count-sm`]:{minWidth:i,height:i,fontSize:d,lineHeight:z(i),borderRadius:y(i).div(2).equal()},[`${t}-multiple-words`]:{padding:`0 ${z(e.paddingXS)}`,bdi:{unicodeBidi:"plaintext"}},[`${t}-dot`]:{zIndex:e.indicatorZIndex,width:f,minWidth:f,height:f,background:e.badgeColor,borderRadius:"100%",boxShadow:`0 0 0 ${z(o)} ${e.badgeShadowColor}`},[`${t}-count, ${t}-dot, ${x}-custom-component`]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",[`&${s}-spin`]:{animationName:gt,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&${t}-status`]:{lineHeight:"inherit",verticalAlign:"baseline",[`${t}-status-dot`]:{position:"relative",top:-1,display:"inline-block",width:m,height:m,verticalAlign:"middle",borderRadius:"50%"},[`${t}-status-success`]:{backgroundColor:e.colorSuccess},[`${t}-status-processing`]:{overflow:"visible",color:e.colorInfo,backgroundColor:e.colorInfo,borderColor:"currentcolor","&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:o,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:it,animationDuration:e.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},[`${t}-status-default`]:{backgroundColor:e.colorTextPlaceholder},[`${t}-status-error`]:{backgroundColor:e.colorError},[`${t}-status-warning`]:{backgroundColor:e.colorWarning},[`${t}-status-text`]:{marginInlineStart:h,color:e.colorText,fontSize:e.fontSize}}}),a),{[`${t}-zoom-appear, ${t}-zoom-enter`]:{animationName:lt,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},[`${t}-zoom-leave`]:{animationName:ct,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},[`&${t}-not-a-wrapper`]:{[`${t}-zoom-appear, ${t}-zoom-enter`]:{animationName:dt,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},[`${t}-zoom-leave`]:{animationName:ut,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},[`&:not(${t}-status)`]:{verticalAlign:"middle"},[`${x}-custom-component, ${t}-count`]:{transform:"none"},[`${x}-custom-component, ${x}`]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[x]:{overflow:"hidden",transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack}`,[`${x}-only`]:{position:"relative",display:"inline-block",height:p,transition:`all ${e.motionDurationSlow} ${e.motionEaseOutBack}`,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",[`> p${x}-only-unit`]:{height:p,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},[`${x}-symbol`]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",[`${t}-count, ${t}-dot, ${x}-custom-component`]:{transform:"translate(-50%, -50%)"}}})}},Ie=e=>{const{fontHeight:t,lineWidth:s,marginXS:r,colorBorderBg:o}=e,c=t,d=s,m=e.colorTextLightSolid,f=e.colorError,S=e.colorErrorHover;return Ue(e,{badgeFontHeight:c,badgeShadowSize:d,badgeTextColor:m,badgeColor:f,badgeColorHover:S,badgeShadowColor:o,badgeProcessingDuration:"1.2s",badgeRibbonOffset:r,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},ze=e=>{const{fontSize:t,lineHeight:s,fontSizeSM:r,lineWidth:o}=e;return{indicatorZIndex:"auto",indicatorHeight:Math.round(t*s)-2*o,indicatorHeightSM:t,dotSize:r/2,textFontSize:r,textFontSizeSM:r,textFontWeight:"normal",statusSize:r/2}},ft=$e("Badge",e=>{const t=Ie(e);return mt(t)},ze),pt=e=>{const{antCls:t,badgeFontHeight:s,marginXS:r,badgeRibbonOffset:o,calc:c}=e,d=`${t}-ribbon`,m=`${t}-ribbon-wrapper`,f=we(e,(S,{darkColor:p})=>({[`&${d}-color-${S}`]:{background:p,color:p}}));return{[m]:{position:"relative"},[d]:Object.assign(Object.assign(Object.assign(Object.assign({},Oe(e)),{position:"absolute",top:r,padding:`0 ${z(e.paddingXS)}`,color:e.colorPrimary,lineHeight:z(s),whiteSpace:"nowrap",backgroundColor:e.colorPrimary,borderRadius:e.borderRadiusSM,[`${d}-text`]:{color:e.badgeTextColor},[`${d}-corner`]:{position:"absolute",top:"100%",width:o,height:o,color:"currentcolor",border:`${z(c(o).div(2).equal())} solid`,transform:e.badgeRibbonCornerTransform,transformOrigin:"top",filter:e.badgeRibbonCornerFilter}}),f),{[`&${d}-placement-end`]:{insetInlineEnd:c(o).mul(-1).equal(),borderEndEndRadius:0,[`${d}-corner`]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},[`&${d}-placement-start`]:{insetInlineStart:c(o).mul(-1).equal(),borderEndStartRadius:0,[`${d}-corner`]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}},bt=$e(["Badge","Ribbon"],e=>{const t=Ie(e);return pt(t)},ze),ht=e=>{const{className:t,prefixCls:s,style:r,color:o,children:c,text:d,placement:m="end",rootClassName:f}=e,{getPrefixCls:S,direction:p}=l.useContext(ce),i=S("ribbon",s),h=`${i}-wrapper`,[y,x,a]=bt(i,h),u=Ne(o,!1),j=I(i,`${i}-placement-${m}`,{[`${i}-rtl`]:p==="rtl",[`${i}-color-${o}`]:u},t),b={},$={};return o&&!u&&(b.background=o,$.color=o),y(l.createElement("div",{className:I(h,f,x,a)},c,l.createElement("div",{className:I(j,x),style:Object.assign(Object.assign({},b),r)},l.createElement("span",{className:`${i}-text`},d),l.createElement("div",{className:`${i}-corner`,style:$}))))},Se=e=>{const{prefixCls:t,value:s,current:r,offset:o=0}=e;let c;return o&&(c={position:"absolute",top:`${o}00%`,left:0}),l.createElement("span",{style:c,className:I(`${t}-only-unit`,{current:r})},s)};function xt(e,t,s){let r=e,o=0;for(;(r+10)%10!==t;)r+=s,o+=s;return o}const vt=e=>{const{prefixCls:t,count:s,value:r}=e,o=Number(r),c=Math.abs(s),[d,m]=l.useState(o),[f,S]=l.useState(c),p=()=>{m(o),S(c)};l.useEffect(()=>{const y=setTimeout(p,1e3);return()=>clearTimeout(y)},[o]);let i,h;if(d===o||Number.isNaN(o)||Number.isNaN(d))i=[l.createElement(Se,Object.assign({},e,{key:o,current:!0}))],h={transition:"none"};else{i=[];const y=o+10,x=[];for(let b=o;b<=y;b+=1)x.push(b);const a=f<c?1:-1,u=x.findIndex(b=>b%10===d);i=(a<0?x.slice(0,u+1):x.slice(u)).map((b,$)=>{const w=b%10;return l.createElement(Se,Object.assign({},e,{key:b,value:w,offset:a<0?$-u:$,current:$===u}))}),h={transform:`translateY(${-xt(d,o,a)}00%)`}}return l.createElement("span",{className:`${t}-only`,style:h,onTransitionEnd:p},i)};var yt=function(e,t){var s={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(s[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(s[r[o]]=e[r[o]]);return s};const St=l.forwardRef((e,t)=>{const{prefixCls:s,count:r,className:o,motionClassName:c,style:d,title:m,show:f,component:S="sup",children:p}=e,i=yt(e,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:h}=l.useContext(ce),y=h("scroll-number",s),x=Object.assign(Object.assign({},i),{"data-show":f,style:d,className:I(y,o,c),title:m});let a=r;if(r&&Number(r)%1===0){const u=String(r).split("");a=l.createElement("bdi",null,u.map((j,b)=>l.createElement(vt,{prefixCls:y,count:Number(r),value:j,key:u.length-b})))}return d?.borderColor&&(x.style=Object.assign(Object.assign({},d),{boxShadow:`0 0 0 1px ${d.borderColor} inset`})),p?Re(p,u=>({className:I(`${y}-custom-component`,u?.className,c)})):l.createElement(S,Object.assign({},x,{ref:t}),a)});var Ct=function(e,t){var s={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(s[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(s[r[o]]=e[r[o]]);return s};const jt=l.forwardRef((e,t)=>{var s,r,o,c,d;const{prefixCls:m,scrollNumberPrefixCls:f,children:S,status:p,text:i,color:h,count:y=null,overflowCount:x=99,dot:a=!1,size:u="default",title:j,offset:b,style:$,className:w,rootClassName:T,classNames:N,styles:O,showZero:B=!1}=e,Z=Ct(e,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:v,direction:M,badge:g}=l.useContext(ce),C=v("badge",m),[q,Be,Ae]=ft(C),J=y>x?`${x}+`:y,k=J==="0"||J===0||i==="0"||i===0,ue=y===null||k&&!B,ee=(p!=null||h!=null)&&ue,Pe=p!=null||!k,W=a&&!k,A=W?"":J,P=l.useMemo(()=>((A==null||A==="")&&(i==null||i==="")||k&&!B)&&!W,[A,k,B,W,i]),ge=l.useRef(y);P||(ge.current=y);const F=ge.current,me=l.useRef(A);P||(me.current=A);const te=me.current,fe=l.useRef(W);P||(fe.current=W);const V=l.useMemo(()=>{if(!b)return Object.assign(Object.assign({},g?.style),$);const R={marginTop:b[1]};return M==="rtl"?R.left=Number.parseInt(b[0],10):R.right=-Number.parseInt(b[0],10),Object.assign(Object.assign(Object.assign({},R),g?.style),$)},[M,b,$,g?.style]),Fe=j??(typeof F=="string"||typeof F=="number"?F:void 0),pe=!P&&(i===0?B:!!i&&i!==!0),De=pe?l.createElement("span",{className:`${C}-status-text`},i):null,Me=!F||typeof F!="object"?void 0:Re(F,R=>({style:Object.assign(Object.assign({},V),R.style)})),G=Ne(h,!1),ke=I(N?.indicator,(s=g?.classNames)===null||s===void 0?void 0:s.indicator,{[`${C}-status-dot`]:ee,[`${C}-status-${p}`]:!!p,[`${C}-color-${h}`]:G}),oe={};h&&!G&&(oe.color=h,oe.background=h);const be=I(C,{[`${C}-status`]:ee,[`${C}-not-a-wrapper`]:!S,[`${C}-rtl`]:M==="rtl"},w,T,g?.className,(r=g?.classNames)===null||r===void 0?void 0:r.root,N?.root,Be,Ae);if(!S&&ee&&(i||Pe||!ue)){const R=V.color;return q(l.createElement("span",Object.assign({},Z,{className:be,style:Object.assign(Object.assign(Object.assign({},O?.root),(o=g?.styles)===null||o===void 0?void 0:o.root),V)}),l.createElement("span",{className:ke,style:Object.assign(Object.assign(Object.assign({},O?.indicator),(c=g?.styles)===null||c===void 0?void 0:c.indicator),oe)}),pe&&l.createElement("span",{style:{color:R},className:`${C}-status-text`},i)))}return q(l.createElement("span",Object.assign({ref:t},Z,{className:be,style:Object.assign(Object.assign({},(d=g?.styles)===null||d===void 0?void 0:d.root),O?.root)}),S,l.createElement(_e,{visible:!P,motionName:`${C}-zoom`,motionAppear:!1,motionDeadline:1e3},({className:R})=>{var ne,re;const We=v("scroll-number",f),se=fe.current,He=I(N?.indicator,(ne=g?.classNames)===null||ne===void 0?void 0:ne.indicator,{[`${C}-dot`]:se,[`${C}-count`]:!se,[`${C}-count-sm`]:u==="small",[`${C}-multiple-words`]:!se&&te&&te.toString().length>1,[`${C}-status-${p}`]:!!p,[`${C}-color-${h}`]:G});let Q=Object.assign(Object.assign(Object.assign({},O?.indicator),(re=g?.styles)===null||re===void 0?void 0:re.indicator),V);return h&&!G&&(Q=Q||{},Q.background=h),l.createElement(St,{prefixCls:We,show:!P,motionClassName:R,className:He,count:te,title:Fe,style:Q,key:"scrollNumber"},Me)}),De))}),X=jt;X.Ribbon=ht;var $t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M859.9 780H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM505.7 669a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V176c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8z"}}]},name:"vertical-align-bottom",theme:"outlined"},wt=function(t,s){return l.createElement(Ze,qe({},t,{ref:s,icon:$t}))},Ot=l.forwardRef(wt);const Ce={async getLogs(e){return(await he.getLogs(e)).data.data},async clearLogs(){await he.clearLogs()}};function Nt(e){const t=Ee(),{handleError:s}=Je(),{data:r,isLoading:o,error:c,refetch:d}=Ve({queryKey:ae.LOGS(e),queryFn:()=>Ce.getLogs(e)}),m=Ye({mutationFn:()=>Ce.clearLogs(),onSuccess:()=>{t.invalidateQueries({queryKey:ae.LOGS()})},onError:f=>s(f)});return{logs:r?.logs??[],total:r?.total??0,page:r?.page??1,limit:r?.limit??20,isLoading:o,error:c,refetch:d,clear:m.mutate,clearAsync:m.mutateAsync,isClearing:m.isPending}}function Rt(e){const t=Ee(),[s,r]=l.useState(null);return l.useEffect(()=>{if(!e)return;const o=tt();r(o);const c=(...d)=>{d[0]?.type==="new"&&t.invalidateQueries({queryKey:ae.LOGS()})};return o.on("logs",c),()=>{o.off("logs",c),ot()}},[e,t]),s}function Et(e,t,s,r){const o=l.useRef(null);l.useEffect(()=>(t&&e&&s.length>0&&(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{const c=r.current?.querySelector(".ant-table-body");c&&(c.scrollTop=c.scrollHeight)},100)),()=>{o.current&&clearTimeout(o.current)}),[s,t,e,r])}function Tt({total:e,error:t,warn:s,info:r}){const{t:o}=_();return n.jsxs(de,{gutter:16,style:{marginBottom:16},children:[n.jsx(L,{span:6,children:n.jsx(U,{children:n.jsx(K,{title:o("logs.totalLogs"),value:e,prefix:n.jsx(Ge,{}),valueStyle:{fontSize:"20px"}})})}),n.jsx(L,{span:6,children:n.jsx(U,{children:n.jsx(K,{title:o("logs.errors"),value:t,prefix:n.jsx(X,{status:"error"}),valueStyle:{color:"#cf1322",fontSize:"20px"}})})}),n.jsx(L,{span:6,children:n.jsx(U,{children:n.jsx(K,{title:o("logs.warnings"),value:s,prefix:n.jsx(X,{status:"warning"}),valueStyle:{color:"#fa8c16",fontSize:"20px"}})})}),n.jsx(L,{span:6,children:n.jsx(U,{children:n.jsx(K,{title:o("logs.info"),value:r,prefix:n.jsx(X,{status:"processing"}),valueStyle:{color:"#1890ff",fontSize:"20px"}})})})]})}function Lt({autoRefresh:e,autoScroll:t,isLoading:s,isClearing:r,hasLogs:o,onAutoRefreshChange:c,onAutoScrollChange:d,onRefresh:m,onScrollToBottom:f,onExport:S,onClear:p}){const{t:i}=_();return n.jsxs(Te,{children:[n.jsx(xe,{checked:e,onChange:c,checkedChildren:i("logs.autoRefresh"),unCheckedChildren:i("logs.manualRefresh")}),e&&n.jsx(xe,{checked:t,onChange:d,checkedChildren:i("logs.autoScroll"),unCheckedChildren:i("logs.manualScroll"),size:"small"}),n.jsx(H,{icon:n.jsx(Qe,{}),onClick:m,loading:s,children:i("logs.refresh")}),n.jsx(ie,{title:i("logs.scrollToBottom"),children:n.jsx(H,{icon:n.jsx(Ot,{}),onClick:f})}),n.jsx(H,{icon:n.jsx(Ke,{}),onClick:S,disabled:!o,children:i("logs.export")}),n.jsx(nt,{title:i("logs.confirmClear"),onConfirm:p,okText:i("common.ok"),cancelText:i("common.cancel"),children:n.jsx(H,{danger:!0,icon:n.jsx(rt,{}),loading:r,children:i("logs.clearLogs")})})]})}const{Search:It}=st,{Option:E}=le;function zt({searchText:e,levelFilter:t,pageSize:s,onSearchChange:r,onSearch:o,onLevelFilterChange:c,onPageSizeChange:d}){const{t:m}=_();return n.jsx(Te,{direction:"vertical",style:{width:"100%"},size:"middle",children:n.jsxs(de,{gutter:16,children:[n.jsx(L,{span:8,children:n.jsx(It,{placeholder:m("logs.searchPlaceholder"),allowClear:!0,enterButton:n.jsx(Xe,{}),value:e,onChange:f=>r(f.target.value),onSearch:o})}),n.jsx(L,{span:6,children:n.jsxs(le,{placeholder:m("logs.filterLevel"),allowClear:!0,style:{width:"100%"},value:t,onChange:c,children:[n.jsx(E,{value:"DEBUG",children:"DEBUG"}),n.jsx(E,{value:"INFO",children:"INFO"}),n.jsx(E,{value:"WARN",children:"WARN"}),n.jsx(E,{value:"ERROR",children:"ERROR"}),n.jsx(E,{value:"FATAL",children:"FATAL"})]})}),n.jsx(L,{span:4,children:n.jsxs(le,{value:s,onChange:d,style:{width:"100%"},children:[n.jsxs(E,{value:50,children:["50 ",m("logs.pageSize")]}),n.jsxs(E,{value:100,children:["100 ",m("logs.pageSize")]}),n.jsxs(E,{value:200,children:["200 ",m("logs.pageSize")]}),n.jsxs(E,{value:500,children:["500 ",m("logs.pageSize")]}),n.jsxs(E,{value:1e3,children:["1000 ",m("logs.pageSize")]})]})})]})})}const{Text:je}=Le;function Bt({entries:e,loading:t,page:s,pageSize:r,total:o,searchText:c,onPageChange:d,onAutoScrollDisable:m}){const{t:f}=_(),S=a=>{switch(a){case"ERROR":case"FATAL":return"red";case"WARN":return"orange";case"INFO":return"blue";case"DEBUG":return"default";default:return"default"}},p=a=>a.replace(/\[\d{4}-\d{2}-\d{2}T[\d:\.]+Z\]/g,"").replace(/\[(DEBUG|INFO|WARN|ERROR|FATAL)\]/gi,"").trim(),i=(a,u)=>!u||!a?a:a.split(new RegExp(`(${u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi")).map((b,$)=>b.toLowerCase()===u.toLowerCase()?n.jsx("mark",{style:{backgroundColor:"#ffd666",padding:"0 2px"},children:b},$):b),h=a=>{if(!a)return"-";try{const u=new Date(a),b=new Date().getTime()-u.getTime(),$=Math.floor(b/6e4),w=Math.floor(b/36e5),T=Math.floor(b/864e5);return $<1?f("logs.justNow"):$<60?`${$} ${f("logs.minutesAgo")}`:w<24?`${w} ${f("logs.hoursAgo")}`:T<7?`${T} ${f("logs.daysAgo")}`:ve(u)}catch{return a}},y=a=>{navigator.clipboard.writeText(a).then(()=>{Y.success(f("logs.copied"))}).catch(()=>{Y.error(f("logs.copyFailed"))})},x=[{title:f("logs.level"),dataIndex:"level",key:"level",width:90,fixed:"left",render:a=>a?n.jsx(ye,{color:S(a),children:a}):n.jsx(ye,{children:"-"})},{title:f("logs.time"),dataIndex:"timestamp",key:"timestamp",width:180,render:a=>{if(!a)return n.jsx(je,{type:"secondary",children:"-"});const u=h(a),j=a?ve(a):"";return n.jsx(ie,{title:j,children:n.jsx(je,{type:"secondary",style:{fontSize:"12px"},children:u})})}},{title:f("logs.content"),dataIndex:"line",key:"line",ellipsis:{showTitle:!1},render:(a,u)=>{const j=p(a);return n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("code",{style:{fontSize:"12px",whiteSpace:"pre-wrap",wordBreak:"break-all",flex:1,fontFamily:'Monaco, Menlo, "Ubuntu Mono", Consolas, "source-code-pro", monospace'},children:c?i(j,c):j}),n.jsx(ie,{title:f("logs.copyLine"),children:n.jsx(H,{type:"text",size:"small",icon:n.jsx(at,{}),onClick:()=>y(u.originalLine),style:{flexShrink:0}})})]})}}];return n.jsxs(n.Fragment,{children:[n.jsx(et,{columns:x,dataSource:e.map((a,u)=>({...a,key:`${s}-${u}-${a.timestamp||u}`})),loading:t,pagination:{current:s,pageSize:r,total:o,showSizeChanger:!1,showTotal:(a,u)=>f("logs.displaying",{start:u[0],end:u[1],total:a}),onChange:a=>{d(a),m()},showQuickJumper:!0},scroll:{y:600,x:"max-content"},size:"small",rowClassName:a=>a.level==="ERROR"||a.level==="FATAL"?"log-row-error":a.level==="WARN"?"log-row-warn":""}),n.jsx("style",{children:`
2
- .log-row-error {
3
- background-color: #fff1f0 !important;
4
- }
5
- .log-row-error:hover {
6
- background-color: #ffe7e5 !important;
7
- }
8
- .log-row-warn {
9
- background-color: #fffbe6 !important;
10
- }
11
- .log-row-warn:hover {
12
- background-color: #fff7d1 !important;
13
- }
14
- .ant-table-tbody > tr > td {
15
- padding: 8px 12px !important;
16
- }
17
- `})]})}const{Title:At}=Le,Pt=e=>{const t=e.match(/\[(DEBUG|INFO|WARN|ERROR|FATAL)\]/i),s=e.match(/\[(\d{4}-\d{2}-\d{2}T[\d:\.]+Z)\]/);return{line:e,originalLine:e,level:t?.[1]?t[1].toUpperCase():void 0,timestamp:s?.[1]||void 0}};function Kt(){const{t:e}=_(),[t,s]=l.useState(1),[r,o]=l.useState(100),[c,d]=l.useState(),[m,f]=l.useState(""),[S,p]=l.useState(!1),[i,h]=l.useState(!0),y=l.useRef(null),{logs:x,total:a,isLoading:u,refetch:j,clear:b,isClearing:$}=Nt({page:t,limit:r,level:c,search:m||void 0});Rt(S);const w=x.map(v=>Pt(v));Et(S,i,w,y);const T={total:a,error:w.filter(v=>v.level==="ERROR"||v.level==="FATAL").length,warn:w.filter(v=>v.level==="WARN").length,info:w.filter(v=>v.level==="INFO").length},N=()=>{const v=w.map(q=>q.originalLine).join(`
18
- `),M=new Blob([v],{type:"text/plain;charset=utf-8"}),g=URL.createObjectURL(M),C=document.createElement("a");C.href=g,C.download=`logs_${new Date().toISOString().replace(/[:.]/g,"-")}.txt`,document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(g),Y.success(e("logs.logsExported"))},O=()=>{const v=y.current?.querySelector(".ant-table-body");v&&(v.scrollTop=v.scrollHeight,Y.success(e("logs.scrolledToBottom")))},B=()=>{s(1),j()},Z=v=>{s(v),h(!1)};return n.jsxs("div",{children:[n.jsxs(de,{justify:"space-between",align:"middle",style:{marginBottom:16},children:[n.jsx(L,{children:n.jsx(At,{level:2,style:{margin:0},children:e("logs.title")})}),n.jsx(L,{children:n.jsx(Lt,{autoRefresh:S,autoScroll:i,isLoading:u,isClearing:$,hasLogs:w.length>0,onAutoRefreshChange:p,onAutoScrollChange:h,onRefresh:()=>j(),onScrollToBottom:O,onExport:N,onClear:()=>b()})})]}),n.jsx(Tt,{total:T.total,error:T.error,warn:T.warn,info:T.info}),n.jsxs(U,{children:[n.jsx(zt,{searchText:m,levelFilter:c,pageSize:r,onSearchChange:v=>{f(v),s(1)},onSearch:B,onLevelFilterChange:v=>{d(v),s(1)},onPageSizeChange:v=>{o(v),s(1)}}),n.jsx("div",{ref:y,children:n.jsx(Bt,{entries:w,loading:u,page:t,pageSize:r,total:a,searchText:m,onPageChange:Z,onAutoScrollDisable:()=>h(!1)})})]})]})}export{Kt as default};
19
- //# sourceMappingURL=index-C2ANILg9.js.map