PageSourceSearch

https://techd.com/assets/ClientsLab-jQrXlRZI.js

js techd.com collected 2026-10-03 20:39:11 UTC 13,954 bytes, 3 lines download raw bytes

1import{r as f,j as o}from"./r3f-D-tv2vky.js";import{G as ge,f as pe,o as xe,i as E,h as D,H as be,P as T,V as ve,W as Z,e as Se,Y as ye,Z as K,$ as j,a as we,S as je,B as W,a0 as H}from"./index-HvJXWkF5.js";import{u as Ce}from"./index-DMgv3_j6.js";import"./three-CrRbY0Rh.js";var q=["PageUp","PageDown"],J=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Q={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},_="Slider",[z,ke,Ne]=ge(_),[ee,Ge]=pe(_,[Ne]),[Re,L]=ee(_),te=f.forwardRef((e,t)=>{const{name:s,min:n=0,max:l=100,step:u=1,orientation:r="horizontal",disabled:c=!1,minStepsBetweenThumbs:m=0,defaultValue:a=[n],value:d,onValueChange:i=()=>{},onValueCommit:h=()=>{},inverted:v=!1,form:w,...b}=e,p=f.useRef(new Set),g=f.useRef(0),S=r==="horizontal"?Pe:Ee,[x=[],$]=xe({prop:d,defaultProp:a,onChange:y=>{var R;(R=[...p.current][g.current])==null||R.focus(),i(y)}}),V=f.useRef(x);function A(y){const C=Ie(x,y);M(y,C)}function fe(y){M(y,g.current)}function he(){const y=V.current[g.current];x[g.current]!==y&&h(x)}function M(y,C,{commit:R}={commit:!1}){const Y=Ve(u),B=Ae(Math.round((y-n)/u)*u+n,Y),I=Z(B,[n,l]);$((P=[])=>{const k=$e(P,I,C);if(Le(k,m*u)){g.current=k.indexOf(I);const G=String(k)!==String(P);return G&&R&&h(k),G?k:P}else return P})}return o.jsx(Re,{scope:e.__scopeSlider,name:s,disabled:c,min:n,max:l,valueIndexToChangeRef:g,thumbs:p.current,values:x,orientation:r,form:w,children:o.jsx(z.Provider,{scope:e.__scopeSlider,children:o.jsx(z.Slot,{scope:e.__scopeSlider,children:o.jsx(S,{"aria-disabled":c,"data-disabled":c?"":void 0,...b,ref:t,onPointerDown:E(b.onPointerDown,()=>{c||(V.current=x)}),min:n,max:l,inverted:v,onSlideStart:c?void 0:A,onSlideMove:c?void 0:fe,onSlideEnd:c?void 0:he,onHomeKeyDown:()=>!c&&M(n,0,{commit:!0}),onEndKeyDown:()=>!c&&M(l,x.length-1,{commit:!0}),onStepKeyDown:({event:y,direction:C})=>{if(!c){const B=q.includes(y.key)||y.shiftKey&&J.includes(y.key)?10:1,I=g.current,P=x[I],k=u*B*C;M(P+k,I,{commit:!0})}}})})})})});te.displayName=_;var[ne,oe]=ee(_,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Pe=f.forwardRef((e,t)=>{const{min:s,max:n,dir:l,inverted:u,onSlideStart:r,onSlideMove:c,onSlideEnd:m,onStepKeyDown:a,...d}=e,[i,h]=f.useState(null),v=D(t,S=>h(S)),w=f.useRef(void 0),b=be(l),p=b==="ltr",g=p&&!u||!p&&u;function N(S){const x=w.current||i.getBoundingClientRect(),$=[0,x.width],A=F($,g?[s,n]:[n,s]);return w.current=x,A(S-x.left)}return o.jsx(ne,{scope:e.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width",children:o.jsx(re,{dir:b,"data-orientation":"horizontal",...d,ref:v,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:S=>{const x=N(S.clientX);r==null||r(x)},onSlideMove:S=>{const x=N(S.clientX);c==null||c(x)},onSlideEnd:()=>{w.current=void 0,m==null||m()},onStepKeyDown:S=>{const $=Q[g?"from-left":"from-right"].includes(S.key);a==null||a({event:S,direction:$?-1:1})}})})}),Ee=f.forwardRef((e,t)=>{const{min:s,max:n,inverted:l,onSlideStart:u,onSlideMove:r,onSlideEnd:c,onStepKeyDown:m,...a}=e,d=f.useRef(null),i=D(t,d),h=f.useRef(void 0),v=!l;function w(b){const p=h.current||d.current.getBoundingClientRect(),g=[0,p.height],S=F(g,v?[n,s]:[s,n]);return h.current=p,S(b-p.top)}return o.jsx(ne,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:o.jsx(re,{"data-orientation":"vertical",...a,ref:i,style:{...a.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const p=w(b.clientY);u==null||u(p)},onSlideMove:b=>{const p=w(b.clientY);r==null||r(p)},onSlideEnd:()=>{h.current=void 0,c==null||c()},onStepKeyDown:b=>{const g=Q[v?"from-bottom":"from-top"].includes(b.key);m==null||m({event:b,direction:g?-1:1})}})})}),re=f.forwardRef((e,t)=>{const{__scopeSlider:s,onSlideStart:n,onSlideMove:l,onSlideEnd:u,onHomeKeyDown:r,onEndKeyDown:c,onStepKeyDown:m,...a}=e,d=L(_,s);return o.jsx(T.span,{...a,ref:t,onKeyDown:E(e.onKeyDown,i=>{i.key==="Home"?(r(i),i.preventDefault()):i.key==="End"?(c(i),i.preventDefault()):q.concat(J).includes(i.key)&&(m(i),i.preventDefault())}),onPointerDown:E(e.onPointerDown,i=>{const h=i.target;h.setPointerCapture(i.pointerId),i.preventDefault(),d.thumbs.has(h)?h.focus():n(i)}),onPointerMove:E(e.onPointerMove,i=>{i.target.hasPointerCapture(i.pointerId)&&l(i)}),onPointerUp:E(e.onPointerUp,i=>{const h=i.target;h.hasPointerCapture(i.pointerId)&&(h.releasePointerCapture(i.pointerId),u(i))})})}),se="SliderTrack",ae=f.forwardRef((e,t)=>
1{const{__scopeSlider:s,...n}=e,l=L(se,s);return o.jsx(T.span,{"data-disabled":l.disabled?"":void 0,"data-orientation":l.orientation,...n,ref:t})});ae.displayName=se;var O="SliderRange",ie=f.forwardRef((e,t)=>{const{__scopeSlider:s,...n}=e,l=L(O,s),u=oe(O,s),r=f.useRef(null),c=D(t,r),m=l.values.length,a=l.values.map(h=>de(h,l.min,l.max)),d=m>1?Math.min(...a):0,i=100-Math.max(...a);return o.jsx(T.span,{"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,...n,ref:c,style:{...e.style,[u.startEdge]:d+"%",[u.endEdge]:i+"%"}})});ie.displayName=O;var U="SliderThumb",ce=f.forwardRef((e,t)=>{const s=ke(e.__scopeSlider),[n,l]=f.useState(null),u=D(t,c=>l(c)),r=f.useMemo(()=>n?s().findIndex(c=>c.ref.current===n):-1,[s,n]);return o.jsx(De,{...e,ref:u,index:r})}),De=f.forwardRef((e,t)=>{const{__scopeSlider:s,index:n,name:l,...u}=e,r=L(U,s),c=oe(U,s),[m,a]=f.useState(null),d=D(t,N=>a(N)),i=m?r.form||!!m.closest("form"):!0,h=ve(m),v=r.values[n],w=v===void 0?0:de(v,r.min,r.max),b=Me(n,r.values.length),p=h==null?void 0:h[c.size],g=p?Te(p,w,c.direction):0;return f.useEffect(()=>{if(m)return r.thumbs.add(m),()=>{r.thumbs.delete(m)}},[m,r.thumbs]),o.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${w}% + ${g}px)`},children:[o.jsx(z.ItemSlot,{scope:e.__scopeSlider,children:o.jsx(T.span,{role:"slider","aria-label":e["aria-label"]||b,"aria-valuemin":r.min,"aria-valuenow":v,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...u,ref:d,style:v===void 0?{display:"none"}:e.style,onFocus:E(e.onFocus,()=>{r.valueIndexToChangeRef.current=n})})}),i&&o.jsx(le,{name:l??(r.name?r.name+(r.values.length>1?"[]":""):void 0),form:r.form,value:v},n)]})});ce.displayName=U;var _e="RadioBubbleInput",le=f.forwardRef(({__scopeSlider:e,value:t,...s},n)=>{const l=f.useRef(null),u=D(l,n),r=Ce(t);return f.useEffect(()=>{const c=l.current;if(!c)return;const m=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(m,"value").set;if(r!==t&&d){const i=new Event("input",{bubbles:!0});d.call(c,t),c.dispatchEvent(i)}},[r,t]),o.jsx(T.input,{style:{display:"none"},...s,ref:u,defaultValue:t})});le.displayName=_e;function $e(e=[],t,s){const n=[...e];return n[s]=t,n.sort((l,u)=>l-u)}function de(e,t,s){const u=100/(s-t)*(e-t);return Z(u,[0,100])}function Me(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Ie(e,t){if(e.length===1)return 0;const s=e.map(l=>Math.abs(l-t)),n=Math.min(...s);return s.indexOf(n)}function Te(e,t,s){const n=e/2,u=F([0,50],[0,n]);return(n-u(t)*s)*s}function He(e){return e.slice(0,-1).map((t,s)=>e[s+1]-t)}function Le(e,t){if(t>0){const s=He(e);return Math.min(...s)>=t}return!0}function F(e,t){return s=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(s-e[0])}}function Ve(e){return(String(e).split(".")[1]||"").length}function Ae(e,t){const s=Math.pow(10,t);return Math.round(e*s)/s}var ue=te,Be=ae,Ke=ie,ze=ce;const me=f.forwardRef(({className:e,...t},s)=>o.jsxs(ue,{ref:s,className:Se("relative flex w-full touch-none select-none items-center",e),...t,children:[o.jsx(Be,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:o.jsx(Ke,{className:"absolute h-full bg-primary"})}),o.jsx(ze,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));me.displayName=ue.displayName;const X=({client:e,height:t,onHeightChange:s,variant:n="light"})=>{const l=K.indexOf(t),u=ye(t),r=n==="dark",c=e.currentLogo?`/${e.currentLogo.replace(/^\//,"")}`:void 0,m=e.currentLogoDark?`/${e.currentLogoDark.replace(/^\//,"")}`:void 0,a=r?m??c:c,d=r&&!m&&!!c;return o.jsxs("div",{className:`flex flex-col rounded-lg border p-5 ${r?"border-muted-foreground/30 bg-secondary":"border-border bg-card"}`,children:[o.jsx("div",{className:`flex h-32 items-center justify-center rounded border border-dashed ${r?"border-muted-foreground
1/40 bg-secondary":"border-border bg-background"}`,children:e.placeholder||!a?o.jsx("div",{className:`${u} flex items-center justify-center rounded border border-dashed px-4 text-center text-[10px] font-bold uppercase tracking-wider transition-all duration-300 ${r?"border-background/40 bg-background/10 text-background":"border-muted-foreground bg-muted/40 text-muted-foreground"}`,children:e.name}):o.jsx("img",{src:a,alt:e.name,className:`${u} w-auto object-contain transition-all duration-300 opacity-70 hover:scale-105 hover:opacity-100 ${r?d?"invert brightness-0":"":"grayscale hover:grayscale-0"}`})}),o.jsxs("div",{className:"mt-4 min-h-[2.5rem]",children:[o.jsx("p",{className:`text-sm font-bold leading-tight ${r?"text-background":"text-foreground"}`,children:e.name}),o.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:`mt-1 inline-block text-[11px] font-light hover:text-primary truncate max-w-full ${r?"text-background/70":"text-muted-foreground"}`,children:[e.url.replace(/^https?:\/\//,"")," ↗"]}),e.placeholder&&o.jsx("p",{className:"mt-1 text-[10px] font-bold uppercase tracking-wider text-primary",children:"Placeholder — needs logo file"})]}),o.jsxs("div",{className:"mt-3",children:[o.jsx(me,{value:[l],min:0,max:K.length-1,step:1,onValueChange:i=>s(K[i[0]])}),o.jsxs("div",{className:`mt-2 flex items-center justify-between font-mono text-[11px] ${r?"text-background/70":"text-muted-foreground"}`,children:[o.jsx("span",{children:"h-6"}),o.jsx("span",{className:`rounded px-2 py-0.5 ${r?"bg-background/10 text-background":"bg-muted text-foreground"}`,children:u}),o.jsx("span",{children:"h-20"})]})]})]})},We=()=>{const[e,t]=f.useState(()=>Object.fromEntries(j.map(a=>[a.name,a.defaultHeight]))),s=(a,d)=>t(i=>({...i,[a]:d})),n=f.useMemo(()=>j.filter(a=>e[a.name]!==a.defaultHeight),[e]),l=f.useMemo(()=>{if(n.length===0)return"// No sizes changed yet. Move a slider to generate an instruction.";const a=[`Lovable: update defaultHeight in src/sections/clients-lab/clients-lab-data.ts for these ${n.length} client${n.length===1?"":"s"} (lab is the source of truth — do NOT touch site.ts):`,""];for(const d of n)a.push(`- ${d.name}: ${e[d.name]}`);return a.join(`
2`)},[n,e]),u=f.useMemo(()=>{const a=[`Current sizes for all ${j.length} clients in /clients-lab:`,""];for(const d of j)a.push(`- ${d.name}: ${e[d.name]}`);return a.join(`
3`)},[e]),r=async a=>{try{return await navigator.clipboard.writeText(a),!0}catch{try{const d=document.createElement("textarea");d.value=a,d.style.position="fixed",d.style.opacity="0",document.body.appendChild(d),d.focus(),d.select();const i=document.execCommand("copy");return document.body.removeChild(d),i}catch{return!1}}},c=async()=>{await r(l)?H({title:"Copied to clipboard",description:`${n.length} changed entr${n.length===1?"y":"ies"} ready to paste`}):(H({title:"Copy failed",description:"Open this page in a new tab to copy, or check console for the snippet.",variant:"destructive"}),console.log(l))},m=async()=>{await r(u)?H({title:"Copied to clipboard",description:`Current sizes for all ${j.length} clients`}):(H({title:"Copy failed",description:"Open this page in a new tab to copy, or check console for the snippet.",variant:"destructive"}),console.log(u))};return o.jsxs(we,{children:[o.jsx(je,{title:"Clients Lab — Internal",description:"Internal logo sizing tool. Not for public viewing.",noindex:!0}),o.jsx("section",{className:"bg-background py-12 md:py-16",children:o.jsxs("div",{className:"container mx-auto max-w-7xl px-4",children:[o.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-end md:justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-foreground",children:"Clients Lab"}),o.jsxs("p",{className:"mt-2 max-w-2xl text-sm text-muted-foreground font-light",children:["TechD's ",j.length," clients — source of truth for the home strip and every industry carousel."]})]}),o.jsxs("div",{className:"flex flex-wrap gap-2 shrink-0",children:[o.jsx(W,{onClick:m,variant:"outline",children:"Copy current sizes"}),o.jsxs(W,{onClick:c,className:"btn-glow",disabled:n.length===0,children:["Copy changed sizes (",n.length,")"]})]})]}),o.jsx("p",{className:"mt-10 text-xs font-bold uppercase tracking-[0.22em] text-muted-foreground",children:"Light"}),o.jsx("div",{className:"mt-4 grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:j.map(a=>
3o.jsx(X,{client:a,height:e[a.name],onHeightChange:d=>s(a.name,d),variant:"light"},`light-${a.name}`))})]})}),o.jsx("section",{className:"bg-secondary py-12 md:py-16",children:o.jsxs("div",{className:"container mx-auto max-w-7xl px-4",children:[o.jsx("p",{className:"text-xs font-bold uppercase tracking-[0.22em] text-background/70",children:"Dark"}),o.jsx("div",{className:"mt-4 grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:j.map(a=>o.jsx(X,{client:a,height:e[a.name],onHeightChange:d=>s(a.name,d),variant:"dark"},`dark-${a.name}`))})]})})]})};export{We as default};

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.