1import{i as e,w as t,a as n,K as o,h as r,L as c,l as a}from"./@[email protected]_r_39d8c4b197f541c8c42d43536a2b7ff2.BzDRMfiV.js";import{c as s}from"./[email protected]";import{a as i,e as l}from"./[email protected]";import{C as u}from"./@[email protected]__5cb28bd61bb270bbfeae2def527d6530.CFuVoC_I.js";import{P as m}from"./@[email protected]__b821f7c07cf0b85c056a8c917cc4f2e8.DGWmWosI.js";import"./[email protected]_q3uNA6.js";import"./[email protected][email protected]";const f=i.createContext(null);function d(){return{width:document.documentElement.clientWidth,height:window.innerHeight||document.documentElement.clientHeight}}const p={x:0,y:0,rotate:0,scale:1,flipX:!1,flipY:!1};function h(e,t,n,o){const r=t+n,c=(n-o)/2;if(n>o){if(t>0)return{[e]:c};if(t<0&&r<o)return{[e]:-c}}else if(t<0||r>o)return{[e]:t<0?c:-c};return{}}function g(e,t,n,o){const{width:r,height:c}=d();let a=null;return e<=r&&t<=c?a={x:0,y:0}:(e>r||t>c)&&(a={...h("x",n,e,r),...h("y",o,t,c)}),a}function v({src:e,isCustomPlaceholder:t,fallback:n}){const[o,r]=i.useState(t?"loading":"normal"),c=i.useRef(!1),a="error"===o;i.useEffect(()=>{let t=!0;return function(e){return new Promise(t=>{if(!e)return void t(!1);const n=document.createElement("img");n.onerror=()=>t(!1),n.onload=()=>t(!0),n.src=e})}(e).then(e=>{!e&&t&&r("error")}),()=>{t=!1}},[e]),i.useEffect(()=>{t&&!c.current?r("loading"):a&&r("normal")},[e]);const s=()=>{r("normal")};return[e=>{c.current=!1,"loading"===o&&(null==e?void 0:e.complete)&&(e.naturalWidth||e.naturalHeight)&&(c.current=!0,s())},a&&n?{src:n}:{onLoad:s,src:e},o]}function y(e,t){const n=e.x-t.x,o=e.y-t.y;return Math.hypot(n,o)}function b(e,t,n,o,r,c,a){const{rotate:s,scale:l,x:u,y:m}=r,[f,d]=i.useState(!1),p=i.useRef({point1:{x:0,y:0},point2:{x:0,y:0},eventType:"none"}),h=e=>{p.current={...p.current,...e}};return i.useEffect(()=>{const e=e=>{e.preventDefault()};return n&&t&&window.addEventListener("touchmove",e,{passive:!1}),()=>{window.removeEventListener("touchmove",e)}},[n,t]),{isTouching:f,onTouchStart:e=>{if(!t)return;e.stopPropagation(),d(!0);const{touches:n=[]}=e;n.length>1?h({point1:{x:n[0].clientX,y:n[0].clientY},point2:{x:n[1].clientX,y:n[1].clientY},eventType:"touchZoom"}):h({point1:{x:n[0].clientX-u,y:n[0].clientY-m},eventType:"move"})},onTouchMove:e=>{const{touches:t=[]}=e,{point1:n,point2:o,eventType:r}=p.current;if(t.length>1&&"touchZoom"===r){const e={x:t[0].clientX,y:t[0].clientY},r={x:t[1].clientX,y:t[1].clientY},[c,s]=function(e,t,n,o){const r=y(e,n),c=y(t,o);if(0===r&&0===c)return[e.x,e.y];const a=r/(r+c);return[e.x+a*(t.x-e.x),e.y+a*(t.y-e.y)]}(n,o,e,r),i=y(e,r)/y(n,o);a(i,"touchZoom",c,s,!0),h({point1:e,point2:r,eventType:"touchZoom"})}else"move"===r&&(c({x:t[0].clientX-n.x,y:t[0].clientY-n.y},"move"),h({eventType:"move"}))},onTouchEnd:()=>{if(!n)return;if(f&&d(!1),h({eventType:"none"}),o>l)return c({x:0,y:0,scale:o},"touchZoom");const t=e.current.offsetWidth*l,r=e.current.offsetHeight*l,{left:a,top:i}=e.current.getBoundingClientRect(),u=s%180!=0,m=g(u?r:t,u?t:r,a,i);m&&c({...m},"dragRebound")}}}function w(e){const{prefixCls:t,icon:n,onClick:o,className:r,style:c}=e;return i.createElement("button",{className:s("".concat(t,"-close"),r),style:c,onClick:o},n)}function C(e){const{prefixCls:t,showProgress:n,current:o,count:r,showSwitch:c,classNames:a,styles:l,icons:u,image:m,transform:f,countRender:d,actionsRender:p,scale:h,minScale:g,maxScale:v,onActive:y,onFlipY:b,onFlipX:w,onRotateLeft:C,onRotateRight:x,onZoomOut:E,onZoomIn:k,onClose:R,onReset:N}=e,{left:Y,right:I,prev:P,next:T,flipY:X,flipX:O,rotateLeft:S,rotateRight:L,zoomOut:j,zoomIn:M}=u,Z=n&&i.createElement("div",{className:"".concat(t,"-progress")},d?d(o+1,r):i.createElement("bdi",null,"".concat(o+1," / ").concat(r))),z="".concat(t,"-actions-action"),D=({type:e,disabled:t,onClick:n,icon:o})=>i.createElement("button",{type:"button",key:e,className:s(z,"".concat(z,"-").concat(e),{["".concat(z,"-disabled")]:!!t}),onClick:n,disabled:!!t,"aria-label":e},o),_=c?D({icon:null!=P?P:Y,onClick:()=>y(-1),type:"prev",disabled:0===o}):void 0,F=c?D({icon:null!=T?T:I,onClick:()=>y(1),type:"next",disabled:o===r-1}):void 0,W=D({icon:X,onClick:b,type:"flipY"}),H=D({icon:O,onClick:w,type:"flipX"}),A=D({icon:S,onClick:C,type:"rotateLeft"}),B=D({icon:L,onClick:x,type:"rotateRight"}),K=D({icon:j,onClick:E,type:"zoomOut",disabled:h<=g}),G=D({icon:M,onClick:k,type:"zoomIn",disabled:h===v}),U=i.createElement("div",{className:s("".concat(t,"-actions"),a.actions),style:l.actions},W,H,A,B,K,G);return i.createElement("div",{className:s("".concat(t,"-footer"),a.footer),style:l.footer},Z,p?p(U,{icons:{prevIcon:_,nextIcon:F,flipYIcon:W,flipXIcon:H,rotateLeftIcon:A,rotateRightIcon:B,zoomOutIcon:K,zoomInIcon:G},actions:{onActive:y,onFlipY:b,onFlipX:w,onRotateLeft:C,onRotateRight:x,onZoomOut:E,onZoomIn:k,onReset:N,onClose:R},transform:f,current:o,total:r,image:m}):U)}function x(e){const{prefixCls:t,onActive:n,current:o,count:r,icons:{left:c,right:a,prev:l,next:u}}=e,m="".concat(t,"-switch"),f=0===o,d=o===r-1;return i.createElement(i.Fragment,null,i.createElement("button",{className:s(m,"".concat(m,"-prev"),{["".concat(m,"-disabled")]:f}),onClick:()=>n(-1),disabled:f},null!=l?l:c),i.createElement("button",{type:"button",className:s(m,"".concat(m,"-next"),{["".concat(m,"-disabled")]:d}),onClick:()=>n(1),disabled:d},null!=u?u:a))}function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},E.apply(this,arguments)}const k=({fallback:e,src:t,imgRef:n,...o})=>{const[r,c]=v({src:t,fallback:e});return l.createElement("img",E({ref:e=>{n.current=e,r(e)}},o,c))},R=a=>{const{prefixCls:h,rootClassName:v,src:y,alt:R,imageInfo:N,fallback:Y,movable:I=!0,onClose:P,open:T,afterOpenChange:X,maskClosable:O=!0,icons:S={},closeIcon:L,getContainer:j,current:M=0,count:Z=1,countRender:z,scaleStep:D=.5,minScale:_=1,maxScale:F=50,motionName:W="fade",imageRender:H,imgCommonProps:A,actionsRender:B,onTransform:K,onChange:G,classNames:U={},styles:V={},mousePosition:q,zIndex:J,focusTrap:Q=!0}=a,$=i.useRef(),ee=i.useRef(null),te=i.useRef(null),ne=i.useContext(f),oe=ne&&Z>1,re=ne&&Z>=1,[ce,ae]=i.useState(!0),{transform:se,resetTransform:ie,updateTransform:le,dispatchZoomChange:ue}=function(n,o,r,c){const a=i.useRef(null),s=i.useRef([]),[l,u]=i.useState(p),m=(e,n
1)=>{null===a.current&&(s.current=[],a.current=t(()=>{u(e=>{let t=e;return s.current.forEach(e=>{t={...t,...e}}),a.current=null,null==c||c({transform:t,action:n}),t})})),s.current.push({...l,...e})};return{transform:l,resetTransform:t=>{u(p),e(p,l)||null==c||c({transform:p,action:t})},updateTransform:m,dispatchZoomChange:(e,t,c,a,s)=>{const{width:i,height:u,offsetWidth:f,offsetHeight:p,offsetLeft:h,offsetTop:g}=n.current;let v=e,y=l.scale*e;y>r?(y=r,v=r/l.scale):y<o&&(y=s?y:o,v=y/l.scale);const b=null!=c?c:innerWidth/2,w=null!=a?a:innerHeight/2,C=v-1,x=C*i*.5,E=C*u*.5,k=C*(b-l.x-h),R=C*(w-l.y-g);let N=l.x-(k-x),Y=l.y-(R-E);if(e<1&&1===y){const e=f*y,t=p*y,{width:n,height:o}=d();e<=n&&t<=o&&(N=0,Y=0)}m({x:N,y:Y,scale:y},t)}}}($,_,F,K),{isMoving:me,onMouseDown:fe,onWheel:de}=function(e,t,n,o,r,c,a){const{rotate:s,scale:l,x:u,y:m}=r,[f,d]=i.useState(!1),p=i.useRef({diffX:0,diffY:0,transformX:0,transformY:0}),h=e=>{n&&f&&c({x:e.pageX-p.current.diffX,y:e.pageY-p.current.diffY},"move")},v=()=>{if(n&&f){d(!1);const{transformX:t,transformY:n}=p.current;if(u===t||m===n)return;const o=e.current.offsetWidth*l,r=e.current.offsetHeight*l,{left:a,top:i}=e.current.getBoundingClientRect(),f=s%180!=0,h=g(f?r:o,f?o:r,a,i);h&&c({...h},"dragRebound")}};return i.useEffect(()=>{if(t){window.addEventListener("mouseup",v,!1),window.addEventListener("mousemove",h,!1);try{window.top!==window.self&&(window.top.addEventListener("mouseup",v,!1),window.top.addEventListener("mousemove",h,!1))}catch(e){}}return()=>{var t,n;window.removeEventListener("mouseup",v),window.removeEventListener("mousemove",h);try{null==(t=window.top)||t.removeEventListener("mouseup",v),null==(n=window.top)||n.removeEventListener("mousemove",h)}catch(e){}}},[n,f,u,m,s,t]),{isMoving:f,onMouseDown:e=>{t&&0===e.button&&(e.preventDefault(),e.stopPropagation(),p.current={diffX:e.pageX-u,diffY:e.pageY-m,transformX:u,transformY:m},d(!0))},onMouseMove:h,onMouseUp:v,onWheel:e=>{if(!n||0==e.deltaY)return;const t=Math.abs(e.deltaY/100);let r=1+Math.min(t,1)*o;e.deltaY>0&&(r=1/r),a(r,"wheel",e.clientX,e.clientY)}}}($,I,T,D,se,le,ue),{isTouching:pe,onTouchStart:he,onTouchMove:ge,onTouchEnd:ve}=b($,I,T,_,se,le,ue),{rotate:ye,scale:be}=se;i.useEffect(()=>{ce||ae(!0)},[ce]),i.useEffect(()=>{T||ie("close")},[T]);const we=l.createElement(k,E({},A,{width:a.width,height:a.height,imgRef:$,className:"".concat(h,"-img"),alt:R,style:{transform:"translate3d(".concat(se.x,"px, ").concat(se.y,"px, 0) scale3d(").concat(se.flipX?"-":"").concat(be,", ").concat(se.flipY?"-":"").concat(be,", 1) rotate(").concat(ye,"deg)"),transitionDuration:(!ce||pe)&&"0s"},fallback:Y,src:y,onWheel:de,onMouseDown:fe,onDoubleClick:e=>{T&&(1!==be?le({x:0,y:0,scale:1},"doubleClick"):ue(1+D,"doubleClick",e.clientX,e.clientY))},onTouchStart:he,onTouchMove:ge,onTouchEnd:ve,onTouchCancel:ve})),Ce={url:y,alt:R,...N},xe=()=>{ue(1+D,"zoomIn")},Ee=()=>{ue(1/(1+D),"zoomOut")},ke=()=>{le({rotate:ye+90},"rotateRight")},Re=()=>{le({rotate:ye-90},"rotateLeft")},Ne=()=>{le({flipX:!se.flipX},"flipX")},Ye=()=>{le({flipY:!se.flipY},"flipY")},Ie=()=>{ie("reset")},Pe=e=>{const t=M+e;t>=0&&t<=Z-1&&(ae(!1),ie(e<0?"prev":"next"),null==G||G(t,M))},Te=n(e=>{if(T){const{keyCode:t}=e;oe&&(t===o.LEFT?Pe(-1):t===o.RIGHT&&Pe(1))}});i.useEffect(()=>{if(T)return window.addEventListener("keydown",Te),()=>{window.removeEventListener("keydown",Te)}},[T]);const[Xe,Oe]=i.useState(!1);l.useEffect(()=>{T&&Oe(!0)},[T]);const[Se,Le]=i.useState(!1);r(()=>{T&&Le(!0)},[T]);r(()=>{T&&(te.current=document.activeElement)},[T]),c(Q&&T&&Se,()=>ee.current);const je={...V.body};return q&&(je.transformOrigin="".concat(q.x,"px ").concat(q.y,"px")),l.createElement(m,{open:Se&&T,autoDestroy:!1,getContainer:j,autoLock:Xe,onEsc:({top:e})=>{e&&(null==P||P())}},l.createElement(u,{motionName:W,visible:Se&&T,motionAppear:!0,motionEnter:!0,motionLeave:!0,onVisibleChanged:e=>{var t,n;e||(Oe(!1),null==(n=null==(t=te.current)?void 0:t.focus)||n.call(t),te.current=null),null==X||X(e)}},({className:e,style:t})=>{const n={...V.root,...t};return J&&(n.zIndex=J),l.createElement("div",{ref:ee,className:s(h,v,U.root,e,{["".concat(h,"-movable")]:I,["".concat(h,"-moving")]:me}),style:n,role:"dialog","aria-modal":"true","aria-label":R,tabIndex:-1},l.createElement("div",{className:s("".concat(h,"-mask"),U.mask),style:V.mask,onClick:O?P:void 0}),l.createElement("div",{className:s("".concat(h,"-body"),U.body),style:je},H?H(we,{transform:se,image:Ce,...ne?{current:M}:{}}):we),!1!==L&&null!==L&&l.createElement(w,{prefixCls:h,icon:!0===L?S.close:L||S.close,onClick:P,className:U.close,style:V.close}),oe&&l.createElement(x,{prefixCls:h,current:M,count:Z,icons:S,onActive:Pe}),l.createElement(C,{prefixCls:h,showProgress:re,current:M,count:Z,showSwitch:oe,classNames:U,styles:V,image:Ce,transform:se,icons:S,countRender:z,actionsRender:B,scale:be,minScale:_,maxScale:F,onActive:Pe,onFlipY:Ye,onFlipX:Ne,onRotateLeft:Re,onRotateRight:ke,onZoomOut:Ee,onZoomIn:xe,onClose:P,onReset:Ie}))}))},N=["crossOrigin","decoding","draggable","loading","referrerPolicy","sizes","srcSet","useMap","alt","fetchPriority"];function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Y.apply(this,arguments)}let I=0;function P(){return P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},P.apply(this,arguments)}const T=e=>{var t;const{prefixCls:n="rc-image",previewPrefixCls:o="".concat(n,"-preview"),rootClassName:r,className:c,style:l,classNames:u={},styles:m={},width:d,height:p,src:h,alt:g,placeholder:y,fallback:b,preview:w=!0,onClick:C,onError:x,onKeyDown:E,...k}=e,Y=i.useContext(f),T=!!w,{src:X,open:O,onOpenChange:S,cover:L,rootClassName:j,...M}=w&&"object"==typeof w?w:{},Z="object"==typeof L&&L.placement&&L.placement||"center",z="object"==typeof L&&L.coverNode?L.coverNode:L,[D,_]=a(!!O,O),[F,W]=i.useState(null),H=e=>{_(e),null==S||S(e)},A=y&&!0!==y,B=null!=X?X:h,[K,G,U]=v({src:h,isCustomPlaceholder:A,fallback:b}),V=i.useMemo(()=>{const t={};
1return N.forEach(n=>{void 0!==e[n]&&(t[n]=e[n])}),t},N.map(t=>e[t])),q=i.useMemo(()=>({...V,src:B}),[B,V]),J=function(e,t){const[n]=i.useState(()=>(I+=1,String(I))),o=i.useContext(f),r={data:t,canPreview:e};return i.useEffect(()=>{if(o)return o.register(n,r)},[]),i.useEffect(()=>{o&&o.register(n,r)},[e,t]),n}(T,q);return i.createElement(i.Fragment,null,i.createElement("div",P({},k,{className:s(n,r,u.root,{["".concat(n,"-error")]:"error"===U}),onClick:T?e=>{const t=e.target.getBoundingClientRect(),n=t.x+t.width/2,o=t.y+t.height/2;Y?Y.onPreview(J,B,n,o):(W({x:n,y:o}),H(!0)),null==C||C(e)}:C,role:T?"button":k.role,tabIndex:T&&null==k.tabIndex?0:k.tabIndex,"aria-label":T?null!=(t=k["aria-label"])?t:g:k["aria-label"],onKeyDown:e=>{if(null==E||E(e),T&&("Enter"===e.key||" "===e.key)){e.preventDefault();const t=e.target.getBoundingClientRect(),n=t.x+t.width/2,o=t.y+t.height/2;Y?Y.onPreview(J,B,n,o):(W({x:n,y:o}),H(!0))}},style:{width:d,height:p,...m.root}}),i.createElement("img",P({},V,{className:s("".concat(n,"-img"),{["".concat(n,"-img-placeholder")]:!0===y},u.image,c),style:{height:p,...m.image,...l},ref:K},G,{width:d,height:p,onError:x})),"loading"===U&&i.createElement("div",{"aria-hidden":"true",className:"".concat(n,"-placeholder")},y),!1!==L&&T&&i.createElement("div",{className:s("".concat(n,"-cover"),u.cover,"".concat(n,"-cover-").concat(Z)),style:{display:"none"===(null==l?void 0:l.display)?"none":void 0,...m.cover}},z)),!Y&&T&&i.createElement(R,P({"aria-hidden":!D,open:D,prefixCls:o,onClose:()=>{H(!1)},mousePosition:F,src:B,alt:g,imageInfo:{width:d,height:p},fallback:b,imgCommonProps:V},M,{classNames:null==u?void 0:u.popup,styles:null==m?void 0:m.popup,rootClassName:s(j,r)})))};T.PreviewGroup=({previewPrefixCls:e="rc-image-preview",classNames:t,styles:o,children:r,icons:c={},items:s,preview:l,fallback:u})=>{var m;const{open:d,onOpenChange:p,current:h,onChange:g,...v}=l&&"object"==typeof l?l:{},[y,b,w]=function(e){const[t,n]=i.useState({}),o=i.useCallback((e,t)=>(n(n=>({...n,[e]:t})),()=>{n(t=>{const n={...t};return delete n[e],n})}),[]);return[i.useMemo(()=>e?e.map(e=>{if("string"==typeof e)return{data:{src:e}};const t={};return Object.keys(e).forEach(n=>{["src",...N].includes(n)&&(t[n]=e[n])}),{data:t}}):Object.keys(t).reduce((e,n)=>{const{canPreview:o,data:r}=t[n];return o&&e.push({data:r,id:n}),e},[]),[e,t]),o,!!e]}(s),[C,x]=a(0,h),[E,k]=i.useState(!1),{src:I,...P}=(null==(m=y[C])?void 0:m.data)||{},[T,X]=a(!!d,d),O=n(e=>{X(e),e!==T&&(null==p||p(e,{current:C}))}),[S,L]=i.useState(null),j=i.useCallback((e,t,n,o)=>{const r=w?y.findIndex(e=>e.data.src===t):y.findIndex(t=>t.id===e);x(r<0?0:r),O(!0),L({x:n,y:o}),k(!0)},[y,w]);i.useEffect(()=>{T?E||x(0):k(!1)},[T]);const M=i.useMemo(()=>({register:b,onPreview:j}),[b,j]);return i.createElement(f.Provider,{value:M},r,i.createElement(R,Y({"aria-hidden":!T,open:T,prefixCls:e,onClose:()=>{O(!1),L(null)},mousePosition:S,imgCommonProps:P,src:I,fallback:u,icons:c,current:C,count:y.length,onChange:(e,t)=>
1{x(e),null==g||g(e,t)}},v,{classNames:null==t?void 0:t.popup,styles:null==o?void 0:o.popup})))};export{T as I};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.