{"version":3,"file":"HighlightSweep.DCgOtkT4.mjs","names":["React.useRef","React.useState"],"sources":["https:/framerusercontent.com/modules/8hcFuJK8FTmowuiXC5Mn/ComVoag38Bu25iMNtOXX/HighlightSweep.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";const DISPLAY='\"TT Hoves Pro Trl Cnd Black\", \"Arial Narrow\", Impact, sans-serif';// Guard every numeric prop. A missing one makes clamp() or calc() invalid,\n// and the browser then drops the whole declaration rather than degrading.\nfunction num(v,fallback){const n=Number(v);return Number.isFinite(n)?n:fallback;}/**\n * Headline with a yellow bar that wipes in behind it, like a marker stroke.\n * Fires once when the block scrolls into view. Honours prefers-reduced-motion,\n * in which case the bar is simply already there.\n *\n * Geometry note: because box-decoration-break gives every line its own bar,\n * lineHeight must exceed barOffset + barHeight, or the next line's bar paints\n * over the bottom of the line above and clips the letterforms.\n *\n * Naming note: no property control here is called `width` or `height`, since\n * those collide with the layout props Framer injects into every component.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function HighlightSweep({text,fontSize,minFontSize,lineHeight,barHeight,barOffset,highlight,color,delay,duration,style}){const ref=React.useRef(null);const[on,setOn]=React.useState(false);React.useEffect(()=>{const node=ref.current;if(!node)return;const reduce=typeof window!==\"undefined\"&&window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches;if(reduce){setOn(true);return;}const io=new IntersectionObserver(entries=>{if(entries.some(e=>e.isIntersecting)){setOn(true);io.disconnect();}},{threshold:.35});io.observe(node);return()=>io.disconnect();},[]);const max=num(fontSize,64);const min=Math.min(num(minFontSize,34),max);const lh=num(lineHeight,1.06);const offset=num(barOffset,.16);// Never let the bar reach past the line box, or it clips the line above.\nconst bar=Math.max(.1,Math.min(num(barHeight,.84),lh-offset-.04));const fluid=`clamp(${min}px, ${(max/1200*100).toFixed(2)}vw, ${max}px)`;return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{width:\"100%\",...style},children:/*#__PURE__*/_jsx(\"span\",{style:{position:\"relative\",display:\"inline\",fontFamily:DISPLAY,fontSize:fluid,lineHeight:`${lh}em`,letterSpacing:\"-0.03em\",color,backgroundImage:`linear-gradient(${highlight}, ${highlight})`,backgroundRepeat:\"no-repeat\",backgroundPosition:`0 ${offset}em`,backgroundSize:on?`100% ${bar}em`:`0% ${bar}em`,transition:`background-size ${num(duration,900)}ms cubic-bezier(0.16, 1, 0.3, 1) ${num(delay,150)}ms`,boxDecorationBreak:\"clone\",WebkitBoxDecorationBreak:\"clone\",padding:\"0 0.06em\"},children:text})});}HighlightSweep.defaultProps={text:\"Give to the theatre that stays with you.\",fontSize:64,minFontSize:34,lineHeight:1.06,barHeight:.84,barOffset:.16,highlight:\"rgb(238, 242, 0)\",color:\"rgb(0, 0, 0)\",delay:150,duration:900};addPropertyControls(HighlightSweep,{text:{type:ControlType.String,title:\"Text\",displayTextArea:true},fontSize:{type:ControlType.Number,title:\"Max size\",min:16,max:200,step:2,unit:\"px\"},minFontSize:{type:ControlType.Number,title:\"Min size\",min:12,max:120,step:2,unit:\"px\"},lineHeight:{type:ControlType.Number,title:\"Line height\",min:.8,max:2,step:.01,description:\"Must exceed bar top plus bar height\"},barHeight:{type:ControlType.Number,title:\"Bar height\",min:.2,max:1.4,step:.02},barOffset:{type:ControlType.Number,title:\"Bar top\",min:0,max:.6,step:.02},highlight:{type:ControlType.Color,title:\"Bar\"},color:{type:ControlType.Color,title:\"Text colour\"},delay:{type:ControlType.Number,title:\"Delay\",min:0,max:2e3,step:50,unit:\"ms\"},duration:{type:ControlType.Number,title:\"Duration\",min:200,max:3e3,step:50,unit:\"ms\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HighlightSweep\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"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