{"version":3,"file":"FileDownloadButton.DA6e0PBx.mjs","names":["useState","__esmMin","_e","c","init_jsx_runtime","ce","init_npm_react_18_3_1","motion","init_framer_motion_DhsWWWsN","addPropertyControls","init_framer_BWFVvmND","ControlType","FileDownloadButton","props","blobUrl","setBlobUrl","initializeBlob","file","blob","button","fileName","fill","fontColor","pointerCursor","paddingIsMixed","paddingTopLeft","paddingTopRight","paddingBottomRight","paddingBottomLeft","padding","radiusIsMixed","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","radius","font","style","hoverFill","hoverFontColor","text","buttonLayer","effects","effectsDefault","init_FileDownloadButton"],"sources":["https:/framerusercontent.com/modules/hcSHXe8COGYvegLWWZnI/Ey7ruWEayAOBCF3E888q/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{file=\"https://framerusercontent.com/assets/MLWPbW1dUQawJLhhun3dBwpgJak.mp4\",fileName,text,fill,fontColor,hoverFill,hoverFontColor,font,paddingIsMixed,paddingTopLeft,paddingTopRight,paddingBottomRight,paddingBottomLeft,padding,radiusIsMixed,radiusTopLeft,radiusTopRight,radiusBottomRight,radiusBottomLeft,radius,pointerCursor,effects,style}=props;const[blobUrl,setBlobUrl]=useState(null);const initializeBlob=async()=>{if(!file)return;const response=await fetch(file);const blob=await response.blob();const blobUrl=URL.createObjectURL(blob);setBlobUrl(blobUrl);};useEffect(()=>{initializeBlob();},[file]);let button=/*#__PURE__*/_jsx(\"a\",{href:blobUrl,download:fileName,style:{backgroundColor:fill,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"max-content\",textDecoration:\"none\",userSelect:\"none\",color:fontColor,cursor:pointerCursor?\"pointer\":\"auto\",padding:paddingIsMixed?`${paddingTopLeft}px ${paddingTopRight}px ${paddingBottomRight}px ${paddingBottomLeft}px`:`${padding}px`,borderRadius:radiusIsMixed?`${radiusTopLeft}px ${radiusTopRight}px ${radiusBottomRight}px ${radiusBottomLeft}px`:`${radius}px`,//border: `1px solid rgba(22,26,30,.15)`,\ntransition:\"background-color 0.2s ease, color 0.2s ease\",...font,...style},onMouseEnter:e=>{if(hoverFill)e.currentTarget.style.backgroundColor=hoverFill;if(hoverFontColor)e.currentTarget.style.color=hoverFontColor;},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=fill;e.currentTarget.style.color=fontColor;},children:text});let buttonLayer=button;if(effects){buttonLayer=/*#__PURE__*/_jsx(motion.div,{whileHover:{scale:effects.hoverScale},whileTap:{scale:effects.pressScale},initial:false,transition:effects.transition,style:{...style},children:button});}return buttonLayer;}FileDownloadButton.displayName=\"Boton Descargar Archivo\";const effectsDefault={hoverScale:1.1,pressScale:.9};addPropertyControls(FileDownloadButton,{file:{title:\"File\",type:ControlType.File,allowedFileTypes:[]},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\"},hoverFill:{type:ControlType.Color,defaultValue:\"#D4D4D4\",optional:true,title:\"Hover Fill\"},hoverFontColor:{type:ControlType.Color,defaultValue:\"#000\",optional:true,title:\"Hover Font Color\"},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\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FileDownloadButton.map"],"mappings":"A,kOAGG,SAAwBY,EAAmB,EAAM,CAAC,GAAK,CAAC,OAAK,uEAAuE,WAAS,OAAK,OAAK,YAAU,YAAU,iBAAe,OAAK,iBAAe,iBAAe,kBAAgB,qBAAmB,oBAAkB,UAAQ,gBAAc,gBAAc,iBAAe,oBAAkB,mBAAiB,SAAO,gBAAc,UAAQ,SAAOC,EAAW,CAACC,EAAQC,GAAYf,EAAS,IAAI,EAAQgB,EAAe,SAAS,CAAC,GAAG,CAACC,EAAK,OAAwC,IAAMC,EAAK,MAAM,MAA7B,MAAMD,CAAI,EAAA,CAA4B,KAAK,EAAQH,EAAQ,IAAI,gBAAgBI,CAAI,EAAEH,EAAWD,CAAO,CAAE,EAAET,MAAc,CAACW,EAAe,CAAE,EAAE,CAACC,CAAI,CAAC,EAAE,IAAIE,EAAoB,gBAAK,IAAI,CAAC,KAAKL,EAAQ,SAASM,EAAS,MAAM,CAAC,gBAAgBC,EAAK,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,MAAM,cAAc,eAAe,OAAO,WAAW,OAAO,MAAMC,EAAU,OAAOC,EAAc,UAAU,OAAO,QAAQC,EAAe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