{"version":3,"file":"testimonial.js","mappings":";MAaA,MAAMA,EAAqBC,SAASC,eAAe,kBACnD,GAAIF,EAAoB,CACpB,MAAMG,EAAyBH,EAAmBI,aAAe,QAC3DC,EAASJ,SAASC,eAAe,cACnCG,GACAA,EAAOC,iBAAiB,SAASC,UAC7B,UAnBZA,eAAmCC,GAC/B,UACUC,UAAUC,UAAUC,UAAUH,EACxC,CAAE,MAAOI,GAEgB,iBAAVA,GAAgC,OAAVA,GAAkB,YAAaA,EAC5DC,QAAQD,MAAOA,EAA8BE,SAE7CD,QAAQD,MAAM,4BAEtB,CACJ,CASsBG,CAAoBZ,GAGzBE,EAAuBW,MAAMC,gBAAkB,QAChD,MAAMC,EAAsBb,EAAuBD,aAAgBC,EAAuBc,UACzFd,EAAuBD,YAAc,UAGtCgB,YAAW,KACNf,EAAuBW,MAAMC,gBAAkB,GAC/CZ,EAAuBD,YAAcc,CAAkB,GACzD,KACP,CAAE,MAAON,GACLC,QAAQD,MAAM,sBAAuBA,EACzC,IAIZ","sources":["webpack://doulamatch/./Scripts/testimonial-detail.ts"],"sourcesContent":["async function writeClipboardText2(text: string) {\r\n    try {\r\n        await navigator.clipboard.writeText(text);\r\n    } catch (error) {\r\n        // Check if error is an instance of Error, which means it should have a message property.\r\n        if (typeof error === 'object' && error !== null && 'message' in error) {\r\n            console.error((error as { message: string }).message);\r\n        } else {\r\n            console.error('An unknown error occurred');\r\n        }\r\n    }\r\n}\r\n// Select all elements with the class 'btn-testimonial'\r\nconst testimonialElement = document.getElementById(\"TestimonialURL\");\r\nif (testimonialElement) {\r\n    const testimonialUrl: string = testimonialElement.textContent || 'error';\r\n    const button = document.getElementById(\"CopyButton\");\r\n    if (button) {\r\n        button.addEventListener(\"click\", async () => {\r\n            try {\r\n                await writeClipboardText2(testimonialUrl);\r\n\r\n                // Change button background and label for a 5-second duration\r\n                (button as HTMLElement).style.backgroundColor = 'green';\r\n                const originalButtonText = (button as HTMLElement).textContent || (button as HTMLElement).innerText;\r\n                (button as HTMLElement).textContent = 'Copied!';\r\n\r\n                // Revert changes after 5 seconds\r\n                setTimeout(() => {\r\n                    (button as HTMLElement).style.backgroundColor = ''; // Reset to default or specify a color if needed\r\n                    (button as HTMLElement).textContent = originalButtonText;\r\n                }, 3500);\r\n            } catch (error) {\r\n                console.error('Error copying text:', error);\r\n            }\r\n        });\r\n\r\n    }\r\n}\r\n"],"names":["testimonialElement","document","getElementById","testimonialUrl","textContent","button","addEventListener","async","text","navigator","clipboard","writeText","error","console","message","writeClipboardText2","style","backgroundColor","originalButtonText","innerText","setTimeout"],"sourceRoot":""}