PageSourceSearch

https://www.lasillavacia.com/wp-content/plugins/newspack-blocks/dist/modal.js?ver=4.33.1

js lasillavacia.com collected 2026-09-24 08:35:48 UTC 22,384 bytes, 1 lines download raw bytes

1(()=>{"use strict";function e(e,t=!1){const n=e.querySelectorAll('button, [href], input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])');if(0===n.length)return!1;const o=n?.[0];let c;o.focus(),t?(document.addEventListener("keydown",function(e){if(("Tab"===e.key||9===e.keyCode)&&e.shiftKey&&document.activeElement===o){const n=t.contentWindow.document,o=n.getElementById("checkout-after-success");c=null!==o?o:n.getElementById("checkout_cancel"),c.focus(),e.preventDefault()}}),document.getElementById("newspack-a11y-last-element").addEventListener("focus",()=>{o.focus()})):(c=n[n.length-1],document.addEventListener("keydown",function(e){("Tab"===e.key||9===e.keyCode)&&(e.shiftKey?document.activeElement===o&&(c.focus(),e.preventDefault()):document.activeElement===c&&(o.focus(),e.preventDefault()))}))}const t=(e,t={})=>({...t,action:e}),n=["action","action_type","amount","currency","product_id","product_type","quantity","variation_id","variation_ids","is_variable","is_grouped","child_ids","price_summary","newspack_popup_id","prompt_title","gate_post_id","contextual_prompt_post_id","contextual_prompt_placement","contextual_prompt_condition","recurrence","referrer"],o=(e,t="np_modal_checkout_interaction")=>{if("function"==typeof window.gtag&&e){const o={};for(const t of n)e[t]&&("boolean"==typeof e[t]?e[t]=e[t]?"yes":"no":"true"===e[t]?e[t]="yes":"false"===e[t]&&(e[t]="no"),o[t]=e[t].toString());window.gtag("event",t,o)}},c=e=>{if("function"!=typeof window.gtag)return;let n="opened";const{amount:c="",is_variable:a="",is_grouped:r="",price:i="",variation_id:s=""}=e,l={...e};(c||i)&&(l.amount=c||i),a&&!s&&(n="opened_variations"),r&&(n="opened_grouped");const u=t(n,l);o(u)};function a(e,t=null){const n=document.createElement("input");return n.type="hidden",n.name=e,t&&(n.value=t),n}function r(e){e.requestSubmit(e.querySelector('button[type="submit"]'))}function i(e){const t="string"==typeof e?document.getElementById(e):e;if(!t)return console.warn("No container found for checkout data"),{};let n={};if("FORM"===t.tagName){const e=new FormData(t);n=Object.fromEntries(e)}const o=t.dataset.checkout;if(!o)return console.warn("No checkout data found"),n;try{n={...n,...JSON.parse(o)}}catch(e){console.warn("Error parsing checkout data")}const c=new URL(t.ownerDocument.defaultView.location.href);return c.searchParams.get("action_type")&&(n.action_type=c.searchParams.get("action_type")),n}const s=e=>{if("function"!=typeof window.gtag)return;e=e||i("newspack_modal_checkout");const n=t("dismissed",e);o(n)};function l(e){const t=e&&e.dataset?e.dataset.checkout:null;if(!t)return null;try{return JSON.parse(t)}catch(e){return null}}function u(e,t,n=null){const o=e.querySelectorAll(".wp-block-newspack-blocks-checkout-button"),c=null!=n&&""!==String(n);let a=null;return o.forEach(e=>{if(a)return;const o=e.querySelector("form"),r=l(o);r&&String(r.product_id)===String(t)&&(c&&String(r.variation_id)!==String(n)||(a=o))}),a}const d=["after_success_behavior","after_success_url","after_success_button_label","after_success_token","gate_post_id","newspack_popup_id","prompt_title","contextual_prompt_post_id","contextual_prompt_placement","contextual_prompt_condition","coupon","quantity"];const p=["tiered","frequency","untiered"],m=["once","month","year"];const h={gate:"gate_post_id",prompt:"newspack_popup_id"};const f=newspackBlocksModal.newspack_class_prefix,y="newspack_modal_checkout_iframe",_="newspack_modal_checkout_container",w=`${f}__modal`,k="newspack-blocks__modal-variation",g=`${f}__processing-payment-text`,v=newspackBlocksModal.processing_payment_messages;let b=!1,S=newspackBlocksModal.labels.checkout_modal_title,E=null;const q=e=>{e.overlayId&&window.newspackReaderActivation?.overlays&&window.newspackReaderActivation?.overlays.remove(e.overlayId),e.setAttribute("data-state","closed"),document.body.style.overflow="auto"};window.onpageshow=e=>{e.persisted&&(document.querySelectorAll(".modal-processing").forEach(e=>e.classList.remove("modal-processing")),document.querySelectorAll(".non-modal-checkout-loading").forEach(e=>e.classList.remove("non-modal-checkout-loading")),document.querySelectorAll(`.${w}
1-container`).forEach(e=>q(e)))};const A=new CustomEvent("checkout-closed");var L;window.newspackRAS=window.newspackRAS||[],L=()=>{const t=document.querySelector("#newspack_modal_checkout");if(!t)return;const n=t.querySelector(`.${w}__content`),o=a("modal_checkout","1"),L=n.querySelector(`.${f}__spinner`);let $=document.querySelector(".newspack-reader__account-link")?.[0];const R="600px",M=document.createElement("iframe");M.name=y,M.style.height=R,M.style.visibility="hidden";const x=e=>{D.observe(e),"none"!==L.style.display&&(L.style.display="none"),"visible"!==M.style.visibility&&(M.style.visibility="visible"),M._ready=!0};!function(e,t,n){e._ready=!1,e._readyTimer&&clearTimeout(e._readyTimer);let o=!1,c="";function a(){o||(o=!0,clearTimeout(e._readyTimer),t.call(this))}function r(){"complete"===this.readyState&&a.call(this)}function i(){e._ready=!1,n&&n(),e._readyTimer&&clearTimeout(e._readyTimer);const t=e.contentDocument||e.contentWindow?.document;t&&(t.removeEventListener("DOMContentLoaded",a),t.removeEventListener("readystatechange",r))}function s(){if(e._ready)return void i();const t=e.contentDocument||e.contentWindow?.document;t&&0!==t.URL.indexOf("about:")?"complete"===t?.readyState?a.call(t):(t.addEventListener("DOMContentLoaded",a),t.addEventListener("readystatechange",r)):e._readyTimer=setTimeout(s,10)}e._observer||(e._observer=new MutationObserver(e=>{e.forEach(e=>{"attributes"===e.type&&"src"===e.attributeName&&(o=!1,i(),s())})}),e._observer.observe(e,{attributes:!0})),e._locationObserver||(e._locationObserver=setInterval(function(){const t=e.contentDocument||e.contentWindow?.document;t&&t.URL!==c&&(c=t.URL,o=!1,i(),s())},50)),s()}(M,function(){const n=M.contentWindow?.location;if(window.newspackReaderActivation&&n?.href?.includes("order-received")){const e=window.newspackReaderActivation,t=new Proxy(new URLSearchParams(n.search),{get:(e,t)=>e.get(t)});t.email&&(e.setReaderEmail(t.email),e.setAuthenticated(!0))}const o=M?.contentDocument?.querySelector(`#${_}`);if(!o)return;const c=i(o.querySelector("#modal-checkout-product-details")),a=document.createElement("p");a.classList.add(g);let r=[];const s=()=>{r.forEach(e=>clearTimeout(e)),r=[]},l=()=>{L.style.display="none",s(),L.querySelectorAll(`.${g}`).forEach(e=>e.remove())};!function(e,t){e.checkoutCancel?t():e.addEventListener("checkout-cancel",t)}(o,()=>{I()}),function(e,t){e.checkoutPlaceOrderStart?t():e.addEventListener("checkout-place-order-start",t)}(o,e=>{L.querySelectorAll(`.${g}`).forEach(e=>e.remove()),L.style.display="flex",s(),a.textContent=v[0]?.text??"",v.slice(1).forEach(({text:t,delay:n})=>{const o=setTimeout(()=>{e.target.dispatchEvent(new CustomEvent("checkout-place-order-processing")),a.textContent=t},n);r.push(o)}),L.appendChild(a)}),function(e,t){e.checkoutPlaceOrderError?t():e.addEventListener("checkout-place-order-error",t)}(o,l),function(e,t){e.checkoutReady?t():e.addEventListener("checkout-ready",t)}(o,()=>{if(t.initialErrors){const e=document.createElement("div");e.classList.add("woocommerce-error"),e.textContent=t.initialErrors,o.prepend(e),delete t.initialErrors}j(),U(S),M.contentWindow?.newspackBlocksModalCheckout?.checkout_nonce&&(t.checkout_nonce=M.contentWindow.newspackBlocksModalCheckout.checkout_nonce),x(o)}),function(e,t){e.checkoutComplete?t():e.addEventListener("checkout-complete",t)}(o,()=>{window.newspackRAS.push(["checkout_completed",c]),window?.newspackReaderActivation?.refreshNewslettersSignupModal&&window?.newspackReaderActivation?.getReader()?.email&&window.newspackReaderActivation.refreshNewslettersSignupModal(window.newspackReaderActivation.getReader().email),j("small"),U(newspackBlocksModal.labels.thankyou_modal_title),x(o),e(t.querySelector(`.${w}`)),l()}),function(e,t){e.checkoutPlaceOrderCriticalError?t():e.addEventListener("checkout-place-order-critical-error",t)}(o,()=>{var e;(e=E)&&(I(),L.style.display="none",t.initialErrors=newspackBlocksModal.labels.critical_error,e.requestSubmit(e.querySelector('button[type="submit"]')),l())})},()=>{L.style.display="flex"});const C=e=>new Promise((t,n)=>{const o=new URLSearchParams(e);o.append("action","modal_checkout_request"),fetch(newspackBlocksModal.ajax_url+"?"+o.toString()).then(e=>{e.ok||n(e),e.json().then(e=>{t(e.url)}).catch(n)}).catch(n)}),B=()=>"undefined"!=typeof newspack_ras_config&&!newspack_ras_config?.is_logged_in&&!window?.newspackReaderActivation?.getReader?.()?.authenticated&&newspackBlocksModal?.is_registration_required&&window?.newspackReaderActivation?.openAuthModal,P=t=>{const n=!newspackBlocksModal.has_unsupported_payment_gateway;n||t.preventDefault();const o=t.target;o.classList.add("modal-processing"),function(e){if(!e||"function"!=typeof e.querySelector)return!1;
1if(e.closest(".newspack-content-gate__gate"))return!1;const t=function(){let e,t;try{e=window.sessionStorage.getItem("newspack_cta_attribution")}catch(e){return null}if(!e)return null;try{t=JSON.parse(e)}catch(e){return null}return t&&1===t.v&&h[t.type]&&t.id?"number"!=typeof t.ts||Date.now()-t.ts>18e5?null:t:null}();if(!t)return!1;const n=h[t.type];if(e.querySelector(`input[name="${n}"]`))return!1;const o=document.createElement("input");o.type="hidden",o.name=n,o.value=t.id,e.prepend(o)}(o);const u=i(o);if(u.newspack_donate){const e=u.donation_frequency,t=[...o.querySelectorAll(`.donation-tier__${e}, .donation-frequency__${e}`)],n=u.donation_tier_index;let c,a;n?(c=t[n],a=u[`donation_value_${e}`]):(c=t[0],u[`donation_value_${e}_untiered`]?a=u[`donation_value_${e}_untiered`]:(a=u[`donation_value_${e}`],"other"===a&&(a=u[`donation_value_${e}_other`])));const r=i(c);for(const e in r)u[e]=r[e];u.amount=a,u.price_summary=u.summary_template.replace("{{PRICE}}",function(e,t="USD"){return parseFloat(e).toLocaleString(document.documentElement.lang,{style:"currency",currency:t,currencyDisplay:"narrowSymbol"})}(u.amount,u.currency))}u&&Object.keys(u).forEach(e=>{0===o.querySelectorAll('input[name="'+e+'"]').length&&o.prepend(a(e,u[e]))}),u.variation_id||($=t.submitter);const p=document.querySelectorAll(`.${k}`);if(p.forEach(e=>{(B()||n)&&q(e)}),u.is_grouped||u.is_variable&&!u.variation_id){const n=[...p].find(e=>e.dataset.productId===u.product_id);if(n)return n.querySelectorAll(`form[target="${y}"]`).forEach(e=>{!function(e,t,n=d){if(!e||!t)return;const o=e.ownerDocument;n.forEach(n=>{if(e.querySelectorAll(`input[type="hidden"][name="${n}"]`).forEach(e=>e.remove()),function(e,t){return!!e.querySelector(`input[name="${t}"]:not([type="hidden"])`)}(e,n))return;const c=t[n],a=null==c?"":String(c);if(!a)return;const r=o.createElement("input");r.type="hidden",r.name=n,r.value=a,e.prepend(r)})}(e,u);const t=l(e);t&&Object.keys(t).forEach(n=>{0===e.querySelectorAll('input[name="'+n+'"]').length&&e.prepend(a(n,t[n]))})}),t.preventDefault(),o.classList.remove("modal-processing"),O(n),e(n,!1),b||c(u),void document.getElementById("newspack_modal_checkout").setAttribute("data-checkout",JSON.stringify(u))}if(n||B()){if(o.classList.remove("modal-processing"),b||c(u),b=!0,B()){t.preventDefault();const e=C(u);e.then(e=>{window.newspackReaderActivation?.setPendingCheckout?.(e)}),window.newspackReaderActivation.openAuthModal({title:newspackBlocksModal.labels.auth_modal_title,onSuccess:(t,o)=>{e.then(e=>{o?.registered&&n&&(e+=`&${newspackBlocksModal.checkout_registration_flag}=1`),n?r(T(e)):C(u).then(window.location.href=e)}).catch(e=>{console.warn("Unable to generate cart:",e),I()})},onError:()=>{I()},onDismiss:()=>{s(u),b=!1,document.getElementById("newspack_modal_checkout").removeAttribute("data-checkout")},skipSuccess:!0,skipNewslettersSignup:!0,labels:{signin:{title:newspackBlocksModal.labels.signin_modal_title},register:{title:newspackBlocksModal.labels.register_modal_title}},trigger:t.submitter,closeOnSuccess:n})}else N(),document.getElementById("newspack_modal_checkout").setAttribute("data-checkout",JSON.stringify(u));E=o}else C(u).then(e=>{window.location.href=e}),(!u.is_variable||u.variation_id)&&o.querySelectorAll("button[type=submit]:focus").forEach(e=>{e.classList.add("non-modal-checkout-loading");const t=e.innerHTML;e.innerHTML="<span>"+t+"</span>"})},T=e=>{const t=document.createElement("form");t.method="POST",t.action=e,t.target=y,t.style.display="none";const n=document.createElement("button");return n.setAttribute("type","submit"),t.appendChild(n),document.body.appendChild(t),t.addEventListener("submit",P),t},D=new ResizeObserver(e=>{if(!e||!e.length)return;if(!M.contentDocument)return;const o=e[0].contentRect;if(o){const e=.01*Math.max(document.documentElement.clientHeight,window.innerHeight||0)*90-(t.querySelector(`.${w}__header`)?.offsetHeight||0),c=o.top+o.bottom,a=Math.min(c,e);if(0===a)return void(M.style.visibility="hidden");n.style.height=a+"px",M.style.height=a+"px"}}),I=()=>{const e=M?.contentDocument?.querySelector(`#${_}`),o=e?.querySelector('input[name="after_success_url"]'),c=e?.querySelector('input[name="after_success_behavior"]'),a=document?.querySelector(".newspack-newsletters-signup-modal"),r=i(e?.querySelector("#modal
1-checkout-product-details"));e?.checkoutComplete||(async()=>{const e=new FormData;newspackBlocksModal.has_unsupported_payment_gateway||e.append("modal_checkout","1"),e.append("action","abandon_modal_checkout"),e.append("_wpnonce",t.checkout_nonce),t.checkout_nonce=null;try{await fetch(newspackBlocksModal.ajax_url,{method:"POST",body:e})}catch(e){console.warn("Unable to empty cart:",e)}})();const l=!(M.contentDocument&&o&&c&&e?.checkoutComplete);if((l||a)&&(L.style.display="flex",M&&n.contains(M)&&(M._ready=!1,M.src="about:blank",M.style.height=R,M.style.visibility="hidden",n.style.height=R,n.removeChild(M)),D&&D.disconnect(),document.querySelectorAll(`.${w}-container`).forEach(e=>q(e)),$&&$.focus(),document.dispatchEvent(A)),e?.checkoutComplete){const e=()=>{if(o&&c){const e=o.getAttribute("value"),t=c.getAttribute("value");if("custom"===t)window.location.href=e;else if("referrer"===t){const e=document.referrer;let t=!1;if(e)try{new URL(e).origin===window.location.origin&&(window.location.href=e,t=!0)}catch(e){}t||window.history.back()}}window?.newspackReaderActivation?.setPendingCheckout?.(),b=!1};"subscription_switch"!==r.action_type&&window?.newspackReaderActivation?.openNewslettersSignupModal?window.newspackReaderActivation.openNewslettersSignupModal({onSuccess:e,onError:e,closeOnSuccess:l}):e(),l&&(S=newspackBlocksModal.labels.checkout_modal_title,j(),U(S))}else window?.newspackReaderActivation?.setPendingCheckout?.(),s(),b=!1,document.getElementById("newspack_modal_checkout").removeAttribute("data-checkout");document.removeEventListener("keydown",W)},N=o=>{o&&(M.src=o),L.style.display="flex",O(t),n.appendChild(M),t.addEventListener("click",e=>{e.target===t&&I()}),e(t,M),document.addEventListener("keydown",W)},O=e=>{window.newspackReaderActivation?.overlays&&(e.overlayId=window.newspackReaderActivation?.overlays.add()),e.setAttribute("data-state","open"),document.body.style.overflow="hidden"},U=e=>{const n=t.querySelector(`.${w}__header h2`);n&&(n.innerText=e)},j=(e="default")=>{const n=t.querySelector(`.${w}`);n&&("small"===e?n.classList.add(`${w}--small`):n.classList.remove(`${w}--small`))};t.querySelectorAll(`.${w}__close`).forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),I()})}),document.querySelectorAll(".newspack-blocks__modal-variation").forEach(e=>{e.addEventListener("click",t=>{t.target===e&&I()}),e.querySelectorAll(`.${w}__close`).forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),I()})})});const W=e=>{"Escape"===e.key&&I()};document.querySelectorAll(".wpbnbd.wpbnbd--platform-wc, .wp-block-newspack-blocks-checkout-button, .newspack-blocks__modal-variation").forEach(e=>{e.querySelectorAll("form").forEach(e=>{newspackBlocksModal.has_unsupported_payment_gateway||e.prepend(o.cloneNode()),e.target=y,e.addEventListener("submit",P)})});const F=["checkout","type","layout","frequency","amount","other","product_id","variation_id"],H=()=>{const e=new URL(window.location.href);F.forEach(t=>e.searchParams.delete(t)),window.history.replaceState(null,null,e.href)},J=(e,t,n,o=null)=>{const c=function(e,{layout:t,frequency:n,amount:o}){if(!function(e,t,n){return!(!p.includes(e)||!m.includes(t))&&("other"===n?"frequency"===e:/^\d+(\.\d+)?$/.test(n))}(t,n,o))return{status:"invalid-params"};let c=null;for(const a of e.querySelectorAll(".wpbnbd.wpbnbd--platform-wc form")){const e=a.closest(".wpbnbd--tiers-based");if("tiered"===t){if(!e)continue;const t=a.querySelector(`.wpbnbd__tiers__amount [data-frequency-slug="${n}"][data-amount="${o}"]`);if(!t)continue;const r=parseInt(t.getAttribute("data-tier-index"));if(isNaN(r))continue;const i=a.querySelector(`button[data-frequency-slug="${n}"]`);if(!i&&!a.querySelector(`input[name="donation_frequency"][value="${n}"]`))continue;if(!e.hasAttribute("data-tiers-based-ready")){c||(c=a);continue}return{status:"tiered",form:a,frequencyButton:i,tierIndex:r}}if(e)continue;const r=a.querySelector(`input[name="donation_frequency"][value="${n}"]`);if(!r)continue;const i="untiered"===t?a.querySelector(`input[name="donation_value_${n}_untiered"]`):a.querySelector(`input[name="donation_value_${n}"][value="${o}"]`);if(i)return{status:t,form:a,frequencyInput:r,amountInput:i}}return c?{status:"not-ready",form:c}:{status:"no-match"}}(document,{layout:e,frequency:t,amount:n}),a=`layout "${e}", frequency "${t}" and amount "${n}"`;if("invalid-params"===c.status)return console.warn(`Newspack modal checkout: invalid donate trigger parameters (${a}). The checkout was not triggered.`),!1;if("no-match"===c.status)return console.warn(`Newspack modal checkout: no donate form matches ${a}. The checkout was not triggered.`),!1;if("not-ready"===c.status){const c=setTimeout(()=>{console.warn(`Newspack modal checkout: the donate form matching ${a} never finished initializing. The checkout was not triggered; the URL params were kept so a reload can retry.`)},5e3);return document.addEventListener("newspack-tiers-based-ready",()=>{clearTimeout(c),J(e,t,n,o)&&H()},{once:!0}),!1}const{form:i}=c;if("tiered"===c.status){c.frequencyButton&&c.frequencyButton.click();const e=i.querySelector(`button[type="submit"][data-tier-index="${c.tierIndex}"]`);return e?(e.click(),!0):(console.warn(`Newspack modal checkout: no tier submit button matches ${a}. The checkout was not triggered.`),!1)}if(c.frequencyInput.checked=!0,"untiered"===c.status)c.amountInput.value=n;else if("other"===n){c.amountInput.click();const e=i.querySelector(`input[name="donation_value_${t}_other"]`);e&&o&&(e.value=o)}else c.amountInput.checked=!0;return i.checkValidity()?(r(i),!0):(console.warn(`Newspack modal checkout: the donate form rejected the values for ${a}. The checkout was not triggered.`),!1)};(()=>{const e=new URLSearchParams(window.location.search);if(!e.has("checkout"))return;let t=!0;const n=e.get("type");if("donate"===n){const n=e.get("layout"),o=e.get("frequency"),c=e.get("amount"),a=e.get("other");n&&o&&c?t=J(n,o,c,a):(t=!1,console.warn("Newspack modal checkout: donate trigger is missing layout, frequency or amount. The checkout was not triggered."))}else if("checkout_button"===n){const n=e.get("product_id"),o=e.get("variation_id");n?t=((e,t=null)=>{const n=function(e,t,n,o={}){const{allowProductOnlyFallback:c=!1}=o;if(null==n||""===String(n))return u(e,t,null);const a=u(e,t,n);if(a)return a;const r=function(e,t,n,o={}){const{variationModalClassPrefix:c,iframeName:a}=o,r=[...e.querySelectorAll(`.${c}`)].find(e=>String(e.dataset.productId)===String(t));if(!r)return null;const i=r.querySelectorAll("form"),s=a?[...i].find(e=>e.getAttribute("target")===a):i[0];if(!s)return null;const l=[...s.querySelectorAll('input[type="radio"][name="product_id"]')].find(e=>String(e.value)===String(n));return l?(l.checked=!0,s):null}(e,t,n,o);return r?(function(e,t,n=d){if(!e||!t)return;const o=t.ownerDocument,c=new FormData(e);
1n.forEach(e=>{if(t.querySelector(`input[name="${e}"]`))return;const n=c.getAll(e).filter(e=>"string"==typeof e&&e);if(!n.length)return;const a=o.createElement("input");a.type="hidden",a.name=e,a.value=n[n.length-1],t.prepend(a)})}(function(e,t){const n=e.querySelectorAll(".wp-block-newspack-blocks-checkout-button");let o=null,c=null;return n.forEach(e=>{if(c)return;const n=e.querySelector("form"),a=l(n);a&&String(a.product_id)===String(t)&&(a.variation_id?o=o||n:c=n)}),c||o}(e,t),r),r):c?u(e,t,null):null}(document,e,t,{variationModalClassPrefix:k,iframeName:y});if(n)return r(n),!0;const o=`Newspack modal checkout: no checkout form found for product_id "${e}"`+(t?` and variation_id "${t}"`:"")+". The checkout was not triggered.";return console.warn(o),!1})(n,o):(t=!1,console.warn("Newspack modal checkout: checkout_button trigger is missing product_id. The checkout was not triggered."))}else{const e=window.newspackReaderActivation?.getPendingCheckout?.();e&&r(T(e))}t&&H()})(),window.newspackOpenModalCheckout=({url:e=null,title:t=null,actionType:n=null,afterSuccess:o={},quantity:c=null,onCheckoutComplete:a=null,onClose:r=null})=>{if(S=t||newspackBlocksModal.labels.checkout_modal_title,U(S),(e=new URL(e||newspackBlocksModal.checkout_url)).searchParams.has("my_account_checkout")&&e.searchParams.delete("my_account_checkout"),e.searchParams.has("modal_checkout")||e.searchParams.set("modal_checkout","1"),n&&e.searchParams.set("action_type",n),c&&parseInt(c,10)>1&&e.searchParams.set("quantity",String(parseInt(c,10))),o?.url&&e.searchParams.set("after_success_url",o.url),(o?.behavior||o?.url)&&e.searchParams.set("after_success_behavior",o.behavior||"custom"),o?.buttonLabel&&e.searchParams.set("after_success_button_label",o.buttonLabel),a){const e=({detail:{action:e,data:t}})=>{"checkout_completed"===e&&a(t)};window.newspackRAS.push(t=>{t.on("activity",e);const n=()=>{t.off("activity",e),document.removeEventListener("checkout-closed",n)};document.addEventListener("checkout-closed",n)})}if(r){const e=()=>{r(),document.removeEventListener("checkout-closed",e)};document.addEventListener("checkout-closed",e)}N(e.toString())},window.newspackCloseModalCheckout=I},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",L):L())})();

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.