NONGYESHUZIDIZUO/public/Cesium/Workers/FeatureDetection-ab6f364c.js

2 lines
8.0 KiB
JavaScript

define(["exports","./when-b60132fc","./Check-7b2a090c","./WebGLConstants-aba9fc67"],(function(e,n,r,t){"use strict";var u,s,i,a,o,c,l,f,d,E,p,A,N,y,T,I,m,S,F,U,g,v={BYTE:t.WebGLConstants.BYTE,UNSIGNED_BYTE:t.WebGLConstants.UNSIGNED_BYTE,SHORT:t.WebGLConstants.SHORT,UNSIGNED_SHORT:t.WebGLConstants.UNSIGNED_SHORT,INT:t.WebGLConstants.INT,UNSIGNED_INT:t.WebGLConstants.UNSIGNED_INT,FLOAT:t.WebGLConstants.FLOAT,DOUBLE:t.WebGLConstants.DOUBLE,getSizeInBytes:function(e){switch(e){case v.BYTE:return Int8Array.BYTES_PER_ELEMENT;case v.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case v.SHORT:return Int16Array.BYTES_PER_ELEMENT;case v.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case v.INT:return Int32Array.BYTES_PER_ELEMENT;case v.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case v.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case v.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},fromTypedArray:function(e){return e instanceof Int8Array?v.BYTE:e instanceof Uint8Array?v.UNSIGNED_BYTE:e instanceof Int16Array?v.SHORT:e instanceof Uint16Array?v.UNSIGNED_SHORT:e instanceof Int32Array?v.INT:e instanceof Uint32Array?v.UNSIGNED_INT:e instanceof Float32Array?v.FLOAT:e instanceof Float64Array?v.DOUBLE:void 0},validate:function(e){return n.defined(e)&&(e===v.BYTE||e===v.UNSIGNED_BYTE||e===v.SHORT||e===v.UNSIGNED_SHORT||e===v.INT||e===v.UNSIGNED_INT||e===v.FLOAT||e===v.DOUBLE)},createTypedArray:function(e,n){switch(e){case v.BYTE:return new Int8Array(n);case v.UNSIGNED_BYTE:return new Uint8Array(n);case v.SHORT:return new Int16Array(n);case v.UNSIGNED_SHORT:return new Uint16Array(n);case v.INT:return new Int32Array(n);case v.UNSIGNED_INT:return new Uint32Array(n);case v.FLOAT:return new Float32Array(n);case v.DOUBLE:return new Float64Array(n)}},createArrayBufferView:function(e,r,t,u){switch(t=n.defaultValue(t,0),u=n.defaultValue(u,(r.byteLength-t)/v.getSizeInBytes(e)),e){case v.BYTE:return new Int8Array(r,t,u);case v.UNSIGNED_BYTE:return new Uint8Array(r,t,u);case v.SHORT:return new Int16Array(r,t,u);case v.UNSIGNED_SHORT:return new Uint16Array(r,t,u);case v.INT:return new Int32Array(r,t,u);case v.UNSIGNED_INT:return new Uint32Array(r,t,u);case v.FLOAT:return new Float32Array(r,t,u);case v.DOUBLE:return new Float64Array(r,t,u)}},fromName:function(e){switch(e){case"BYTE":return v.BYTE;case"UNSIGNED_BYTE":return v.UNSIGNED_BYTE;case"SHORT":return v.SHORT;case"UNSIGNED_SHORT":return v.UNSIGNED_SHORT;case"INT":return v.INT;case"UNSIGNED_INT":return v.UNSIGNED_INT;case"FLOAT":return v.FLOAT;case"DOUBLE":return v.DOUBLE}}},b=Object.freeze(v),w={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},B={};function _(e){for(var n=e.split("."),r=0,t=n.length;r<t;++r)n[r]=parseInt(n[r],10);return n}function h(){if(!n.defined(i)&&(i=!1,!L())){var e=/ Chrome\/([\.0-9]+)/.exec(s.userAgent);null!==e&&(i=!0,a=_(e[1]))}return i}function D(){if(!n.defined(o)&&(o=!1,!h()&&!L()&&/ Safari\/[\.0-9]+/.test(s.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(s.userAgent);null!==e&&(o=!0,c=_(e[1]))}return o}function O(){if(!n.defined(l)){l=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(s.userAgent);null!==e&&(l=!0,(f=_(e[1])).isNightly=!!e[2])}return l}function G(){var e;n.defined(d)||(d=!1,"Microsoft Internet Explorer"===s.appName?null!==(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(s.userAgent))&&(d=!0,E=_(e[1])):"Netscape"===s.appName&&null!==(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(s.userAgent))&&(d=!0,E=_(e[1])));return d}function L(){if(!n.defined(p)){p=!1;var e=/ Edge\/([\.0-9]+)/.exec(s.userAgent);null!==e&&(p=!0,A=_(e[1]))}return p}function R(){if(!n.defined(N)){N=!1;var e=/Firefox\/([\.0-9]+)/.exec(s.userAgent);null!==e&&(N=!0,y=_(e[1]))}return N}function Y(){if(!n.defined(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;(F=n.defined(r)&&""!==r)&&(S=r)}return F}function x(){if(n.defined(g))return g.promise;g=n.when.defer(),L()&&(U=!1,g.resolve(U));var e=new Image;return e.onload=function(){U=e.width>0&&e.height>0,g.resolve(U)},e.onerror=function(){U=!1,g.resolve(U)},e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",g.promise}Object.defineProperties(B,{element:{get:function(){if(B.supportsFullscreen())return document[w.fullscreenElement]}},changeEventName:{get:function(){if(B.supportsFullscreen())return w.fullscreenchange}},errorEventName:{get:function(){if(B.supportsFullscreen())return w.fullscreenerror}},enabled:{get:function(){if(B.supportsFullscreen())return document[w.fullscreenEnabled]}},fullscreen:{get:function(){if(B.supportsFullscreen())return null!==B.element}}}),B.supportsFullscreen=function(){if(n.defined(u))return u;u=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return w.requestFullscreen="requestFullscreen",w.exitFullscreen="exitFullscreen",w.fullscreenEnabled="fullscreenEnabled",w.fullscreenElement="fullscreenElement",w.fullscreenchange="fullscreenchange",w.fullscreenerror="fullscreenerror",u=!0;for(var r,t=["webkit","moz","o","ms","khtml"],s=0,i=t.length;s<i;++s){var a=t[s];("function"==typeof e[r=a+"RequestFullscreen"]||"function"==typeof e[r=a+"RequestFullScreen"])&&(w.requestFullscreen=r,u=!0),r=a+"ExitFullscreen","function"==typeof document[r]?w.exitFullscreen=r:(r=a+"CancelFullScreen","function"==typeof document[r]&&(w.exitFullscreen=r)),r=a+"FullscreenEnabled",void 0!==document[r]?w.fullscreenEnabled=r:(r=a+"FullScreenEnabled",void 0!==document[r]&&(w.fullscreenEnabled=r)),r=a+"FullscreenElement",void 0!==document[r]?w.fullscreenElement=r:(r=a+"FullScreenElement",void 0!==document[r]&&(w.fullscreenElement=r)),r=a+"fullscreenchange",void 0!==document["on"+r]&&("ms"===a&&(r="MSFullscreenChange"),w.fullscreenchange=r),r=a+"fullscreenerror",void 0!==document["on"+r]&&("ms"===a&&(r="MSFullscreenError"),w.fullscreenerror=r)}return u},B.requestFullscreen=function(e,n){B.supportsFullscreen()&&e[w.requestFullscreen]({vrDisplay:n})},B.exitFullscreen=function(){B.supportsFullscreen()&&document[w.exitFullscreen]()},B._names=w,s="undefined"!=typeof navigator?navigator:{};var C=[];"undefined"!=typeof ArrayBuffer&&(C.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),"undefined"!=typeof Uint8ClampedArray&&C.push(Uint8ClampedArray),"undefined"!=typeof CanvasPixelArray&&C.push(CanvasPixelArray));var W={isChrome:h,chromeVersion:function(){return h()&&a},isSafari:D,safariVersion:function(){return D()&&c},isWebkit:O,webkitVersion:function(){return O()&&f},isInternetExplorer:G,internetExplorerVersion:function(){return G()&&E},isEdge:L,edgeVersion:function(){return L()&&A},isFirefox:R,firefoxVersion:function(){return R()&&y},isWindows:function(){return n.defined(T)||(T=/Windows/i.test(s.appVersion)),T},isNodeJs:function(){return n.defined(I)||(I="object"==typeof process&&"[object process]"===Object.prototype.toString.call(process)),I},hardwareConcurrency:n.defaultValue(s.hardwareConcurrency,3),supportsPointerEvents:function(){return n.defined(m)||(m=!R()&&"undefined"!=typeof PointerEvent&&(!n.defined(s.pointerEnabled)||s.pointerEnabled)),m},supportsImageRenderingPixelated:Y,supportsWebP:x,supportsWebPSync:function(){return n.defined(g)||x(),U},imageRenderingValue:function(){return Y()?S:void 0},typedArrayTypes:C,isPCBroswer:function(){var e=window.navigator.userAgent.toLowerCase(),n="ipad"==e.match(/ipad/i),r="iphone os"==e.match(/iphone os/i),t="midp"==e.match(/midp/i),u="rv:1.2.3.4"==e.match(/rv:1.2.3.4/i),s="ucweb"==e.match(/ucweb/i),i="android"==e.match(/android/i),a="windows ce"==e.match(/windows ce/i),o="windows mobile"==e.match(/windows mobile/i);return!(n||r||t||u||s||i||a||o)}};W.supportsFullscreen=function(){return B.supportsFullscreen()},W.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},W.supportsWebWorkers=function(){return"undefined"!=typeof Worker},W.supportsWebAssembly=function(){return"undefined"!=typeof WebAssembly&&!W.isEdge()},W.supportsOffscreenCanvas=function(){return"undefined"!=typeof OffscreenCanvas&&!W.isEdge()},e.ComponentDatatype=b,e.FeatureDetection=W}));