{"version":3,"file":"SN_PromoTicker.DhAPI0LE.mjs","names":["React.forwardRef","useState","useId","useMemo","useRef"],"sources":["https:/framerusercontent.com/modules/4G0pHPXdxDC0q34eFfFr/oq0PkaqnOfre09AZeL9M/gXjG4ReaI.js","https:/framerusercontent.com/modules/G45jnEJvGURbqhCjhh5o/lnxEhIvTDHhXVJBsWnvW/SN_PromoTicker.js"],"sourcesContent":["// Generated by Framer (85eaff3)\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 0 0 L 14 0\" fill=\"transparent\" height=\"1px\" id=\"h3fQSrHEV\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--js9iwy, 2)\" stroke=\"var(--1m973uw, rgb(0,0,0))\" transform=\"translate(5 12)\" width=\"14px\"/><path d=\"M 0 0 L 7 7 L 0 14\" fill=\"transparent\" height=\"14px\" id=\"DAe82Eor1\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--js9iwy, 2)\" stroke=\"var(--1m973uw, rgb(0,0,0))\" transform=\"translate(12 5)\" width=\"7px\"/></svg>';const getProps=({color,height,id,width,width1,...props})=>{return{...props,JEeZYcamG:width1??props.JEeZYcamG??2,P_DcoRcrY:color??props.P_DcoRcrY??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,P_DcoRcrY,JEeZYcamG,...restProps}=getProps(props);const href=useSVGTemplate(\"1175957644\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-SYorz\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1m973uw\":P_DcoRcrY,\"--js9iwy\":JEeZYcamG,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-SYorz { -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 {\"P_DcoRcrY\":\"color\",\"JEeZYcamG\":\"width1\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Arrow Right\",\"color\":{\"type\":\"variable\",\"value\":\"1m973uw\"},\"set\":{\"localId\":\"vectorSet/ZsiCCGPvG\",\"id\":\"ZsiCCGPvG\",\"moduleId\":\"Y7SpbVH16cWqMhj75z1M\"}}\n */const Icon=withCSS(Component,css,\"framer-SYorz\");Icon.displayName=\"Arrow Right\";export default Icon;addPropertyControls(Icon,{P_DcoRcrY:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Color\",type:ControlType.Color},JEeZYcamG:{defaultValue:2,displayStepper:true,hidden:false,max:16,min:1,title:\"Width\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"24\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerVector\":\"{\\\"name\\\":\\\"Arrow Right\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"1m973uw\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/ZsiCCGPvG\\\",\\\"id\\\":\\\"ZsiCCGPvG\\\",\\\"moduleId\\\":\\\"Y7SpbVH16cWqMhj75z1M\\\"}}\",\"framerVariables\":\"{\\\"P_DcoRcrY\\\":\\\"color\\\",\\\"JEeZYcamG\\\":\\\"width1\\\"}\",\"framerIntrinsicHeight\":\"24\",\"framerContractVersion\":\"1\",\"framerImmutableVariables\":\"true\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useId,useLayoutEffect,useMemo,useRef,useState}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";function usePrefersReducedMotion(){const[reduced,setReduced]=useState(false);useEffect(()=>{if(typeof window===\"undefined\"||!window.matchMedia)return;const mq=window.matchMedia(\"(prefers-reduced-motion: reduce)\");const on=()=>setReduced(mq.matches);on();if(mq.addEventListener){mq.addEventListener(\"change\",on);return()=>mq.removeEventListener(\"change\",on);}},[]);return reduced;}export default function SN_PromoTicker(props){const{text,ticker,speed,separator,gap,background,color,height,paddingX,pauseOnHover,font,style}=props;const message=(text||\"\").trim();const rawId=useId();const id=useMemo(()=>\"snpt\"+String(rawId).replace(/[^a-zA-Z0-9]/g,\"\"),[rawId]);const isCanvas=RenderTarget.current()===RenderTarget.canvas;const reduced=usePrefersReducedMotion();const wrapRef=useRef(null);const itemRef=useRef(null);const[copies,setCopies]=useState(4);const[groupWidth,setGroupWidth]=useState(0);const animate=!!message&&ticker&&!reduced&&!isCanvas;useLayoutEffect(()=>{if(!animate)return;const wrap=wrapRef.current;const item=itemRef.current;if(!wrap||!item)return;const measure=()=>{const w=wrap.getBoundingClientRect().width;const iw=item.getBoundingClientRect().width;if(!(w>0)||!(iw>0))return;// one group must be at least as wide as the bar so the loop never shows a hole\nconst n=Math.max(2,Math.ceil(w/iw)+1);setCopies(prev=>prev===n?prev:n);setGroupWidth(iw*n);};measure();if(typeof ResizeObserver===\"undefined\")return;const ro=new ResizeObserver(measure);ro.observe(wrap);ro.observe(item);return()=>ro.disconnect();},[animate,message,separator,gap,font]);if(!message)return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:0}});const textStyle={fontFamily:'\"Instrument Sans\", \"Instrument Sans Placeholder\", sans-serif',fontWeight:700,fontSize:13,letterSpacing:\"0.4px\",lineHeight:1.2,textTransform:\"uppercase\",...font||{},color,whiteSpace:\"nowrap\"};const bar={...style,width:\"100%\",height,background,overflow:\"hidden\",display:\"flex\",alignItems:\"center\",position:\"relative\",userSelect:\"none\"};if(!animate){return /*#__PURE__*/_jsx(\"div\",{style:{...bar,padding:`0 ${paddingX}px`,boxSizing:\"border-box\"},children:/*#__PURE__*/_jsx(\"span\",{style:{...textStyle,overflow:\"hidden\",textOverflow:\"ellipsis\",display:\"block\",width:\"100%\"},children:message})});}const duration=groupWidth>0?Math.max(4,groupWidth/Math.max(10,speed)):12;const renderGroup=hidden=>/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":hidden?\"true\":undefined,style:{display:\"flex\",flex:\"0 0 auto\",alignItems:\"center\"},children:Array.from({length:copies}).map((_,i)=>/*#__PURE__*/_jsxs(\"span\",{ref:!hidden&&i===0?itemRef:undefined,style:{...textStyle,display:\"inline-flex\",alignItems:\"center\",flex:\"0 0 auto\",paddingRight:gap},children:[message,separator?/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{paddingLeft:gap,opacity:.6},children:separator}):null]},i))});return /*#__PURE__*/_jsxs(\"div\",{ref:wrapRef,style:bar,className:id,role:\"marquee\",\"aria-label\":message,children:[/*#__PURE__*/_jsx(\"style\",{children:`\n@keyframes ${id}-scroll { from { transform: translate3d(0,0,0) } to { transform: translate3d(-${groupWidth}px,0,0) } }\n.${id} .${id}-track { display:flex; width:max-content; will-change:transform; animation:${id}-scroll ${duration}s linear infinite; }\n${pauseOnHover?`.${id}:hover .${id}-track { animation-play-state: paused; }`:\"\"}\n`}),/*#__PURE__*/_jsxs(\"div\",{className:`${id}-track`,style:{paddingLeft:paddingX},children:[renderGroup(false),renderGroup(true)]})]});}SN_PromoTicker.defaultProps={text:\"-50% OFF ON CB VESTS\",ticker:true,speed:40,separator:\"•\",gap:14,background:\"rgb(10, 10, 10)\",color:\"rgb(255, 255, 255)\",height:35,paddingX:14,pauseOnHover:false};addPropertyControls(SN_PromoTicker,{text:{type:ControlType.String,title:\"Text\",description:\"Empty text hides the bar completely.\"},ticker:{type:ControlType.Boolean,title:\"Ticker\",enabledTitle:\"On\",disabledTitle:\"Off\",defaultValue:true},speed:{type:ControlType.Number,title:\"Speed\",min:10,max:200,step:5,unit:\"px/s\",defaultValue:40,hidden:p=>!p.ticker},separator:{type:ControlType.String,title:\"Separator\",defaultValue:\"•\",hidden:p=>!p.ticker},gap:{type:ControlType.Number,title:\"Gap\",min:4,max:80,step:1,unit:\"px\",defaultValue:14,hidden:p=>!p.ticker},pauseOnHover:{type:ControlType.Boolean,title:\"Pause on Hover\",defaultValue:false,hidden:p=>!p.ticker},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"rgb(10, 10, 10)\"},color:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"rgb(255, 255, 255)\"},height:{type:ControlType.Number,title:\"Height\",min:20,max:80,step:1,unit:\"px\",defaultValue:35},paddingX:{type:ControlType.Number,title:\"Side Padding\",min:0,max:40,step:1,unit:\"px\",defaultValue:14},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SN_PromoTicker\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SN_PromoTicker.map"],"mappings":"gVAC0C,IAAqF,IAA4B,EAAqC,EAAK,0BAA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