(()=>{"use strict";function e(e=""){var t,o,n,r,c=(e=e||location?.href).indexOf("?")+1,a=e.indexOf("#")+1||e.length+1,i=e.slice(c,a-1),l=i.replace(/\+/g," ").split("&"),d={};if(i!==e&&""!==i){for(t=0;t<l.length;t++)r=l[t].split("=",2),o=decodeURIComponent(r[0]),n=decodeURIComponent(r[1]),d.hasOwnProperty(o)||(d[o]=[]),d[o]=2===r.length?n:null;return d}}document.addEventListener("DOMContentLoaded",function(){t.protect(document.querySelectorAll(".pdfp_wrapper")),document.querySelectorAll(".pdfp_quick_frame_wrapper").forEach(t=>{const o=t.querySelector("iframe"),n=e(o?.src);if(n.file){const e=new URL(n?.file),t=new URL(o?.src);t?.protocol!==e?.protocol&&(o.src=t.href.replace(e.protocol,t.protocol))}})}),document.addEventListener("adobe_dc_view_sdk.ready",function(){document.querySelectorAll(".pdfp-adobe-viewer").forEach(e=>{let o=e?.href||e?.dataset?.href;const n=e?.dataset?.id||e?.parentElement?.id,r=JSON.parse(e?.dataset?.options,"{}"),c=t.scramble("decode",pdfp.adobeClientKey),a=e.parentElement;if(window.parentElement=a,window.doc=e,n&&o){o=t.scramble("decode",e?.href||e?.dataset?.href);const i={showPrintPDF:!1,showDownloadPDF:!1,showAnnotationTools:!1,embedMode:r.embedMode};function l(e){new AdobeDC.View({clientId:c,divId:n}).previewFile({content:{location:{url:o}},metaData:{fileName:" "}},{...e,enableLinearization:!0})}"BUTTON"===e?.tagName?e.addEventListener("click",()=>{l(i)}):l(i)}})});class t{static protect=async o=>{const n=this.getDetectorData(o);let r=!1,c=null;if(!n)return!1;const{wrapper:a,iframe:i,options:l,infos:d,frame:s}=n,u=a.querySelector(".pdfp_fullscreen"),p=a.querySelector(".close"),f=a.querySelector(".iframe_wrapper");if("_self"===u?.target&&u?.addEventListener("click",e=>{t.isiOSDevice()?u.target="blank":(e.preventDefault(),f?.requestFullscreen())}),p?.addEventListener("click",e=>{document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()}),d?.protect){let m=i?.dataset?.source||"";i.dataset.source="";let w=m.match(/\?file=(.+)&nobaki/);if(w||(r=!0,w=m.match(/https:\/\/bplugins.com\/(.+)/)),w){if(w=this.scramble("decode",w[1]),w=w.replace(/https?:/,window.location.protocol),w.includes("dropbox.com"))c=w;else{const v=await fetch(w),b=await v.blob();c=URL.createObjectURL(b)}function h(e){isNaN(+e)&&(e=100);var t=+new Date,o=+new Date;(isNaN(t)||isNaN(o)||o-t>e)&&(URL.revokeObjectURL(c),alert("please close devtool"),i.src="")}w=r?c:m.replace(/\?file=(.+)&nobaki/,`?file=${c}&nobaki`),i.src=w,window.attachEvent?"complete"===document.readyState||"interactive"===document.readyState?(h(),window.attachEvent("onresize",h),window.attachEvent("onmousemove",h),window.attachEvent("onfocus",h),window.attachEvent("onblur",h)):setTimeout(argument.callee,0):(window.addEventListener("load",h),window.addEventListener("resize",h),window.addEventListener("mousemove",h),window.addEventListener("focus",h),window.addEventListener("blur",h))}d?.alert?(setTimeout(()=>{document.getElementById(s).contentWindow.document.oncontextmenu=function(e){alert("Right Click Disabled"),e.preventDefault()}},1e3),document.oncontextmenu=function(e){alert("Right Click Disabled"),e.preventDefault()}):(document.oncontextmenu=function(e){e.preventDefault()},i.contentWindow.document.oncontextmenu=function(e){e.preventDefault()})}else{const E=e(i?.src),g=new URL(E?.file),y=new URL(i?.src),D=a.querySelector(".pdfp_fullscreen");y?.protocol!==g?.protocol&&(i.src=y.href.replace(g.protocol,y.protocol),D&&(D.href=y.href.replace(g.protocol,y.protocol))),i?.removeAttribute("data-source")}};static getDetectorData=(e,o=!1,n=!1)=>{let r=null,c=null;return null!==e&&(void 0!==e[0]?(e.forEach(e=>{t.protect(e)}),!1):(void 0===e.length||0!==e.length)&&(null!==e.querySelector(".pdfp_wrapper")&&(e=e.querySelector(".pdfp_wrapper")),o||null==e?.dataset?.options||(o=JSON.parse(e?.dataset?.options||"{}")),n||null==e?.dataset?.infos||(n=JSON.parse(e?.dataset?.infos||"{}"),e.removeAttribute("data-infos")),r=e.querySelector("iframe"),c=e.querySelector("iframe").getAttribute("id"),{wrapper:e,iframe:r,options:o,infos:n,frame:c}))};static scramble(e="encode",t=""){const o="abcdefghijklmnopqrstuvwxyz1234567890",n="z1ntg4ihmwj5cr09byx8spl7ak6vo2q3eduf";let r="";if("encode"==e&&""!=t){const e=t.length;for(let c=0;c<e;c++){const e=o.indexOf(t[c]);r+=-1!==e?n[e]:t[c]}}if("decode"==e&&""!=t){const e=t.length;for(let c=0;c<e;c++){const e=t[c],a=n.indexOf(e);r+=-1!==a?o[a]:e}}return r}static isiOSDevice(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}}})();