native-fn 1.0.42 → 1.0.43

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 (55) hide show
  1. package/dist/native.cjs +362 -6
  2. package/dist/native.min.cjs +1 -1
  3. package/dist/native.min.mjs +1 -1
  4. package/dist/native.mjs +362 -6
  5. package/dist/native.umd.js +362 -6
  6. package/dist/native.umd.min.js +1 -1
  7. package/dist/plugin/app/index.cjs +262 -98
  8. package/dist/plugin/app/index.min.cjs +1 -1
  9. package/dist/plugin/app/index.min.mjs +1 -1
  10. package/dist/plugin/app/index.mjs +262 -98
  11. package/dist/plugin/app/index.umd.js +262 -98
  12. package/dist/plugin/app/index.umd.min.js +1 -1
  13. package/dist/plugin/app/src/constants/platform.d.ts +3 -13
  14. package/dist/plugin/app/src/types/platform.d.ts +17 -0
  15. package/dist/plugin/app/src/utils/create-hidden-element.d.ts +1 -1
  16. package/dist/plugin/camera/index.cjs +248 -86
  17. package/dist/plugin/camera/index.min.cjs +1 -1
  18. package/dist/plugin/camera/index.min.mjs +1 -1
  19. package/dist/plugin/camera/index.mjs +248 -86
  20. package/dist/plugin/camera/index.umd.js +248 -86
  21. package/dist/plugin/camera/index.umd.min.js +1 -1
  22. package/dist/plugin/camera/src/constants/platform.d.ts +3 -13
  23. package/dist/plugin/camera/src/types/platform.d.ts +17 -0
  24. package/dist/plugin/camera/src/utils/create-hidden-element.d.ts +1 -1
  25. package/dist/plugin/clipboard/index.cjs +6 -0
  26. package/dist/plugin/clipboard/index.min.cjs +1 -1
  27. package/dist/plugin/clipboard/index.min.mjs +1 -1
  28. package/dist/plugin/clipboard/index.mjs +6 -0
  29. package/dist/plugin/clipboard/index.umd.js +6 -0
  30. package/dist/plugin/clipboard/index.umd.min.js +1 -1
  31. package/dist/plugin/clipboard/src/constants/platform.d.ts +3 -13
  32. package/dist/plugin/clipboard/src/types/platform.d.ts +17 -0
  33. package/dist/plugin/clipboard/src/utils/create-hidden-element.d.ts +1 -1
  34. package/dist/plugin/fullscreen/index.cjs +241 -82
  35. package/dist/plugin/fullscreen/index.min.cjs +1 -1
  36. package/dist/plugin/fullscreen/index.min.mjs +1 -1
  37. package/dist/plugin/fullscreen/index.mjs +241 -82
  38. package/dist/plugin/fullscreen/index.umd.js +241 -82
  39. package/dist/plugin/fullscreen/index.umd.min.js +1 -1
  40. package/dist/plugin/fullscreen/src/constants/platform.d.ts +3 -13
  41. package/dist/plugin/fullscreen/src/types/platform.d.ts +17 -0
  42. package/dist/plugin/fullscreen/src/utils/create-hidden-element.d.ts +1 -1
  43. package/dist/plugin/theme/index.cjs +252 -91
  44. package/dist/plugin/theme/index.min.cjs +1 -1
  45. package/dist/plugin/theme/index.min.mjs +1 -1
  46. package/dist/plugin/theme/index.mjs +252 -91
  47. package/dist/plugin/theme/index.umd.js +252 -91
  48. package/dist/plugin/theme/index.umd.min.js +1 -1
  49. package/dist/plugin/theme/src/constants/platform.d.ts +3 -13
  50. package/dist/plugin/theme/src/types/platform.d.ts +17 -0
  51. package/dist/plugin/theme/src/utils/create-hidden-element.d.ts +1 -1
  52. package/dist/src/constants/platform.d.ts +3 -13
  53. package/dist/src/types/platform.d.ts +17 -0
  54. package/dist/src/utils/create-hidden-element.d.ts +1 -1
  55. package/package.json +1 -8
