!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self,function(){var n=e.Cookies,o=e.Cookies=t();o.noConflict=function(){return e.Cookies=n,o}}())}(this,(function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var t=function t(n,o){function r(t,r,i){if("undefined"!=typeof document){"number"==typeof(i=e({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u].split(";")[0]));return document.cookie=t+"="+n.write(r,t)+c}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],o={},r=0;r<t.length;r++){var i=t[r].split("="),c=i.slice(1).join("=");try{var u=decodeURIComponent(i[0]);if(o[u]=n.read(c,u),e===u)break}catch(e){}}return e?o[e]:o}},remove:function(t,n){r(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(n)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});return t}));
jQuery(document).ready(function(t){const a=ps_ajax.rest_url+"passster/v1";function e(){switch(ps_ajax.cookie_duration_unit){case"days":default:return parseInt(ps_ajax.cookie_duration);case"hours":return new Date((new Date).getTime()+60*ps_ajax.cookie_duration*60*1e3);case"minutes":return new Date((new Date).getTime()+60*ps_ajax.cookie_duration*1e3)}}function s(){const t="pts="+Math.floor(Date.now()/1e3);return location.origin+location.pathname+(location.search?location.search+"&"+t:"?"+t)+(location.hash||"")}function r(){const t=Cookies.get("passster");return t?t.split("|").filter(t=>t.length>0):[]}async function n(t){const s=await async function(t){try{const e=await fetch(a+"/hash",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:t})});return(await e.json()).hash||""}catch(t){return""}}(t);if(s){const t=r();t.includes(s)||t.push(s),Cookies.set("passster",t.join("|"),{expires:e(),sameSite:"strict"})}}function i(t){const a=r();a.includes(t)||a.push(t),Cookies.set("passster",a.join("|"),{expires:e(),sameSite:"strict"})}function o(a,e,r,n){if(!ps_ajax.disable_cookie&&n&&i(n),a.redirect)window.location.replace(a.redirect);else if(ps_ajax.unlock_mode){if(e.find(".passster-error").hide(),a.requires_reload)return void(window.location.href=s());if(a.content){let s=a.content;ps_ajax.shortcodes&&t.each(ps_ajax.shortcodes,function(t,a){s=s.replace(t,a)}),e.replaceWith(s)}r&&window.location.replace(r)}else window.location.href=s()}function c(t,a){const e=t.find(".passster-error");e.text(a||"An error occurred."),e.show().fadeOut(3500)}async function p(t,e,s,r,n,i,p){try{const r=await fetch(a+"/captcha",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,type:e,post_id:ps_ajax.post_id,area_id:n,redirect:i,protection:p||""})}),d=await r.json();d.success?o(d,s,i,e.replace("_v2","").replace("_v3","")):c(s,d.error)}catch(t){c(s,"Captcha validation failed.")}}ps_ajax.link_pass&&(ps_ajax.disable_cookie||(ps_ajax.link_pass.length<25?n(atob(ps_ajax.link_pass)).then(()=>{window.location.replace(ps_ajax.permalink+"?pts="+Math.floor(Date.now()/1e3))}):(i(ps_ajax.link_pass),window.location.replace(ps_ajax.permalink+"?pts="+Math.floor(Date.now()/1e3))))),t(".passster-submit").on("click",async function(e){e.preventDefault();const s=t(this),r=s.attr("data-psid"),i=t("#"+r),p=i.find(".passster-password"),d=parseInt(s.attr("data-post-id"))||ps_ajax.post_id,l=i.find("form")[0];if(l&&!l.checkValidity())return void l.reportValidity();const h=p.val(),u=(p.attr("data-protection-type")||"password").replace(/-/g,"_"),f=parseInt(p.attr("data-area"))||0,_=parseInt(p.attr("data-list"))||0,w=p.attr("data-lists")||"",y=p.attr("data-protection")||"",m=s.attr("data-acf")||"",j=s.attr("data-redirect")||"",k=parseInt(s.attr("data-term-id"))||0,x=i.closest(".passster-protected-content"),g=x.length?x.attr("data-block-id"):"";i.find(".ps-loader").css("display","block");try{const t=await fetch(a+"/unlock",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:h,type:u,post_id:d,area_id:f,block_id:g,list_id:_,lists:w,protection:y,acf:m,redirect:j,term_id:k})}),e=await t.json();i.find(".ps-loader").css("display","none"),e.success?(ps_ajax.disable_cookie||await n(h),o(e,i,j,null)):(c(i,e.error),p.val(""))}catch(t){i.find(".ps-loader").css("display","none"),c(i,"An error occurred. Please try again.")}}),t(".recaptcha-form-v2").length>0&&window.grecaptcha&&grecaptcha.ready(function(){grecaptcha.render("ps-recaptcha-v2",{sitekey:ps_ajax.recaptcha_key,callback(a){const e=t(".recaptcha-v2-submit").attr("data-psid"),s=t("#"+e),r=s.find(".recaptcha-v2-submit");p(a,"recaptcha_v2",s,0,parseInt(r.attr("data-area"))||0,r.attr("data-redirect")||"",r.attr("data-protection")||"")}})}),t(".recaptcha-form").on("submit",function(a){a.preventDefault();const e=t(this).find(".passster-submit-recaptcha"),s=e.attr("data-psid"),r=t("#"+s),n=parseInt(e.attr("data-area"))||0,i=e.attr("data-redirect")||"",o=e.attr("data-protection")||"";window.grecaptcha&&grecaptcha.ready(function(){grecaptcha.execute(ps_ajax.recaptcha_key,{action:"validate_input"}).then(function(t){p(t,"recaptcha_v3",r,0,n,i,o)})})}),t(".hcaptcha-form").on("submit",function(a){a.preventDefault();const e=t(this).find(".passster-submit-recaptcha"),s=e.attr("data-psid"),r=t("#"+s),n=parseInt(e.attr("data-area"))||0,i=e.attr("data-redirect")||"",o=e.attr("data-protection")||"";window.hcaptcha&&hcaptcha.execute({async:!0}).then(({response:t})=>{p(t,"hcaptcha",r,0,n,i,o)}).catch(t=>{c(r,t.message||"hCaptcha error")})}),t(".turnstile-form").length>0&&window.turnstile&&window.turnstile.ready(function(){window.turnstile.render(".passster-turnstile",{sitekey:ps_ajax.turnstile_key,callback(a){const e=t(".passster-submit-turnstile"),s=e.attr("data-psid");p(a,"turnstile",t("#"+s),0,parseInt(e.attr("data-area"))||0,e.attr("data-redirect")||"",e.attr("data-protection")||"")}})}),t(document).on("click","#ps-logout",async function(){try{const t=await fetch(a+"/logout",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"}});(await t.json()).success&&(Cookies.set("passster","",{expires:0,sameSite:"strict"}),window.location.href=s())}catch(t){window.location.href=s()}})});
(()=>{"use strict";const n=function(n,e){0<n.length&&Array.prototype.slice.call(n,0).forEach((function(n,t){e(n,t)}))},e=["sme-animation-bounce-in","sme-animation-bounce-down","sme-animation-fade-in","sme-animation-fade-in-up","sme-animation-fade-in-down","sme-animation-fade-in-left","sme-animation-fade-in-right"];document.addEventListener("DOMContentLoaded",(()=>{const t=document.querySelectorAll('[class*="sme-animation-"]');if("undefined"==typeof IntersectionObserver)return void n(t,(n=>{e.forEach((e=>{n.classList.remove(e)}))}));const i=(n,t)=>{n.forEach((n=>{if(!n.isIntersecting)return;const i=n.target;e.forEach((n=>{if(!i.classList.contains(n))return;i.classList.replace(n,`${n}-fired`);const e=i.getAttribute("data-sme-animation-delay");0<e&&(i.style.animationDelay=`${e}s`);const t=i.getAttribute("data-sme-animation-duration");0<t&&(i.style.animationDuration=`${t}s`)})),t&&t.unobserve(i)}))},a=new IntersectionObserver(i,{root:null,rootMargin:"-25% 0px",threshold:[0,.25,.5,.75,1]});n(t,(n=>{const t=n.getBoundingClientRect(),o=window.innerHeight;0<=t.top&&t.top<=o&&i([{target:n,isIntersecting:!0,intersectionRatio:1}]),a.observe(n),n.addEventListener("animationend",(()=>{e.forEach((e=>{n.classList.remove(`${e}-fired`)}))}),!1)}))}),!1)})();