(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[76998],{42282:(e,s,t)=>{"use strict";t.d(s,{Z:()=>a});var n=t(79477),r=t(74631),o=t(87740);let u=e=>e instanceof MouseEvent,a=function(e){let{buffer:s=0,throttleBy:t=18,excludeTouchEvents:a,onEnterBox:l,onLeaveBox:c}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},p=(0,o.Z)(e),[i,d]=n.useState({x:null,y:null}),v=n.useRef(!1),m=n.useRef(l),h=n.useRef(c);return m.current=l,h.current=c,n.useEffect(()=>{let e=m.current,n=h.current,o=t=>{u(t)&&(t.preventDefault(),t.stopPropagation());let{clientX:r,clientY:o}=t;if(!p)return;if(!(r>=p.left-s&&r<=p.left+p.width+s&&o>=p.top-s&&o<=p.top+p.height+s)){v.current&&"function"==typeof n&&n(),v.current=!1;return}v.current||("function"==typeof e&&e(),v.current=!0);let a={x:r-p.left,y:o-p.top};v.current=!0,d(a)},[l,c]=(0,r.Ep)(o,t),[i,w]=(0,r.Ep)(e=>{o(e.touches[0])},t);return window.addEventListener("mousemove",l),a||window.addEventListener("touchmove",i),()=>{window.removeEventListener("mousemove",l),c(),a||(window.removeEventListener("touchmove",i),w())}},[p,s,t,a]),[i,p]}},76998:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>A});var n=t(67841),r=t(79477),o=t(64833),u=t(74631),a=t(42282);let l=e=>{let{r:s,g:t,b:n}=e;return"rgb(".concat(s," ").concat(t," ").concat(n,")")},c=e=>"linear-gradient(90deg, ".concat(e.join(", "),")"),p=(0,o.z)("div")({name:"Wrapper",class:"wlcwux6",propsAsIs:!1}),i=(0,o.z)("div")({name:"TopRow",class:"t19h02b3",propsAsIs:!1}),d=(0,o.z)("label")({name:"Label",class:"lpuat1a",propsAsIs:!1}),v=(0,o.z)("div")({name:"Value",class:"vzytuuw",propsAsIs:!1}),m=(0,o.z)("button")({name:"SliderButton",class:"shx7s09",propsAsIs:!1}),h=(0,o.z)("span")({name:"HandleWrapper",class:"hx5nmpm",propsAsIs:!1}),w=(0,o.z)("span")({name:"Handle",class:"h1wyvrrv",propsAsIs:!1}),f=function(e){let{label:s,color:t,channel:o,value:f,dynamicGradients:x,onChange:b}=e,y=r.useRef(),j=r.useId(),[E,g]=(0,a.Z)(y,{buffer:128}),[k,z]=r.useState(!1);r.useEffect(()=>{if(!k||"number"!=typeof E.x||"number"!=typeof E.y||!g)return;let e=E.x/g.width*255;b(o,e=Math.round((0,u.uZ)(e,0,255)))},[k,E,g,o,b]),r.useEffect(()=>{function e(){z(!1)}return window.addEventListener("mouseup",e),window.addEventListener("touchend",e),document.addEventListener("mouseleave",e),()=>{window.removeEventListener("mouseup",e),window.removeEventListener("touchend",e),document.removeEventListener("mouseleave",e)}},[k]);let A=(0,u.w6)(10).map(e=>{let s=x?{...t}:{r:0,g:0,b:0};return s[o]=(0,u.Fv)(e,0,9,0,255),l(s)}),I=(0,u.Fv)(f,0,255,0,100);return(0,n.jsxs)(p,{children:[(0,n.jsxs)(i,{children:[(0,n.jsx)(d,{htmlFor:"slider-".concat(j),children:s}),(0,n.jsx)(v,{children:f})]}),(0,n.jsx)(m,{ref:y,id:"slider-".concat(j),style:{background:c(A)},onMouseDown:()=>z(!0),onTouchStart:()=>z(!0),onKeyDown:function(e){switch(e.key){case"ArrowLeft":e.preventDefault(),b(o,(0,u.uZ)(f-10,0,255));break;case"ArrowRight":e.preventDefault(),b(o,(0,u.uZ)(f+10,0,255))}},children:(0,n.jsx)(h,{children:(0,n.jsx)(w,{style:{left:"".concat(I,"%")}})})})]})};t(92219);let x=(0,o.z)("div")({name:"Wrapper",class:"wyki552",propsAsIs:!1}),b=(0,o.z)("span")({name:"Color",class:"cda6ynm",propsAsIs:!1}),y=function(e){let{r:s,g:t,b:r}=e;return(0,n.jsxs)(x,{children:["rgb(",(0,n.jsx)(b,{children:s}),"\xa0",(0,n.jsx)(b,{children:t}),"\xa0",(0,n.jsx)(b,{children:r}),");"]})};t(27018);let j={r:"Red",g:"Green",b:"Blue"},E=(0,o.z)("div")({name:"Wrapper",class:"w1997lpl",propsAsIs:!1}),g=(0,o.z)("div")({name:"Sliders",class:"s1pxkd12",propsAsIs:!1}),k=(0,o.z)("div")({name:"Preview",class:"ppw3vqu",propsAsIs:!1}),z=(0,o.z)("div")({name:"Output",class:"o1pb353l",propsAsIs:!1}),A=r.memo(function(e){let{dynamicGradients:s=!1}=e,[t,o]=r.useState({r:255,g:0,b:0}),u=r.useCallback((e,s)=>{o(t=>({...t,[e]:s}))},[]),a=Object.keys(t);return(0,n.jsxs)(E,{children:[(0,n.jsx)(g,{children:a.map(e=>(0,n.jsx)(f,{label:j[e],color:t,channel:e,value:t[e],dynamicGradients:s,onChange:u},e))}),(0,n.jsxs)(z,{children:[(0,n.jsx)(k,{style:{backgroundColor:"rgb(".concat(t.r," ").concat(t.g," ").concat(t.b,")")}}),(0,n.jsx)(y,{...t})]})]})});t(61661)},92219:e=>{e.exports={t19h02b3:"t19h02b3",lpuat1a:"lpuat1a",vzytuuw:"vzytuuw",shx7s09:"shx7s09",hx5nmpm:"hx5nmpm",h1wyvrrv:"h1wyvrrv"}},61661:e=>{e.exports={w1997lpl:"w1997lpl",s1pxkd12:"s1pxkd12",ppw3vqu:"ppw3vqu",o1pb353l:"o1pb353l"}},27018:e=>{e.exports={wyki552:"wyki552",cda6ynm:"cda6ynm"}}}]); //# sourceMappingURL=76998.6683bf40bcf82921.js.map