native-fn 1.0.59 → 1.0.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/native.cjs +1 -1
  2. package/dist/native.min.cjs +1 -1
  3. package/dist/native.min.mjs +1 -1
  4. package/dist/native.mjs +1 -1
  5. package/dist/native.umd.js +1 -1
  6. package/dist/native.umd.min.js +1 -1
  7. package/dist/plugin/app/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
  8. package/dist/plugin/app/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
  9. package/dist/plugin/camera/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
  10. package/dist/plugin/camera/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
  11. package/dist/plugin/clipboard/index.cjs +4 -1
  12. package/dist/plugin/clipboard/index.min.cjs +1 -1
  13. package/dist/plugin/clipboard/index.min.mjs +1 -1
  14. package/dist/plugin/clipboard/index.mjs +4 -1
  15. package/dist/plugin/clipboard/index.umd.js +4 -1
  16. package/dist/plugin/clipboard/index.umd.min.js +1 -1
  17. package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
  18. package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
  19. package/dist/plugin/fullscreen/index.cjs +37 -16
  20. package/dist/plugin/fullscreen/index.d.ts +13 -3
  21. package/dist/plugin/fullscreen/index.min.cjs +1 -1
  22. package/dist/plugin/fullscreen/index.min.mjs +1 -1
  23. package/dist/plugin/fullscreen/index.mjs +37 -16
  24. package/dist/plugin/fullscreen/index.umd.js +37 -16
  25. package/dist/plugin/fullscreen/index.umd.min.js +1 -1
  26. package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
  27. package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
  28. package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
  29. package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
  30. package/dist/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
  31. package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
  32. package/package.json +1 -1
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).Clipboard=n()}(this,(function(){"use strict";function e(e,n){if(void 0===n&&(n=!0),void 0!==globalThis.document){var r=globalThis.document.createElement(e);return"width"in r&&(r.width="0"),"height"in r&&(r.height="0"),"border"in r&&(r.border="0"),"frameBorder"in r&&(r.frameBorder="0"),"scrolling"in r&&(r.scrolling="no"),"cellPadding"in r&&(r.cellPadding="0"),"cellSpacing"in r&&(r.cellSpacing="0"),"frame"in r&&(r.frame="void"),"rules"in r&&(r.rules="none"),"noWrap"in r&&(r.noWrap=!0),r.tabIndex=-1,r.setAttribute("role","presentation"),n?(r.style.width="1px",r.style.height="1px"):(r.setAttribute("aria-hidden","true"),r.style.width="0",r.style.height="0",r.style.zIndex="-9999",r.style.display="none",r.style.visibility="hidden",r.style.pointerEvents="none"),r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.padding="0",r.style.margin="0",r.style.border="none",r.style.outline="none",r.style.clip="rect(1px, 1px, 1px, 1px)",r.style.clipPath="inset(50%)",r.style.overflow="hidden",r.style.whiteSpace="nowrap",r}}function n(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];for(var t="",o=0;o<n.length-2;o++){var i=n[o];void 0!==i&&(t=t+i.charAt(0).toUpperCase()+i.slice(1))}return t}function r(){this.returnValue=!1}function t(){this.cancelBubble=!0}var o,i,a,s,l=/(animation)(start|iteration|end|cancel)|(transition)(start|run|end|cancel)|(fullscreen)(change|error)|(lost|got)(pointer)(capture)|(pointer)(lock)(change|error)|(pointer)(cancel|down|enter|leave|move|out|over|up)/i,c=["","webkit","moz","ms","MS","o","O"],u={wheel:["wheel","mousewheel","DOMMouseScroll"],focus:["focus","focusin"],blur:["blur","focusout"],beforeinput:["beforeinput","textInput"]},d={useStd:void 0!==globalThis.document&&"function"==typeof globalThis.document.addEventListener,add:function(e,n){void 0===n&&(n={callback:null,options:!1});var o=n.callback;if(void 0!==e&&null!==o){var i=d.withVender(e,n.type),a=n.options;if("function"==typeof e.addEventListener)try{return e.addEventListener(i,o,a)}catch(e){}if("function"==typeof e.addListener)if("boolean"==typeof e.matches)try{return e.addListener(o)}catch(e){}else try{return e.addListener(i,o)}catch(e){}return"function"==typeof e.attachEvent?o.__ieWrapper?e.attachEvent("on"+i,o.__ieWrapper):e.attachEvent("on"+i,o.__ieWrapper=function(n){void 0===n&&(n=globalThis.event),void 0!==n&&(n.currentTarget=e,"function"!=typeof n.preventDefault&&(n.preventDefault=r),"function"!=typeof n.stopPropagation&&(n.stopPropagation=t),"function"==typeof o?o.call(e,n):o&&"function"==typeof o.handleEvent&&o.handleEvent.call(e,n))}):void 0}},remove:function(e,n){void 0===n&&(n={callback:null,options:!1});var r=n.callback;if(void 0!==e&&null!==r){var t=d.withVender(e,n.type),o=n.options;if("function"==typeof e.removeEventListener)try{return e.removeEventListener(t,r,o)}catch(e){}if("function"==typeof e.removeListener)if("boolean"==typeof e.matches)try{return e.removeListener(r)}catch(e){}else try{return e.removeListener(t,r)}catch(e){}if("function"!=typeof e.detachEvent);else{var i=r.__ieWrapper;void 0!==i&&(e.detachEvent("on"+t,i),delete r.__ieWrapper)}}},withVender:function(e,r){if(void 0===r)return"";if("webkitEnterFullscreen"in e&&["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"].indexOf(r)>-1)return r;var t;t=r in u?u[r]:l.test(r)?[r,r.replace(l,n)]:[r];for(var o=0;o<c.length;o++)for(var i=0;i<t.length;i++){var a=c[o]+t[i];if(void 0!==e["on"+a])return a}return""}};!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(o||(o={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(i||(i={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(a||(a={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(s||(s={}));var f="undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",m={device:i.Unknown,os:o.Unknown,osVersion:"",engine:a.Unknown,engineVersion:"",browser:s.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var r=n.getExtension("WEBGL_debug_renderer_info");return null===r?n.getParameter(n.RENDERER):n.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:f,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(f),isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isElectron:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(f),isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},p=[[/windows nt (6\.[23]); arm/i,o.Windows,h],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,o.Windows,h],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,o.Windows,h],[/windows nt ?([\d.)]*)(?!.+xbox)/i,o.Windows,h],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,o.Windows,h],[/windows ce\/?([\d.]*)/i,o.Windows,h],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,o.iOS,g],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,o.iOS,g],[/cfnetwork\/.+darwin/i,o.iOS,g],[/mac os x ?([\w. ]*)/i,o.MacOS,g],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,o.MacOS,g],[/droid ([\w.]+)\b.+(android[- ]x86)/i,o.Android],[/android\w*[-\/.; ]?([\d.]*)/i,o.Android]],b=[[/windows.+ edge\/([\w.]+)/i,a.EdgeHTML],[/arkweb\/([\w.]+)/i,a.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,a.Blink],[/presto\/([\w.]+)/i,a.Presto],[/webkit\/([\w.]+)/i,a.WebKit],[/trident\/([\w.]+)/i,a.Trident],[/netfront\/([\w.]+)/i,a.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,a.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,a.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,a.Gecko]],v=[[/\b(?:crmo|crios)\/([\w.]+)/i,s.Chrome],[/webview.+edge\/([\w.]+)/i,s.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,s.Edge],[/opera mini\/([-\w.]+)/i,s.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,s.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,s.Opera],[/opios[\/ ]+([\w.]+)/i,s.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,s.Opera],[/\bopr\/([\w.]+)/i,s.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,s.IE],[/(?:ms|\()ie ([\w.]+)/i,s.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,s.IE],[/\bfocus\/([\w.]+)/i,s.Firefox],[/\bopt\/([\w.]+)/i,s.Opera],[/coast\/([\w.]+)/i,s.Opera],[/fxios\/([\w.-]+)/i,s.Firefox],[/samsungbrowser\/([\w.]+)/i,s.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,s.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,s.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,s.Chrome],[/chrome\/([\w.]+) mobile/i,s.Chrome],[/chrome\/v?([\w.]+)/i,s.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,s.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,s.Safari],[/version\/([\w.,]+) .*safari/i,s.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,s.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,s.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,s.Firefox],[/firefox\/([\w.]+)/i,s.Firefox]];function h(e){if(void 0===e)return"";var n={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==n?n:e}function g(e){return void 0===e?"":e.replace(/_/g,".")}function w(e,n){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":n}function y(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function T(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var x=0;x<p.length;x++){var j=(D=p[x])[0],k=D[1],E=D[2];if(null!==(M=m.userAgent.match(j))){m.os=k,m.osVersion=y(M[1],E);break}}m.os===o.iOS&&0===function(e,n){for(var r=e.split("."),t=n.split("."),o=Math.max(r.length,t.length),i=0;i<o;i++){var a=void 0,s=void 0;if((a=i<r.length?parseInt(r[i],10):0)>(s=i<t.length?parseInt(t[i],10):0))return 1;if(a<s)return-1}return 0}(m.osVersion,"18.6")&&(null!==(O=/\) Version\/([\d.]+)/.exec(m.userAgent))&&parseInt(O[1].substring(0,2),10)>=26&&(m.osVersion=O[1]));for(x=0;x<b.length;x++){j=(D=b[x])[0];var S=D[1];E=D[2];if(null!==(M=m.userAgent.match(j))){m.engine=S,m.engineVersion=y(M[1],E);break}}for(x=0;x<v.length;x++){j=(D=v[x])[0];var D,M,V=D[1];E=D[2];if(null!==(M=m.userAgent.match(j))){m.browser=V,m.browserVersion=y(M[1],E);break}}if(m.isReactNative)try{k=(A=require("react-native").Platform).OS;var O=T(P=""+A.Version);switch(k){case"android":m.os=o.Android,m.osVersion=function(e,n){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major?"4.4W":19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":n}(O,P);break;case"ios":m.os=o.iOS,m.osVersion=P;break;case"windows":m.os=o.Windows,m.osVersion=w(O,P);break;case"macos":m.os=o.MacOS,m.osVersion=P}}catch(e){}if(m.isNodeJS)try{var P,A=(k=require("os")).platform();O=T(P=k.release());switch(A){case"win32":m.os=o.Windows,m.osVersion=w(O,P);break;case"darwin":m.os=o.MacOS,m.osVersion=function(e,n){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:n}(O,P);break;case"android":m.os=o.Android,m.osVersion=P;break;case"linux":/android/i.test(P)&&(m.os=o.Android,m.osVersion=P)}}catch(e){}function C(e){return null!==e&&"object"==typeof e}function W(e){return C(e)||function(e){return Array.isArray(e)}(e)}function L(e){if(function(e){return C(e)&&"innerHTML"in e}(e))return e.innerHTML;if(W(e))try{return JSON.stringify(e)}catch(n){return""+e}else if("string"!=typeof e)return""+e;return e}function N(){return function(){if("isSecureContext"in window)return globalThis.isSecureContext;var e=location.protocol,n=location.hostname;return"https:"===e||"localhost"===n||"127.0.0.1"===n||"[::1]"===n}()&&"undefined"!=typeof navigator&&"clipboard"in navigator}function I(n){return function(n){if(!globalThis.getSelection||!globalThis.document.createRange)return!1;var r=e("div");if(void 0===r)return!1;r.contentEditable="true",r.innerHTML=n,r.style.whiteSpace="pre",r.style.userSelect="text",r.style.setProperty("-webkit-user-select","text"),r.style.setProperty("-moz-user-select","text"),r.style.setProperty("-ms-user-select","text"),globalThis.document.body.appendChild(r);var t=globalThis.getSelection(),o=globalThis.document.createRange(),i=function(e){try{null!==e.clipboardData&&"function"==typeof e.clipboardData.setData&&(e.preventDefault(),e.clipboardData.setData("text/html",n),e.clipboardData.setData("text/plain",n))}catch(e){}};d.add(globalThis.document,{type:"copy",callback:i,options:{once:!0,capture:!0}});try{if(null===t)return _(r,t,i),!1;t.removeAllRanges(),o.selectNodeContents(r),t.addRange(o);var a=globalThis.document.execCommand("copy");return _(r,t,i),a}catch(e){return _(r,t,i),!1}}(n)||function(e){var n=window.clipboardData;if(void 0!==n&&"function"==typeof n.setData)try{return n.setData("Text",e)}catch(e){return!1}return!1}(n)}function R(){return function(){var n=e("div");if(void 0===n)return null;n.contentEditable="true",globalThis.document.body.appendChild(n),n.focus();var r=null,t=function(e){try{null!==e.clipboardData&&"function"==typeof e.clipboardData.getData&&(e.preventDefault(),r=e.clipboardData.getData("text/html")||e.clipboardData.getData("text/plain")||null)}catch(e){}};d.add(globalThis.document,{type:"paste",callback:t,options:{once:!0,capture:!0}});try{return globalThis.document.execCommand("paste")||r||(r=n.innerHTML||n.textContent||null),U(n,t),r}catch(e){return U(n,t),null}}()||function(){var e=window.clipboardData;if(void 0!==e&&"function"==typeof e.getData)try{return e.getData("Text")||null}catch(e){return null}return null}()||""}function _(e,n,r){null!==n&&n.removeAllRanges(),globalThis.document.body.removeChild(e),d.remove(globalThis.document,{type:"copy",callback:r})}function U(e,n){globalThis.document.body.removeChild(e),d.remove(globalThis.document,{type:"paste",callback:n})}void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(e){for(var n,r=e.fullVersionList||e.brands||[],t=e.platformVersion,i=0;i<r.length;i++){var a=null==(n=r[i])?{brand:"",version:""}:"string"==typeof n?{brand:n,version:""}:{brand:n.brand,version:n.version},s=a.brand,l=a.version;/not.a.brand/i.test(s)||"Chromium"===s&&(m.engineVersion=l)}"string"==typeof t&&(m.os===o.Windows&&parseInt(t.replace(/[^\d.]/g,"").split(".")[0],10)>=13?m.osVersion="11":m.osVersion=t)})),m.device=m.os===o.iOS||m.os===o.Android?i.Mobile:m.os===o.Windows||m.os===o.MacOS?i.Desktop:i.Unknown,m.isMobile=m.device===i.Mobile,m.isDesktop=m.device===i.Desktop,m.isStandalone=function(e){return"matchMedia"in globalThis&&(e===o.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(m.os);var H={copy:function(e){var n=L(e);return m.isElectron?function(e){try{var n=require("electron");return new Promise((function(r){try{n.clipboard.writeText(e),n.clipboard.writeHTML(e),r(!0)}catch(e){r(!1)}}))}catch(e){return Promise.resolve(!1)}}(n):N()&&("write"in navigator.clipboard||"writeText"in navigator.clipboard)?function(e){try{if("ClipboardItem"in window&&"write"in navigator.clipboard)return navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([e],{type:"text/html"}),"text/plain":new Blob([e],{type:"text/plain"})})]).then((function(){return!0})).catch((function(){return!1}));if("writeText"in navigator.clipboard)return navigator.clipboard.writeText(e).then((function(){return!0})).catch((function(){return!1}))}catch(e){return Promise.resolve(!1)}return Promise.resolve(!1)}(n).then((function(e){return!!e||I(n)})).catch((function(){return I(n)})):Promise.resolve(I(n))},paste:function(){return m.isElectron?function(){try{var e=require("electron");return new Promise((function(n){try{n(e.clipboard.readHTML()||e.clipboard.readText())}catch(e){n("")}}))}catch(e){return Promise.resolve("")}}():N()&&("read"in navigator.clipboard||"readText"in navigator.clipboard)?function(){try{if("ClipboardItem"in window&&"read"in navigator.clipboard)return navigator.clipboard.read().then((function(e){if(0===e.length)return Promise.resolve(null);for(var n=e[0],r=n.types,t=0;t<r.length;t++)if("text/html"===r[t])return n.getType("text/html").then((function(e){return e.text()})).catch((function(){return null}));for(t=0;t<r.length;t++)if("text/plain"===r[t])return n.getType("text/plain").then((function(e){return e.text()})).catch((function(){return null}));return Promise.resolve(null)})).catch((function(){return null}));if("readText"in navigator.clipboard)return navigator.clipboard.readText().then((function(e){return e})).catch((function(){return null}))}catch(e){return Promise.resolve(null)}return Promise.resolve(null)}().then((function(e){return null!==e?e:R()})).catch((function(){return R()})):Promise.resolve(R())}};return{installed:!1,name:"Clipboard",module:H,Constants:{},Errors:{}}}));
1
+ !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(e="undefined"!=typeof globalThis?globalThis:e||self).Clipboard=r()}(this,(function(){"use strict";function e(e,r){if(void 0===r&&(r=!0),void 0!==globalThis.document){var n=globalThis.document.createElement(e);return"width"in n&&(n.width="0"),"height"in n&&(n.height="0"),"border"in n&&(n.border="0"),"frameBorder"in n&&(n.frameBorder="0"),"scrolling"in n&&(n.scrolling="no"),"cellPadding"in n&&(n.cellPadding="0"),"cellSpacing"in n&&(n.cellSpacing="0"),"frame"in n&&(n.frame="void"),"rules"in n&&(n.rules="none"),"noWrap"in n&&(n.noWrap=!0),n.tabIndex=-1,n.setAttribute("role","presentation"),r?(n.style.width="1px",n.style.height="1px"):(n.setAttribute("aria-hidden","true"),n.style.width="0",n.style.height="0",n.style.zIndex="-9999",n.style.display="none",n.style.visibility="hidden",n.style.pointerEvents="none"),n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.padding="0",n.style.margin="0",n.style.border="none",n.style.outline="none",n.style.clip="rect(1px, 1px, 1px, 1px)",n.style.clipPath="inset(50%)",n.style.overflow="hidden",n.style.whiteSpace="nowrap",n}}function r(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];for(var t="",o=0;o<r.length-2;o++){var i=r[o];void 0!==i&&(t=t+i.charAt(0).toUpperCase()+i.slice(1))}return t}function n(){this.returnValue=!1}function t(){this.cancelBubble=!0}var o,i,a,s,l=/(animation)(start|iteration|end|cancel)|(transition)(start|run|end|cancel)|(fullscreen)(change|error)|(lost|got)(pointer)(capture)|(pointer)(lock)(change|error)|(pointer)(cancel|down|enter|leave|move|out|over|up)/i,c=["","webkit","moz","ms","MS","o","O"],u={wheel:["wheel","mousewheel","DOMMouseScroll"],focus:["focus","focusin"],blur:["blur","focusout"],beforeinput:["beforeinput","textInput"]},d={useStd:void 0!==globalThis.document&&"function"==typeof globalThis.document.addEventListener,add:function(e,r){void 0===r&&(r={callback:null,options:!1});var o=r.callback;if(void 0!==e&&null!==o){var i=d.withVender(e,r.type),a=r.options;if("function"==typeof e.addEventListener)try{return e.addEventListener(i,o,a)}catch(e){}if("function"==typeof e.addListener)if("boolean"==typeof e.matches)try{return e.addListener(o)}catch(e){}else try{return e.addListener(i,o)}catch(e){}return"function"==typeof e.attachEvent?o.__ieWrapper?e.attachEvent("on"+i,o.__ieWrapper):e.attachEvent("on"+i,o.__ieWrapper=function(r){void 0===r&&(r=globalThis.event),void 0!==r&&(r.currentTarget=e,"function"!=typeof r.preventDefault&&(r.preventDefault=n),"function"!=typeof r.stopPropagation&&(r.stopPropagation=t),"function"==typeof o?o.call(e,r):o&&"function"==typeof o.handleEvent&&o.handleEvent.call(e,r))}):void 0}},remove:function(e,r){void 0===r&&(r={callback:null,options:!1});var n=r.callback;if(void 0!==e&&null!==n){var t=d.withVender(e,r.type),o=r.options;if("function"==typeof e.removeEventListener)try{return e.removeEventListener(t,n,o)}catch(e){}if("function"==typeof e.removeListener)if("boolean"==typeof e.matches)try{return e.removeListener(n)}catch(e){}else try{return e.removeListener(t,n)}catch(e){}if("function"!=typeof e.detachEvent);else{var i=n.__ieWrapper;void 0!==i&&(e.detachEvent("on"+t,i),delete n.__ieWrapper)}}},withVender:function(e,n){if(void 0===n)return"";if("webkitEnterFullscreen"in e&&["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"].indexOf(n)>-1)return n;var t;t=n in u?u[n]:l.test(n)?[n,n.replace(l,r)]:[n];for(var o=0;o<c.length;o++)for(var i=0;i<t.length;i++){var a=c[o]+t[i];if(void 0!==e["on"+a])return a}return""}};!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(o||(o={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(i||(i={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(a||(a={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(s||(s={}));var f="undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",m={device:i.Unknown,os:o.Unknown,osVersion:"",engine:a.Unknown,engineVersion:"",browser:s.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var r=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===r)return"";if(r instanceof WebGLRenderingContext||"getParameter"in r&&"function"==typeof r.getParameter){var n=r.getExtension("WEBGL_debug_renderer_info");return null===n?r.getParameter(r.RENDERER):r.getParameter(n.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:f,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(f),isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isElectron:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(f),isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},p=[[/windows nt (6\.[23]); arm/i,o.Windows,h],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,o.Windows,h],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,o.Windows,h],[/windows nt ?([\d.)]*)(?!.+xbox)/i,o.Windows,h],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,o.Windows,h],[/windows ce\/?([\d.]*)/i,o.Windows,h],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,o.iOS,g],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,o.iOS,g],[/cfnetwork\/.+darwin/i,o.iOS,g],[/mac os x ?([\w. ]*)/i,o.MacOS,g],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,o.MacOS,g],[/droid ([\w.]+)\b.+(android[- ]x86)/i,o.Android],[/android\w*[-\/.; ]?([\d.]*)/i,o.Android]],b=[[/windows.+ edge\/([\w.]+)/i,a.EdgeHTML],[/arkweb\/([\w.]+)/i,a.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,a.Blink],[/presto\/([\w.]+)/i,a.Presto],[/webkit\/([\w.]+)/i,a.WebKit],[/trident\/([\w.]+)/i,a.Trident],[/netfront\/([\w.]+)/i,a.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,a.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,a.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,a.Gecko]],v=[[/\b(?:crmo|crios)\/([\w.]+)/i,s.Chrome],[/webview.+edge\/([\w.]+)/i,s.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,s.Edge],[/opera mini\/([-\w.]+)/i,s.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,s.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,s.Opera],[/opios[\/ ]+([\w.]+)/i,s.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,s.Opera],[/\bopr\/([\w.]+)/i,s.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,s.IE],[/(?:ms|\()ie ([\w.]+)/i,s.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,s.IE],[/\bfocus\/([\w.]+)/i,s.Firefox],[/\bopt\/([\w.]+)/i,s.Opera],[/coast\/([\w.]+)/i,s.Opera],[/fxios\/([\w.-]+)/i,s.Firefox],[/samsungbrowser\/([\w.]+)/i,s.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,s.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,s.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,s.Chrome],[/chrome\/([\w.]+) mobile/i,s.Chrome],[/chrome\/v?([\w.]+)/i,s.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,s.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,s.Safari],[/version\/([\w.,]+) .*safari/i,s.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,s.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,s.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,s.Firefox],[/firefox\/([\w.]+)/i,s.Firefox]];function h(e){if(void 0===e)return"";var r={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==r?r:e}function g(e){return void 0===e?"":e.replace(/_/g,".")}function w(e,r){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":r}function y(e,r){return"function"==typeof r?r(e):"string"==typeof r?r:void 0===e?"":e}function T(e){var r=e.split(".");return{major:parseInt(r[0]||"0"),minor:parseInt(r[1]||"0"),build:parseInt(r[2]||"0")}}for(var x=0;x<p.length;x++){var j=(D=p[x])[0],k=D[1],E=D[2];if(null!==(M=m.userAgent.match(j))){m.os=k,m.osVersion=y(M[1],E);break}}m.os===o.iOS&&0===function(e,r){for(var n=e.split("."),t=r.split("."),o=Math.max(n.length,t.length),i=0;i<o;i++){var a=void 0,s=void 0;if((a=i<n.length?parseInt(n[i],10):0)>(s=i<t.length?parseInt(t[i],10):0))return 1;if(a<s)return-1}return 0}(m.osVersion,"18.6")&&(null!==(O=/\) Version\/([\d.]+)/.exec(m.userAgent))&&parseInt(O[1].substring(0,2),10)>=26&&(m.osVersion=O[1]));for(x=0;x<b.length;x++){j=(D=b[x])[0];var S=D[1];E=D[2];if(null!==(M=m.userAgent.match(j))){m.engine=S,m.engineVersion=y(M[1],E);break}}for(x=0;x<v.length;x++){j=(D=v[x])[0];var D,M,V=D[1];E=D[2];if(null!==(M=m.userAgent.match(j))){m.browser=V,m.browserVersion=y(M[1],E);break}}if(m.isReactNative)try{k=(A=require("react-native").Platform).OS;var O=T(P=""+A.Version);switch(k){case"android":m.os=o.Android,m.osVersion=function(e,r){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major?"4.4W":19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":r}(O,P);break;case"ios":m.os=o.iOS,m.osVersion=P;break;case"windows":m.os=o.Windows,m.osVersion=w(O,P);break;case"macos":m.os=o.MacOS,m.osVersion=P}}catch(e){}if(m.isNodeJS)try{var P,A=(k=require("os")).platform();O=T(P=k.release());switch(A){case"win32":m.os=o.Windows,m.osVersion=w(O,P);break;case"darwin":m.os=o.MacOS,m.osVersion=function(e,r){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:r}(O,P);break;case"android":m.os=o.Android,m.osVersion=P;break;case"linux":/android/i.test(P)&&(m.os=o.Android,m.osVersion=P)}}catch(e){}function C(e){return null!==e&&"object"==typeof e}function W(e){return C(e)||function(e){return Array.isArray(e)}(e)}function L(e){if(function(e){return C(e)&&"innerHTML"in e}(e))return e.innerHTML;if(W(e))try{return JSON.stringify(e)}catch(r){return""+e}else if("string"!=typeof e)return""+e;return e}function N(){return function(){if("isSecureContext"in window)return globalThis.isSecureContext;var e=location.protocol,r=location.hostname;return"https:"===e||"localhost"===r||"127.0.0.1"===r||"[::1]"===r}()&&"undefined"!=typeof navigator&&"clipboard"in navigator}function I(r){return function(r){if(!globalThis.getSelection||!globalThis.document.createRange)return!1;var n=e("div");if(void 0===n)return!1;n.contentEditable="true",n.innerHTML=r,n.style.whiteSpace="pre",n.style.userSelect="text",n.style.setProperty("-webkit-user-select","text"),n.style.setProperty("-moz-user-select","text"),n.style.setProperty("-ms-user-select","text"),globalThis.document.body.appendChild(n);var t=globalThis.getSelection(),o=globalThis.document.createRange(),i=function(e){try{null!==e.clipboardData&&"function"==typeof e.clipboardData.setData&&(e.preventDefault(),e.clipboardData.setData("text/html",r),e.clipboardData.setData("text/plain",r))}catch(e){}};d.add(globalThis.document,{type:"copy",callback:i,options:{once:!0,capture:!0}});try{if(null===t)return _(n,t,i),!1;t.removeAllRanges(),o.selectNodeContents(n),t.addRange(o);var a=globalThis.document.execCommand("copy");return _(n,t,i),a}catch(e){return _(n,t,i),!1}}(r)||function(e){var r=window.clipboardData;if(void 0!==r&&"function"==typeof r.setData)try{return r.setData("Text",e)}catch(e){return!1}return!1}(r)}function R(){return function(){var r=e("div");if(void 0===r)return null;r.contentEditable="true",globalThis.document.body.appendChild(r),r.focus();var n=null,t=function(e){try{null!==e.clipboardData&&"function"==typeof e.clipboardData.getData&&(e.preventDefault(),n=e.clipboardData.getData("text/html")||e.clipboardData.getData("text/plain")||null)}catch(e){}};d.add(globalThis.document,{type:"paste",callback:t,options:{once:!0,capture:!0}});try{return globalThis.document.execCommand("paste")||n||(n=r.innerHTML||r.textContent||null),U(r,t),n}catch(e){return U(r,t),null}}()||function(){var e=window.clipboardData;if(void 0!==e&&"function"==typeof e.getData)try{return e.getData("Text")||null}catch(e){return null}return null}()||""}function _(e,r,n){null!==r&&r.removeAllRanges(),globalThis.document.body.removeChild(e),d.remove(globalThis.document,{type:"copy",callback:n})}function U(e,r){globalThis.document.body.removeChild(e),d.remove(globalThis.document,{type:"paste",callback:r})}void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(e){for(var r,n=e.fullVersionList||e.brands||[],t=e.platformVersion,i=0;i<n.length;i++){var a=null==(r=n[i])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},s=a.brand,l=a.version;/not.a.brand/i.test(s)||"Chromium"===s&&(m.engineVersion=l)}"string"==typeof t&&(m.os===o.Windows&&parseInt(t.replace(/[^\d.]/g,"").split(".")[0],10)>=13?m.osVersion="11":m.osVersion=t)})),m.device=m.os===o.iOS||m.os===o.Android?i.Mobile:m.os===o.Windows||m.os===o.MacOS?i.Desktop:i.Unknown,m.isMobile=m.device===i.Mobile,m.isDesktop=m.device===i.Desktop,m.isStandalone=function(e){return"matchMedia"in globalThis&&(e===o.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(m.os);var H={copy:function(e){var r=L(e);return m.isElectron?function(e){try{var r=require("electron");return new Promise((function(n){try{r.clipboard.writeText(e),r.clipboard.writeHTML(e),n(!0)}catch(e){n(!1)}}))}catch(e){return Promise.resolve(!1)}}(r):N()&&("write"in navigator.clipboard||"writeText"in navigator.clipboard)?function(e){try{if("ClipboardItem"in window&&"write"in navigator.clipboard)return navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([e],{type:"text/html"}),"text/plain":new Blob([e],{type:"text/plain"})})]).then((function(){return!0})).catch((function(){return!1}));if("writeText"in navigator.clipboard)return navigator.clipboard.writeText(e).then((function(){return!0})).catch((function(){return!1}))}catch(e){return Promise.resolve(!1)}return Promise.resolve(!1)}(r).then((function(e){return!!e||I(r)})).catch((function(){return I(r)})):Promise.resolve(I(r))},paste:function(){return m.isElectron?function(){try{var e=require("electron");return new Promise((function(r){try{var n=e.clipboard.readHTML();return r(n?n.replace(/<meta[^>]*\bcharset\b[^>]*>/i,""):e.clipboard.readText()||"")}catch(e){r("")}}))}catch(e){return Promise.resolve("")}}():N()&&("read"in navigator.clipboard||"readText"in navigator.clipboard)?function(){try{if("ClipboardItem"in window&&"read"in navigator.clipboard)return navigator.clipboard.read().then((function(e){if(0===e.length)return Promise.resolve(null);for(var r=e[0],n=r.types,t=0;t<n.length;t++)if("text/html"===n[t])return r.getType("text/html").then((function(e){return e.text()})).catch((function(){return null}));for(t=0;t<n.length;t++)if("text/plain"===n[t])return r.getType("text/plain").then((function(e){return e.text()})).catch((function(){return null}));return Promise.resolve(null)})).catch((function(){return null}));if("readText"in navigator.clipboard)return navigator.clipboard.readText().then((function(e){return e})).catch((function(){return null}))}catch(e){return Promise.resolve(null)}return Promise.resolve(null)}().then((function(e){return null!==e?e:R()})).catch((function(){return R()})):Promise.resolve(R())}};return{installed:!1,name:"Clipboard",module:H,Constants:{},Errors:{}}}));
@@ -0,0 +1,10 @@
1
+ export declare interface Electron {
2
+ BrowserWindow: BrowserWindow;
3
+ }
4
+ export declare type BrowserWindow = import('electron').BrowserWindow;
5
+ export declare type IsElectron = typeof process extends {
6
+ versions: {
7
+ electron: string;
8
+ };
9
+ } ? true : false;
10
+ export declare type FullscreenTarget = IsElectron extends true ? BrowserWindow : Element;
@@ -1,10 +1,11 @@
1
+ import { FullscreenTarget } from "./fullscreen-electron";
1
2
  export declare interface FullscreenInstance {
2
3
  enabled: boolean;
3
- element: Element | null;
4
+ element: FullscreenTarget | null;
4
5
  isFullscreen: boolean;
5
- request(target: Element, options?: FullscreenOptions): Promise<void>;
6
+ request(target?: FullscreenTarget, options?: FullscreenOptions): Promise<void>;
6
7
  exit(): Promise<void>;
7
- toggle(target: Element, options?: FullscreenOptions): Promise<void>;
8
+ toggle(target?: FullscreenTarget, options?: FullscreenOptions): Promise<void>;
8
9
  onChange(handler: (event: Event) => void): () => void;
9
10
  onError(handler: (event: Event) => void): () => void;
10
11
  }
