<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/**
 * AVWP Public JS
 * 
 * Age Verification for WordPress utilizes the following open source javascript plugin. Thanks Michael!
 *
 * Plugin: ageCheck.js
 * Description: A simple plugin to verify user's age. Uses sessionStorage API to store if user is verified - only kept until browser is closed.
 * Options can be passed for easy customization.
 * Author: Michael Soriano
 * Author's website: http://fearlessflyer.com
 *
 */
(function ($) {
  "use strict";
  $.ageCheck = function (options) {
    const settings = $.extend({
      bgImage: '',
      minAge: 18,
      redirectTo: "",
      redirectOnFail: "",
      title: "Age Verification",
      copy: "You must be [age] years old to enter.",
      btnYes: "YES",
      btnNo: "NO",
      successTitle: "Success!",
      successText: "You are now being redirected back to the site...",
      successMessage: "show",
      failTitle: "Sorry",
      failText: "You are not old enough to view this site...",
      failMessage: "show",
      cookieDays: 30,
      adminDebug: "",
      beforeContent: "",
      afterContent: "",
      logoHeight: "",
      logoWidth: "",
    }, options);

    const _this = {
      age: "",
      errors: [],
      setValues() {
        const month = $(".avwp-av .month").val();
        const day = $(".avwp-av .day").val();
        _this.month = month;
        _this.day = day.replace(/^0+/, ""); // remove leading zero
        _this.year = $(".avwp-av .year").val();
      },
      validate() {
        _this.errors = [];
        if (/^([0-9]|[12]\d|3[0-1])$/.test(_this.day) === false) {
          _this.errors.push("Day is invalid or empty");
        }
        if (/^(19|20)\d{2}$/.test(_this.year) === false) {
          _this.errors.push("Year is invalid or empty");
        }
        _this.clearErrors();
        _this.displayErrors();
        return _this.errors.length &lt; 1;
      },
      clearErrors() {
        $(".errors").html("");
      },
      displayErrors() {
        let html = "&lt;ul&gt;";
        for (let i = 0; i &lt; _this.errors.length; i++) {
          html += `&lt;li&gt;&lt;span&gt;x&lt;/span&gt;${_this.errors[i]}&lt;/li&gt;`;
        }
        html += "&lt;/ul&gt;";
        setTimeout(() =&gt; {
          $(".avwp-av .errors").html(html);
        }, 200);
      },
      reCenter(b) {
        b.css("top", `${Math.max(0, (($(window).height() - (b.outerHeight() + 150)) / 2))}px`);
        b.css("left", `${Math.max(0, (($(window).width() - b.outerWidth()) / 2))}px`);
      },
      buildHtml() {
        const copy = settings.copy;
        let html = "";
        html += "&lt;div class=\"avwp-av-overlay\"&gt;&lt;/div&gt;";
        html += "&lt;div class=\"avwp-av\"&gt;";
        if (settings.beforeContent !== "") {
          html += settings.beforeContent;
        }
        if (settings.imgLogo !== "") {
          html += "&lt;img src=\"" + settings.imgLogo + "\" alt=\"" + settings.title + "\" width=\"" + settings.logoWidth + "\" height=\"" + settings.logoHeight + "\" /&gt;";
        }
        if (settings.title !== "") {
          html += `&lt;h2&gt;${settings.title}&lt;/h2&gt;`;
        }
        html += `&lt;p&gt;${copy.replace("[age]", `&lt;strong&gt;${settings.minAge}&lt;/strong&gt;`)}`; + `&lt;/p&gt;`;
        html += `&lt;p&gt;&lt;button class="yes"&gt;${settings.btnYes}&lt;/button&gt;&lt;button class="no"&gt;${settings.btnNo}&lt;/button&gt;&lt;/p&gt;`;
        if (settings.afterContent !== "") {
          html += settings.afterContent;
        }
        html += "&lt;/div&gt;&lt;/div&gt;";
        $("body").append(html);

        $(".avwp-av-overlay").animate({
          opacity: 1,
        }, 500, () =&gt; {
          _this.reCenter($(".avwp-av"));
          $(".avwp-av").css({
            opacity: 1,
          });
        });

        $(".avwp-av .day, .avwp-av .year").focus(function () {
          $(this).removeAttr("placeholder");
        });
      },
      setAge() {
        _this.age = "";
        _this.age = Math.abs(Date.now() - 1970);
      },
      setSessionStorage(key, val) {
        try {
          sessionStorage.setItem(key, val);
          return true;
        } catch (e) {
          return false;
        }
      },
      handleSuccess() {
        const successMsg = `&lt;h2&gt;${settings.successTitle}&lt;/h2&gt;&lt;p&gt;${settings.successText}&lt;/p&gt;`;
        if (settings.messageTime != 0) {
          $(".avwp-av").html(successMsg);
        }
        setTimeout(() =&gt; {
          $(".avwp-av").animate({
            top: "-350px",
          }, settings.successTime, () =&gt; {
            $(".avwp-av-overlay").animate({
              opacity: "0",
            }, settings.messageTime, () =&gt; {
              if (settings.redirectTo !== "") {
                window.location.replace(settings.redirectTo);
              } else {
                $(".avwp-av-overlay, .avwp-av").remove();
              }
            });
          });
        }, settings.messageTime);
      },
      handleUnderAge() {
        const underAgeMsg = `&lt;h2&gt;${settings.failTitle}&lt;/h2&gt;&lt;p&gt;${settings.failText}&lt;/p&gt;`;
        $(".avwp-av").html(underAgeMsg);
        if (settings.redirectOnFail !== "") {
          setTimeout(() =&gt; {
            window.location.replace(settings.redirectOnFail);
          }, settings.messageTime);
        }
      },
    }; // end _this

    // Check for cookie and reture false if it's set.
    var cookiereader = readCookie("age-verification");
    if (cookiereader) {
      if (settings.adminDebug !== "") {
        eraseCookie("age-verification");
      } else {
        return false;
      }
    }

    // Create pop up.
    _this.buildHtml();

    // Successful "YES" button click.
    $(".avwp-av button.yes").on("click", () =&gt; {
      createCookie("age-verification", "true", settings.cookieDays);
      _this.handleSuccess();
    });

    // Successful "NO" button click.
    $(".avwp-av button.no").on("click", () =&gt; {
      _this.handleUnderAge();
    });

    $(window).resize(() =&gt; {
      _this.reCenter($(".avwp-av"));
      setTimeout(() =&gt; {
        _this.reCenter($(".avwp-av"));
      }, 500);
    });
  };
}(jQuery));

