| Current Path : /home/antonen/chenglong.lt/plugins/content/dearflip/dflip/js/libs/ |
| Current File : /home/antonen/chenglong.lt/plugins/content/dearflip/dflip/js/libs/compatibility.min.js |
(function compatibilityWrapper(){"use strict";var e=navigator.userAgent,t=/Android/.test(e),n=/Android\s[0-2][^\d]/.test(e),r=/Android\s[0-4][^\d]/.test(e),i=e.indexOf("Chrom")>=0,o=/Chrome\/(39|40)\./.test(e),a=e.indexOf("Trident")>=0,c=/\b(iPad|iPhone|iPod)(?=;)/.test(e),s=e.indexOf("Opera")>=0,u=/Safari\//.test(e)&&!/(Chrome\/|Android\s)/.test(e);"undefined"==typeof PDFJS&&(("undefined"!=typeof window?window:this).PDFJS={}),function checkTypedArrayCompatibility(){if("undefined"!=typeof Uint8Array)return void 0===Uint8Array.prototype.subarray&&(Uint8Array.prototype.subarray=function subarray(e,t){return new Uint8Array(this.slice(e,t))},Float32Array.prototype.subarray=function subarray(e,t){return new Float32Array(this.slice(e,t))}),void("undefined"==typeof Float64Array&&(window.Float64Array=Float32Array));function subarray(e,t){return new TypedArray(this.slice(e,t))}function setArrayOffset(e,t){arguments.length<2&&(t=0);for(var n=0,r=e.length;n<r;++n,++t)this[t]=255&e[n]}function TypedArray(e){var t,n,r;if("number"==typeof e)for(t=[],n=0;n<e;++n)t[n]=0;else if("slice"in e)t=e.slice(0);else for(t=[],n=0,r=e.length;n<r;++n)t[n]=e[n];return t.subarray=subarray,t.buffer=t,t.byteLength=t.length,t.set=setArrayOffset,"object"==typeof e&&e.buffer&&(t.buffer=e.buffer),t}window.Uint8Array=TypedArray,window.Int8Array=TypedArray,window.Uint32Array=TypedArray,window.Int32Array=TypedArray,window.Uint16Array=TypedArray,window.Float32Array=TypedArray,window.Float64Array=TypedArray}(),function normalizeURLObject(){window.URL||(window.URL=window.webkitURL)}(),function checkObjectDefinePropertyCompatibility(){if(void 0!==Object.defineProperty){var e=!0;try{Object.defineProperty(new Image,"id",{value:"test"});var t=function Test(){};t.prototype={get id(){}},Object.defineProperty(new t,"id",{value:"",configurable:!0,enumerable:!0,writable:!1})}catch(t){e=!1}if(e)return}Object.defineProperty=function objectDefineProperty(e,t,n){delete e[t],"get"in n&&e.__defineGetter__(t,n.get),"set"in n&&e.__defineSetter__(t,n.set),"value"in n&&(e.__defineSetter__(t,(function objectDefinePropertySetter(e){return this.__defineGetter__(t,(function objectDefinePropertyGetter(){return e})),e})),e[t]=n.value)}}(),function checkXMLHttpRequestResponseCompatibility(){var e=XMLHttpRequest.prototype,t=new XMLHttpRequest;"overrideMimeType"in t||Object.defineProperty(e,"overrideMimeType",{value:function xmlHttpRequestOverrideMimeType(e){}}),"responseType"in t||(PDFJS.disableWorker=!0,Object.defineProperty(e,"responseType",{get:function xmlHttpRequestGetResponseType(){return this._responseType||"text"},set:function xmlHttpRequestSetResponseType(e){"text"!==e&&"arraybuffer"!==e||(this._responseType=e,"arraybuffer"===e&&"function"==typeof this.overrideMimeType&&this.overrideMimeType("text/plain; charset=x-user-defined"))}}),"undefined"==typeof VBArray?Object.defineProperty(e,"response",{get:function xmlHttpRequestResponseGet(){if("arraybuffer"!==this.responseType)return this.responseText;var e,t=this.responseText,n=t.length,r=new Uint8Array(n);for(e=0;e<n;++e)r[e]=255&t.charCodeAt(e);return r.buffer}}):Object.defineProperty(e,"response",{get:function xmlHttpRequestResponseGet(){return"arraybuffer"===this.responseType?new Uint8Array(new VBArray(this.responseBody).toArray()):this.responseText}}))}(),function checkWindowBtoaCompatibility(){if(!("btoa"in window)){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";window.btoa=function windowBtoa(t){var n,r,i="";for(n=0,r=t.length;n<r;n+=3){var o=255&t.charCodeAt(n),a=255&t.charCodeAt(n+1),c=255&t.charCodeAt(n+2),s=(3&o)<<4|a>>4,u=n+1<r?(15&a)<<2|c>>6:64,f=n+2<r?63&c:64;i+=e.charAt(o>>2)+e.charAt(s)+e.charAt(u)+e.charAt(f)}return i}}}(),function checkWindowAtobCompatibility(){if(!("atob"in window)){window.atob=function(e){if((e=e.replace(/=+$/,"")).length%4==1)throw new Error("bad atob input");for(var t,n,r=0,i=0,o="";n=e.charAt(i++);~n&&(t=r%4?64*t+n:n,r++%4)?o+=String.fromCharCode(255&t>>(-2*r&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return o}}}(),function checkFunctionPrototypeBindCompatibility(){void 0===Function.prototype.bind&&(Function.prototype.bind=function functionPrototypeBind(e){var t=this,n=Array.prototype.slice.call(arguments,1),r=function functionPrototypeBindBound(){var r=n.concat(Array.prototype.slice.call(arguments));return t.apply(e,r)};return r})}(),function checkDatasetProperty(){"dataset"in document.createElement("div")||Object.defineProperty(HTMLElement.prototype,"dataset",{get:function(){if(this._dataset)return this._dataset;for(var e={},t=0,n=this.attributes.length;t<n;t++){var r=this.attributes[t];if("data-"===r.name.substring(0,5))e[r.name.substring(5).replace(/\-([a-z])/g,(function(e,t){return t.toUpperCase()}))]=r.value}return Object.defineProperty(this,"_dataset",{value:e,writable:!1,enumerable:!1}),e},enumerable:!0})}(),function checkClassListProperty(){if(!("classList"in document.createElement("div"))){var e={add:function(e){changeList(this.element,e,!0,!1)},contains:function(e){return changeList(this.element,e,!1,!1)},remove:function(e){changeList(this.element,e,!1,!0)},toggle:function(e){changeList(this.element,e,!0,!0)}};Object.defineProperty(HTMLElement.prototype,"classList",{get:function(){if(this._classList)return this._classList;var t=Object.create(e,{element:{value:this,writable:!1,enumerable:!0}});return Object.defineProperty(this,"_classList",{value:t,writable:!1,enumerable:!1}),t},enumerable:!0})}function changeList(e,t,n,r){var i=(e.className||"").split(/\s+/g);""===i[0]&&i.shift();var o=i.indexOf(t);return o<0&&n&&i.push(t),o>=0&&r&&i.splice(o,1),e.className=i.join(" "),o>=0}}(),function checkConsoleCompatibility(){var e;"console"in window?"bind"in console.log||(console.log=(e=console.log,function(t){return e(t)}),console.error=function(e){return function(t){return e(t)}}(console.error),console.warn=function(e){return function(t){return e(t)}}(console.warn)):window.console={log:function(){},error:function(){},warn:function(){}}}(),function checkOnClickCompatibility(){function isDisabled(e){return e.disabled||e.parentNode&&isDisabled(e.parentNode)}s&&document.addEventListener("click",(function ignoreIfTargetDisabled(e){isDisabled(e.target)&&e.stopPropagation()}),!0)}(),function checkOnBlobSupport(){a&&(PDFJS.disableCreateObjectURL=!0)}(),function checkNavigatorLanguage(){"language"in navigator||(PDFJS.locale=navigator.userLanguage||"en-US")}(),function checkRangeRequests(){(u||n||o||c)&&(PDFJS.disableRange=!0,PDFJS.disableStream=!0)}(),function checkHistoryManipulation(){history.pushState&&!n||(PDFJS.disableHistory=!0)}(),function checkSetPresenceInImageData(){if(window.CanvasPixelArray)"function"!=typeof window.CanvasPixelArray.prototype.set&&(window.CanvasPixelArray.prototype.set=function(e){for(var t=0,n=this.length;t<n;t++)this[t]=e[t]});else{var n,o=!1;if(i?o=(n=e.match(/Chrom(e|ium)\/([0-9]+)\./))&&parseInt(n[2])<21:t?o=r:u&&(o=(n=e.match(/Version\/([0-9]+)\.([0-9]+)\.([0-9]+) Safari\//))&&parseInt(n[1])<6),o){var a=window.CanvasRenderingContext2D.prototype,c=a.createImageData;a.createImageData=function(e,t){var n=c.call(this,e,t);return n.data.set=function(e){for(var t=0,n=this.length;t<n;t++)this[t]=e[t]},n},a=null}}}(),function checkRequestAnimationFrame(){function fakeRequestAnimationFrame(e){window.setTimeout(e,20)}c?window.requestAnimationFrame=fakeRequestAnimationFrame:"requestAnimationFrame"in window||(window.requestAnimationFrame=window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||fakeRequestAnimationFrame)}(),function checkCanvasSizeLimitation(){(c||t)&&(PDFJS.maxCanvasPixels=5242880)}(),function checkFullscreenSupport(){a&&window.parent!==window&&(PDFJS.disableFullscreen=!0)}(),function checkCurrentScript(){"currentScript"in document||Object.defineProperty(document,"currentScript",{get:function(){var e=document.getElementsByTagName("script");return e[e.length-1]},enumerable:!0,configurable:!0})}(),function checkInputTypeNumberAssign(){var e=document.createElement("input");try{e.type="number"}catch(r){var t=e.constructor.prototype,n=Object.getOwnPropertyDescriptor(t,"type");Object.defineProperty(t,"type",{get:function(){return n.get.call(this)},set:function(e){n.set.call(this,"number"===e?"text":e)},enumerable:!0,configurable:!0})}}(),function checkDocumentReadyState(){if(document.attachEvent){var e=document.constructor.prototype,t=Object.getOwnPropertyDescriptor(e,"readyState");Object.defineProperty(e,"readyState",{get:function(){var e=t.get.call(this);return"interactive"===e?"loading":e},set:function(e){t.set.call(this,e)},enumerable:!0,configurable:!0})}}()}).call("undefined"==typeof window?this:window);