var PTB;(($,e,t,i)=>{"use strict";PTB={jsLazy:new Map,cssLazy:new Map,mobile:!!("ontouchstart"in window||navigator.msMaxTouchPoints>0),v:i.ver,hash(e){let t=0;for(let i=e.length-1;i>-1;--i)t=(t<<5)-t+e.charCodeAt(i),t&=t;return t},imagesLoad:e=>new Promise((i=>{if(null!==e){e.length===t&&(e=[e]);const s=[];for(let t=e.length-1;t>-1;--t){let i="IMG"===e[t].tagName?[e[t]]:e[t].getElementsByTagName("img");for(let e=i.legnth-1;e>-1;--e)if(!i[e].complete){let t=i[e];s.push(new Promise(((e,i)=>{t.onload=e,t.onerror=i,t=null})))}}Promise.all(s).finally((()=>{i(e[0])}))}else i()})),loadJs(i,s,n,o){let r=i,a=this.jsLazy.get(r);return a===t&&(a=new Promise(((t,r)=>{if(!0===s)return void requestAnimationFrame(t);!1!==n&&-1===i.indexOf("ver=")&&(n||(n=this.v),i+="?ver="+n);const a=e.createElement("script");a.async=!!o,a.addEventListener("load",(()=>{requestAnimationFrame(t)}),{passive:!0,once:!0}),a.addEventListener("error",r,{passive:!0,once:!0}),a.src=i,requestAnimationFrame((()=>{e.head.appendChild(a)}))})),this.jsLazy.set(r,a)),a},LoadAsync(e,t,i,s){this.loadJs(e,s,i).then(t)},loadCss(i,s,n,o,r){s||(s="ptb_"+this.hash(i));let a=this.cssLazy.get(s);if(a===t)a=new Promise(((t,a)=>{const l=(o?o.getRootNode():e).getElementById(s);if(null!==l&&"print"!==l.media)return void t();const u=e.createElement("link"),c=function(){r||(r="all"),this.media=r;const e=this.id,i=()=>{const s=this.getRootNode().styleSheets;let n=!1;for(let t=s.length-1;t>-1;--t)if(null!==s[t].ownerNode&&s[t].ownerNode.id===e){n=!0;break}!0===n?t():requestAnimationFrame((()=>{i()}))};requestAnimationFrame((()=>{i()}))};!1!==n&&-1===i.indexOf("ver=")&&(n||(n=this.v),i+="?ver="+n),u.rel="stylesheet",u.media="print",u.id=s,u.href=i,u.setAttribute("fetchpriority","low"),"isApplicationInstalled"in navigator?u.onloadcssdefined(c):u.addEventListener("load",c,{passive:!0,once:!0}),u.addEventListener("error",a,{passive:!0,once:!0});let m=o;if(!m){const t=(e.body||e.getElementsByTagName("head")[0]).childNodes;m=t[t.length-1]}requestAnimationFrame((()=>{m.parentNode.insertBefore(u,o?m:m.nextSibling)}))})),this.cssLazy.set(s,a);else if(!0===a)a=Promise.resolve(),this.cssLazy.set(s,a);else if(o){if(null===o.getRootNode().getElementById(s))return this.cssLazy.delete(s),this.loadCss(i,s,n,o,r)}return a},LoadCss(e,t,i,s,n){this.loadCss(e,null,t,i,s).then(n)},is_mobile(){return this.mobile},async init(t=e){const s=i.modules;for(let i in s)if(t.querySelector(s[i].selector)){await this.loadJs(s[i].js);let n=new CustomEvent("ptb_"+i+"_init",{detail:{context:t}});e.body.dispatchEvent(n)}}},window.addEventListener("load",(()=>{$(e).trigger("ptb_loaded",!1),PTB.init()}),{once:!0,passive:!0})})(jQuery,document,void 0,ptb);