{"version":3,"file":"DirectionalFill.BUPaceJ8.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/nCAPO155fkyfhuL6jvCA/dBwPvXproXRaMgfy6Rfl/DirectionalFill.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useLayoutEffect,useRef}from\"react\";import{useReducedMotion}from\"framer-motion\";import{RenderTarget}from\"framer\";const FALLBACK_RADIUS=\"20px\";const EASE=\"cubic-bezier(0.33, 1, 0.68, 1)\";// past the edge, so the plate never leaves a seam at rest\nconst OUT=101;const OFFSETS={top:{x:0,y:-OUT},right:{x:OUT,y:0},bottom:{x:0,y:OUT},left:{x:-OUT,y:0}};const CENTRE={x:0,y:0};// keyboard focus has no cursor to take a direction from\nconst NO_POINTER=OFFSETS.bottom;/**\n * Which edge the pointer is nearest, measured in the cell's own proportions —\n * normalising by width and height keeps a wide tile from always reading as\n * entered \"from the side\".\n */function edgeFrom(rect,clientX,clientY){const x=(clientX-rect.left)/rect.width-.5;const y=(clientY-rect.top)/rect.height-.5;if(Math.abs(x)>Math.abs(y))return x>0?\"right\":\"left\";return y>0?\"bottom\":\"top\";}// Surface/Sunken — the card's resting surface, painted by the wrapper instead.\nconst SURFACE_REST=\"var(--token-f0da955b-4330-4898-bd14-c4e89ee5de08, rgb(233, 234, 238))\";// Surface/Sunken Hover — the hover plate is one gray step down (Sanna,\n// 2026-09-26: «gray with red accent instead of full red»). The red lives in\n// the card's own hover variant: the dot fills and the arrow pill turns Red 500.\nconst SURFACE_FILL=\"var(--token-2d853ac4-0e43-4f75-8992-604c7a721576, rgb(223, 224, 229))\";// Shorter than the logo wall: the card's dot and arrow change on its own\n// 0.15s variant, so the plate has to cover the card about as fast.\nconst SURFACE_DURATION=.3;const SURFACE_ATTR=\"data-dfill-surface\";const SURFACE_CSS=`[${SURFACE_ATTR}]{background-color:transparent!important}`;/**\n * withDirectionalSurface\n *\n * The same directional plate, for a cell whose child is a CARD WITH ITS OWN\n * FILL (Home «How teams are using it» → `Story Cell` around `Story Card`).\n * A plate behind an opaque card is invisible, so this one finds the card's\n * painted surface, clears it with a stylesheet rule (it beats the inline and\n * class fills of both variants), and paints the resting colour on the wrapper\n * instead. The card keeps its own hover variant for text, dot and arrow.\n *\n * The shared `Story Card` component is not touched, so /customer-stories and\n * /blog keep their plain hover.\n */export function withDirectionalSurface(Component){return function WithDirectionalSurface(props){const frameRef=useRef(null);const plateRef=useRef(null);const reduceMotion=useReducedMotion();const isCanvas=RenderTarget.current()===RenderTarget.canvas;// First painted, rounded element under the cell = the card surface.\nfunction tagSurface(){const frame=frameRef.current;if(!frame||isCanvas)return;if(frame.querySelector(`[${SURFACE_ATTR}]`))return;const walker=document.createTreeWalker(frame,NodeFilter.SHOW_ELEMENT);let el=walker.nextNode();while(el){if(el!==plateRef.current){const cs=window.getComputedStyle(el);const painted=cs.backgroundColor!==\"rgba(0, 0, 0, 0)\"&&cs.backgroundColor!==\"transparent\";if(painted){if(cs.borderRadius&&cs.borderRadius!==\"0px\")frame.style.borderRadius=cs.borderRadius;el.setAttribute(SURFACE_ATTR,\"\");return;}}el=walker.nextNode();}}useLayoutEffect(()=>{if(isCanvas||typeof document===\"undefined\")return;if(!document.getElementById(\"dfill-surface-css\")){const style=document.createElement(\"style\");style.id=\"dfill-surface-css\";style.textContent=SURFACE_CSS;document.head.appendChild(style);}tagSurface();});function place(offset,animated){const plate=plateRef.current;if(!plate)return;plate.style.transition=animated&&!reduceMotion?`transform ${SURFACE_DURATION}s ${EASE}`:\"none\";plate.style.transform=`translate(${offset.x}%, ${offset.y}%)`;}function slideIn(offset){const frame=frameRef.current;if(!frame)return;tagSurface();place(offset,false);void frame.offsetWidth;place(CENTRE,true);}function edgeAt(event){const frame=frameRef.current;if(!frame)return\"bottom\";return edgeFrom(frame.getBoundingClientRect(),event.clientX,event.clientY);}function handleEnter(event){if(event.pointerType===\"touch\")return;slideIn(OFFSETS[edgeAt(event)]);}function handleLeave(event){if(event.pointerType===\"touch\")return;place(OFFSETS[edgeAt(event)],true);}function handleFocus(event){let keyboard=true;try{keyboard=!!event.target?.matches?.(\":focus-visible\");}catch{keyboard=true;}if(keyboard)slideIn(NO_POINTER);}function reset(){place(NO_POINTER,true);}return /*#__PURE__*/_jsxs(\"div\",{ref:frameRef,onPointerEnter:isCanvas?undefined:handleEnter,onPointerLeave:isCanvas?undefined:handleLeave,onPointerCancel:isCanvas?undefined:reset,onFocus:isCanvas?undefined:handleFocus,onBlur:isCanvas?undefined:reset,style:{position:\"relative\",width:\"100%\",height:\"100%\",borderRadius:FALLBACK_RADIUS,overflow:\"hidden\",// on the canvas the card still paints itself\nbackground:isCanvas?undefined:SURFACE_REST,isolation:\"isolate\"},children:[/*#__PURE__*/_jsx(\"div\",{ref:plateRef,\"aria-hidden\":true,style:{position:\"absolute\",inset:0,background:SURFACE_FILL,transform:`translate(0%, ${OUT}%)`,pointerEvents:\"none\",zIndex:0}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",zIndex:1,width:\"100%\",height:\"100%\"},children:/*#__PURE__*/_jsx(Component,{...props})})]});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withDirectionalSurface\":{\"type\":\"reactHoc\",\"name\":\"withDirectionalSurface\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DirectionalFill.map"],"mappings":"uOAMG,SAAS,EAAS,EAAK,EAAQ,EAAQ,CAAC,IAAM,GAAG,EAAQ,EAAK,MAAM,EAAK,MAAM,GAAS,GAAG,EAAQ,EAAK,KAAK,EAAK,OAAO,GAAwD,OAAlD,KAAK,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAS,EAAE,EAAE,QAAQ,OAAc,EAAE,EAAE,SAAS,KAAM,CAkB3M,SAAgB,EAAuB,EAAU,CAAC,OAAO,SAAgC,EAAM,CAAC,IAAM,EAASA,EAAO,IAAI,EAAQ,EAASA,EAAO,IAAI,EAAQ,EAAa,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