{"version":3,"file":"Linkdisplay.PVLXeb4O.mjs","names":[],"sources":["https:/framerusercontent.com/modules/XmIPeVSsL5eNnao4xJEU/YSH8vrKEaycMqQFngW3I/Linkdisplay.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerDisableUnlink\n */export default function Link_Display(props){const getStyle=()=>({color:props.fontColor,textDecoration:props.showUnderline?\"underline\":\"none\",cursor:props.isClickable?\"pointer\":\"default\",display:\"inline-flex\",alignItems:\"center\",gap:\"4px\",...props.font});const handleClick=e=>{if(!props.isClickable){e.preventDefault();}};const renderLink=()=>{try{const url=new URL(props.link);const hostname=url.hostname;let displayText=\"\";switch(props.displayStyle){case\"plain\":displayText=url.origin+(props.showPath&&url.pathname!==\"/\"?url.pathname:\"\");break;case\"urlOnly\":displayText=hostname;break;case\"urlNoWww\":displayText=hostname.replace(/^www\\./,\"\");break;case\"nameOnly\":const parts=hostname.replace(/^www\\./,\"\").split(\".\");displayText=parts[0];break;default:displayText=props.link;}if(props.showPath&&url.pathname!==\"/\"&&props.displayStyle!==\"plain\"){displayText+=url.pathname;}return displayText;}catch{return props.link;}};const ExternalIcon=()=>/*#__PURE__*/_jsx(\"svg\",{height:`${parseFloat(props.font.fontSize||\"16px\")*.8}px`,width:`${parseFloat(props.font.fontSize||\"16px\")*.8}px`,viewBox:\"0 0 24 24\",fill:\"none\",style:{minWidth:`${parseFloat(props.font.fontSize||\"16px\")*.8}px`,marginTop:\"1px\"},children:/*#__PURE__*/_jsx(\"path\",{d:\"M21 13v7a1 1 0 01-1 1H4a1 1 0 01-1-1V4a1 1 0 011-1h7m4 0h6m0 0v6m0-6L11 13\",stroke:props.fontColor,strokeWidth:\"2\",strokeLinecap:\"round\"})});return /*#__PURE__*/_jsxs(\"a\",{href:props.link,style:getStyle(),onClick:handleClick,target:props.newTab?\"_blank\":\"_self\",rel:props.newTab?\"noopener noreferrer\":\"\",children:[renderLink(),props.showExternalIcon&&/*#__PURE__*/_jsx(ExternalIcon,{})]});}Link_Display.defaultProps={link:\"https://www.example.com\",fontColor:\"#000000\",showUnderline:true,isClickable:true,displayStyle:\"plain\",newTab:false,showPath:false,showExternalIcon:false};addPropertyControls(Link_Display,{link:{type:ControlType.Link,title:\"Link\"},displayStyle:{type:ControlType.Enum,title:\"Display Style\",options:[\"plain\",\"urlOnly\",\"urlNoWww\",\"nameOnly\"],defaultValue:\"plain\"},font:{type:ControlType.Font,controls:\"extended\",title:\"Font\"},fontColor:{type:ControlType.Color,title:\"Color\"},showUnderline:{type:ControlType.Boolean,title:\"Show Underline\",defaultValue:true},showPath:{type:ControlType.Boolean,title:\"Show Path\",defaultValue:false},showExternalIcon:{type:ControlType.Boolean,title:\"Show External Icon\",defaultValue:false},isClickable:{type:ControlType.Boolean,title:\"Clickable\",defaultValue:true},newTab:{type:ControlType.Boolean,title:\"Open in New Tab\",defaultValue:false,description:\"v1.2 \\n[via SegmentUI](https://www.segmentUI.com)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Link_Display\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Linkdisplay.map"],"mappings":"wOAEG,SAAwB,EAAa,EAAM,CAAC,IAAM,EAAS,KAAK,CAAC,MAAM,EAAM,UAAU,eAAe,EAAM,cAAc,YAAY,OAAO,OAAO,EAAM,YAAY,UAAU,UAAU,QAAQ,cAAc,WAAW,SAAS,IAAI,MAAM,GAAG,EAAM,IAAK,GAAQ,EAAY,GAAG,CAAC,AAAI,EAAM,aAAa,EAAE,gBAAgB,AAAG,EAAO,EAAW,IAAI,CAAC,GAAG,CAAC,IAAM,EAAI,IAAI,IAAI,EAAM,MAAY,EAAS,EAAI,SAAa,EAAY,GAAG,OAAO,EAAM,aAAb,CAA2B,IAAI,QAAQ,EAAY,E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