{"version":3,"file":"Download_button.DPVAY3f0.mjs","names":[],"sources":["https:/framerusercontent.com/modules/YM3cFlUZBbmW184BQxFz/cpt8dj5kKaCc9GQNDEfy/Download_button.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";// Learn more: https://www.framer.com/docs/guides/overrides/\n// By Vinaykumar C (www.linkedin.com/in/vinay-sc)\nexport default function Download(props){const{title,tint,style,file,downloadFileName}=props;const downloadFile=()=>{fetch(file).then(response=>response.blob()).then(blob=>{const url=window.URL.createObjectURL(blob);const link=document.createElement(\"a\");link.href=url;link.download=downloadFileName||getFileNameFromUrl(file)||\"download\";document.body.appendChild(link);link.click();document.body.removeChild(link);window.URL.revokeObjectURL(url);}).catch(error=>{console.error(\"Error downloading the file:\",error);});};return /*#__PURE__*/_jsx(motion.div,{style:{...style,...containerStyle},children:/*#__PURE__*/_jsxs(motion.div,{onTap:downloadFile,style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:\"8px\",padding:\"13px 20px\",borderRadius:\"4px\",backgroundColor:\"#E84029\",color:\"#FFFFFF\",fontSize:\"22px\",fontFamily:\"Gilmer Bold, sans-serif\",fontWeight:\"bold\",cursor:\"pointer\",width:\"fit-content\",userSelect:\"none\"},whileHover:{scale:1.01},children:[title,/*#__PURE__*/_jsx(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",width:\"20\",height:\"20\",fill:\"none\",viewBox:\"0 0 24 24\",stroke:\"currentColor\",strokeWidth:2,children:/*#__PURE__*/_jsx(\"path\",{strokeLinecap:\"round\",strokeLinejoin:\"round\",d:\"M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5m0 0l5-5m-5 5V4\"})})]})});}Download.defaultProps={tint:\"#09F\",title:\"Download Fonts\",downloadFileName:\"\"};addPropertyControls(Download,{tint:{title:\"Tint\",type:ControlType.Color},title:{title:\"Label\",type:ControlType.String},file:{title:\"File\",type:ControlType.File,allowedFileTypes:[]},downloadFileName:{title:\"Download File Name\",type:ControlType.String,defaultValue:\"\"}});const containerStyle={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\"};function getFileNameFromUrl(url){const decodedUrl=decodeURIComponent(url);const parts=decodedUrl.split(\"/\");return parts[parts.length-1];}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Download\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Download_button.map"],"mappings":"gWAEA,SAAwB,EAAS,EAAM,CAAC,GAAK,CAAC,QAAM,OAAK,QAAM,OAAK,mBAAiB,CAAC,EAAY,MAAiB,CAAC,MAAM,GAAM,KAAK,GAAU,EAAS,QAAQ,KAAK,GAAM,CAAC,IAAM,EAAI,EAAO,IAAI,gBAAgB,GAAY,EAAK,SAAS,cAAc,KAAK,EAAK,KAAK,EAAI,EAAK,SAAS,GAAkB,EAAmB,IAAO,WAAW,SAAS,KAAK,YAAY,GAAM,EAAK,QAAQ,SAAS,KAAK,YAAY,GAAM,EAAO,IAAI,gBAAgB,EAAM,GAAE,MAAM,GAAO,CAAC,QAAQ,MAAM,8BAA8B,EAAQ,EAAG,EAAC,OAAoB,EAAK,EAAO,IAAI,CAAC,MAAM,CAAC,GAAG,EAAM,GAAG,EAAe,CAAC,SAAsB,EAAM,EAAO,IAAI,CAAC,MAAM,EAAa,MAAM,CAAC,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,IAAI,MAAM,QAAQ,YAAY,aAAa,MAAM,gBAAgB,UAAU,MAAM,UAAU,SAAS,OAAO,WAAW,0BAA0B,WAAW,OAAO,OAAO,UAAU,MAAM,cAAc,WAAW,OAAO,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,SAAS,CAAC,EAAmB,EAAK,MAAM,CAAC,MAAM,6BAA6B,MAAM,KAAK,OAAO,KA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