{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/kBkaj3LmBqcSU2IkUsBC/kvFSr6fSU7VcYZyNyfaK/Download.js"],
  "sourcesContent": ["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { addPropertyControls, ControlType } from \"framer\";\nimport { motion } from \"framer-motion\";\nvar IconType;\n(function (IconType) {\n  IconType[\"Default\"] = \"Default\";\n  IconType[\"Custom\"] = \"Custom\";\n})(IconType || (IconType = {}));\nvar SrcType;\n(function (SrcType) {\n  SrcType[\"Upload\"] = \"Upload\";\n  SrcType[\"URL\"] = \"URL\";\n})(SrcType || (SrcType = {})); // Check for the Search Index Meta Tag\n// Currently the only way to differenciate between Preview & Publish\nconst metaTagSelector = 'meta[name=\"framer-search-index\"]'; // We can hopefully remove this check when new Preview ships\nfunction isPublishedSiteOrSSG() {\n  if (typeof document === \"undefined\") return true;\n  const metaTag = document.querySelector(metaTagSelector);\n  return !!metaTag;\n} /**\n  *\n  * DOWNLOAD\n  * By Hunter\n  *\n  * @framerIntrinsicWidth 200\n  * @framerIntrinsicHeight 100\n  *\n  * @framerDisableUnlink\n  *\n  * @framerSupportedLayoutWidth any\n  * @framerSupportedLayoutHeight any\n  */\nexport default function Download(props) {\n  const {\n    styleOptions,\n    hoverOptions,\n    iconOptions\n  } = props;\n  const {\n    backgroundColor,\n    color,\n    borderRadius,\n    padding,\n    paddingPerSide,\n    paddingTop,\n    paddingRight,\n    paddingBottom,\n    paddingLeft,\n    gap\n  } = styleOptions;\n  const isInPublishedSiteOrSSG = isPublishedSiteOrSSG();\n  let downloadURL = undefined;\n  if (isInPublishedSiteOrSSG) {\n    if (props.srcType === SrcType.URL) downloadURL = props.srcURL;\n    if (props.srcType === SrcType.Upload) downloadURL = props.srcFile;\n  }\n  const paddingValue = paddingPerSide ? `${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px` : `${padding}px`;\n  const getIcon = () => {\n    var ref, ref1;\n    if (!iconOptions) return;\n    const iconStyle = {\n      order: iconOptions.alignment === \"start\" ? 0 : 2,\n      flexShrink: 0\n    };\n    return iconOptions.type === IconType.Custom && !!((ref = iconOptions.image) === null || ref === void 0 ? void 0 : ref.src) ? /*#__PURE__*/_jsx(\"img\", {\n      style: iconStyle,\n      alt: ((ref1 = iconOptions.image) === null || ref1 === void 0 ? void 0 : ref1.alt) && iconOptions.image.alt.length > 0 ? iconOptions.image.alt : \"download icon\",\n      src: iconOptions.image.src,\n      width: iconOptions.size,\n      height: iconOptions.size\n    }) : /*#__PURE__*/_jsx(\"svg\", {\n      style: iconStyle,\n      xmlns: \"http://www.w3.org/2000/svg\",\n      width: iconOptions.size,\n      height: iconOptions.size,\n      fill: iconOptions.color,\n      viewBox: \"0 0 256 256\",\n      children: /*#__PURE__*/_jsx(\"path\", {\n        d: \"M228 152v56a20 20 0 0 1-20 20H48a20 20 0 0 1-20-20v-56a12 12 0 0 1 24 0v52h152v-52a12 12 0 0 1 24 0Zm-108.49 8.49a12 12 0 0 0 17 0l40-40a12 12 0 0 0-17-17L140 123V40a12 12 0 0 0-24 0v83l-19.51-19.49a12 12 0 0 0-17 17Z\"\n      })\n    });\n  };\n  const getCursor = () => {\n    if (props.srcType === SrcType.URL && props.srcURL) return \"pointer\";\n    if (props.srcType === SrcType.Upload && props.srcFile) return \"pointer\";\n    return \"auto\";\n  };\n  const buttonTitle = isInPublishedSiteOrSSG ? \"Download File\" : \"Publish to Download\";\n  return /*#__PURE__*/_jsxs(motion.a, {\n    target: \"_blank\",\n    href: downloadURL,\n    download: true,\n    title: buttonTitle,\n    style: {\n      gap,\n      fontSize: 16,\n      lineHeight: 1,\n      fontFamily: \"Inter\",\n      fontWeight: 500,\n      width: \"max-content\",\n      ...props.style,\n      ...buttonStyles,\n      ...props.fontControl,\n      padding: paddingValue,\n      color: color,\n      backgroundColor: backgroundColor,\n      borderRadius: borderRadius,\n      userSelect: \"none\",\n      placeContent: flexAlignSwitch(props.fontControl),\n      whiteSpace: \"nowrap\",\n      cursor: getCursor()\n    },\n    whileHover: hoverOptions,\n    transition: hoverOptions === null || hoverOptions === void 0 ? void 0 : hoverOptions.transition,\n    children: [getIcon(), props.text]\n  });\n}\n;\nDownload.displayName = \"Download\";\naddPropertyControls(Download, {\n  text: {\n    title: \"Text\",\n    type: ControlType.String,\n    defaultValue: \"Download\"\n  },\n  srcType: {\n    type: ControlType.Enum,\n    displaySegmentedControl: true,\n    title: \"Source\",\n    options: [SrcType.Upload, SrcType.URL]\n  },\n  srcURL: {\n    type: ControlType.String,\n    title: \" \",\n    placeholder: \"../example.pdf\",\n    hidden: props => props.srcType === SrcType.Upload\n  },\n  srcFile: {\n    type: ControlType.File,\n    title: \" \",\n    allowedFileTypes: [],\n    hidden: props => props.srcType === SrcType.URL\n  },\n  fontControl: {\n    // @ts-ignore - Internal\n    type: ControlType.Font,\n    title: \"Font\",\n    controls: \"extended\"\n  },\n  iconOptions: {\n    type: ControlType.Object,\n    optional: true,\n    title: \"Icon\",\n    buttonTitle: \"Size, Color\",\n    controls: {\n      type: {\n        title: \"Type\",\n        type: ControlType.Enum,\n        options: Object.values(IconType),\n        optionTitles: Object.values(IconType),\n        displaySegmentedControl: true\n      },\n      color: {\n        title: \"Color\",\n        type: ControlType.Color,\n        defaultValue: \"#FFF\",\n        hidden: props => props.type === IconType.Custom\n      },\n      image: {\n        title: \"File\",\n        type: ControlType.ResponsiveImage,\n        allowedFileTypes: [\"jpg\", \"png\", \"svg\"],\n        hidden: props => props.type === IconType.Default\n      },\n      size: {\n        type: ControlType.Number,\n        displayStepper: true,\n        min: 5,\n        defaultValue: 16,\n        max: 250\n      },\n      alignment: {\n        title: \"Align\",\n        type: ControlType.Enum,\n        displaySegmentedControl: true,\n        options: [\"start\", \"end\"],\n        optionTitles: [\"Start\", \"End\"]\n      }\n    }\n  },\n  styleOptions: {\n    type: ControlType.Object,\n    title: \"Styles\",\n    buttonTitle: \"Button, Font\",\n    controls: {\n      backgroundColor: {\n        type: ControlType.Color,\n        title: \"Fill\",\n        defaultValue: \"#111\"\n      },\n      color: {\n        type: ControlType.Color,\n        defaultValue: \"#FFF\"\n      },\n      borderRadius: {\n        type: ControlType.Number,\n        title: \"Radius\",\n        displayStepper: true,\n        defaultValue: 50\n      },\n      padding: {\n        title: \"Padding\",\n        type: ControlType.FusedNumber,\n        toggleKey: \"paddingPerSide\",\n        toggleTitles: [\"Padding\", \"Padding per side\"],\n        defaultValue: 10,\n        valueKeys: [\"paddingTop\", \"paddingRight\", \"paddingBottom\", \"paddingLeft\"],\n        valueLabels: [\"T\", \"R\", \"B\", \"L\"],\n        min: 0\n      },\n      gap: {\n        title: \"Gap\",\n        type: ControlType.Number,\n        displayStepper: true,\n        defaultValue: 5\n      }\n    }\n  },\n  hoverOptions: {\n    type: ControlType.Object,\n    title: \"Hover\",\n    buttonTitle: \"Effect\",\n    optional: true,\n    controls: {\n      scale: {\n        type: ControlType.Number,\n        title: \"Scale\",\n        min: 0,\n        max: 10,\n        displayStepper: true,\n        step: .01,\n        defaultValue: 1.1\n      },\n      backgroundColor: {\n        type: ControlType.Color,\n        title: \"Fill\",\n        defaultValue: \"#333\",\n        optional: true\n      },\n      color: {\n        type: ControlType.Color,\n        title: \"Color\",\n        defaultValue: \"#FFF\",\n        optional: true\n      },\n      transition: {\n        type: ControlType.Transition,\n        title: \"Transition\",\n        defaultValue: {\n          type: \"spring\",\n          stiffness: 400,\n          damping: 30\n        }\n      }\n    }\n  }\n});\nconst buttonStyles = {\n  display: \"flex\",\n  placeItems: \"center\",\n  placeContent: \"center\",\n  textDecoration: \"none\"\n}; /* Match flex content alignment with text align */\nconst flexAlignSwitch = fontControlStyles => {\n  if (!(fontControlStyles === null || fontControlStyles === void 0 ? void 0 : fontControlStyles.textAlign)) {\n    return \"left\";\n  }\n  if (fontControlStyles.textAlign === \"left\") {\n    return \"flex-start\";\n  }\n  if (fontControlStyles.textAlign === \"right\") {\n    return \"flex-end\";\n  }\n  return \"center\";\n};\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"default\": {\n      \"type\": \"reactComponent\",\n      \"name\": \"Download\",\n      \"slots\": [],\n      \"annotations\": {\n        \"framerIntrinsicHeight\": \"100\",\n        \"framerContractVersion\": \"1\",\n        \"framerDisableUnlink\": \"*\",\n        \"framerSupportedLayoutWidth\": \"any\",\n        \"framerSupportedLayoutHeight\": \"any\",\n        \"framerIntrinsicWidth\": \"200\"\n      }\n    },\n    \"__FramerMetadata__\": {\n      \"type\": \"variable\"\n    }\n  }\n};\n//# sourceMappingURL=./Download.map"],
  "mappings": "uGAGA,IAAIA,GACH,SAAUA,EAAU,CACnBA,EAAS,QAAa,UACtBA,EAAS,OAAY,QACvB,GAAGA,IAAaA,EAAW,CAAC,EAAE,EAC9B,IAAIC,GACH,SAAUA,EAAS,CAClBA,EAAQ,OAAY,SACpBA,EAAQ,IAAS,KACnB,GAAGA,IAAYA,EAAU,CAAC,EAAE,EAE5B,IAAMC,EAAkB,mCACxB,SAASC,GAAuB,CAC9B,OAAI,OAAO,SAAa,IAAoB,GAErC,CAAC,CADQ,SAAS,cAAcD,CAAe,CAExD,CAae,SAARE,EAA0BC,EAAO,CACtC,GAAM,CACJ,aAAAC,EACA,aAAAC,EACA,YAAAC,CACF,EAAIH,EACE,CACJ,gBAAAI,EACA,MAAAC,EACA,aAAAC,EACA,QAAAC,EACA,eAAAC,EACA,WAAAC,EACA,aAAAC,EACA,cAAAC,EACA,YAAAC,EACA,IAAAC,CACF,EAAIZ,EACEa,EAAyBhB,EAAqB,EAChDiB,EACAD,IACEd,EAAM,UAAYJ,EAAQ,MAAKmB,EAAcf,EAAM,QACnDA,EAAM,UAAYJ,EAAQ,SAAQmB,EAAcf,EAAM,UAE5D,IAAMgB,EAAeR,EAAiB,GAAGC,OAAgBC,OAAkBC,OAAmBC,MAAkB,GAAGL,MAC7GU,EAAU,IAAM,CACpB,IAAIC,EAAKC,EACT,GAAI,CAAChB,EAAa,OAClB,IAAMiB,EAAY,CAChB,MAAOjB,EAAY,YA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AAMA,EAAY,OAClB,MAAO,SACP,eAAgB,GAChB,aAAc,EAChB,EACA,QAAS,CACP,MAAO,UACP,KAAMA,EAAY,YAClB,UAAW,iBACX,aAAc,CAAC,UAAW,kBAAkB,EAC5C,aAAc,GACd,UAAW,CAAC,aAAc,eAAgB,gBAAiB,aAAa,EACxE,YAAa,CAAC,IAAK,IAAK,IAAK,GAAG,EAChC,IAAK,CACP,EACA,IAAK,CACH,MAAO,MACP,KAAMA,EAAY,OAClB,eAAgB,GAChB,aAAc,CAChB,CACF,CACF,EACA,aAAc,CACZ,KAAMA,EAAY,OAClB,MAAO,QACP,YAAa,SACb,SAAU,GACV,SAAU,CACR,MAAO,CACL,KAAMA,EAAY,OAClB,MAAO,QACP,IAAK,EACL,IAAK,GACL,eAAgB,GAChB,KAAM,IACN,aAAc,GAChB,EACA,gBAAiB,CACf,KAAMA,EAAY,MAClB,MAAO,OACP,aAAc,OACd,SAAU,EACZ,EACA,MAAO,CACL,KAAMA,EAAY,MAClB,MAAO,QACP,aAAc,OACd,SAAU,EACZ,EACA,WAAY,CACV,KAAMA,EAAY,WAClB,MAAO,aACP,aAAc,CACZ,KAAM,SACN,UAAW,IACX,QAAS,EACX,CACF,CACF,CACF,CACF,CAAC,EACD,IAAMH,EAAe,CACnB,QAAS,OACT,WAAY,SACZ,aAAc,SACd,eAAgB,MAClB,EACMC,EAAkBG,GACsDA,GAAkB,UAG1FA,EAAkB,YAAc,OAC3B,aAELA,EAAkB,YAAc,QAC3B,WAEF,SARE",
  "names": ["IconType", "SrcType", "metaTagSelector", "isPublishedSiteOrSSG", "Download", "props", "styleOptions", "hoverOptions", "iconOptions", "backgroundColor", "color", "borderRadius", "padding", "paddingPerSide", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "gap", "isInPublishedSiteOrSSG", "downloadURL", "paddingValue", "getIcon", "ref", "ref1", "iconStyle", "p", "getCursor", "buttonTitle", "u", "motion", "buttonStyles", "flexAlignSwitch", "addPropertyControls", "ControlType", "fontControlStyles"]
}
