((e,o)=>{"function"==typeof define&&define.amd?define([],o):"object"==typeof module&&module.exports?module.exports=o():e.PDFObject=o()})(this,function(){var e,m,o,g,t,n,v,i,b,y,r,h,w,s,P,T,j;return"undefined"!=typeof window&&"undefined"!=typeof navigator&&(n=window.navigator.userAgent,e=void 0!==navigator.mimeTypes&&void 0!==navigator.mimeTypes["application/pdf"],m=void 0!==window.Promise,o=-1!==n.indexOf("irefox")&&-1===n.indexOf("Mobile")&&-1===n.indexOf("Tablet")&&18<parseInt(n.split("rv:")[1].split(".")[0],10),g=/iphone|ipad|ipod/i.test(n.toLowerCase()),t=function(e){var o;try{o=new ActiveXObject(e)}catch(e){o=null}return o},n=function(){return!!(window.ActiveXObject||"ActiveXObject"in window)},v=!g&&navigator.vendor&&-1!==navigator.vendor.indexOf("Apple")&&navigator.userAgent&&-1!==navigator.userAgent.indexOf("Safari"),i=function(){return!(!t("AcroPDF.PDF")&&!t("PDF.PdfCtrl"))},b=!g&&(o||e||n()&&i()),y=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},r=function(e){"undefined"!=typeof console&&console.log&&console.log("[PDFObject] "+e)},h=function(e){return r(e),!1},w=function(e){var o=document.body;return"string"==typeof e?o=document.querySelector(e):"undefined"!=typeof jQuery&&e instanceof jQuery&&e.length?o=e.get(0):void 0!==e.nodeType&&1===e.nodeType&&(o=e),o},s=function(e){var o="pdfobject-container",t=e.className.split(/\s+/);-1===t.indexOf(o)&&(t.push(o),e.className=t.join(" "))},P=function(e,o,t,n,i){n=n+"?file="+encodeURIComponent(o)+t,o="<div style='"+(g?"-webkit-overflow-scrolling: touch; overflow-y: scroll; ":"overflow: hidden; ")+"position: absolute; top: 0; right: 0; bottom: 0; left: 0;'><iframe  "+i+" src='"+n+"' style='border: none; width: 100%; height: 100%;' frameborder='0'></iframe></div>";return s(e),e.style.position="relative",e.style.overflow="auto",e.innerHTML=o,e.getElementsByTagName("iframe")[0]},T=function(e,o,t,n,i,r,d){var a="",a=o&&o!==document.body?"width: "+i+"; height: "+r+";":"position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;";return s(e),e.innerHTML="<embed "+d+" class='pdfobject' src='"+t+n+"' type='application/pdf' style='overflow: auto; "+a+"'/>",e.getElementsByTagName("embed")[0]},j=function(e,o,t,n,i,r,d){var a="",a=o&&o!==document.body?"width: "+i+"; height: "+r+";":"position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;";return e.className+=" pdfobject-container",e.innerHTML="<iframe "+d+" class='pdfobject' src='"+t+n+"' type='application/pdf' style='border: none; "+a+"'/>",e.getElementsByTagName("iframe")[0]},{embed:function(e,o,t){var n,i,r,d,a,s,f,p,l,c,u;return"string"!=typeof e?h("URL is not valid"):(n=(t=void 0!==t?t:{}).id&&"string"==typeof t.id?"id='"+t.id+"'":"",i=t.page||!1,r=t.pdfOpenParams||{},d=void 0===t.fallbackLink||t.fallbackLink,a=t.width||"100%",s=t.height||"100%",f="boolean"!=typeof t.assumptionMode||t.assumptionMode,p="boolean"==typeof t.forcePDFJS&&t.forcePDFJS,l="boolean"==typeof t.supportRedirect&&t.supportRedirect,t=t.PDFJS_URL||!1,u="",(c=w(o=void 0!==o&&o))?(i&&(r.page=i),u=y(r),p&&t?P(c,e,u,t,n):b||f&&m&&!g?(l&&v?j:T)(c,o,e,u,a,s,n):t?P(c,e,u,t,n):(d&&(c.innerHTML=("string"==typeof d?d:"<p>This browser does not support inline PDFs. Please download the PDF to view it: <a href='[url]'>Download PDF</a></p>").replace(/\[url\]/g,e)),h("This browser does not support embedded PDFs"))):h("Target element cannot be determined"))},pdfobjectversion:"2.1.1",supportsPDFs:b})});