{"version":3,"file":"InstagramDMButton_1.D8WelXav.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/XZYrNMX3RmwxxPWDsClD/MfbvJtRcdnOvjvWGDdiV/InstagramDMButton_1.js"],"sourcesContent":["// DM on Instagram component with customizable message and username\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function InstagramDMButton(props){const{username,buttonText,backgroundColor,textColor,borderRadius,showIcon,iconOnly,size,font,responsive}=props;const[screenSize,setScreenSize]=useState(\"desktop\");useEffect(()=>{if(!responsive||typeof window===\"undefined\")return;const updateScreenSize=()=>{const width=window.innerWidth;if(width<768){setScreenSize(\"mobile\");}else if(width<1024){setScreenSize(\"tablet\");}else{setScreenSize(\"desktop\");}};updateScreenSize();window.addEventListener(\"resize\",updateScreenSize);return()=>window.removeEventListener(\"resize\",updateScreenSize);},[responsive]);const handleClick=()=>{if(typeof window!==\"undefined\"){const cleanUsername=username.replace(/[@]/g,\"\");const instagramUrl=`https://ig.me/m/${cleanUsername}`;window.open(instagramUrl,\"_blank\");}};// Size configurations\nconst sizeConfig={small:{padding:\"8px 16px\",iconSize:16,gap:\"6px\",fontSize:\"14px\"},medium:{padding:\"12px 20px\",iconSize:20,gap:\"8px\",fontSize:\"16px\"},large:{padding:\"16px 24px\",iconSize:24,gap:\"10px\",fontSize:\"18px\"},\"x-large\":{padding:\"20px 32px\",iconSize:28,gap:\"12px\",fontSize:\"20px\"}};// Responsive size mapping\nconst getResponsiveSize=()=>{if(!responsive)return size;const responsiveMapping={mobile:{small:\"small\",medium:\"small\",large:\"medium\",\"x-large\":\"medium\"},tablet:{small:\"small\",medium:\"medium\",large:\"medium\",\"x-large\":\"large\"},desktop:{small:\"small\",medium:\"medium\",large:\"large\",\"x-large\":\"x-large\"}};return responsiveMapping[screenSize][size];};const currentSize=sizeConfig[getResponsiveSize()];const isFixedWidth=props?.style&&props.style.width===\"100%\";return /*#__PURE__*/_jsxs(\"button\",{onClick:handleClick,style:{...props.style,...isFixedWidth?{...props?.style}:{minWidth:\"max-content\"},backgroundColor,color:textColor,borderRadius,border:\"none\",padding:iconOnly?`${parseInt(currentSize.padding.split(\" \")[0])}px`:currentSize.padding,cursor:\"pointer\",display:\"flex\",alignItems:\"center\",gap:showIcon&&!iconOnly?currentSize.gap:\"0px\",transition:\"all 0.2s ease\",boxShadow:\"0 2px 8px rgba(0,0,0,0.1)\",...font,fontSize:currentSize.fontSize},onMouseEnter:e=>{e.currentTarget.style.opacity=\"0.9\";},onMouseLeave:e=>{e.currentTarget.style.opacity=\"1\";},onMouseDown:e=>{e.currentTarget.style.transform=\"translateY(0px)\";},onMouseUp:e=>{e.currentTarget.style.transform=\"translateY(-1px)\";},children:[showIcon&&/*#__PURE__*/_jsx(\"svg\",{width:currentSize.iconSize,height:currentSize.iconSize,viewBox:\"0 0 24 24\",fill:\"currentColor\",style:{flexShrink:0},children:/*#__PURE__*/_jsx(\"path\",{d:\"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z\"})}),!iconOnly&&/*#__PURE__*/_jsx(\"span\",{children:buttonText})]});}addPropertyControls(InstagramDMButton,{buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"DM on Instagram\",hidden:({iconOnly})=>iconOnly},size:{type:ControlType.Enum,title:\"Size\",options:[\"small\",\"medium\",\"large\",\"x-large\"],optionTitles:[\"Small\",\"Medium\",\"Large\",\"X-Large\"],defaultValue:\"medium\",displaySegmentedControl:true},responsive:{type:ControlType.Boolean,title:\"Responsive\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},username:{type:ControlType.String,title:\"Instagram Username\",defaultValue:\"username\",placeholder:\"username\"},showIcon:{type:ControlType.Boolean,title:\"Show Instagram Icon\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\",hidden:({iconOnly})=>iconOnly},iconOnly:{type:ControlType.Boolean,title:\"Icon Only\",defaultValue:false,enabledTitle:\"Icon Only\",disabledTitle:\"Text + Icon\"},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#E4405F\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:32,unit:\"px\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},controls:\"basic\",defaultFontType:\"sans-serif\",hidden:({iconOnly})=>iconOnly}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"InstagramDMButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./InstagramDMButton_1.map"],"mappings":"sMAIG,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,WAAS,aAAW,kBAAgB,YAAU,eAAa,WAAS,WAAS,OAAK,OAAK,cAAY,EAAW,CAAC,EAAW,GAAeA,EAAS,UAAU,CAAC,MAAc,CAAC,GAAG,CAAC,GAAmB,IAAS,OAAY,OAAO,IAAM,MAAqB,CAAC,IAAM,EAAM,EAAO,WAAyB,EAAX,EAAM,IAAmB,SAAmB,EAAM,KAAoB,SAA8B,UAAU,EAA0E,OAAtE,GAAkB,CAAC,EAAO,iBAAiB,SAAS,EAAiB,KAAW,EAAO,oBAAoB,SAAS,EAAiB,EAAG,CAAC,EAAW,CAAC,CAAC,IAAM,MAAgB,CAAC,GAAU,IAAS,OAAY,CAAiD,IAAM,EAAa,mBAA/C,EAAS,QAAQ,OAAO,GAAG,GAAuD,EAAO,KAAK,EAAa,SAAS,GAE9b,EAD9U,CAAC,MAAM,CAAC,QAAQ,WAAW,SAAS,GAAG,IAAI,MAAM,SAAS,OAAO,CAAC,OAAO,CAAC,QAAQ,YAAY,SAAS,GAAG,IAAI,MAAM,SAAS,OAAO,CAAC,MAAM,CAAC,QAAQ,YAAY,SAAS,GAAG,IAAI,OAAO,SAAS,OAAO,CAAC,UAAU,CAAC,QAAQ,YAAY,SAAS,GAAG,IAAI,OAAO,SAAS,OAAO,CAAC,MAC/P,EAA+C,CAAC,OAAO,CAAC,MAAM,QAAQ,OAAO,QAAQ,MAAM,SAAS,UAAU,SAAS,CAAC,OAAO,CAAC,MAAM,QAAQ,OAAO,SAAS,MAAM,SAAS,UAAU,QAAQ,CAAC,QAAQ,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