{"version":3,"file":"FAQSchema.VBScgJsW.mjs","names":[],"sources":["https:/framerusercontent.com/modules/XB5IdRy5MSNBBmJUSksI/cNpod87SZ3T4aClKIVzK/FAQSchema.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";export default function FAQSchema(props){const{q1,a1,q2,a2,q3,a3,q4,a4,q5,a5}=props;// Check if we are currently inside the Framer editor\nconst isCanvas=RenderTarget.current()===RenderTarget.canvas;useEffect(()=>{// Skip injecting the script while working inside the Framer canvas\nif(isCanvas)return;const mainEntity=[];// Helper function to pair Qs and As, dropping empty ones safely\nconst addQA=(q,a)=>{if(q&&a){mainEntity.push({\"@type\":\"Question\",name:q,acceptedAnswer:{\"@type\":\"Answer\",text:a}});}};// Add up to 5 questions (you can expand this in the code if needed)\naddQA(q1,a1);addQA(q2,a2);addQA(q3,a3);addQA(q4,a4);addQA(q5,a5);// If no questions were filled out, do nothing\nif(mainEntity.length===0)return;// Build the Schema object\nconst schema={\"@context\":\"https://schema.org\",\"@type\":\"FAQPage\",mainEntity:mainEntity,name:\"Frequently Asked Questions\"};// Create the script tag\nconst script=document.createElement(\"script\");script.type=\"application/ld+json\";// JSON.stringify safely escapes all quotes and special characters!\nscript.innerHTML=JSON.stringify(schema);// Inject into the <head> of the website\ndocument.head.appendChild(script);// Cleanup function: Removes the script if the component is removed/unmounted\nreturn()=>{document.head.removeChild(script);};},[q1,a1,q2,a2,q3,a3,q4,a4,q5,a5,isCanvas]);// What to show on the Framer canvas so you can click and select it\nif(isCanvas){return /*#__PURE__*/_jsx(\"div\",{style:canvasStyles,children:\"⚙️ FAQ Schema Injector\"});}// Return absolutely nothing on the live, published site\nreturn null;}// Styling for the placeholder inside Framer\nconst canvasStyles={padding:\"16px\",background:\"rgba(0, 0, 0, 0.05)\",border:\"1px dashed rgba(0, 0, 0, 0.2)\",borderRadius:\"8px\",color:\"#333\",fontSize:\"12px\",fontWeight:600,textAlign:\"center\",width:\"100%\",minWidth:\"200px\"};// These controls expose the variables to the right-hand panel in Framer\naddPropertyControls(FAQSchema,{q1:{type:ControlType.String,title:\"Question 1\"},a1:{type:ControlType.String,title:\"Answer 1\",displayTextArea:true},q2:{type:ControlType.String,title:\"Question 2\"},a2:{type:ControlType.String,title:\"Answer 2\",displayTextArea:true},q3:{type:ControlType.String,title:\"Question 3\"},a3:{type:ControlType.String,title:\"Answer 3\",displayTextArea:true},q4:{type:ControlType.String,title:\"Question 4\"},a4:{type:ControlType.String,title:\"Answer 4\",displayTextArea:true},q5:{type:ControlType.String,title:\"Question 5\"},a5:{type:ControlType.String,title:\"Answer 5\",displayTextArea:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FAQSchema\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FAQSchema.map"],"mappings":"iLAAyI,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,KAAG,KAAG,KAAG,KAAG,KAAG,KAAG,KAAG,KAAG,KAAG,MAAI,EACjN,EAAS,EAAa,SAAS,GAAG,EAAa,OAWrD,OAX4D,MAAc,CAC1E,GAAG,EAAS,OAAO,IAAM,EAAW,EAAE,CAChC,GAAO,EAAE,IAAI,CAAI,GAAG,GAAG,EAAW,KAAK,CAAC,QAAQ,WAAW,KAAK,EAAE,eAAe,CAAC,QAAQ,SAAS,KAAK,EAAE,CAAC,CAAC,EAElH,GADA,EAAM,EAAG,EAAG,CAAC,EAAM,EAAG,EAAG,CAAC,EAAM,EAAG,EAAG,CAAC,EAAM,EAAG,EAAG,CAAC,EAAM,EAAG,EAAG,CAC7D,EAAW,SAAS,EAAE,OACzB,IAAM,EAAO,CAAC,WAAW,qBAAqB,QAAQ,UAAqB,aAAW,KAAK,6BAA6B,CAClH,EAAO,SAAS,cAAc,SAAS,CAG7C,MAH8C,GAAO,KAAK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