{"version":3,"file":"CurvyBG.6loDUkSp.mjs","names":["useLayoutEffect","useEffect","React.useState","useRef"],"sources":["https:/framerusercontent.com/modules/5sD1L34Nn4AzaFRyCPrW/BT9HMtTDsUFnXFBXXei7/useIsomorphicLayoutEffect.js","https:/framer.com/m/framer/useIsomorphicLayoutEffect.js@^0.2.0","https:/framerusercontent.com/modules/GBoYA6hnuFwSZZCbht26/cguAGhuQfx1BXbfShe7V/useMeasuredSize.js","https:/framer.com/m/framer/useMeasuredSize.js","https:/framerusercontent.com/modules/P1X4TYc3JsBIPb750mLx/NiwL5cJmet5wwlRAustt/CurvyBG.js"],"sourcesContent":["import{useLayoutEffect,useEffect}from\"react\";/**\n * Swaps `useLayoutEffect` for `useEffect` on the server to avoid React warnings.\n * NOTE! The effect won't run on the server.\n */ export const useIsomorphicLayoutEffect=typeof document!==\"undefined\"?useLayoutEffect:useEffect;\nexport const __FramerMetadata__ = {\"exports\":{\"useIsomorphicLayoutEffect\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./useIsomorphicLayoutEffect.map","/*\n * useIsomorphicLayoutEffect (framer/useIsomorphicLayoutEffect@0.2.0)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/5sD1L34Nn4AzaFRyCPrW/BT9HMtTDsUFnXFBXXei7/useIsomorphicLayoutEffect.js\"\n","import*as React from\"react\";import{useIsomorphicLayoutEffect}from\"https://framer.com/m/framer/useIsomorphicLayoutEffect.js@^0.2.0\";let safeResizeObserver=undefined;try{if(typeof window!==undefined){safeResizeObserver=window.ResizeObserver;}}catch(e){// happy linting!\n}class SharedObserver{//@ts-ignore\nupdateResizedElements(entries){for(const entry of entries){const callbackForElement=this.callbacks.get(entry.target);if(callbackForElement)callbackForElement(entry.contentRect);}}observeElementWithCallback(element,callback){if(!this.sharedResizeObserver)return;this.sharedResizeObserver.observe(element);this.callbacks.set(element,callback);}unobserve(element){if(!this.sharedResizeObserver)return;this.sharedResizeObserver.unobserve(element);this.callbacks.delete(element);}constructor(){this.callbacks=new WeakMap();const ResizeObserver1=safeResizeObserver;if(!ResizeObserver1)return;this.sharedResizeObserver=new ResizeObserver1(this.updateResizedElements.bind(this));}}const sharedResizeObserver=new SharedObserver();/**\n * Uses a globally shared resize observer, and returns an updated\n * size object when the element's size changes. This is the recommended way to\n * use a Resize Observer: https://github.com/WICG/resize-observer/issues/59.\n */ export function useMeasuredSize(ref,callback){const[size,setSize]=React.useState(null);function updateSize(newSize){if(!size||newSize.height!==size.height||newSize.width!==size.width){if(callback)callback(newSize);setSize({width:newSize.width,height:newSize.height});}}// On mount, immediately measure and set a size. This will defer paint until\n// no more updates are scheduled. Additionally add our element to the shared\n// ResizeObserver with a callback to perform when the element resizes.\n// Finally, remove the element from the observer when the component is unmounted.\nuseIsomorphicLayoutEffect(()=>{if(!ref.current)return;const{offsetWidth,offsetHeight}=ref.current;// Defer paint until initial size is added.\nupdateSize({width:offsetWidth,height:offsetHeight});// Resize observer will race to add the initial size, but since the size\n// is set above, it won't trigger a render on mount since it should\n// match the measured size. Future executions of the callback will\n// trigger renders if the size changes.\nsharedResizeObserver.observeElementWithCallback(ref.current,updateSize);return()=>{if(!ref.current)return;sharedResizeObserver.unobserve(ref.current);};},[]);return size;}export function useSizeChange(ref,callback){const size=React.useRef(null);const updateSize=React.useCallback(newSize=>{if(!size.current||newSize.height!==size.current.height||newSize.width!==size.current.width){size.current={width:newSize.width,height:newSize.height};if(callback)callback(size.current);}},[callback]);// On mount, immediately measure and set a size. This will defer paint until\n// no more updates are scheduled. Additionally add our element to the shared\n// ResizeObserver with a callback to perform when the element resizes.\n// Finally, remove the element from the observer when the component is unmounted.\nuseIsomorphicLayoutEffect(()=>{if(!ref.current)return;const{offsetWidth,offsetHeight}=ref.current;// Defer paint until initial size is added.\nupdateSize({width:offsetWidth,height:offsetHeight});// Resize observer will race to add the initial size, but since the size\n// is set above, it won't trigger a render on mount since it should\n// match the measured size. Future executions of the callback will\n// trigger renders if the size changes.\nsharedResizeObserver.observeElementWithCallback(ref.current,updateSize);return()=>{if(!ref.current)return;sharedResizeObserver.unobserve(ref.current);};},[callback]);return null;}\nexport const __FramerMetadata__ = {\"exports\":{\"useSizeChange\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useMeasuredSize\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./useMeasuredSize.map","/*\n * useMeasuredSize (framer/useMeasuredSize@0.13.0)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/GBoYA6hnuFwSZZCbht26/cguAGhuQfx1BXbfShe7V/useMeasuredSize.js\"\n","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{useMeasuredSize}from\"https://framer.com/m/framer/useMeasuredSize.js\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function CurvyBG(props){const{middleComponent,image,tileWidth,tileHeight,variant}=props;// Reference for the middle content to measure height\nconst middleRef=useRef(null);const size=useMeasuredSize(middleRef);var _size_height;const middleHeight=(_size_height=size===null||size===void 0?void 0:size.height)!==null&&_size_height!==void 0?_size_height:200// Default height if undefined\n;const uniqueId=useRef(`pattern-${Math.random().toString(36).substr(2,9)}`);const topCurveHeight=90;const bottomCurveHeight=90;const effectiveTopCurveHeight=variant!==\"Bottom\"?topCurveHeight:0;const effectiveBottomCurveHeight=variant!==\"Top\"?bottomCurveHeight:0;const totalHeight=middleHeight+effectiveTopCurveHeight+effectiveBottomCurveHeight;const translateY=variant===\"Top\"?-45:variant===\"Bottom\"?45:0;return /*#__PURE__*/_jsxs(\"div\",{style:containerStyle,children:[/*#__PURE__*/_jsxs(\"svg\",{width:\"3342px\",height:totalHeight,viewBox:`0 0 3342 ${totalHeight}`,fill:\"transparent\",style:{position:\"absolute\",transform:`translateY(${translateY}px)`},children:[/*#__PURE__*/_jsxs(\"defs\",{children:[/*#__PURE__*/_jsx(\"pattern\",{id:`${uniqueId.current}-texturedPattern`,patternUnits:\"userSpaceOnUse\",width:tileWidth,height:tileHeight,children:/*#__PURE__*/_jsx(\"image\",{href:image,width:tileWidth,height:tileHeight,preserveAspectRatio:\"none\"})}),/*#__PURE__*/_jsx(\"pattern\",{id:`${uniqueId.current}-secondPattern`,patternUnits:\"userSpaceOnUse\",width:tileWidth,height:tileHeight,patternTransform:`translate(0, -${effectiveTopCurveHeight+middleHeight})`,children:/*#__PURE__*/_jsx(\"image\",{href:image,width:tileWidth,height:tileHeight,preserveAspectRatio:\"none\"})})]}),variant!==\"Bottom\"&&/*#__PURE__*/_jsx(\"g\",{fill:`url(#${uniqueId.current}-texturedPattern)`,children:/*#__PURE__*/_jsx(\"path\",{d:\"M2731.52,44.52c-225.14-50.19-335.93-65.98-522.81-4.79-218.21,58.21-311.48,48.74-548.19,4.79-225.14-50.19-335.93-65.98-522.81-4.79-218.21,58.21-311.48,48.74-548.19,4.79C338.88-11.35,229.98-24.61,0,63.54v26.6h3342V22.31c-264.84,77.07-352.41,70.13-610.47,22.22Z\"})}),/*#__PURE__*/_jsx(\"rect\",{width:\"100%\",height:middleHeight,y:effectiveTopCurveHeight,fill:`url(#${uniqueId.current}-texturedPattern)`}),variant!==\"Top\"&&/*#__PURE__*/_jsx(\"g\",{fill:`url(#${uniqueId.current}-secondPattern)`,children:/*#__PURE__*/_jsx(\"path\",{d:\"M2270.99,0H0v74.06C229.99-14.09,338.87-.83,589.52,55.04c211.12,39.2,308.14,50.98,481.47,11.76,20.96-4.74,109.04-29.72,129.01-34.82,151.86-38.8,261.5-21.3,460.52,23.06,211.13,39.2,308.14,50.98,481.47,11.76,20.96-4.75,109.02-29.71,129-34.82,151.86-38.8,261.51-21.3,460.53,23.06,258.06,47.92,345.63,54.86,610.47-22.22V0h-1071Z\",transform:`translate(0, ${effectiveTopCurveHeight+middleHeight-1})`})})]}),/*#__PURE__*/_jsx(\"div\",{ref:middleRef,style:{position:\"relative\",display:\"flex\",// position: \"relative\",\n// zIndex: 1,\nwidth:\"100%\",height:\"100%\",// boxSizing: \"border-box\",\n// minHeight: \"200px\",\n// display: \"flex\",\njustifyContent:\"center\",// alignItems: \"center\", // Ensures vertical alignment\nflexGrow:1}})]});}// Styles are written in object syntax\nconst containerStyle={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"visible\",position:\"relative\",width:\"100%\",height:\"100%\"};addPropertyControls(CurvyBG,{image:{type:ControlType.Image,title:\"Image\"},tileWidth:{type:ControlType.Number,title:\"Tile Width\",defaultValue:1920,min:10,max:3e3},tileHeight:{type:ControlType.Number,title:\"Tile Height\",defaultValue:1080,min:10,max:3e3},variant:{type:ControlType.Enum,title:\"Variant\",options:[\"Top\",\"Middle\",\"Bottom\"],optionTitles:[\"Top\",\"Middle\",\"Bottom\"],defaultValue:\"Middle\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CurvyBG\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CurvyBG.map"],"mappings":"uOAA6C,CAG5B,EAA0B,OAAO,SAAW,IAAYA,EAAgBC,sBEGrF,SAAgB,EAAgB,EAAI,EAAS,CAAC,GAAK,CAAC,EAAK,GAASC,EAAe,KAAK,CAAC,SAAS,EAAW,EAAQ,EAAI,CAAC,GAAM,EAAQ,SAAS,EAAK,QAAQ,EAAQ,QAAQ,EAAK,SAAU,GAAS,EAAS,EAAQ,CAAC,EAAQ,CAAC,MAAM,EAAQ,MAAM,OAAO,EAAQ,OAAO,CAAC,EAShH,OAL9J,MAA8B,CAAC,GAAG,CAAC,EAAI,QAAQ,OAAO,GAAK,CAAC,cAAY,gBAAc,EAAI,QAKlB,OA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