{"version":3,"file":"FAQPageSchema_black.CFPlynSC.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/9yNItcqbFuwQYpUnkqta/pxuNnNSQFQI1h0rVKalw/FAQPageSchema_black.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";import{useState}from\"react\";const FAQ_FONT_FAMILY='\"Outfit\", sans-serif';function reactNodeToHTML(node){if(!node)return\"\";// Plain text\nif(typeof node===\"string\"){return node;}// Arrays\nif(Array.isArray(node)){return node.map(reactNodeToHTML).join(\"\");}// React element\nif(typeof node===\"object\"){const props=node.props||{};const type=node.type;const children=reactNodeToHTML(props.children);// Detect links via href prop\nif(props.href){const href=typeof props.href===\"string\"?props.href:props.href?.url||props.href?.href||\"#\";return`<a href=\"${href}\">${children}</a>`;}switch(type){case\"p\":return`<p>${children}</p>`;case\"strong\":return`<strong>${children}</strong>`;case\"em\":return`<em>${children}</em>`;case\"u\":return`<u>${children}</u>`;case\"a\":return`<a href=\"${node.props?.href||\"#\"}\">${children}</a>`;case\"ul\":return`<ul>${children}</ul>`;case\"ol\":return`<ol>${children}</ol>`;case\"li\":return`<li>${children}</li>`;case\"br\":return`<br/>`;case\"h1\":case\"h2\":case\"h3\":case\"h4\":case\"h5\":case\"h6\":return`<${type}>${children}</${type}>`;default:return children;}}return\"\";}function escapeJSONString(str){return str.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,'\\\\\"').replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/\\t/g,\"\\\\t\");}export default function FAQSWithPageSchema(props){const{items,fontColor}=props;const[openIndex,setOpenIndex]=useState(null);if(!items){return null;}const resolvedFontColor=fontColor||\"var(--framer-font-color, var(--font-color, #000))\";const schema=`\n{\n  \"@context\": \"https://schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [\n ${items.map(item=>`\n    {\n      \"@type\": \"Question\",\n      \"name\": \"${escapeJSONString(item.question)}\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"${escapeJSONString(typeof item.answer===\"string\"?item.answer:reactNodeToHTML(item.answer))}\"\n      }\n    }\n`).join(\",\")}\n  ]\n}\n`;const containerStyle={display:\"flex\",flexDirection:\"column\",gap:20,width:\"100%\",boxSizing:\"border-box\",fontFamily:FAQ_FONT_FAMILY,color:resolvedFontColor};const questionStyle={width:\"100%\",display:\"flex\",justifyContent:\"space-between\",alignItems:\"center\",padding:\"20px\",background:\"transparent\",border:\"none\",fontSize:18,fontWeight:600,cursor:\"pointer\",textAlign:\"left\",fontFamily:FAQ_FONT_FAMILY,color:resolvedFontColor};return /*#__PURE__*/_jsxs(\"div\",{style:containerStyle,children:[/*#__PURE__*/_jsx(\"script\",{type:\"application/ld+json\",dangerouslySetInnerHTML:{__html:schema}}),items.map((item,index)=>{const isOpen=openIndex===index;const svgStyle={flex:\"0 0 24px\",rotate:isOpen?\"180deg\":\"0deg\"};return /*#__PURE__*/_jsxs(\"div\",{style:faqItemStyle,children:[/*#__PURE__*/_jsxs(\"button\",{type:\"button\",style:questionStyle,\"aria-expanded\":isOpen,onClick:()=>setOpenIndex(isOpen?null:index),children:[/*#__PURE__*/_jsx(\"span\",{children:item.question}),/*#__PURE__*/_jsx(\"svg\",{\"aria-hidden\":\"true\",focusable:\"false\",fill:\"none\",viewBox:\"0 0 24 24\",stroke:\"currentColor\",width:\"20px\",height:\"20px\",style:svgStyle,children:/*#__PURE__*/_jsx(\"path\",{strokeLinecap:\"round\",strokeLinejoin:\"round\",strokeWidth:\"2\",d:\"M19 9l-7 7-7-7\"})})]}),/*#__PURE__*/_jsx(AnimatePresence,{children:isOpen&&/*#__PURE__*/_jsx(motion.div,{initial:{height:0,opacity:0},animate:{height:\"auto\",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25},style:answerWrapperStyle,children:/*#__PURE__*/_jsx(\"div\",{style:answerStyle,children:item.answer})})})]},index);})]});}addPropertyControls(FAQSWithPageSchema,{items:{type:ControlType.Array,title:\"Items\",control:{type:ControlType.Object,controls:{question:{type:ControlType.String,title:\"Question\",defaultValue:\"What services do you offer?\"},answer:{type:ControlType.String,title:\"Answer\",displayTextArea:true,defaultValue:\"We provide strategy, design, and development services tailored to your goals.\"}}},defaultValue:[{question:\"What services do you offer?\",answer:\"We provide strategy, design, and development services tailored to your goals.\"}]},fontColor:{type:ControlType.Color,defaultValue:\"#fff\"}});const faqItemStyle={border:\"1px solid rgba(255,255,255,0.15)\",borderRadius:16,overflow:\"hidden\",background:\"#000\"};const answerWrapperStyle={overflow:\"hidden\"};const answerStyle={padding:\"0 20px 20px\",fontSize:16,lineHeight:1.7,whiteSpace:\"pre-wrap\",fontFamily:FAQ_FONT_FAMILY};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FAQSWithPageSchema\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FAQPageSchema_black.map"],"mappings":"yOAAwO,SAAS,EAAgB,EAAK,CAAC,GAAG,CAAC,EAAK,MAAM,GACtR,GAAG,OAAO,GAAO,SAAU,OAAO,EAClC,GAAG,MAAM,QAAQ,CAAI,EAAG,OAAO,EAAK,IAAI,CAAe,CAAC,CAAC,KAAK,EAAE,EAChE,GAAG,OAAO,GAAO,SAAS,CAAC,IAAM,EAAM,EAAK,OAAO,CAAC,EAAQ,EAAK,EAAK,KAAW,EAAS,EAAgB,EAAM,QAAQ,EACxH,GAAG,EAAM,KAAgG,MAAM,YAArF,OAAO,EAAM,MAAO,SAAS,EAAM,KAAK,EAAM,MAAM,KAAK,EAAM,MAAM,MAAM,IAA2B,IAAI,EAAS,MAAO,OAAO,EAAP,CAAa,IAAI,IAAI,MAAM,MAAM,EAAS,MAAM,IAAI,SAAS,MAAM,WAAW,EAAS,WAAW,IAAI,KAAK,MAAM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