{"version":3,"file":"FAQ.MuLkcG02.mjs","names":["useState","__esmMin","te","init_npm_react_18_3_1","_e","init_jsx_runtime","c","p","addPropertyControls","init_framer_BWFVvmND","ControlType","FAQ","props","openIndex","setOpenIndex","toggleItem","prev","index","renderAnswer","lines","answer","blocks","currentBullets","currentParagraph","flushParagraph","text","flushBullets","b","i","isBulletLine","line","stripBullet","raw","items","isOpen","borderRadius","border","fontColor","item","init_FAQ"],"sources":["https:/framerusercontent.com/modules/pCqVS24spC3pXm3P5nV7/0KIpNVxdNoJcF2QrKDF1/FAQ.js"],"sourcesContent":["// FAQ component with expandable questions and answers\n// - Icon upload option (24x24)\n// - Title with 8px gap from icon, 1.125rem (18px), 140% line height, Literata regular\n// - Plus symbol with 8px gap from title, rotates to X on open\n// - Answer supports paragraphs + bullet points (lines starting with \"- \", \"* \", or \"• \")\n// - Answer text field with 1rem Plus Jakarta Sans, 150% line height\n// - Adjustable font color, background color, radius, and border\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function FAQ(props){const{items=[],fontColor,backgroundColor,borderRadius,border}=props;const[openIndex,setOpenIndex]=useState(null);const toggleItem=index=>{startTransition(()=>{setOpenIndex(prev=>prev===index?null:index);});};// Parses plain text into paragraphs and bullet lists.\n// Bullet syntax: lines starting with \"- \", \"* \", or \"• \".\nconst renderAnswer=answer=>{const lines=(answer||\"\").replace(/\\r\\n/g,\"\\n\").split(\"\\n\");const blocks=[];let currentBullets=[];let currentParagraph=[];const flushParagraph=()=>{const text=currentParagraph.join(\" \").trim();if(text){blocks.push(/*#__PURE__*/_jsx(\"p\",{style:{margin:\"0 0 10px 0\"},children:text},`p-${blocks.length}`));}currentParagraph=[];};const flushBullets=()=>{if(currentBullets.length){blocks.push(/*#__PURE__*/_jsx(\"ul\",{style:{margin:\"0 0 10px 0\",paddingLeft:\"18px\"},children:currentBullets.map((b,i)=>/*#__PURE__*/_jsx(\"li\",{style:{margin:\"0 0 6px 0\"},children:b},i))},`ul-${blocks.length}`));}currentBullets=[];};const isBulletLine=line=>{const t=line.trim();return t.startsWith(\"- \")||t.startsWith(\"* \")||t.startsWith(\"• \");};const stripBullet=line=>{const t=line.trim();if(t.startsWith(\"- \"))return t.slice(2).trim();if(t.startsWith(\"* \"))return t.slice(2).trim();if(t.startsWith(\"• \"))return t.slice(2).trim();return t;};for(const raw of lines){const line=raw.trim();// Blank line ends current block(s)\nif(!line){flushParagraph();flushBullets();continue;}if(isBulletLine(line)){// Switch from paragraph to bullets\nflushParagraph();currentBullets.push(stripBullet(line));}else{// Switch from bullets to paragraph\nflushBullets();currentParagraph.push(line);}}// Flush any remaining content\nflushParagraph();flushBullets();return blocks.length?blocks:null;};return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style,display:\"flex\",flexDirection:\"column\",gap:\"12px\",width:\"100%\"},children:[/*#__PURE__*/_jsx(\"link\",{href:\"https://fonts.googleapis.com/css2?family=Literata:wght@400&family=Plus+Jakarta+Sans:wght@400&display=swap\",rel:\"stylesheet\"}),items.map((item,index)=>{const isOpen=openIndex===index;return /*#__PURE__*/_jsxs(\"div\",{style:{backgroundColor,borderRadius:`${borderRadius}px`,overflow:\"hidden\",...border},children:[/*#__PURE__*/_jsxs(\"button\",{onClick:()=>toggleItem(index),style:{width:\"100%\",display:\"flex\",alignItems:\"center\",padding:\"16px\",border:\"none\",background:\"transparent\",cursor:\"pointer\",color:fontColor,textAlign:\"left\"},children:[item.icon?.src&&/*#__PURE__*/_jsx(\"img\",{src:item.icon.src,alt:item.icon.alt||\"\",style:{width:\"24px\",height:\"24px\",flexShrink:0}}),/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:\"Literata, serif\",fontSize:\"1.125rem\",lineHeight:\"140%\",fontWeight:400,marginLeft:item.icon?.src?\"8px\":\"0\",flex:1},children:item.question}),/*#__PURE__*/_jsx(\"div\",{style:{marginLeft:\"8px\",width:\"24px\",height:\"24px\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",transition:\"transform 0.4s ease-out\",transform:isOpen?\"rotate(45deg)\":\"rotate(0deg)\",flexShrink:0},children:/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M12 5V19M5 12H19\",stroke:fontColor,strokeWidth:\"2\",strokeLinecap:\"round\"})})})]}),/*#__PURE__*/_jsx(\"div\",{style:{maxHeight:isOpen?\"700px\":\"0\",overflow:\"hidden\",transition:\"max-height 0.4s ease-out\"},children:/*#__PURE__*/_jsx(\"div\",{style:{padding:\"0 16px 16px 16px\",fontFamily:\"Plus Jakarta Sans, sans-serif\",fontSize:\"1rem\",lineHeight:\"150%\",fontWeight:400,color:fontColor},children:renderAnswer(item.answer)})})]},index);})]});}addPropertyControls(FAQ,{items:{type:ControlType.Array,title:\"FAQ Items\",control:{type:ControlType.Object,controls:{icon:{type:ControlType.ResponsiveImage,title:\"Icon\"},question:{type:ControlType.String,title:\"Question\",defaultValue:\"What is this FAQ about?\"},answer:{type:ControlType.String,title:\"Answer\",displayTextArea:true,defaultValue:\"This is a paragraph answer.\\n\\n- First bullet\\n- Second bullet\\n\\nAnother paragraph after bullets.\"}}},defaultValue:[{icon:{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Icon 1\"},question:\"What is this FAQ about?\",answer:\"This is a paragraph.\\n\\n- Bullet one\\n- Bullet two\"},{icon:{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Icon 2\"},question:\"How do I use this component?\",answer:\"Add text normally for paragraphs.\\nUse '- ' at the start of a line for bullets.\\n\\n- Like this\\n- And this\"}]},fontColor:{type:ControlType.Color,title:\"Font Color\",defaultValue:\"#000000\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#F5F5F5\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:32,unit:\"px\"},border:{type:ControlType.Border,title:\"Border\",defaultValue:{borderWidth:1,borderStyle:\"solid\",borderColor:\"#EEEEEE\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FAQ\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FAQ.map"],"mappings":"A,yLAUG,SAAwBW,EAAI,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,EAAE,YAAU,kBAAgB,eAAa,UAAQC,EAAW,CAACC,EAAUC,GAAcd,EAAS,IAAI,EAAQe,EAAW,GAAO,CAACb,MAAoB,CAACY,EAAa,GAAME,IAAOC,EAAM,KAAKA,CAAK,CAAE,CAAC,CAAE,EAE9OC,EAAa,GAAQ,CAAC,IAAMC,GAAOC,GAAQ,GAAA,CAAI,QAAQ,QAAQ;CAAI,CAAC,CAAC,MAAM;CAAI,EAAQC,EAAO,CAAC,EAAMC,EAAe,CAAC,EAAMC,EAAiB,CAAC,EAAQC,MAAmB,CAAC,IAAMC,EAAKF,EAAiB,KAAK,GAAG,CAAC,CAAC,KAAK,EAAKE,GAAMJ,EAAO,KAAkB,gBAAK,IAAI,CAAC,MAAM,CAAC,OAAO,YAAY,EAAE,SAASI,CAAI,EAAE,KAAKJ,EAAO,QAAQ,CAAC,EAAG,EAAiB,CAAC,CAAE,EAAQK,MAAiB,CAAIJ,EAAe,QAAQD,EAAO,KAAkB,gBAAK,KAAK,CAAC,MAAM,CAAC,OAAO,aAAa,YAAY,MAAM,EAAE,SAASC,EAAe,KAAK,EAAE,IAAiB,gBAAK,KAAK,CAAC,MAAM,CAAC,OAAO,WAAW,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