@tindtechnologies/universalviewer
Version:
The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎
1 lines • 2.97 kB
JavaScript
(self.webpackChunkUV=self.webpackChunkUV||[]).push([[9694],{6659:function(e,o,t){var n,i,r=t(4692);void 0===(i="function"==typeof(n=function(){"use strict";if("undefined"==typeof window||"undefined"==typeof navigator)return!1;var e,o,t,n,i,d,a,s,p,f,c=window.navigator.userAgent,l=void 0!==navigator.mimeTypes["application/pdf"],u=void 0!==window.Promise,v=!!(-1!==c.indexOf("irefox"))&&parseInt(c.split("rv:")[1].split(".")[0],10)>18,h=/iphone|ipad|ipod/i.test(c.toLowerCase());return t=function(e){var o;try{o=new ActiveXObject(e)}catch(e){o=null}return o},o=function(){return!(!t("AcroPDF.PDF")&&!t("PDF.PdfCtrl"))},e=!h&&(v||l||function(){return!(!window.ActiveXObject&&!("ActiveXObject"in window))}()&&o()),n=function(e){var o,t="";if(e){for(o in e)e.hasOwnProperty(o)&&(t+=encodeURIComponent(o)+"="+encodeURIComponent(e[o])+"&");t&&(t=(t="#"+t).slice(0,t.length-1))}return t},i=function(e){"undefined"!=typeof console&&console.log&&console.log("[PDFObject] "+e)},d=function(e){return i(e),!1},s=function(e){var o=document.body;return"string"==typeof e?o=document.querySelector(e):void 0!==r&&e instanceof r&&e.length?o=e.get(0):void 0!==e.nodeType&&1===e.nodeType&&(o=e),o},p=function(e,o,t,n,i){var r=n+"?file="+encodeURIComponent(o)+t,d="<div style='"+(h?"-webkit-overflow-scrolling: touch; overflow-y: scroll; ":"overflow: hidden; ")+"position: absolute; top: 0; right: 0; bottom: 0; left: 0;'><iframe "+i+" src='"+r+"' style='border: none; width: 100%; height: 100%;' frameborder='0'></iframe></div>";return e.className+=" pdfobject-container",e.style.position="relative",e.style.overflow="auto",e.innerHTML=d,e.getElementsByTagName("iframe")[0]},f=function(e,o,t,n,i,r,d){var a;return a=o&&o!==document.body?"width: "+i+"; height: "+r+";":"position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;",e.className+=" pdfobject-container",e.innerHTML="<embed "+d+" class='pdfobject' src='"+t+n+"' type='application/pdf' style='overflow: auto; "+a+"'/>",e.getElementsByTagName("embed")[0]},a=function(o,t,i){if("string"!=typeof o)return d("URL is not valid");t=void 0!==t&&t;var r=(i=void 0!==i?i:{}).id&&"string"==typeof i.id?"id='"+i.id+"'":"",a=!!i.page&&i.page,c=i.pdfOpenParams?i.pdfOpenParams:{},l=void 0===i.fallbackLink||i.fallbackLink,v=i.width?i.width:"100%",m=i.height?i.height:"100%",w="boolean"!=typeof i.assumptionMode||i.assumptionMode,b="boolean"==typeof i.forcePDFJS&&i.forcePDFJS,g=!!i.PDFJS_URL&&i.PDFJS_URL,y=s(t),P="",D="";return y?(a&&(c.page=a),D=n(c),b&&g?p(y,o,D,g,r):e||w&&u&&!h?f(y,t,o,D,v,m,r):g?p(y,o,D,g,r):(l&&(P="string"==typeof l?l:"<p>This browser does not support inline PDFs. Please download the PDF to view it: <a href='[url]'>Download PDF</a></p>",y.innerHTML=P.replace(/\[url\]/g,o)),d("This browser does not support embedded PDFs"))):d("Target element cannot be determined")},{embed:function(e,o,t){return a(e,o,t)},pdfobjectversion:"2.1.1",supportsPDFs:e}})?n.apply(o,[]):n)||(e.exports=i)}}]);