PageSourceSearch

https://vehicars.com/assets/ui-forms-Csj1jrcw.js

js vehicars.com collected 2026-10-09 22:03:59 UTC 11,439 bytes, 1 lines download raw bytes

1import{r as d}from"./react-vendor-uGzgjzEW.js";import{f as M,a as $,j as m,b as F,P as R,h as k,p as U,e as ye,u as Pe,q as ke}from"./ui-core-BMY9F9vW.js";import{u as X,c as Q}from"./ui-select-D1VYNzR8.js";var Y="Switch",[Re]=F(Y),[Ee,De]=Re(Y),Z=d.forwardRef((e,n)=>{const{__scopeSwitch:t,name:o,checked:r,defaultChecked:a,required:s,disabled:i,value:u="on",onCheckedChange:b,form:h,...c}=e,[l,x]=d.useState(null),w=M(n,g=>x(g)),S=d.useRef(!1),v=l?h||!!l.closest("form"):!0,[f=!1,y]=$({prop:r,defaultProp:a,onChange:b});return m.jsxs(Ee,{scope:t,checked:f,disabled:i,children:[m.jsx(R.button,{type:"button",role:"switch","aria-checked":f,"aria-required":s,"data-state":ne(f),"data-disabled":i?"":void 0,disabled:i,value:u,...c,ref:w,onClick:k(e.onClick,g=>{y(p=>!p),v&&(S.current=g.isPropagationStopped(),S.current||g.stopPropagation())})}),v&&m.jsx(_e,{control:l,bubbles:!S.current,name:o,value:u,checked:f,required:s,disabled:i,form:h,style:{transform:"translateX(-100%)"}})]})});Z.displayName=Y;var ee="SwitchThumb",te=d.forwardRef((e,n)=>{const{__scopeSwitch:t,...o}=e,r=De(ee,t);return m.jsx(R.span,{"data-state":ne(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:n})});te.displayName=ee;var _e=e=>{const{control:n,checked:t,bubbles:o=!0,...r}=e,a=d.useRef(null),s=X(t),i=U(n);return d.useEffect(()=>{const u=a.current,b=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(b,"checked").set;if(s!==t&&c){const l=new Event("click",{bubbles:o});c.call(u,t),u.dispatchEvent(l)}},[s,t,o]),m.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...r,tabIndex:-1,ref:a,style:{...e.style,...i,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function ne(e){return e?"checked":"unchecked"}var Ze=Z,et=te,Me="Label",oe=d.forwardRef((e,n)=>m.jsx(R.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));oe.displayName=Me;var tt=oe,re=["PageUp","PageDown"],se=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ae={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},j="Slider",[O,Ie,je]=ye(j),[ie]=F(j,[je]),[Te,K]=ie(j),ce=d.forwardRef((e,n)=>{const{name:t,min:o=0,max:r=100,step:a=1,orientation:s="horizontal",disabled:i=!1,minStepsBetweenThumbs:u=0,defaultValue:b=[o],value:h,onValueChange:c=()=>{},onValueCommit:l=()=>{},inverted:x=!1,form:w,...S}=e,v=d.useRef(new Set),f=d.useRef(0),g=s==="horizontal"?Ae:Ke,[p=[],P]=$({prop:h,defaultProp:b,onChange:C=>{[...v.current][f.current]?.focus(),c(C)}}),B=d.useRef(p);function N(C){const D=Oe(p,C);T(C,D)}function we(C){T(C,f.current)}function Ce(){const C=B.current[f.current];p[f.current]!==C&&l(p)}function T(C,D,{commit:V}={commit:!1}){const G=Fe(a),H=Ue(Math.round((C-o)/a)*a+o,G),A=Q(H,[o,r]);P((I=[])=>{const _=Ve(I,A,D);if($e(_,u*a)){f.current=_.indexOf(A);const J=String(_)!==String(I);return J&&V&&l(_),J?_:I}else return I})}return m.jsx(Te,{scope:e.__scopeSlider,name:t,disabled:i,min:o,max:r,valueIndexToChangeRef:f,thumbs:v.current,values:p,orientation:s,form:w,children:m.jsx(O.Provider,{scope:e.__scopeSlider,children:m.jsx(O.Slot,{scope:e.__scopeSlider,children:m.jsx(g,{"aria-disabled":i,"data-disabled":i?"":void 0,...S,ref:n,onPointerDown:k(S.onPointerDown,()=>{i||(B.current=p)}),min:o,max:r,inverted:x,onSlideStart:i?void 0:N,onSlideMove:i?void 0:we,onSlideEnd:i?void 0:Ce,onHomeKeyDown:()=>!i&&T(o,0,{commit:!0}),onEndKeyDown:()=>!i&&T(r,p.length-1,{commit:!0}),onStepKeyDown:({event:C,direction:D})=>{if(!i){const H=re.includes(C.key)||C.shiftKey&&se.includes(C.key)?10:1,A=f.current,I=p[A],_=a*H*D;T(I+_,A,{commit:!0})}}})})})})});ce.displayName=j;var[de,le]=ie(j,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Ae=d.forwardRef((e,n)=>{const{min:t,max:o,dir:r,inverted:a,onSlideStart:s,onSlideMove:i,onSlideEnd:u,onStepKeyDown:b,...h}=e,[c,l]=d.useState(null),x=M(n,g=>l(g)),w=d.useRef(),S=Pe(r),v=S==="ltr",f=v&&!a||!v&&a;function y(g){const p=w.current||c.getBoundingClientRect(),P=[0,p.width],N=q(P,f?[t,o]:[o,t]);return w.current=p,N(g-p.left)}return m.jsx(de,{scope:e.__scopeSlider,startEdge:f?"left":"right",endEdge:f?"right":"left",direction:f?1:-1,size:"width",children:m.jsx(ue,{dir:S,"data-orientation":"horizontal",...h,ref:x,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:g=>{const p=y(g.clientX);s?.(p)},onSlideMove:g=>{const p=y(g.clientX);i?.(p)},onSlideEnd:()=>{w.current=void 0,u?.()},onStepKeyDown:g=>{const P=ae[f?"from-left":"from-right"].includes(g.key);b?.({event:g,direction:P?-1:1})}})})}
1),Ke=d.forwardRef((e,n)=>{const{min:t,max:o,inverted:r,onSlideStart:a,onSlideMove:s,onSlideEnd:i,onStepKeyDown:u,...b}=e,h=d.useRef(null),c=M(n,h),l=d.useRef(),x=!r;function w(S){const v=l.current||h.current.getBoundingClientRect(),f=[0,v.height],g=q(f,x?[o,t]:[t,o]);return l.current=v,g(S-v.top)}return m.jsx(de,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:m.jsx(ue,{"data-orientation":"vertical",...b,ref:c,style:{...b.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:S=>{const v=w(S.clientY);a?.(v)},onSlideMove:S=>{const v=w(S.clientY);s?.(v)},onSlideEnd:()=>{l.current=void 0,i?.()},onStepKeyDown:S=>{const f=ae[x?"from-bottom":"from-top"].includes(S.key);u?.({event:S,direction:f?-1:1})}})})}),ue=d.forwardRef((e,n)=>{const{__scopeSlider:t,onSlideStart:o,onSlideMove:r,onSlideEnd:a,onHomeKeyDown:s,onEndKeyDown:i,onStepKeyDown:u,...b}=e,h=K(j,t);return m.jsx(R.span,{...b,ref:n,onKeyDown:k(e.onKeyDown,c=>{c.key==="Home"?(s(c),c.preventDefault()):c.key==="End"?(i(c),c.preventDefault()):re.concat(se).includes(c.key)&&(u(c),c.preventDefault())}),onPointerDown:k(e.onPointerDown,c=>{const l=c.target;l.setPointerCapture(c.pointerId),c.preventDefault(),h.thumbs.has(l)?l.focus():o(c)}),onPointerMove:k(e.onPointerMove,c=>{c.target.hasPointerCapture(c.pointerId)&&r(c)}),onPointerUp:k(e.onPointerUp,c=>{const l=c.target;l.hasPointerCapture(c.pointerId)&&(l.releasePointerCapture(c.pointerId),a(c))})})}),fe="SliderTrack",pe=d.forwardRef((e,n)=>{const{__scopeSlider:t,...o}=e,r=K(fe,t);return m.jsx(R.span,{"data-disabled":r.disabled?"":void 0,"data-orientation":r.orientation,...o,ref:n})});pe.displayName=fe;var z="SliderRange",me=d.forwardRef((e,n)=>{const{__scopeSlider:t,...o}=e,r=K(z,t),a=le(z,t),s=d.useRef(null),i=M(n,s),u=r.values.length,b=r.values.map(l=>Se(l,r.min,r.max)),h=u>1?Math.min(...b):0,c=100-Math.max(...b);return m.jsx(R.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...o,ref:i,style:{...e.style,[a.startEdge]:h+"%",[a.endEdge]:c+"%"}})});me.displayName=z;var L="SliderThumb",he=d.forwardRef((e,n)=>{const t=Ie(e.__scopeSlider),[o,r]=d.useState(null),a=M(n,i=>r(i)),s=d.useMemo(()=>o?t().findIndex(i=>i.ref.current===o):-1,[t,o]);return m.jsx(Be,{...e,ref:a,index:s})}
1),Be=d.forwardRef((e,n)=>{const{__scopeSlider:t,index:o,name:r,...a}=e,s=K(L,t),i=le(L,t),[u,b]=d.useState(null),h=M(n,y=>b(y)),c=u?s.form||!!u.closest("form"):!0,l=U(u),x=s.values[o],w=x===void 0?0:Se(x,s.min,s.max),S=He(o,s.values.length),v=l?.[i.size],f=v?ze(v,w,i.direction):0;return d.useEffect(()=>{if(u)return s.thumbs.add(u),()=>{s.thumbs.delete(u)}},[u,s.thumbs]),m.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[i.startEdge]:`calc(${w}% + ${f}px)`},children:[m.jsx(O.ItemSlot,{scope:e.__scopeSlider,children:m.jsx(R.span,{role:"slider","aria-label":e["aria-label"]||S,"aria-valuemin":s.min,"aria-valuenow":x,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...a,ref:h,style:x===void 0?{display:"none"}:e.style,onFocus:k(e.onFocus,()=>{s.valueIndexToChangeRef.current=o})})}),c&&m.jsx(Ne,{name:r??(s.name?s.name+(s.values.length>1?"[]":""):void 0),form:s.form,value:x},o)]})});he.displayName=L;var Ne=e=>{const{value:n,...t}=e,o=d.useRef(null),r=X(n);return d.useEffect(()=>{const a=o.current,s=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(s,"value").set;if(r!==n&&u){const b=new Event("input",{bubbles:!0});u.call(a,n),a.dispatchEvent(b)}},[r,n]),m.jsx("input",{style:{display:"none"},...t,ref:o,defaultValue:n})};function Ve(e=[],n,t){const o=[...e];return o[t]=n,o.sort((r,a)=>r-a)}function Se(e,n,t){const a=100/(t-n)*(e-n);return Q(a,[0,100])}function He(e,n){return n>2?`Value ${e+1} of ${n}`:n===2?["Minimum","Maximum"][e]:void 0}function Oe(e,n){if(e.length===1)return 0;const t=e.map(r=>Math.abs(r-n)),o=Math.min(...t);return t.indexOf(o)}function ze(e,n,t){const o=e/2,a=q([0,50],[0,o]);return(o-a(n)*t)*t}function Le(e){return e.slice(0,-1).map((n,t)=>e[t+1]-n)}function $e(e,n){if(n>0){const t=Le(e);return Math.min(...t)>=n}return!0}function q(e,n){return t=>{if(e[0]===e[1]||n[0]===n[1])return n[0];const o=(n[1]-n[0])/(e[1]-e[0]);return n[0]+o*(t-e[0])}}function Fe(e){return(String(e).split(".")[1]||"").length}function Ue(e,n){const t=Math.pow(10,n);return Math.round(e*t)/t}var nt=ce,ot=pe,rt=me,st=he,W="Checkbox",[Xe]=F(W),[Ye,qe]=Xe(W),be=d.forwardRef((e,n)=>{const{__scopeCheckbox:t,name:o,checked:r,defaultChecked:a,required:s,disabled:i,value:u="on",onCheckedChange:b,form:h,...c}=e,[l,x]=d.useState(null),w=M(n,p=>x(p)),S=d.useRef(!1),v=l?h||!!l.closest("form"):!0,[f=!1,y]=$({prop:r,defaultProp:a,onChange:b}),g=d.useRef(f);return d.useEffect(()=>{const p=l?.form;if(p){const P=()=>y(g.current);return p.addEventListener("reset",P),()=>p.removeEventListener("reset",P)}},[l,y]),m.jsxs(Ye,{scope:t,state:f,disabled:i,children:[m.jsx(R.button,{type:"button",role:"checkbox","aria-checked":E(f)?"mixed":f,"aria-required":s,"data-state":ge(f),"data-disabled":i?"":void 0,disabled:i,value:u,...c,ref:w,onKeyDown:k(e.onKeyDown,p=>{p.key==="Enter"&&p.preventDefault()}),onClick:k(e.onClick,p=>{y(P=>E(P)?!0:!P),v&&(S.current=p.isPropagationStopped(),S.current||p.stopPropagation())})}),v&&m.jsx(We,{control:l,bubbles:!S.current,name:o,value:u,checked:f,required:s,disabled:i,form:h,style:{transform:"translateX(-100%)"},defaultChecked:E(a)?!1:a})]})});be.displayName=W;var ve="CheckboxIndicator",xe=d.forwardRef((e,n)=>{const{__scopeCheckbox:t,forceMount:o,...r}=e,a=qe(ve,t);return m.jsx(ke,{present:o||E(a.state)||a.state===!0,children:m.jsx(R.span,{"data-state":ge(a.state),"data-disabled":a.disabled?"":void 0,...r,ref:n,style:{pointerEvents:"none",...e.style}})})});xe.displayName=ve;var We=e=>{const{control:n,checked:t,bubbles:o=!0,defaultChecked:r,...a}=e,s=d.useRef(null),i=X(t),u=U(n);d.useEffect(()=>{const h=s.current,c=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(c,"checked").set;if(i!==t&&x){const w=new Event("click",{bubbles:o});h.indeterminate=E(t),x.call(h,E(t)?!1:t),h.dispatchEvent(w)}},[i,t,o]);const b=d.useRef(E(t)?!1:t);return m.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r??b.current,...a,tabIndex:-1,ref:s,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function E(e){return e==="indeterminate"}function ge(e){return E(e)?"indeterminate":e?"checked":"unchecked"}var at=be,it=xe;export{it as I,Ze as R,et as T,tt as a,nt as b,ot as c,rt as d,st as e,at as f};

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.