PageSourceSearch

https://www.upcar.ai/_next/static/chunks/88533-95308c964b5b47da.js

js upcar.ai collected 2026-10-05 15:27:35 UTC 11,090 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[88533],{88533:function(e,t,n){n.d(t,{Z:function(){return C}});var r=n(7653),i=n(80931),l=n(93282);let o={minZoom:1,maxZoomPixelRatio:1,zoomInMultiplier:2,doubleTapDelay:300,doubleClickDelay:500,doubleClickMaxStops:2,keyboardMoveDistance:50,wheelZoomDistanceFactor:100,pinchZoomDistanceFactor:100,pinchZoomV4:!1,scrollToZoom:!1};function a(e){let{minZoom:t,...n}={...o,...e};return{minZoom:Math.min(Math.max(t,Number.EPSILON),1),...n}}function u(){let{zoom:e}=(0,i.RD)();return a(e)}function c(e,t){return Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)}function h(e,t,n=100,r=2){return e*Math.min(1+Math.abs(t/n),r)**Math.sign(t)}let d=r.createContext(null),s=(0,i.Fy)("useZoom","ZoomControllerContext",d);function m({children:e}){let[t,n]=r.useState(),{slideRect:o}=(0,i.bc)(),{ref:a,minZoom:s}=u(),{imageRect:m,maxZoom:f}=function(e,t){var n,r;let l={width:0,height:0},o={width:0,height:0},{currentSlide:a}=(0,i.oc)(),{imageFit:c}=(0,i.RD)().carousel,{maxZoomPixelRatio:h}=u();if(e&&a){let u={...a,...t};if((0,i.QB)(u)){let t=(0,i.VI)(u,c),a=Math.max(...((null===(n=u.srcSet)||void 0===n?void 0:n.map(e=>e.width))||[]).concat(u.width?[u.width]:[])),d=Math.max(...((null===(r=u.srcSet)||void 0===r?void 0:r.map(e=>e.height))||[]).concat(u.height?[u.height]:[]));a>0&&d>0&&e.width>0&&e.height>0&&(o={width:(o=t?{width:Math.round(Math.min(a,e.width/e.height*d)),height:Math.round(Math.min(d,e.height/e.width*a))}:{width:a,height:d}).width*h,height:o.height*h},l=t?{width:Math.min(e.width,o.width,a),height:Math.min(e.height,o.height,d)}:{width:Math.round(Math.min(e.width,e.height/d*a,a)),height:Math.round(Math.min(e.height,e.width/a*d,d))})}}let d=l.width?Math.max((0,i.NM)(o.width/l.width,5),1):1;return{imageRect:l,maxZoom:d}}(o,null==t?void 0:t.imageDimensions),{zoom:v,offsetX:g,offsetY:p,disabled:w,changeZoom:b,changeOffsets:M,zoomIn:E,zoomOut:C}=function(e,t,n){let[l,o]=r.useState(1),[a,c]=r.useState(0),[h,d]=r.useState(0),s=function(e,t,n,l){let o=r.useRef(void 0),a=r.useRef(void 0),{zoom:u}=(0,i.RD)().animation,c=(0,i.OL)(),h=(0,i.$0)(()=>{var r,i,h;if(null===(r=o.current)||void 0===r||r.cancel(),o.current=void 0,a.current&&(null==l?void 0:l.current)){try{o.current=null===(h=(i=l.current).animate)||void 0===h?void 0:h.call(i,[{transform:a.current},{transform:`scale(${e}) translateX(${t}px) translateY(${n}px)`}],{duration:c?0:null!=u?u:500,easing:o.current?"ease-out":"ease-in-out"})}catch(e){console.error(e)}a.current=void 0,o.current&&(o.current.onfinish=()=>{o.current=void 0})}});return(0,i.bt)(h,[e,t,n,h]),r.useCallback(()=>{a.current=(null==l?void 0:l.current)?window.getComputedStyle(l.current).transform:void 0},[l])}(l,a,h,n),{currentSlide:m,globalIndex:f}=(0,i.oc)(),{containerRect:v,slideRect:g}=(0,i.bc)(),{minZoom:p,zoomInMultiplier:w}=u(),b=m&&(0,i.QB)(m)?m.src:void 0,M=!b||!(null==n?void 0:n.current);(0,i.bt)(()=>{o(1),c(0),d(0)},[f,b]);let E=r.useCallback((t,n,r)=>{let i=r||l,o=a-(t||0),u=h-(n||0),s=(e.width*i-g.width)/2/i,m=(e.height*i-g.height)/2/i;c(Math.min(Math.abs(o),Math.max(s,0))*Math.sign(o)),d(Math.min(Math.abs(u),Math.max(m,0))*Math.sign(u))},[l,a,h,g,e.width,e.height]),C=r.useCallback((e,n,r,a)=>{let u=(0,i.NM)(e+.01<t?e-.01>p?e:p:t,5);n||s(),E(r?r*(1/l-1/u):0,a?a*(1/l-1/u):0,u),o(u)},[l,p,t,E,s]),k=(0,i.$0)(()=>{l>1&&(l>t&&C(t,!0),E())});(0,i.bt)(k,[v.width,v.height,k]);let x=r.useCallback(()=>{let e=l*w;C(l<1&&e>1?1:e)},[l,w,C]),R=r.useCallback(()=>{let e=l/w;C(l>1&&e<1?1:e)},[l,w,C]);return{zoom:l,offsetX:a,offsetY:h,disabled:M,changeOffsets:E,changeZoom:C,zoomIn:x,zoomOut:R}}(m,f,null==t?void 0:t.zoomWrapperRef);!function(e,t){let{on:n}=(0,i.RD)(),l=(0,i.$0)(()=>{var r;t||null===(r=n.zoom)||void 0===r||r.call(n,{zoom:e})});r.useEffect(l,[e,l])}(v,w),function(e,t,n,o,a,d,s,m,f){let v=r.useRef([]),g=r.useRef(0),p=r.useRef(void 0),{globalIndex:w}=(0,i.oc)(),{getOwnerWindow:b}=(0,i.tS)(),{containerRef:M,subscribeSensors:E}=(0,i.bc)(),{keyboardMoveDistance:C,zoomInMultiplier:k,wheelZoomDistanceFactor:x,scrollToZoom:R,doubleTapDelay:Z,doubleClickDelay:y,doubleClickMaxStops:D,pinchZoomDistanceFactor:S,pinchZoomV4:I}=u(),z=r.useCallback(e=>{if(M.current){let{pageX:t,pageY:n}=e,{scrollX:r,scrollY:i}=b(),{left:l,top:o,width:a,height:u}=M.current.getBoundingClientRect();return[t-l-r-a/2,n-o-i-u/2]}return[]},[M,b]),$=(0,i.$0)(t=>{let{key:n,metaKey:r,ctrlKey:i}=t,l=r||i,o=()=>{t.preventDefault(),t.stopPropagation()};if(e>1){let e=(e,t)=>
1{o(),m(e,t)};"ArrowDown"===n?e(0,C):"ArrowUp"===n?e(0,-C):"ArrowLeft"===n?e(-C,0):"ArrowRight"===n&&e(C,0)}"+"===n||l&&"="===n?(o(),a()):"-"===n||l&&"_"===n?(o(),d()):l&&"0"===n&&(o(),s(1))}),P=(0,i.$0)(t=>{if((t.ctrlKey||R)&&Math.abs(t.deltaY)>Math.abs(t.deltaX)){t.stopPropagation(),s(h(e,-t.deltaY,x),!0,...z(t));return}e>1&&(t.stopPropagation(),R||m(t.deltaX,t.deltaY))}),F=r.useCallback(e=>{let t=v.current;t.splice(0,t.length,...t.filter(t=>t.pointerId!==e.pointerId))},[]),N=r.useCallback(e=>{F(e),e.persist(),v.current.push(e)},[F]),L=(0,i.$0)(r=>{var i;let l=v.current;if("mouse"===r.pointerType&&r.buttons>1||!(null===(i=null==f?void 0:f.current)||void 0===i?void 0:i.contains(r.target)))return;e>1&&r.stopPropagation();let{timeStamp:o}=r;if(0===l.length&&o-g.current<("touch"===r.pointerType?Z:y)?(g.current=0,s(e>=1?e!==n?e*Math.max(n**(1/D),k):1:e!==t?e/Math.max(t**(-1/D),k):1,!1,...z(r))):g.current=o,N(r),2===l.length){let t=c(l[0],l[1]);p.current={previousDistance:t,initialDistance:Math.max(t,1),initialZoom:e}}}),Y=(0,i.$0)(t=>{let n=v.current,r=n.find(e=>e.pointerId===t.pointerId);if(2===n.length&&p.current){t.stopPropagation(),N(t);let r=c(n[0],n[1]);s(I?p.current.initialZoom/p.current.initialDistance*r:h(e,r-p.current.previousDistance,S),!0,...n.map(e=>z(e)).reduce((e,t)=>t.map((t,n)=>e[n]+t/2))),p.current.previousDistance=r;return}e>1&&(t.stopPropagation(),r&&(1===n.length&&m((r.clientX-t.clientX)/e,(r.clientY-t.clientY)/e),N(t)))}),X=r.useCallback(e=>{let t=v.current;2===t.length&&t.find(t=>t.pointerId===e.pointerId)&&(p.current=void 0),F(e)},[F]),B=r.useCallback(()=>{let e=v.current;e.splice(0,e.length),g.current=0,p.current=void 0},[]);(0,i.bQ)(E,L,Y,X,o),r.useEffect(B,[w,B]),r.useEffect(()=>o?()=>{}:(0,i.Eq)(B,E(l.ds,$),E(l.yq,P)),[o,E,B,$,P])}(v,s,f,w,E,C,b,M,null==t?void 0:t.zoomWrapperRef);let k=r.useMemo(()=>({zoom:v,minZoom:s,maxZoom:f,offsetX:g,offsetY:p,disabled:w,zoomIn:E,zoomOut:C,changeZoom:b}),[v,s,f,g,p,w,E,C,b]);r.useImperativeHandle(a,()=>k,[k]);let x=r.useMemo(()=>({...k,setZoomWrapper:n}),[k,n]);return r.createElement(d.Provider,{value:x},e)}let f=(0,i.U2)("ZoomIn",r.createElement(r.Fragment,null,r.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),r.createElement("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"}))),v=(0,i.U2)("ZoomOut",r.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})),g=r.forwardRef(function({zoomIn:e,onLoseFocus:t},n){let l=r.useRef(!1),o=r.useRef(!1),{zoom:a,minZoom:u,maxZoom:c,zoomIn:h,zoomOut:d,disabled:m}=s(),{render:g}=(0,i.RD)(),p=m||(e?a>=c:a<=u);return r.useEffect(()=>{p&&l.current&&o.current&&t(),p||(l.current=!0)},[p,t]),r.createElement(i.hU,{ref:n,disabled:p,label:e?"Zoom in":"Zoom out",icon:e?f:v,renderIcon:e?g.iconZoomIn:g.iconZoomOut,onClick:e?h:d,onFocus:()=>{o.current=!0},onBlur:()=>{o.current=!1}})});function p(){let e=r.useRef(null),t=r.useRef(null),{focus:n}=(0,i.bc)(),l=r.useCallback(e=>{var t,r;(null===(t=e.current)||void 0===t?void 0:t.disabled)?n():null===(r=e.current)||void 0===r||r.focus()},[n]),o=r.useCallback(()=>l(e),[l]),a=r.useCallback(()=>l(t),[l]);return r.createElement(r.Fragment,null,r.createElement(g,{zoomIn:!0,ref:e,onLoseFocus:a}),r.createElement(g,{ref:t,onLoseFocus:o}))}function w(){let{render:e}=(0,i.RD)(),t=s();
1return e.buttonZoom?r.createElement(r.Fragment,null,e.buttonZoom(t)):r.createElement(p,null)}function b({current:e,preload:t},{type:n,source:r}){switch(n){case"fetch":if(!e)return{current:r};return{current:e,preload:r};case"done":if(r===t)return{current:r};return{current:e,preload:t};default:throw Error(l.c3)}}function M(e){var t,n;let[{current:l,preload:o},a]=r.useReducer(b,{}),{slide:u,rect:c,imageFit:h,render:d,interactive:s}=e,m=u.srcSet.sort((e,t)=>e.width-t.width),f=null!==(t=u.width)&&void 0!==t?t:m[m.length-1].width,v=null!==(n=u.height)&&void 0!==n?n:m[m.length-1].height,g=(0,i.VI)(u,h),p=Math.max(...m.map(e=>e.width)),w=Math.min((g?Math.max:Math.min)(c.width,c.height/v*f),p),M=(0,i.KL)(),E=(0,i.$0)(()=>{var e;let t=null!==(e=m.find(e=>e.width>=w*M))&&void 0!==e?e:m[m.length-1];(!l||m.findIndex(e=>e.src===l)<m.findIndex(e=>e===t))&&a({type:"fetch",source:t.src})});(0,i.bt)(E,[c.width,c.height,M,E]);let C=(0,i.$0)(e=>a({type:"done",source:e})),k={WebkitTransform:s?"initial":"translateZ(0)"};return g||Object.assign(k,c.width/c.height<f/v?{width:"100%",height:"auto"}:{width:"auto",height:"100%"}),r.createElement(r.Fragment,null,o&&o!==l&&r.createElement(i.P0,{key:"preload",...e,offset:void 0,slide:{...u,src:o,srcSet:void 0},style:{position:"absolute",visibility:"hidden",...k},onLoad:()=>C(o),render:{...d,iconLoading:()=>null,iconError:()=>null}}),l&&r.createElement(i.P0,{key:"current",...e,slide:{...u,src:l,srcSet:void 0},style:k}))}function E({render:e,slide:t,offset:n,rect:o}){var a,u;let[c,h]=r.useState(),d=r.useRef(null),{zoom:m,maxZoom:f,offsetX:v,offsetY:g,setZoomWrapper:p}=s(),w=m>1,{carousel:b,on:E}=(0,i.RD)(),{currentIndex:C}=(0,i.oc)();(0,i.bt)(()=>0===n?(p({zoomWrapperRef:d,imageDimensions:c}),()=>p(void 0)):()=>{},[n,c,p]);let k=null===(a=e.slide)||void 0===a?void 0:a.call(e,{slide:t,offset:n,rect:o,zoom:m,maxZoom:f});if(!k&&(0,i.QB)(t)){let l={slide:t,offset:n,rect:o,render:e,imageFit:b.imageFit,imageProps:b.imageProps,onClick:0===n?()=>{var e;return null===(e=E.click)||void 0===e?void 0:e.call(E,{index:C})}:void 0};k=((null===(u=t.srcSet)||void 0===u?void 0:u.length)||0)>0?r.createElement(M,{...l,slide:t,interactive:w,rect:0===n?{width:o.width*m,height:o.height*m}:o}):r.createElement(i.P0,{onLoad:e=>h({width:e.naturalWidth,height:e.naturalHeight}),...l})}return k?r.createElement("div",{ref:d,className:(0,i.Wy)((0,i.Nc)(l.yS),(0,i.Nc)(l.aN),(0,i.Nc)(l.af),w&&(0,i.Nc)(l.ZZ)),style:0===n?{transform:`scale(${m}) translateX(${v}px) translateY(${g}px)`}:void 0},k):null}let C=({augment:e,addModule:t})=>{e(({zoom:e,toolbar:t,render:n,controller:o,...u})=>{let c=a(e);return{zoom:c,toolbar:(0,i.wQ)(t,l.xc,r.createElement(w,null)),render:{...n,slide:e=>{var t;return(0,i.QB)(e.slide)?r.createElement(E,{render:n,...e}):null===(t=n.slide)||void 0===t?void 0:t.call(n,e)}},controller:{...o,preventDefaultWheelY:c.scrollToZoom},...u}}),t((0,i.l6)(l.xc,m))}}}]);

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.