{"version":3,"file":"HeroWaveLottie.DrILAz3c.mjs","names":["useRef","useState","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","le","_e","ce","de","addPropertyControls","init_framer_DxfB3JJo","RenderTarget","ControlType","layout","W","frameWidth","B","band","frameHeight","w","zoom","h","aspect","top","crop","t","rotate","cos","sin","A","anchor","left","back","x","y","above","b","i","a","scale","u","EDGE_MARGIN","o","qx","qy","n","HeroWaveLottie","frameRef","ref","ready","setReady","box","setBox","cropKey","art","ARTWORKS","artwork","frame","target","clearOf","measure","f","gap","ro","el","anim","observer","cancelled","still","io","entry","resolve","player","data","speed","style","init_HeroWaveLottie","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/08C4joCktFKidZR0uV41/LASABOWeKB7vxrQ0eOCF/HeroWaveLottie.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useLayoutEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";// Animated wave lines behind a section: the Governed-AI hero (Figma \"Wave.lottie\") or the closing\n// Governed-AI CTA (Figma \"Footer.lottie\"), both 24s seamless loops, picked with `artwork`.\n// The player and the animation data are both loaded after the page renders, so neither delays the\n// hero; the layer fades in once its first frame is drawn. It pauses whenever it is off screen, and\n// shows a still frame on the Framer canvas and for visitors who prefer reduced motion.\n//\n// Place it filling the hero. The artwork is drawn at full width (times `zoom`) and its bottom edge\n// sits `gap` px above the first element matching `clearOf` (the headline); whatever doesn't fit\n// above that is clipped at the top of the frame. The headline is measured live: the hero centres its\n// content vertically, so its position depends on the window's width and height, and a fixed offset\n// can't keep the lines clear of it. A negative gap lets the lines run behind the headline.\n//\n// The wave's dip (the middle of the artwork's bottom edge) sits at `anchor` (a fraction of the frame's\n// width), and `rotate` tilts the artwork about it. A tilted rectangle could expose its ends, where the\n// lines stop dead, so the artwork is scaled up about the dip — which keeps the dip where it is — by the\n// smallest amount that keeps its left, right and top edges outside the visible band at the current\n// width. Its bottom edge may show: the artwork carries no lines along it. Everything is a fraction of\n// the frame's width, so the composition scales with the screen; the layer should fill the section,\n// as edges are only hidden within the layer's own box.\n// Each artwork's data lives in its own module (Framer caps a code file at 1 MB) and is only fetched\n// by the instance that uses it. aspect = height / width of the Figma artboard.\nconst ARTWORKS={// @ts-ignore - the typechecker skips these ~900 KB data modules; they resolve at runtime\nhero:{aspect:1202/2110,load:()=>import(\"https://framerusercontent.com/modules/yrwDbWIrB46TSWj4cyIX/aJbsbTvIyh0BwJMdsRyh/HeroWaveData.js\")},// @ts-ignore - see above\nfooter:{aspect:895/1920,load:()=>import(\"https://framerusercontent.com/modules/vFkKWWt358V1kyWZmFHT/dUQxkNIV1lzC0jlKeciw/FooterWaveData.js\")}};const EDGE_MARGIN=2// px kept between an artwork edge and the visible band\n;// Places the artwork box in band coordinates and returns its CSS transform.\nfunction layout(frameWidth,frameHeight,band,aspect,crop,zoom,rotate,anchor){const W=frameWidth;const B=band??frameHeight;const w=W*zoom;const h=w*aspect;const top=crop===\"top\"?0:crop===\"center\"?(B-h)/2:B-h;const t=rotate*Math.PI/180;const cos=Math.cos(t);const sin=Math.sin(t);const A={x:anchor*W,y:top+h}// the dip: middle of the artwork's bottom edge\n;const left=A.x-w/2;// The band rotated back into the artwork's frame, relative to the dip, keeping only the part above\n// the artwork's bottom edge (y <= 0): below it there is nothing to hide.\nconst back=[[0,0],[W,0],[W,B],[0,B]].map(([x,y])=>({x:cos*(x-A.x)+sin*(y-A.y),y:-sin*(x-A.x)+cos*(y-A.y)}));const above=[];back.forEach((a,i)=>{const b=back[(i+1)%back.length];if(a.y<=0)above.push(a);if(a.y<=0!==b.y<=0)above.push({x:a.x+a.y/(a.y-b.y)*(b.x-a.x),y:0});});let scale=1;for(const u of above)scale=Math.max(scale,(Math.abs(u.x)+EDGE_MARGIN)/(w/2),(-u.y+EDGE_MARGIN)/h);// Map: scale about the dip, then rotate about it.\nconst map=(x,y)=>{const qx=scale*(x-A.x);const qy=scale*(y-A.y);return{x:A.x+cos*qx-sin*qy,y:A.y+sin*qx+cos*qy};};const o=map(left,top);const m=[scale*cos,scale*sin,-scale*sin,scale*cos,o.x,o.y].map(n=>+n.toFixed(4));return{band,width:w,height:h,transform:`matrix(${m.join(\",\")})`};}/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function HeroWaveLottie({artwork=\"hero\",crop=\"bottom\",zoom=1,rotate=0,anchor=.5,speed=1,clearOf=\"h1\",gap=16,style}){const frameRef=useRef(null);const ref=useRef(null);const[ready,setReady]=useState(false);const[box,setBox]=useState(null);const cropKey=String(crop).toLowerCase()||\"bottom\";const art=ARTWORKS[String(artwork).toLowerCase()]??ARTWORKS.hero;useLayoutEffect(()=>{const frame=frameRef.current;if(!frame)return;let target=null;if(clearOf)for(let n=frame.parentElement;n&&!target;n=n.parentElement)target=n.querySelector(clearOf);const measure=()=>{const f=frame.getBoundingClientRect();// A match above this layer (e.g. another section's headline) is ignored: fill the frame.\nconst t=target?.getBoundingClientRect();const band=t&&t.top>f.top?Math.max(0,Math.round(t.top-f.top-gap)):null;setBox(layout(f.width,f.height,band,art.aspect,cropKey,zoom,rotate,anchor));};measure();const ro=new ResizeObserver(measure);ro.observe(frame);if(target)ro.observe(target);window.addEventListener(\"resize\",measure);return()=>{ro.disconnect();window.removeEventListener(\"resize\",measure);};},[clearOf,gap,zoom,rotate,anchor,cropKey,art]);useEffect(()=>{const el=ref.current;if(!el)return;let anim;let observer;let cancelled=false;const still=RenderTarget.current()===RenderTarget.canvas||window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;// Fetch the player and data only once the layer is within a screen's height of the viewport,\n// so a wave far down the page costs nothing for visitors who never scroll to it.\nconst near=new Promise(resolve=>{const io=new IntersectionObserver(([entry])=>{if(!entry.isIntersecting)return;io.disconnect();resolve();},{rootMargin:\"100% 0px\"});io.observe(frameRef.current??el);});near.then(()=>Promise.all([// @ts-ignore - resolved from npm by Framer (it can't resolve the lottie_light subpath)\n    import(\"lottie-web\"),art.load()])).then(([player,data])=>{if(cancelled)return;const lottie=player.default??player;anim=lottie.loadAnimation({container:el,renderer:\"svg\",loop:true,autoplay:false,// lottie mutates the data it is given, so each instance gets its own copy\nanimationData:structuredClone(data.default)});anim.setSpeed(speed);anim.addEventListener(\"DOMLoaded\",()=>{anim.goToAndStop(0,true);setReady(true);if(still)return;observer=new IntersectionObserver(([entry])=>entry.isIntersecting?anim.play():anim.pause());observer.observe(frameRef.current??el);});});return()=>{cancelled=true;observer?.disconnect();anim?.destroy();};},[speed,art]);return /*#__PURE__*/_jsx(\"div\",{ref:frameRef,\"aria-hidden\":true,style:{...style,width:\"100%\",height:\"100%\",pointerEvents:\"none\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:box?.band??\"100%\",overflow:\"hidden\",opacity:ready&&box?1:0,transition:\"opacity 0.8s ease\"},children:/*#__PURE__*/_jsx(\"div\",{ref:ref,style:{position:\"absolute\",left:0,top:0,width:box?.width??0,height:box?.height??0,transformOrigin:\"0 0\",transform:box?.transform}})})});}addPropertyControls(HeroWaveLottie,{artwork:{type:ControlType.Enum,title:\"Artwork\",options:[\"hero\",\"footer\"],optionTitles:[\"Hero wave\",\"Footer wave\"],defaultValue:\"hero\"},crop:{type:ControlType.Enum,title:\"Crop\",options:[\"top\",\"center\",\"bottom\"],optionTitles:[\"Top\",\"Centre\",\"Bottom\"],defaultValue:\"bottom\"},zoom:{type:ControlType.Number,title:\"Zoom\",min:.5,max:4,step:.1,defaultValue:1},rotate:{type:ControlType.Number,title:\"Rotate\",min:-45,max:45,step:1,unit:\"\\xb0\",defaultValue:0},anchor:{type:ControlType.Number,title:\"Pivot\",min:0,max:1,step:.05,defaultValue:.5},speed:{type:ControlType.Number,title:\"Speed\",min:.25,max:2,step:.05,defaultValue:1},clearOf:{type:ControlType.String,title:\"Stop above\",defaultValue:\"h1\",placeholder:\"CSS selector, or empty to fill the frame\"},gap:{type:ControlType.Number,title:\"Gap\",min:-400,max:200,step:4,unit:\"px\",defaultValue:16}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HeroWaveLottie\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HeroWaveLottie.map"],"mappings":"A,2MAyBA,SAASc,EAAO,EAAW,EAAY,EAAK,EAAO,EAAK,EAAK,EAAO,EAAO,CAAC,IAAMC,EAAEC,EAAiBC,EAAEC,GAAMC,EAAkBC,EAAEL,EAAEM,EAAWC,EAAEF,EAAEG,EAAaC,EAAIC,IAAO,MAAM,EAAEA,IAAO,UAAUR,EAAEK,GAAG,EAAEL,EAAEK,EAAQI,EAAEC,EAAO,KAAK,GAAG,IAAUC,EAAI,KAAK,IAAIF,CAAC,EAAQG,EAAI,KAAK,IAAIH,CAAC,EAAQI,EAAE,CAAC,EAAEC,EAAOhB,EAAE,EAAES,EAAIF,CAAC,EACzSU,EAAKF,EAAE,EAAEV,EAAE,EAEZa,EAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAClB,EAAE,CAAC,EAAE,CAACA,EAAEE,CAAC,EAAE,CAAC,EAAEA,CAAC,CAAC,CAAC,CAAC,KAAK,CAACiB,EAAEC,MAAM,CAAC,EAAEP,GAAKM,EAAEJ,EAAE,GAAGD,GAAKM,EAAEL,EAAE,GAAG,EAAE,CAACD,GAAKK,EAAEJ,EAAE,GAAGF,GAAKO,EAAEL,EAAE,EAAE,EAAE,EAAQM,EAAM,CAAC,EAAEH,EAAK,SAAS,EAAE,IAAI,CAAC,IAAMI,EAAEJ,GAAMK,EAAE,GAAGL,EAAK,QAAWM,EAAE,GAAG,GAAEH,EAAM,KAAKG,CAAC,EAAKA,EAAE,GAAG,GAAIF,EAAE,GAAG,GAAED,EAAM,KAAK,CAAC,EAAEG,EAAE,EAAEA,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