<style>
  body.tny-anon-active #field_5_24,
  body.tny-anon-active #field_5_25,
  body.tny-anon-active #field_5_43,
  body.tny-anon-active #field_5_42 > .gfield_label,
  body.tny-anon-active #field_5_42 > legend,
  body.tny-anon-active #field_5_42 .gform-field-label--type-field {
    display: none !important;
  }
</style>

<script>
function applyAnonStateFromCode() {
  var codeInput = document.querySelector('#input_5_10');
  var anonCheckbox = document.querySelector('#choice_5_42_1');

  if (!codeInput) return;

  var isAnon = codeInput.value.toUpperCase().includes('-ANONYMOUS');

  document.body.classList.toggle('tny-anon-active', isAnon);

  if (anonCheckbox) {
    anonCheckbox.checked = isAnon;

    if (isAnon && !anonCheckbox.dataset.locked) {
      anonCheckbox.dataset.locked = '1';
      anonCheckbox.addEventListener('click', function(e) {
        if (document.body.classList.contains('tny-anon-active')) {
          e.preventDefault();
          anonCheckbox.checked = true;
        }
      });
    }
  }
}

document.addEventListener('DOMContentLoaded', function() {
  applyAnonStateFromCode();

  var codeInput = document.querySelector('#input_5_10');
  if (codeInput) {
    codeInput.addEventListener('input', applyAnonStateFromCode);
    codeInput.addEventListener('change', applyAnonStateFromCode);
    codeInput.addEventListener('blur', applyAnonStateFromCode);
  }
});

document.addEventListener('gform_post_render', applyAnonStateFromCode);
</script>
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://tapestryofny.org/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://tapestryofny.org/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://tapestryofny.org/wp-sitemap-posts-kadence_element-1.xml</loc></sitemap><sitemap><loc>https://tapestryofny.org/wp-sitemap-posts-story-1.xml</loc></sitemap><sitemap><loc>https://tapestryofny.org/wp-sitemap-taxonomies-tny_medium-1.xml</loc></sitemap><sitemap><loc>https://tapestryofny.org/wp-sitemap-taxonomies-tny_grade_band-1.xml</loc></sitemap><sitemap><loc>https://tapestryofny.org/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
