{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/5DTMMRPRpOJIWFQ8dM2s/m1G04Ytltn3LsmRgfaAt/Download_button.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function Download(props){const[bloblUrl,setBlobUrl]=useState(null);const[isHovered,setIsHovered]=useState(false);const{fileName,title,tint,hoverTint,style,file,radius,topLeftRadius,topRightRadius,bottomRightRadius,bottomLeftRadius,isMixedRadius=false,stylePadding,topLeftPadding,topRightPadding,bottomRightPadding,bottomLeftPadding,isMixedPadding=false,font}=props;const borderRadius=isMixedRadius?`${topLeftRadius}px ${topRightRadius}px ${bottomRightRadius}px ${bottomLeftRadius}px`:`${radius}px`;const padding=isMixedPadding?`${topLeftPadding}px ${topRightPadding}px ${bottomRightPadding}px ${bottomLeftPadding}px`:`${stylePadding}px`;const handleClick=async()=>{const response=await fetch(props.file);const blob=await response.blob();const blobUrl=URL.createObjectURL(blob);setBlobUrl(blobUrl);};useEffect(()=>{handleClick();},[]);return /*#__PURE__*/_jsx(motion.div,{style:{...style,...containerStyle},children:/*#__PURE__*/_jsx(motion.div,{style:{borderRadius,padding,backgroundColor:isHovered?hoverTint:tint,fontSize:font.size,fontWeight:font.weight,color:font.color,fontFamily:\"Europa-Bold Bold\",overflow:\"visible\",width:\"100%\",textAlign:\"center\"},onHoverStart:()=>setIsHovered(true),onHoverEnd:()=>setIsHovered(false),animate:{backgroundColor:isHovered?hoverTint:tint},transition:{duration:.3,ease:\"easeInOut\"},children:/*#__PURE__*/_jsx(\"a\",{href:bloblUrl,style:{textDecoration:\"none\",color:font.color,textAlign:\"center\"},download:fileName,children:title})})});}addPropertyControls(Download,{fileName:{type:ControlType.String,defaultValue:\"File\"},tint:{title:\"Background Color\",type:ControlType.Color,defaultValue:\"#242424\"},hoverTint:{// New property control for hover color\ntitle:\"Hover Background Color\",type:ControlType.Color,defaultValue:\"#1a1a1a\"},title:{title:\"Label\",type:ControlType.String,defaultValue:\"Download!\"},font:{type:ControlType.Object,controls:{fontFace:{type:ControlType.String,defaultValue:\"Inter\"},size:{type:ControlType.Number,defaultValue:18},color:{type:ControlType.Color,defaultValue:\"#fff\"},weight:{type:ControlType.Enum,defaultValue:\"bold\",options:[\"normal\",\"bold\",\"bolder\",\"lighter\"]}}},file:{title:\"File\",type:ControlType.File,allowedFileTypes:[]},radius:{type:ControlType.FusedNumber,title:\"Radius\",defaultValue:8,toggleKey:\"isMixedRadius\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"topLeftRadius\",\"topRightRadius\",\"bottomRightRadius\",\"bottomLeftRadius\"],valueLabels:[\"T\",\"R\",\"B\",\"L\"],min:0},stylePadding:{type:ControlType.FusedNumber,title:\"Padding\",defaultValue:16,toggleKey:\"isMixedPadding\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"topLeftPadding\",\"topRightPadding\",\"bottomRightPadding\",\"bottomLeftPadding\"],valueLabels:[\"T\",\"R\",\"B\",\"L\"],min:0}});const containerStyle={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"visible\",width:\"100%\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Download\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Download_button.map"],
  "mappings": "8GAGkB,SAARA,EAA0BC,EAAM,CAAC,GAAK,CAACC,EAASC,CAAU,EAAEC,EAAS,IAAI,EAAO,CAACC,EAAUC,CAAY,EAAEF,EAAS,EAAK,EAAO,CAAC,SAAAG,EAAS,MAAAC,EAAM,KAAAC,EAAK,UAAAC,EAAU,MAAAC,EAAM,KAAAC,EAAK,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"hoverTint", "style", "file", "radius", "topLeftRadius", "topRightRadius", "bottomRightRadius", "bottomLeftRadius", "isMixedRadius", "stylePadding", "topLeftPadding", "topRightPadding", "bottomRightPadding", "bottomLeftPadding", "isMixedPadding", "font", "borderRadius", "padding", "handleClick", "blob", "blobUrl", "ue", "p", "motion", "containerStyle", "addPropertyControls", "ControlType"]
}
