{
  "version": 3,
  "sources": ["ssg:https://framer.com/m/framer/integrations-styles.js@^0.2.0", "ssg:https://framerusercontent.com/modules/3VbLlIQuOMJh9PZyYR3D/xG8adK1glTAxJchw5bER/ProductHunt.js"],
  "sourcesContent": ["import{containerStyles,emptyStateStyle as defaultEmptyStateStyle}from\"https://framer.com/m/framer/default-utils.js@^0.43.0\";export const emptyStateStyle={...containerStyles,...defaultEmptyStateStyle,textAlign:\"center\",padding:15,width:200,height:100,overflow:\"hidden\"};export const neutralStateStyle={...emptyStateStyle,color:\"#09f\",background:\"rgb(0, 153, 255, 0.1)\",borderColor:\"#09f\"};export const stateTitleStyle={fontSize:12,fontWeight:600,margin:0};export const stateParagraphStyle={fontSize:12,maxWidth:200,lineHeight:1.4,margin:\"5px 0 0 0\"};\nexport const __FramerMetadata__ = {\"exports\":{\"neutralStateStyle\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"stateTitleStyle\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"emptyStateStyle\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"stateParagraphStyle\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./styles.map", "import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { addPropertyControls, ControlType, motion } from \"framer\";\nimport { containerStyles } from \"https://framer.com/m/framer/default-utils.js@^0.45.0\";\nimport { useMemo } from \"react\";\nimport { emptyStateStyle, stateParagraphStyle, stateTitleStyle } from \"https://framer.com/m/framer/integrations-styles.js@^0.2.0\";\nconst BADGES = {\n  featured: \"featured.svg\",\n  top: \"top-post-badge.svg\",\n  review: \"review.svg\"\n};\nconst productHuntRegex = /^https?:\\/\\/(?:www\\.)?producthunt\\.com\\/posts\\/([^\\/]*)/; /**\n                                                                                    * PRODUCT HUNT\n                                                                                    *\n                                                                                    * @framerIntrinsicWidth 250\n                                                                                    * @framerIntrinsicHeight 54\n                                                                                    *\n                                                                                    * @framerSupportedLayoutWidth auto\n                                                                                    * @framerSupportedLayoutHeight auto\n                                                                                    */\nexport default function ProductHunt({\n  url,\n  type,\n  theme,\n  style,\n  ...props\n}) {\n  const badgeUrl = useMemo(() => {\n    var ref;\n    const [, id] = (ref = url.match(productHuntRegex)) !== null && ref !== void 0 ? ref : [null, \"\"];\n    if (!id) return null;\n    return `https://api.producthunt.com/widgets/embed-image/v1/${BADGES[type]}?post_id=${id}&theme=${theme}`;\n  }, [url, type, theme]);\n  return /*#__PURE__*/_jsx(motion.div, {\n    style: {\n      ...style,\n      ...containerStyles,\n      placeContent: \"center\",\n      placeItems: \"center\",\n      overflow: \"hidden\"\n    },\n    ...props,\n    children: badgeUrl ? /*#__PURE__*/_jsx(motion.a, {\n      href: url,\n      target: \"_blank\",\n      style: {\n        ...style,\n        width: 250,\n        height: 54\n      },\n      ...props,\n      children: /*#__PURE__*/_jsx(\"img\", {\n        src: badgeUrl,\n        alt: \"Product Hunt Badge\",\n        width: \"250\",\n        height: \"54\"\n      })\n    }) : /*#__PURE__*/_jsxs(motion.div, {\n      style: {\n        ...emptyStateStyle,\n        ...style\n      },\n      ...props,\n      children: [/*#__PURE__*/_jsx(\"h1\", {\n        style: stateTitleStyle,\n        children: \"Product Hunt\"\n      }), /*#__PURE__*/_jsx(\"p\", {\n        style: stateParagraphStyle,\n        children: \"Set a product URL in the Properties.\"\n      })]\n    })\n  });\n}\n;\naddPropertyControls(ProductHunt, {\n  url: {\n    type: ControlType.String,\n    title: \"URL\",\n    placeholder: \"https://www.producthunt.com/posts/***\",\n    defaultValue: \"https://www.producthunt.com/posts/framer-for-web\"\n  },\n  type: {\n    type: ControlType.Enum,\n    title: \"Type\",\n    options: [\"featured\", \"top\", \"review\"],\n    optionTitles: [\"Featured\", \"Top Post Daily\", \"Leave a Review\"],\n    defaultValue: \"featured\"\n  },\n  theme: {\n    type: ControlType.Enum,\n    options: [\"light\", \"dark\"],\n    optionTitles: [\"Light\", \"Dark\"],\n    displaySegmentedControl: true\n  }\n});\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"default\": {\n      \"type\": \"reactComponent\",\n      \"name\": \"ProductHunt\",\n      \"slots\": [],\n      \"annotations\": {\n        \"framerSupportedLayoutWidth\": \"auto\",\n        \"framerIntrinsicHeight\": \"54\",\n        \"framerContractVersion\": \"1\",\n        \"framerIntrinsicWidth\": \"250\",\n        \"framerSupportedLayoutHeight\": \"auto\"\n      }\n    },\n    \"__FramerMetadata__\": {\n      \"type\": \"variable\"\n    }\n  }\n};\n//# sourceMappingURL=./ProductHunt.map"],
  "mappings": "8JAAmI,IAAMA,EAAgB,CAAC,GAAGC,EAAgB,GAAGD,EAAuB,UAAU,SAAS,QAAQ,GAAG,MAAM,IAAI,OAAO,IAAI,SAAS,QAAQ,EAAeE,GAAkB,CAAC,GAAGF,EAAgB,MAAM,OAAO,WAAW,wBAAwB,YAAY,MAAM,EAAeG,EAAgB,CAAC,SAAS,GAAG,WAAW,IAAI,OAAO,CAAC,EAAeC,EAAoB,CAAC,SAAS,GAAG,SAAS,IAAI,WAAW,IAAI,OAAO,WAAW,ECKniB,IAAMC,EAAS,CACb,SAAU,eACV,IAAK,qBACL,OAAQ,YACV,EACMC,EAAmB,0DASV,SAARC,EAA6B,CAClC,IAAAC,EACA,KAAAC,EACA,MAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EAAG,CACD,IAAMC,EAAWC,EAAQ,IAAM,CAC7B,IAAIC,EACJ,GAAM,CAAC,CAAEC,CAAE,GAAKD,EAAMP,EAAI,MAAMF,CAAgB,KAAO,MAAQS,IAAQ,OAASA,EAAM,CAAC,KAAM,EAAE,EAC/F,OAAKC,EACE,sDAAsDX,EAAOI,CAAI,aAAaO,WAAYN,IADjF,IAElB,EAAG,CAACF,EAAKC,EAAMC,CAAK,CAAC,EACrB,OAAoBO,EAAKC,EAAO,IAAK,CACnC,MAAO,CACL,GAAGP,EACH,GAAGQ,EACH,aAAc,SACd,WAAY,SACZ,SAAU,QACZ,EACA,GAAGP,EACH,SAAUC,EAAwBI,EAAKC,EAAO,EAAG,CAC/C,KAAMV,EACN,OAAQ,SACR,MAAO,CACL,GAAGG,EACH,MAAO,IACP,OAAQ,EACV,EACA,GAAGC,EACH,SAAuBK,EAAK,MAAO,CACjC,IAAKJ,EACL,IAAK,qBACL,MAAO,MACP,OAAQ,IACV,CAAC,CACH,CAAC,EAAiBO,EAAMF,EAAO,IAAK,CAClC,MAAO,CACL,GAAGG,EACH,GAAGV,CACL,EACA,GAAGC,EACH,SAAU,CAAcK,EAAK,KAAM,CACjC,MAAOK,EACP,SAAU,cACZ,CAAC,EAAgBL,EAAK,IAAK,CACzB,MAAOM,EACP,SAAU,sCACZ,CAAC,CAAC,CACJ,CAAC,CACH,CAAC,CACH,CAEAC,EAAoBjB,EAAa,CAC/B,IAAK,CACH,KAAMkB,EAAY,OAClB,MAAO,MACP,YAAa,wCACb,aAAc,kDAChB,EACA,KAAM,CACJ,KAAMA,EAAY,KAClB,MAAO,OACP,QAAS,CAAC,WAAY,MAAO,QAAQ,EACrC,aAAc,CAAC,WAAY,iBAAkB,gBAAgB,EAC7D,aAAc,UAChB,EACA,MAAO,CACL,KAAMA,EAAY,KAClB,QAAS,CAAC,QAAS,MAAM,EACzB,aAAc,CAAC,QAAS,MAAM,EAC9B,wBAAyB,EAC3B,CACF,CAAC",
  "names": ["emptyStateStyle", "containerStyles", "neutralStateStyle", "stateTitleStyle", "stateParagraphStyle", "BADGES", "productHuntRegex", "ProductHunt", "url", "type", "theme", "style", "props", "badgeUrl", "se", "ref", "id", "p", "motion", "containerStyles", "u", "emptyStateStyle", "stateTitleStyle", "stateParagraphStyle", "addPropertyControls", "ControlType"]
}
