mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2025-04-05 19:42:07 +08:00
6 lines
2.3 KiB
JavaScript
6 lines
2.3 KiB
JavaScript
import{g as d}from"./call-bind-apply-helpers@1.0.1-BosuxZz1.js";var o={exports:{}};/*!
|
|
* screenfull
|
|
* v5.2.0 - 2021-11-03
|
|
* (c) Sindre Sorhus; MIT License
|
|
*/var h;function F(){return h||(h=1,function(i){(function(){var t=typeof window<"u"&&typeof window.document<"u"?window.document:{},f=i.exports,l=function(){for(var e,r=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,s=r.length,u={};n<s;n++)if(e=r[n],e&&e[1]in t){for(n=0;n<e.length;n++)u[r[0][n]]=e[n];return u}return!1}(),a={change:l.fullscreenchange,error:l.fullscreenerror},c={request:function(e,r){return new Promise((function(n,s){var u=(function(){this.off("change",u),n()}).bind(this);this.on("change",u),e=e||t.documentElement;var m=e[l.requestFullscreen](r);m instanceof Promise&&m.then(u).catch(s)}).bind(this))},exit:function(){return new Promise((function(e,r){if(!this.isFullscreen){e();return}var n=(function(){this.off("change",n),e()}).bind(this);this.on("change",n);var s=t[l.exitFullscreen]();s instanceof Promise&&s.then(n).catch(r)}).bind(this))},toggle:function(e,r){return this.isFullscreen?this.exit():this.request(e,r)},onchange:function(e){this.on("change",e)},onerror:function(e){this.on("error",e)},on:function(e,r){var n=a[e];n&&t.addEventListener(n,r,!1)},off:function(e,r){var n=a[e];n&&t.removeEventListener(n,r,!1)},raw:l};if(!l){f?i.exports={isEnabled:!1}:window.screenfull={isEnabled:!1};return}Object.defineProperties(c,{isFullscreen:{get:function(){return!!t[l.fullscreenElement]}},element:{enumerable:!0,get:function(){return t[l.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return!!t[l.fullscreenEnabled]}}}),f?i.exports=c:window.screenfull=c})()}(o)),o.exports}var b=F();const w=d(b);export{w as s};
|