{"version":3,"file":"Test.DxmoPRSe.mjs","names":["Arc","hash","useState","useRef"],"sources":["https:/framerusercontent.com/modules/dZ9c6z10n71dmz3JQVi4/9V4bd6GeC5hErLrBqMW9/Arc.js","https:/framerusercontent.com/modules/GwGrmoehBRpQvWUjtAyw/2Whu98h6wCNT7g0ipXPY/Test.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget,withCSS}from\"framer\";import hash from\"@emotion/hash\";function getAlignmentIcon(alignmentBaseline){switch(alignmentBaseline){case\"top\":return\"Text Top\";case\"center\":return\"Central\";case\"bottom\":return\"Hanging\";}}/**\n * ARC TEXT FOR INSERT\n * By Adam and Benjamin\n *\n * @framerIntrinsicWidth 150\n * @framerIntrinsicHeight 150\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */const Arc=withCSS(function Arc(_props){const props={..._props,width:_props.width??50,height:_props.height??50};// Checks\nconst isCanvas=RenderTarget.current()===RenderTarget.canvas;// For Ellipse\nconst isEllipse=!props.type;const cylinder=isEllipse?props.cylinderHeight/2:0;// Base arc path\nconst path=createPath(props.flip,cylinder);// Unique IDs to avoid multiple instances on the canvas sharing a single path\nconst id=`curve-${hash(path)}`;// Alignment icon conversion\nconst alignmentValue=getAlignmentIcon(props.alignmentBaseline);return /*#__PURE__*/_jsxs(\"svg\",{className:\"transform-origin-center-center\",style:{width:\"100%\",height:\"100%\",transformOrigin:\"center\"},viewBox:`0 0 100 100`,overflow:\"visible\",children:[/*#__PURE__*/_jsx(\"path\",{id:id,d:path,strokeWidth:\"none\",fill:\"transparent\"}),/*#__PURE__*/_jsx(\"text\",{children:/*#__PURE__*/_jsx(\"textPath\",{href:`#${id}`,startOffset:props.startOffset,dominantBaseline:alignmentValue,style:{letterSpacing:props.font?.letterSpacing?props.font.letterSpacing:1.85,...props.font,fill:props.color},children:props.text})})]});},// Work around a bug with framer-motion that calculates a px origin when animating SVG elements.\n[\".transform-origin-center-center { transform-origin: center center !important; }\"],\"framer-arc-text\");export default Arc;addPropertyControls(Arc,{text:{title:\"Content\",type:ControlType.String,defaultValue:\"DESIGN SITES LIKE A PRO WITH FRAMER\",displayTextArea:true},type:{title:\"Type\",type:ControlType.Boolean,enabledTitle:\"Circle\",disabledTitle:\"Ellipse\",defaultValue:true},cylinderHeight:{title:\"Height\",type:ControlType.Number,min:0,max:1e3,displayStepper:true,hidden:props=>props.type},alignmentBaseline:{title:\"Align\",type:ControlType.Enum,options:[\"top\",\"center\",\"bottom\"],optionIcons:[\"align-top\",\"align-middle\",\"align-bottom\"],defaultValue:\"bottom\",displaySegmentedControl:true},flip:{type:ControlType.Boolean,defaultValue:false,title:\"Direction\",enabledTitle:\"CW\",disabledTitle:\"CCW\"},startOffset:{title:\"Offset\",type:ControlType.Number,defaultValue:0,max:360,unit:\"\\xb0\",step:.5},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",displayTextAlignment:false},color:{title:\"Color\",type:ControlType.Color,defaultValue:\"#999\"}});/* Path creation method */const createPath=(flip,cylinder)=>{const cylinderTop=50-cylinder;const cylinderBottom=50+cylinder;return!flip?`M 0 50 L 0 ${cylinderTop} A 1 1 0 0 1 100 ${cylinderTop} L 100 50 L 100 ${cylinderBottom} A 1 1 0 0 1 0 ${cylinderBottom} L 0 ${cylinderTop}`:`M 0 50 L 0 ${cylinderBottom} A 1 1 0 1 0 100 ${cylinderBottom} L 100 ${cylinderTop} A 1 1 0 1 0 0 ${cylinderTop} L 0 50`;};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Arc\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerDisableUnlink\":\"*\",\"framerIntrinsicHeight\":\"150\",\"framerIntrinsicWidth\":\"150\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Arc.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,useRef}from\"react\";import{motion,useMotionValue,useSpring}from\"framer-motion\";const SPRING_CONFIG={damping:100,stiffness:400};const MAX_DISTANCE=.5;export const withMagnet=Component=>{return props=>{const[isHovered,setIsHovered]=useState(false);const x=useMotionValue(0);const y=useMotionValue(0);const ref=useRef(null);const springX=useSpring(x,SPRING_CONFIG);const springY=useSpring(y,SPRING_CONFIG);useEffect(()=>{const calculateDistance=e=>{if(ref.current){const rect=ref.current.getBoundingClientRect();const centerX=rect.left+rect.width/2;const centerY=rect.top+rect.height/2;const distanceX=e.clientX-centerX;const distanceY=e.clientY-centerY;if(isHovered){x.set(distanceX*MAX_DISTANCE);y.set(distanceY*MAX_DISTANCE);}else{x.set(0);y.set(0);}}};document.addEventListener(\"mousemove\",calculateDistance);return()=>{document.removeEventListener(\"mousemove\",calculateDistance);};},[ref,isHovered]);return /*#__PURE__*/_jsx(motion.div,{ref:ref,onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>setIsHovered(false),style:{x:springX,y:springY,height:props.height||\"auto\"},children:/*#__PURE__*/_jsx(Component,{...props})});};};\nexport const __FramerMetadata__ = {\"exports\":{\"withMagnet\":{\"type\":\"reactHoc\",\"name\":\"withMagnet\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Test.map"],"mappings":"2RAAkK,SAAS,EAAiB,EAAkB,CAAC,OAAO,EAAP,CAA0B,IAAI,MAAM,MAAM,WAAW,IAAI,SAAS,MAAM,UAAU,IAAI,SAAS,MAAM,kCAA3P,IAAyE,IAAgC,CAUzJ,EAAI,EAAQ,SAAa,EAAO,CAAC,IAAM,EAAM,CAAC,GAAG,EAAO,MAAM,EAAO,OAAO,GAAG,OAAO,EAAO,QAAQ,GAAG,CAClG,EAAa,SAAS,CAAG,EAAa,OACzB,IAAM,EAAjB,EAAM,KAAqD,E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