import{$n as e,Bt as t,J as n,Nt as r,Xn as i,Yn as a,bn as o,bt as s,ht as c,ir as l,or as u,tr as d,xn as f}from"./dist-CoD0k1Bd.js";import{a as p,c as m,d as h,f as g,i as _,l as v,n as y,o as b,r as x,t as S,u as C}from"./shared-C4LIOFnZ.js";var w=x?window:void 0,T=x?window.document:void 0,E=x?window.navigator:void 0;x&&window.location;function D(e){let t=l(e);return t?.$el??t}function O(...e){let t=[],r=()=>{t.forEach(e=>e()),t.length=0},i=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),a=n(()=>{let t=m(l(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0}),o=g(()=>[a.value?.map(e=>D(e))??[w].filter(e=>e!=null),m(l(a.value?e[1]:e[0])),m(u(a.value?e[2]:e[1])),l(a.value?e[3]:e[2])],([e,n,a,o])=>{if(r(),!e?.length||!n?.length||!a?.length)return;let s=p(o)?{...o}:o;t.push(...e.flatMap(e=>n.flatMap(t=>a.map(n=>i(e,t,n,s)))))},{flush:`post`});return C(r),()=>{o(),r()}}function k(){let n=e(!1),r=c();return r&&t(()=>{n.value=!0},r),n}function A(e){let t=k();return n(()=>(t.value,!!e()))}var j=Symbol(`vueuse-ssr-width`);function M(){let e=s()?y(j,null):null;return typeof e==`number`?e:void 0}function N(t,r={}){let{window:i=w,ssrWidth:a=M()}=r,o=A(()=>i&&`matchMedia`in i&&typeof i.matchMedia==`function`),s=e(typeof a==`number`),c=e(),u=e(!1);return f(()=>{if(s.value){s.value=!o.value;let e=l(t).split(`,`);u.value=e.some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),r=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),i=!!(n||r);return n&&i&&(i=a>=b(n[1])),r&&i&&(i=a<=b(r[1])),t?!i:i});return}o.value&&(c.value=i.matchMedia(l(t)),u.value=c.value.matches)}),O(c,`change`,e=>{u.value=e.matches},{passive:!0}),n(()=>u.value)}function P(t,n={}){let{controls:r=!1,navigator:i=E}=n,a=A(()=>i&&`permissions`in i),o=e(),s=typeof t==`string`?{name:t}:t,c=e(),l=()=>{c.value=o.value?.state??`prompt`};O(o,`change`,l,{passive:!0});let u=S(async()=>{if(a.value){if(!o.value)try{o.value=await i.permissions.query(s)}catch{o.value=void 0}finally{l()}if(r)return d(o.value)}});return u(),r?{state:c,isSupported:a,query:u}:c}function F(t={}){let{navigator:r=E,read:i=!1,source:a,copiedDuring:o=1500,legacy:s=!1}=t,c=A(()=>r&&`clipboard`in r),u=P(`clipboard-read`),d=P(`clipboard-write`),f=n(()=>c.value||s),p=e(``),m=e(!1),g=h(()=>m.value=!1,o,{immediate:!1});async function _(){let e=!(c.value&&x(u.value));if(!e)try{p.value=await r.clipboard.readText()}catch{e=!0}e&&(p.value=b())}f.value&&i&&O([`copy`,`cut`],_,{passive:!0});async function v(e=l(a)){if(f.value&&e!=null){let t=!(c.value&&x(d.value));if(!t)try{await r.clipboard.writeText(e)}catch{t=!0}t&&y(e),p.value=e,m.value=!0,g.start()}}function y(e){let t=document.createElement(`textarea`);t.value=e??``,t.style.position=`absolute`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),t.remove()}function b(){return((document==null?void 0:document.getSelection)?.call(document))?.toString()??``}function x(e){return e===`granted`||e===`prompt`}return{isSupported:f,text:p,copied:m,copy:v}}function I(e){return JSON.parse(JSON.stringify(e))}function L(t,n){let r=e(n);return o(v(t),(e,t)=>{r.value=t},{flush:`sync`}),a(r)}function R(e,t,a,s={}){let{clone:l=!1,passive:u=!1,eventName:d,deep:f=!1,defaultValue:p,shouldEmit:m}=s,h=c(),g=a||h?.emit||(h?.$emit)?.bind(h)||(h?.proxy?.$emit)?.bind(h?.proxy),v=d;t||=`modelValue`,v||=`update:${t.toString()}`;let y=e=>l?typeof l==`function`?l(e):I(e):e,b=()=>_(e[t])?y(e[t]):p,x=e=>{m?m(e)&&g(v,e):g(v,e)};if(u){let n=b(),a=i(n),s=!1;return o(()=>e[t],e=>{s||(s=!0,a.value=y(e),r(()=>s=!1))}),o(a,n=>{!s&&(n!==e[t]||f)&&x(n)},{deep:f}),a}return n({get(){return b()},set(e){x(e)}})}export{N as a,O as i,w as n,L as o,F as r,R as s,T as t};