{"version":3,"file":"DynamicFAQList_1.AxDvilA7.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/Bw13biBY2LStWbEzMihO/DCgDWolG3MrBapwHoaa3/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}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=index=>{setOpenIndex(openIndex===index?null:index);};// Helper function to replace all placeholders\nconst replacePlaceholders=text=>{if(!text)return text;return text.replace(/\\{\\{location\\}\\}/g,location).replace(/\\{\\{tagforfaq\\}\\}/g,tagforfaq).replace(/\\{\\{destinationforfaq\\}\\}/g,destinationforfaq)// Support both formats: {city1} and {{tag}}, {city2} and {{destination}}\n.replace(/\\{city1\\}/g,tagforfaq).replace(/\\{city2\\}/g,destinationforfaq);};const faqs=[{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)}].filter(faq=>faq.q&&faq.a);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:{maxHeight:isOpen?\"1000px\":\"0px\",overflow:\"hidden\",transition:\"max-height 0.4s ease\"},children:/*#__PURE__*/_jsx(\"p\",{style:{marginTop:isOpen?12:0,color:\"#444\",fontSize:\"15px\",lineHeight:1.6,whiteSpace:\"pre-line\",opacity:isOpen?1:0,transition:\"opacity 0.3s ease\"},children:item.a})})]},index);})});}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}});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":"0LACyD,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,EAAO,GAAO,CAAC,EAAa,IAAY,EAAM,KAAK,EAAM,EACzd,EAAoB,GAAW,GAAwB,EAAK,QAAQ,oBAAoB,EAAS,CAAC,QAAQ,qBAAqB,EAAU,CAAC,QAAQ,6BAA6B,EAAkB,CACtM,QAAQ,aAAa,EAAU,CAAC,QAAQ,aAAa,EAAkB,CAAS,EAAK,CAAC,CAAC,EAAE,EAAoB,EAAM,aAAa,CAAC,EAAE,EAAoB,EAAM,WAAW,CAAC,CAAC,CAAC,EAAE,EAAoB,EAAM,aAAa,CAAC,EAAE,EAAoB,EAAM,WAAW,CAAC,CAAC,CAAC,EAAE,EAAoB,EAAM,aAAa,CAAC,EAAE,EAAoB,EAAM,WAAW,CAAC,CAAC,CAAC,EAAE,EAAoB,EAAM,aAAa,CAAC,EAAE,EAAoB,EAAM,WAAW,CAAC,CAAC,CAAC,EAAE,EAAoB,EAAM,aAAa,CAAC,EAAE,EAAoB,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