{"version":3,"file":"PostContentTree.B_5N-Re4.mjs","names":["useState","useRef","useCallback","__esmMin","window","te","init_ssg_sandbox_shims","init_npm_react_18_3_1","_e","de","ne","p","c","init_jsx_runtime","ce","addPropertyControls","init_framer_DxfB3JJo","ControlType","PostContentTree","props","activeId","setActiveId","isMobile","setIsMobile","items","setItems","debugInfo","setDebugInfo","observerRef","sectionsRef","mutationObserverRef","componentRef","headingsFoundRef","assignedIdsRef","isClickScrollingRef","generateSlug","text","extractHeadings","headingElements","contentRoot","detectionMethod","contentRootSelector","headingSelector","current","candidates","el","candidate","foundHeadings","allHeadings","filteredHeadings","heading","extractedItems","id","index","item","debugMode","debugMessage","initialTimeout","retryTimeouts","timeout","delay","checkMobile","handleClick","cleanId","targetId","targetElement","finalOffset","scrollOffset","finalPosition","smoothScroll","element","observerOptions","topMostEntry","topMostPosition","entries","entry","rect","distanceFromTop","prevId","enabledItems","maxWidth","itemFont","mobileDisplay","showTitle","labelFont","labelColor","sectionPaddingTop","sectionPaddingBottom","titleLabel","isActive","showDividers","dividerColor","borderOpacity","itemSpacing","e","activeItemTextColor","itemTextColor","activeIndicatorOpacity","uppercaseItems","containerStyle","stickyTop","hoverItemTextColor","init_PostContentTree"],"sources":["https:/framerusercontent.com/modules/N1JsBuu68t1CQi1cOwEx/asnpi3jI8olYCLFS6x0C/PostContentTree.js"],"sourcesContent":["// Post Content Tree - A sticky table-of-contents sidebar component for CMS blog posts\n// Dynamically extracts H4 headings from CMS rich text content field \"Conteúdo\"\n// Displays clickable section links that smoothly scroll to article sections\n// Tracks active section while scrolling and highlights the current item\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useState,useCallback,useRef,startTransition}from\"react\";/**\n * Post Content Tree\n *\n * @framerIntrinsicWidth 280\n * @framerIntrinsicHeight 400\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function PostContentTree(props){const{titleLabel=\"Neste Artigo\",showTitle=true,headingSelector=\"h4\",contentRootSelector=\"\",labelColor=\"#000000\",itemTextColor=\"#666666\",activeItemTextColor=\"#000000\",hoverItemTextColor=\"#000000\",dividerColor=\"#EEEEEE\",labelFont,itemFont,itemSpacing=16,sectionPaddingTop=24,sectionPaddingBottom=24,borderOpacity=1,activeIndicatorOpacity=1,stickyTop=100,scrollOffset=100,smoothScroll=true,showDividers=true,maxWidth=280,mobileDisplay=\"collapsible\",debugMode=false,uppercaseItems=false}=props;const[activeId,setActiveId]=useState(null);const[isMobile,setIsMobile]=useState(false);const[items,setItems]=useState([]);const[debugInfo,setDebugInfo]=useState(\"\");const observerRef=useRef(null);const sectionsRef=useRef(new Map);const mutationObserverRef=useRef(null);const componentRef=useRef(null);const headingsFoundRef=useRef(false);const assignedIdsRef=useRef(new Set);const isClickScrollingRef=useRef(false);// Generate slug from text\nconst generateSlug=useCallback(text=>{return text.toLowerCase().normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g,\"\")// Remove accents\n.replace(/[^\\w\\s-]/g,\"\")// Remove special characters\n.replace(/\\s+/g,\"-\")// Replace spaces with hyphens\n.replace(/-+/g,\"-\")// Replace multiple hyphens with single\n.trim();},[]);// Extract H4 headings from CMS rich text content\nconst extractHeadings=useCallback(()=>{if(typeof window===\"undefined\")return;// Stop scanning if we've already found headings successfully\nif(headingsFoundRef.current&&items.length>0)return;let headingElements=null;let contentRoot=null;let detectionMethod=\"\";// Strategy 1: Use provided contentRootSelector\nif(contentRootSelector&&contentRootSelector.trim()!==\"\"){try{contentRoot=document.querySelector(contentRootSelector);if(contentRoot){headingElements=contentRoot.querySelectorAll(headingSelector);detectionMethod=`Custom selector: ${contentRootSelector}`;}}catch(e){// Invalid selector, continue to fallback\n}}// Strategy 2: Automatic detection - find nearest article content container\nif(!headingElements||headingElements.length===0){// Try to find the component's position in the DOM\nif(componentRef.current){// Look for sibling or nearby content containers\nlet current=componentRef.current.parentElement;// Walk up the DOM tree to find a common container\nwhile(current&&!contentRoot){// Look for article content containers within this level\nconst candidates=[current.querySelector(\"article\"),current.querySelector(\"main\"),current.querySelector(\"[role='main']\"),current.querySelector(\".post-content\"),current.querySelector(\".article-content\"),current.querySelector(\".content\"),// Look for rich text containers (Framer CMS often uses these)\n...Array.from(current.querySelectorAll(\"[data-framer-component-type]\")).filter(el=>{// Filter for elements that look like rich text content\nconst text=el.textContent||\"\";return text.length>200// Likely article content if substantial text\n;})];for(const candidate of candidates){if(candidate&&candidate!==componentRef.current&&!componentRef.current.contains(candidate)){const foundHeadings=candidate.querySelectorAll(headingSelector);if(foundHeadings.length>0){contentRoot=candidate;headingElements=foundHeadings;detectionMethod=`Auto-detected: ${candidate.tagName}${candidate.className?\".\"+candidate.className.split(\" \")[0]:\"\"}`;break;}}}if(!contentRoot){current=current.parentElement;}}}}// Strategy 3: Fallback - search entire document but exclude sidebar\nif(!headingElements||headingElements.length===0){const allHeadings=document.querySelectorAll(headingSelector);const filteredHeadings=[];allHeadings.forEach(heading=>{// Exclude headings inside this component\nif(componentRef.current&&!componentRef.current.contains(heading)){filteredHeadings.push(heading);}});if(filteredHeadings.length>0){headingElements=filteredHeadings;detectionMethod=`Fallback: all ${headingSelector} elements on page`;}}const extractedItems=[];if(headingElements&&headingElements.length>0){headingElements.forEach(heading=>{const text=heading.textContent?.trim()||\"\";if(!text)return;// Use existing id or generate one\nlet id=heading.id;if(!id){id=generateSlug(text);// Only assign id if we haven't already done so\nif(!assignedIdsRef.current.has(id)){heading.id=id;assignedIdsRef.current.add(id);}}else{assignedIdsRef.current.add(id);}extractedItems.push({label:text,targetId:id});});}// Only update state if items have changed\nif(extractedItems.length>0){const itemsChanged=extractedItems.length!==items.length||extractedItems.some((item,index)=>!items[index]||item.label!==items[index].label||item.targetId!==items[index].targetId);if(itemsChanged){startTransition(()=>setItems(extractedItems));headingsFoundRef.current=true;// Disconnect MutationObserver once we've found headings\nif(mutationObserverRef.current){mutationObserverRef.current.disconnect();mutationObserverRef.current=null;}}}if(debugMode){const debugMessage=`Detection: ${detectionMethod||\"none\"}\nFound: ${extractedItems.length} ${headingSelector} elements\nHeadings: ${extractedItems.map(item=>item.label).join(\", \")||\"none\"}`;startTransition(()=>setDebugInfo(debugMessage));}},[headingSelector,contentRootSelector,generateSlug,debugMode,items]);// Extract headings on mount with retry logic for async CMS content\nuseEffect(()=>{if(typeof window===\"undefined\")return;// Initial extraction after a brief delay\nconst initialTimeout=setTimeout(()=>{extractHeadings();},100);// Retry a few times to catch async-loaded content\nconst retryTimeouts=[];const retryDelays=[500,1e3,2e3];retryDelays.forEach(delay=>{const timeout=window.setTimeout(()=>{// Only retry if we haven't found headings yet\nif(!headingsFoundRef.current){extractHeadings();}},delay);retryTimeouts.push(timeout);});// Set up MutationObserver to watch for content changes\n// Only if we haven't found headings yet\nif(!headingsFoundRef.current){mutationObserverRef.current=new MutationObserver(()=>{if(!headingsFoundRef.current){extractHeadings();}});mutationObserverRef.current.observe(document.body,{childList:true,subtree:true});}return()=>{clearTimeout(initialTimeout);retryTimeouts.forEach(timeout=>clearTimeout(timeout));if(mutationObserverRef.current){mutationObserverRef.current.disconnect();}};},[extractHeadings]);// Detect mobile viewport\nuseEffect(()=>{if(typeof window===\"undefined\")return;const checkMobile=()=>{startTransition(()=>setIsMobile(window.innerWidth<768));};checkMobile();window.addEventListener(\"resize\",checkMobile);return()=>window.removeEventListener(\"resize\",checkMobile);},[]);// Handle smooth scroll to section\nconst handleClick=useCallback(targetId=>{if(typeof window===\"undefined\")return;// Normalize targetId (remove leading # if present)\nconst cleanId=targetId.startsWith(\"#\")?targetId.slice(1):targetId;const targetElement=document.getElementById(cleanId);if(!targetElement)return;// Set flag to prevent IntersectionObserver from interfering\nisClickScrollingRef.current=true;// Update active state immediately\nstartTransition(()=>setActiveId(cleanId));// Manual scroll calculation to account for fixed header\n// Apply additional 50px correction to ensure content is fully visible\nconst finalOffset=scrollOffset+50;const elementTop=targetElement.getBoundingClientRect().top+window.scrollY;const finalPosition=elementTop-finalOffset;if(smoothScroll){window.scrollTo({top:finalPosition,behavior:\"smooth\"});}else{window.scrollTo({top:finalPosition,behavior:\"auto\"});}// Re-enable IntersectionObserver after scroll completes\n// Use longer timeout for smooth scroll to ensure it's finished\nsetTimeout(()=>{isClickScrollingRef.current=false;},smoothScroll?1e3:100);},[scrollOffset,smoothScroll]);// Set up IntersectionObserver to track active section\nuseEffect(()=>{if(typeof window===\"undefined\")return;if(items.length===0)return;// Clean up previous observer\nif(observerRef.current){observerRef.current.disconnect();}// Clear sections map\nsectionsRef.current.clear();// Find all target sections\nitems.forEach(item=>{const cleanId=item.targetId.startsWith(\"#\")?item.targetId.slice(1):item.targetId;const element=document.getElementById(cleanId);if(element){sectionsRef.current.set(cleanId,element);}});if(sectionsRef.current.size===0)return;// Create intersection observer with passive observation\nconst observerOptions={rootMargin:`-${scrollOffset}px 0px -50% 0px`,threshold:[0,.25,.5,.75,1]};observerRef.current=new IntersectionObserver(entries=>{// Skip updates if user just clicked a link\nif(isClickScrollingRef.current)return;// Use requestAnimationFrame to avoid layout thrashing\nrequestAnimationFrame(()=>{// Find the most visible section near the top\nlet topMostEntry=null;let topMostPosition=Number.POSITIVE_INFINITY;entries.forEach(entry=>{if(entry.isIntersecting){const rect=entry.boundingClientRect;const distanceFromTop=Math.abs(rect.top-scrollOffset);if(distanceFromTop<topMostPosition){topMostPosition=distanceFromTop;topMostEntry=entry;}}});if(topMostEntry){const id=topMostEntry.target.id;// Only update if changed\nsetActiveId(prevId=>prevId===id?prevId:id);}});},observerOptions);// Observe all sections\nsectionsRef.current.forEach(element=>{observerRef.current?.observe(element);});return()=>{if(observerRef.current){observerRef.current.disconnect();}};},[items,scrollOffset]);// Filter enabled items\nconst enabledItems=items;// If no items found, show minimal empty state or debug info\nif(enabledItems.length===0){if(debugMode){return /*#__PURE__*/_jsx(\"div\",{ref:componentRef,style:{width:\"100%\",maxWidth:`${maxWidth}px`,minHeight:\"100px\",backgroundColor:\"#FFF9E6\",border:\"1px solid #FFD700\",borderRadius:\"4px\",position:\"relative\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:\"24px\"},children:/*#__PURE__*/_jsx(\"span\",{style:{...itemFont,color:\"#000\",fontSize:\"12px\",whiteSpace:\"pre-wrap\",textAlign:\"left\"},children:debugInfo||\"Searching for h3 elements...\"})});}// Neutral empty state - just render nothing visible\nreturn /*#__PURE__*/_jsx(\"div\",{ref:componentRef,style:{width:\"100%\",maxWidth:`${maxWidth}px`,minHeight:\"1px\",backgroundColor:\"transparent\",position:\"relative\"}});}// Handle mobile display\nif(isMobile){if(mobileDisplay===\"hidden\"){return null;}// Mobile: always show full list, no collapsible behavior\nreturn /*#__PURE__*/_jsxs(\"nav\",{ref:componentRef,style:{width:\"100%\",backgroundColor:\"transparent\",position:\"relative\",paddingLeft:\"16px\",paddingRight:\"16px\"},\"aria-label\":\"Table of contents\",children:[debugMode&&debugInfo&&/*#__PURE__*/_jsx(\"div\",{style:{backgroundColor:\"#FFF9E6\",border:\"1px solid #FFD700\",borderRadius:\"4px\",padding:\"8px\",marginBottom:\"16px\",fontSize:\"11px\",whiteSpace:\"pre-wrap\",color:\"#000\"},children:debugInfo}),showTitle&&/*#__PURE__*/_jsx(\"div\",{style:{...labelFont,color:labelColor,paddingTop:`${Math.max(16,sectionPaddingTop)}px`,paddingBottom:`${Math.max(12,sectionPaddingBottom)}px`},children:titleLabel}),/*#__PURE__*/_jsx(\"div\",{style:{paddingBottom:`${Math.max(16,sectionPaddingBottom)}px`},children:enabledItems.map((item,index)=>{const cleanId=item.targetId.startsWith(\"#\")?item.targetId.slice(1):item.targetId;const isActive=activeId===cleanId;return /*#__PURE__*/_jsxs(\"div\",{children:[showDividers&&index>0&&/*#__PURE__*/_jsx(\"div\",{style:{height:\"1px\",backgroundColor:dividerColor,opacity:borderOpacity,marginTop:`${Math.max(12,itemSpacing)}px`,marginBottom:`${Math.max(12,itemSpacing)}px`}}),/*#__PURE__*/_jsx(\"a\",{href:`#${cleanId}`,onClick:e=>{e.preventDefault();handleClick(item.targetId);},style:{display:\"block\",textDecoration:\"none\",cursor:\"pointer\",padding:\"8px 0\",minHeight:\"44px\",alignItems:\"center\",...itemFont,color:isActive?activeItemTextColor:itemTextColor,opacity:isActive?activeIndicatorOpacity:1,transition:\"color 0.2s ease, opacity 0.2s ease\",textTransform:uppercaseItems?\"uppercase\":\"none\"},\"aria-current\":isActive?\"location\":undefined,children:item.label})]},index);})})]});}// Desktop display\nconst containerStyle={width:\"100%\",maxWidth:`${maxWidth}px`,backgroundColor:\"transparent\",position:\"sticky\",top:`${stickyTop}px`};return /*#__PURE__*/_jsxs(\"nav\",{ref:componentRef,style:containerStyle,\"aria-label\":\"Table of contents\",children:[debugMode&&debugInfo&&/*#__PURE__*/_jsx(\"div\",{style:{backgroundColor:\"#FFF9E6\",border:\"1px solid #FFD700\",borderRadius:\"4px\",padding:\"8px\",marginBottom:\"16px\",fontSize:\"11px\",whiteSpace:\"pre-wrap\",color:\"#000\"},children:debugInfo}),showTitle&&/*#__PURE__*/_jsx(\"div\",{style:{...labelFont,color:labelColor,paddingTop:`${sectionPaddingTop}px`,paddingBottom:`${sectionPaddingBottom}px`},children:titleLabel}),/*#__PURE__*/_jsx(\"div\",{children:enabledItems.map((item,index)=>{const cleanId=item.targetId.startsWith(\"#\")?item.targetId.slice(1):item.targetId;const isActive=activeId===cleanId;return /*#__PURE__*/_jsxs(\"div\",{children:[showDividers&&index>0&&/*#__PURE__*/_jsx(\"div\",{style:{height:\"1px\",backgroundColor:dividerColor,opacity:borderOpacity,marginBottom:`${itemSpacing}px`}}),/*#__PURE__*/_jsx(\"a\",{href:`#${cleanId}`,onClick:e=>{e.preventDefault();handleClick(item.targetId);},style:{display:\"block\",textDecoration:\"none\",cursor:\"pointer\",marginBottom:index<enabledItems.length-1?`${itemSpacing}px`:0,...itemFont,color:isActive?activeItemTextColor:itemTextColor,opacity:isActive?activeIndicatorOpacity:1,transition:\"color 0.2s ease, opacity 0.2s ease\",textTransform:uppercaseItems?\"uppercase\":\"none\"},\"aria-current\":isActive?\"location\":undefined,onMouseEnter:e=>{if(!isActive){e.currentTarget.style.color=hoverItemTextColor;e.currentTarget.style.opacity=\"0.7\";}},onMouseLeave:e=>{if(!isActive){e.currentTarget.style.color=itemTextColor;e.currentTarget.style.opacity=\"1\";}},children:item.label})]},index);})})]});}addPropertyControls(PostContentTree,{titleLabel:{type:ControlType.String,title:\"Title Label\",defaultValue:\"Neste Artigo\"},showTitle:{type:ControlType.Boolean,title:\"Show Title\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},headingSelector:{type:ControlType.String,title:\"Heading Selector\",defaultValue:\"h4\",description:\"HTML heading tag to extract (e.g., h4)\"},contentRootSelector:{type:ControlType.String,title:\"Content Root Selector\",defaultValue:\"\",description:\"Optional CSS selector for article container (leave empty for auto-detect)\"},debugMode:{type:ControlType.Boolean,title:\"Debug Mode\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},labelColor:{type:ControlType.Color,title:\"Label Color\",defaultValue:\"#000000\"},itemTextColor:{type:ControlType.Color,title:\"Item Text Color\",defaultValue:\"#666666\"},activeItemTextColor:{type:ControlType.Color,title:\"Active Item Color\",defaultValue:\"#000000\"},hoverItemTextColor:{type:ControlType.Color,title:\"Hover Item Color\",defaultValue:\"#000000\"},dividerColor:{type:ControlType.Color,title:\"Divider Color\",defaultValue:\"#EEEEEE\"},labelFont:{type:ControlType.Font,title:\"Label Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"12px\",variant:\"Semibold\",letterSpacing:\"0.05em\",lineHeight:\"1.2em\"}},itemFont:{type:ControlType.Font,title:\"Item Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Regular\",letterSpacing:\"-0.01em\",lineHeight:\"1.4em\"}},itemSpacing:{type:ControlType.Number,title:\"Item Spacing\",defaultValue:16,min:0,max:48,step:1,unit:\"px\"},sectionPaddingTop:{type:ControlType.Number,title:\"Padding Top\",defaultValue:24,min:0,max:64,step:1,unit:\"px\"},sectionPaddingBottom:{type:ControlType.Number,title:\"Padding Bottom\",defaultValue:24,min:0,max:64,step:1,unit:\"px\"},borderOpacity:{type:ControlType.Number,title:\"Border Opacity\",defaultValue:1,min:0,max:1,step:.1},activeIndicatorOpacity:{type:ControlType.Number,title:\"Active Opacity\",defaultValue:1,min:0,max:1,step:.1},stickyTop:{type:ControlType.Number,title:\"Sticky Top\",defaultValue:100,min:0,max:500,step:10,unit:\"px\"},scrollOffset:{type:ControlType.Number,title:\"Scroll Offset\",defaultValue:100,min:0,max:500,step:10,unit:\"px\"},smoothScroll:{type:ControlType.Boolean,title:\"Smooth Scroll\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},showDividers:{type:ControlType.Boolean,title:\"Show Dividers\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},maxWidth:{type:ControlType.Number,title:\"Max Width\",defaultValue:280,min:200,max:500,step:10,unit:\"px\"},mobileDisplay:{type:ControlType.Enum,title:\"Mobile Display\",options:[\"hidden\",\"collapsible\",\"normal\"],optionTitles:[\"Hidden\",\"Collapsible\",\"Normal\"],defaultValue:\"collapsible\"},uppercaseItems:{type:ControlType.Boolean,title:\"Uppercase Items\",defaultValue:false,enabledTitle:\"Uppercase\",disabledTitle:\"Normal\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PostContentTree\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"400\",\"framerIntrinsicWidth\":\"280\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PostContentTree.map"],"mappings":"A,2NAYG,SAAwBkB,EAAgB,EAAM,CAAC,GAAK,CAAC,aAAW,eAAe,YAAU,GAAK,kBAAgB,KAAK,sBAAoB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