{"version":3,"file":"Back.Cpg9B6Iz.mjs","names":["React.useState","React.useMemo"],"sources":["https:/framerusercontent.com/modules/vPuVmgVp1Wp0I1MbG1z6/Aac3TeqRGmRTM5BYb1DN/Back.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function BackButton(props){const{label=\"Back\",defaultColor=\"#ffffff\",hoverColor=\"#f5f5f5\",textColor=\"#111111\",textHoverColor=\"#111111\",borderColor=\"rgba(0,0,0,0.15)\",radius=12,fontSize=16,fontWeight=600,letterSpacing=0,fullWidth=false,paddingTop=12,paddingRight=20,paddingBottom=12,paddingLeft=20,fallbackUrl=\"/\",showIcon=true}=props;const[hover,setHover]=React.useState(false);const referrer=typeof document!==\"undefined\"?document.referrer:\"\";const hereOrigin=typeof location!==\"undefined\"?location.origin:\"\";const referrerUrl=React.useMemo(()=>{try{return referrer?new URL(referrer):null;}catch{return null;}},[referrer]);const hasReferrer=!!referrerUrl;const isSameOrigin=referrerUrl?.origin===hereOrigin;const onClick=e=>{e.preventDefault();if(typeof window===\"undefined\")return;try{if(\"scrollRestoration\"in history){history.scrollRestoration=\"auto\";}if(hasReferrer&&isSameOrigin){// Same-origin: preserves scroll position\nhistory.back();return;}if(hasReferrer&&!isSameOrigin){// External referrer: go back to the referring page\nwindow.location.assign(referrerUrl.href);return;}// No referrer: use fallback\nif(fallbackUrl){window.location.assign(fallbackUrl);}else{// last resort\nwindow.history.length>1?history.back():window.location.assign(\"/\");}}catch{window.location.assign(fallbackUrl||\"/\");}};const style={display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",width:fullWidth?\"100%\":\"auto\",cursor:\"pointer\",userSelect:\"none\",border:`1px solid ${borderColor}`,background:hover?hoverColor:defaultColor,color:hover?textHoverColor:textColor,paddingTop,paddingRight,paddingBottom,paddingLeft,borderRadius:radius,lineHeight:1.2,textDecoration:\"none\",letterSpacing:`${letterSpacing}px`,fontSize,fontWeight,transition:\"background 120ms ease, color 120ms ease, border-color 120ms ease, box-shadow 120ms ease\"};const iconStyle={marginRight:showIcon?8:0,display:showIcon?\"inline-block\":\"none\"};return /*#__PURE__*/_jsxs(\"button\",{type:\"button\",\"aria-label\":label||\"Go back\",onClick:onClick,onMouseEnter:()=>setHover(true),onMouseLeave:()=>setHover(false),onFocus:()=>setHover(true),onBlur:()=>setHover(false),style:style,children:[/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:iconStyle,children:\"←\"}),/*#__PURE__*/_jsx(\"span\",{children:label})]});}addPropertyControls(BackButton,{// Label\nlabel:{type:ControlType.String,title:\"Label\",defaultValue:\"Back\"},// Icon\nshowIcon:{type:ControlType.Boolean,title:\"Show Icon\",defaultValue:true},// Padding (per side)\npaddingTop:{type:ControlType.Number,title:\"Pad Top\",defaultValue:12,min:0,max:64,step:1},paddingRight:{type:ControlType.Number,title:\"Pad Right\",defaultValue:20,min:0,max:64,step:1},paddingBottom:{type:ControlType.Number,title:\"Pad Bottom\",defaultValue:12,min:0,max:64,step:1},paddingLeft:{type:ControlType.Number,title:\"Pad Left\",defaultValue:20,min:0,max:64,step:1},// Colors & border\ndefaultColor:{type:ControlType.Color,title:\"BG\",defaultValue:\"#ffffff\"},hoverColor:{type:ControlType.Color,title:\"BG Hover\",defaultValue:\"#f5f5f5\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#111111\"},textHoverColor:{type:ControlType.Color,title:\"Text Hover\",defaultValue:\"#111111\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"rgba(0,0,0,0.15)\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:12,min:0,max:64,step:1},// Typography\nfontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:16,min:10,max:40,step:1},fontWeight:{type:ControlType.Enum,title:\"Weight\",options:[400,500,600,700],optionTitles:[\"Regular\",\"Medium\",\"Semibold\",\"Bold\"],defaultValue:600},letterSpacing:{type:ControlType.Number,title:\"Tracking\",defaultValue:0,min:-1,max:2,step:.1},// Layout\nfullWidth:{type:ControlType.Boolean,title:\"Full Width\",defaultValue:false},// Behavior\nfallbackUrl:{type:ControlType.String,title:\"Fallback URL\",defaultValue:\"/\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BackButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Back.map"],"mappings":"sMAAyI,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,QAAM,OAAO,eAAa,UAAU,aAAW,UAAU,YAAU,UAAU,iBAAe,UAAU,cAAY,mBAAmB,SAAO,GAAG,WAAS,GAAG,aAAW,IAAI,gBAAc,EAAE,YAAU,GAAM,aAAW,GAAG,eAAa,GAAG,gBAAc,GAAG,cAAY,GAAG,cAAY,IAAI,WAAS,IAAM,EAAW,CAAC,EAAM,GAAUA,EAAe,GAAM,CAAO,EAAS,OAAO,SAAW,IAAY,SAAS,SAAS,GAAS,EAAW,OAAO,SAAW,IAAY,SAAS,OAAO,GAAS,EAAYC,MAAkB,CAAC,GAAG,CAAC,OAAO,EAAS,IAAI,IAAI,EAAS,CAAC,UAAW,CAAC,OAAO,OAAQ,CAAC,EAAS,CAAC,CAAO,EAAY,CAAC,CAAC,EAAkB,EAAa,GAAa,SAAS,EAAiB,EAAQ,GAAG,CAAC,KAAE,gBAAgB,CAAW,IAAS,OAAmB,GAAG,CAAqE,GAAjE,sBAAsB,UAAS,QAAQ,kBAAkB,QAAW,GAAa,EAAa,CAC5gC,QAAQ,MAAM,CAAC,OAAQ,GAAG,GAAa,CAAC,EAAa,CACrD,EAAO,SAAS,OAAO,EAAY,KAAK,CAAC,OACtC,EAAa,EAAO,SAAS,OAAO,EAAY,CACnD,EAAO,QAAQ,OAAO,EAAE,QAAQ,MAAM,CAAC,EAAO,SAAS,OAAO,IAAI,MAAQ,CAAC,EAAO,S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