(()=>{"use strict";var t={};function e(e){this._navigator=e||(t.g.navigator?t.g.navigator:window?window.navigator:void 0),this.browser=this._getBrowser(),this.flash=this._getFlash(),this.os=this._getOS(),this.device=this._getDevice(),this.locales=this._getLocales(),this.locale=this.locales?this.locales[0]:void 0}t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),e.prototype.constructor=e,e.prototype._getBrowser=function(){const t=void 0!==this._navigator?this._navigator.userAgent.toLowerCase():"",e=function(e){const i=t.match(e);return i&&i.length>1&&i[1]||""};let i;const o=/CrOS/.test(t),n=e(/edge?\/(\d+(\.\d+)?)/i),s=n?n>=80?"chromiumEdge":"msedge":null,l=e(/version\/(\d+(\.\d+)?)/i);let r=!1;return/opera|opr/i.test(t)?i={name:"Opera",opera:!0,version:l||e(/(?:opera|opr)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(t)?i={name:"Yandex Browser",yandexbrowser:!0,version:l||e(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/windows phone/i.test(t)?(r=!0,i={name:"Windows Phone IE",ie:!0},n?(i[s]=!0,i.version=n):(i.msie=!0,i.version=e(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(t)?(i={name:"Internet Explorer",msie:!0,ie:!0,version:e(/(?:msie |rv:)(\d+(\.\d+)?)/i)},/trident/i.test(t)&&("7.0"===i.version&&"4.0"===e(/(?:trident\/)(\d+(\.\d+)?)/i)&&(i.version="8.0"),"7.0"===i.version&&"5.0"===e(/(?:trident\/)(\d+(\.\d+)?)/i)&&(i.version="9.0"))):/silk/i.test(t)?i={name:"Amazon Silk",silk:!0,version:e(/silk\/(\d+(\.\d+)?)/i)}:o?i={name:"Chrome",chrome:!0,version:e(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/chrome.+? edge?/i.test(t)?(i={name:"Microsoft Edge",version:n},i[s]=!0,i.ie="msedge"===s):/chrome|crios|crmo/i.test(t)?(i={name:"Chrome",chrome:!0,version:e(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)},/SamsungBrowser/i.test(t)&&(i.name="Samsung Browser",i.samsung=!0,i.version=e(/SamsungBrowser\/(\d+(\.\d+)?)/i))):i=/seamonkey\//i.test(t)?{name:"SeaMonkey",seamonkey:!0,version:e(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel/i.test(t)?{name:"Firefox",firefox:!0,version:e(/(?:firefox|iceweasel)[ \/](\d+(\.\d+)?)/i)}:/phantom/i.test(t)?{name:"PhantomJS",phantom:!0,version:e(/phantomjs\/(\d+(\.\d+)?)/i)}:/safari/i.test(t)?{name:"Safari",safari:!0,version:l}:{other:!0},/FBAN|FBIOS|FB_IAB|FBAV/i.test(t)&&(i.name="Facebook In-App",i.facebook=!0,i.inApp=!0),/\bFB[\w_]+\/(Messenger|MESSENGER)/i.test(t)&&(i.name="Messenger In-App",i.messenger=!0,i.inApp=!0),/\bTwitter/i.test(t)&&(i.name="Twitter In-App",i.twitter=!0,i.inApp=!0),/\bLine\//i.test(t)&&(i.name="Line In-App",i.line=!0,i.inApp=!0),/\bMicroMessenger\//i.test(t)&&(i.name="Wechat In-App",i.wechat=!0,i.inApp=!0),/\bInstagram/i.test(t)&&(i.name="Instagram In-App",i.instagram=!0,i.inApp=!0),r||i.msie||i.msedge||i.chromiumEdge||!/(apple)?webkit/i.test(t)?!i.opera&&/gecko\//i.test(t)&&(i.name=i.name||"Gecko",i.gecko=!0,i.version=i.version||e(/gecko\/(\d+(\.\d+)?)/i)):(i.name=i.name||"Webkit",i.webkit=!0,!i.version&&l&&(i.version=l)),i.name||(i.name="Other"),-1!==t.toLowerCase().indexOf("publisher")&&(i.publisher=!0),i},e.prototype._getFlash=function(){const e="Shockwave Flash",i="application/x-shockwave-flash";let o=null;if(void 0!==this._navigator.plugins&&"object"==typeof this._navigator.plugins[e]){let t=this._navigator.plugins[e].description;!t||void 0!==this._navigator.mimeTypes&&this._navigator.mimeTypes[i]&&!this._navigator.mimeTypes[i].enabledPlugin||(t=t.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),o=[parseInt(t.replace(/^(.*)\..*$/,"$1"),10),parseInt(t.replace(/^.*\.(.*)\s.*$/,"$1"),10),/[a-zA-Z]/.test(t)?parseInt(t.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0])}else if(void 0!==t.g.ActiveXObject)try{const e=new t.g.ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(e){let t=e.GetVariable("$version");t&&(t=t.split(" ")[1].split(","),o=[parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10)])}}catch(t){}return o},e.prototype._getOS=function(){const t=void 0!==this._navigator?this._navigator.userAgent.toLowerCase():"",e=function(e){const i=t.match(e);return i&&i.length>1&&i[1]||""};let i={name:"Other",other:!0};const o=e(/(ipod|iphone|ipad)/i).toLowerCase(),n="ontouchstart"in document.documentElement&&/macintosh/i.test(t),s=!/like android/i.test(t)&&/android/i.test(t),l=e(/version\/(\d+(\.\d+)?)/i);return o&&!n?i={name:"iOS",version:e(/os\s(\d+_*\d*_*\d*)/).split("_").join("."),ios:!0}:n?i={name:"iPadOS",version:e(/version\/(\d+.?\d*.?\d*)\s/i),ios:!0,ipados:!0}:s?i={name:"Android",version:e(/android\s(\d+\.*\d*\.*\d*)/),android:!0}:/mac os/.test(t)?i={name:"Mac OS",mac:!0}:/windows/i.test(t)?i={name:"Windows",windows:!0}:/playbook|blackberry|\bbb\d+/i.test(t)||/rim\stablet/i.test(t)?i={name:"Blackberry",blackberry:!0,version:l||e(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:/(web|hpw)os/i.test(t)?(i={name:"WebOS",webos:!0,version:l||e(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(t)&&(i.touchpad=!0)):/bada/i.test(t)?i={name:"Bada",bada:!0,version:e(/dolfin\/(\d+(\.\d+)?)/i)}:/tizen/i.test(t)?i={name:"Tizen",tizen:!0,version:e(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||l}:/sailfish/i.test(t)?i={name:"Sailfish",sailfish:!0,version:e(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel/i.test(t)&&/\((mobile|tablet);[^)]*rv:[\d.]+\)/i.test(t)&&(i={name:"Firefox OS",firefoxos:!0}),i},e.prototype._getDevice=function(){const t=void 0!==this._navigator?this._navigator.userAgent.toLowerCase():"",e={},i=!/like android/i.test(t)&&/android/i.test(t),o=/cros/.test(t);return e.name=t.match(/ipad/)||this.os.ipados?"ipad":t.match(/ipod/)?"ipod":t.match(/iphone/)?"iphone":i?"android":t.match(/windows phone/)?"wphone":t.match(/mobile/)?"mobile":t.match(/mac|win|linux/)||o?"desktop":"other",e[e.name]=!0,e},e.prototype._getLocales=function(){if(void 0!==this._navigator){if(this._navigator.languages&&this._navigator.languages.length>0){const t=[];let e;for(let i=0;io[t]?1:-1}return i.length!==o.length?-1:0}o.prototype.constructor=o,o.prototype.getSupportedVersions=function(){const t=[];if(this.userAgentInfo.device.desktop){if(this.userAgentInfo.browser.ie)return[];t.push("html")}else{const e=this.userAgentInfo.os.ios,i=this.userAgentInfo.os.ipados,o=this.userAgentInfo.os.android&&(parseInt(this.userAgentInfo.os.version.split(".")[0],10)>4||4===parseInt(this.userAgentInfo.os.version.split(".")[0],10)&&parseInt(this.userAgentInfo.os.version.split(".")[1],10)>=1);if(e||i||o)if(i||e&&parseInt(this.userAgentInfo.os.version.split(".")[0],10)>=10||o&&parseInt(this.userAgentInfo.os.version.split(".")[0],10)>=6)t.push("mobile");else{const i=navigator.userAgent.indexOf("Mozilla/5.0")>-1&&navigator.userAgent.indexOf("Android ")>-1&&navigator.userAgent.indexOf("AppleWebKit")>-1&&-1===navigator.userAgent.indexOf("Chrome");(e&&n(this.userAgentInfo.os.version,"9")>=0||o&&1===n(this.userAgentInfo.os.version,"4.2")&&!i)&&t.push("mobile-old")}}return t},o.prototype.mainVersion=function(){const t=this.getSupportedVersions();if(this.priorities){for(let e=0;e0)return t[0];return null},o.prototype.isRenderable=function(){return!0};const s=o,l=function(e,i,o=!1){let n=100;let s=t.g.innerWidth-n,l=t.g.innerHeight-n;const r=s/l,a=e/i;let h=r>a?e*l/i:s,d=r>a?l:i*s/e;return o&&(h>e||d>i)?(h=e,d=i,s+=n,l+=n,n=0):(h=Math.round(h),d=Math.round(d)),{width:h,height:d,paddingTop:(l+n-20-d)/2,paddingLeft:(s+n-20-h)/2}};function r(t,e,i,o){const n=this;this.onClick=function(t){let s=!0;e&&(s=s&&e(t)),s&&(t.preventDefault(),n.render(t.currentTarget,i,o))},t.addEventListener("click",this.onClick),this._sizingBound=this.sizing.bind(this),this._closeBound=this.close.bind(this),this._receiveMessageBound=this._receiveMessage.bind(this),this._keyListenerBound=this._keyListener.bind(this)}r.prototype.render=function(t,e,o){const n=new i,s=n.browser,l=-1!==["ar","he"].indexOf(n.locale);this.blackout=document.createElement("div"),this.lightbox=document.createElement("div"),this.closeButton=document.createElement("button"),this.lightbox.setAttribute("role","dialog"),this.lightbox.style.position="absolute",this.lightbox.style.display="block",this.lightbox.style.margin="50px auto",this.lightbox.style.minWidth="200px",this.lightbox.style.minHeight="150px",this.lightbox.style.maxWidth="90%",this.lightbox.style.backgroundColor="#fff",this.lightbox.style.padding="10px",this.lightbox.style.borderRadius="5px",this.closeButton.style.width="30px",this.closeButton.style.height="30px",this.closeButton.style.top="-15px",this.closeButton.style.right="-15px",this.closeButton.style.position="absolute",this.closeButton.style.padding="0",this.closeButton.style.border="none",this.closeButton.style.background="transparent url("+this._getCloseIcon()+")",this.closeButton.style.cursor="pointer",l&&(this.closeButton.style.right="initial",this.closeButton.style.left="-15px"),this.blackout.style.width="100%",this.blackout.style.height="100%",this.blackout.style.backgroundColor="rgba(0, 0, 0, 0.7)",this.blackout.style.position="fixed",this.blackout.style.top="0px",this.blackout.style.left="0px",this.blackout.style.zIndex="12147483646",this.blackout.style.opacity="0",this.blackout.style.transition="opacity .4s ease",this.lightbox.appendChild(this.closeButton),this.blackout.appendChild(this.lightbox);const r=this;if(t.getAttribute("data-img")){const e=document.createElement("img");this.sizing(100,100,!0),e.onload=function(){r.width=e.width,r.height=e.height,r.sizing(e.width,e.height,!0),e.style.width="100%",e.style.height="100%",r.lightbox.appendChild(e)},e.src=t.getAttribute("data-img"),this._sizingBound=this.sizing.bind(this,this.width,this.height,!0)}else if(t.getAttribute("href")){const i=document.createElement("iframe");let n=t.getAttribute("href");const l=n.split("#");n=l[0],n+=-1===n.indexOf("?")?"?embed=true":"&embed=true",n+="&lightbox=true",n+=l[1]?"#"+l[1]:"",i.src=n,i.width="100%",i.height="100%",i.setAttribute("type","text/html"),i.setAttribute("scrolling","no"),i.setAttribute("frameborder","0"),i.setAttribute("allowfullscreen","allowfullscreen"),i.setAttribute("allow","accelerometer; autoplay; encrypted-media; fullscreen; gyroscope; picture-in-picture;"),this.width=t.getAttribute("data-width")||600,this.height=o?this.width/o:t.getAttribute("data-height")||400,this.sizing(),this.lightbox.appendChild(i),setTimeout((function(){e(i)}),10),s.safari&&setTimeout((function(){i.contentWindow.focus()}),0),i.addEventListener("load",(function(){i.contentWindow.focus()}))}this.addCloseListeners(),document.body.appendChild(this.blackout),setTimeout((()=>{this.blackout.style.opacity="1"}),10),this.lightbox.addEventListener("wheel",this._preventer,{passive:!1}),this.blackout.addEventListener("wheel",this._preventer,{passive:!1})},r.prototype._preventer=function(t){t.preventDefault()},r.prototype._getCloseIcon=function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAEAUlEQVR42oWVbWwUZRDH/+3e9l5h2yu9tsddX+hRWnupR2uFQK8hMWnrGcRCCKGKcJQ0aKgmJh4mJFWspmArYgiQGtvqN0MipOIXPyARRSIagYgJIRIhsaZRIIF723vrOHu7163cGWf2w+7M/O55ZuZ55vCIFKEYxRsM7WJLicc4Zj1uaylpKWkXNxgUO3t1yQMFiDCtWrLX8UHdqGeo4cgTE2s63EH3W65gRYUNJvYKKCqMGmCssHU7PvR+Hfj7cPISaZK6cv+jcxs317rs/ANGGPLxYjaa60q31kx2hj/PYXOZ2xnS5MFnq+pXO8skmMEpPLqqxWV/wTPzbOY2UXJ+ItkdQ1jVjuj7yfg8W6+e295eI5XBoq6uo+al9h7PqT5KEH2Vro2omK5N0Z/SROx7vqmOcbOOCzBCaq1/rzd9h2g6KYRRQIXwuwkFP9nndENiQmCcHxG2Zc6XO+9/qayqo/l6IkkU/h6PoQo2porBj2mpvav5kyBRNOPSNtwWXb+QsyMyIFuybyXh2RTRN2+6VsIOEwQFtlqcWzt//5ToWFIN90aJ5WBCeV8RneViTWieQZno7nm0oho2GMC8JK0I9MauEq3VVquNxEjFVyooy1hC9ZRHlLqVdqEepSgB8+WV3k39RA8zenbPxFT8YRY9ndIrcY3Ltn9oSROWwQSINkdLx55XiG6mdVjBZcZ0NKdfMHzysPVxVMLMsKXauy4YIvo1/e/O3p1X4bcTi+1nGD5+FG1wwsownI51/iGie+nF6FwWTWu5654f4kSvj5ifxHINFtfUDyT/Iso1SorMablu1HLfJ+eOygNuVutL4gJcLXa07Lx1gehVLWRtTM9VLd2plOrp5o+5X7Ad7bltO0Rf47YjH7M5ZQnn+rlPFhYuxsFEbk8XokRnz2IztIJxq9BsDLhCs1f0fhbWXZxv+M/y/ehFs9oqARLqDX77wJ4JYtkV/y90fSyV4UqfQRD+3CHh44lq+IS+yjdOZMfAcMHVd8RlRi9eRgib4NOOJ8Mm2OFBl7Cz7J1jMwp+Q94W17LXynSJC8XozxjBi+iCR70Y2pVEFbzoEQalQ3tn/rhJLHLmWmJSnpR/lLk5LPdmx8/jEAbRA69+JbVhADdWIyAMWkYwdfS7327QIrlza/qyOI0RRgMcpQ+D3BhCGWrgQw9vK2Qex5R0+qlvD1w/cD1wcfkMpjCOEHt64OMofQzpA5CNbnjhx3PYjdcwbBg1jGHMMFo8zF+72epnrxvaAMwbvZA4mwb4OOxpbEE/drD2Ywt/+dnawF599Ob9XxhhRRmH1KIRXg5vY/XxWyNbqthj1XPNw1mVHYgcYoYFVk0tMLNFVFbMxvyPFBXQAvIP9TCL+Lre4wwAAAAASUVORK5CYII="},r.prototype.sizing=function(t,e,i){t=t||this.width,e=e||this.height;const o=l(t,e,i=i||!1);this.lightbox.style.width=o.width+"px",this.lightbox.style.height=o.height+"px",this.lightbox.style.top=o.paddingTop+"px",this.lightbox.style.left=o.paddingLeft+"px",this.lightbox.style.margin="0"},r.prototype.close=function(e){e.stopPropagation();const i=()=>{t.g.history&&t.g.history.pushState&&window.removeEventListener("popstate",this._closeBound),window.removeEventListener("resize",this._sizingBound),window.removeEventListener("message",this._receiveMessageBound,!1),window.removeEventListener("keyup",this._keyListenerBound),this.closeButton.removeEventListener("click",this._closeBound),this.blackout.removeEventListener("click",this._closeBound),this.blackout.removeEventListener("transitionend",i),this.blackout.parentNode.removeChild(this.blackout)};this.blackout.addEventListener("transitionend",i),this.blackout.style.opacity="0"},r.prototype._receiveMessage=function(t){const e=t.data;e&&e.fbPublicationUrl&&-1!==e.fbPublicationUrl.indexOf(t.origin)&&"closeLightbox"===e.action&&this.close(t)},r.prototype._keyListener=function(t){"Escape"===t.code&&this.close(t)},r.prototype.addCloseListeners=function(){t.g.history&&t.g.history.pushState&&(t.g.history.pushState({lightbox:!0},null,t.g.location.href),window.addEventListener("popstate",this._closeBound)),window.addEventListener("resize",this._sizingBound),window.addEventListener("message",this._receiveMessageBound,!1),window.addEventListener("keyup",this._keyListenerBound),this.closeButton.addEventListener("click",this._closeBound),this.blackout.addEventListener("click",this._closeBound)};const a=r;function h(t){return!isNaN(parseFloat(t))&&isFinite(t)}const d="fbo";function c(){this.THUMBNAIL_URL="https://online.flippingbook.com/Thumbnail.aspx?url=",this.API_URL="https://fbo-b.flippingbook.com/FrontendApi.svc/GetPublicationForDisplay",this.PROTECTION_API_URL="https://online.flippingbook.com/info.json?type=accessPolicy.hasDomainRestrictions&url=",this.elementsArray=[],this.elementId=0,this.embeds={},this.requestInterval=200,this.lastRequestTime=0,this.userAgentDetector=new i,this.publicationDetector=new s(this.userAgentDetector,["html","mobile"]),this.version=this.publicationDetector.mainVersion(),this.parseAllEmbeds(),window.addEventListener("message",this._receiveMessage.bind(this),!1),this.onMobileResizeBound=this.onMobileResize.bind(this),this.closeMobileLightboxBound=this.closeMobileLightbox.bind(this,this.currentLigtboxId)}void 0!==t.g[d+"Embed"]&&t.g[d+"Embed"].parseAllEmbeds(),c.prototype.parseAllEmbeds=function(){const t=this._getElementsByClass(d+"-embed");for(let e=0;e0?"&":"")+"page="+g,f+=r):(f.lastIndexOf("/")!==f.length-1&&(f+="/"),f+=g+"/"+r):f+=r,"no"===a&&(f+=-1===f.indexOf("?")?"?noview=true":"&noview=true");let v=f;w.length>0&&(v+="#"+w);const I=t.g.document.createElement("div");for(let t=0,i=e.attributes.length;t0?L.src=this._getPublicationThumbLink(x):L.src=this._getSelfhostPublicationThumbLink(x,u,r),L.onload=function(){const t=L.naturalWidth,e=L.naturalHeight,o=A.getBoundingClientRect(),n=o.width/o.height,s=t/e;t>0&&e>0&&o.height>0&&o.width>0&&(L.style.height=n>s?o.height:e*o.width/t,L.style.width=n>s?t*o.height/e:o.width),i.embeds[l].id&&!i.embeds[l].throttled&&(L.style.opacity="1",E.style.display="initial",setTimeout((()=>{E.style.opacity="0.8"}),10))},a.appendChild(L),E=t.g.document.createElement("div"),E.style.width="60px",E.style.height="60px",E.style.position="absolute",E.style.top="0",E.style.left="0",E.style.right="0",E.style.bottom="0",E.style.margin="auto",E.style.backgroundImage="url('"+this._getPublicationThumbIcon()+"')",E.style.backgroundPosition="center",E.style.transition="transform .3s ease, opacity .3s ease",E.style.transform="scale(0.9)",E.style["will-change"]="transform",E.style.borderRadius="100%",E.style.backgroundColor="rgba(0,0,0,0.7)",E.style.opacity="0",E.style.display="none";const d=function(){E.style.transform="scale(1)",E.style.backgroundColor="rgba(0,0,0,0.66)",E.style.opacity="1"};L.addEventListener("mouseenter",d),E.addEventListener("mouseenter",d);const c=function(){E.style.transform="scale(0.9)",E.style.opacity="0.8",E.style.backgroundColor="rgba(0,0,0,0.7)"};if(L.addEventListener("mouseleave",c),E.addEventListener("mouseleave",c),a.appendChild(E),o||(o=this._getEmbedDefaultWidth()+"px"),n||(n=this._getEmbedDefaultHeight()+"px"),k){const t=s.split(":");_=t[0]/t[1]}k&&_&&(C=(100/_).toFixed(2)+"%",e.style.position="relative"),e.style.width||(e.style.width=o+(h(o)?"px":"")),e.style.height||(e.style.height=n+(h(n)?"px":"")),"auto"===n&&(e.style.minHeight=this._getPayloadMinHeight()+"px")}let M=!1;this.PROTECTION_API_URL&&"mobile"===this.version?this._ajax(this.PROTECTION_API_URL+x,(function(t,o){if(200!==o.status)return void console.log(o.status,o.statusText);const n=JSON.parse(t);"boolean"==typeof n?(M=n,i.storeEmbed({elementId:l,element:e,embedPublicationUrl:f,linkElement:A,image:L,icon:E,method:d,analytics:a,isProtected:M,wheel:c,urlHash:w,thumbnailUrl:u,ratioPadding:C,showLightbox:m,caption:y})):console.log("Protection check error")}),null,5e3):this.storeEmbed({elementId:l,element:e,embedPublicationUrl:f,linkElement:A,image:L,icon:E,method:d,analytics:a,isProtected:M,wheel:c,urlHash:w,thumbnailUrl:u,ratioPadding:C,showLightbox:m,caption:y})},c.prototype.storeEmbed=function(e){const i=this;e.isProtected&&"mobile"===this.version?e.linkElement.addEventListener("click",(function(t){t.preventDefault(),i.openMobileLightbox(e.elementId)})):new a(e.linkElement,(function(){return.8*i._getWindowWidth()>i._getPayloadMinWidth()&&.8*i._getWindowHeight()>i._getPayloadMinHeight()&&!0===i.userAgentDetector.device.desktop&&e.showLightbox}),(function(t){i.embeds[e.elementId].lightboxWindow=t.contentWindow}));const o=t.g.document.createElement("div");e.element.appendChild(o),this.embeds[e.elementId]={id:e.elementId,url:e.embedPublicationUrl,element:e.element,container:o,link:e.linkElement,image:e.image,icon:e.icon,isProtected:e.isProtected,wheel:e.wheel,urlHash:e.urlHash,thumbnailUrl:e.thumbnailUrl,ratioPadding:e.ratioPadding,showLightbox:e.showLightbox,caption:e.caption},this._throttleEmbedInit(e,o),t.g.addEventListener("resize",(function(){i.embeds[e.elementId]&&i._resizeEmbed({element:e.element,payloadContainer:o,linkElement:e.linkElement,publicationUrl:e.embedPublicationUrl,embedId:e.elementId,ratioPadding:e.ratioPadding,image:e.image,icon:e.icon})})),this._doResize=function(){i.embeds[e.elementId]&&i._resizeEmbed({element:e.element,payloadContainer:o,linkElement:e.linkElement,publicationUrl:e.embedPublicationUrl,embedId:e.elementId,ratioPadding:e.ratioPadding,image:e.image,icon:e.icon})},this.API_URL.length>0&&"no"!==e.analytics&&this._sendAnalytics(this.API_URL,e.embedPublicationUrl,e.method)},c.prototype._shouldThrottleInit=function(t){let e=!0;if(t){const i=this._getBoundingClientRect(t);e=this._shouldRunPayload(i)}return e&&!0},c.prototype._throttleEmbedInit=function(t,e){if(Date.now()-this.lastRequestTime{this._throttleEmbedInit(t,e)}),100);this.lastRequestTime=Date.now(),this._resizeEmbed({element:t.element,payloadContainer:e,linkElement:t.linkElement,publicationUrl:t.embedPublicationUrl,embedId:t.elementId,ratioPadding:t.ratioPadding,image:t.image,icon:t.icon})},c.prototype.setEmbedPropertyById=function(t,e){if(!this.embeds.hasOwnProperty(t))return!1;const i=this.embeds[t];for(const t in e){if(!i.element)return;e.hasOwnProperty(t)&&i.element.hasAttribute("data-fbo-"+t)&&("lightbox"===t&&"boolean"==typeof e[t]&&(e[t]=e[t]?"yes":"no"),i.element.setAttribute("data-fbo-"+t,e[t]),"width"!==t&&"height"!==t||(i.element.style[t]=e[t]))}this._resizeEmbed({element:i.element,payloadContainer:i.container,linkElement:i.link,publicationUrl:i.url,embedId:t,ratioPadding:i.ratioPadding,image:i.image,icon:i.icon})},c.prototype._getPublicationThumbLink=function(t){return this.THUMBNAIL_URL+encodeURIComponent(t)+"&size=400"},c.prototype._getSelfhostPublicationThumbLink=function(t,e,i){let o=t.split("#")[0].split("?")[0];return i&&(o=t.split(i)[0]),o.lastIndexOf("/")===o.length-1&&(o=o.slice(0,o.length-1)),o+"/"+(e||"files/assets/cover300.jpg")},c.prototype._sendAnalytics=function(e,i,o){this._ajax(e,(function(t,e){200!==e.status&&console.log(e)}),'{"RecordOnly":true,"Url":"'+i+'","EmbedDomain":"'+t.g.location.hostname+'"'+(o?',"EmbedMethod":"'+o+'"':"")+"}")},c.prototype._ajax=function(t,e,i,o){if(Date.now()-this.lastRequestTime{this._ajax(t,e,i,o)}),100);this.lastRequestTime=Date.now();const n=new XMLHttpRequest;try{n.open(i?"POST":"GET",t,1),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.setRequestHeader("Content-type","application/json"),o&&(n.timeout=o),n.onreadystatechange=function(){n.readyState>3&&e&&e(n.responseText,n)},n.send(i)}catch(t){window.console&&console.error(t)}},c.prototype._receiveMessage=function(t){if(!t.data)return;const{fbPublicationUrl:e,action:i,localStorageFallback:o}=t.data;if(e&&e.includes(t.origin))for(const e in this.embeds){if(!this.embeds.hasOwnProperty(e))continue;const{contentWindow:n,lightboxWindow:s,url:l}=this.embeds[e];if([n,s].includes(t.source))switch(i){case"getLocalStorageFallback":const t={action:"localStorageFallback",localStorageFallback:JSON.parse(localStorage.getItem(`localStorageFallback-${e}`))};n&&n.postMessage(t,l),s&&s.postMessage(t,l);break;case"saveLocalStorageFallback":localStorage.setItem(`localStorageFallback-${e}`,JSON.stringify(o));break;case"openMobileLightbox":this.openMobileLightbox(e);break;case"closeLightbox":this.closeMobileLightbox(e);break;default:n&&n.postMessage("auth",l),s&&s.postMessage("auth",l)}}},c.prototype.openMobileLightbox=function(e){const i=this;let o=this.embeds[e].url+(-1===this.embeds[e].url.indexOf("?")?"?lightbox=true":"&lightbox=true");this.embeds[e].urlHash&&(o+="#"+this.embeds[e].urlHash),this.lightbox=t.g.document.createElement("div"),this.lightbox.style.position="fixed",this.lightbox.style.zIndex="9999",this.lightbox.style.top="0",this.lightbox.style.left="0",this.lightbox.style.width="100%",this.lightbox.style.height="100%",this.lightbox.style.opacity="0",this.lightbox.style.backgroundColor="#aaaaaa",this.lightbox.style.transition="opacity .5s ease-in-out",this.iframe=t.g.document.createElement("iframe"),this.iframe.style.width="100%",this.iframe.style.height="100%",this.iframe.setAttribute("type","text/html"),this.iframe.setAttribute("scrolling","no"),this.iframe.setAttribute("frameborder","0"),this.iframe.setAttribute("allowfullscreen","allowfullscreen"),this.iframe.setAttribute("allow","accelerometer; autoplay; encrypted-media; fullscreen *; gyroscope; picture-in-picture;"),this.iframe.setAttribute("src",o),this.setViewport(!1),this.lightbox.appendChild(this.iframe),setTimeout((function(){i.embeds[e].lightboxWindow=i.iframe.contentWindow}),10),t.g.document.body.appendChild(this.lightbox),t.g.scrollTo(0,-1),setTimeout((function(){const o=t.g.document.body.clientWidth/window.innerWidth;1!==o?(i.scale=o,t.g.scrollTo(0,-1),setTimeout((function(){t.g.scrollTo(0,-1),setTimeout((function(){i.lightbox.style.transformOrigin="top left",i.lightbox.style.transform="scale("+1/o+","+1/o+")",i.lightbox.style.height=t.g.innerHeight*o+"px",i.lightbox.style.width=t.g.innerWidth*o+"px",i.lightbox.style.opacity="1"}),100)}),200)):(i.lightbox.style.opacity="1",i.lightbox.style.height=t.g.innerHeight+"px",i.lightbox.style.width=t.g.innerWidth+"px"),i.mobileLightboxOpened=!0,t.g.addEventListener("resize",i.onMobileResizeBound),i.currentLigtboxId=e,t.g.history&&t.g.history.pushState&&(t.g.history.pushState({lightbox:!0},null,t.g.location.href),addEventListener("popstate",i.closeMobileLightboxBound))}),500)},c.prototype.closeMobileLightbox=function(e){e=e||this.currentLigtboxId;const i=this;t.g.history&&t.g.history.pushState&&removeEventListener("popstate",this.closeMobileLightboxBound),this.mobileLightboxOpened=!1,this.lightbox&&(i.setViewport(!0),setTimeout((function(){i.lightbox.style.opacity="0",setTimeout((function(){t.g.document.body.removeChild(i.lightbox),t.g.removeEventListener("resize",this.onMobileResizeBound),delete i.lightbox,delete i.iframe,delete i.currentLigtboxId,i.embeds[e].lightboxWindow=null,i.mobileLightboxOpened=!1}),1e3)}),0))},c.prototype.setViewport=function(t){let e=document.querySelector('meta[name="viewport"]');if(e)t||(this.savedViewport=e.content);else{if(!document.head||t)return;e=document.createElement("meta"),e.name="viewport",document.head.appendChild(e)}t?this.savedViewport?e.setAttribute("content",this.savedViewport):e&&document.head.removeChild(e):e.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, viewport-fit=cover, interactive-widget=resizes-content")},c.prototype.onMobileResize=function(){if(!this.mobileLightboxOpened)return;const e=this,i=this.userAgentDetector.os.ios&&(736===t.g.innerWidth||414===t.g.innerWidth);this.lightbox.style.width="100%",this.lightbox.style.height=t.g.innerHeight+"px",clearTimeout(this.resizeTimer),t.g.scrollTo(0,-1),this.resizeTimer=setTimeout((function(){const o=t.g.document.body.clientWidth/window.innerWidth;1!==e.scale||1!==o?(e.scale=o,e.lightbox.style.transformOrigin="top left",e.lightbox.style.transform="scale("+1/o+","+1/o+")",e.lightbox.style.height=t.g.innerHeight*o+"px",e.lightbox.style.width=t.g.innerWidth*o+"px"):(i&&t.g.scrollTo(0,-1),e.lightbox.style.height=t.g.innerHeight+"px",e.lightbox.style.width=t.g.innerWidth+"px",e.lightbox.style.transform="initial",e.lightbox.style.transformOrigin="initial")}),500)},c.prototype._runPayload=function(e,i,o,n=!1){if(i+=-1===i.indexOf("?")?"?embed=true":"&embed=true",i+=`&embedId=${o}`,this.embeds[o].isProtected&&(i+="&protected=true"),"true"!==this.embeds[o].wheel&&"yes"!==this.embeds[o].wheel||(i+="&wheel=true"),this.embeds[o].urlHash&&(i+="#"+this.embeds[o].urlHash),this._shouldShowPayload()&&!e.hasChildNodes()){const s=t.g.document.createElement("iframe");s.style.width="100%",s.style.height="100%",n&&(s.style.position="absolute",s.style.top=0,s.style.left=0),s.setAttribute("type","text/html"),s.setAttribute("scrolling","no"),s.setAttribute("frameborder","0"),s.setAttribute("loading","lazy"),s.setAttribute("allowfullscreen","allowfullscreen"),s.setAttribute("allow","accelerometer; autoplay; encrypted-media; fullscreen *; gyroscope; picture-in-picture;"),s.setAttribute("src",i),s.setAttribute("title",this.embeds[o].caption),s.addEventListener("load",(()=>{this.embeds[o].contentWindow=s.contentWindow})),e.appendChild(s),this.embeds[o].iframe=s}},c.prototype._removePayload=function(t,e,i,o){let n=t.firstChild;for(;n;)t.removeChild(n),n=t.firstChild;i&&i.complete&&0!==i.naturalHeight&&(i.style.opacity="1",o.style.display="initial",setTimeout((()=>{o.style.opacity="0.8"}),10)),window.removeEventListener("message",this._receiveMessage,!1)},c.prototype._resizeEmbed=function({element:t,payloadContainer:e,linkElement:i,publicationUrl:o,embedId:n,ratioPadding:s,image:l,icon:r}){const a=this,h=this._getBoundingClientRect(t);if(0!==h.width&&0!==h.height){if(e.style.width=i.style.width=h.width+"px",e.style.height=i.style.height=h.height+"px",this._shouldRunPayload(h)){if(this.mobileLightboxOpened)return;this._runPayload(e,o,n,!!s),s?(e.style.position="relative",e.style.display="inline-block",e.style.paddingTop=s,e.style.height=0):e.style.display="inline",i.style.display="none"}else if(this._removePayload(e,n,l,r),t.style.minHeight=null,e.style.display="none",s?(i.style.position="relative",i.style.display="inline-block",i.style.paddingTop=s,i.style.height=0):i.style.display="block",this.embeds[n].image){const t=this.embeds[n].image,e=t.naturalWidth,o=t.naturalHeight,s=i.getBoundingClientRect(),l=s.width/s.height,r=e/o;e>0&&o>0&&s.height>0&&s.width>0&&(t.style.height=l>r?s.height:o*s.width/e,t.style.width=l>r?e*s.height/o:s.width)}}else setTimeout((function(){a._resizeEmbed({element:t,payloadContainer:e,linkElement:i,publicationUrl:o,embedId:n,ratioPadding:s,image:l,icon:r})}),200)},c.prototype._getPayloadMinWidth=function(){return 400},c.prototype._getPayloadMinHeight=function(){return 200},c.prototype._getEmbedDefaultWidth=function(){return 250},c.prototype._getEmbedDefaultHeight=function(){return 150},c.prototype._shouldRunPayload=function(t){return t.width>=this._getPayloadMinWidth()&&t.height>=this._getPayloadMinHeight()&&this._shouldShowPayload()},c.prototype._shouldShowPayload=function(){return!!this.version},c.prototype._getPublicationThumbIcon=function(){return"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIxLjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MCA1MCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNTAgNTA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7b3BhY2l0eTowLjk7fQoJLnN0MXtmaWxsOm5vbmU7c3Ryb2tlOiNGRkZGRkY7c3Ryb2tlLXdpZHRoOjI7fQo8L3N0eWxlPgo8ZyBpZD0iUGFnZS0xIj4KCTxnIGlkPSJWaWV3LUljb24iIHRyYW5zZm9ybT0idHJhbnNsYXRlKC02NC4wMDAwMDAsIC04NS4wMDAwMDApIj4KCQk8ZyBpZD0iX3gzMV8uLXZpZXciIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIwLjAwMDAwMCwgMjAuMDAwMDAwKSI+CgkJCTxnIGlkPSJHcm91cC00IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg0NC4wMDAwMDAsIDY1LjAwMDAwMCkiPgoJCQkJPGcgaWQ9Ikdyb3VwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMS4wMDAwMDAsIDkuMDAwMDAwKSIgY2xhc3M9InN0MCI+CgkJCQkJPHBhdGggaWQ9IlJlY3RhbmdsZV8yXyIgY2xhc3M9InN0MSIgZD0iTTEzLDdIMkMxLjQsNywxLDcuNCwxLDh2MThjMCwwLjYsMC40LDEsMSwxaDI1YzAuNiwwLDEtMC40LDEtMVY4YzAtMC42LTAuNC0xLTEtMWgtMi43CgkJCQkJCSIvPgoJCQkJCTxwYXRoIGlkPSJSZWN0YW5nbGVfMV8iIGNsYXNzPSJzdDEiIGQ9Ik0xNCw2LjZ2MTkuOGwxMC01VjEuNkwxNCw2LjZ6Ii8+CgkJCQk8L2c+CgkJCTwvZz4KCQk8L2c+Cgk8L2c+CjwvZz4KPC9zdmc+Cg=="},c.prototype._getWindowWidth=function(){return t.g.innerWidth||t.g.document.documentElement.clientWidth||t.g.document.body.clientWidth},c.prototype._getWindowHeight=function(){return t.g.innerHeight||t.g.document.documentElement.clientHeight||t.g.document.body.clientHeight},c.prototype._getBoundingClientRect=function(t){const e=t.getBoundingClientRect();return{width:e.width||e.right-e.left,height:e.height||e.bottom-e.top,left:e.left,right:e.right,top:e.top,bottom:e.bottom}},c.prototype._getElementsByClass=function(e,i){if(void 0===i&&(i=t.g.document),"function"==typeof i.getElementsByClassName)return i.getElementsByClassName(e);{const t=[],o=i.getElementsByTagName("*");for(const i in o)if(Object.prototype.hasOwnProperty.call(o,i)&&"object"==typeof o[i]){const n=Object.prototype.hasOwnProperty.call(o[i],"className")?o[i].className:o[i].getAttribute("className"),s=null===n?[]:n.split(" ");-1!==this._indexOf(s,e)&&t.push(o[i])}return t}},c.prototype._indexOf=function(t,e){if(null===t)return-1;const i=t.length;for(let o=0;o