"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@vueuse/core"),n=require("vue"),s=new WeakMap,a=new Set;i.isClient&&document.addEventListener("fullscreenchange",()=>{if(a.forEach(e=>e.value=!1),document.fullscreenElement){const e=s.get(document.fullscreenElement);e&&(e.value=!0)}});const m=(e=n.ref(null))=>{const f=n.computed({get:()=>n.unref(e),set:t=>{n.isRef(e)&&(e.value=t)}}),l=n.ref(!1);a.add(l),n.watch(()=>e.value,(t,u)=>{t&&s.set(t,l),u&&s.delete(u)},{immediate:!0,flush:"post"});async function c(t=!1){await r();const u=n.unref(e);return u&&(t||!document.fullscreenElement)?(await u.requestFullscreen(),l.value=!0,!0):!1}async function r(t=!1){const u=n.unref(e);return t||u&&document.fullscreenElement===u?(await document.exitFullscreen(),l.value=!1,!0):!1}async function o(t=!1){return await(n.unref(l)?r(t):c(t))}return{target:f,full:n.computed(()=>n.unref(l)),enter:c,exit:r,toggle:o}};exports.useFullScreen=m;
