import{r as registerInstance,h,H as Host}from"./index-966f70a5.js";var XCopy=function(){function t(t){registerInstance(this,t);this.content=undefined}t.prototype.copyContent=function(){if(!navigator.clipboard){this.fallbackCopyTextToClipboard();return}navigator.clipboard.writeText(this.content).then((function(){}),(function(t){console.warn(t)}))};t.prototype.fallbackCopyTextToClipboard=function(){var t=document.createElement("textarea");t.value=this.content;t.style.top="0";t.style.left="0";t.style.position="fixed";document.body.appendChild(t);t.focus();t.select();try{document.execCommand("copy")}catch(t){console.warn(t)}document.body.removeChild(t)};t.prototype.render=function(){return h(Host,{key:"cf335b97f84b055ebd5de911e880c85a440cba84",onClick:this.copyContent},h("slot",{key:"5e797834504f24557bdcce2bb1e1e00636e81a26"}))};return t}();export{XCopy as x_copy};