{"version":3,"file":"DownloadButton_1.Blo7JWil.mjs","names":[],"sources":["https:/framerusercontent.com/modules/4lY2fS0XNnmXv124wYJH/tcnNMaySCNHFtSqvAQ0Q/DownloadButton_1.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";const spring={type:\"spring\",stiffness:300,damping:30};/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function Download(props){const{fileName,title,tint,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()=>{try{const response=await fetch(file);const blob=await response.blob();const blobUrl=URL.createObjectURL(blob);const a=document.createElement(\"a\");a.href=blobUrl;a.download=fileName||\"download\";document.body.appendChild(a);a.click();document.body.removeChild(a);URL.revokeObjectURL(blobUrl);}catch(error){console.error(\"Download failed:\",error);}};return /*#__PURE__*/_jsx(motion.div,{style:{...style,width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"visible\"},children:/*#__PURE__*/_jsx(motion.div,{onClick:handleClick,whileHover:{scale:1.05},transition:spring,style:{width:\"100%\",height:\"100%\",borderRadius,padding,backgroundColor:tint,fontSize:font.size,fontWeight:font.weight,color:font.color,fontFamily:`'${font.fontFace}'`,cursor:\"pointer\",userSelect:\"none\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",pointerEvents:\"auto\"},children:title||\"Download\"})});}addPropertyControls(Download,{fileName:{type:ControlType.String,defaultValue:\"File.pdf\"},title:{title:\"Label\",type:ControlType.String,defaultValue:\"Download\"},tint:{title:\"Background Color\",type:ControlType.Color,defaultValue:\"#242424\"},font:{type:ControlType.Object,controls:{fontFace:{type:ControlType.String,defaultValue:\"Inter\"},size:{type:ControlType.Number,defaultValue:18},color:{type:ControlType.Color,defaultValue:\"#ffffff\"},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}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Download\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DownloadButton_1.map"],"mappings":"wMAGG,SAAwB,EAAS,EAAM,CAAC,GAAK,CAAC,WAAS,QAAM,OAAK,QAAM,OAAK,SAAO,gBAAc,iBAAe,oBAAkB,mBAAiB,gBAAc,GAAM,eAAa,iBAAe,kBAAgB,qBAAmB,oBAAkB,iBAAe,GAAM,QAAM,EAAY,EAAa,EAAc,GAAG,EAAc,KAAK,EAAe,KAAK,EAAkB,KAAK,EAAiB,IAAI,GAAG,EAAO,IAAU,EAAQ,EAAe,GAAG,EAAe,KAAK,EAAgB,K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