\nYou can be the difference in a child making a decision to follow Jesus at camp this summer. Will you help a kid get to Eagle Lake Camps of The Navigators this summer? Give here »\n
',position:"append"});})("body")}}, R_722072_157_1_2_1:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
var el,ctx=vwo_$(x);
/*vwo_debug log("Revert","addElement","body"); vwo_debug*/(el=vwo_$('[vwo-element-id="1744048814304"]')).remove();})("body")}}, C_722072_157_1_2_2:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x);
/*vwo_debug log("content",".pushdown-copy > p:nth-of-type(1)"); vwo_debug*/el=vwo_$(".pushdown-copy > p:nth-of-type(1)"),vwo_$(".pushdown-copy > p:nth-of-type(1)").each((function(){this.__vwoControlOuterHTML=this.__vwoControlOuterHTML||this.outerHTML,!vwo_$(this).find('[vwo-op-1744062807509-0=""]').length&&vwo_$(this).append('Will you help a kid get to Eagle Lake Camps of The Navigators this summer?'),vwo_$(this).nonEmptyContents().eq(0).replaceWith2(document.createTextNode("You can be the difference in a child making a decision to follow Jesus at camp this summer. "))})),el=vwo_$(".pushdown-copy > p:nth-of-type(1)");})(".pushdown-copy > p:nth-of-type(1)")}}, R_722072_157_1_2_2:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
var el,ctx=vwo_$(x);
/*vwo_debug log("Revert","content",".pushdown-copy > p:nth-of-type(1)"); vwo_debug*/(el=vwo_$(".pushdown-copy > p:nth-of-type(1)")).revertContentOp(),el=vwo_$(".pushdown-copy > p:nth-of-type(1)");})(".pushdown-copy > p:nth-of-type(1)")}}, C_722072_79_1_2_0:{ fn:function(){return (function(x) { try{
var _vwo_sel = vwo_$("");
!vwo_$("head").find("#1734023425003").length && vwo_$('head').append(_vwo_sel);
const DEFAULT_DONATION_FREQUENCY="One-Time";function getQueryParam(e){let t=window.location.search.match(e+"=([^&]*)");return t?t[1]:void 0}function initOnElement(e,t,n){const i=e.getElementsByTagName(t);return i.length?n(i):setTimeout(initOnElement,500,e,t,n)}window.DonationForm=window.DonationForm||{recurring_checkbox:null,submit_button:null,other_amt:null,gift_array_elements:[],onetime_gift_array:[],recurring_gift_array:[10,20,30,40],setRecurring:function(e){console.log("setRecurring",e,this.recurring_checkbox),(!this.recurring_checkbox.checked&&e||this.recurring_checkbox.checked&&!e)&&(console.log("checked",this.recurring_checkbox.checked,"(before click)"),this.recurring_checkbox.click(),console.log("checked",this.recurring_checkbox.checked,"(after click)"))},selectGiftArray:function(e){this.gift_array_elements[e].click()},modifyGiftArray:function(e){this.gift_array_elements.forEach((t,n)=>{t.value=e[n],t.textContent="$"+e[n]})},setOneTimeGiftArrayValues:function(){let e=this;this.gift_array_elements.forEach(t=>{e.onetime_gift_array.push(parseInt(t.value))})},setFirstNamePersonalization:function(e){const t=void 0===getQueryParam("first_name")||""===getQueryParam("first_name")?"Friend":getQueryParam("first_name");for(let n=0;n<=e.length-1;n++)e[n].innerHTML.includes("[Name]")&&(e[n].innerHTML=e[n].innerHTML.replace(/\[[^\]]*]/,t)),e[n].innerHTML.includes("Friend")&&(e[n].innerHTML=e[n].innerHTML.replace("Friend",t))},init:function(){document.querySelectorAll(".tab").forEach(e=>{e.addEventListener("click",(function(e){this.classList.add("selected"),this.classList.contains("recurring")?(document.querySelector(".tab.onetime").classList.remove("selected"),DonationForm.setRecurring(!0)):(document.querySelector(".tab.recurring").classList.remove("selected"),DonationForm.setRecurring(!1))}))}),this.setOneTimeGiftArrayValues(),this.setRecurring(!1),this.selectGiftArray(0)}},initOnElement(document,"c-donate-community-staff-information",(function(e){initOnElement(e[0],"div",(function(e){e[0].querySelectorAll("div.slds-col")[0].classList.add("page-image");const t=e[0].querySelectorAll("div.slds-col")[1];t.classList.add("donation-form-content");const n=t.querySelectorAll("div,lightning-formatted-rich-text");for(let e=0;e<=n.length-1;e++)0==e&&n[e].classList.add("page-title"),1==e&&n[e].classList.add("page-action-text"),2==e&&n[e].classList.add("donation-form"),3==e&&n[e].classList.add("bottom-title"),4==e&&n[e].classList.add("page-text");DonationForm.setFirstNamePersonalization(n[4].shadowRoot.querySelectorAll("div p")),n[1].before(n[4]);const i=document.createElement("div");i.classList.add("tabs"),i.innerHTML='
One-Time Gift
Recurring Gift
',n[2].before(i),initOnElement(n[2],"c-donate-community-donate-buttons",(function(e){initOnElement(e[0].shadowRoot.querySelector("div"),"div",(function(e){for(let t=0;t const TOKEN_NAME = \"apr25_el_pushdown\";\nconst DELAY = 1 /* seconds */;\nconst storageApi = sessionStorage /* permanent: localStorage, session: sessionStorage*/;\n(function init() {\n if (typeof window.jQuery === 'undefined')\n return console.warn(\"jQuery not defined yet.\"), setTimeout(init, 50);\n //\n jQuery(function() {\n (function pushdown($) {\n //console.log('pushdown', $('.na-pushdown-wrapper').length);\n if (!$('.na-pushdown-wrapper').length) return setTimeout(pushdown, 500);\n \n var pushdown = {\n element: $('.na-pushdown-wrapper'),\n\n open: function () {\n\n var self = this;\n var height = this.element.outerHeight();\n \n /* HANDLE SEMI-STICKY DONATE BUTTON */\n const pushdownDOMElement = this.element.get(0);\n const stickybar = document.querySelector('.na-pushdown-wrapper'),\n masthead = document.querySelector(\"header#masthead\"),\n wrapperDonateBtn = document.querySelector(\".menu-donate-container\");\n \n function scrollspy () {\n const stickybar = /*pushdownDOMElement || */document.querySelector('.na-pushdown-wrapper'),\n masthead = document.querySelector(\"header#masthead\");\n function scrollTriggerAction (scrollTrigger, el, gt = (el, sd = 0, st = 0) => { console.log(\"gt\"); }, lt = (el, sd = 0, st = 0) => { console.log(\"lt\"); }) {\n let mobile = window.innerWidth < 768,\n scrollDepth = window.scrollY;\n return scrollDepth > scrollTrigger ? gt(el, scrollDepth, scrollTrigger): lt(el, scrollDepth, scrollTrigger);\n }\n const scrollActions = {\n lt: (k, s = 0, t = 0) => { // scroll depth not past a certain amount\n //console.log(\"lt\", s, t);\n let wrapperDonateBtn = k,\n scrollY = s;\n if (window.innerWidth >= 992) { // larger screens\n if ( storageApi.getItem(TOKEN_NAME) === \"shown\" ) { // stickybar visible\n const stickybarHeight = () => stickybar.offsetHeight;\n wrapperDonateBtn.style.setProperty(\"position\", \"absolute\");\n wrapperDonateBtn.style.setProperty(\"top\", \"20px\");\n masthead.style.setProperty(\"position\", \"fixed\");\n masthead.style.setProperty(\"top\", (stickybarHeight() - s) + 'px', \"important\"); // set the margin-top to the stickybar height\n masthead.style.setProperty(\"margin-top\", \"unset\", \"important\");\n /*masthead.style.setProperty(\"transform\", `translateY(${stickybarHeight()}px)`);\n if (stickybarHeight() - scrollY < 0) {*/\n //wrapperDonateBtn.style.setProperty(\"position\", \"fixed\");\n /*wrapperDonateBtn.style.setProperty(\"top\", \"0px\");/*\n wrapperDonateBtn.style.setProperty(\"transform\", `translateY(${scrollY - stickybarHeight()}px)`);\n }*/\n } else { // stickybar not visible\n wrapperDonateBtn.style.setProperty(\"position\", \"absolute\");\n wrapperDonateBtn.style.setProperty(\"top\", \"20px\");\n masthead.style.setProperty(\"position\", \"absolute\");\n masthead.style.setProperty(\"top\", 0 + 'px', \"important\");\n if (s > 20) {\n wrapperDonateBtn.style.setProperty(\"position\", \"fixed\");\n wrapperDonateBtn.style.setProperty(\"top\", \"0px\");\n }\n }\n } else { // smaller screens\n const stickybarHeight = () => stickybar.offsetHeight;\n wrapperDonateBtn.style.setProperty(\"position\", \"absolute\", \"important\");\n wrapperDonateBtn.style.setProperty(\"top\", (stickybarHeight() - scrollY) + 'px');\n //masthead.style.setProperty(\"margin-top\", \"unset\", \"important\");\n if ( stickybarHeight() - scrollY > 0) { // scroll depth not past stickybar\n masthead.style.setProperty(\"top\", (stickybarHeight() - scrollY) + 'px', \"important\"); // set the margin-top to the stickybar height\n masthead.style.setProperty(\"margin-top\", \"unset\", \"important\");\n //masthead.style.setProperty(\"transform\", `translateY(${stickybarHeight() - scrollY}px)`);\n wrapperDonateBtn.style.setProperty(\"position\", \"absolute\", \"important\");\n wrapperDonateBtn.style.setProperty(\"top\", (stickybarHeight() - scrollY) + 'px');\n } else if (stickybarHeight() - scrollY < 0) { // scroll depth past stickybar\n masthead.style.setProperty(\"position\", \"fixed\", \"important\");\n masthead.style.setProperty(\"top\", \"0\", \"important\");\n //masthead.style.setProperty(\"transform\", `translateY(${0}px)`);\n wrapperDonateBtn.style.setProperty(\"top\", '0');\n } else { // scroll depth at stickybar\n masthead.style.setProperty(\"top\", (stickybarHeight() - scrollY) + 'px', \"important\"); // set the top to the stickybar height\n //masthead.style.setProperty(\"transform\", `translateY(${stickybarHeight() - scrollY}px)`);\n masthead.style.setProperty(\"margin-top\", \"unset\", \"important\");\n wrapperDonateBtn.style.setProperty(\"position\", \"absolute\", \"important\");\n wrapperDonateBtn.style.setProperty(\"top\", (stickybarHeight() - scrollY) + 'px');\n }\n }\n },\n gt: (k, s = 0, t = 0) => { // scroll depth is past a certain amount\n //console.log(\"gt\", s, t);\n let wrapperDonateBtn = k,\n scrollY = s;\n if (window.innerWidth >= 992) { // larger screens\n if ( storageApi.getItem(TOKEN_NAME) === \"shown\" ) { // stickybar visible\n const stickybarHeight = () => stickybar.offsetHeight;\n wrapperDonateBtn.style.setProperty(\"position\", \"fixed\");\n wrapperDonateBtn.style.setProperty(\"top\", \"0\");\n masthead.style.setProperty(\"position\", \"fixed\");\n masthead.style.setProperty(\"top\", (stickybarHeight() - s) + 'px', \"important\"); // set the margin-top to the stickybar height\n masthead.style.setProperty(\"margin-top\", \"unset\", \"important\");\n /*masthead.style.setProperty(\"transform\", `translateY(${stickybarHeight()}px)`);\n if (stickybarHeight() - scrollY < 0) {*/\n //wrapperDonateBtn.style.setProperty(\"position\", \"fixed\");\n /*wrapperDonateBtn.style.setProperty(\"top\", \"0px\");/*\n wrapperDonateBtn.style.setProperty(\"transform\", `translateY(${scrollY - stickybarHeight()}px)`);\n }*/\n } else { // stickybar not visible\n wrapperDonateBtn.style.setProperty(\"position\", \"fixed\");\n wrapperDonateBtn.style.setProperty(\"top\", \"20px\");\n masthead.style.setProperty(\"position\", \"absolute\");\n masthead.style.setProperty(\"top\", 0 + 'px', \"important\");\n if (s > 20) {\n wrapperDonateBtn.style.setProperty(\"position\", \"fixed\");\n wrapperDonateBtn.style.setProperty(\"top\", \"0px\");\n }\n }\n } else { // smaller screens\n const stickybarHeight = () => stickybar.offsetHeight;\n wrapperDonateBtn.style.setProperty(\"position\", \"absolute\", \"important\");\n wrapperDonateBtn.style.setProperty(\"top\", (stickybarHeight() - scrollY) + 'px');\n //masthead.style.setProperty(\"margin-top\", \"unset\", \"important\");\n if ( stickybarHeight() - scrollY > 0) { // scroll depth not past stickybar\n masthead.style.setProperty(\"top\", (stickybarHeight() - scrollY) + 'px', \"important\"); // set the margin-top to the stickybar height\n //masthead.style.setProperty(\"transform\", `translateY(${stickybarHeight() - scrollY}px)`);\n masthead.style.setProperty(\"margin-top\", \"unset\", \"important\");\n wrapperDonateBtn.style.setProperty(\"position\", \"absolute\", \"important\");\n wrapperDonateBtn.style.setProperty(\"top\", (stickybarHeight() - scrollY) + 'px');\n } else if (stickybarHeight() - scrollY < 0) { // scroll depth past stickybar\n masthead.style.setProperty(\"position\", \"fixed\", \"important\");\n masthead.style.setProperty(\"top\", \"0\", \"important\");\n //masthead.style.setProperty(\"transform\", `translateY(${0}px)`);\n wrapperDonateBtn.style.setProperty(\"top\", '0');\n } else { // scroll depth at stickybar\n masthead.style.setProperty(\"top\", (stickybarHeight() - scrollY) + 'px', \"important\"); // set the top to the stickybar height\n //masthead.style.setProperty(\"transform\", `translateY(${stickybarHeight() - scrollY}px)`);\n masthead.style.setProperty(\"margin-top\", \"unset\", \"important\");\n wrapperDonateBtn.style.setProperty(\"position\", \"absolute\", \"important\");\n wrapperDonateBtn.style.setProperty(\"top\", (stickybarHeight() - scrollY) + 'px');\n }\n }\n }\n };\n const triggerDepth = () => pushdownDOMElement.offsetHeight + /*masthead.offsetHeight*/ 16;\n scrollTriggerAction(triggerDepth(), document.querySelector(\".menu-donate-container\"), scrollActions.gt, scrollActions.lt);\n window.addEventListener('scroll', scrollTriggerAction.bind(null, triggerDepth(), document.querySelector(\".menu-donate-container\"), scrollActions.gt, scrollActions.lt ));\n window.addEventListener('resize', scrollTriggerAction.bind(null, triggerDepth(), document.querySelector(\".menu-donate-container\"), scrollActions.gt, scrollActions.lt ));\n window.addEventListener('resize', (e) => {\n window.dispatchEvent(new Event('scroll', { bubbles: true }));\n }); // trigger the update by scrolling 1px\n }\n \n if (window.scrollY <= pushdownDOMElement.offsetHeight)\n window.scrollTo(0,0);\n \n $('.na-pushdown-wrapper').slideDown({\n duration: 'fast',\n step: function () {\n if (window.scrollY < pushdown.element.outerHeight()) {\n masthead.style.setProperty(\"top\", pushdown.element.outerHeight() + 'px', \"important\");\n window.innerWidth < 992 && wrapperDonateBtn.style.setProperty(\"top\", pushdown.element.outerHeight() + 'px', \"important\");\n }\n if (window.scrollY <= pushdownDOMElement.offsetHeight)\n window.scrollTo(0,0);\n },\n complete: function () {\n /*console.log(pushdownDOMElement.offsetHeight + 'px');\n masthead.removeAttribute(\"style\");\n masthead.style.setProperty(\"top\", pushdownDOMElement.offsetHeight + 'px', \"important\");*/\n storageApi.setItem(TOKEN_NAME, \"shown\"); // remember \"shown\" state\n scrollspy(); // active the scrollspy code\n window.dispatchEvent(new Event('resize'));\n if (window.scrollY <= pushdownDOMElement.offsetHeight)\n window.scrollTo(0,0);\n }\n });\n this.element.find('.close').html('×');\n },\n\n close: function () {\n\n const stickybar = document.querySelector('.na-pushdown-wrapper'),\n masthead = document.querySelector(\"header#masthead\"),\n wrapperDonateBtn = document.querySelector(\".menu-donate-container\");\n $('.na-pushdown-wrapper').slideUp({\n duration: 'fast',\n step: function () {\n masthead.style.setProperty(\"top\", pushdown.element.outerHeight() + 'px', \"important\");\n window.innerWidth < 992 && wrapperDonateBtn.style.setProperty(\"top\", pushdown.element.outerHeight() + 'px', \"important\");\n },\n complete: function () {\n masthead.style.setProperty(\"margin-top\", \"unset\", \"important\");\n masthead.style.setProperty(\"position\", \"fixed\", \"important\");\n masthead.style.setProperty(\"top\", \"0\", \"important\");\n wrapperDonateBtn.style.setProperty(\"position\", \"absolute\");\n window.innerWidth >= 992 ? wrapperDonateBtn.style.setProperty(\"top\", \"20px\") : wrapperDonateBtn.style.setProperty(\"top\", \"0\");\n }\n });\n\n //$('.na-pushdown-wrapper .close').html('');\n \n $(window).off(\"resize\", this.resize);\n storageApi.setItem(TOKEN_NAME, \"dismissed\"); // remember \"dismissed\" state\n\n },\n\n resize: function () {\n var height = pushdown.element.outerHeight();\n },\n\n init: function () {\n\n if (storageApi.getItem(TOKEN_NAME) === \"shown\" )\n return; // do not shown if shown this session\n\n if (storageApi.getItem(TOKEN_NAME) === \"dismissed\" )\n return; // do not shown if dismissed this session\n\n this.open();\n \n const pushdownDOMElement = document.querySelector('.na-pushdown-wrapper'),\n masthead = document.getElementById(\"masthead\");\n pushdownDOMElement.style.position = \"relative\";\n masthead.before(pushdownDOMElement);\n document.getElementById(\"donate-menu\").style.top = '0';\n $('.menu-donate-container').css('position', \"absolute\");\n $('.menu-donate-container').css('top', \"0px\");\n \n /*[...document.querySelectorAll('[data-action=\"dismiss\"]')].forEach((btn) => {\n let target = btn.getAttribute(\"data-target\");\n if (target)\n btn.addEventListener('click', this.close);\n });*/\n this.element.find(\".btn-dismiss\").on('click', this.close);\n // const [ btnYes, btnNo ] = [...document.querySelector(\".div-block-15\").children];\n // btnYes.onclick = (e) => { storageApi.setItem(TOKEN_NAME, \"dismissed\"); };\n // btnNo.onclick = this.close;\n $(window).resize(this.resize);\n\n }\n }\n\n //var run = parseInt(window.localStorage.getItem('na-show-pushdown') || 1);\n //if (run < 3) {\n setTimeout(function () {\n //window.localStorage.setItem('na-show-pushdown', run+1);\n pushdown.init();\n }, DELAY * 1000);\n //}\n })(jQuery);\n });\n})();\n \n");vwo_$('head').append(_vwo_sel);return vwo_$('head')[0] && vwo_$('head')[0].lastChild;})("HEAD")}}, R_722072_157_1_3_0:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
var ctx=vwo_$(x),el;
/*vwo_debug log("Revert","content",""); vwo_debug*/;
el=vwo_$('[vwo-element-id="1744062807520"]');
el.revertContentOp().remove();})("HEAD")}}, C_722072_79_1_3_0:{ fn:function(){return (function(x) { try{
var _vwo_sel = vwo_$("");
!vwo_$("head").find("#1734023424983").length && vwo_$('head').append(_vwo_sel);
const DEFAULT_DONATION_FREQUENCY="One-Time";function getQueryParam(e){let t=window.location.search.match(e+"=([^&]*)");return t?t[1]:void 0}function initOnElement(e,t,n){const i=e.getElementsByTagName(t);return i.length?n(i):setTimeout(initOnElement,500,e,t,n)}window.DonationForm=window.DonationForm||{recurring_checkbox:null,submit_button:null,other_amt:null,gift_array_elements:[],onetime_gift_array:[],recurring_gift_array:[10,20,30,40],setRecurring:function(e){console.log("setRecurring",e,this.recurring_checkbox),(!this.recurring_checkbox.checked&&e||this.recurring_checkbox.checked&&!e)&&(console.log("checked",this.recurring_checkbox.checked,"(before click)"),this.recurring_checkbox.click(),console.log("checked",this.recurring_checkbox.checked,"(after click)"))},selectGiftArray:function(e){this.gift_array_elements[e].click()},modifyGiftArray:function(e){this.gift_array_elements.forEach((t,n)=>{t.value=e[n],t.textContent="$"+e[n]})},setOneTimeGiftArrayValues:function(){let e=this;this.gift_array_elements.forEach(t=>{e.onetime_gift_array.push(parseInt(t.value))})},setFirstNamePersonalization:function(e){const t=void 0===getQueryParam("first_name")||""===getQueryParam("first_name")?"Friend":getQueryParam("first_name");for(let n=0;n<=e.length-1;n++)e[n].innerHTML.includes("[Name]")&&(e[n].innerHTML=e[n].innerHTML.replace(/\[[^\]]*]/,t)),e[n].innerHTML.includes("Friend")&&(e[n].innerHTML=e[n].innerHTML.replace("Friend",t))},init:function(){document.querySelectorAll(".tab").forEach(e=>{e.addEventListener("click",(function(e){this.classList.add("selected"),this.classList.contains("recurring")?(document.querySelector(".tab.onetime").classList.remove("selected"),DonationForm.setRecurring(!0)):(document.querySelector(".tab.recurring").classList.remove("selected"),DonationForm.setRecurring(!1))}))}),this.setOneTimeGiftArrayValues(),this.setRecurring(!1),this.selectGiftArray(0)}},initOnElement(document,"c-donate-community-staff-information",(function(e){initOnElement(e[0],"div",(function(e){e[0].querySelectorAll("div.slds-col")[0].classList.add("page-image");const t=e[0].querySelectorAll("div.slds-col")[1];t.classList.add("donation-form-content");const n=t.querySelectorAll("div,lightning-formatted-rich-text");for(let e=0;e<=n.length-1;e++)0==e&&n[e].classList.add("page-title"),1==e&&n[e].classList.add("page-action-text"),2==e&&n[e].classList.add("donation-form"),3==e&&n[e].classList.add("bottom-title"),4==e&&n[e].classList.add("page-text");DonationForm.setFirstNamePersonalization(n[4].shadowRoot.querySelectorAll("div p")),n[1].before(n[4]);const i=document.createElement("div");i.classList.add("tabs"),i.innerHTML='
One-Time Gift
Recurring Gift
',n[2].before(i),initOnElement(n[2],"c-donate-community-donate-buttons",(function(e){initOnElement(e[0].shadowRoot.querySelector("div"),"div",(function(e){for(let t=0;t p:nth-of-type(1)"); vwo_debug*/el=vwo_$(".pushdown-copy > p:nth-of-type(1)"),vwo_$(".pushdown-copy > p:nth-of-type(1)").each((function(){this.__vwoControlOuterHTML=this.__vwoControlOuterHTML||this.outerHTML,!vwo_$(this).find('[vwo-op-1744062807520-0=""]').length&&vwo_$(this).append('Will you help a kid get to Eagle Lake Camps of The Navigators this summer?'),vwo_$(this).nonEmptyContents().eq(0).replaceWith2(document.createTextNode("You can be the difference in a child making a decision to follow Jesus at camp this summer. "))})),el=vwo_$(".pushdown-copy > p:nth-of-type(1)");})(".pushdown-copy > p:nth-of-type(1)")}}, R_722072_157_1_3_2:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
var el,ctx=vwo_$(x);
/*vwo_debug log("Revert","content",".pushdown-copy > p:nth-of-type(1)"); vwo_debug*/(el=vwo_$(".pushdown-copy > p:nth-of-type(1)")).revertContentOp(),el=vwo_$(".pushdown-copy > p:nth-of-type(1)");})(".pushdown-copy > p:nth-of-type(1)")}}, C_722072_157_1_3_3:{ fn:function(log,nonce=''){return (function(x) {})(".na-pushdown-wrapper,.mw-w-button,input.mw-w-button,#page,.pushdownbar,.div-block-16,.pushdownheadline,.pushdown,.div-block-7,.div-block-8,.paragraph-2,.div-block-15,.mw-btn,.mw-btn:visited,.mw-white,.mw-btn.mw-white,.mw-btn.mw-whitemw-btn:link,.na-pushdown-wrapper .close span,.na-pushdown-wrapper .close,.fa-angle-down:before,/*#donate-menu,.close-wrapper,.btn-dismiss,#masthead .close-menu,.pushdown .pushdown__row,.pushdown .pushdown__col,.pushdown .pushdown__content,.pushdown .pushdown-copy > *:last-child,.pushdown .grid-area,.pushdown .grid-card,.pushdown .grid-card div > p,.pushdown .grid-card div > p > span,.pushdown .grid-card .flex-col,.pushdown .grid-card div > p > b,.pushdown .grid-card button,.pushdown div div.centered,.pushdown div a.other-link,.pushdown .pushdown__close,.pushdown .grid-card p:nth-of-type(3),.pushdown .grid-card p > b")}}, R_722072_157_1_3_3:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
})(".na-pushdown-wrapper,.mw-w-button,input.mw-w-button,#page,.pushdownbar,.div-block-16,.pushdownheadline,.pushdown,.div-block-7,.div-block-8,.paragraph-2,.div-block-15,.mw-btn,.mw-btn:visited,.mw-white,.mw-btn.mw-white,.mw-btn.mw-whitemw-btn:link,.na-pushdown-wrapper .close span,.na-pushdown-wrapper .close,.fa-angle-down:before,/*#donate-menu,.close-wrapper,.btn-dismiss,#masthead .close-menu,.pushdown .pushdown__row,.pushdown .pushdown__col,.pushdown .pushdown__content,.pushdown .pushdown-copy > *:last-child,.pushdown .grid-area,.pushdown .grid-card,.pushdown .grid-card div > p,.pushdown .grid-card div > p > span,.pushdown .grid-card .flex-col,.pushdown .grid-card div > p > b,.pushdown .grid-card button,.pushdown div div.centered,.pushdown div a.other-link,.pushdown .pushdown__close,.pushdown .grid-card p:nth-of-type(3),.pushdown .grid-card p > b")}}, R_722072_157_1_3_1:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
var el,ctx=vwo_$(x);
/*vwo_debug log("Revert","addElement","body"); vwo_debug*/(el=vwo_$('[vwo-element-id="1744062806843"]')).remove();})("body")}}, R_722072_156_1_2_0:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
var ctx=vwo_$(x),el;
/*vwo_debug log("Revert","content",""); vwo_debug*/;
el=vwo_$('[vwo-element-id="1744048774370"]');
el.revertContentOp().remove();})("HEAD")}}, C_722072_156_1_2_0:{ fn:function(log,nonce=''){return (function(x) {;var _vwo_sel=vwo_$("");vwo_$('head').append(_vwo_sel);return vwo_$('head')[0] && vwo_$('head')[0].lastChild;})("HEAD")}}, C_722072_79_1_3_1:{ fn:function(){return (function(x) { try{
var _vwo_sel = vwo_$("");
!vwo_$("head").find("#1734023425072").length && vwo_$('head').append(_vwo_sel);
!vwo_$("body").find('[vwo-op-1734023424996=""]').length && vwo_$("body").vwoElement({ "html": "", "position": "append", "customBodyElement": true, "addElementId": 1734023424996 })
'esversion: 8';
const ASK_AMOUNT = 10;
const DONATION_INTERRUPTER_GROUP_NAME = "StaffDP" /* all the popups in this test will share the same group name so that the metrics for them are all counted in the test */;
//
//
//
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//
//
//
window.HTMLElement.prototype.getSlot = window.HTMLElement.prototype.getSlot || function () { return this.querySelector('slot') || this.shadowRoot.querySelector('slot'); }
window.HTMLElement.prototype.getSlotNodes = window.HTMLElement.prototype.getSlotNodes || function (n) { return (parseInt(n) !== 'NaN' && n >= 0) ? Array.from(this.getSlot().assignedNodes({ flatten: true })).at(n) : Array.from(this.getSlot().assignedNodes({ flatten: true })); }
window.HTMLElement.prototype.shadowChildren = window.HTMLElement.prototype.shadowChildren || function (n) { return (parseInt(n) !== 'NaN' && n >= 0) ? Array.from(this.shadowRoot.children).at(n) : Array.from(this.shadowRoot.children); }
function waitForElement (el, retry, onSuccess = (el) => {}, delay = 30) {
if ( !el ) return setTimeout(retry, delay);
onSuccess(el);
return true;
}
//
function vwoSendEvent (eventName = "customEvent", object = { label: '' }) {
window.VWO = window.VWO || [];
VWO.event = VWO.event || function () {VWO.push(["event"].concat([].slice.call(arguments)));};
VWO.event(eventName, object);
console.log(eventName, object);
}
const vwoSendEvent_DonationInterrupter = (action, group = undefined) => {
if (action === "Shown")
vwoSendEvent("custom_DonationInterrupter_Shown", { shown: true, group: group });
else if (action === "Yes")
vwoSendEvent("custom_DonationInterrupter_Yes", { yes: true, group: group });
else if (action === "No")
vwoSendEvent("custom_DonationInterrupter_No", { donationInterrupterNoClicked: true, group: group });
};
//
function getBasketId (tokenName = `LSSIndex:LOCAL{"namespace":"c"}`){
const token = localStorage.getItem(tokenName);
if (!token) {
return console.error("getBasketId:", "Failed to get token from localStorage:", tokenName);
} else {
try {
const { basket } = JSON.parse(token); // get basket property from the object
return basket;
} catch (error) {
return console.error("getBasketId:", "Failed to parse JSON:", token);
}
}
}
function getBasket (basketId) {
let token = localStorage.getItem(basketId);
if (!token) {
const emptyBasket = {
"Id": "localBasket",
"Basket_Items__r": [],
"Total__c": 0,
"Number_of_Items__c": 0,
"itemMap": {}
};
console.info("getBasket:", "Failed to get token from localStorage:", basketId, "\nAttempting to create a new empty basket and retrying...");
localStorage.setItem(basketId, JSON.stringify(emptyBasket));
token = localStorage.getItem(basketId);
}
if (!token) {
return console.error("getBasket:", "Failed to get token from localStorage:", basketId);
} else {
try {
return JSON.parse(token); // get basket property from the object
} catch (error) {
return console.error("getBasket:", "Failed to parse JSON:", token);
}
}
}
function addItemToBasket (item) {
const basketId = getBasketId(),
basket = getBasket(basketId);
if ( basket.Basket_Items__r.find(item => item.id === item.Id) ) { // check if the item Id is already in the cart
const foundItem = basket.Basket_Items__r.find(item => item.Id);
foundItem["Quantity__c"] += 1; // update the quantity of the found item
foundItem["Total_Amount__c"] = foundItem["Amount__c"] * foundItem["Quantity__c"]; // update the quantity of the found item
foundItem["Total_Deductible_Amount__c"] = foundItem["Amount__c"] * foundItem["Quantity__c"]; // update the quantity of the found item
} else {
basket.Basket_Items__r.push(item); // add the item to the array
}
basket.Number_of_Items__c = basket.Basket_Items__r.length; // update item count
basket.Total__c = basket.Basket_Items__r.reduce((total, item) => total + item["Amount__c"], 0); // update total amount
basket.itemMap = Object.fromEntries(basket.Basket_Items__r.map((item, index) => ([item.Id, index]))); // update itemMap
return localStorage.setItem(basketId, JSON.stringify(basket));
}
function setAppealCode (sf_ac) {
let queryString;
let searchParams = window.location.search;
if (searchParams.match('sf_ac')) {
const regex = new RegExp(`(${'sf_ac'}=)([^&]*)`);
queryString = searchParams.replace(regex, `$1${sf_ac}`); // replace existing appeal code value
} else {
queryString = searchParams + '&sf_ac=' + sf_ac; // append appeal code
}
window.history.pushState('', '', '?' + queryString);
}
//
function entangleElements (element1, element2, method = 'innerHTML', options = { attributes: true, childList: true, subtree: true }) {
if (!element1 || !element2)
return console.error(`entangleElements: ${!element1 && "element1"}${!element1 && !element2 ? " and " : " "} ${!element2 && "element2"} ${!element1 && !element2 ? "are" : "is"} undefined.`);
console.log("Entangling:\n", element1, ' ', element2, "\nElement 2 will mirror Element 1's values.");
const handleMutation = (mutationList, observer) => { // Callback function to execute when mutations are observed
let lastAttributeValues = {};
for (const mutation of mutationList) {
switch (mutation.type) {
case "attributes":
const { attributeName, oldValue } = mutation;
if (attributeName !== "style") { // ignore changes to style attribute
const currentValue = element1.getAttribute(attributeName);
if (currentValue === null) {
element2.removeAttribute(attributeName); // mirror element 1 attributes on element 2 by removing null value attribute
} else {
element2.setAttribute(attributeName, currentValue); // mirror element 1 attributes on element 2
}
}
break;
default:
element2[method] = element1[method];
break;
}
}
};
const observer = new MutationObserver(handleMutation);
observer.observe(element1, options); // Start observing the target node for configured mutations
return observer;
}
//
//
//
//
function init () {
if (window.VWOInjected) {
console.warn("Do not preview using the VWO Visual Editor.");
return;
}
if (sessionStorage.getItem("NA_DonationInterrupter_StaffDPv2_status") === "dismissed") {
console.warn("Popup already dismissed.");
return;
}
try {
customElements.whenDefined("c-donate-community-staff-information").then(() => {
customElements.whenDefined("c-donate-community-donate-buttons").then(() => {
customElements.whenDefined("lightning-input").then(() => {
const wrapperForm = document.querySelector('c-donate-community-staff-information');
const wrapperFormInteractive = wrapperForm.shadowRoot.querySelector('c-donate-community-donate-buttons').shadowChildren(0);
console.log(wrapperFormInteractive);
/// Interface with the giving form and create a window object
const form = {
getGiftArrayButtons: function () {
let w = wrapperFormInteractive;
return Array.from(w.children).slice(0, Array.from(w.children).indexOf(w.querySelector('.slds-form-element'))).map(x => x.querySelector('button'));
},
getAmount: function () {
const sanitizeAmount = a => a.replace(/[^\d\.]/,''); // remove non-digit characters (except for decimals)
let selected = this.getGiftArrayButtons().filter(x => x.classList.contains("donate-selected"))[0];
if (selected) {
return parseFloat(selected.value);
} else {
selected = wrapperFormInteractive.querySelector('lightning-input').shadowChildren(0).shadowChildren(0).querySelector('input');
return parseFloat(sanitizeAmount(selected.value));
}
console.warn("Amount is not defined: no option is selected.")
return undefined;
},
setAmount: function (n) {
let match;
const otherAmount = wrapperFormInteractive.querySelector('lightning-input').shadowChildren(0).shadowChildren(0).querySelector('input');
for (const button of this.getGiftArrayButtons()) { // iterate over gift array buttons
if (parseFloat(button.value) === parseFloat(n) ) { // if matching button found for amount
otherAmount.value = ''; // clear other amount
button.click(); // click the matching button
return this.getAmount() === parseFloat(n); // return true if the getAmount() matches the input value
}
}
otherAmount.value = parseFloat(n); // set the other amount field value to the input value
otherAmount.dispatchEvent(new Event('change', { bubbles: true })); // trigger a change event to cause the input to be formatted
return this.getAmount() === parseFloat(n); // return true if the getAmount() matches the input value
},
getRecurring: function () {
const checkbox = [...wrapperFormInteractive.querySelector(".slds-grid").querySelectorAll("lightning-input")][0].shadowChildren(0).shadowChildren(0).querySelector('input[type="checkbox"]');
return checkbox.checked;
},
setRecurring: function (toRecurring = true) {
const checkbox = [...wrapperFormInteractive.querySelector(".slds-grid").querySelectorAll("lightning-input")][0].shadowChildren(0).shadowChildren(0).querySelector('input[type="checkbox"]');
const isRecurring = this.getRecurring(), isOnetime = !isRecurring, toOnetime = !toRecurring; // semantic booleans
if ( (isOnetime && toRecurring) || (isRecurring && toOnetime)) {
checkbox.click();
}
return this.getRecurring() === toRecurring;
},
submit: function (btn = this.buttons["Donate Now"]) {
return btn.click();
},
};
//form.giftArrayButtons = form.getGiftArrayButtons();
window.NA = window.NA || {};
window.NA.MiniDonationForm = form;
waitForElement(wrapperFormInteractive.querySelector('button'), init, (el) => { // wait for form buttons
window.NA.MiniDonationForm.buttons = {
"Donate Now": Array.from(wrapperFormInteractive.children).slice(Array.from(wrapperFormInteractive.children).indexOf(wrapperFormInteractive.querySelector('.slds-form-element'))).map(x => x.querySelector('button')).filter(y => y)[0],
"Add to Basket": Array.from(wrapperFormInteractive.children).slice(Array.from(wrapperFormInteractive.children).indexOf(wrapperFormInteractive.querySelector('.slds-form-element'))).map(x => x.querySelector('button')).filter(y => y)[1],
};
window.NA.MiniDonationForm.cloneSubmitButton = function (originalButton = this.buttons["Donate Now"]) {
const clonedButton = originalButton.cloneNode(true); // clone the button and its children
clonedButton.attributes = originalButton.attributes; // copy attributes
clonedButton.id = clonedButton.textContent.trim().replaceAll(' ', '_') + "_copy";
if (clonedButton.style) clonedButton.style = originalButton.style; // copy styles
originalButton.after(clonedButton); // insert the fake button after the original
//entangleElements(originalButton, clonedButton, 'outerHTML'); // quantum entangle the elements via outerHTML -- does not work if the element is fully replaced when state changed
return clonedButton; // return the fake button
};
/// Interface with the Donation Interrupter