{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/tW1ExjbbJRt9YcZ0Gyxk/7xLQ6of7kXWmBUVuRiYG/Spotify.js"],
  "sourcesContent": ["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { addPropertyControls, ControlType } from \"framer\";\nimport { useCallback } from \"react\";\nconst urlRegex = /(https?:\\/\\/[^ ]*)/; /**\n                                       * SPOTIFY\n                                       *\n                                       * @framerIntrinsicWidth 280\n                                       * @framerIntrinsicHeight 350\n                                       */\nexport function Spotify(props) {\n  const {\n    theme,\n    url: sourceUrl\n  } = props;\n  const createEmbedUrl = useCallback(() => {\n    if (sourceUrl.length < 5) return null; // If someone pastes the embed code lets still try to render it\n    const strippedUrl = sourceUrl.includes(\"iframe\") ? sourceUrl.match(urlRegex)[1].replace(`\"`, \"\") : sourceUrl;\n    const url = new URL(strippedUrl); // Add embed prefix if needed\n    if (!url.pathname.includes(\"embed\")) url.pathname = `/embed${url.pathname}`; // Remove params\n    url.search = `theme=${theme}`; // @ben you could add all other bools in here like\n    // url.search = `theme=${theme}&dog=${cat}`\n    return url.toString();\n  }, [theme, sourceUrl]);\n  const identifier = createEmbedUrl();\n  return /*#__PURE__*/_jsx(\"iframe\", {\n    style: {\n      height: \"100%\",\n      width: \"100%\"\n    },\n    frameBorder: 0,\n    src: identifier\n  });\n}\nSpotify.defaultProps = {\n  url: \"https://open.spotify.com/album/31qVWUdRrlb8thMvts0yYL?si=Jl-8Mnc3RNGuOtqRC7NXVg\",\n  width: 280,\n  height: 350,\n  theme: 1\n};\naddPropertyControls(Spotify, {\n  url: {\n    type: ControlType.String,\n    title: \"URL\"\n  },\n  theme: {\n    type: ControlType.Enum,\n    displaySegmentedControl: true,\n    options: [1, 0],\n    optionTitles: [\"On\", \"Off\"]\n  }\n});\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"Spotify\": {\n      \"type\": \"reactComponent\",\n      \"name\": \"Spotify\",\n      \"slots\": [],\n      \"annotations\": {\n        \"framerContractVersion\": \"1\",\n        \"framerIntrinsicHeight\": \"350\",\n        \"framerIntrinsicWidth\": \"280\"\n      }\n    }\n  }\n};\n//# sourceMappingURL=./Spotify.map"],
  "mappings": "gGAGA,IAAMA,EAAW,qBAMV,SAASC,EAAQC,EAAO,CAC7B,GAAM,CACJ,MAAAC,EACA,IAAKC,CACP,EAAIF,EAUEG,EATiBC,EAAY,IAAM,CACvC,GAAIF,EAAU,OAAS,EAAG,OAAO,KACjC,IAAMG,EAAcH,EAAU,SAAS,QAAQ,EAAIA,EAAU,MAAMJ,CAAQ,EAAE,CAAC,EAAE,QAAQ,IAAK,EAAE,EAAII,EAC7FI,EAAM,IAAI,IAAID,CAAW,EAC/B,OAAKC,EAAI,SAAS,SAAS,OAAO,IAAGA,EAAI,SAAW,SAASA,EAAI,YACjEA,EAAI,OAAS,SAASL,IAEfK,EAAI,SAAS,CACtB,EAAG,CAACL,EAAOC,CAAS,CAAC,EACa,EAClC,OAAoBK,EAAK,SAAU,CACjC,MAAO,CACL,OAAQ,OACR,MAAO,MACT,EACA,YAAa,EACb,IAAKJ,CACP,CAAC,CACH,CACAJ,EAAQ,aAAe,CACrB,IAAK,kFACL,MAAO,IACP,OAAQ,IACR,MAAO,CACT,EACAS,EAAoBT,EAAS,CAC3B,IAAK,CACH,KAAMU,EAAY,OAClB,MAAO,KACT,EACA,MAAO,CACL,KAAMA,EAAY,KAClB,wBAAyB,GACzB,QAAS,CAAC,EAAG,CAAC,EACd,aAAc,CAAC,KAAM,KAAK,CAC5B,CACF,CAAC",
  "names": ["urlRegex", "Spotify", "props", "theme", "sourceUrl", "identifier", "te", "strippedUrl", "url", "p", "addPropertyControls", "ControlType"]
}
