{"version":3,"file":"DirectLinkDownload.BVbMBfRH.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/sFARMEha3OApR1A0dK0X/vgTi9cTsnEsWATMEuelx/DirectLinkDownload.js"],"sourcesContent":["// Welcome to Code in Framer\n// Get Started: https://www.framer.com/developers/\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Download(props){// This is a React component containing an Example component\n// - Replace <Example /> with your own code\n// - Find inspiration: https://www.framer.com/developers/\nconst[hover,setHover]=useState(false);const download=()=>{if(props.url){fetch(props.url).then(resp=>resp.blob()).then(res=>{console.log(111111,props);const blockURL=URL.createObjectURL(res);const link=document.createElement(\"a\");link.href=blockURL;link.download=props.fileName;link.click();URL.revokeObjectURL(link.href);});}};return /*#__PURE__*/_jsx(\"span\",{style:{...containerStyle,color:hover?\"#06E9EF\":\"#3a3a3a\"},onClick:download,onMouseEnter:()=>setHover(true),onMouseLeave:()=>setHover(false),children:props.text||\"direct link.\"});}// Styles are written in object syntax\n// Learn more: https://reactjs.org/docs/dom-elements.html#style\nconst containerStyle={textDecoration:\"underline\",cursor:\"pointer\",fontSize:\"18px\",fontFamily:\"Poppins\",lineHeight:\"150%\"};addPropertyControls(Download,{url:{title:\"URL\",type:ControlType.String},fileName:{title:\"File Name\",type:ControlType.String},text:{title:\"Text\",type:ControlType.String}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Download\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DirectLinkDownload.map"],"mappings":"0KAQG,SAAwB,EAAS,EAAM,CAG1C,GAAK,CAAC,EAAM,GAAUA,EAAS,GAAM,CAAO,MAAa,CAAI,EAAM,KAAK,MAAM,EAAM,IAAI,CAAC,KAAK,GAAM,EAAK,MAAM,CAAC,CAAC,KAAK,GAAK,CAAC,QAAQ,IAAI,OAAO,EAAM,CAAC,IAAM,EAAS,IAAI,gBAAgB,EAAI,CAAO,EAAK,SAAS,cAAc,IAAI,CAAC,EAAK,KAAK,EAAS,EAAK,SAAS,EAAM,SAAS,EAAK,OAAO,CAAC,IAAI,gBAAgB,EAAK,KAAK,EAAG,EAAI,OAAoB,EAAK,OAAO,CAAC,MAAM,CAAC,GAAG,EAAe,MAAM,EAAM,UAAU,UAAU,CAAC,QAAQ,EAAS,iBAAiB,EAAS,GAAK,CAAC,iBAAiB,EAAS,GAAM,CAAC,SAAS,EAAM,MAAM,eAAe,CAAC,oBAT9e,IAA4B,IAAoD,CAWrH,EAAe,CAAC,eAAe,YAAY,OAAO,UAAU,SAAS,OAAO,WAAW,UAAU,WAAW,OAAO,CAAC,EAAoB,EAAS,CAAC,IAAI,CAAC,MAAM,MAAM,KAAK,EAAY,OAAO,CAAC,SAAS,CAAC,MAAM,YAAY,KAAK,EAAY,OAAO,CAAC,KAAK,CAAC,MAAM,OAAO,KAAK,EAAY,OAAO,CAAC,CAAC"}