1import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t,t as n}from"./compiler-runtime-5zjLlyPH.js";var r=n(),i=e(t(),1),a=0;async function o(e,t){let n=++a;if(t!==void 0&&typeof ClipboardItem<`u`)try{return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:`text/plain`}),"text/html":new Blob([t],{type:`text/html`})})]),n===a?`copied`:`superseded`}catch{if(n!==a)return`superseded`}if(!e)return`refused`;try{await navigator.clipboard.writeText(e)}catch(e){if(n!==a)return`superseded`;throw e}return n===a?`copied`:`superseded`}function s(e){let t=(0,r.c)(14),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{timeout:a}=n,s=a===void 0?1e3:a,[c,l]=(0,i.useState)(!1),[u,d]=(0,i.useState)(null),f=(0,i.useRef)(null),p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>{f.current&&=(clearTimeout(f.current),null),l(!1)},t[2]=p):p=t[2];let m=p,h;t[3]===s?h=t[4]:(h=async(e,t)=>{let n=t===void 0?{}:t;if(!(e||n.html))return m(),`refused`;try{let t=await o(e,n.html);return t===`superseded`?t:t===`refused`?(m(),t):(d(null),f.current&&clearTimeout(f.current),l(!0),f.current=setTimeout(()=>{l(!1),f.current=null},s),t)}catch(e){let t=e,n=t instanceof Error?t:Error(`Failed to copy to clipboard`);return d(n),m(),`refused`}},t[3]=s,t[4]=h);let g=h,_;t[5]===g?_=t[6]:(_=async(e,t)=>await g(e,t)===`copied`,t[5]=g,t[6]=_);let v=_,y,b;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>()=>{f.current&&clearTimeout(f.current)},b=[],t[7]=y,t[8]=b):(y=t[7],b=t[8]),(0,i.useEffect)(y,b);let x;return t[9]!==v||t[10]!==g||t[11]!==u||t[12]!==c?(x={isCopied:c,error:u,copy:v,copyOutcome:g},t[9]=v,t[10]=g,t[11]=u,t[12]=c,t[13]=x):x=t[13],x}export{s as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.