{"version":3,"file":"PromoCode.DwRFbvAy.mjs","names":["React.useState","React.useRef","React.useEffect","_jsxs","_jsx","_Fragment","__esmMin","window","init_ssg_sandbox_shims","init_npm_react_18_3_1","_e","de","init_jsx_runtime","l","p","ce","navigator","addPropertyControls","init_framer_ChujFWHC","ControlType","copyText","text","area","ok","PromoCode","props","code","label","copyLabel","copiedLabel","trackingId","font","textColor","mutedColor","fill","brand","copied","setCopied","timer","onCopy","layer","css","init_PromoCode"],"sources":["https:/framerusercontent.com/modules/mTtVn1dl3EZo48YkBfFB/1hmVnniyGnVtFHKVFnPh/PromoCode.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Copy with the async clipboard API, falling back to a hidden textarea for older browsers\nasync function copyText(text){try{if(typeof navigator!==\"undefined\"&&navigator.clipboard?.writeText){await navigator.clipboard.writeText(text);return true;}}catch{}if(typeof document===\"undefined\")return false;const area=document.createElement(\"textarea\");area.value=text;area.setAttribute(\"readonly\",\"\");area.style.position=\"fixed\";area.style.opacity=\"0\";document.body.appendChild(area);area.select();let ok=false;try{ok=document.execCommand(\"copy\");}catch{}document.body.removeChild(area);return ok;}const css=`\n.pc-btn { transition: filter 0.18s, transform 0.18s cubic-bezier(0.2, 0, 0, 1); }\n.pc-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }\n.pc-btn:focus-visible { outline: 2px solid var(--pc-brand); outline-offset: 2px; }\n`;/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function PromoCode(props){const{code=\"BLACKFRIDAY30\",label=\"Use code\",copyLabel=\"Copy\",copiedLabel=\"Copied\",trackingId=\"promo-code\",font,textColor=\"#1B1E28\",mutedColor=\"#878895\",fill=\"#FFFFFF\",brand=\"#555DFF\"}=props;const[copied,setCopied]=React.useState(false);const timer=React.useRef(null);React.useEffect(()=>()=>{if(timer.current)window.clearTimeout(timer.current);},[]);const onCopy=async()=>{const layer=typeof window!==\"undefined\"?window.dataLayer:null;if(Array.isArray(layer))layer.push({event:\"promo_copy\",tracking_id:trackingId,promo_code:code});if(!await copyText(code))return;setCopied(true);if(timer.current)window.clearTimeout(timer.current);timer.current=window.setTimeout(()=>setCopied(false),1800);};return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style,display:\"inline-flex\",alignItems:\"center\",gap:12,padding:\"6px 6px 6px 16px\",borderRadius:14,background:fill,border:`1.5px dashed ${brand}`,fontFamily:font?.fontFamily,\"--pc-brand\":brand},children:[/*#__PURE__*/_jsx(\"style\",{children:css}),label?/*#__PURE__*/_jsx(\"span\",{style:{color:mutedColor,fontSize:14,lineHeight:1.2,whiteSpace:\"nowrap\",...font},children:label}):null,/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,fontSize:18,lineHeight:1.2,fontWeight:600,letterSpacing:\"0.06em\",whiteSpace:\"nowrap\",fontVariantNumeric:\"tabular-nums\"},children:code}),/*#__PURE__*/_jsxs(\"button\",{type:\"button\",className:\"pc-btn\",onClick:onCopy,\"aria-live\":\"polite\",\"aria-label\":`${copyLabel} ${code}`,style:{height:36,display:\"inline-flex\",alignItems:\"center\",gap:6,padding:\"0 14px\",border:0,borderRadius:10,background:brand,color:\"#FFFFFF\",fontFamily:\"inherit\",fontSize:14,fontWeight:600,lineHeight:1,cursor:\"pointer\",whiteSpace:\"nowrap\",boxShadow:\"inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 20px -6px rgba(85, 93, 255, 0.5)\"},children:[/*#__PURE__*/_jsx(\"svg\",{viewBox:\"0 0 16 16\",width:\"14\",height:\"14\",fill:\"none\",\"aria-hidden\":\"true\",children:copied?/*#__PURE__*/_jsx(\"path\",{d:\"M3 8.5l3 3 7-7\",stroke:\"currentColor\",strokeWidth:\"1.8\",strokeLinecap:\"round\",strokeLinejoin:\"round\"}):/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"rect\",{x:\"5.5\",y:\"5.5\",width:\"8\",height:\"8\",rx:\"2\",stroke:\"currentColor\",strokeWidth:\"1.5\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M10.5 3.5v-.5a1.5 1.5 0 0 0-1.5-1.5H4A1.5 1.5 0 0 0 2.5 3v5A1.5 1.5 0 0 0 4 9.5h.5\",stroke:\"currentColor\",strokeWidth:\"1.5\"})]})}),copied?copiedLabel:copyLabel]})]});}addPropertyControls(PromoCode,{code:{type:ControlType.String,title:\"Code\",defaultValue:\"BLACKFRIDAY30\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"Use code\"},copyLabel:{type:ControlType.String,title:\"Copy label\",defaultValue:\"Copy\"},copiedLabel:{type:ControlType.String,title:\"Copied label\",defaultValue:\"Copied\"},trackingId:{type:ControlType.String,title:\"Tracking ID\",defaultValue:\"promo-code\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#1B1E28\"},mutedColor:{type:ControlType.Color,title:\"Muted\",defaultValue:\"#878895\"},fill:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#FFFFFF\"},brand:{type:ControlType.Color,title:\"Brand\",defaultValue:\"#555DFF\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PromoCode\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PromoCode.map"],"mappings":"A,2NACA,eAAeoB,EAASC,EAAK,CAAC,GAAG,CAAC,GAAUL,IAAY,QAAaA,EAAU,WAAW,UAAqD,OAA1C,MAAMA,EAAU,UAAU,UAAUK,CAAI,EAAS,EAAM,MAAM,CAAC,CAAC,GAAG,OAAO,SAAW,IAAY,MAAO,GAAM,IAAMC,EAAK,SAAS,cAAc,UAA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