@@ -538,15 +538,31 @@ function detectApi() {
538
538
  }
539
539
  return null;
540
540
  }
541
- function isIOS() {
542
- return OS.iOS === Platform.os;
543
- }
544
541
  function createFullscreenUtils() {
545
542
  var api = detectApi();
546
543
  var lastIOSVideo = null;
547
544
  var lastElectronBrowserWindow = null;
548
545
  var lastElectronBrowserWindowOptions = null;
549
546
  var eventsBridged = false;
547
+ function getDefaultTarget() {
548
+ if (Platform.isElectron) {
549
+ var electron = require('electron');
550
+ var focusedWindow = electron.BrowserWindow.getFocusedWindow();
551
+ if (focusedWindow !== null)
552
+ return focusedWindow;
553
+ var allWindows = electron.BrowserWindow.getAllWindows();
554
+ if (allWindows.length === 0)
555
+ throw new Error();
556
+ return allWindows[0];
557
+ }
558
+ if (OS.iOS === Platform.os) {
559
+ var video = globalThis.document.querySelector('video');
560
+ if (video === null)
561
+ throw new Error();
562
+ return video;
563
+ }
564
+ return globalThis.document.documentElement;
565
+ }
550
566
  function restoreElectronBrowserWindowOptions() {
551
567
  if (lastElectronBrowserWindowOptions !== null) {
552
568
  lastElectronBrowserWindow.fullScreenable = lastElectronBrowserWindowOptions.fullScreenable;
@@ -573,6 +589,9 @@ function createFullscreenUtils() {
573
589
  function emitChange() {
574
590
  emit('fullscreenchange');
575
591
  }
592
+ function emitError() {
593
+ emit('fullscreenerror');
594
+ }
576
595
  if (Platform.isElectron) {
577
596
  try {
578
597
  var electron = require('electron');
@@ -615,9 +634,9 @@ function createFullscreenUtils() {
615
634
  }
616
635
  for (var i = 0; i < errorEvents.length; i++) {
617
636
  if (typeof globalThis.document !== 'undefined')
618
- globalThis.document.addEventListener(errorEvents[i], emitChange, false);
637
+ globalThis.document.addEventListener(errorEvents[i], emitError, false);
619
638
  }
620
- if (isIOS()) {
639
+ if (OS.iOS === Platform.os) {
621
640
  bridgeIOSVideoEvents();
622
641
  if (typeof globalThis.MutationObserver !== 'undefined') {
623
642
  var observer = new MutationObserver(function () {
@@ -653,7 +672,7 @@ function createFullscreenUtils() {
653
672
  }
654
673
  }
655
674
  if (api === null) {
656
- if (!isIOS())
675
+ if (OS.iOS !== Platform.os)
657
676
  return false;
658
677
  var videos = globalThis.document.querySelectorAll('video');
659
678
  for (var i = 0; i < videos.length; i++) {
@@ -700,19 +719,21 @@ function createFullscreenUtils() {
700
719
  return getElement() !== null;
701
720
  }
702
721
  function request(target, options) {
722
+ if (target === void 0) { target = getDefaultTarget(); }
703
723
  if (Platform.isElectron) {
724
+ var browserWindow_1 = target;
704
725
  return new Promise(function (resolve, reject) {
705
726
  try {
706
727
  if (lastElectronBrowserWindow === null) {
707
728
  lastElectronBrowserWindowOptions = {
708
- fullScreenable: target.fullScreenable,
709
- autoHideMenuBar: target.autoHideMenuBar,
729
+ fullScreenable: browserWindow_1.fullScreenable,
730
+ autoHideMenuBar: browserWindow_1.autoHideMenuBar,
710
731
  };
711
- target.fullScreenable = true;
712
- target.autoHideMenuBar = true;
732
+ browserWindow_1.fullScreenable = true;
733
+ browserWindow_1.autoHideMenuBar = true;
713
734
  }
714
- target.setFullScreen(true);
715
- lastElectronBrowserWindow = target;
735
+ browserWindow_1.setFullScreen(true);
736
+ lastElectronBrowserWindow = browserWindow_1;
716
737
  resolve();
717
738
  return;
718
739
  }
@@ -733,7 +754,7 @@ function createFullscreenUtils() {
733
754
  resolve();
734
755
  })
735
756
  .catch(function () {
736
- if (!isIOS()) {
757
+ if (OS.iOS !== Platform.os) {
737
758
  reject();
738
759
  return;
739
760
  }
@@ -747,7 +768,7 @@ function createFullscreenUtils() {
747
768
  }
748
769
  }
749
770
  catch (error) {
750
- if (!isIOS()) {
771
+ if (OS.iOS !== Platform.os) {
751
772
  reject();
752
773
  return;
753
774
  }
@@ -755,7 +776,7 @@ function createFullscreenUtils() {
755
776
  }
756
777
  }
757
778
  function fallbackToIOSVideo() {
758
- if (isIOS() && target.tagName.toUpperCase() === 'VIDEO') {
779
+ if (OS.iOS === Platform.os && target.tagName.toUpperCase() === 'VIDEO') {
759
780
  var video = target;
760
781
  if (video.webkitSupportsFullscreen && typeof video.webkitEnterFullscreen === 'function') {
761
782
  lastIOSVideo = video;
@@ -811,7 +832,7 @@ function createFullscreenUtils() {
811
832
  }
812
833
  }
813
834
  }
814
- if (isIOS() && lastIOSVideo !== null) {
835
+ if (OS.iOS === Platform.os && lastIOSVideo !== null) {
815
836
  if (typeof lastIOSVideo.webkitExitFullscreen === 'function' && lastIOSVideo.webkitDisplayingFullscreen === true) {
816
837
  lastIOSVideo.webkitExitFullscreen();
817
838
  lastIOSVideo = null;
@@ -1,3 +1,5 @@
1
+ import * as electron from 'electron';
2
+
1
3
  declare interface NativePlugin<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
2
4
  installed: boolean;
3
5
  name: Key;
@@ -6,13 +8,21 @@ declare interface NativePlugin<Key extends string, Module, Constants extends Rec
6
8
  Errors: Errors;
7
9
  }
8
10
 
11
+ declare type BrowserWindow = electron.BrowserWindow;
12
+ declare type IsElectron = typeof process extends {
13
+ versions: {
14
+ electron: string;
15
+ };
16
+ } ? true : false;
17
+ declare type FullscreenTarget = IsElectron extends true ? BrowserWindow : Element;
18
+
9
19
  declare interface FullscreenInstance {
10
20
  enabled: boolean;
11
- element: Element | null;
21
+ element: FullscreenTarget | null;
12
22
  isFullscreen: boolean;
13
- request(target: Element, options?: FullscreenOptions): Promise<void>;
23
+ request(target?: FullscreenTarget, options?: FullscreenOptions): Promise<void>;
14
24
  exit(): Promise<void>;
15
- toggle(target: Element, options?: FullscreenOptions): Promise<void>;
25
+ toggle(target?: FullscreenTarget, options?: FullscreenOptions): Promise<void>;
16
26
  onChange(handler: (event: Event) => void): () => void;
17
27
  onError(handler: (event: Event) => void): () => void;
18
28
  }
@@ -1 +1 @@
1
- "use strict";var e,n,r,o;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(o||(o={}));var i="undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",t={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:o.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var r=n.getExtension("WEBGL_debug_renderer_info");return null===r?n.getParameter(n.RENDERER):n.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:i,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(i),isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isElectron:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(i),isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},l=[[/windows nt (6\.[23]); arm/i,e.Windows,u],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,u],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,u],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,u],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,u],[/windows ce\/?([\d.]*)/i,e.Windows,u],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,c],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,c],[/cfnetwork\/.+darwin/i,e.iOS,c],[/mac os x ?([\w. ]*)/i,e.MacOS,c],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,c],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],a=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],s=[[/\b(?:crmo|crios)\/([\w.]+)/i,o.Chrome],[/webview.+edge\/([\w.]+)/i,o.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,o.Edge],[/opera mini\/([-\w.]+)/i,o.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,o.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,o.Opera],[/opios[\/ ]+([\w.]+)/i,o.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,o.Opera],[/\bopr\/([\w.]+)/i,o.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,o.IE],[/(?:ms|\()ie ([\w.]+)/i,o.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,o.IE],[/\bfocus\/([\w.]+)/i,o.Firefox],[/\bopt\/([\w.]+)/i,o.Opera],[/coast\/([\w.]+)/i,o.Opera],[/fxios\/([\w.-]+)/i,o.Firefox],[/samsungbrowser\/([\w.]+)/i,o.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,o.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,o.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,o.Chrome],[/chrome\/([\w.]+) mobile/i,o.Chrome],[/chrome\/v?([\w.]+)/i,o.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/version\/([\w.,]+) .*safari/i,o.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,o.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,o.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,o.Firefox],[/firefox\/([\w.]+)/i,o.Firefox]];function u(e){if(void 0===e)return"";var n={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==n?n:e}function c(e){return void 0===e?"":e.replace(/_/g,".")}function d(e,n){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":n}function m(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function f(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var b=0;b<l.length;b++){var w=(p=l[b])[0],g=p[1],v=p[2];if(null!==(k=t.userAgent.match(w))){t.os=g,t.osVersion=m(k[1],v);break}}t.os===e.iOS&&0===function(e,n){for(var r=e.split("."),o=n.split("."),i=Math.max(r.length,o.length),t=0;t<i;t++){var l=void 0,a=void 0;if((l=t<r.length?parseInt(r[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(l<a)return-1}return 0}(t.osVersion,"18.6")&&(null!==(T=/\) Version\/([\d.]+)/.exec(t.userAgent))&&parseInt(T[1].substring(0,2),10)>=26&&(t.osVersion=T[1]));for(b=0;b<a.length;b++){w=(p=a[b])[0];var h=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.engine=h,t.engineVersion=m(k[1],v);break}}for(b=0;b<s.length;b++){w=(p=s[b])[0];var p,k,E=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.browser=E,t.browserVersion=m(k[1],v);break}}if(t.isReactNative)try{g=(S=require("react-native").Platform).OS;var T=f(j=""+S.Version);switch(g){case"android":t.os=e.Android,t.osVersion=function(e,n){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major?"4.4W":19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":n}(T,j);break;case"ios":t.os=e.iOS,t.osVersion=j;break;case"windows":t.os=e.Windows,t.osVersion=d(T,j);break;case"macos":t.os=e.MacOS,t.osVersion=j}}catch(e){}if(t.isNodeJS)try{var j,S=(g=require("os")).platform();T=f(j=g.release());switch(S){case"win32":t.os=e.Windows,t.osVersion=d(T,j);break;case"darwin":t.os=e.MacOS,t.osVersion=function(e,n){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:n}(T,j);break;case"android":t.os=e.Android,t.osVersion=j;break;case"linux":/android/i.test(j)&&(t.os=e.Android,t.osVersion=j)}}catch(e){}void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(n){for(var r,o=n.fullVersionList||n.brands||[],i=n.platformVersion,l=0;l<o.length;l++){var a=null==(r=o[l])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},s=a.brand,u=a.version;/not.a.brand/i.test(s)||"Chromium"===s&&(t.engineVersion=u)}"string"==typeof i&&(t.os===e.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?t.osVersion="11":t.osVersion=i)})),t.device=t.os===e.iOS||t.os===e.Android?n.Mobile:t.os===e.Windows||t.os===e.MacOS?n.Desktop:n.Unknown,t.isMobile=t.device===n.Mobile,t.isDesktop=t.device===n.Desktop,t.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(t.os);var F={standard:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}};function x(){return e.iOS===t.os}var y=function(){var n=function(){if(t.isElectron)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return F.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=F[o]).enabled in globalThis.document||i.element in globalThis.document||i.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}if("webkitCurrentFullScreenElement"in globalThis.document){var i={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:F.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=null,i=null,l=!1;function a(){null!==i&&(o.fullScreenable=i.fullScreenable,o.autoHideMenuBar=i.autoHideMenuBar,i=null),o=null}function s(){void 0!==globalThis.document&&globalThis.document.querySelectorAll("video").forEach((function(e){function n(){globalThis.document.dispatchEvent(new Event("fullscreenchange"))}e.__fsBridged__||!("webkitEnterFullscreen"in e)&&!("onwebkitbeginfullscreen"in e)||(e.addEventListener("webkitbeginfullscreen",n,!1),e.addEventListener("webkitendfullscreen",n,!1),e.__fsBridged__=!0)}))}function u(){if(t.isElectron){if(null!==o)return o;try{for(var i=require("electron").BrowserWindow.getAllWindows(),l=0;l<i.length;l++){var a=i[l];if(a.isFullScreen()||t.os===e.MacOS&&"function"==typeof a.isSimpleFullScreen&&a.isSimpleFullScreen())return a}return null}catch(e){return null}}if(null===n)return r&&r.webkitDisplayingFullscreen?r:null;var s=globalThis.document[n.element];return null!=s?s:null}function c(){return null!==u()}function d(e,l){return t.isElectron?new Promise((function(n,r){try{return null===o&&(i={fullScreenable:e.fullScreenable,autoHideMenuBar:e.autoHideMenuBar},e.fullScreenable=!0,e.autoHideMenuBar=!0),e.setFullScreen(!0),o=e,void n()}catch(e){r()}})):new Promise((function(o,i){if(null!==n){var t=e[n.request];if("function"==typeof t)try{var a=t.call(e,l);return void 0!==a&&"function"==typeof a.then?void a.then((function(){o()})).catch((function(){x()?u():i()})):void o()}catch(e){if(!x())return void i()}}function u(){if(x()&&"VIDEO"===e.tagName.toUpperCase()){var n=e;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,s(),n.webkitEnterFullscreen(),void o()}i()}u()}))}function m(){return t.isElectron?new Promise((function(e,n){try{if(null!==o)o.setFullScreen(!1),a();else{var r=u();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}})):new Promise((function(e,o){if(null!==n){var i=globalThis.document[n.exit];if("function"==typeof i){var t=i.call(globalThis.document);return void 0!==t&&"function"==typeof t.then?void t.then((function(){e()})).catch((function(){o()})):void e()}}if(x()&&null!==r){if("function"==typeof r.webkitExitFullscreen&&!0===r.webkitDisplayingFullscreen)return r.webkitExitFullscreen(),r=null,void e();for(var l=globalThis.document.querySelectorAll("video"),a=0;a<l.length;a++){var s=l[a];if("function"==typeof s.webkitExitFullscreen&&!0===s.webkitDisplayingFullscreen)return s.webkitExitFullscreen(),void e()}}u()?o():e()}))}return function(){if(!l){l=!0;var e=!1;if(t.isElectron)try{for(var n=require("electron"),r=n.BrowserWindow.getAllWindows(),i=function(e){var n=r[e];n.on("enter-full-screen",(function(){o=n,m()})),n.on("leave-full-screen",(function(){a(),m()}))},u=0;u<r.length;u++)i(u);"function"==typeof n.BrowserWindow.on&&n.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){o=n,m()})),n.on("leave-full-screen",(function(){a(),m()}))}))}catch(e){}var c=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],d=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(u=0;u<c.length;u++)void 0!==globalThis.document&&globalThis.document.addEventListener(c[u],m,!1);for(u=0;u<d.length;u++)void 0!==globalThis.document&&globalThis.document.addEventListener(d[u],m,!1);if(x())if(s(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){s()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function m(){var n;n="fullscreenchange",e||(e=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(n,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){e=!1})))}}(),{get enabled(){return function(){if(t.isElectron)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===n){if(!x())return!1;for(var e=globalThis.document.querySelectorAll("video"),r=0;r<e.length;r++){var o=e[r];if(o.webkitSupportsFullscreen||"webkitEnterFullscreen"in o)return!0}return!1}var i=globalThis.document[n.enabled];return"boolean"==typeof i?i:void 0!==globalThis.document[n.element]}()},get element(){return u()},get isFullscreen(){return c()},request:d,exit:m,toggle:function(e,n){return c()?m():d(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}(),M={installed:!1,name:"Fullscreen",module:y,Constants:{},Errors:{}};module.exports=M;
1
+ "use strict";var e,n,r,o;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(o||(o={}));var i="undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",t={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:o.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var r=n.getExtension("WEBGL_debug_renderer_info");return null===r?n.getParameter(n.RENDERER):n.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:i,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(i),isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isElectron:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(i),isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},l=[[/windows nt (6\.[23]); arm/i,e.Windows,u],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,u],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,u],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,u],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,u],[/windows ce\/?([\d.]*)/i,e.Windows,u],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,c],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,c],[/cfnetwork\/.+darwin/i,e.iOS,c],[/mac os x ?([\w. ]*)/i,e.MacOS,c],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,c],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],a=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],s=[[/\b(?:crmo|crios)\/([\w.]+)/i,o.Chrome],[/webview.+edge\/([\w.]+)/i,o.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,o.Edge],[/opera mini\/([-\w.]+)/i,o.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,o.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,o.Opera],[/opios[\/ ]+([\w.]+)/i,o.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,o.Opera],[/\bopr\/([\w.]+)/i,o.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,o.IE],[/(?:ms|\()ie ([\w.]+)/i,o.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,o.IE],[/\bfocus\/([\w.]+)/i,o.Firefox],[/\bopt\/([\w.]+)/i,o.Opera],[/coast\/([\w.]+)/i,o.Opera],[/fxios\/([\w.-]+)/i,o.Firefox],[/samsungbrowser\/([\w.]+)/i,o.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,o.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,o.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,o.Chrome],[/chrome\/([\w.]+) mobile/i,o.Chrome],[/chrome\/v?([\w.]+)/i,o.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/version\/([\w.,]+) .*safari/i,o.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,o.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,o.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,o.Firefox],[/firefox\/([\w.]+)/i,o.Firefox]];function u(e){if(void 0===e)return"";var n={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==n?n:e}function c(e){return void 0===e?"":e.replace(/_/g,".")}function d(e,n){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":n}function m(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function f(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var b=0;b<l.length;b++){var w=(p=l[b])[0],g=p[1],v=p[2];if(null!==(k=t.userAgent.match(w))){t.os=g,t.osVersion=m(k[1],v);break}}t.os===e.iOS&&0===function(e,n){for(var r=e.split("."),o=n.split("."),i=Math.max(r.length,o.length),t=0;t<i;t++){var l=void 0,a=void 0;if((l=t<r.length?parseInt(r[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(l<a)return-1}return 0}(t.osVersion,"18.6")&&(null!==(S=/\) Version\/([\d.]+)/.exec(t.userAgent))&&parseInt(S[1].substring(0,2),10)>=26&&(t.osVersion=S[1]));for(b=0;b<a.length;b++){w=(p=a[b])[0];var h=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.engine=h,t.engineVersion=m(k[1],v);break}}for(b=0;b<s.length;b++){w=(p=s[b])[0];var p,k,E=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.browser=E,t.browserVersion=m(k[1],v);break}}if(t.isReactNative)try{g=(j=require("react-native").Platform).OS;var S=f(T=""+j.Version);switch(g){case"android":t.os=e.Android,t.osVersion=function(e,n){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major?"4.4W":19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":n}(S,T);break;case"ios":t.os=e.iOS,t.osVersion=T;break;case"windows":t.os=e.Windows,t.osVersion=d(S,T);break;case"macos":t.os=e.MacOS,t.osVersion=T}}catch(e){}if(t.isNodeJS)try{var T,j=(g=require("os")).platform();S=f(T=g.release());switch(j){case"win32":t.os=e.Windows,t.osVersion=d(S,T);break;case"darwin":t.os=e.MacOS,t.osVersion=function(e,n){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:n}(S,T);break;case"android":t.os=e.Android,t.osVersion=T;break;case"linux":/android/i.test(T)&&(t.os=e.Android,t.osVersion=T)}}catch(e){}void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(n){for(var r,o=n.fullVersionList||n.brands||[],i=n.platformVersion,l=0;l<o.length;l++){var a=null==(r=o[l])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},s=a.brand,u=a.version;/not.a.brand/i.test(s)||"Chromium"===s&&(t.engineVersion=u)}"string"==typeof i&&(t.os===e.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?t.osVersion="11":t.osVersion=i)})),t.device=t.os===e.iOS||t.os===e.Android?n.Mobile:t.os===e.Windows||t.os===e.MacOS?n.Desktop:n.Unknown,t.isMobile=t.device===n.Mobile,t.isDesktop=t.device===n.Desktop,t.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(t.os);var F={standard:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}};var x=function(){var n=function(){if(t.isElectron)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return F.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=F[o]).enabled in globalThis.document||i.element in globalThis.document||i.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}if("webkitCurrentFullScreenElement"in globalThis.document){var i={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:F.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=null,i=null,l=!1;function a(){null!==i&&(o.fullScreenable=i.fullScreenable,o.autoHideMenuBar=i.autoHideMenuBar,i=null),o=null}function s(){void 0!==globalThis.document&&globalThis.document.querySelectorAll("video").forEach((function(e){function n(){globalThis.document.dispatchEvent(new Event("fullscreenchange"))}e.__fsBridged__||!("webkitEnterFullscreen"in e)&&!("onwebkitbeginfullscreen"in e)||(e.addEventListener("webkitbeginfullscreen",n,!1),e.addEventListener("webkitendfullscreen",n,!1),e.__fsBridged__=!0)}))}function u(){if(t.isElectron){if(null!==o)return o;try{for(var i=require("electron").BrowserWindow.getAllWindows(),l=0;l<i.length;l++){var a=i[l];if(a.isFullScreen()||t.os===e.MacOS&&"function"==typeof a.isSimpleFullScreen&&a.isSimpleFullScreen())return a}return null}catch(e){return null}}if(null===n)return r&&r.webkitDisplayingFullscreen?r:null;var s=globalThis.document[n.element];return null!=s?s:null}function c(){return null!==u()}function d(l,a){if(void 0===l&&(l=function(){if(t.isElectron){var n=require("electron"),r=n.BrowserWindow.getFocusedWindow();if(null!==r)return r;var o=n.BrowserWindow.getAllWindows();if(0===o.length)throw new Error;return o[0]}if(e.iOS===t.os){var i=globalThis.document.querySelector("video");if(null===i)throw new Error;return i}return globalThis.document.documentElement}()),t.isElectron){var u=l;return new Promise((function(e,n){try{return null===o&&(i={fullScreenable:u.fullScreenable,autoHideMenuBar:u.autoHideMenuBar},u.fullScreenable=!0,u.autoHideMenuBar=!0),u.setFullScreen(!0),o=u,void e()}catch(e){n()}}))}return new Promise((function(o,i){if(null!==n){var u=l[n.request];if("function"==typeof u)try{var c=u.call(l,a);return void 0!==c&&"function"==typeof c.then?void c.then((function(){o()})).catch((function(){e.iOS===t.os?d():i()})):void o()}catch(n){if(e.iOS!==t.os)return void i()}}function d(){if(e.iOS===t.os&&"VIDEO"===l.tagName.toUpperCase()){var n=l;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,s(),n.webkitEnterFullscreen(),void o()}i()}d()}))}function m(){return t.isElectron?new Promise((function(e,n){try{if(null!==o)o.setFullScreen(!1),a();else{var r=u();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}})):new Promise((function(o,i){if(null!==n){var l=globalThis.document[n.exit];if("function"==typeof l){var a=l.call(globalThis.document);return void 0!==a&&"function"==typeof a.then?void a.then((function(){o()})).catch((function(){i()})):void o()}}if(e.iOS===t.os&&null!==r){if("function"==typeof r.webkitExitFullscreen&&!0===r.webkitDisplayingFullscreen)return r.webkitExitFullscreen(),r=null,void o();for(var s=globalThis.document.querySelectorAll("video"),c=0;c<s.length;c++){var d=s[c];if("function"==typeof d.webkitExitFullscreen&&!0===d.webkitDisplayingFullscreen)return d.webkitExitFullscreen(),void o()}}u()?i():o()}))}return function(){if(!l){l=!0;var n=!1;if(t.isElectron)try{for(var r=require("electron"),i=r.BrowserWindow.getAllWindows(),u=function(e){var n=i[e];n.on("enter-full-screen",(function(){o=n,b()})),n.on("leave-full-screen",(function(){a(),b()}))},c=0;c<i.length;c++)u(c);"function"==typeof r.BrowserWindow.on&&r.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){o=n,b()})),n.on("leave-full-screen",(function(){a(),b()}))}))}catch(e){}var d=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],m=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(c=0;c<d.length;c++)void 0!==globalThis.document&&globalThis.document.addEventListener(d[c],b,!1);for(c=0;c<m.length;c++)void 0!==globalThis.document&&globalThis.document.addEventListener(m[c],w,!1);if(e.iOS===t.os)if(s(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){s()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function f(e){n||(n=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(e,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){n=!1})))}function b(){f("fullscreenchange")}function w(){f("fullscreenerror")}}(),{get enabled(){return function(){if(t.isElectron)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===n){if(e.iOS!==t.os)return!1;for(var r=globalThis.document.querySelectorAll("video"),o=0;o<r.length;o++){var i=r[o];if(i.webkitSupportsFullscreen||"webkitEnterFullscreen"in i)return!0}return!1}var l=globalThis.document[n.enabled];return"boolean"==typeof l?l:void 0!==globalThis.document[n.element]}()},get element(){return u()},get isFullscreen(){return c()},request:d,exit:m,toggle:function(e,n){return c()?m():d(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}(),y={installed:!1,name:"Fullscreen",module:x,Constants:{},Errors:{}};module.exports=y;
@@ -1 +1 @@
1
- var e,n,r,o;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(o||(o={}));var i="undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",t={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:o.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var r=n.getExtension("WEBGL_debug_renderer_info");return null===r?n.getParameter(n.RENDERER):n.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:i,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(i),isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isElectron:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(i),isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},l=[[/windows nt (6\.[23]); arm/i,e.Windows,u],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,u],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,u],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,u],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,u],[/windows ce\/?([\d.]*)/i,e.Windows,u],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,c],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,c],[/cfnetwork\/.+darwin/i,e.iOS,c],[/mac os x ?([\w. ]*)/i,e.MacOS,c],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,c],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],a=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],s=[[/\b(?:crmo|crios)\/([\w.]+)/i,o.Chrome],[/webview.+edge\/([\w.]+)/i,o.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,o.Edge],[/opera mini\/([-\w.]+)/i,o.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,o.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,o.Opera],[/opios[\/ ]+([\w.]+)/i,o.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,o.Opera],[/\bopr\/([\w.]+)/i,o.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,o.IE],[/(?:ms|\()ie ([\w.]+)/i,o.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,o.IE],[/\bfocus\/([\w.]+)/i,o.Firefox],[/\bopt\/([\w.]+)/i,o.Opera],[/coast\/([\w.]+)/i,o.Opera],[/fxios\/([\w.-]+)/i,o.Firefox],[/samsungbrowser\/([\w.]+)/i,o.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,o.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,o.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,o.Chrome],[/chrome\/([\w.]+) mobile/i,o.Chrome],[/chrome\/v?([\w.]+)/i,o.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/version\/([\w.,]+) .*safari/i,o.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,o.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,o.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,o.Firefox],[/firefox\/([\w.]+)/i,o.Firefox]];function u(e){if(void 0===e)return"";var n={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==n?n:e}function c(e){return void 0===e?"":e.replace(/_/g,".")}function d(e,n){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":n}function m(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function f(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var b=0;b<l.length;b++){var w=(p=l[b])[0],g=p[1],v=p[2];if(null!==(k=t.userAgent.match(w))){t.os=g,t.osVersion=m(k[1],v);break}}t.os===e.iOS&&0===function(e,n){for(var r=e.split("."),o=n.split("."),i=Math.max(r.length,o.length),t=0;t<i;t++){var l=void 0,a=void 0;if((l=t<r.length?parseInt(r[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(l<a)return-1}return 0}(t.osVersion,"18.6")&&(null!==(T=/\) Version\/([\d.]+)/.exec(t.userAgent))&&parseInt(T[1].substring(0,2),10)>=26&&(t.osVersion=T[1]));for(b=0;b<a.length;b++){w=(p=a[b])[0];var h=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.engine=h,t.engineVersion=m(k[1],v);break}}for(b=0;b<s.length;b++){w=(p=s[b])[0];var p,k,E=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.browser=E,t.browserVersion=m(k[1],v);break}}if(t.isReactNative)try{g=(S=require("react-native").Platform).OS;var T=f(j=""+S.Version);switch(g){case"android":t.os=e.Android,t.osVersion=function(e,n){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major?"4.4W":19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":n}(T,j);break;case"ios":t.os=e.iOS,t.osVersion=j;break;case"windows":t.os=e.Windows,t.osVersion=d(T,j);break;case"macos":t.os=e.MacOS,t.osVersion=j}}catch(e){}if(t.isNodeJS)try{var j,S=(g=require("os")).platform();T=f(j=g.release());switch(S){case"win32":t.os=e.Windows,t.osVersion=d(T,j);break;case"darwin":t.os=e.MacOS,t.osVersion=function(e,n){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:n}(T,j);break;case"android":t.os=e.Android,t.osVersion=j;break;case"linux":/android/i.test(j)&&(t.os=e.Android,t.osVersion=j)}}catch(e){}void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(n){for(var r,o=n.fullVersionList||n.brands||[],i=n.platformVersion,l=0;l<o.length;l++){var a=null==(r=o[l])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},s=a.brand,u=a.version;/not.a.brand/i.test(s)||"Chromium"===s&&(t.engineVersion=u)}"string"==typeof i&&(t.os===e.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?t.osVersion="11":t.osVersion=i)})),t.device=t.os===e.iOS||t.os===e.Android?n.Mobile:t.os===e.Windows||t.os===e.MacOS?n.Desktop:n.Unknown,t.isMobile=t.device===n.Mobile,t.isDesktop=t.device===n.Desktop,t.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(t.os);var F={standard:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}};function x(){return e.iOS===t.os}var y=function(){var n=function(){if(t.isElectron)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return F.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=F[o]).enabled in globalThis.document||i.element in globalThis.document||i.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}if("webkitCurrentFullScreenElement"in globalThis.document){var i={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:F.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=null,i=null,l=!1;function a(){null!==i&&(o.fullScreenable=i.fullScreenable,o.autoHideMenuBar=i.autoHideMenuBar,i=null),o=null}function s(){void 0!==globalThis.document&&globalThis.document.querySelectorAll("video").forEach((function(e){function n(){globalThis.document.dispatchEvent(new Event("fullscreenchange"))}e.__fsBridged__||!("webkitEnterFullscreen"in e)&&!("onwebkitbeginfullscreen"in e)||(e.addEventListener("webkitbeginfullscreen",n,!1),e.addEventListener("webkitendfullscreen",n,!1),e.__fsBridged__=!0)}))}function u(){if(t.isElectron){if(null!==o)return o;try{for(var i=require("electron").BrowserWindow.getAllWindows(),l=0;l<i.length;l++){var a=i[l];if(a.isFullScreen()||t.os===e.MacOS&&"function"==typeof a.isSimpleFullScreen&&a.isSimpleFullScreen())return a}return null}catch(e){return null}}if(null===n)return r&&r.webkitDisplayingFullscreen?r:null;var s=globalThis.document[n.element];return null!=s?s:null}function c(){return null!==u()}function d(e,l){return t.isElectron?new Promise((function(n,r){try{return null===o&&(i={fullScreenable:e.fullScreenable,autoHideMenuBar:e.autoHideMenuBar},e.fullScreenable=!0,e.autoHideMenuBar=!0),e.setFullScreen(!0),o=e,void n()}catch(e){r()}})):new Promise((function(o,i){if(null!==n){var t=e[n.request];if("function"==typeof t)try{var a=t.call(e,l);return void 0!==a&&"function"==typeof a.then?void a.then((function(){o()})).catch((function(){x()?u():i()})):void o()}catch(e){if(!x())return void i()}}function u(){if(x()&&"VIDEO"===e.tagName.toUpperCase()){var n=e;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,s(),n.webkitEnterFullscreen(),void o()}i()}u()}))}function m(){return t.isElectron?new Promise((function(e,n){try{if(null!==o)o.setFullScreen(!1),a();else{var r=u();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}})):new Promise((function(e,o){if(null!==n){var i=globalThis.document[n.exit];if("function"==typeof i){var t=i.call(globalThis.document);return void 0!==t&&"function"==typeof t.then?void t.then((function(){e()})).catch((function(){o()})):void e()}}if(x()&&null!==r){if("function"==typeof r.webkitExitFullscreen&&!0===r.webkitDisplayingFullscreen)return r.webkitExitFullscreen(),r=null,void e();for(var l=globalThis.document.querySelectorAll("video"),a=0;a<l.length;a++){var s=l[a];if("function"==typeof s.webkitExitFullscreen&&!0===s.webkitDisplayingFullscreen)return s.webkitExitFullscreen(),void e()}}u()?o():e()}))}return function(){if(!l){l=!0;var e=!1;if(t.isElectron)try{for(var n=require("electron"),r=n.BrowserWindow.getAllWindows(),i=function(e){var n=r[e];n.on("enter-full-screen",(function(){o=n,m()})),n.on("leave-full-screen",(function(){a(),m()}))},u=0;u<r.length;u++)i(u);"function"==typeof n.BrowserWindow.on&&n.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){o=n,m()})),n.on("leave-full-screen",(function(){a(),m()}))}))}catch(e){}var c=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],d=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(u=0;u<c.length;u++)void 0!==globalThis.document&&globalThis.document.addEventListener(c[u],m,!1);for(u=0;u<d.length;u++)void 0!==globalThis.document&&globalThis.document.addEventListener(d[u],m,!1);if(x())if(s(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){s()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function m(){var n;n="fullscreenchange",e||(e=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(n,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){e=!1})))}}(),{get enabled(){return function(){if(t.isElectron)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===n){if(!x())return!1;for(var e=globalThis.document.querySelectorAll("video"),r=0;r<e.length;r++){var o=e[r];if(o.webkitSupportsFullscreen||"webkitEnterFullscreen"in o)return!0}return!1}var i=globalThis.document[n.enabled];return"boolean"==typeof i?i:void 0!==globalThis.document[n.element]}()},get element(){return u()},get isFullscreen(){return c()},request:d,exit:m,toggle:function(e,n){return c()?m():d(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}(),M={installed:!1,name:"Fullscreen",module:y,Constants:{},Errors:{}};export{M as default};
1
+ var e,n,r,o;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(o||(o={}));var i="undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",t={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:o.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var r=n.getExtension("WEBGL_debug_renderer_info");return null===r?n.getParameter(n.RENDERER):n.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:i,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(i),isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isElectron:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(i),isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},l=[[/windows nt (6\.[23]); arm/i,e.Windows,u],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,u],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,u],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,u],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,u],[/windows ce\/?([\d.]*)/i,e.Windows,u],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,c],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,c],[/cfnetwork\/.+darwin/i,e.iOS,c],[/mac os x ?([\w. ]*)/i,e.MacOS,c],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,c],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],a=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],s=[[/\b(?:crmo|crios)\/([\w.]+)/i,o.Chrome],[/webview.+edge\/([\w.]+)/i,o.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,o.Edge],[/opera mini\/([-\w.]+)/i,o.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,o.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,o.Opera],[/opios[\/ ]+([\w.]+)/i,o.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,o.Opera],[/\bopr\/([\w.]+)/i,o.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,o.IE],[/(?:ms|\()ie ([\w.]+)/i,o.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,o.IE],[/\bfocus\/([\w.]+)/i,o.Firefox],[/\bopt\/([\w.]+)/i,o.Opera],[/coast\/([\w.]+)/i,o.Opera],[/fxios\/([\w.-]+)/i,o.Firefox],[/samsungbrowser\/([\w.]+)/i,o.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,o.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,o.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,o.Chrome],[/chrome\/([\w.]+) mobile/i,o.Chrome],[/chrome\/v?([\w.]+)/i,o.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/version\/([\w.,]+) .*safari/i,o.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,o.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,o.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,o.Firefox],[/firefox\/([\w.]+)/i,o.Firefox]];function u(e){if(void 0===e)return"";var n={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==n?n:e}function c(e){return void 0===e?"":e.replace(/_/g,".")}function d(e,n){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":n}function m(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function f(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var b=0;b<l.length;b++){var w=(p=l[b])[0],g=p[1],v=p[2];if(null!==(k=t.userAgent.match(w))){t.os=g,t.osVersion=m(k[1],v);break}}t.os===e.iOS&&0===function(e,n){for(var r=e.split("."),o=n.split("."),i=Math.max(r.length,o.length),t=0;t<i;t++){var l=void 0,a=void 0;if((l=t<r.length?parseInt(r[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(l<a)return-1}return 0}(t.osVersion,"18.6")&&(null!==(S=/\) Version\/([\d.]+)/.exec(t.userAgent))&&parseInt(S[1].substring(0,2),10)>=26&&(t.osVersion=S[1]));for(b=0;b<a.length;b++){w=(p=a[b])[0];var h=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.engine=h,t.engineVersion=m(k[1],v);break}}for(b=0;b<s.length;b++){w=(p=s[b])[0];var p,k,E=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.browser=E,t.browserVersion=m(k[1],v);break}}if(t.isReactNative)try{g=(j=require("react-native").Platform).OS;var S=f(T=""+j.Version);switch(g){case"android":t.os=e.Android,t.osVersion=function(e,n){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major?"4.4W":19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":n}(S,T);break;case"ios":t.os=e.iOS,t.osVersion=T;break;case"windows":t.os=e.Windows,t.osVersion=d(S,T);break;case"macos":t.os=e.MacOS,t.osVersion=T}}catch(e){}if(t.isNodeJS)try{var T,j=(g=require("os")).platform();S=f(T=g.release());switch(j){case"win32":t.os=e.Windows,t.osVersion=d(S,T);break;case"darwin":t.os=e.MacOS,t.osVersion=function(e,n){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:n}(S,T);break;case"android":t.os=e.Android,t.osVersion=T;break;case"linux":/android/i.test(T)&&(t.os=e.Android,t.osVersion=T)}}catch(e){}void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(n){for(var r,o=n.fullVersionList||n.brands||[],i=n.platformVersion,l=0;l<o.length;l++){var a=null==(r=o[l])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},s=a.brand,u=a.version;/not.a.brand/i.test(s)||"Chromium"===s&&(t.engineVersion=u)}"string"==typeof i&&(t.os===e.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?t.osVersion="11":t.osVersion=i)})),t.device=t.os===e.iOS||t.os===e.Android?n.Mobile:t.os===e.Windows||t.os===e.MacOS?n.Desktop:n.Unknown,t.isMobile=t.device===n.Mobile,t.isDesktop=t.device===n.Desktop,t.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(t.os);var F={standard:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}};var x=function(){var n=function(){if(t.isElectron)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return F.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=F[o]).enabled in globalThis.document||i.element in globalThis.document||i.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}if("webkitCurrentFullScreenElement"in globalThis.document){var i={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:F.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=null,i=null,l=!1;function a(){null!==i&&(o.fullScreenable=i.fullScreenable,o.autoHideMenuBar=i.autoHideMenuBar,i=null),o=null}function s(){void 0!==globalThis.document&&globalThis.document.querySelectorAll("video").forEach((function(e){function n(){globalThis.document.dispatchEvent(new Event("fullscreenchange"))}e.__fsBridged__||!("webkitEnterFullscreen"in e)&&!("onwebkitbeginfullscreen"in e)||(e.addEventListener("webkitbeginfullscreen",n,!1),e.addEventListener("webkitendfullscreen",n,!1),e.__fsBridged__=!0)}))}function u(){if(t.isElectron){if(null!==o)return o;try{for(var i=require("electron").BrowserWindow.getAllWindows(),l=0;l<i.length;l++){var a=i[l];if(a.isFullScreen()||t.os===e.MacOS&&"function"==typeof a.isSimpleFullScreen&&a.isSimpleFullScreen())return a}return null}catch(e){return null}}if(null===n)return r&&r.webkitDisplayingFullscreen?r:null;var s=globalThis.document[n.element];return null!=s?s:null}function c(){return null!==u()}function d(l,a){if(void 0===l&&(l=function(){if(t.isElectron){var n=require("electron"),r=n.BrowserWindow.getFocusedWindow();if(null!==r)return r;var o=n.BrowserWindow.getAllWindows();if(0===o.length)throw new Error;return o[0]}if(e.iOS===t.os){var i=globalThis.document.querySelector("video");if(null===i)throw new Error;return i}return globalThis.document.documentElement}()),t.isElectron){var u=l;return new Promise((function(e,n){try{return null===o&&(i={fullScreenable:u.fullScreenable,autoHideMenuBar:u.autoHideMenuBar},u.fullScreenable=!0,u.autoHideMenuBar=!0),u.setFullScreen(!0),o=u,void e()}catch(e){n()}}))}return new Promise((function(o,i){if(null!==n){var u=l[n.request];if("function"==typeof u)try{var c=u.call(l,a);return void 0!==c&&"function"==typeof c.then?void c.then((function(){o()})).catch((function(){e.iOS===t.os?d():i()})):void o()}catch(n){if(e.iOS!==t.os)return void i()}}function d(){if(e.iOS===t.os&&"VIDEO"===l.tagName.toUpperCase()){var n=l;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,s(),n.webkitEnterFullscreen(),void o()}i()}d()}))}function m(){return t.isElectron?new Promise((function(e,n){try{if(null!==o)o.setFullScreen(!1),a();else{var r=u();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}})):new Promise((function(o,i){if(null!==n){var l=globalThis.document[n.exit];if("function"==typeof l){var a=l.call(globalThis.document);return void 0!==a&&"function"==typeof a.then?void a.then((function(){o()})).catch((function(){i()})):void o()}}if(e.iOS===t.os&&null!==r){if("function"==typeof r.webkitExitFullscreen&&!0===r.webkitDisplayingFullscreen)return r.webkitExitFullscreen(),r=null,void o();for(var s=globalThis.document.querySelectorAll("video"),c=0;c<s.length;c++){var d=s[c];if("function"==typeof d.webkitExitFullscreen&&!0===d.webkitDisplayingFullscreen)return d.webkitExitFullscreen(),void o()}}u()?i():o()}))}return function(){if(!l){l=!0;var n=!1;if(t.isElectron)try{for(var r=require("electron"),i=r.BrowserWindow.getAllWindows(),u=function(e){var n=i[e];n.on("enter-full-screen",(function(){o=n,b()})),n.on("leave-full-screen",(function(){a(),b()}))},c=0;c<i.length;c++)u(c);"function"==typeof r.BrowserWindow.on&&r.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){o=n,b()})),n.on("leave-full-screen",(function(){a(),b()}))}))}catch(e){}var d=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],m=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(c=0;c<d.length;c++)void 0!==globalThis.document&&globalThis.document.addEventListener(d[c],b,!1);for(c=0;c<m.length;c++)void 0!==globalThis.document&&globalThis.document.addEventListener(m[c],w,!1);if(e.iOS===t.os)if(s(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){s()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function f(e){n||(n=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(e,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){n=!1})))}function b(){f("fullscreenchange")}function w(){f("fullscreenerror")}}(),{get enabled(){return function(){if(t.isElectron)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===n){if(e.iOS!==t.os)return!1;for(var r=globalThis.document.querySelectorAll("video"),o=0;o<r.length;o++){var i=r[o];if(i.webkitSupportsFullscreen||"webkitEnterFullscreen"in i)return!0}return!1}var l=globalThis.document[n.enabled];return"boolean"==typeof l?l:void 0!==globalThis.document[n.element]}()},get element(){return u()},get isFullscreen(){return c()},request:d,exit:m,toggle:function(e,n){return c()?m():d(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}(),y={installed:!1,name:"Fullscreen",module:x,Constants:{},Errors:{}};export{y as default};
@@ -536,15 +536,31 @@ function detectApi() {
536
536
  }
537
537
  return null;
538
538
  }
