{"version":3,"file":"Examples.Ccp4H--w.mjs","names":["useState","useRef","useCallback","_Fragment"],"sources":["https:/framerusercontent.com/modules/OCX748Li6EFShYuq9CXY/CGniPSCygAiUJzBkp5vx/Examples.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{forwardRef,startTransition,useCallback,useEffect,useRef,useState}from\"react\";// Learn more: https://www.framer.com/developers/overrides/\nexport function withRotate(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{rotate:90},transition:{duration:2}});});}export function withHover(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,whileHover:{scale:1.05}});});}export function withRandomColor(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[background,setBackground]=useState(\"#0099FF\");return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{background},onClick:()=>{const nextColor=`hsl(${Math.floor(Math.random()*360)} 100% 50%)`;setBackground(nextColor);}});});}export function withReferralCodeLock(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[search,setSearch]=useState(\"\");const inputElementRef=useRef(null);useEffect(()=>{if(typeof window!==\"undefined\"){startTransition(()=>{setSearch(window.location.search??\"\");});}else{startTransition(()=>{setSearch(\"\");});}},[]);const params=new URLSearchParams(search);const referralCode=(params.get(\"ref\")??\"\").trim();const hasReferralCode=referralCode.length>0;useEffect(()=>{const inputElement=inputElementRef.current;if(!inputElement)return;if(hasReferralCode){inputElement.value=referralCode;inputElement.disabled=false;inputElement.readOnly=true;inputElement.style.cursor=\"not-allowed\";inputElement.style.color=\"var(--token-f6601b97-d1df-44d3-9844-efd8e310b18b, rgba(23, 35, 31, 0.5))\";return;}inputElement.disabled=Boolean(props.disabled);inputElement.readOnly=Boolean(props.readOnly);inputElement.style.cursor=\"\";inputElement.style.color=\"\";});useEffect(()=>{if(typeof window===\"undefined\")return;const frame=window.requestAnimationFrame(()=>{const inputElement=inputElementRef.current;if(!inputElement)return;if(hasReferralCode){inputElement.value=referralCode;inputElement.disabled=false;inputElement.readOnly=true;inputElement.style.cursor=\"not-allowed\";inputElement.style.color=\"var(--token-f6601b97-d1df-44d3-9844-efd8e310b18b, rgba(23, 35, 31, 0.5))\";return;}inputElement.disabled=Boolean(props.disabled);inputElement.readOnly=Boolean(props.readOnly);inputElement.style.cursor=\"\";inputElement.style.color=\"\";});return()=>{window.cancelAnimationFrame(frame);};},[hasReferralCode,props.disabled,props.readOnly,referralCode]);return /*#__PURE__*/_jsx(Component,{ref:node=>{const resolvedInput=node instanceof HTMLInputElement?node:node?.querySelector?.(\"input\")??null;inputElementRef.current=resolvedInput;if(typeof ref===\"function\"){ref(node);}else if(ref){ref.current=node;}},...props,value:hasReferralCode?referralCode:props.value,...hasReferralCode?{}:{disabled:props.disabled},readOnly:hasReferralCode||props.readOnly,\"aria-label\":hasReferralCode?\"Referral code field prefilled from your link and locked for editing\":props[\"aria-label\"],placeholder:hasReferralCode?props.placeholder:\"Enter reference code\"});});}export function withCopyMarriageMessage(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const message=\"Assalamualaikum. I’ve been thinking about marriage, and I’d rather someone who knows me speak for me than put myself on an app. There’s a service called Safir that works this way — a person you trust introduces you. Would you be willing to be that person for me?\";const[showToast,setShowToast]=useState(false);const toastTimerRef=useRef(null);const copyWithFallback=useCallback(async()=>{if(typeof window===\"undefined\")return false;if(typeof navigator!==\"undefined\"&&navigator.clipboard&&typeof navigator.clipboard.writeText===\"function\"){try{await navigator.clipboard.writeText(message);return true;}catch(_error){// Fall back to legacy approach below.\n}}if(typeof document===\"undefined\")return false;const textarea=document.createElement(\"textarea\");textarea.value=message;textarea.setAttribute(\"readonly\",\"true\");textarea.setAttribute(\"aria-hidden\",\"true\");textarea.style.position=\"fixed\";textarea.style.opacity=\"0\";textarea.style.pointerEvents=\"none\";textarea.style.left=\"-9999px\";document.body.appendChild(textarea);textarea.focus();textarea.select();textarea.setSelectionRange(0,textarea.value.length);try{return document.execCommand(\"copy\");}catch(_error){// No-op: older/locked environments may block this.\nreturn false;}finally{document.body.removeChild(textarea);}},[message]);useEffect(()=>{return()=>{if(typeof window!==\"undefined\"&&toastTimerRef.current!==null){window.clearTimeout(toastTimerRef.current);}};},[]);const showSuccessToast=useCallback(()=>{if(typeof window===\"undefined\")return;if(toastTimerRef.current!==null){window.clearTimeout(toastTimerRef.current);}startTransition(()=>{setShowToast(true);});toastTimerRef.current=window.setTimeout(()=>{startTransition(()=>{setShowToast(false);});toastTimerRef.current=null;},3e3);},[]);const handleCopyInteraction=useCallback(async(event,originalHandler)=>{const copied=await copyWithFallback();if(copied){showSuccessToast();}if(typeof originalHandler===\"function\"){originalHandler(event);}},[copyWithFallback,showSuccessToast]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:event=>handleCopyInteraction(event,props.onClick),onTap:event=>handleCopyInteraction(event,props.onTap)}),showToast?/*#__PURE__*/_jsxs(\"div\",{role:\"status\",\"aria-live\":\"polite\",\"aria-atomic\":\"true\",style:{position:\"fixed\",right:16,bottom:16,zIndex:2147483647,display:\"flex\",alignItems:\"center\",gap:8,padding:\"10px 12px\",borderRadius:10,border:\"1px solid rgba(16, 185, 129, 0.35)\",background:\"rgba(15, 23, 42, 0.95)\",color:\"#FFFFFF\",boxShadow:\"0 10px 30px rgba(15, 23, 42, 0.24), 0 2px 8px rgba(15, 23, 42, 0.2)\",fontSize:13,lineHeight:1.2,fontWeight:500,pointerEvents:\"none\"},children:[/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{color:\"#22C55E\"},children:\"✓\"}),/*#__PURE__*/_jsx(\"span\",{children:\"Copied to clipboard\"})]}):null]});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withReferralCodeLock\":{\"type\":\"reactHoc\",\"name\":\"withReferralCodeLock\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCopyMarriageMessage\":{\"type\":\"reactHoc\",\"name\":\"withCopyMarriageMessage\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"mLACoqB,SAAgB,EAAqB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,EAAO,GAAWA,EAAS,EAAE,EAAQ,EAAgBC,EAAO,IAAI,EAAE,MAAc,CAAqG,EAA1F,IAAS,WAAqG,CAAC,EAAU,EAAE,CAAE,MAAnF,CAAC,EAAU,EAAO,SAAS,QAAQ,EAAE,CAAE,CAA6C,CAAG,EAAE,CAAC,CAAC,EAA2C,IAAM,GAAc,IAA5C,gBAAgB,CAAiC,CAAC,CAAC,IAAI,KAAK,GAAG,GAAA,CAAI,KAAK,EAAQ,EAAgB,EAAa,OAAO,EAAwpC,OAAtpC,MAAc,CAAC,IAAM,EAAa,EAAgB,QAAY,KAAoB,IAAG,EAAgB,CAAC,EAAa,MAAM,EAAa,EAAa,SAAS,GAAM,EAAa,SAAS,GAAK,EAAa,MAAM,OAAO,cAAc,EAAa,MAAM,MAAM,2EAA2E,MAAO,CAAC,EAAa,SAAS,EAAQ,EAAM,SAAU,EAAa,SAAS,EAAQ,EAAM,SAAU,EAAa,MAAM,OAAO,GAAG,EAAa,MAAM,MAAM,EAAnJ,CAAsJ,CAAC,EAAE,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,EAAM,EAAO,0BAA0B,CAAC,IAAM,EAAa,EAAgB,QAAY,KAAoB,IAAG,EAAgB,CAAC,EAAa,MAA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