@@ -1 +1 @@
1
- function t(t,e){void 0===e&&(e=!0);var n=globalThis.document.createElement(t);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"),e?(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 e(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r="",o=0;o<e.length-2;o++){var i=e[o];void 0!==i&&(r=r+i.charAt(0).toUpperCase()+i.slice(1))}return r}function n(){this.returnValue=!1}function r(){this.cancelBubble=!0}var o=/(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,i=["","webkit","moz","ms","MS","o","O"],a={wheel:["wheel","mousewheel","DOMMouseScroll"],focus:["focus","focusin"],blur:["blur","focusout"],beforeinput:["beforeinput","textInput"]},l={useStd:void 0!==globalThis.document&&"function"==typeof globalThis.document.addEventListener,add:function(t,e){void 0===e&&(e={callback:null,options:!1});var o=e.callback;if(void 0!==t&&null!==o){var i=l.withVender(t,e.type),a=e.options;if("function"==typeof t.addEventListener)try{return t.addEventListener(i,o,a)}catch(t){}if("function"==typeof t.addListener)if("boolean"==typeof t.matches)try{return t.addListener(o)}catch(t){}else try{return t.addListener(i,o)}catch(t){}return"function"==typeof t.attachEvent?o.__ieWrapper?t.attachEvent("on"+i,o.__ieWrapper):t.attachEvent("on"+i,o.__ieWrapper=function(e){void 0===e&&(e=globalThis.event),void 0!==e&&(e.currentTarget=t,"function"!=typeof e.preventDefault&&(e.preventDefault=n),"function"!=typeof e.stopPropagation&&(e.stopPropagation=r),"function"==typeof o?o.call(t,e):o&&"function"==typeof o.handleEvent&&o.handleEvent.call(t,e))}):void 0}},remove:function(t,e){void 0===e&&(e={callback:null,options:!1});var n=e.callback;if(void 0!==t&&null!==n){var r=l.withVender(t,e.type),o=e.options;if("function"==typeof t.removeEventListener)try{return t.removeEventListener(r,n,o)}catch(t){}if("function"==typeof t.removeListener)if("boolean"==typeof t.matches)try{return t.removeListener(n)}catch(t){}else try{return t.removeListener(r,n)}catch(t){}if("function"!=typeof t.detachEvent);else{var i=n.__ieWrapper;void 0!==i&&(t.detachEvent("on"+r,i),delete n.__ieWrapper)}}},withVender:function(t,n){if(void 0===n)return"";if("webkitEnterFullscreen"in t&&["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"].indexOf(n)>-1)return n;var r;r=n in a?a[n]:o.test(n)?[n,n.replace(o,e)]:[n];for(var l=0;l<i.length;l++)for(var c=0;c<r.length;c++){var u=i[l]+r[c];if(void 0!==t["on"+u])return u}return""}};function c(t){return null!==t&&"object"==typeof t}function u(t){return c(t)||function(t){return Array.isArray(t)}(t)}function s(t){if(function(t){return c(t)&&"innerHTML"in t}(t))return t.innerHTML;if(u(t))try{return JSON.stringify(t)}catch(e){return""+t}else if("string"!=typeof t)return""+t;return t}function d(){return function(){if("isSecureContext"in window)return globalThis.isSecureContext;var t=location.protocol,e=location.hostname;return"https:"===t||"localhost"===e||"127.0.0.1"===e||"[::1]"===e}()&&"undefined"!=typeof navigator&&"clipboard"in navigator}function p(e){return function(e){if(!globalThis.getSelection||!globalThis.document.createRange)return!1;var n=t("div");n.contentEditable="true",n.innerHTML=e,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 r=globalThis.getSelection(),o=globalThis.document.createRange(),i=function(t){try{null!==t.clipboardData&&"function"==typeof t.clipboardData.setData&&(t.preventDefault(),t.clipboardData.setData("text/html",e),t.clipboardData.setData("text/plain",e))}catch(t){}};l.add(globalThis.document,{type:"copy",callback:i,options:{once:!0,capture:!0}});try{if(null===r)return h(n,r,i),!1;r.removeAllRanges(),o.selectNodeContents(n),r.addRange(o);var a=globalThis.document.execCommand("copy");return h(n,r,i),a}catch(t){return h(n,r,i),!1}}(e)||function(t){var e=window.clipboardData;if(void 0!==e&&"function"==typeof e.setData)try{return e.setData("Text",t)}catch(t){return!1}return!1}(e)}function f(){return function(){var e=t("div");e.contentEditable="true",globalThis.document.body.appendChild(e),e.focus();var n=null,r=function(t){try{null!==t.clipboardData&&"function"==typeof t.clipboardData.getData&&(t.preventDefault(),n=t.clipboardData.getData("text/html")||t.clipboardData.getData("text/plain")||null)}catch(t){}};l.add(globalThis.document,{type:"paste",callback:r,options:{once:!0,capture:!0}});try{return globalThis.document.execCommand("paste")||n||(n=e.innerHTML||e.textContent||null),v(e,r),n}catch(t){return v(e,r),null}}()||function(){var t=window.clipboardData;if(void 0!==t&&"function"==typeof t.getData)try{return t.getData("Text")||null}catch(t){return null}return null}()||""}function h(t,e,n){null!==e&&e.removeAllRanges(),globalThis.document.body.removeChild(t),l.remove(globalThis.document,{type:"copy",callback:n})}function v(t,e){globalThis.document.body.removeChild(t),l.remove(globalThis.document,{type:"paste",callback:e})}var b={installed:!1,name:"Clipboard",module:{copy:function(t){var e=s(t);return d()&&("write"in navigator.clipboard||"writeText"in navigator.clipboard)?function(t){try{if("ClipboardItem"in window&&"write"in navigator.clipboard)return navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([t],{type:"text/html"}),"text/plain":new Blob([t],{type:"text/plain"})})]).then((function(){return!0})).catch((function(){return!1}));if("writeText"in navigator.clipboard)return navigator.clipboard.writeText(t).then((function(){return!0})).catch((function(){return!1}))}catch(t){return Promise.resolve(!1)}return Promise.resolve(!1)}(e).then((function(t){return!!t||p(e)})).catch((function(){return p(e)})):Promise.resolve(p(e))},paste:function(){return d()&&("read"in navigator.clipboard||"readText"in navigator.clipboard)?function(){try{if("ClipboardItem"in window&&"read"in navigator.clipboard)return navigator.clipboard.read().then((function(t){if(0===t.length)return Promise.resolve(null);for(var e=t[0],n=e.types,r=0;r<n.length;r++)if("text/html"===n[r])return e.getType("text/html").then((function(t){return t.text()})).catch((function(){return null}));for(r=0;r<n.length;r++)if("text/plain"===n[r])return e.getType("text/plain").then((function(t){return t.text()})).catch((function(){return null}));return Promise.resolve(null)})).catch((function(){return null}));if("readText"in navigator.clipboard)return navigator.clipboard.readText().then((function(t){return t})).catch((function(){return null}))}catch(t){return Promise.resolve(null)}return Promise.resolve(null)}().then((function(t){return null!==t?t:f()})).catch((function(){return f()})):Promise.resolve(f())}},Constants:{},Errors:{}};export{b as default};
1
+ function t(t,e){if(void 0===e&&(e=!0),void 0!==globalThis.document){var n=globalThis.document.createElement(t);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"),e?(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 e(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r="",o=0;o<e.length-2;o++){var i=e[o];void 0!==i&&(r=r+i.charAt(0).toUpperCase()+i.slice(1))}return r}function n(){this.returnValue=!1}function r(){this.cancelBubble=!0}var o=/(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,i=["","webkit","moz","ms","MS","o","O"],a={wheel:["wheel","mousewheel","DOMMouseScroll"],focus:["focus","focusin"],blur:["blur","focusout"],beforeinput:["beforeinput","textInput"]},l={useStd:void 0!==globalThis.document&&"function"==typeof globalThis.document.addEventListener,add:function(t,e){void 0===e&&(e={callback:null,options:!1});var o=e.callback;if(void 0!==t&&null!==o){var i=l.withVender(t,e.type),a=e.options;if("function"==typeof t.addEventListener)try{return t.addEventListener(i,o,a)}catch(t){}if("function"==typeof t.addListener)if("boolean"==typeof t.matches)try{return t.addListener(o)}catch(t){}else try{return t.addListener(i,o)}catch(t){}return"function"==typeof t.attachEvent?o.__ieWrapper?t.attachEvent("on"+i,o.__ieWrapper):t.attachEvent("on"+i,o.__ieWrapper=function(e){void 0===e&&(e=globalThis.event),void 0!==e&&(e.currentTarget=t,"function"!=typeof e.preventDefault&&(e.preventDefault=n),"function"!=typeof e.stopPropagation&&(e.stopPropagation=r),"function"==typeof o?o.call(t,e):o&&"function"==typeof o.handleEvent&&o.handleEvent.call(t,e))}):void 0}},remove:function(t,e){void 0===e&&(e={callback:null,options:!1});var n=e.callback;if(void 0!==t&&null!==n){var r=l.withVender(t,e.type),o=e.options;if("function"==typeof t.removeEventListener)try{return t.removeEventListener(r,n,o)}catch(t){}if("function"==typeof t.removeListener)if("boolean"==typeof t.matches)try{return t.removeListener(n)}catch(t){}else try{return t.removeListener(r,n)}catch(t){}if("function"!=typeof t.detachEvent);else{var i=n.__ieWrapper;void 0!==i&&(t.detachEvent("on"+r,i),delete n.__ieWrapper)}}},withVender:function(t,n){if(void 0===n)return"";if("webkitEnterFullscreen"in t&&["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"].indexOf(n)>-1)return n;var r;r=n in a?a[n]:o.test(n)?[n,n.replace(o,e)]:[n];for(var l=0;l<i.length;l++)for(var c=0;c<r.length;c++){var u=i[l]+r[c];if(void 0!==t["on"+u])return u}return""}};function c(t){return null!==t&&"object"==typeof t}function u(t){return c(t)||function(t){return Array.isArray(t)}(t)}function s(t){if(function(t){return c(t)&&"innerHTML"in t}(t))return t.innerHTML;if(u(t))try{return JSON.stringify(t)}catch(e){return""+t}else if("string"!=typeof t)return""+t;return t}function d(){return function(){if("isSecureContext"in window)return globalThis.isSecureContext;var t=location.protocol,e=location.hostname;return"https:"===t||"localhost"===e||"127.0.0.1"===e||"[::1]"===e}()&&"undefined"!=typeof navigator&&"clipboard"in navigator}function p(e){return function(e){if(!globalThis.getSelection||!globalThis.document.createRange)return!1;var n=t("div");if(void 0===n)return!1;n.contentEditable="true",n.innerHTML=e,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 r=globalThis.getSelection(),o=globalThis.document.createRange(),i=function(t){try{null!==t.clipboardData&&"function"==typeof t.clipboardData.setData&&(t.preventDefault(),t.clipboardData.setData("text/html",e),t.clipboardData.setData("text/plain",e))}catch(t){}};l.add(globalThis.document,{type:"copy",callback:i,options:{once:!0,capture:!0}});try{if(null===r)return h(n,r,i),!1;r.removeAllRanges(),o.selectNodeContents(n),r.addRange(o);var a=globalThis.document.execCommand("copy");return h(n,r,i),a}catch(t){return h(n,r,i),!1}}(e)||function(t){var e=window.clipboardData;if(void 0!==e&&"function"==typeof e.setData)try{return e.setData("Text",t)}catch(t){return!1}return!1}(e)}function f(){return function(){var e=t("div");if(void 0===e)return null;e.contentEditable="true",globalThis.document.body.appendChild(e),e.focus();var n=null,r=function(t){try{null!==t.clipboardData&&"function"==typeof t.clipboardData.getData&&(t.preventDefault(),n=t.clipboardData.getData("text/html")||t.clipboardData.getData("text/plain")||null)}catch(t){}};l.add(globalThis.document,{type:"paste",callback:r,options:{once:!0,capture:!0}});try{return globalThis.document.execCommand("paste")||n||(n=e.innerHTML||e.textContent||null),v(e,r),n}catch(t){return v(e,r),null}}()||function(){var t=window.clipboardData;if(void 0!==t&&"function"==typeof t.getData)try{return t.getData("Text")||null}catch(t){return null}return null}()||""}function h(t,e,n){null!==e&&e.removeAllRanges(),globalThis.document.body.removeChild(t),l.remove(globalThis.document,{type:"copy",callback:n})}function v(t,e){globalThis.document.body.removeChild(t),l.remove(globalThis.document,{type:"paste",callback:e})}var b={installed:!1,name:"Clipboard",module:{copy:function(t){var e=s(t);return d()&&("write"in navigator.clipboard||"writeText"in navigator.clipboard)?function(t){try{if("ClipboardItem"in window&&"write"in navigator.clipboard)return navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([t],{type:"text/html"}),"text/plain":new Blob([t],{type:"text/plain"})})]).then((function(){return!0})).catch((function(){return!1}));if("writeText"in navigator.clipboard)return navigator.clipboard.writeText(t).then((function(){return!0})).catch((function(){return!1}))}catch(t){return Promise.resolve(!1)}return Promise.resolve(!1)}(e).then((function(t){return!!t||p(e)})).catch((function(){return p(e)})):Promise.resolve(p(e))},paste:function(){return d()&&("read"in navigator.clipboard||"readText"in navigator.clipboard)?function(){try{if("ClipboardItem"in window&&"read"in navigator.clipboard)return navigator.clipboard.read().then((function(t){if(0===t.length)return Promise.resolve(null);for(var e=t[0],n=e.types,r=0;r<n.length;r++)if("text/html"===n[r])return e.getType("text/html").then((function(t){return t.text()})).catch((function(){return null}));for(r=0;r<n.length;r++)if("text/plain"===n[r])return e.getType("text/plain").then((function(t){return t.text()})).catch((function(){return null}));return Promise.resolve(null)})).catch((function(){return null}));if("readText"in navigator.clipboard)return navigator.clipboard.readText().then((function(t){return t})).catch((function(){return null}))}catch(t){return Promise.resolve(null)}return Promise.resolve(null)}().then((function(t){return null!==t?t:f()})).catch((function(){return f()})):Promise.resolve(f())}},Constants:{},Errors:{}};export{b as default};
@@ -1,5 +1,7 @@
1
1
  function createHiddenElement(tagName, focusable) {
2
2
  if (focusable === void 0) { focusable = true; }
3
+ if (typeof globalThis.document === 'undefined')
4
+ return undefined;
3
5
  var element = globalThis.document.createElement(tagName);
4
6
  if ('width' in element)
5
7
  element.width = '0';
@@ -291,6 +293,8 @@ function copyViaSelection(text) {
291
293
  if (!globalThis.getSelection || !globalThis.document.createRange)
292
294
  return false;
293
295
  var div = createHiddenElement('div');
296
+ if (div === undefined)
297
+ return false;
294
298
  div.contentEditable = 'true';
295
299
  div.innerHTML = text;
296
300
  div.style.whiteSpace = 'pre';
@@ -414,6 +418,8 @@ function pasteViaClipboardAPI() {
414
418
  }
415
419
  function pasteViaSelection() {
416
420
  var div = createHiddenElement('div');
421
+ if (div === undefined)
422
+ return null;
417
423
  div.contentEditable = 'true';
418
424
  globalThis.document.body.appendChild(div);
419
425
  div.focus();
@@ -6,6 +6,8 @@
6
6
 
7
7
  function createHiddenElement(tagName, focusable) {
8
8
  if (focusable === void 0) { focusable = true; }
9
+ if (typeof globalThis.document === 'undefined')
10
+ return undefined;
9
11
  var element = globalThis.document.createElement(tagName);
10
12
  if ('width' in element)
11
13
  element.width = '0';
@@ -297,6 +299,8 @@
297
299
  if (!globalThis.getSelection || !globalThis.document.createRange)
298
300
  return false;
299
301
  var div = createHiddenElement('div');
302
+ if (div === undefined)
303
+ return false;
300
304
  div.contentEditable = 'true';
301
305
  div.innerHTML = text;
302
306
  div.style.whiteSpace = 'pre';
@@ -420,6 +424,8 @@
420
424
  }
421
425
  function pasteViaSelection() {
422
426
  var div = createHiddenElement('div');
427
+ if (div === undefined)
428
+ return null;
423
429
  div.contentEditable = 'true';
424
430
  globalThis.document.body.appendChild(div);
425
431
  div.focus();
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Clipboard=t()}(this,(function(){"use strict";function e(e,t){void 0===t&&(t=!0);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"),t?(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 t(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r="",o=0;o<t.length-2;o++){var i=t[o];void 0!==i&&(r=r+i.charAt(0).toUpperCase()+i.slice(1))}return r}function n(){this.returnValue=!1}function r(){this.cancelBubble=!0}var o=/(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,i=["","webkit","moz","ms","MS","o","O"],a={wheel:["wheel","mousewheel","DOMMouseScroll"],focus:["focus","focusin"],blur:["blur","focusout"],beforeinput:["beforeinput","textInput"]},l={useStd:void 0!==globalThis.document&&"function"==typeof globalThis.document.addEventListener,add:function(e,t){void 0===t&&(t={callback:null,options:!1});var o=t.callback;if(void 0!==e&&null!==o){var i=l.withVender(e,t.type),a=t.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(t){void 0===t&&(t=globalThis.event),void 0!==t&&(t.currentTarget=e,"function"!=typeof t.preventDefault&&(t.preventDefault=n),"function"!=typeof t.stopPropagation&&(t.stopPropagation=r),"function"==typeof o?o.call(e,t):o&&"function"==typeof o.handleEvent&&o.handleEvent.call(e,t))}):void 0}},remove:function(e,t){void 0===t&&(t={callback:null,options:!1});var n=t.callback;if(void 0!==e&&null!==n){var r=l.withVender(e,t.type),o=t.options;if("function"==typeof e.removeEventListener)try{return e.removeEventListener(r,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(r,n)}catch(e){}if("function"!=typeof e.detachEvent);else{var i=n.__ieWrapper;void 0!==i&&(e.detachEvent("on"+r,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 r;r=n in a?a[n]:o.test(n)?[n,n.replace(o,t)]:[n];for(var l=0;l<i.length;l++)for(var c=0;c<r.length;c++){var u=i[l]+r[c];if(void 0!==e["on"+u])return u}return""}};function c(e){return null!==e&&"object"==typeof e}function u(e){return c(e)||function(e){return Array.isArray(e)}(e)}function s(e){if(function(e){return c(e)&&"innerHTML"in e}(e))return e.innerHTML;if(u(e))try{return JSON.stringify(e)}catch(t){return""+e}else if("string"!=typeof e)return""+e;return e}function d(){return function(){if("isSecureContext"in window)return globalThis.isSecureContext;var e=location.protocol,t=location.hostname;return"https:"===e||"localhost"===t||"127.0.0.1"===t||"[::1]"===t}()&&"undefined"!=typeof navigator&&"clipboard"in navigator}function f(t){return function(t){if(!globalThis.getSelection||!globalThis.document.createRange)return!1;var n=e("div");n.contentEditable="true",n.innerHTML=t,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 r=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",t),e.clipboardData.setData("text/plain",t))}catch(e){}};l.add(globalThis.document,{type:"copy",callback:i,options:{once:!0,capture:!0}});try{if(null===r)return h(n,r,i),!1;r.removeAllRanges(),o.selectNodeContents(n),r.addRange(o);var a=globalThis.document.execCommand("copy");return h(n,r,i),a}catch(e){return h(n,r,i),!1}}(t)||function(e){var t=window.clipboardData;if(void 0!==t&&"function"==typeof t.setData)try{return t.setData("Text",e)}catch(e){return!1}return!1}(t)}function p(){return function(){var t=e("div");t.contentEditable="true",globalThis.document.body.appendChild(t),t.focus();var n=null,r=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){}};l.add(globalThis.document,{type:"paste",callback:r,options:{once:!0,capture:!0}});try{return globalThis.document.execCommand("paste")||n||(n=t.innerHTML||t.textContent||null),v(t,r),n}catch(e){return v(t,r),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 h(e,t,n){null!==t&&t.removeAllRanges(),globalThis.document.body.removeChild(e),l.remove(globalThis.document,{type:"copy",callback:n})}function v(e,t){globalThis.document.body.removeChild(e),l.remove(globalThis.document,{type:"paste",callback:t})}return{installed:!1,name:"Clipboard",module:{copy:function(e){var t=s(e);return d()&&("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)}(t).then((function(e){return!!e||f(t)})).catch((function(){return f(t)})):Promise.resolve(f(t))},paste:function(){return d()&&("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 t=e[0],n=t.types,r=0;r<n.length;r++)if("text/html"===n[r])return t.getType("text/html").then((function(e){return e.text()})).catch((function(){return null}));for(r=0;r<n.length;r++)if("text/plain"===n[r])return t.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:p()})).catch((function(){return p()})):Promise.resolve(p())}},Constants:{},Errors:{}}}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Clipboard=t()}(this,(function(){"use strict";function e(e,t){if(void 0===t&&(t=!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"),t?(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 t(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r="",o=0;o<t.length-2;o++){var i=t[o];void 0!==i&&(r=r+i.charAt(0).toUpperCase()+i.slice(1))}return r}function n(){this.returnValue=!1}function r(){this.cancelBubble=!0}var o=/(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,i=["","webkit","moz","ms","MS","o","O"],a={wheel:["wheel","mousewheel","DOMMouseScroll"],focus:["focus","focusin"],blur:["blur","focusout"],beforeinput:["beforeinput","textInput"]},l={useStd:void 0!==globalThis.document&&"function"==typeof globalThis.document.addEventListener,add:function(e,t){void 0===t&&(t={callback:null,options:!1});var o=t.callback;if(void 0!==e&&null!==o){var i=l.withVender(e,t.type),a=t.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(t){void 0===t&&(t=globalThis.event),void 0!==t&&(t.currentTarget=e,"function"!=typeof t.preventDefault&&(t.preventDefault=n),"function"!=typeof t.stopPropagation&&(t.stopPropagation=r),"function"==typeof o?o.call(e,t):o&&"function"==typeof o.handleEvent&&o.handleEvent.call(e,t))}):void 0}},remove:function(e,t){void 0===t&&(t={callback:null,options:!1});var n=t.callback;if(void 0!==e&&null!==n){var r=l.withVender(e,t.type),o=t.options;if("function"==typeof e.removeEventListener)try{return e.removeEventListener(r,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(r,n)}catch(e){}if("function"!=typeof e.detachEvent);else{var i=n.__ieWrapper;void 0!==i&&(e.detachEvent("on"+r,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 r;r=n in a?a[n]:o.test(n)?[n,n.replace(o,t)]:[n];for(var l=0;l<i.length;l++)for(var c=0;c<r.length;c++){var u=i[l]+r[c];if(void 0!==e["on"+u])return u}return""}};function c(e){return null!==e&&"object"==typeof e}function u(e){return c(e)||function(e){return Array.isArray(e)}(e)}function s(e){if(function(e){return c(e)&&"innerHTML"in e}(e))return e.innerHTML;if(u(e))try{return JSON.stringify(e)}catch(t){return""+e}else if("string"!=typeof e)return""+e;return e}function d(){return function(){if("isSecureContext"in window)return globalThis.isSecureContext;var e=location.protocol,t=location.hostname;return"https:"===e||"localhost"===t||"127.0.0.1"===t||"[::1]"===t}()&&"undefined"!=typeof navigator&&"clipboard"in navigator}function f(t){return function(t){if(!globalThis.getSelection||!globalThis.document.createRange)return!1;var n=e("div");if(void 0===n)return!1;n.contentEditable="true",n.innerHTML=t,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 r=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",t),e.clipboardData.setData("text/plain",t))}catch(e){}};l.add(globalThis.document,{type:"copy",callback:i,options:{once:!0,capture:!0}});try{if(null===r)return h(n,r,i),!1;r.removeAllRanges(),o.selectNodeContents(n),r.addRange(o);var a=globalThis.document.execCommand("copy");return h(n,r,i),a}catch(e){return h(n,r,i),!1}}(t)||function(e){var t=window.clipboardData;if(void 0!==t&&"function"==typeof t.setData)try{return t.setData("Text",e)}catch(e){return!1}return!1}(t)}function p(){return function(){var t=e("div");if(void 0===t)return null;t.contentEditable="true",globalThis.document.body.appendChild(t),t.focus();var n=null,r=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){}};l.add(globalThis.document,{type:"paste",callback:r,options:{once:!0,capture:!0}});try{return globalThis.document.execCommand("paste")||n||(n=t.innerHTML||t.textContent||null),v(t,r),n}catch(e){return v(t,r),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 h(e,t,n){null!==t&&t.removeAllRanges(),globalThis.document.body.removeChild(e),l.remove(globalThis.document,{type:"copy",callback:n})}function v(e,t){globalThis.document.body.removeChild(e),l.remove(globalThis.document,{type:"paste",callback:t})}return{installed:!1,name:"Clipboard",module:{copy:function(e){var t=s(e);return d()&&("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)}(t).then((function(e){return!!e||f(t)})).catch((function(){return f(t)})):Promise.resolve(f(t))},paste:function(){return d()&&("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 t=e[0],n=t.types,r=0;r<n.length;r++)if("text/html"===n[r])return t.getType("text/html").then((function(e){return e.text()})).catch((function(){return null}));for(r=0;r<n.length;r++)if("text/plain"===n[r])return t.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:p()})).catch((function(){return p()})):Promise.resolve(p())}},Constants:{},Errors:{}}}));
@@ -1,3 +1,4 @@
1
+ import { PlatformInstance } from "../types/platform";
1
2
  declare global {
2
3
  interface Navigator {
3
4
  userAgentData?: UserAgentData;
@@ -51,16 +52,5 @@ export declare enum Browsers {
51
52
  IE = "IE",
52
53
  SamsungInternet = "SamsungInternet"
53
54
  }
54
- export declare let DEVICE_NAME: Devices;
55
- export declare let OS_NAME: OS;
56
- export declare let OS_VERSION: string;
57
- export declare let ENGINE_NAME: Engines;
58
- export declare let ENGINE_VERSION: string;
59
- export declare let BROWSER_NAME: Browsers;
60
- export declare let BROWSER_VERSION: string;
61
- export declare const RENDERER: string;
62
- export declare const IS_WEBVIEW: boolean;
63
- export declare const IS_MOBILE: boolean;
64
- export declare const IS_DESKTOP: boolean;
65
- export declare const IS_STANDALONE: boolean;
66
- export {};
55
+ declare const Platform: PlatformInstance;
56
+ export default Platform;
@@ -0,0 +1,17 @@
1
+ import { Browsers, Devices, Engines, OS } from "../constants/platform";
2
+ export declare interface PlatformInstance {
3
+ os: OS;
4
+ device: Devices;
5
+ engine: Engines;
6
+ browser: Browsers;
7
+ osVersion: string;
8
+ engineVersion: string;
9
+ browserVersion: string;
10
+ renderer: string;
11
+ userAgent: string;
12
+ isWebview: boolean;
13
+ isStandalone: boolean;
14
+ isMobile: boolean;
15
+ isDesktop: boolean;
16
+ isNodeJS: boolean;
17
+ }
@@ -1 +1 @@
1
- export default function createHiddenElement<K extends keyof HTMLElementTagNameMap>(tagName: K, focusable?: boolean): HTMLElementTagNameMap[K];
1
+ export default function createHiddenElement<K extends keyof HTMLElementTagNameMap>(tagName: K, focusable?: boolean): HTMLElementTagNameMap[K] | undefined;
@@ -1,6 +1,22 @@
1
1
  'use strict';
2
2
 
3
- var USER_AGENT = navigator.userAgent;
3
+ function dynamicImport(moduleName) {
4
+ if ('require' in globalThis && typeof globalThis.require === 'function') {
5
+ try {
6
+ return Promise.resolve(globalThis.require(moduleName));
7
+ }
8
+ catch (_) {
9
+ return Promise.resolve(null);
10
+ }
11
+ }
12
+ return import(moduleName)
13
+ .then(function (module) {
14
+ return (module.default || module);
15
+ })
16
+ .catch(function () {
17
+ return Promise.resolve(null);
18
+ });
19
+ }
4
20
 
5
21
  var OS;
6
22
  (function (OS) {
@@ -41,42 +57,22 @@ var Browsers;
41
57
  Browsers["IE"] = "IE";
42
58
  Browsers["SamsungInternet"] = "SamsungInternet";
43
59
  })(Browsers || (Browsers = {}));
44
- function resolveWindowsVersion(string) {
45
- if (string === undefined)
46
- return '';
47
- var mapped = {
48
- '4.90': 'ME',
49
- 'NT3.51': 'NT 3.11',
50
- 'NT4.0': 'NT 4.0',
51
- 'NT 5.0': '2000',
52
- 'NT 5.1': 'XP',
53
- 'NT 5.2': 'XP',
54
- 'NT 6.0': 'Vista',
55
- 'NT 6.1': '7',
56
- 'NT 6.2': '8',
57
- 'NT 6.3': '8.1',
58
- 'NT 6.4': '10',
59
- 'NT 10.0': '10',
60
- 'ARM': 'RT'
61
- }[string];
62
- if (mapped !== undefined)
63
- return mapped;
64
- return string;
65
- }
66
- function resolveUnderscoreVersion(string) {
67
- if (string === undefined)
68
- return '';
69
- return string.replace(/_/g, '.');
70
- }
71
- function resolveVersion(string, resolver) {
72
- if (typeof resolver === 'function')
73
- return resolver(string);
74
- if (typeof resolver === 'string')
75
- return resolver;
76
- if (string === undefined)
77
- return '';
78
- return string;
79
- }
60
+ var Platform = {
61
+ device: Devices.Unknown,
62
+ os: OS.Unknown,
63
+ osVersion: '',
64
+ engine: Engines.Unknown,
65
+ engineVersion: '',
66
+ browser: Browsers.Unknown,
67
+ browserVersion: '',
68
+ renderer: getRenderer(),
69
+ userAgent: navigator.userAgent,
70
+ isWebview: false,
71
+ isMobile: false,
72
+ isDesktop: false,
73
+ isStandalone: false,
74
+ isNodeJS: getIsNode(),
75
+ };
80
76
  var OS_RESOLVER_MAP = [
81
77
  [/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
82
78
  [/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i, OS.Windows, resolveWindowsVersion],
@@ -135,77 +131,240 @@ var BROWSER_RESOLVER_MAP = [
135
131
  [/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
136
132
  [/firefox\/([\w.]+)/i, Browsers.Firefox],
137
133
  ];
138
- var DEVICE_NAME = Devices.Unknown;
139
- var OS_NAME = OS.Unknown;
140
- Engines.Unknown;
141
- Browsers.Unknown;
134
+ function resolveWindowsVersion(string) {
135
+ if (string === undefined)
136
+ return '';
137
+ var mapped = {
138
+ '4.90': 'ME',
139
+ 'NT3.51': 'NT 3.11',
140
+ 'NT4.0': 'NT 4.0',
141
+ 'NT 5.0': '2000',
142
+ 'NT 5.1': 'XP',
143
+ 'NT 5.2': 'XP',
144
+ 'NT 6.0': 'Vista',
145
+ 'NT 6.1': '7',
146
+ 'NT 6.2': '8',
147
+ 'NT 6.3': '8.1',
148
+ 'NT 6.4': '10',
149
+ 'NT 10.0': '10',
150
+ 'ARM': 'RT'
151
+ }[string];
152
+ if (mapped !== undefined)
153
+ return mapped;
154
+ return string;
155
+ }
156
+ function resolveUnderscoreVersion(string) {
157
+ if (string === undefined)
158
+ return '';
159
+ return string.replace(/_/g, '.');
160
+ }
161
+ function resolveVersion(string, resolver) {
162
+ if (typeof resolver === 'function')
163
+ return resolver(string);
164
+ if (typeof resolver === 'string')
165
+ return resolver;
166
+ if (string === undefined)
167
+ return '';
168
+ return string;
169
+ }
170
+ function normalizeBrand(entry) {
171
+ if (entry === null || entry === undefined)
172
+ return { brand: '', version: '' };
173
+ if (typeof entry === 'string')
174
+ return { brand: entry, version: '' };
175
+ return { brand: entry.brand, version: entry.version };
176
+ }
177
+ function getRenderer() {
178
+ if (typeof globalThis.document === 'undefined')
179
+ return '';
180
+ var canvas = globalThis.document.createElement('canvas');
181
+ if (typeof canvas.getContext !== 'function')
182
+ return '';
183
+ var context = canvas.getContext('webgl2') || canvas.getContext('experimental-webgl') || canvas.getContext('webgl');
184
+ if (context === null)
185
+ return '';
186
+ if (context instanceof WebGLRenderingContext || 'getParameter' in context && typeof context.getParameter === 'function') {
187
+ var extension = context.getExtension('WEBGL_debug_renderer_info');
188
+ if (extension === null)
189
+ return context.getParameter(context.RENDERER);
190
+ else
191
+ return context.getParameter(extension.UNMASKED_RENDERER_WEBGL);
192
+ }
193
+ else {
194
+ return '';
195
+ }
196
+ }
197
+ function getIsStandalone(os) {
198
+ if (!('matchMedia' in globalThis))
199
+ return false;
200
+ if (os === OS.iOS)
201
+ return 'standalone' in navigator && !!navigator.standalone;
202
+ return globalThis.matchMedia('(display-mode: standalone)').matches;
203
+ }
204
+ function getIsWebview() {
205
+ return /; ?wv|applewebkit(?!.*safari)/i.test(Platform.userAgent);
206
+ }
207
+ function getIsNode() {
208
+ return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
209
+ }
210
+ function getNodeOSVersion(string) {
211
+ var parts = string.split('.');
212
+ return {
213
+ major: parseInt(parts[0] || '0'),
214
+ minor: parseInt(parts[1] || '0'),
215
+ build: parseInt(parts[2] || '0')
216
+ };
217
+ }
142
218
  for (var i = 0; i < OS_RESOLVER_MAP.length; i++) {
143
219
  var map = OS_RESOLVER_MAP[i];
144
220
  var regexp = map[0];
145
221
  var os = map[1];
146
222
  var resolver = map[2];
147
- var matched = USER_AGENT.match(regexp);
223
+ var matched = Platform.userAgent.match(regexp);
148
224
  if (matched !== null) {
149
- OS_NAME = os;
150
- resolveVersion(matched[1], resolver);
225
+ Platform.os = os;
226
+ Platform.osVersion = resolveVersion(matched[1], resolver);
151
227
  if (os === OS.iOS || os === OS.Android)
152
- DEVICE_NAME = Devices.Mobile;
228
+ Platform.device = Devices.Mobile;
153
229
  else if (os === OS.Windows || os === OS.MacOS)
154
- DEVICE_NAME = Devices.Desktop;
230
+ Platform.device = Devices.Desktop;
155
231
  break;
156
232
  }
157
233
  }
158
234
  for (var i = 0; i < ENGINE_RESOLVER_MAP.length; i++) {
159
235
  var map = ENGINE_RESOLVER_MAP[i];
160
236
  var regexp = map[0];
161
- map[1];
237
+ var engine = map[1];
162
238
  var resolver = map[2];
163
- var matched = USER_AGENT.match(regexp);
239
+ var matched = Platform.userAgent.match(regexp);
164
240
  if (matched !== null) {
165
- resolveVersion(matched[1], resolver);
241
+ Platform.engine = engine;
242
+ Platform.engineVersion = resolveVersion(matched[1], resolver);
166
243
  break;
167
244
  }
168
245
  }
169
246
  for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
170
247
  var map = BROWSER_RESOLVER_MAP[i];
171
248
  var regexp = map[0];
172
- map[1];
249
+ var browser = map[1];
173
250
  var resolver = map[2];
174
- var matched = USER_AGENT.match(regexp);
251
+ var matched = Platform.userAgent.match(regexp);
175
252
  if (matched !== null) {
176
- resolveVersion(matched[1], resolver);
253
+ Platform.browser = browser;
254
+ Platform.browserVersion = resolveVersion(matched[1], resolver);
177
255
  break;
178
256
  }
179
257
  }
180
- ((function () {
181
- if (typeof globalThis.document === 'undefined')
182
- return '';
183
- var canvas = globalThis.document.createElement('canvas');
184
- if (typeof canvas.getContext !== 'function')
185
- return '';
186
- var context = canvas.getContext('webgl2') || canvas.getContext('experimental-webgl') || canvas.getContext('webgl');
187
- if (context === null)
188
- return '';
189
- if (context instanceof WebGLRenderingContext || 'getParameter' in context && typeof context.getParameter === 'function') {
190
- var extension = context.getExtension('WEBGL_debug_renderer_info');
191
- if (extension === null)
192
- return context.getParameter(context.RENDERER);
193
- else
194
- return context.getParameter(extension.UNMASKED_RENDERER_WEBGL);
195
- }
196
- else {
197
- return '';
198
- }
199
- }))();
200
- DEVICE_NAME === Devices.Mobile;
201
- DEVICE_NAME === Devices.Desktop;
202
- ((function () {
203
- if (!('matchMedia' in globalThis))
204
- return false;
205
- if (OS_NAME === OS.iOS)
206
- return 'standalone' in navigator && !!navigator.standalone;
207
- return globalThis.matchMedia('(display-mode: standalone)').matches;
208
- }))();
258
+ if (Platform.isNodeJS) {
259
+ dynamicImport('os')
260
+ .then(function (os) {
261
+ if (os === null)
262
+ return;
263
+ var platform = os.platform();
264
+ var release = os.release();
265
+ var version = getNodeOSVersion(release);
266
+ switch (platform) {
267
+ case 'win32':
268
+ Platform.os = OS.Windows;
269
+ if (version.major === 10 && version.minor === 0 && version.build >= 22000)
270
+ Platform.osVersion = '11';
271
+ else if (version.major === 10 && version.minor === 0 && version.build < 22000)
272
+ Platform.osVersion = '10';
273
+ else if (version.major === 6 && version.minor === 3)
274
+ Platform.osVersion = '8.1';
275
+ else if (version.major === 6 && version.minor === 2)
276
+ Platform.osVersion = '8';
277
+ else if (version.major === 6 && version.minor === 1)
278
+ Platform.osVersion = '7';
279
+ else if (version.major === 6 && version.minor === 0)
280
+ Platform.osVersion = 'Vista';
281
+ else if (version.major === 5 && version.minor === 1)
282
+ Platform.osVersion = 'XP';
283
+ else if (version.major === 5 && version.minor === 2)
284
+ Platform.osVersion = 'XP';
285
+ else if (version.major === 5 && version.minor === 0)
286
+ Platform.osVersion = '2000';
287
+ else if (version.major === 4 && version.minor === 90)
288
+ Platform.osVersion = 'ME';
289
+ else if (version.major === 4 && version.minor === 0)
290
+ Platform.osVersion = 'NT 4.0';
291
+ else if (version.major === 3 && version.minor === 51)
292
+ Platform.osVersion = 'NT 3.11';
293
+ else
294
+ Platform.osVersion = release;
295
+ break;
296
+ case 'darwin':
297
+ Platform.os = OS.MacOS;
298
+ if (version.major >= 24)
299
+ Platform.osVersion = '' + (version.major - 9);
300
+ else if (version.major === 23)
301
+ Platform.osVersion = '14';
302
+ else if (version.major === 22)
303
+ Platform.osVersion = '13';
304
+ else if (version.major === 21)
305
+ Platform.osVersion = '12';
306
+ else if (version.major === 20)
307
+ Platform.osVersion = '11';
308
+ else if (version.major === 19)
309
+ Platform.osVersion = '10.15';
310
+ else if (version.major === 18)
311
+ Platform.osVersion = '10.14';
312
+ else if (version.major === 17)
313
+ Platform.osVersion = '10.13';
314
+ else if (version.major === 16)
315
+ Platform.osVersion = '10.12';
316
+ else if (version.major === 15)
317
+ Platform.osVersion = '10.11';
318
+ else if (version.major === 14)
319
+ Platform.osVersion = '10.10';
320
+ else if (version.major === 13)
321
+ Platform.osVersion = '10.9';
322
+ else if (version.major >= 5 && version.major <= 12)
323
+ Platform.osVersion = '10.' + (version.major - 4);
324
+ else
325
+ Platform.osVersion = release;
326
+ break;
327
+ case 'android':
328
+ Platform.os = OS.Android;
329
+ Platform.osVersion = release;
330
+ break;
331
+ case 'linux':
332
+ if (/android/i.test(release)) {
333
+ Platform.os = OS.Android;
334
+ Platform.osVersion = release;
335
+ }
336
+ break;
337
+ }
338
+ });
339
+ }
340
+ if (navigator.userAgentData !== undefined && navigator.userAgentData.getHighEntropyValues !== undefined) {
341
+ navigator
342
+ .userAgentData
343
+ .getHighEntropyValues(['brands', 'fullVersionList', 'mobile', 'model', 'platform', 'platformVersion', 'architecture', 'formFactors', 'bitness', 'uaFullVersion', 'wow64'])
344
+ .then(function (result) {
345
+ var brands = result.fullVersionList || result.brands || [];
346
+ var platformVersion = result.platformVersion;
347
+ for (var i = 0; i < brands.length; i++) {
348
+ var brand = normalizeBrand(brands[i]);
349
+ var brandName = brand.brand;
350
+ var brandVersion = brand.version;
351
+ if (/not.a.brand/i.test(brandName))
352
+ continue;
353
+ if (brandName === "Chromium")
354
+ Platform.engineVersion = brandVersion;
355
+ }
356
+ if (typeof platformVersion === 'string') {
357
+ if (Platform.os === OS.Windows && parseInt(platformVersion.replace(/[^\d.]/g, '').split('.')[0], 10) >= 13)
358
+ Platform.osVersion = '11';
359
+ else
360
+ Platform.osVersion = platformVersion;
361
+ }
362
+ });
363
+ }
364
+ Platform.isMobile = Platform.device === Devices.Mobile;
365
+ Platform.isDesktop = Platform.device === Devices.Desktop;
366
+ Platform.isWebview = getIsWebview();
367
+ Platform.isStandalone = getIsStandalone(Platform.os);
209
368
 
210
369
  var API_VARIANTS = {
211
370
  standard: {
@@ -267,7 +426,7 @@ function detectApi() {
267
426
  return null;
268
427
  }
269
428
  function isIOS() {
270
- return OS.iOS === OS_NAME;
429
+ return OS.iOS === Platform.os;
271
430
  }
272
431
  function createFullscreenUtils() {
273
432
  var api = detectApi();
@@ -1 +1 @@
1
- "use strict";var e,n,r,i,t=navigator.userAgent;function o(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 l(e){return void 0===e?"":e.replace(/_/g,".")}function u(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}!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"}(i||(i={}));var a=[[/windows nt (6\.[23]); arm/i,e.Windows,o],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,o],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,o],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,o],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,o],[/windows ce\/?([\d.]*)/i,e.Windows,o],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,l],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,l],[/cfnetwork\/.+darwin/i,e.iOS,l],[/mac os x ?([\w. ]*)/i,e.MacOS,l],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,l],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],c=[[/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,i.Chrome],[/webview.+edge\/([\w.]+)/i,i.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,i.Edge],[/opera mini\/([-\w.]+)/i,i.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,i.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,i.Opera],[/opios[\/ ]+([\w.]+)/i,i.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,i.Opera],[/\bopr\/([\w.]+)/i,i.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,i.IE],[/(?:ms|\()ie ([\w.]+)/i,i.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,i.IE],[/\bfocus\/([\w.]+)/i,i.Firefox],[/\bopt\/([\w.]+)/i,i.Opera],[/coast\/([\w.]+)/i,i.Opera],[/fxios\/([\w.-]+)/i,i.Firefox],[/samsungbrowser\/([\w.]+)/i,i.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,i.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,i.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,i.Chrome],[/chrome\/([\w.]+) mobile/i,i.Chrome],[/chrome\/v?([\w.]+)/i,i.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,i.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,i.Safari],[/version\/([\w.,]+) .*safari/i,i.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,i.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,i.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,i.Firefox],[/firefox\/([\w.]+)/i,i.Firefox]],f=(n.Unknown,e.Unknown);r.Unknown,i.Unknown;for(var d=0;d<a.length;d++){var w=(v=a[d])[0],b=v[1],m=v[2];if(null!==(g=t.match(w))){f=b,u(g[1],m),b===e.iOS||b===e.Android?n.Mobile:b!==e.Windows&&b!==e.MacOS||n.Desktop;break}}for(d=0;d<c.length;d++){w=(v=c[d])[0];v[1];m=v[2];if(null!==(g=t.match(w))){u(g[1],m);break}}for(d=0;d<s.length;d++){var v;w=(v=s[d])[0];v[1];var g;m=v[2];if(null!==(g=t.match(w))){u(g[1],m);break}}!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)}}(),n.Mobile,n.Desktop,"matchMedia"in globalThis&&(f===e.iOS?"standalone"in navigator&&navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches);var h={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 k(){return e.iOS===f}var E=function(){var e=function(){var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return h.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var i=n[r];if((t=h[i]).enabled in globalThis.document||t.element in globalThis.document||t.exit in globalThis.document)return"webkit"===i&&"webkitRequestFullScreen"in e&&(t.request="webkitRequestFullScreen"),t}if("webkitCurrentFullScreenElement"in globalThis.document){var t={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:h.webkit.events};return"webkitRequestFullScreen"in e&&(t.request="webkitRequestFullScreen"),t}return null}(),n=null,r=!1;function i(){document.querySelectorAll("video").forEach((function(e){function n(){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 t(){if(null===e)return n&&n.webkitDisplayingFullscreen?n:null;var r=document[e.element];return null!=r?r:null}function o(){return null!==t()}function l(r,t){return new Promise((function(o,l){if(null!==e){var u=r[e.request];if("function"==typeof u)try{var a=u.call(r,t);return void 0!==a&&"function"==typeof a.then?void a.then((function(){o()})).catch((function(){k()?c():l()})):void o()}catch(e){if(!k())return void l()}}function c(){if(k()&&"VIDEO"===r.tagName.toUpperCase()){var e=r;if(e.webkitSupportsFullscreen&&"function"==typeof e.webkitEnterFullscreen)return n=e,i(),e.webkitEnterFullscreen(),void o()}l()}c()}))}function u(){return new Promise((function(r,i){if(null!==e){var o=document[e.exit];if("function"==typeof o){var l=o.call(document);return void 0!==l&&"function"==typeof l.then?void l.then((function(){r()})).catch((function(){i()})):void r()}}if(k()&&null!==n){if("function"==typeof n.webkitExitFullscreen&&!0===n.webkitDisplayingFullscreen)return n.webkitExitFullscreen(),n=null,void r();for(var u=document.querySelectorAll("video"),a=0;a<u.length;a++){var c=u[a];if("function"==typeof c.webkitExitFullscreen&&!0===c.webkitDisplayingFullscreen)return c.webkitExitFullscreen(),void r()}}t()?i():r()}))}return function(){if(!r){r=!0;var e=!1;if(["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].forEach((function(e){globalThis.document.addEventListener(e,t,!1)})),["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"].forEach((function(e){globalThis.document.addEventListener(e,o,!1)})),k())i(),new MutationObserver((function(){i()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function n(n){e||(e=!0,globalThis.document.dispatchEvent(new Event(n,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){e=!1})))}function t(){n("fullscreenchange")}function o(){n("fullscreenerror")}}(),{get enabled(){return function(){if(null===e){if(!k())return!1;for(var n=document.querySelectorAll("video"),r=0;r<n.length;r++){var i=n[r];if(i.webkitSupportsFullscreen||"webkitEnterFullscreen"in i)return!0}return!1}var t=document[e.enabled];return"boolean"==typeof t?t:void 0!==document[e.element]}()},get element(){return t()},get isFullscreen(){return o()},request:l,exit:u,toggle:function(e,n){return o()?u():l(e,n)},onChange:function(e){var n=[];return function(r){function i(n){e(n)}document.addEventListener(r,i,!1),n.push((function(){document.removeEventListener(r,i,!1)}))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function i(n){e(n)}document.addEventListener(r,i,!1),n.push((function(){document.removeEventListener(r,i,!1)}))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}(),p={installed:!1,name:"Fullscreen",module:E,Constants:{},Errors:{}};module.exports=p;
1
+ "use strict";var e,n,r,i;!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"}(i||(i={}));var o={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:i.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:navigator.userAgent,isWebview:!1,isMobile:!1,isDesktop:!1,isStandalone:!1,isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node},t=[[/windows nt (6\.[23]); arm/i,e.Windows,a],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,a],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,a],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,a],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,a],[/windows ce\/?([\d.]*)/i,e.Windows,a],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,u],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,u],[/cfnetwork\/.+darwin/i,e.iOS,u],[/mac os x ?([\w. ]*)/i,e.MacOS,u],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,u],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],l=[[/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,i.Chrome],[/webview.+edge\/([\w.]+)/i,i.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,i.Edge],[/opera mini\/([-\w.]+)/i,i.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,i.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,i.Opera],[/opios[\/ ]+([\w.]+)/i,i.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,i.Opera],[/\bopr\/([\w.]+)/i,i.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,i.IE],[/(?:ms|\()ie ([\w.]+)/i,i.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,i.IE],[/\bfocus\/([\w.]+)/i,i.Firefox],[/\bopt\/([\w.]+)/i,i.Opera],[/coast\/([\w.]+)/i,i.Opera],[/fxios\/([\w.-]+)/i,i.Firefox],[/samsungbrowser\/([\w.]+)/i,i.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,i.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,i.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,i.Chrome],[/chrome\/([\w.]+) mobile/i,i.Chrome],[/chrome\/v?([\w.]+)/i,i.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,i.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,i.Safari],[/version\/([\w.,]+) .*safari/i,i.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,i.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,i.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,i.Firefox],[/firefox\/([\w.]+)/i,i.Firefox]];function a(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 u(e){return void 0===e?"":e.replace(/_/g,".")}function c(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}for(var d=0;d<t.length;d++){var f=(v=t[d])[0],m=v[1],b=v[2];if(null!==(g=o.userAgent.match(f))){o.os=m,o.osVersion=c(g[1],b),m===e.iOS||m===e.Android?o.device=n.Mobile:m!==e.Windows&&m!==e.MacOS||(o.device=n.Desktop);break}}for(d=0;d<l.length;d++){f=(v=l[d])[0];var w=v[1];b=v[2];if(null!==(g=o.userAgent.match(f))){o.engine=w,o.engineVersion=c(g[1],b);break}}for(d=0;d<s.length;d++){f=(v=s[d])[0];var v,g,h=v[1];b=v[2];if(null!==(g=o.userAgent.match(f))){o.browser=h,o.browserVersion=c(g[1],b);break}}o.isNodeJS&&function(e){if("require"in globalThis&&"function"==typeof globalThis.require)try{return Promise.resolve(globalThis.require(e))}catch(e){return Promise.resolve(null)}return import(e).then((function(e){return e.default||e})).catch((function(){return Promise.resolve(null)}))}("os").then((function(n){if(null!==n){var r,i=n.platform(),t=n.release(),l=(r=t.split("."),{major:parseInt(r[0]||"0"),minor:parseInt(r[1]||"0"),build:parseInt(r[2]||"0")});switch(i){case"win32":o.os=e.Windows,o.osVersion=10===l.major&&0===l.minor&&l.build>=22e3?"11":10===l.major&&0===l.minor&&l.build<22e3?"10":6===l.major&&3===l.minor?"8.1":6===l.major&&2===l.minor?"8":6===l.major&&1===l.minor?"7":6===l.major&&0===l.minor?"Vista":5===l.major&&1===l.minor||5===l.major&&2===l.minor?"XP":5===l.major&&0===l.minor?"2000":4===l.major&&90===l.minor?"ME":4===l.major&&0===l.minor?"NT 4.0":3===l.major&&51===l.minor?"NT 3.11":t;break;case"darwin":o.os=e.MacOS,o.osVersion=l.major>=24?""+(l.major-9):23===l.major?"14":22===l.major?"13":21===l.major?"12":20===l.major?"11":19===l.major?"10.15":18===l.major?"10.14":17===l.major?"10.13":16===l.major?"10.12":15===l.major?"10.11":14===l.major?"10.10":13===l.major?"10.9":l.major>=5&&l.major<=12?"10."+(l.major-4):t;break;case"android":o.os=e.Android,o.osVersion=t;break;case"linux":/android/i.test(t)&&(o.os=e.Android,o.osVersion=t)}}})),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,i=n.fullVersionList||n.brands||[],t=n.platformVersion,l=0;l<i.length;l++){var s=null==(r=i[l])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},a=s.brand,u=s.version;/not.a.brand/i.test(a)||"Chromium"===a&&(o.engineVersion=u)}"string"==typeof t&&(o.os===e.Windows&&parseInt(t.replace(/[^\d.]/g,"").split(".")[0],10)>=13?o.osVersion="11":o.osVersion=t)})),o.isMobile=o.device===n.Mobile,o.isDesktop=o.device===n.Desktop,o.isWebview=/; ?wv|applewebkit(?!.*safari)/i.test(o.userAgent),o.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(o.os);var p={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 k(){return e.iOS===o.os}var E=function(){var e=function(){var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return p.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var i=n[r];if((o=p[i]).enabled in globalThis.document||o.element in globalThis.document||o.exit in globalThis.document)return"webkit"===i&&"webkitRequestFullScreen"in e&&(o.request="webkitRequestFullScreen"),o}if("webkitCurrentFullScreenElement"in globalThis.document){var o={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:p.webkit.events};return"webkitRequestFullScreen"in e&&(o.request="webkitRequestFullScreen"),o}return null}(),n=null,r=!1;function i(){document.querySelectorAll("video").forEach((function(e){function n(){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 o(){if(null===e)return n&&n.webkitDisplayingFullscreen?n:null;var r=document[e.element];return null!=r?r:null}function t(){return null!==o()}function l(r,o){return new Promise((function(t,l){if(null!==e){var s=r[e.request];if("function"==typeof s)try{var a=s.call(r,o);return void 0!==a&&"function"==typeof a.then?void a.then((function(){t()})).catch((function(){k()?u():l()})):void t()}catch(e){if(!k())return void l()}}function u(){if(k()&&"VIDEO"===r.tagName.toUpperCase()){var e=r;if(e.webkitSupportsFullscreen&&"function"==typeof e.webkitEnterFullscreen)return n=e,i(),e.webkitEnterFullscreen(),void t()}l()}u()}))}function s(){return new Promise((function(r,i){if(null!==e){var t=document[e.exit];if("function"==typeof t){var l=t.call(document);return void 0!==l&&"function"==typeof l.then?void l.then((function(){r()})).catch((function(){i()})):void r()}}if(k()&&null!==n){if("function"==typeof n.webkitExitFullscreen&&!0===n.webkitDisplayingFullscreen)return n.webkitExitFullscreen(),n=null,void r();for(var s=document.querySelectorAll("video"),a=0;a<s.length;a++){var u=s[a];if("function"==typeof u.webkitExitFullscreen&&!0===u.webkitDisplayingFullscreen)return u.webkitExitFullscreen(),void r()}}o()?i():r()}))}return function(){if(!r){r=!0;var e=!1;if(["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].forEach((function(e){globalThis.document.addEventListener(e,o,!1)})),["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"].forEach((function(e){globalThis.document.addEventListener(e,t,!1)})),k())i(),new MutationObserver((function(){i()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function n(n){e||(e=!0,globalThis.document.dispatchEvent(new Event(n,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){e=!1})))}function o(){n("fullscreenchange")}function t(){n("fullscreenerror")}}(),{get enabled(){return function(){if(null===e){if(!k())return!1;for(var n=document.querySelectorAll("video"),r=0;r<n.length;r++){var i=n[r];if(i.webkitSupportsFullscreen||"webkitEnterFullscreen"in i)return!0}return!1}var o=document[e.enabled];return"boolean"==typeof o?o:void 0!==document[e.element]}()},get element(){return o()},get isFullscreen(){return t()},request:l,exit:s,toggle:function(e,n){return t()?s():l(e,n)},onChange:function(e){var n=[];return function(r){function i(n){e(n)}document.addEventListener(r,i,!1),n.push((function(){document.removeEventListener(r,i,!1)}))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function i(n){e(n)}document.addEventListener(r,i,!1),n.push((function(){document.removeEventListener(r,i,!1)}))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}(),F={installed:!1,name:"Fullscreen",module:E,Constants:{},Errors:{}};module.exports=F;