{"version":3,"file":"ViewAllGeneric.fSCIITa-.mjs","names":[],"sources":["https:/framerusercontent.com/modules/woKpKKOiPA5gBC9YMVdY/VTpel42gz0NidjmMWwJu/ViewAllGeneric.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export function ViewAllGeneric(props){const{targetUrl,slug,label,color}=props;React.useEffect(()=>{try{const path=window.location.pathname.replace(/\\/+$/,\"\");if(path===`/${slug}`){sessionStorage.setItem(`cameFrom-${slug}`,\"1\");}}catch{}},[slug]);const handleClick=e=>{e.preventDefault();try{const host=window.location.host;const isExternal=/^https?:\\/\\//i.test(targetUrl)&&!targetUrl.includes(host);// ---- Si targetUrl tiene un # y es la misma página actual -> scroll suave\nconst urlObj=new URL(targetUrl,window.location.origin);const samePageAnchor=urlObj.pathname===window.location.pathname&&urlObj.hash.length>1;if(samePageAnchor){const id=urlObj.hash.slice(1);const el=document.getElementById(id);if(el)el.scrollIntoView({behavior:\"smooth\"});return;}if(isExternal){window.location.href=targetUrl;return;}const cameFromList=sessionStorage.getItem(`cameFrom-${slug}`)===\"1\";if(cameFromList&&window.history.length>1){sessionStorage.removeItem(`cameFrom-${slug}`);window.history.back();return;}}catch{}// en cualquier otro caso ir al targetUrl (puede tener #, funciona igual)\nwindow.location.href=targetUrl;};return /*#__PURE__*/_jsxs(\"a\",{href:targetUrl,onClick:handleClick,style:{display:\"inline-flex\",alignItems:\"center\",gap:8,cursor:\"pointer\",textDecoration:\"none\",color:color||\"black\",fontFamily:\"Inter, sans-serif\",textTransform:\"uppercase\",fontSize:11,letterSpacing:\"1.76px\",lineHeight:\"140%\",fontWeight:\"600\"},children:[/*#__PURE__*/_jsx(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 256 256\",width:\"16\",height:\"16\",fill:\"currentColor\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z\"})}),label||\"View all\"]});}addPropertyControls(ViewAllGeneric,{label:{type:ControlType.String,title:\"Text\",defaultValue:\"View all\"},color:{type:ControlType.Color,title:\"Color\"},targetUrl:{type:ControlType.String,title:\"Target URL\",defaultValue:\"https://www.brokenrubik.com/portfolio#section-id\"},slug:{type:ControlType.String,title:\"Slug\",defaultValue:\"blog\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"ViewAllGeneric\":{\"type\":\"reactComponent\",\"name\":\"ViewAllGeneric\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ViewAllGeneric.map"],"mappings":"+LAAyI,SAAgB,EAAe,EAAM,CAAC,GAAK,CAAC,YAAU,OAAK,QAAM,SAAO,EAEhL,OAFsL,MAAoB,CAAC,GAAG,CAAY,EAAO,SAAS,SAAS,QAAQ,OAAO,GAAG,GAAW,IAAI,KAAQ,eAAe,QAAQ,YAAY,IAAO,IAAI,MAAQ,IAAI,CAAC,EAAK,CAAC,CAEzU,EAAM,IAAI,CAAC,KAAK,EAAU,QAFkU,GAAG,CAAC,EAAE,gBAAgB,CAAC,GAAG,CAAC,IAAM,EAAK,EAAO,SAAS,KAAW,EAAW,gBAAgB,KAAK,EAAU,EAAE,CAAC,EAAU,SAAS,EAAK,CACjhB,EAAO,IAAI,IAAI,EAAU,EAAO,SAAS,OAAO,CAAuF,GAAjE,EAAO,WAAW,EAAO,SAAS,UAAU,EAAO,KAAK,OAAO,EAAoB,CAAC,IAAM,EAAG,EAAO,KAAK,MAAM,EAAE,CAAO,EAAG,SAAS,eAAe,EAAG,CAAI,GAAG,EAAG,eAAe,CAAC,SAAS,SAAS,CAAC,CAAC,OAAQ,GAAG,EAAW,CAAC,EAAO,SAAS,KAAK,EAAU,OAA4E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