{"version":3,"file":"BlogToC.Bvp4P2fd.mjs","names":["useRef","useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/AFVASnD9f96jfFqI51lt/LP6CI1xUVUtgGcXZWs1l/BlogToC.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const defaultSections=[{label:\"Quick Comparison\",anchor:\"comparison\"},{label:\"Which Method?\",anchor:\"which-method\"},{label:\"All 7 Methods\",anchor:\"methods\"},{label:\"FAQ\",anchor:\"faq\"}];const SLUG_SECTIONS={\"how-to-block-distracting-websites-on-mac\":[{label:\"Quick Comparison\",anchor:\"comparison\"},{label:\"Which Method?\",anchor:\"which-method\"},{label:\"All 7 Methods\",anchor:\"methods\"},{label:\"FAQ\",anchor:\"faq\"}],\"context-switching-the-hidden-productivity-killer\":[{label:\"The real numbers\",anchor:\"task-switching\"},{label:\"Cognitive cost\",anchor:\"cognitive-cost\"},{label:\"Attention residue\",anchor:\"attention-residue\"},{label:\"FAQ\",anchor:\"faq\"}],\"best-focus-app-for-mac\":[{label:\"9 apps reviewed\",anchor:\"apps\"},{label:\"How to choose\",anchor:\"apps\"},{label:\"FAQ\",anchor:\"faq\"}],\"deep-work-on-mac-setup-guide\":[{label:\"The 6-step setup\",anchor:\"setup\"},{label:\"Fragmentation vs distraction\",anchor:\"setup\"},{label:\"FAQ\",anchor:\"faq\"}],\"adhd-focus-tools-for-mac\":[{label:\"Tools for ADHD\",anchor:\"tools\"},{label:\"macOS tips\",anchor:\"macos-adhd-tips\"},{label:\"FAQ\",anchor:\"faq\"}],\"ai-website-blockers-replacing-blocklists\":[{label:\"The blocklist problem\",anchor:\"blocklist-limits\"},{label:\"How AI blocking works\",anchor:\"how-ai-works\"},{label:\"Privacy\",anchor:\"ai-privacy\"},{label:\"FAQ\",anchor:\"faq\"}],\"why-macos-screen-time-isnt-enough\":[{label:\"Why Screen Time fails\",anchor:\"main\"},{label:\"What works instead\",anchor:\"alternatives\"},{label:\"FAQ\",anchor:\"faq\"}],\"digital-distraction-statistics-2026\":[{label:\"Task switching stats\",anchor:\"attention-stats\"},{label:\"Workplace data\",anchor:\"workplace-stats\"},{label:\"Stats to avoid\",anchor:\"bad-stats\"},{label:\"FAQ\",anchor:\"faq\"}]};export default function BlogToC({style,sections,title=\"In this article\",slug}){const ref=useRef(null);const[activeAnchor,setActiveAnchor]=useState(\"\");const[open,setOpen]=useState(true);const resolvedSections=sections&&sections.length>0?sections:slug&&SLUG_SECTIONS[slug]?SLUG_SECTIONS[slug]:defaultSections;useEffect(()=>{if(!ref.current)return;let el=ref.current.parentElement;let depth=0;while(el&&depth<20){el.style.setProperty(\"height\",\"auto\",\"important\");el.style.setProperty(\"max-height\",\"none\",\"important\");el.style.setProperty(\"overflow\",\"visible\",\"important\");el=el.parentElement;depth++;}},[]);useEffect(()=>{const observers=[];resolvedSections.forEach(({anchor})=>{const el=document.getElementById(anchor);if(!el)return;const obs=new IntersectionObserver(([entry])=>{if(entry.isIntersecting)setActiveAnchor(anchor);},{rootMargin:\"-20% 0px -70% 0px\"});obs.observe(el);observers.push(obs);});return()=>observers.forEach(o=>o.disconnect());},[resolvedSections]);const safeStyle={...style||{}};delete safeStyle.height;delete safeStyle.maxHeight;delete safeStyle.minHeight;delete safeStyle.overflow;const scrollTo=anchor=>{const el=document.getElementById(anchor);if(el){const y=el.getBoundingClientRect().top+window.scrollY-72;window.scrollTo({top:y,behavior:\"smooth\"});}};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                .toc-wrap {\n                    width: 100%;\n                    background: #F4F4F0;\n                    padding: 0 20px 0;\n                    box-sizing: border-box;\n                    font-family: Geist, Inter, -apple-system, BlinkMacSystemFont, sans-serif;\n                    -webkit-font-smoothing: antialiased;\n                }\n                .toc-inner { max-width: 760px; margin: 0 auto; padding-bottom: 8px; }\n                .toc-card {\n                    background: #fff;\n                    border: 1px solid rgba(0,0,0,0.08);\n                    border-radius: 14px;\n                    overflow: hidden;\n                }\n                .toc-header {\n                    display: flex;\n                    align-items: center;\n                    justify-content: space-between;\n                    padding: 14px 18px;\n                    cursor: pointer;\n                    user-select: none;\n                }\n                .toc-header:hover { background: rgba(0,0,0,0.015); }\n                .toc-title {\n                    font-size: 12px;\n                    font-weight: 700;\n                    letter-spacing: 0.07em;\n                    text-transform: uppercase;\n                    color: #888;\n                }\n                .toc-chevron {\n                    font-size: 11px;\n                    color: #bbb;\n                    transition: transform 0.2s;\n                }\n                .toc-chevron.open { transform: rotate(180deg); }\n                .toc-list { padding: 4px 0 12px; border-top: 1px solid rgba(0,0,0,0.06); }\n                .toc-item {\n                    display: flex;\n                    align-items: center;\n                    gap: 10px;\n                    padding: 7px 18px;\n                    cursor: pointer;\n                    border: none;\n                    background: none;\n                    width: 100%;\n                    text-align: left;\n                    transition: background 0.12s;\n                }\n                .toc-item:hover { background: rgba(0,0,0,0.02); }\n                .toc-dot {\n                    width: 6px;\n                    height: 6px;\n                    border-radius: 50%;\n                    background: #ddd;\n                    flex-shrink: 0;\n                    transition: background 0.15s;\n                }\n                .toc-dot.active { background: #30D359; }\n                .toc-label {\n                    font-size: 13px;\n                    font-weight: 500;\n                    color: #555;\n                    transition: color 0.15s;\n                    line-height: 1.4;\n                }\n                .toc-label.active { color: #171717; font-weight: 600; }\n                .toc-num {\n                    margin-left: auto;\n                    font-size: 11px;\n                    color: #ccc;\n                    font-weight: 600;\n                }\n                @media (min-width: 640px) {\n                    .toc-wrap { padding: 0 32px 0; }\n                }\n            `}),/*#__PURE__*/_jsx(\"div\",{ref:ref,className:\"toc-wrap\",style:safeStyle,children:/*#__PURE__*/_jsx(\"div\",{className:\"toc-inner\",children:/*#__PURE__*/_jsxs(\"div\",{className:\"toc-card\",children:[/*#__PURE__*/_jsxs(\"div\",{className:\"toc-header\",onClick:()=>setOpen(o=>!o),children:[/*#__PURE__*/_jsx(\"span\",{className:\"toc-title\",children:title}),/*#__PURE__*/_jsx(\"span\",{className:`toc-chevron${open?\" open\":\"\"}`,children:\"▾\"})]}),open&&/*#__PURE__*/_jsx(\"div\",{className:\"toc-list\",children:resolvedSections.map((s,i)=>/*#__PURE__*/_jsxs(\"button\",{className:\"toc-item\",onClick:()=>scrollTo(s.anchor),children:[/*#__PURE__*/_jsx(\"span\",{className:`toc-dot${activeAnchor===s.anchor?\" active\":\"\"}`}),/*#__PURE__*/_jsx(\"span\",{className:`toc-label${activeAnchor===s.anchor?\" active\":\"\"}`,children:s.label}),/*#__PURE__*/_jsx(\"span\",{className:\"toc-num\",children:i+1})]},s.anchor+i))})]})})})]});}addPropertyControls(BlogToC,{title:{type:ControlType.String,title:\"Heading\",defaultValue:\"In this article\"},slug:{type:ControlType.String,title:\"Post Slug\",defaultValue:\"\"},sections:{type:ControlType.Array,title:\"Sections (override)\",control:{type:ControlType.Object,controls:{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Section\"},anchor:{type:ControlType.String,title:\"Anchor ID\",defaultValue:\"section\"}}},defaultValue:[]}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BlogToC\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BlogToC.map"],"mappings":"oNAA+zD,SAAwB,EAAQ,CAAC,QAAM,WAAS,QAAM,kBAAkB,QAAM,CAAC,IAAM,EAAIA,EAAO,KAAK,CAAM,CAAC,EAAa,GAAiBC,EAAS,GAAG,CAAM,CAAC,EAAK,GAASA,EAAS,GAAK,CAAO,EAAiB,GAAU,EAAS,OAAO,EAAE,EAAS,GAAM,EAAc,GAAM,EAAc,GAAM,EAAgB,MAAc,CAAC,GAAG,CAAC,EAAI,QAAQ,OAAO,IAAI,EAAG,EAAI,QAAQ,cAAkB,EAAM,EAAE,KAAM,GAAI,EAAM,IAAI,EAAG,MAAM,YAAY,SAA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