{"version":3,"file":"otJ12zb0j.C9TrChhG.mjs","names":["_Fragment","children","fonts","css","className"],"sources":["https:/framerusercontent.com/modules/3RfOvOARaF8CtNiQuo8F/OfrjqZnY156dBkYA68VE/TableOfContent.js","https:/framerusercontent.com/modules/qLInOEpFDnmhdN2TkwVP/9AfBoCqJEsonp1eywbTk/HfN5DEsPj.js","https:/framerusercontent.com/modules/Z6xWF5fuxfAaP6ty1riI/ebd0LsrgtfHxDwSyP1Dg/otJ12zb0j.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{useEffect,useState}from\"react\";// Made with love by Clément. https://lionneclement.com/\n// Full tutorial: https://lionneclement.com/tutorial/how-to-create-table-of-contents-cms-collections-framer\n//UPDATE:\n//This is a modified version in collaboration with Tay Rush. https://twitter.com/taylorrushmore\n// https://www.youtube.com/@taylorrushmore/\nconst HEADING_TO_DISPLAY=[\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"];const SCROLL_MARGIN_TOP=80;const useStore=createStore({headings:[]});export function withTableOfContent(Component){return props=>{const[store]=useStore();const[activeSection,setActiveSection]=useState(\"\");const scrollToId=id=>{const element=document.getElementById(id);if(element){element.scrollIntoView({behavior:\"smooth\"});}};useEffect(()=>{const handleScroll=()=>{const sections=store.headings.map(heading=>document.getElementById(heading.id));const scrollPosition=window.scrollY-160;for(let i=sections.length-1;i>=0;i--){if(sections[i].offsetTop<=scrollPosition){setActiveSection(store.headings[i].id);break;}}};window.addEventListener(\"scroll\",handleScroll);return()=>{window.removeEventListener(\"scroll\",handleScroll);};},[store.headings]);return /*#__PURE__*/_jsx(_Fragment,{children:store.headings.length>0&&window?store.headings.sort((a,b)=>a.originalIndex-b.originalIndex).filter(({type})=>HEADING_TO_DISPLAY.includes(type)).map(({id,heading,type},index)=>/*#__PURE__*/_jsx(Component,{...props,variant:activeSection===id?`${type}-active`:type,title:heading,onClick:()=>scrollToId(id)})):/*#__PURE__*/_jsx(Component,{...props})});};}export function withContent(Component){return props=>{const[store,setStore]=useStore();const[newProps,setNewProps]=useState(props);useEffect(()=>{setStore({headings:formatTableOfContent(newProps.children.props.children)});},[newProps]);useEffect(()=>{const formatHeadings=()=>{const newChildren=[];props.children.props.children.length>0&&props.children.props.children.forEach((item,index)=>{const children=item.props.children;if([\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"].includes(item.type)){const{formattedId}=formatHeading(children,index);// Create a new object for the modified item\nconst newItem={...item,props:{...item.props,id:formattedId}};newChildren.push(newItem);}else{newChildren.push(item);}});// Return a new props object with the modified children\nreturn{...props,children:{...props.children,props:{...props.children.props,children:newChildren}}};};setNewProps(formatHeadings());},[props]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`.framer-text {\n                    scroll-margin-top: ${SCROLL_MARGIN_TOP}px;\n                }`}),/*#__PURE__*/_jsx(Component,{...newProps})]});};}const formatTableOfContent=children=>{const result=[];children.length>0&&children.filter(({type})=>[\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"].includes(type)).map((item,index)=>{const children=item.props.children;const{formattedId,formattedHeading}=formatHeading(children,index);result.push({id:formattedId,heading:formattedHeading,type:item.type,originalIndex:index});});return result;};const formatHeading=(children,index)=>{let formattedHeading=\"\";let formattedId=\"\";if(typeof children===\"string\"){formattedHeading=children;}else if(Array.isArray(children)){formattedHeading=children.map(item=>{console.log(\"item\",item);if(typeof item===\"string\")return item.trim();if(item.type===\"br\")return\"\";return item.props.children.trim();}).join(\" \");}else if(typeof children===\"object\"){if(typeof children.props.children===\"string\"){formattedHeading=children.props.children;}}else{formattedHeading=index.toString();}formattedId=formattedHeading.trim().toLowerCase().replace(/[^a-z]+/g,\"-\").replace(/^-+|-+$/g,\"\");return{formattedId,formattedHeading};};\nexport const __FramerMetadata__ = {\"exports\":{\"withContent\":{\"type\":\"reactHoc\",\"name\":\"withContent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTableOfContent\":{\"type\":\"reactHoc\",\"name\":\"withTableOfContent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TableOfContent.map","// Generated by Framer (f082bd6)\nimport{fontStore}from\"framer\";fontStore.loadFonts([\"CUSTOM;Sharp Type Medium\"]);export const fonts=[{explicitInter:true,fonts:[{family:\"Sharp Type Medium\",source:\"custom\",url:\"https://framerusercontent.com/assets/cPQh4WZ63TQ49uLyP7YpEnwQJIY.woff2\"}]}];export const css=[\".framer-G1RD2 .framer-styles-preset-l02qcy:not(.rich-text-wrapper), .framer-G1RD2 .framer-styles-preset-l02qcy.rich-text-wrapper h4 { --framer-font-family: \\\"Sharp Type Medium\\\", \\\"Sharp Type Medium Placeholder\\\", sans-serif; --framer-font-open-type-features: 'blwf' on, 'cv09' on, 'cv03' on, 'cv04' on, 'cv11' on; --framer-font-size: 24px; --framer-font-style: normal; --framer-font-variation-axes: normal; --framer-font-weight: 400; --framer-letter-spacing: -0.2px; --framer-line-height: 1.4em; --framer-paragraph-spacing: 40px; --framer-text-alignment: start; --framer-text-color: var(--token-3a68ddff-8adf-46de-a195-26452e32930a, #020506); --framer-text-decoration: none; --framer-text-stroke-color: initial; --framer-text-stroke-width: initial; --framer-text-transform: none; }\",\"@media (max-width: 991px) and (min-width: 0px) { .framer-G1RD2 .framer-styles-preset-l02qcy:not(.rich-text-wrapper), .framer-G1RD2 .framer-styles-preset-l02qcy.rich-text-wrapper h4 { --framer-font-family: \\\"Sharp Type Medium\\\", \\\"Sharp Type Medium Placeholder\\\", sans-serif; --framer-font-open-type-features: 'blwf' on, 'cv09' on, 'cv03' on, 'cv04' on, 'cv11' on; --framer-font-size: 20px; --framer-font-style: normal; --framer-font-variation-axes: normal; --framer-font-weight: 400; --framer-letter-spacing: -0.2px; --framer-line-height: 1.4em; --framer-paragraph-spacing: 40px; --framer-text-alignment: start; --framer-text-color: var(--token-3a68ddff-8adf-46de-a195-26452e32930a, #020506); --framer-text-decoration: none; --framer-text-stroke-color: initial; --framer-text-stroke-width: initial; --framer-text-transform: none; } }\"];export const className=\"framer-G1RD2\";\nexport const __FramerMetadata__ = {\"exports\":{\"className\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"fonts\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"css\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Generated by Framer (f082bd6)\nimport{fontStore}from\"framer\";fontStore.loadFonts([\"CUSTOM;Sharp Type Medium\"]);export const fonts=[{explicitInter:true,fonts:[{family:\"Sharp Type Medium\",source:\"custom\",url:\"https://framerusercontent.com/assets/cPQh4WZ63TQ49uLyP7YpEnwQJIY.woff2\"}]}];export const css=[\".framer-kJ7MA .framer-styles-preset-91pcgt:not(.rich-text-wrapper), .framer-kJ7MA .framer-styles-preset-91pcgt.rich-text-wrapper h3 { --framer-font-family: \\\"Sharp Type Medium\\\", \\\"Sharp Type Medium Placeholder\\\", sans-serif; --framer-font-open-type-features: 'blwf' on, 'cv09' on, 'cv03' on, 'cv04' on, 'cv11' on; --framer-font-size: 32px; --framer-font-style: normal; --framer-font-variation-axes: normal; --framer-font-weight: 400; --framer-letter-spacing: 0em; --framer-line-height: 40px; --framer-paragraph-spacing: 40px; --framer-text-alignment: start; --framer-text-color: var(--token-3a68ddff-8adf-46de-a195-26452e32930a, #020506); --framer-text-decoration: none; --framer-text-stroke-color: initial; --framer-text-stroke-width: initial; --framer-text-transform: none; }\",\"@media (max-width: 991px) and (min-width: 0px) { .framer-kJ7MA .framer-styles-preset-91pcgt:not(.rich-text-wrapper), .framer-kJ7MA .framer-styles-preset-91pcgt.rich-text-wrapper h3 { --framer-font-family: \\\"Sharp Type Medium\\\", \\\"Sharp Type Medium Placeholder\\\", sans-serif; --framer-font-open-type-features: 'blwf' on, 'cv09' on, 'cv03' on, 'cv04' on, 'cv11' on; --framer-font-size: 28px; --framer-font-style: normal; --framer-font-variation-axes: normal; --framer-font-weight: 400; --framer-letter-spacing: -0.56px; --framer-line-height: 32px; --framer-paragraph-spacing: 40px; --framer-text-alignment: start; --framer-text-color: var(--token-3a68ddff-8adf-46de-a195-26452e32930a, #020506); --framer-text-decoration: none; --framer-text-stroke-color: initial; --framer-text-stroke-width: initial; --framer-text-transform: none; } }\"];export const className=\"framer-kJ7MA\";\nexport const __FramerMetadata__ = {\"exports\":{\"fonts\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"className\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"css\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"wXAK8H,SAAgB,EAAmB,EAAU,CAAC,MAAO,CAAA,GAAO,CAAC,GAAK,CAAC,EAAM,CAAC,GAAU,CAAM,CAAC,EAAc,EAAiB,CAAC,EAAS,GAAG,CAAO,EAAW,GAAI,CAAC,IAAM,EAAQ,SAAS,eAAe,EAAG,CAAC,AAAG,GAAS,EAAQ,eAAe,CAAC,SAAS,QAAS,EAAC,AAAG,EAAma,MAAla,GAAU,IAAI,CAAC,IAAM,EAAa,IAAI,CAAC,IAAM,EAAS,EAAM,SAAS,IAAI,GAAS,SAAS,eAAe,EAAQ,GAAG,CAAC,CAAO,EAAe,EAAO,QAAQ,IAAI,IAAI,IAAI,EAAE,EAAS,OAAO,EAAE,GAAG,EAAE,IAAK,GAAG,EAAS,GAAG,WAAW,EAAe,CAAC,EAAiB,EAAM,SAAS,GAAG,GAAG,CAAC,KAAO,CAAE,EAAgD,MAA/C,GAAO,iBAAiB,SAAS,EAAa,CAAO,IAAI,CAAC,EAAO,oBAAoB,SAAS,EAAa,AAAE,CAAE,EAAC,CAAC,EAAM,QAAS,EAAC,CAAqB,EAAKA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