{"version":3,"file":"MeshGradient.FgoPj2WS.mjs","names":["React.useMemo","p"],"sources":["https:/framerusercontent.com/modules/z07Yx2BkLSObnXipAK3w/HcMRzl5hACZecP8WbSc3/MeshGradient.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function MeshGradient({points=[],background=\"#0b1020\",blendMode=\"screen\"}){const pointsComputed=React.useMemo(()=>{if(Array.isArray(points)&&points.length>0){return points.map(p=>({x:Math.max(0,Math.min(100,p?.x??25))/100,y:Math.max(0,Math.min(100,p?.y??25))/100,size:Math.max(0,Math.min(100,p?.size??50))/100,color:p?.color||\"#FF6B6B\",blurPx:Math.max(0,Math.min(200,p?.blur??40))}));}// Fallback: 3 default points\nreturn[{x:.25,y:.3,size:.55,color:\"#FF6B6B\",blurPx:60},{x:.7,y:.35,size:.5,color:\"#4F46E5\",blurPx:60},{x:.5,y:.7,size:.6,color:\"#06D6A0\",blurPx:60}];},[points]);// Build a background string with multiple radial-gradients using inlined percentages\nconst backgroundImage=React.useMemo(()=>{const layers=[];pointsComputed.forEach(b=>{const xPct=Math.round(b.x*100);const yPct=Math.round(b.y*100);// Map size (0..1) directly to gradient radius percentage (0..100)\nconst outerStop=Math.max(0,Math.min(100,Math.round(b.size*100)));// Determine fade width between solid color and transparent based on blur\nconst fadeWidth=Math.max(6,Math.round(8+b.blurPx*.1))// in percentage points\n;const innerStop=Math.max(0,Math.min(outerStop,outerStop-fadeWidth));const layer=`radial-gradient(circle at ${xPct}% ${yPct}%, ${b.color} 0%, ${b.color} ${innerStop}%, transparent ${outerStop}%)`;layers.push(layer);});return layers.join(\", \");},[pointsComputed]);return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\",backgroundColor:background,backgroundImage,backgroundRepeat:\"no-repeat\",backgroundSize:\"100% 100%\",backgroundBlendMode:blendMode}});}MeshGradient.defaultProps={width:600,height:400};addPropertyControls(MeshGradient,{points:{type:ControlType.Array,title:\"Points\",icon:\"blend\",defaultValue:[{color:\"#FF6B6B\",x:25,y:30,size:55,blur:60},{color:\"#4F46E5\",x:70,y:35,size:50,blur:60},{color:\"#06D6A0\",x:50,y:70,size:60,blur:60}],propertyControl:{type:ControlType.Object,controls:{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#FF6B6B\"},x:{type:ControlType.Number,title:\"X\",min:0,max:100,step:1,defaultValue:50},y:{type:ControlType.Number,title:\"Y\",min:0,max:100,step:1,defaultValue:50},size:{type:ControlType.Number,title:\"Size\",min:0,max:100,step:1,defaultValue:60},blur:{type:ControlType.Number,title:\"Blur\",min:0,max:200,step:1,defaultValue:60}}}},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#0b1020\"},blendMode:{type:ControlType.Enum,title:\"Blend\",defaultValue:\"screen\",options:[\"normal\",\"multiply\",\"screen\",\"overlay\",\"darken\",\"lighten\",\"color-dodge\",\"color-burn\",\"hard-light\",\"soft-light\",\"difference\",\"exclusion\",\"hue\",\"saturation\",\"color\",\"luminosity\",\"plus-lighter\"],optionTitles:[\"Normal\",\"Multiply\",\"Screen\",\"Overlay\",\"Darken\",\"Lighten\",\"Color Dodge\",\"Color Burn\",\"Hard Light\",\"Soft Light\",\"Difference\",\"Exclusion\",\"Hue\",\"Saturation\",\"Color\",\"Luminosity\",\"+ Lighter\"]}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MeshGradient\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MeshGradient.map"],"mappings":"kQAA2H,SAAwB,EAAa,CAAC,SAAO,EAAE,CAAC,aAAW,UAAU,YAAU,UAAU,CAAC,IAAM,EAAeA,MAAsB,MAAM,QAAQ,EAAO,EAAE,EAAO,OAAO,EAAU,EAAO,IAAI,IAAI,CAAC,EAAE,KAAK,IAAI,EAAE,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