539
- function isIOS() {
540
- return OS.iOS === Platform.os;
541
- }
542
539
  function createFullscreenUtils() {
543
540
  var api = detectApi();
544
541
  var lastIOSVideo = null;
545
542
  var lastElectronBrowserWindow = null;
546
543
  var lastElectronBrowserWindowOptions = null;
547
544
  var eventsBridged = false;
545
+ function getDefaultTarget() {
546
+ if (Platform.isElectron) {
547
+ var electron = require('electron');
548
+ var focusedWindow = electron.BrowserWindow.getFocusedWindow();
549
+ if (focusedWindow !== null)
550
+ return focusedWindow;
551
+ var allWindows = electron.BrowserWindow.getAllWindows();
552
+ if (allWindows.length === 0)
553
+ throw new Error();
554
+ return allWindows[0];
555
+ }
556
+ if (OS.iOS === Platform.os) {
557
+ var video = globalThis.document.querySelector('video');
558
+ if (video === null)
559
+ throw new Error();
560
+ return video;
561
+ }
562
+ return globalThis.document.documentElement;
563
+ }
548
564
  function restoreElectronBrowserWindowOptions() {
549
565
  if (lastElectronBrowserWindowOptions !== null) {
550
566
  lastElectronBrowserWindow.fullScreenable = lastElectronBrowserWindowOptions.fullScreenable;
@@ -571,6 +587,9 @@ function createFullscreenUtils() {
571
587
  function emitChange() {
572
588
  emit('fullscreenchange');
573
589
  }
590
+ function emitError() {
591
+ emit('fullscreenerror');
592
+ }
574
593
  if (Platform.isElectron) {
575
594
  try {
576
595
  var electron = require('electron');
@@ -613,9 +632,9 @@ function createFullscreenUtils() {
613
632
  }
614
633
  for (var i = 0; i < errorEvents.length; i++) {
615
634
  if (typeof globalThis.document !== 'undefined')
616
- globalThis.document.addEventListener(errorEvents[i], emitChange, false);
635
+ globalThis.document.addEventListener(errorEvents[i], emitError, false);
617
636
  }
618
- if (isIOS()) {
637
+ if (OS.iOS === Platform.os) {
619
638
  bridgeIOSVideoEvents();
620
639
  if (typeof globalThis.MutationObserver !== 'undefined') {
621
640
  var observer = new MutationObserver(function () {
@@ -651,7 +670,7 @@ function createFullscreenUtils() {
651
670
  }
652
671
  }
653
672
  if (api === null) {
654
- if (!isIOS())
673
+ if (OS.iOS !== Platform.os)
655
674
  return false;
656
675
  var videos = globalThis.document.querySelectorAll('video');
657
676
  for (var i = 0; i < videos.length; i++) {
@@ -698,19 +717,21 @@ function createFullscreenUtils() {
698
717
  return getElement() !== null;
699
718
  }
700
719
  function request(target, options) {
720
+ if (target === void 0) { target = getDefaultTarget(); }
701
721
  if (Platform.isElectron) {
722
+ var browserWindow_1 = target;
702
723
  return new Promise(function (resolve, reject) {
703
724
  try {
704
725
  if (lastElectronBrowserWindow === null) {
705
726
  lastElectronBrowserWindowOptions = {
706
- fullScreenable: target.fullScreenable,
707
- autoHideMenuBar: target.autoHideMenuBar,
727
+ fullScreenable: browserWindow_1.fullScreenable,
728
+ autoHideMenuBar: browserWindow_1.autoHideMenuBar,
708
729
  };
709
- target.fullScreenable = true;
710
- target.autoHideMenuBar = true;
730
+ browserWindow_1.fullScreenable = true;
731
+ browserWindow_1.autoHideMenuBar = true;
711
732
  }
712
- target.setFullScreen(true);
713
- lastElectronBrowserWindow = target;
733
+ browserWindow_1.setFullScreen(true);
734
+ lastElectronBrowserWindow = browserWindow_1;
714
735
  resolve();
715
736
  return;
716
737
  }
@@ -731,7 +752,7 @@ function createFullscreenUtils() {
731
752
  resolve();
732
753
  })
733
754
  .catch(function () {
734
- if (!isIOS()) {
755
+ if (OS.iOS !== Platform.os) {
735
756
  reject();
736
757
  return;
737
758
  }
@@ -745,7 +766,7 @@ function createFullscreenUtils() {
745
766
  }
746
767
  }
747
768
  catch (error) {
748
- if (!isIOS()) {
769
+ if (OS.iOS !== Platform.os) {
749
770
  reject();
750
771
  return;
751
772
  }
@@ -753,7 +774,7 @@ function createFullscreenUtils() {
753
774
  }
754
775
  }
755
776
  function fallbackToIOSVideo() {
756
- if (isIOS() && target.tagName.toUpperCase() === 'VIDEO') {
777
+ if (OS.iOS === Platform.os && target.tagName.toUpperCase() === 'VIDEO') {
757
778
  var video = target;
758
779
  if (video.webkitSupportsFullscreen && typeof video.webkitEnterFullscreen === 'function') {
759
780
  lastIOSVideo = video;
@@ -809,7 +830,7 @@ function createFullscreenUtils() {
809
830
  }
810
831
  }
811
832
  }
812
- if (isIOS() && lastIOSVideo !== null) {
833
+ if (OS.iOS === Platform.os && lastIOSVideo !== null) {
813
834
  if (typeof lastIOSVideo.webkitExitFullscreen === 'function' && lastIOSVideo.webkitDisplayingFullscreen === true) {
814
835
  lastIOSVideo.webkitExitFullscreen();
815
836
  lastIOSVideo = null;