PageSourceSearch

https://ithacavoice.org/wp-content/plugins/newspack-plugin/dist/my-account-v1.js?ver=b552d1d9fdcfb54edb34

js ithacavoice.org collected 2026-09-24 09:03:58 UTC 13,259 bytes, 1 lines download raw bytes

1(()=>{"use strict";var e,t,n,a={3887(e,t,n){var a=n(72397);function c(e){if(e.target.closest('[id*="newspack-my-account__"]')){const t=e.target.querySelector('button[type="submit"]');t&&!t.disabled&&(t.disabled=!0,t.classList.add("newspack-ui--loading"))}}function o(e,t,n=null){document.querySelectorAll(e).forEach(e=>{e.addEventListener("click",a=>{a.preventDefault();const c=n?e.getAttribute(n):"",o=t+(c?`-${c}`:""),r=document.getElementById(o);if(r){r.setAttribute("data-state","open"),e.closest("div").classList.remove("newspack-ui--loading");const t=e.closest(".newspack-ui__dropdown");t&&t.classList.remove("active"),jQuery(document.body).trigger("refresh")}})})}(0,a.Qc)(()=>{[...document.querySelectorAll([".newspack-ui--block-on-interaction"].join(","))].forEach(e=>{const t=e.closest("form, div");"button"!==e.tagName.toLowerCase()&&"input"!==e.tagName.toLowerCase()||"form"!==t.tagName.toLowerCase()?e.addEventListener("click",e=>{e.target.closest("form, div").classList.add("newspack-ui--loading")}):t.addEventListener("submit",e=>{e.target.classList.add("newspack-ui--loading")})});const e=window.newspackUI?.notices?.createNotice;e&&document.querySelectorAll(".woocommerce-message:not(.woocommerce-info):not(.woocommerce-message--info), .wc-block-components-notice-banner.is-success").forEach(t=>{const n=t.textContent.trim();n&&(e(n),t.remove())}),document.querySelectorAll(".woocommerce-notices-wrapper:empty").forEach(e=>e.remove())}),(0,a.Qc)(()=>{const e=document.querySelector(".newspack-my-account__navigation-topbar__button .newspack-ui__button");let t;if(e){const n=e.dataset.labelOpen||e.getAttribute("aria-label"),a=e.dataset.labelClose||n;t=t=>{e.setAttribute("aria-expanded",t?"true":"false"),e.setAttribute("aria-label",t?a:n)},t(document.body.classList.contains("navigation-open")),e.addEventListener("click",()=>{const e=document.body.classList.toggle("navigation-open");t(e)})}document.addEventListener("keydown",e=>{"Escape"===e.key&&document.body.classList.contains("navigation-open")&&(document.body.classList.remove("navigation-open"),t&&t(!1))})}),(0,a.Qc)(function(){const e=document.getElementById("newspack-my-account__reset-password");if(e){const t=document.getElementById("newspack-my-account__reset-password-modal");t&&e.addEventListener("click",e=>{e.preventDefault(),t.setAttribute("data-state","open")})}const t=document.querySelector("#delete-account .newspack-ui__button");if(t){const e=document.getElementById("newspack-my-account__delete-account");if(e){const n=t=>{t.preventDefault(),e.setAttribute("data-state","open")};t.addEventListener("click",n)}}}),(0,a.Qc)(function(){Array.from(document.querySelectorAll(".subscription_details .button.cancel, .newspack-my-account__subscription--actions .cancel")).forEac
1h(e=>{const t=document.getElementById("newspack-my-account__confirm-subscription-cancellation");if(t){e.classList.remove("wcs_block_ui_on_click");const n=e=>{e.preventDefault(),t.setAttribute("data-state","open")};e.addEventListener("click",n)}});const e=document.getElementById("newspack-my-account__confirm-leave-group");e&&document.querySelectorAll(".newspack-my-account__subscription--leave-group").forEach(t=>{t.addEventListener("click",t=>{t.preventDefault(),e.setAttribute("data-state","open")})})}),(0,a.Qc)(function(){o(".newspack-my-account__add-payment-method","newspack-my-account__add-payment-method"),o(".newspack-my-account__delete-payment-method","newspack-my-account__delete-payment-method","data-payment-method"),o(".newspack-my-account__edit-address","newspack-my-account__edit-address","data-address-type"),o(".newspack-my-account__delete-address","newspack-my-account__delete-address","data-address-type"),document.addEventListener("submit",c);const e=document.querySelector(".woocommerce-PaymentMethod:first-child");e&&e.classList.add("active")}),n(13521),window.newspackRAS=window.newspackRAS||[],(0,a.Qc)(()=>{[...document.querySelectorAll(".wcs-switch-link")].forEach(e=>{e.addEventListener("click",t=>{const n=new URL(e.getAttribute("href")).searchParams.get("switch-subscription"),a=document.querySelector('.newspack__subscription-tiers[data-subscription-id="'+n+'"]');a&&(t.preventDefault(),a.setAttribute("data-state","open"))})})}),(0,a.Qc)(function(){const e=document.querySelector(".newspack-my-account__group_subscription__content");if(!e)return;const t=parseInt(e.getAttribute("data-subscription-id"),10),n=newspackMyAccountV1?.rest?.base_url,a=newspackMyAccountV1?.rest?.namespaces?.group,c=newspackMyAccountV1?.rest?.nonce,o="function"==typeof newspackUI?.notices?.createNotice?newspackUI.notices.createNotice:(e,t)=>console.warn("[group-subscriptions]",t,e),r=document.getElementById("newspack-my-account__group_subscription--invite-member"),i=[...document.querySelectorAll(".newspack-my-account__subscription--invite-member")];i&&r&&i.forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),r.setAttribute("data-state","open")})});const s=document.getElementById("newspack-my-account__group_subscription--confirm-remove-member");if(s){const e=s.querySelector("[data-remove-member-id]"),t=s.querySelector("[data-member-name]");document.addEventListener("click",n=>{const a=n.target.closest(".newspack-my-account__group_subscription__remove-member");a&&(n.preventDefault(),e&&(e.value=a.getAttribute("data-member-id")||""),t&&(t.textContent=a.getAttribute("data-member-name")||""),a.closest(".newspack-ui__dropdown")?.classList.remove("active"),s.setAttribute("data-state","open"))})}const u=`${n}${a}/invite-link`,d=[...document.querySelectorAll(".newspack-my-account__group_subscription__invite-link__copy")],l=[...document.querySelectorAll(".newspack-my-account__group_subscription__invite-link__regenerate")],p=[...document.querySelectorAll(".newspack-my-account__group_subscription__invite-link__disable")],m=document.getElementById("newspack-my-account__group_subscription--confirm-regenerate-link"),_=document.getElementById("newspack-my-account__group_subscription--confirm-disable-link"),y=[...document.querySelectorAll(".newspack-my-account__group_subscription__invite-link__confirm-regenerate")],b=[...document.querySelectorAll(".newspack-my-account__group_subscription__invite-link__confirm-disable")];m&&y.forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),m.setAttribute("data-state","open")})}),_&&b.forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),_.setAttribute("data-state","open")})});const f=(e=!0)=>{[...y,...b].forEach(t=>{const n=t.closest("li")||t;if(e){const e=n.classList.contains("hidden");n.classList.remove("hidden"),e&&(n.classList.add("newspack-my-account__group_subscription__entering"),parseFloat(getComputedStyle(n).animationDuration)>0?n.addEventListener("animationend",()=>n.classList.remove("newspack-my-account__group_subscription__entering"),{once:!0}):n.classList.remove("newspack-my-account__group_subscription__entering"))}else n.classList.add("hidden")}),[...document.querySelectorAll('.newspack-ui__modal-container[data-state="open"]')].forEac
1h(e=>e.setAttribute("data-state","closed"))},v=async e=>{if(!e)return!1;try{return await navigator.clipboard.writeText(e),!0}catch(t){try{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();const n=document.execCommand("copy");return document.body.removeChild(t),n}catch(e){return!1}}},w=e=>`${newspackMyAccountV1?.labels?.invite_link_copy_failed||"Couldn't copy the invite link to your clipboard. Copy it manually:"} ${e}`,k=()=>"undefined"!=typeof performance&&performance.now?performance.now():Date.now(),g=e=>{const t=k()-e;return t<500?new Promise(e=>setTimeout(e,500-t)):Promise.resolve()},h=async(e,t)=>{e.classList.add("newspack-ui__button--loading"),e.setAttribute("aria-busy","true"),e.setAttribute("disabled","");try{return await t()}finally{e.classList.remove("newspack-ui__button--loading"),e.removeAttribute("aria-busy"),e.removeAttribute("disabled")}},A=n=>h(n.currentTarget,async()=>{const a=n.currentTarget.getAttribute("data-error-text"),r=k();try{const n=await fetch(u,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":c},body:JSON.stringify({subscription_id:t})}),i=await n.json();if(await g(r),!n.ok||!i||!i.url){const e=i&&i.message||a;return void o(e,"error")}const s=!!e.getAttribute("data-invite-link");if(e.setAttribute("data-invite-link",i.url),f(!0),await v(i.url)){const e=s?newspackMyAccountV1?.labels?.invite_link_regenerated||"New invite link copied. Any older link no longer works.":newspackMyAccountV1?.labels?.invite_link_copied||"Invite link copied.";o(e)}else o(w(i.url),"error")}catch(e){await g(r),o(a,"error")}});d.forEach(t=>{t.addEventListener("click",async t=>{t.preventDefault();const n=e.getAttribute("data-invite-link");n?await v(n)?o(newspackMyAccountV1?.labels?.invite_link_copied||"Invite link copied."):o(w(n),"error"):A(t)})}),l.forEach(e=>{e.addEventListener("click",async e=>{e.preventDefault(),A(e)})}),p.forEach(n=>{n.addEventListener("click",async n=>{n.preventDefault(),(n=>{h(n.currentTarget,async()=>{const a=n.currentTarget.getAttribute("data-error-text"),r=k();try{const n=await fetch(u,{method:"DELETE",credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":c},body:JSON.stringify({subscription_id:t})}),i=await n.json();if(await g(r),!n.ok){const e=i&&i.message||a;return void o(e,"error")}o(newspackMyAccountV1?.labels?.invite_link_disabled||"Invite link disabled. You can create a new link any time."),e.removeAttribute("data-invite-link"),f(!1)}catch(e){await g(r),o(a,"error")}})})(n)})});const E=document.getElementById("newspack-my-account__group_subscription--rename"),L=E?.querySelector(".newspack-my-account__group--rename-form"),S=E?.querySelector(".newspack-my-account__group--rename-input"),q=[...document.querySelectorAll(".newspack-my-account__group--rename")],O=[...document.querySelectorAll("[data-group-name]")];if(E&&L&&S){const e=parseInt(L.getAttribute("data-subscription-id"),10);let t=S.value;q.forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),S.value=t,E.setAttribute("data-state","open"),window.requestAnimationFrame(()=>{S.focus(),S.select()})})}),L.addEventListener("submit",r=>{r.preventDefault();const i=L.querySelector(".newspack-my-account__group--rename-save"),s=L.getAttribute("data-error-text"),u=S.value.trim();return h(i,async()=>{const r=k();try{const i=await fetch(`${n}${a}/name`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":c},body:JSON.stringify({subscription_id:e,name:u})}),d=await i.json();if(await g(r),!i.ok||!d||"string"!=typeof d.name)return void o(d&&d.message||s,"error");t=u,O.forEach(e=>{e.textContent=d.name}),E.setAttribute("data-state","closed"),o(newspackMyAccountV1?.labels?.group_name_updated||"Name updated.")}catch(e){await g(r),o(s,"error")}})})}})}},c={};function o(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={id:e,loaded:!1,exports:{}};return a[e](n,n.exports,o),n.loaded=!0,n.exports}
1o.m=a,e=[],o.O=(t,n,a,c)=>{if(!n){var r=1/0;for(d=0;d<e.length;d++){for(var[n,a,c]=e[d],i=!0,s=0;s<n.length;s++)(!1&c||r>=c)&&Object.keys(o.O).every(e=>o.O[e](n[s]))?n.splice(s--,1):(i=!1,c<r&&(r=c));if(i){e.splice(d--,1);var u=a();void 0!==u&&(t=u)}}return t}c=c||0;for(var d=e.length;d>0&&e[d-1][2]>c;d--)e[d]=e[d-1];e[d]=[n,a,c]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var c=Object.create(null);o.r(c);var r={};t=t||[null,n({}),n([]),n(n)];for(var i=2&a&&e;("object"==typeof i||"function"==typeof i)&&!~t.indexOf(i);i=n(i))Object.getOwnPropertyNames(i).forEach(t=>r[t]=()=>e[t]);return r.default=()=>e,o.d(c,r),c},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.j=3731,(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var a=n.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=n[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{var e={3731:0};o.O.j=t=>0===e[t];var t=(t,n)=>{var a,c,[r,i,s]=n,u=0;if(r.some(t=>0!==e[t])){for(a in i)o.o(i,a)&&(o.m[a]=i[a]);if(s)var d=s(o)}for(t&&t(n);u<r.length;u++)c=r[u],o.o(e,c)&&e[c]&&e[c][0](),e[c]=0;return o.O(d)},n=globalThis.webpackChunknewspack=globalThis.webpackChunknewspack||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var r=o.O(void 0,[4223],()=>o(3887));r=o.O(r)})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.