{"version":3,"file":"Blog.DMoQvW4F.mjs","names":["useState","__esmMin","init_npm_react_18_3_1","ce","init_jsx_runtime","c","p","_e","createStore","init_store_js__1_0","getPropertiesByTag","init_Utilities","elemProps","elementTag","key","childrenProps","result","init_Utilities_LgUQ","getTitles","store","setStore","useStore","activeIndex","setActiveIndex","html","content","ptagProps","props","atagProps","headings","headingsArray","i","el","handleClick","index","baseLinkStyle","hoverStyle","isActive","element","getTitlesSpoilerStyled","open","setOpen","titles","Component","item","init_Blog"],"sources":["https:/framerusercontent.com/modules/1rYQMgPBy2BHwN1a8Z5O/YgTH7d8XoflBisXAiR7m/Utilities.js","https:/framer.com/m/Utilities-LgUQ.js@YgTH7d8XoflBisXAiR7m","https:/framerusercontent.com/modules/8IJxaKQCb443ePbwbpyX/ZrIgcoCkEhCcgOKhFBgE/Blog.js"],"sourcesContent":["/**\n * Reusable framer utilities\n * @description This file contains utility functions which can be used in any code-overides or\n * code-components in framer.\n * @author Manjunath\n * @see {@link https://manjumjn.com/}\n *//**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */import{jsx as _jsx}from\"react/jsx-runtime\";export default function Utilities(props){return /*#__PURE__*/_jsx(\"div\",{});}/**\n * Get element props by tag inside the component\n * @param {Object} elementProps Component props\n * @param {String} elementTag Tag of props to be returned. Eg: a, div, p\n * @returns {Object} props of the `elementTag`\n */export const getPropertiesByTag=(elemProps,elementTag)=>{// Check if the current object is of the target type\nif(elemProps.type===elementTag){return elemProps;}// Iterate through object properties that can hold nested objects (children and props)\nfor(const key of[\"children\",\"props\"]){if(elemProps[key]&&typeof elemProps[key]===\"object\"){// Check if props has more children, if so get first one\nconst childrenProps=Array.isArray(elemProps[key])?elemProps[key][0]:elemProps[key];// Recursively search for the target type within the nested object\nconst result=getPropertiesByTag(childrenProps,elementTag);if(result){return result;}}}// Not found in current object or its children/props\nreturn null;};\nexport const __FramerMetadata__ = {\"exports\":{\"getPropertiesByTag\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"Utilities\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Utilities.map","/*\n * Utilities\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/1rYQMgPBy2BHwN1a8Z5O/YgTH7d8XoflBisXAiR7m/Utilities.js\"\nexport { default } from \"https://framerusercontent.com/modules/1rYQMgPBy2BHwN1a8Z5O/YgTH7d8XoflBisXAiR7m/Utilities.js\"\n","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{getPropertiesByTag}from\"https://framer.com/m/Utilities-LgUQ.js@YgTH7d8XoflBisXAiR7m\";// import { getPropertiesByTag } from \"./Miscellaneous.tsx\"\n// Learn more: https://www.framer.com/docs/guides/overrides/\nconst useStore=createStore({titles:[],chagedLink:false,className:\"\",pTagStyle:{},pTagClass:\"\",aTagClass:\"\"});export function withClassNameWeglot(Component){return props=>{const newClassName=`${props.className||\"\"} blog-article`.trim();return /*#__PURE__*/_jsx(Component,{...props,className:newClassName});};}export function getTitles(Component){return props=>{const[store,setStore]=useStore();const[activeIndex,setActiveIndex]=useState(null);useEffect(()=>{const html=document.querySelector(\"html\");html.style.scrollBehavior=\"smooth\";const content=document.getElementById(\"content-data\");if(!content)return;const ptagProps=getPropertiesByTag(props,\"p\");const atagProps=getPropertiesByTag(ptagProps||{},\"a\");const headings=content.querySelectorAll(\"h2\");const headingsArray=[];for(let i=0;i<headings.length;i++){const el=headings[i];el.style.position=\"relative\";el.insertAdjacentHTML(\"beforeend\",`<span id=\"title-${i}\" style=\"position: absolute; top:-144px;\"></span>`);headingsArray.push(el.innerText.replace(/(\\r\\n|\\n|\\r)/gm,\"\"));}setStore({titles:headingsArray,pTagStyle:ptagProps?.props?.style||{},pTagClass:ptagProps?.props?.className||\"\",aTagClass:atagProps?.props?.className||\"\"});},[]);const handleClick=index=>{setActiveIndex(index);};const baseLinkStyle={color:\"#000\",textDecoration:\"none\",transition:\"color 0.2s ease\"};const hoverStyle={color:\"#0E6FDE\"};return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:\"12px\"},children:Array.isArray(store.titles)&&store.titles.map((element,i)=>{const isActive=activeIndex===i;return /*#__PURE__*/_jsx(\"p\",{className:`framer-text ${store.pTagClass}`,style:store.pTagStyle,children:/*#__PURE__*/_jsx(\"a\",{href:`#title-${i}`,onClick:()=>handleClick(i),className:`framer-text ${store.aTagClass}`,style:{...baseLinkStyle,...isActive?hoverStyle:{}},onMouseEnter:e=>e.currentTarget.style.color=\"#0E6FDE\",onMouseLeave:e=>{if(!isActive){e.currentTarget.style.color=baseLinkStyle.color;}},children:element})},i);})});};}const useStore2=createStore({titles:[],pTagStyle:{},pTagClass:\"\",aTagClass:\"\"});export function getTitlesSpoilerStyled(Component){return props=>{const[store,setStore]=useStore();const[open,setOpen]=useState(false);const[activeIndex,setActiveIndex]=useState(null);useEffect(()=>{const html=document.querySelector(\"html\");html.style.scrollBehavior=\"smooth\";const content=document.getElementById(\"content-data\");if(!content)return;const ptagProps=getPropertiesByTag(props,\"p\");const atagProps=getPropertiesByTag(ptagProps||{},\"a\");const headings=content.querySelectorAll(\"h2\");const titles=[];headings.forEach((el,i)=>{if(!document.getElementById(`title-${i}`)){el.style.position=\"relative\";el.insertAdjacentHTML(\"beforeend\",`<span id=\"title-${i}\" style=\"position: absolute; top:-144px;\"></span>`);}titles.push({text:el.innerText,id:`title-${i}`});});setStore({titles,pTagStyle:ptagProps?.props?.style||{},pTagClass:ptagProps?.props?.className||\"\",aTagClass:atagProps?.props?.className||\"\"});},[]);const handleClick=index=>{setActiveIndex(index);};const baseLinkStyle={color:\"#000\",textDecoration:\"none\",transition:\"color 0.2s ease\",fontSize:\"16px\",fontFamily:\"Inter\"};const hoverStyle={color:\"#0E6FDE\"};return /*#__PURE__*/_jsx(Component,{...props,children:/*#__PURE__*/_jsxs(\"div\",{style:{borderRadius:\"16px\",boxShadow:\"0 4px 12px rgba(0, 0, 0, 0.06)\",padding:\"20px\",background:\"#fff\",maxWidth:\"100%\",marginBottom:\"20px\"},children:[/*#__PURE__*/_jsxs(\"div\",{onClick:()=>setOpen(!open),style:{display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",cursor:\"pointer\"},children:[/*#__PURE__*/_jsx(\"h3\",{style:{fontFamily:\"Inter\",fontSize:\"18px\",fontWeight:600,color:\"#0E6FDE\",margin:0},children:\"Table des mati\\xe8res\"}),/*#__PURE__*/_jsx(\"span\",{style:{fontSize:\"22px\",fontWeight:\"bold\",color:\"#0E6FDE\",lineHeight:1},children:open?\"−\":\"+\"})]}),open&&/*#__PURE__*/_jsx(\"div\",{style:{marginTop:\"12px\",paddingLeft:\"0px\"},children:store.titles.map((item,i)=>{const isActive=activeIndex===i;return /*#__PURE__*/_jsx(\"p\",{className:`framer-text ${store.pTagClass}`,style:{margin:\"8px 0\",...store.pTagStyle},children:/*#__PURE__*/_jsx(\"a\",{href:`#${item.id}`,onClick:()=>handleClick(i),className:`framer-text ${store.aTagClass}`,style:{...baseLinkStyle,...isActive?hoverStyle:{}},onMouseEnter:e=>e.currentTarget.style.color=\"#0E6FDE\",onMouseLeave:e=>{if(!isActive){e.currentTarget.style.color=baseLinkStyle.color;}},children:item.text})},i);})})]})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"getTitles\":{\"type\":\"reactHoc\",\"name\":\"getTitles\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getTitlesSpoilerStyled\":{\"type\":\"reactHoc\",\"name\":\"getTitlesSpoilerStyled\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withClassNameWeglot\":{\"type\":\"reactHoc\",\"name\":\"withClassNameWeglot\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Blog.map"],"mappings":"A,gOAiBgB,GAAoB,EAAU,IAAa,CAC3D,GAAGY,EAAU,OAAOC,EAAY,OAAOD,EACvC,IAAI,IAAME,IAAM,CAAC,WAAW,OAAO,EAAG,GAAGF,EAAUE,IAAM,OAAOF,EAAUE,IAAO,SAAS,CAC1F,IAAMC,EAAc,MAAM,QAAQH,EAAUE,EAAI,EAAEF,EAAUE,EAAI,CAAC,GAAGF,EAAUE,GACxEE,EAAON,EAAmBK,EAAcF,CAAU,EAAE,GAAGG,EAAQ,OAAOA,CAAQ,CACpF,OAAO,IAAK,C,+CEpBwS,SAAgBE,EAAU,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAACC,EAAMC,GAAUC,EAAS,EAAO,CAACC,EAAYC,GAAgBvB,EAAS,IAAI,EAAEG,MAAc,CAAC,IAAMqB,EAAK,SAAS,cAAc,MAAM,EAAE,EAAK,MAAM,eAAe,SAAS,IAAMC,EAAQ,SAAS,eAAe,cAAc,EAAE,GAAG,CAACA,EAAQ,OAAO,IAAMC,EAAUhB,EAAmBiB,EAAM,GAAG,EAAQC,EAAUlB,EAAmBgB,GAAW,CAAC,EAAE,GAAG,EAAQG,EAASJ,EAAQ,iBAAiB,IAAI,EAAQK,EAAc,CAAC,EAAE,IAAI,IAAIC,EAAE,EAAEA,EAAEF,EAAS,OAAO,IAAI,CAAC,IAAMG,EAAGH,EAASE,GAAG,EAAG,MAAM,SAAS,WAAWC,EAAG,mBAAmB,YAAY,mBAAmBD,EAAE,kDAAkD,EAAED,EAAc,KAAKE,EAAG,UAAU,QAAQ,iBAAiB,EAAE,CAAC,CAAE,CAACZ,EAAS,CAAC,OAAOU,EAAc,UAAUJ,GAAW,OAAO,OAAO,CAAC,EAAE,UAAUA,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