{"version":3,"file":"SubPageSEO.DX14mAOp.mjs","names":["p"],"sources":["https:/framerusercontent.com/modules/goEzbYEm4hjgrsoRDxbE/dvPpPmyPJ08mudWntXRK/SubPageSEO.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect}from\"react\";const TAG_PREFIX=\"subpage-seo-\";function removeOldTags(){if(typeof document===\"undefined\")return;document.querySelectorAll(`[data-seo-source=\"${TAG_PREFIX}\"]`).forEach(el=>el.remove());}function addMeta(name,content,isProperty=false){if(!content||typeof document===\"undefined\")return;const meta=document.createElement(\"meta\");if(isProperty){meta.setAttribute(\"property\",name);}else{meta.setAttribute(\"name\",name);}meta.content=content;meta.setAttribute(\"data-seo-source\",TAG_PREFIX);document.head.appendChild(meta);}function addLink(rel,href){if(!href||typeof document===\"undefined\")return;const link=document.createElement(\"link\");link.rel=rel;link.href=href;link.setAttribute(\"data-seo-source\",TAG_PREFIX);document.head.appendChild(link);}function addJsonLd(data){if(typeof document===\"undefined\")return;const script=document.createElement(\"script\");script.type=\"application/ld+json\";script.textContent=JSON.stringify(data);script.setAttribute(\"data-seo-source\",TAG_PREFIX);document.head.appendChild(script);}export default function SubPageSEO(props){const{pageTitle=\"\",metaDescription=\"\",canonicalPath=\"\",ogTitle=\"\",ogDescription=\"\",ogImage=\"\",ogType=\"website\",pageType=\"general\",serviceName=\"\",serviceDescription=\"\",serviceCategory=\"Primary Care\",locationName=\"\",streetAddress=\"\",city=\"\",state=\"CA\",zip=\"\",phone=\"+13239885900\",latitude=\"\",longitude=\"\",openingHours=\"Monday-Friday 09:00-17:00\",baseUrl=\"https://thedoctor.me\",practiceName=\"The Doctor\",style}=props;useEffect(()=>{removeOldTags();const fullUrl=canonicalPath?`${baseUrl}${canonicalPath.startsWith(\"/\")?\"\":\"/\"}${canonicalPath}`:\"\";// ── Meta description ──\nif(metaDescription){// Remove any existing description first\nconst existing=document.querySelector('meta[name=\"description\"]');if(existing)existing.remove();addMeta(\"description\",metaDescription);}// ── Canonical URL ──\nif(fullUrl){const existingCanonical=document.querySelector('link[rel=\"canonical\"]');if(existingCanonical)existingCanonical.remove();addLink(\"canonical\",fullUrl);}// ── Open Graph ──\nconst ogT=ogTitle||pageTitle;const ogD=ogDescription||metaDescription;if(ogT)addMeta(\"og:title\",ogT,true);if(ogD)addMeta(\"og:description\",ogD,true);if(ogImage)addMeta(\"og:image\",ogImage,true);if(fullUrl)addMeta(\"og:url\",fullUrl,true);addMeta(\"og:type\",ogType,true);addMeta(\"og:site_name\",practiceName,true);// ── Twitter Card ──\naddMeta(\"twitter:card\",ogImage?\"summary_large_image\":\"summary\");if(ogT)addMeta(\"twitter:title\",ogT);if(ogD)addMeta(\"twitter:description\",ogD);if(ogImage)addMeta(\"twitter:image\",ogImage);// ── Structured Data ──\nif(pageType===\"service\"&&serviceName){addJsonLd({\"@context\":\"https://schema.org\",\"@type\":\"MedicalWebPage\",name:serviceName,description:serviceDescription||metaDescription,url:fullUrl,mainEntity:{\"@type\":\"MedicalBusiness\",name:practiceName,url:baseUrl,telephone:phone,medicalSpecialty:serviceCategory},isPartOf:{\"@type\":\"WebSite\",name:practiceName,url:baseUrl}});// Service schema\naddJsonLd({\"@context\":\"https://schema.org\",\"@type\":\"MedicalProcedure\",name:serviceName,description:serviceDescription||metaDescription,howPerformed:\"In-person and telehealth appointments available\",url:fullUrl,category:serviceCategory});}if(pageType===\"location\"&&locationName){addJsonLd({\"@context\":\"https://schema.org\",\"@type\":\"MedicalClinic\",name:locationName,description:metaDescription,url:fullUrl,telephone:phone,address:{\"@type\":\"PostalAddress\",streetAddress,addressLocality:city,addressRegion:state,postalCode:zip,addressCountry:\"US\"},...latitude&&longitude?{geo:{\"@type\":\"GeoCoordinates\",latitude:parseFloat(latitude),longitude:parseFloat(longitude)}}:{},openingHoursSpecification:parseOpeningHours(openingHours),parentOrganization:{\"@type\":\"MedicalBusiness\",name:practiceName,url:baseUrl}});}if(pageType===\"team\"){addJsonLd({\"@context\":\"https://schema.org\",\"@type\":\"MedicalWebPage\",name:pageTitle||\"Our Care Team\",description:metaDescription,url:fullUrl,about:{\"@type\":\"MedicalBusiness\",name:practiceName,url:baseUrl}});}if(pageType===\"blog\"){addJsonLd({\"@context\":\"https://schema.org\",\"@type\":\"Blog\",name:pageTitle||\"Health Blog\",description:metaDescription,url:fullUrl,publisher:{\"@type\":\"Organization\",name:practiceName,url:baseUrl}});}return()=>removeOldTags();},[pageTitle,metaDescription,canonicalPath,ogTitle,ogDescription,ogImage,ogType,pageType,serviceName,serviceDescription,serviceCategory,locationName,streetAddress,city,state,zip,phone,latitude,longitude,openingHours,baseUrl,practiceName]);return /*#__PURE__*/_jsx(\"div\",{style:{width:1,height:1,opacity:0,position:\"absolute\",pointerEvents:\"none\",overflow:\"hidden\",...style},\"aria-hidden\":\"true\"});}// Helper: parse \"Monday-Friday 09:00-17:00\" into structured data\nfunction parseOpeningHours(hours){if(!hours)return[];const dayMap={Monday:\"Mo\",Tuesday:\"Tu\",Wednesday:\"We\",Thursday:\"Th\",Friday:\"Fr\",Saturday:\"Sa\",Sunday:\"Su\"};const specs=[];const parts=hours.split(\",\").map(s=>s.trim());for(const part of parts){const match=part.match(/(\\w+)(?:-(\\w+))?\\s+(\\d{2}:\\d{2})(?:\\s*-\\s*(\\d{2}:\\d{2}))?/);if(match){const startDay=match[1];const endDay=match[2]||startDay;const opens=match[3];const closes=match[4]||\"17:00\";const days=[];const dayNames=Object.keys(dayMap);let collecting=false;for(const d of dayNames){if(d===startDay)collecting=true;if(collecting)days.push(dayMap[d]);if(d===endDay)break;}specs.push({\"@type\":\"OpeningHoursSpecification\",dayOfWeek:days,opens,closes});}}return specs;}// ── PROPERTY CONTROLS ──\naddPropertyControls(SubPageSEO,{pageTitle:{type:ControlType.String,title:\"Page Title\",defaultValue:\"\",description:\"Used for OG title fallback\"},metaDescription:{type:ControlType.String,title:\"Meta Description\",defaultValue:\"\",description:\"Max 160 chars for best SEO\"},canonicalPath:{type:ControlType.String,title:\"Canonical Path\",defaultValue:\"\",description:\"e.g. /services/primary-care\"},ogTitle:{type:ControlType.String,title:\"OG Title\",defaultValue:\"\",description:\"Falls back to Page Title\"},ogDescription:{type:ControlType.String,title:\"OG Description\",defaultValue:\"\",description:\"Falls back to Meta Description\"},ogImage:{type:ControlType.String,title:\"OG Image URL\",defaultValue:\"\"},ogType:{type:ControlType.String,title:\"OG Type\",defaultValue:\"website\"},pageType:{type:ControlType.Enum,title:\"Page Type\",options:[\"service\",\"location\",\"team\",\"blog\",\"general\"],optionTitles:[\"Service\",\"Location\",\"Team\",\"Blog\",\"General\"],defaultValue:\"general\"},serviceName:{type:ControlType.String,title:\"Service Name\",defaultValue:\"\",hidden:p=>p.pageType!==\"service\"},serviceDescription:{type:ControlType.String,title:\"Service Description\",defaultValue:\"\",hidden:p=>p.pageType!==\"service\"},serviceCategory:{type:ControlType.String,title:\"Service Category\",defaultValue:\"Primary Care\",hidden:p=>p.pageType!==\"service\"},locationName:{type:ControlType.String,title:\"Location Name\",defaultValue:\"\",hidden:p=>p.pageType!==\"location\"},streetAddress:{type:ControlType.String,title:\"Street Address\",defaultValue:\"\",hidden:p=>p.pageType!==\"location\"},city:{type:ControlType.String,title:\"City\",defaultValue:\"\",hidden:p=>p.pageType!==\"location\"},state:{type:ControlType.String,title:\"State\",defaultValue:\"CA\",hidden:p=>p.pageType!==\"location\"},zip:{type:ControlType.String,title:\"ZIP\",defaultValue:\"\",hidden:p=>p.pageType!==\"location\"},phone:{type:ControlType.String,title:\"Phone\",defaultValue:\"+13239885900\",hidden:p=>p.pageType!==\"location\"},latitude:{type:ControlType.String,title:\"Latitude\",defaultValue:\"\",hidden:p=>p.pageType!==\"location\"},longitude:{type:ControlType.String,title:\"Longitude\",defaultValue:\"\",hidden:p=>p.pageType!==\"location\"},openingHours:{type:ControlType.String,title:\"Opening Hours\",defaultValue:\"Monday-Friday 09:00-17:00\",hidden:p=>p.pageType!==\"location\"},baseUrl:{type:ControlType.String,title:\"Base URL\",defaultValue:\"https://thedoctor.me\"},practiceName:{type:ControlType.String,title:\"Practice Name\",defaultValue:\"The Doctor\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SubPageSEO\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SubPageSEO.map"],"mappings":"qKAA4J,SAAS,GAAe,CAAI,OAAO,SAAW,KAAmB,SAAS,iBAAiB,qBAAqB,EAAW,IAAI,CAAC,QAAQ,GAAI,EAAG,QAAQ,CAAC,CAAE,SAAS,EAAQ,EAAK,EAAQ,EAAW,GAAM,CAAC,GAAG,CAAC,GAAS,OAAO,SAAW,IAAY,OAAO,IAAM,EAAK,SAAS,cAAc,OAAO,CAAI,EAAY,EAAK,aAAa,WAAW,EAAK,CAAO,EAAK,aAAa,OAAO,EAAK,CAAE,EAAK,QAAQ,EAAQ,EAAK,aAAa,kBAAkB,EAAW,CAAC,SAAS,KAAK,YAAY,EAAK,CAAE,SAAS,EAAQ,EAAI,EAAK,CAAC,GAAG,CAAC,GAAM,OAAO,SAAW,IAAY,OAAO,IAAM,EAAK,SAAS,cAAc,OAAO,CAAC,EAAK,IAAI,EAAI,EAAK,KAAK,EAAK,EAAK,aAAa,kBAAkB,EAAW,CAAC,SAAS,KAAK,YAAY,EAAK,CAAE,SAAS,EAAU,EAAK,CAAC,GAAG,OAAO,SAAW,IAAY,OAAO,IAAM,EAAO,SAAS,cAAc,SAAS,CAAC,EAAO,KAAK,sBAAsB,EAAO,YAAY,KAAK,UAAU,EAAK,CAAC,EAAO,aAAa,kBAAkB,EAAW,CAAC,SAAS,KAAK,YAAY,EAAO,CAAE,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,YAAU,GAAG,kBAAgB,GAAG,gBAAc,GAAG,UAAQ,GAAG,gBAAc,GAAG,UAAQ,GAAG,SAAO,UAAU,WAAS,UAAU,cAA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