{"version":3,"file":"PodcastSeo.CENWr2h8.mjs","names":[],"sources":["https:/framerusercontent.com/modules/TQRUbTnZbyBNEHAULj6A/L93SbwC9HmjBXeO966E1/PodcastSeo.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect}from\"react\";/*\nUser request:\nCreate PodcastSeo.tsx with two named code overrides:\n- withPodcastSeriesSeo: inject PodcastSeries JSON-LD for EBPM新聞 episodes index.\n- withPodcastEpisodeSeo: inject PodcastEpisode JSON-LD from visible H1, URL, meta description, and visible date text when present.\n- Prevent duplicates via unique data attributes and cleanup only injected tags.\n*/function injectJsonLd(tagId,payload){if(typeof document===\"undefined\")return()=>{};const selector=`script[data-ebpm-seo=\"${tagId}\"]`;const existing=document.head.querySelector(selector);if(existing)return()=>{};const script=document.createElement(\"script\");script.type=\"application/ld+json\";script.setAttribute(\"data-ebpm-seo\",tagId);script.text=JSON.stringify(payload);document.head.appendChild(script);return()=>{if(script.parentNode)script.parentNode.removeChild(script);};}function findVisibleDateText(){if(typeof document===\"undefined\")return undefined;const timeElements=Array.from(document.querySelectorAll(\"time\"));for(const time of timeElements){const value=(time.textContent||\"\").trim();if(/\\b\\d{4}[/-]\\d{2}[/-]\\d{2}\\b/.test(value))return value.match(/\\b\\d{4}[/-]\\d{2}[/-]\\d{2}\\b/)?.[0];}const bodyText=(document.body?.innerText||\"\").trim();const matched=bodyText.match(/\\b\\d{4}[/-]\\d{2}[/-]\\d{2}\\b/);return matched?matched[0]:undefined;}export function withPodcastSeriesSeo(Component){return /*#__PURE__*/forwardRef(function WithPodcastSeriesSeo(props,ref){const WrappedComponent=Component;useEffect(()=>{const cleanup=injectJsonLd(\"podcast-series-jsonld\",{\"@context\":\"https://schema.org\",\"@type\":\"PodcastSeries\",name:\"EBPM新聞\",url:\"https://ebpm.jp/episodes\",description:\"EBPM新聞のポッドキャスト・エピソード一覧。各エピソードの概要と文字起こし全文を掲載しています。\"});return()=>{cleanup();};},[]);return /*#__PURE__*/_jsx(WrappedComponent,{ref:ref,...props});});}export function withPodcastEpisodeSeo(Component){return /*#__PURE__*/forwardRef(function WithPodcastEpisodeSeo(props,ref){const WrappedComponent=Component;useEffect(()=>{if(typeof document===\"undefined\"||typeof window===\"undefined\")return;const h1Text=(document.querySelector(\"h1\")?.textContent||\"\").trim();const descriptionMeta=document.querySelector('meta[name=\"description\"]');const description=descriptionMeta?.content?.trim();const url=window.location.href;const visibleDate=findVisibleDateText();const payload={\"@context\":\"https://schema.org\",\"@type\":\"PodcastEpisode\",partOfSeries:{\"@type\":\"PodcastSeries\",name:\"EBPM新聞\",url:\"https://ebpm.jp/episodes\"},url};if(h1Text)payload.name=h1Text;if(description)payload.description=description;if(visibleDate)payload.datePublished=visibleDate;const cleanup=injectJsonLd(\"podcast-episode-jsonld\",payload);return()=>{cleanup();};},[]);return /*#__PURE__*/_jsx(WrappedComponent,{ref:ref,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withPodcastSeriesSeo\":{\"type\":\"reactHoc\",\"name\":\"withPodcastSeriesSeo\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPodcastEpisodeSeo\":{\"type\":\"reactHoc\",\"name\":\"withPodcastEpisodeSeo\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PodcastSeo.map"],"mappings":"uIAME,SAAS,EAAa,EAAM,EAAQ,CAAC,GAAG,OAAO,SAAW,IAAY,UAAU,CAAC,EAAE,IAAM,EAAS,yBAAyB,EAAM,IAAyD,GAAtC,SAAS,KAAK,cAAc,CAAoB,EAAE,UAAU,CAAC,EAAE,IAAM,EAAO,SAAS,cAAc,QAAQ,EAAqJ,MAAnJ,GAAO,KAAK,sBAAsB,EAAO,aAAa,gBAAgB,CAAK,EAAE,EAAO,KAAK,KAAK,UAAU,CAAO,EAAE,SAAS,KAAK,YAAY,CAAM,MAAY,CAAI,EAAO,YAAW,EAAO,WAAW,YAAY,CAAM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