{"version":3,"file":"HorizontalScroller.Do4U2PW7.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/oHK08zRV1YNCS9LrnLo5/9uLSgWZCAHUDWL5HjCOG/imBHyMNUs.js","https:/framerusercontent.com/modules/W5bVGd7Xkzj5pdlHdVI1/dBKJNqR7LVVymnyqLTcY/HorizontalScroller.js"],"sourcesContent":["// Generated by Framer (dd59b2c)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,useSVGTemplate,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask=\"var(--framer-icon-mask)\";const Base=/*#__PURE__*/forwardRef(function(props,ref){return /*#__PURE__*/_jsx(\"svg\",{...props,ref:ref,children:props.children});});const MotionSVG=motion.create(Base);const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(MotionSVG,{...rest,layoutId:layoutId,ref:ref,children:children}):/*#__PURE__*/_jsx(\"svg\",{...rest,ref:ref,children:children});});const svg='<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 8.076 1.163 C 8.136 0.504 8.688 0 9.35 0 L 10.65 0 C 11.312 0 11.864 0.504 11.924 1.163 C 11.973 1.704 12.362 2.145 12.871 2.336 C 13.002 2.385 13.131 2.437 13.258 2.493 C 13.761 2.711 14.353 2.669 14.774 2.318 C 15.295 1.884 16.061 1.919 16.54 2.398 L 17.458 3.316 C 17.915 3.773 17.948 4.503 17.535 5 C 17.19 5.413 17.158 5.997 17.39 6.483 C 17.49 6.694 17.582 6.909 17.664 7.129 C 17.855 7.638 18.296 8.027 18.837 8.076 C 19.496 8.136 20 8.688 20 9.35 L 20 10.65 C 20 11.312 19.496 11.864 18.837 11.924 C 18.296 11.973 17.855 12.362 17.664 12.871 C 17.59 13.068 17.509 13.262 17.42 13.452 C 17.205 13.913 17.24 14.464 17.566 14.855 C 17.962 15.33 17.93 16.029 17.493 16.467 L 16.467 17.493 C 16.029 17.93 15.33 17.962 14.855 17.566 C 14.464 17.24 13.913 17.205 13.452 17.42 C 13.262 17.509 13.068 17.59 12.871 17.664 C 12.362 17.855 11.973 18.296 11.924 18.837 C 11.864 19.496 11.312 20 10.65 20 L 9.35 20 C 8.688 20 8.136 19.496 8.076 18.837 C 8.027 18.296 7.638 17.855 7.129 17.664 C 6.909 17.582 6.694 17.49 6.483 17.39 C 5.997 17.158 5.413 17.19 5 17.535 C 4.503 17.948 3.773 17.915 3.316 17.458 L 2.398 16.54 C 1.919 16.061 1.884 15.295 2.318 14.774 C 2.669 14.353 2.711 13.761 2.493 13.258 C 2.437 13.131 2.385 13.002 2.336 12.871 C 2.145 12.362 1.704 11.973 1.163 11.924 C 0.504 11.864 0 11.312 0 10.65 L 0 9.35 C 0 8.688 0.504 8.136 1.163 8.076 C 1.704 8.027 2.145 7.638 2.336 7.129 C 2.394 6.976 2.456 6.824 2.522 6.675 C 2.757 6.147 2.718 5.523 2.348 5.079 C 1.897 4.538 1.933 3.742 2.431 3.244 L 3.244 2.431 C 3.742 1.933 4.538 1.897 5.079 2.348 C 5.523 2.718 6.147 2.757 6.675 2.522 C 6.824 2.456 6.975 2.394 7.129 2.336 C 7.638 2.145 8.027 1.704 8.076 1.163 Z\" fill=\"transparent\" height=\"20px\" id=\"ir3uGP8xU\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--1ww558a, 2)\" stroke=\"var(--4rxgx6, black)\" transform=\"translate(2 2)\" width=\"20px\"/><path d=\"M 6 3 C 6 4.657 4.657 6 3 6 C 1.343 6 0 4.657 0 3 C 0 1.343 1.343 0 3 0 C 4.657 0 6 1.343 6 3 Z\" fill=\"transparent\" height=\"6px\" id=\"nQFQJQhUH\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--1ww558a, 2)\" stroke=\"var(--4rxgx6, black)\" transform=\"translate(9 9)\" width=\"6px\"/></svg>';const getProps=({color,height,id,width,width1,...props})=>{return{...props,CRY1Fpez4:color??props.CRY1Fpez4??\"rgb(0, 0, 0)\",vet7gqNu_:width1??props.vet7gqNu_??2};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,CRY1Fpez4,vet7gqNu_,...restProps}=getProps(props);const href=useSVGTemplate(\"2747065769\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-Fjoog\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1ww558a\":vet7gqNu_,\"--4rxgx6\":CRY1Fpez4,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-Fjoog { -webkit-mask: ${mask}; aspect-ratio: 1; display: block; mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"CRY1Fpez4\":\"color\",\"vet7gqNu_\":\"width1\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Settings Account More\",\"color\":{\"type\":\"variable\",\"value\":\"4rxgx6\"},\"set\":{\"localId\":\"vectorSet/dSZJyzeMx\",\"id\":\"dSZJyzeMx\",\"moduleId\":\"E1vFg1A6wcWAGuFi9Hz1\"}}\n */const Icon=withCSS(Component,css,\"framer-Fjoog\");Icon.displayName=\"Settings Account More\";export default Icon;addPropertyControls(Icon,{CRY1Fpez4:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Color\",type:ControlType.Color},vet7gqNu_:{defaultValue:2,displayStepper:true,hidden:false,max:4,min:1,title:\"Width\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"24\",\"framerImmutableVariables\":\"true\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"24\",\"framerVector\":\"{\\\"name\\\":\\\"Settings Account More\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"4rxgx6\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/dSZJyzeMx\\\",\\\"id\\\":\\\"dSZJyzeMx\\\",\\\"moduleId\\\":\\\"E1vFg1A6wcWAGuFi9Hz1\\\"}}\",\"framerVariables\":\"{\\\"CRY1Fpez4\\\":\\\"color\\\",\\\"vet7gqNu_\\\":\\\"width1\\\"}\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useLayoutEffect,useRef,useState}from\"react\";import{motion,useScroll,useSpring,useTransform}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n *\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 400\n *\n * @framerDisableUnlink\n */export default function HorizontalScroller(props){const stickyTop=props.top;const containerOverflow=props.overflow;const containerRef=useRef(null);const scrollRef=useRef(null);const sizerRef=useRef(null);const[scrollRange,setScrollRange]=useState(0);const[contentWidth,setContentWidth]=useState(0);useLayoutEffect(()=>{setScrollRange(scrollRef.current.scrollWidth);const onResize=entries=>{for(let entry of entries){setContentWidth(entry.contentRect.width);setScrollRange(scrollRef.current.scrollWidth);}};const onStyleChange=entries=>{for(let entry of entries){setScrollRange(scrollRef.current.scrollWidth);}};const resizeObserver=new ResizeObserver(onResize);resizeObserver.observe(sizerRef.current);const mutationObserver=new MutationObserver(onStyleChange);mutationObserver.observe(scrollRef.current,{attributes:true,attributeFilter:[\"style\"]});return()=>{resizeObserver.disconnect();mutationObserver.disconnect();};},[]);const{scrollYProgress}=useScroll({target:containerRef});const transform=useTransform(scrollYProgress,[0,1],[0,-scrollRange+contentWidth]);const physics={damping:60,mass:1,stiffness:500};const spring=useSpring(transform,physics);return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,...props,children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"sticky\",top:stickyTop},children:/*#__PURE__*/_jsx(\"div\",{style:{overflow:containerOverflow},children:/*#__PURE__*/_jsx(motion.div,{ref:scrollRef,style:{x:spring},children:props.children})})}),/*#__PURE__*/_jsx(\"div\",{ref:sizerRef,\"aria-hidden\":\"true\",style:{width:\"100%\",height:scrollRange}})]});}HorizontalScroller.displayName=\"Horizontal Scroller\";addPropertyControls(HorizontalScroller,{branding:{type:ControlType.Enum,title:\"Developed By\",options:[\"artech\"],optionTitles:[\"artech\"],displaySegmentedControl:true,description:\"Live [demo](https://horizontalscroller.framer.website).\"},children:{type:ControlType.ComponentInstance,title:\"Frame\",description:\"Long, overflowing frame.\"},top:{type:ControlType.Number,title:\"Top\",description:\"Auto sticky.\\n\\n*Note*: Parent containers require their overflows set to clip for sticky to work.\",defaultValue:0,min:0,step:1,displayStepper:true},overflow:{type:ControlType.Enum,defaultValue:\"hidden\",displaySegmentedControl:true,segmentedControlDirection:\"horizontal\",options:[\"hidden\",\"visible\"],optionTitles:[\"Hidden\",\"Visible\"]}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HorizontalScroller\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"800\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"400\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HorizontalScroller.map"],"mappings":"sUAC2C,IAAqF,IAA4B,CAAoC,EAAK,0BAAgC,EAAkB,EAAW,SAAS,EAAM,EAAI,C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