jQuery(document).ready(function($) {
    $.ageCheck({
        "bgImage" : object_name.bgImage,
        "minAge" : object_name.minAge,
        "imgLogo" : object_name.imgLogo,
        "logoWidth" : object_name.logoWidth,
        "logoHeight" : object_name.logoHeight,
        "title" : object_name.title,
        "copy" : object_name.copy,
        "btnYes" : object_name.btnYes,
        "btnNo" : object_name.btnNo,
        "redirectOnFail" : object_name.redirectOnFail,
        "successTitle" : object_name.successTitle,
        "successText" : object_name.successText,
        "successMessage" : object_name.successMessage,
        "failTitle" : object_name.failTitle,
        "failText" : object_name.failText,
        "messageTime" : object_name.messageTime,
        "cookieDays" : object_name.cookieDays,
        "adminDebug" : object_name.adminDebug,
        "beforeContent" : object_name.beforeContent,
        "afterContent" : object_name.afterContent
    });

    if (typeof object_name !== "undefined" &amp;&amp; object_name.bgImage) {
        let overlay = document.querySelector(".avwp-av-overlay");
        if (overlay) {
            overlay.style.backgroundImage = `url(${object_name.bgImage})`;
            overlay.style.backgroundRepeat = "no-repeat";
            overlay.style.backgroundPosition = "center";
            overlay.style.backgroundSize = "cover";
            overlay.style.backgroundAttachment = "fixed";
            overlay.style.boxSizing = "border-box";
        }

        let avwpAv = document.querySelector(".avwp-av");
        if (avwpAv) {
            avwpAv.style.boxShadow = "none";
        }
    }
});
</pre></body></html>