import{c as e,l as t}from"./BA99CCI5.js";import"./xihTtKlq.js";import{t as n}from"./3rupxGJ5.js";var r=new Set([`$$slots`,`$$events`,`$$legacy`]);function i(i,a){let o=e(a,r),s=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]];n(i,t({name:`copy`},()=>o,{get iconNode(){return s}}))}async function a(e){if(typeof navigator<`u`&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}return o(e)}function o(e){if(typeof document>`u`||!document.body)return!1;let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.getSelection(),r=n?.rangeCount?n.getRangeAt(0):null,i=document.createElement(`textarea`);i.value=e,i.setAttribute(`readonly`,``),i.style.position=`fixed`,i.style.top=`0`,i.style.left=`0`,i.style.width=`1px`,i.style.height=`1px`,i.style.opacity=`0`,i.style.pointerEvents=`none`,document.body.appendChild(i),i.focus(),i.select(),i.setSelectionRange(0,i.value.length);let a=!1;try{a=document.execCommand(`copy`)}catch{a=!1}return document.body.removeChild(i),r&&n&&(n.removeAllRanges(),n.addRange(r)),t?.focus(),a}export{i as n,a as t};