{"version":3,"file":"HelpCenterMenu.kaBVxbAx.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/uLFXcvEMiMAgIZ15SUkC/LBmikT7WpDgcujpL7fML/HelpCenterMenu.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";// Learn more: https://www.framer.com/developers/overrides/\nexport function TabState(Component){return props=>{const[tab,setTab]=useState(\"Default\");useEffect(()=>{const tabText=document.querySelector('[data-framer-name=\"Platform\"] p')?.textContent.trim();const tabIndex=document.querySelector('[data-framer-name=\"Tab Index\"] p')?.textContent.trim();console.log(tabIndex,tabText);setTab(tabIndex);setTimeout(()=>{const slug=window.location.pathname.split(\"/\").pop();console.log(slug);const link=document.querySelector(`a[href=\"./${slug}\"]`);if(link){console.log(\"element found\");console.log(link);link.style.color=\"red\";}else{console.log(\"no link element found\");}},200);},[]);return /*#__PURE__*/_jsx(Component,{...props,variant:tab});};}async function getEditorDownloadLink(){const isMac=navigator.userAgent.indexOf(\"Mac\")!==-1;const platform=isMac?\"mac\":\"win\";const yamlFile=isMac?\"latest-mac.yml\":\"latest.yml\";const res=await fetch(`https://editor-downloader.bepro11.com/latest/${platform}/${yamlFile}?${Date.now()}`);const text=await res.text();// YAML에서 files 아래 url 항목들 파싱\nconst urls=[...text.matchAll(/- url:\\s*(.+)/g)].map(m=>m[1].trim());const ext=isMac?\".dmg\":\".exe\";const targetUrl=urls.find(url=>url.includes(ext))??\"\";return`https://editor-downloader.bepro11.com/latest/${platform}/${encodeURIComponent(targetUrl)}`;}export function DownloadEditorButton(Component){return props=>{const[loading,setLoading]=useState(false);const handleClick=async()=>{setLoading(true);try{const url=await getEditorDownloadLink();window.location.href=url;}catch(e){console.error(\"Download link fetch failed:\",e);}finally{setLoading(false);}};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick});};}\nexport const __FramerMetadata__ = {\"exports\":{\"DownloadEditorButton\":{\"type\":\"reactHoc\",\"name\":\"DownloadEditorButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"TabState\":{\"type\":\"reactHoc\",\"name\":\"TabState\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HelpCenterMenu.map"],"mappings":"8IACA,SAAgB,EAAS,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAI,GAAQA,EAAS,UAAU,CAAihB,OAAhhB,MAAc,CAAC,IAAM,EAAQ,SAAS,cAAc,kCAAkC,EAAE,YAAY,MAAM,CAAO,EAAS,SAAS,cAAc,mCAAmC,EAAE,YAAY,MAAM,CAAC,QAAQ,IAAI,EAAS,EAAQ,CAAC,EAAO,EAAS,CAAC,eAAe,CAAC,IAAM,EAAK,EAAO,SAAS,SAAS,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAK,CAAC,IAAM,EAAK,SAAS,cAAc,aAAa,EAAK,IAAI,CAAI,GAAM,QAAQ,IAAI,gBAAgB,CAAC,QAAQ,IAAI,EAAK,CAAC,EAAK,MAAM,MAAM,OAAY,QAAQ,IAAI,wBAAwB,EAAI,IAAI,EAAG,EAAE,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,EAAI,CAAC,EAAI,eAAe,GAAuB,CAAC,IAAM,EAAM,EAAU,UAAU,QAAQ,MAAM,GAAG,GAAS,EAAS,EAAM,MAAM,MAAY,EAAS,EAAM,iBAAiB,aACn0B,EAAK,CAAC,IADi8B,MAA7G,MAAM,MAAM,gDAAgD,EAAS,GAAG,EAAS,GAAG,KAAK,KAAK,GAAG,EAAsB,MAAM,EACz8B,SAAS,iBAAiB,CAAC,CAAC,IAAI,GAAG,EAAE,GAAG,MAAM,CAAC,CAAO,EAAI,EAAM,OAAO,OAAa,EAAU,EAAK,KAAK,GAAK,EAAI,SAAS,EAAI,CAAC,EAAE,GAAG,MAAM,gDAAgD,EAAS,GAAG,mBAAmB,EAAU,GAAI,SAAgB,EAAqB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