{"version":3,"file":"FileDownloadButton.BUckoIPN.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/0IaItUosTlBPCy6UbZMV/HU1a7jGWp1wnPUwWtakC/FileDownloadButton.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";import{useState,useEffect}from\"react\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function FileDownloadButton(props){const[blobUrl,setBlobUrl]=useState(null);const initializeBlob=async()=>{const response=await fetch(props.file);const blob=await response.blob();const blobUrl=URL.createObjectURL(blob);setBlobUrl(blobUrl);};useEffect(()=>{initializeBlob();},[]);const button=/*#__PURE__*/_jsx(motion.a,{href:blobUrl,download:props.fileName,whileHover:{textDecoration:\"underline\"},style:{backgroundColor:props.fill,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"max-content\",textDecoration:\"none\",userSelect:\"none\",color:props.fontColor,cursor:props.pointerCursor?\"pointer\":\"auto\",...props.font,fontSize:14,lineHeight:\"18px\",padding:props.paddingIsMixed?`${props.paddingTopLeft}px ${props.paddingTopRight}px ${props.paddingBottomRight}px ${props.paddingBottomLeft}px`:`${props.padding}px`,borderRadius:props.radiusIsMixed?`${props.radiusTopLeft}px ${props.radiusTopRight}px ${props.radiusBottomRight}px ${props.radiusBottomLeft}px`:`${props.radius}px`,...props.style},children:props.text});let buttonLayer=button;if(props.effects){buttonLayer=/*#__PURE__*/_jsx(motion.div,{whileHover:{scale:props.effects.hoverScale},whileTap:{scale:props.effects.pressScale},initial:false,transition:props.effects.transition,children:button});}return buttonLayer;}FileDownloadButton.displayName=\"File Download Button\";const effectsDefault={hoverScale:1.1,pressScale:.9};addPropertyControls(FileDownloadButton,{file:{type:ControlType.File,allowedFileTypes:[],description:\"Up to 50MB\"},fileName:{type:ControlType.String,placeholder:\"File\"},text:{type:ControlType.String,defaultValue:\"Download\"},fill:{type:ControlType.Color,defaultValue:\"#EDEDED\",optional:true},fontColor:{type:ControlType.Color,defaultValue:\"#000\"},font:{type:\"font\",controls:\"extended\"},padding:{type:ControlType.FusedNumber,defaultValue:12,toggleKey:\"paddingIsMixed\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"paddingTopLeft\",\"paddingTopRight\",\"paddingBottomRight\",\"paddingBottomLeft\"],valueLabels:[\"T\",\"R\",\"B\",\"L\"],min:0},radius:{type:ControlType.FusedNumber,defaultValue:8,toggleKey:\"radiusIsMixed\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"radiusTopLeft\",\"radiusTopRight\",\"radiusBottomRight\",\"radiusBottomLeft\"],valueLabels:[\"TL\",\"TR\",\"BR\",\"BL\"],min:0},pointerCursor:{type:ControlType.Boolean,defaultValue:true},effects:{type:ControlType.Object,defaultValue:effectsDefault,optional:true,buttonTitle:\"Hover & Press\",icon:\"effect\",controls:{hoverScale:{type:ControlType.Number,defaultValue:effectsDefault.hoverScale,min:0,step:.01,displayStepper:true},pressScale:{type:ControlType.Number,defaultValue:effectsDefault.pressScale,min:0,step:.01,displayStepper:true},transition:{type:ControlType.Transition}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FileDownloadButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FileDownloadButton.map"],"mappings":"kOAGG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,EAAQ,GAAYA,EAAS,IAAI,EAAQ,EAAe,SAAS,CAAwC,IAAM,EAAK,MAAM,MAAnC,MAAM,EAAM,IAAI,EAAA,CAA4B,KAAK,EAAQ,EAAQ,IAAI,gBAAgB,CAAI,EAAE,EAAW,CAAO,CAAE,EAAE,MAAc,CAAC,EAAe,CAAE,EAAE,CAAC,CAAC,EAAE,IAAM,EAAoB,EAAK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