{"version":3,"file":"DynamicFAQList_1.C80OBmur.mjs","names":["useState","useCallback","useMemo"],"sources":["https:/framerusercontent.com/modules/Bw13biBY2LStWbEzMihO/xSXTNGE6Bg9m6lW2Fr1o/DynamicFAQList_1.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{ControlType,addPropertyControls}from\"framer\";// @ts-ignore - useRoute is an internal Framer API without public types\nimport{useRoute}from\"framer\";import{useState,useMemo,useCallback}from\"react\";export function OtoFAQ(props){const route=useRoute();const cmsData=route?.data;const location=props.overrideLocation?.trim()||cmsData?.Locations||\"your location\";const tagforfaq=props.tagforfaq?.trim()||cmsData?.tagforfaq||\"\";const destinationforfaq=props.destinationforfaq?.trim()||cmsData?.destinationforfaq||\"\";const[openIndex,setOpenIndex]=useState(null);const toggle=useCallback(index=>{setOpenIndex(prev=>prev===index?null:index);},[]);const replacePlaceholders=text=>{if(!text)return text;return text.replace(/\\{\\{location\\}\\}/g,location).replace(/\\{\\{tagforfaq\\}\\}/g,tagforfaq).replace(/\\{\\{destinationforfaq\\}\\}/g,destinationforfaq).replace(/\\{city1\\}/g,tagforfaq).replace(/\\{city2\\}/g,destinationforfaq);};const faqs=useMemo(()=>[{q:replacePlaceholders(props.faq1Question),a:replacePlaceholders(props.faq1Answer)},{q:replacePlaceholders(props.faq2Question),a:replacePlaceholders(props.faq2Answer)},{q:replacePlaceholders(props.faq3Question),a:replacePlaceholders(props.faq3Answer)},{q:replacePlaceholders(props.faq4Question),a:replacePlaceholders(props.faq4Answer)},{q:replacePlaceholders(props.faq5Question),a:replacePlaceholders(props.faq5Answer)},{q:replacePlaceholders(props.faq6Question),a:replacePlaceholders(props.faq6Answer)},{q:replacePlaceholders(props.faq7Question),a:replacePlaceholders(props.faq7Answer)},{q:replacePlaceholders(props.faq8Question),a:replacePlaceholders(props.faq8Answer)}].filter(faq=>faq.q&&faq.a),[props.faq1Question,props.faq1Answer,props.faq2Question,props.faq2Answer,props.faq3Question,props.faq3Answer,props.faq4Question,props.faq4Answer,props.faq5Question,props.faq5Answer,props.faq6Question,props.faq6Answer,props.faq7Question,props.faq7Answer,props.faq8Question,props.faq8Answer,location,tagforfaq,destinationforfaq]);return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:\"12px\",padding:\"25px 50px\",background:\"#f6f6f6\",borderRadius:\"20px\"},children:faqs.map((item,index)=>{const isOpen=openIndex===index;return /*#__PURE__*/_jsxs(\"div\",{onClick:()=>toggle(index),style:{background:\"transparent\",borderBottom:index===faqs.length-1?\"none\":\"1px solid #00000010\",padding:\"30px 0\",cursor:\"pointer\",userSelect:\"none\"},children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{fontSize:\"17px\",fontWeight:600,color:\"#222\"},children:item.q}),/*#__PURE__*/_jsx(\"span\",{style:{transition:\"transform 0.4s ease\",transform:isOpen?\"rotate(45deg)\":\"rotate(0deg)\",fontSize:22,lineHeight:1,color:\"#000000\"},children:\"+\"})]}),/*#__PURE__*/_jsx(\"div\",{style:{display:\"grid\",gridTemplateRows:isOpen?\"1fr\":\"0fr\",transition:\"grid-template-rows 0.3s ease\"},children:/*#__PURE__*/_jsx(\"div\",{style:{overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"p\",{style:{marginTop:12,color:\"#444\",fontSize:\"15px\",lineHeight:1.6,whiteSpace:\"pre-line\",opacity:isOpen?1:0,transition:\"opacity 0.3s ease\"},children:item.a})})})]},item.q);})});}addPropertyControls(OtoFAQ,{overrideLocation:{type:ControlType.String,title:\"Override Location\",placeholder:\"Dubai\"},tagforfaq:{type:ControlType.String,title:\"Origin (City/Country 1)\",placeholder:\"Dubai\"},destinationforfaq:{type:ControlType.String,title:\"Destination (City/Country 2)\",placeholder:\"Jeddah\"},faq1Question:{type:ControlType.String,title:\"FAQ 1 - Question\"},faq1Answer:{type:ControlType.String,title:\"FAQ 1 - Answer\",displayTextArea:true},faq2Question:{type:ControlType.String,title:\"FAQ 2 - Question\"},faq2Answer:{type:ControlType.String,title:\"FAQ 2 - Answer\",displayTextArea:true},faq3Question:{type:ControlType.String,title:\"FAQ 3 - Question\"},faq3Answer:{type:ControlType.String,title:\"FAQ 3 - Answer\",displayTextArea:true},faq4Question:{type:ControlType.String,title:\"FAQ 4 - Question\"},faq4Answer:{type:ControlType.String,title:\"FAQ 4 - Answer\",displayTextArea:true},faq5Question:{type:ControlType.String,title:\"FAQ 5 - Question\"},faq5Answer:{type:ControlType.String,title:\"FAQ 5 - Answer\",displayTextArea:true},faq6Question:{type:ControlType.String,title:\"FAQ 6 - Question\"},faq6Answer:{type:ControlType.String,title:\"FAQ 6 - Answer\",displayTextArea:true},faq7Question:{type:ControlType.String,title:\"FAQ 7 - Question\"},faq7Answer:{type:ControlType.String,title:\"FAQ 7 - Answer\",displayTextArea:true},faq8Question:{type:ControlType.String,title:\"FAQ 8 - Question\"},faq8Answer:{type:ControlType.String,title:\"FAQ 8 - Answer\",displayTextArea:true}});OtoFAQ.displayName=\"OTO Dynamic FAQ\";\nexport const __FramerMetadata__ = {\"exports\":{\"OtoFAQ\":{\"type\":\"reactComponent\",\"name\":\"OtoFAQ\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DynamicFAQList_1.map"],"mappings":"wMAC6E,SAAgB,EAAO,EAAM,CAAwB,IAAM,EAAjB,GAAU,EAAsB,KAAW,EAAS,EAAM,kBAAkB,MAAM,EAAE,GAAS,WAAW,gBAAsB,EAAU,EAAM,WAAW,MAAM,EAAE,GAAS,WAAW,GAAS,EAAkB,EAAM,mBAAmB,MAAM,EAAE,GAAS,mBAAmB,GAAQ,CAAC,EAAU,GAAcA,EAAS,KAAK,CAAO,EAAOC,EAAY,GAAO,CAAC,EAAa,GAAM,IAAO,EAAM,KAAK,EAAM,EAAG,EAA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