@automattic/newspack-blocks 4.34.1 → 4.35.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/AGENTS.md +1 -0
  2. package/CHANGELOG.md +28 -0
  3. package/dist/editor-rtl.css +17 -17
  4. package/dist/editor.asset.php +1 -1
  5. package/dist/editor.css +17 -17
  6. package/dist/editor.js +22 -22
  7. package/dist/modal.asset.php +1 -1
  8. package/dist/modal.js +1 -1
  9. package/includes/class-newspack-blocks-api.php +94 -0
  10. package/includes/class-newspack-blocks-caching.php +1 -1
  11. package/includes/class-newspack-blocks.php +2 -0
  12. package/languages/newspack-blocks-de_DE-17dfe823d00514d2459851e9b0f738b1.json +1 -0
  13. package/languages/newspack-blocks-de_DE-53e2a1d5945b8d2b1c35e81ae1e532f3.json +1 -1
  14. package/languages/newspack-blocks-de_DE.po +15 -10
  15. package/languages/newspack-blocks-es_ES-17dfe823d00514d2459851e9b0f738b1.json +1 -0
  16. package/languages/newspack-blocks-es_ES-53e2a1d5945b8d2b1c35e81ae1e532f3.json +1 -1
  17. package/languages/newspack-blocks-es_ES.po +15 -10
  18. package/languages/newspack-blocks-fr_BE-17dfe823d00514d2459851e9b0f738b1.json +1 -0
  19. package/languages/newspack-blocks-fr_BE-53e2a1d5945b8d2b1c35e81ae1e532f3.json +1 -1
  20. package/languages/newspack-blocks-fr_BE.po +15 -10
  21. package/languages/newspack-blocks-nb_NO-17dfe823d00514d2459851e9b0f738b1.json +1 -0
  22. package/languages/newspack-blocks-nb_NO-53e2a1d5945b8d2b1c35e81ae1e532f3.json +1 -1
  23. package/languages/newspack-blocks-nb_NO.po +15 -10
  24. package/languages/newspack-blocks-pt_PT-17dfe823d00514d2459851e9b0f738b1.json +1 -0
  25. package/languages/newspack-blocks-pt_PT-53e2a1d5945b8d2b1c35e81ae1e532f3.json +1 -1
  26. package/languages/newspack-blocks-pt_PT.po +15 -10
  27. package/languages/newspack-blocks.pot +17 -11
  28. package/newspack-blocks.php +2 -2
  29. package/package.json +6 -6
  30. package/src/blocks/carousel/edit.js +1 -1
  31. package/src/blocks/homepage-articles/class-wp-rest-newspack-articles-controller.php +47 -0
  32. package/src/blocks/homepage-articles/store.js +101 -38
  33. package/src/blocks/homepage-articles/store.test.js +189 -0
  34. package/src/modal-checkout/modal.js +11 -1
  35. package/src/modal-checkout/utils.js +33 -0
  36. package/src/modal-checkout/utils.test.js +67 -1
  37. package/vendor/composer/installed.php +2 -2
@@ -1 +1 @@
1
- <?php return array('dependencies' => array(), 'version' => 'ad0265d8573d5220c5fe');
1
+ <?php return array('dependencies' => array(), 'version' => 'd540ac3428d006bff92c');
package/dist/modal.js CHANGED
@@ -1 +1 @@
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:r="",is_grouped:a="",price:i="",variation_id:s=""}=e,l={...e};(c||i)&&(l.amount=c||i),r&&!s&&(n="opened_variations"),a&&(n="opened_grouped");const u=t(n,l);o(u)};function r(e,t=null){const n=document.createElement("input");return n.type="hidden",n.name=e,t&&(n.value=t),n}function a(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}}const u=e=>Boolean(e.closest(".newspack-blocks__url-triggered-checkout"));function d(e,t,n=null,o={}){const{synthesized:c=null}=o,r=e.querySelectorAll(".wp-block-newspack-blocks-checkout-button"),a=null!=n&&""!==String(n);let i=null;return r.forEach(e=>{if(i)return;if(null!==c&&u(e)!==c)return;const o=e.querySelector("form"),r=l(o);r&&String(r.product_id)===String(t)&&(a&&String(r.variation_id)!==String(n)||!a&&r.variation_id||(i=o))}),i}function p(e,t,n={}){const{synthesized:o=null}=n,c=e.querySelectorAll(".wp-block-newspack-blocks-checkout-button");let r=null,a=null;return c.forEach(e=>{if(a)return;if(null!==o&&u(e)!==o)return;const n=e.querySelector("form"),c=l(n);c&&String(c.product_id)===String(t)&&(c.variation_id?r=r||n:a=n)}),a||r}function m(e,t,n,o={}){const{variationModalClassPrefix:c,iframeName:r}=o,a=[...e.querySelectorAll(`.${c}`)].find(e=>String(e.dataset.productId)===String(t));if(!a)return null;const i=a.querySelectorAll("form"),s=r?[...i].find(e=>e.getAttribute("target")===r):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}const h=["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"];function f(e,t,n=h){if(!e||!t)return;const o=t.ownerDocument,c=new FormData(e);n.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 r=o.createElement("input");r.type="hidden",r.name=e,r.value=n[n.length-1],t.prepend(r)})}const y=["coupon","after_success_behavior","after_success_url","after_success_button_label"],_=["tiered","frequency","untiered"],w=["once","month","year"];const k={gate:"gate_post_id",prompt:"newspack_popup_id"};const g=newspackBlocksModal.newspack_class_prefix,v="newspack_modal_checkout_iframe",b="newspack_modal_checkout_container",S=`${g}__modal`,E="newspack-blocks__modal-variation",q=`${g}__processing-payment-text`,A=newspackBlocksModal.processing_payment_messages;let L=!1,$=newspackBlocksModal.labels.checkout_modal_title,R=null;const M=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(`.${S}-container`).forEach(e=>M(e)))};const x=new CustomEvent("checkout-closed");var C;window.newspackRAS=window.newspackRAS||[],C=()=>{const t=document.querySelector("#newspack_modal_checkout");if(!t)return;const n=t.querySelector(`.${S}__content`),o=r("modal_checkout","1"),u=n.querySelector(`.${g}__spinner`);let C=document.querySelector(".newspack-reader__account-link")?.[0];const B="600px",P=document.createElement("iframe");P.name=v,P.style.height=B,P.style.visibility="hidden";const T=e=>{j.observe(e),"none"!==u.style.display&&(u.style.display="none"),"visible"!==P.style.visibility&&(P.style.visibility="visible"),P._ready=!0};!function(e,t,n){e._ready=!1,e._readyTimer&&clearTimeout(e._readyTimer);let o=!1,c="";function r(){o||(o=!0,clearTimeout(e._readyTimer),t.call(this))}function a(){"complete"===this.readyState&&r.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",r),t.removeEventListener("readystatechange",a))}function s(){if(e._ready)return void i();const t=e.contentDocument||e.contentWindow?.document;t&&0!==t.URL.indexOf("about:")?"complete"===t?.readyState?r.call(t):(t.addEventListener("DOMContentLoaded",r),t.addEventListener("readystatechange",a)):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()}(P,function(){const n=P.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=P?.contentDocument?.querySelector(`#${b}`);if(!o)return;const c=i(o.querySelector("#modal-checkout-product-details")),r=document.createElement("p");r.classList.add(q);let a=[];const s=()=>{a.forEach(e=>clearTimeout(e)),a=[]},l=()=>{u.style.display="none",s(),u.querySelectorAll(`.${q}`).forEach(e=>e.remove())};!function(e,t){e.checkoutCancel?t():e.addEventListener("checkout-cancel",t)}(o,()=>{z()}),function(e,t){e.checkoutPlaceOrderStart?t():e.addEventListener("checkout-place-order-start",t)}(o,e=>{u.querySelectorAll(`.${q}`).forEach(e=>e.remove()),u.style.display="flex",s(),r.textContent=A[0]?.text??"",A.slice(1).forEach(({text:t,delay:n})=>{const o=setTimeout(()=>{e.target.dispatchEvent(new CustomEvent("checkout-place-order-processing")),r.textContent=t},n);a.push(o)}),u.appendChild(r)}),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(),H($),P.contentWindow?.newspackBlocksModalCheckout?.checkout_nonce&&(t.checkout_nonce=P.contentWindow.newspackBlocksModalCheckout.checkout_nonce),T(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"),H(newspackBlocksModal.labels.thankyou_modal_title),T(o),e(t.querySelector(`.${S}`)),l()}),function(e,t){e.checkoutPlaceOrderCriticalError?t():e.addEventListener("checkout-place-order-critical-error",t)}(o,()=>{var e;(e=R)&&(z(),u.style.display="none",t.initialErrors=newspackBlocksModal.labels.critical_error,e.requestSubmit(e.querySelector('button[type="submit"]')),l())})},()=>{u.style.display="flex"});const D=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)}),I=()=>"undefined"!=typeof newspack_ras_config&&!newspack_ras_config?.is_logged_in&&!window?.newspackReaderActivation?.getReader?.()?.authenticated&&newspackBlocksModal?.is_registration_required&&window?.newspackReaderActivation?.openAuthModal,N=function(e){const t={};return new URLSearchParams(e).forEach((e,n)=>{n.startsWith("utm")&&e&&(t[n]=e)}),t}(window.location.search),O=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;if(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&&k[t.type]&&t.id?"number"!=typeof t.ts||Date.now()-t.ts>18e5?null:t:null}();if(!t)return!1;const n=k[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),function(e,t){if(!e||!t)return;const n=e.ownerDocument;Object.keys(t).forEach(o=>{if(!t[o]||e.elements.namedItem(o))return;const c=n.createElement("input");c.type="hidden",c.name=o,c.value=t[o],e.prepend(c)})}(o,N);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,r;n?(c=t[n],r=u[`donation_value_${e}`]):(c=t[0],u[`donation_value_${e}_untiered`]?r=u[`donation_value_${e}_untiered`]:(r=u[`donation_value_${e}`],"other"===r&&(r=u[`donation_value_${e}_other`])));const a=i(c);for(const e in a)u[e]=a[e];u.amount=r,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(r(e,u[e]))}),u.variation_id||(C=t.submitter);const d=document.querySelectorAll(`.${E}`);if(d.forEach(e=>{(I()||n)&&M(e)}),u.is_grouped||u.is_variable&&!u.variation_id){const n=[...d].find(e=>e.dataset.productId===u.product_id);if(n)return n.querySelectorAll(`form[target="${v}"]`).forEach(e=>{!function(e,t,n=h){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],r=null==c?"":String(c);if(!r)return;const a=o.createElement("input");a.type="hidden",a.name=n,a.value=r,e.prepend(a)})}(e,u);const t=l(e);t&&Object.keys(t).forEach(n=>{0===e.querySelectorAll('input[name="'+n+'"]').length&&e.prepend(r(n,t[n]))})}),t.preventDefault(),o.classList.remove("modal-processing"),F(n),e(n,!1),L||c(u),void document.getElementById("newspack_modal_checkout").setAttribute("data-checkout",JSON.stringify(u))}if(n||I()){if(o.classList.remove("modal-processing"),L||c(u),L=!0,I()){t.preventDefault();const e=D(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?a(U(e)):D(u).then(window.location.href=e)}).catch(e=>{console.warn("Unable to generate cart:",e),z()})},onError:()=>{z()},onDismiss:()=>{s(u),L=!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 W(),document.getElementById("newspack_modal_checkout").setAttribute("data-checkout",JSON.stringify(u));R=o}else D(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>"})},U=e=>{const t=document.createElement("form");t.method="POST",t.action=e,t.target=v,t.style.display="none";const n=document.createElement("button");return n.setAttribute("type","submit"),t.appendChild(n),document.body.appendChild(t),t.addEventListener("submit",O),t},j=new ResizeObserver(e=>{if(!e||!e.length)return;if(!P.contentDocument)return;const o=e[0].contentRect;if(o){const e=.01*Math.max(document.documentElement.clientHeight,window.innerHeight||0)*90-(t.querySelector(`.${S}__header`)?.offsetHeight||0),c=o.top+o.bottom,r=Math.min(c,e);if(0===r)return void(P.style.visibility="hidden");n.style.height=r+"px",P.style.height=r+"px"}}),z=()=>{const e=P?.contentDocument?.querySelector(`#${b}`),o=e?.querySelector('input[name="after_success_url"]'),c=e?.querySelector('input[name="after_success_behavior"]'),r=document?.querySelector(".newspack-newsletters-signup-modal"),a=i(e?.querySelector("#modal-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=!(P.contentDocument&&o&&c&&e?.checkoutComplete);if((l||r)&&(u.style.display="flex",P&&n.contains(P)&&(P._ready=!1,P.src="about:blank",P.style.height=B,P.style.visibility="hidden",n.style.height=B,n.removeChild(P)),j&&j.disconnect(),document.querySelectorAll(`.${S}-container`).forEach(e=>M(e)),C&&C.focus(),document.dispatchEvent(x)),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?.(),L=!1};"subscription_switch"!==a.action_type&&window?.newspackReaderActivation?.openNewslettersSignupModal?window.newspackReaderActivation.openNewslettersSignupModal({onSuccess:e,onError:e,closeOnSuccess:l}):e(),l&&($=newspackBlocksModal.labels.checkout_modal_title,J(),H($))}else window?.newspackReaderActivation?.setPendingCheckout?.(),s(),L=!1,document.getElementById("newspack_modal_checkout").removeAttribute("data-checkout");document.removeEventListener("keydown",K)},W=o=>{o&&(P.src=o),u.style.display="flex",F(t),n.appendChild(P),t.addEventListener("click",e=>{e.target===t&&z()}),e(t,P),document.addEventListener("keydown",K)},F=e=>{window.newspackReaderActivation?.overlays&&(e.overlayId=window.newspackReaderActivation?.overlays.add()),e.setAttribute("data-state","open"),document.body.style.overflow="hidden"},H=e=>{const n=t.querySelector(`.${S}__header h2`);n&&(n.innerText=e)},J=(e="default")=>{const n=t.querySelector(`.${S}`);n&&("small"===e?n.classList.add(`${S}--small`):n.classList.remove(`${S}--small`))};t.querySelectorAll(`.${S}__close`).forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),z()})}),document.querySelectorAll(".newspack-blocks__modal-variation").forEach(e=>{e.addEventListener("click",t=>{t.target===e&&z()}),e.querySelectorAll(`.${S}__close`).forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),z()})})});const K=e=>{"Escape"===e.key&&z()};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=v,e.addEventListener("submit",O)})});const V=["checkout","type","layout","frequency","amount","other","product_id","variation_id"],G=()=>{const e=new URL(window.location.href);V.forEach(t=>e.searchParams.delete(t)),window.history.replaceState(null,null,e.href)},Q=(e,t,n,o=null)=>{const c=function(e,{layout:t,frequency:n,amount:o}){if(!function(e,t,n){return!(!_.includes(e)||!w.includes(t))&&("other"===n?"frequency"===e:/^\d+(\.\d+)?$/.test(n))}(t,n,o))return{status:"invalid-params"};let c=null;for(const r of e.querySelectorAll(".wpbnbd.wpbnbd--platform-wc form")){const e=r.closest(".wpbnbd--tiers-based");if("tiered"===t){if(!e)continue;const t=r.querySelector(`.wpbnbd__tiers__amount [data-frequency-slug="${n}"][data-amount="${o}"]`);if(!t)continue;const a=parseInt(t.getAttribute("data-tier-index"));if(isNaN(a))continue;const i=r.querySelector(`button[data-frequency-slug="${n}"]`);if(!i&&!r.querySelector(`input[name="donation_frequency"][value="${n}"]`))continue;if(!e.hasAttribute("data-tiers-based-ready")){c||(c=r);continue}return{status:"tiered",form:r,frequencyButton:i,tierIndex:a}}if(e)continue;const a=r.querySelector(`input[name="donation_frequency"][value="${n}"]`);if(!a)continue;const i="untiered"===t?r.querySelector(`input[name="donation_value_${n}_untiered"]`):r.querySelector(`input[name="donation_value_${n}"][value="${o}"]`);if(i)return{status:t,form:r,frequencyInput:a,amountInput:i}}return c?{status:"not-ready",form:c}:{status:"no-match"}}(document,{layout:e,frequency:t,amount:n}),r=`layout "${e}", frequency "${t}" and amount "${n}"`;if("invalid-params"===c.status)return console.warn(`Newspack modal checkout: invalid donate trigger parameters (${r}). The checkout was not triggered.`),!1;if("no-match"===c.status)return console.warn(`Newspack modal checkout: no donate form matches ${r}. The checkout was not triggered.`),!1;if("not-ready"===c.status){const c=setTimeout(()=>{console.warn(`Newspack modal checkout: the donate form matching ${r} 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),Q(e,t,n,o)&&G()},{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 ${r}. 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()?(a(i),!0):(console.warn(`Newspack modal checkout: the donate form rejected the values for ${r}. 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"),r=e.get("other");n&&o&&c?t=Q(n,o,c,r):(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={}){if(null==n||""===String(n))return d(e,t,null,{synthesized:!1})||d(e,t,null,{synthesized:!0});const c=d(e,t,n,{synthesized:!1});if(c)return c;const r=p(e,t,{synthesized:!1});if(r){const c=m(e,t,n,o);if(c)return f(r,c),c}const a=d(e,t,n,{synthesized:!0});if(a)return a;const i=m(e,t,n,o);return i?(f(p(e,t),i),i):null}(document,e,t,{variationModalClassPrefix:E,iframeName:v});if(n){const e=function(e,t){const n=new URLSearchParams(t);return y.filter(t=>n.get(t)&&!(e&&e.elements.namedItem(t)))}(n,window.location.search);return e.length&&console.warn(`Newspack modal checkout: the resolved checkout form does not carry ${e.join(", ")} from the URL. The page block's own settings apply instead.`),a(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&&a(U(e))}t&&G()})(),window.newspackOpenModalCheckout=({url:e=null,title:t=null,actionType:n=null,afterSuccess:o={},quantity:c=null,onCheckoutComplete:r=null,onClose:a=null})=>{if($=t||newspackBlocksModal.labels.checkout_modal_title,H($),(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),r){const e=({detail:{action:e,data:t}})=>{"checkout_completed"===e&&r(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(a){const e=()=>{a(),document.removeEventListener("checkout-closed",e)};document.addEventListener("checkout-closed",e)}W(e.toString())},window.newspackCloseModalCheckout=z},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",C):C())})();
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:r="",is_grouped:a="",price:i="",variation_id:s=""}=e,u={...e};(c||i)&&(u.amount=c||i),r&&!s&&(n="opened_variations"),a&&(n="opened_grouped");const l=t(n,u);o(l)};function r(e,t=null){const n=document.createElement("input");return n.type="hidden",n.name=e,t&&(n.value=t),n}function a(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 u(e){const t=e&&e.dataset?e.dataset.checkout:null;if(!t)return null;try{return JSON.parse(t)}catch(e){return null}}const l=e=>Boolean(e.closest(".newspack-blocks__url-triggered-checkout"));function d(e,t,n=null,o={}){const{synthesized:c=null}=o,r=e.querySelectorAll(".wp-block-newspack-blocks-checkout-button"),a=null!=n&&""!==String(n);let i=null;return r.forEach(e=>{if(i)return;if(null!==c&&l(e)!==c)return;const o=e.querySelector("form"),r=u(o);r&&String(r.product_id)===String(t)&&(a&&String(r.variation_id)!==String(n)||!a&&r.variation_id||(i=o))}),i}function p(e,t,n={}){const{synthesized:o=null}=n,c=e.querySelectorAll(".wp-block-newspack-blocks-checkout-button");let r=null,a=null;return c.forEach(e=>{if(a)return;if(null!==o&&l(e)!==o)return;const n=e.querySelector("form"),c=u(n);c&&String(c.product_id)===String(t)&&(c.variation_id?r=r||n:a=n)}),a||r}function m(e,t,n,o={}){const{variationModalClassPrefix:c,iframeName:r}=o,a=[...e.querySelectorAll(`.${c}`)].find(e=>String(e.dataset.productId)===String(t));if(!a)return null;const i=a.querySelectorAll("form"),s=r?[...i].find(e=>e.getAttribute("target")===r):i[0];if(!s)return null;const u=[...s.querySelectorAll('input[type="radio"][name="product_id"]')].find(e=>String(e.value)===String(n));return u?(u.checked=!0,s):null}const h=["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"];function f(e,t,n=h){if(!e||!t)return;const o=t.ownerDocument,c=new FormData(e);n.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 r=o.createElement("input");r.type="hidden",r.name=e,r.value=n[n.length-1],t.prepend(r)})}const y=["coupon","after_success_behavior","after_success_url","after_success_button_label"],_=["tiered","frequency","untiered"],w=["once","month","year"];const k={gate:"gate_post_id",prompt:"newspack_popup_id"};const g=newspackBlocksModal.newspack_class_prefix,v="newspack_modal_checkout_iframe",b="newspack_modal_checkout_container",S=`${g}__modal`,E="newspack-blocks__modal-variation",q=`${g}__processing-payment-text`,A=newspackBlocksModal.processing_payment_messages;let L=!1,$=newspackBlocksModal.labels.checkout_modal_title,R=null;const M=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(`.${S}-container`).forEach(e=>M(e)))};const C=new CustomEvent("checkout-closed");var x;window.newspackRAS=window.newspackRAS||[],x=()=>{const t=document.querySelector("#newspack_modal_checkout");if(!t)return;const n=t.querySelector(`.${S}__content`),o=r("modal_checkout","1"),l=n.querySelector(`.${g}__spinner`);let x=document.querySelector(".newspack-reader__account-link")?.[0];const B="600px",T=document.createElement("iframe");T.name=v,T.style.height=B,T.style.visibility="hidden";const P=e=>{j.observe(e),"none"!==l.style.display&&(l.style.display="none"),"visible"!==T.style.visibility&&(T.style.visibility="visible"),T._ready=!0};!function(e,t,n){e._ready=!1,e._readyTimer&&clearTimeout(e._readyTimer);let o=!1,c="";function r(){o||(o=!0,clearTimeout(e._readyTimer),t.call(this))}function a(){"complete"===this.readyState&&r.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",r),t.removeEventListener("readystatechange",a))}function s(){if(e._ready)return void i();const t=e.contentDocument||e.contentWindow?.document;t&&0!==t.URL.indexOf("about:")?"complete"===t?.readyState?r.call(t):(t.addEventListener("DOMContentLoaded",r),t.addEventListener("readystatechange",a)):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()}(T,function(){const n=T.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=T?.contentDocument?.querySelector(`#${b}`);if(!o)return;const c=i(o.querySelector("#modal-checkout-product-details")),r=document.createElement("p");r.classList.add(q);let a=[];const s=()=>{a.forEach(e=>clearTimeout(e)),a=[]},u=()=>{l.style.display="none",s(),l.querySelectorAll(`.${q}`).forEach(e=>e.remove())};!function(e,t){e.checkoutCancel?t():e.addEventListener("checkout-cancel",t)}(o,()=>{z()}),function(e,t){e.checkoutPlaceOrderStart?t():e.addEventListener("checkout-place-order-start",t)}(o,e=>{l.querySelectorAll(`.${q}`).forEach(e=>e.remove()),l.style.display="flex",s(),r.textContent=A[0]?.text??"",A.slice(1).forEach(({text:t,delay:n})=>{const o=setTimeout(()=>{e.target.dispatchEvent(new CustomEvent("checkout-place-order-processing")),r.textContent=t},n);a.push(o)}),l.appendChild(r)}),function(e,t){e.checkoutPlaceOrderError?t():e.addEventListener("checkout-place-order-error",t)}(o,u),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(),H($),T.contentWindow?.newspackBlocksModalCheckout?.checkout_nonce&&(t.checkout_nonce=T.contentWindow.newspackBlocksModalCheckout.checkout_nonce),P(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"),H(newspackBlocksModal.labels.thankyou_modal_title),P(o),e(t.querySelector(`.${S}`)),u()}),function(e,t){e.checkoutPlaceOrderCriticalError?t():e.addEventListener("checkout-place-order-critical-error",t)}(o,()=>{var e;(e=R)&&(z(),l.style.display="none",t.initialErrors=newspackBlocksModal.labels.critical_error,e.requestSubmit(e.querySelector('button[type="submit"]')),u())})},()=>{l.style.display="flex"});const D=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)}),I=()=>"undefined"!=typeof newspack_ras_config&&!newspack_ras_config?.is_logged_in&&!window?.newspackReaderActivation?.getReader?.()?.authenticated&&newspackBlocksModal?.is_registration_required&&window?.newspackReaderActivation?.openAuthModal,N=function(e){const t={};return new URLSearchParams(e).forEach((e,n)=>{n.startsWith("utm")&&e&&(t[n]=e)}),t}(window.location.search),O=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;if(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&&k[t.type]&&t.id?"number"!=typeof t.ts||Date.now()-t.ts>18e5?null:t:null}();if(!t)return!1;const n=k[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),function(e,t){if(!e||!t)return;const n=e.ownerDocument;Object.keys(t).forEach(o=>{if(!t[o]||e.elements.namedItem(o))return;const c=n.createElement("input");c.type="hidden",c.name=o,c.value=t[o],e.prepend(c)})}(o,N);const l=i(o);if(l.newspack_donate){const e=l.donation_frequency,t=[...o.querySelectorAll(`.donation-tier__${e}, .donation-frequency__${e}`)],n=l.donation_tier_index;let c,r;n?(c=t[n],r=l[`donation_value_${e}`]):(c=t[0],l[`donation_value_${e}_untiered`]?r=l[`donation_value_${e}_untiered`]:(r=l[`donation_value_${e}`],"other"===r&&(r=l[`donation_value_${e}_other`])));const a=i(c);for(const e in a)l[e]=a[e];l.amount=r,l.price_summary=l.summary_template.replace("{{PRICE}}",function(e,t="USD"){return parseFloat(e).toLocaleString(document.documentElement.lang,{style:"currency",currency:t,currencyDisplay:"narrowSymbol"})}(l.amount,l.currency))}l&&Object.keys(l).forEach(e=>{0===o.querySelectorAll('input[name="'+e+'"]').length&&o.prepend(r(e,l[e]))}),l.variation_id||(x=t.submitter);const d=document.querySelectorAll(`.${E}`);if(d.forEach(e=>{(I()||n)&&M(e)}),l.is_grouped||l.is_variable&&!l.variation_id){const n=[...d].find(e=>e.dataset.productId===l.product_id);if(n)return n.querySelectorAll(`form[target="${v}"]`).forEach(e=>{!function(e,t,n=h){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],r=null==c?"":String(c);if(!r)return;const a=o.createElement("input");a.type="hidden",a.name=n,a.value=r,e.prepend(a)})}(e,l);const t=u(e);t&&Object.keys(t).forEach(n=>{0===e.querySelectorAll('input[name="'+n+'"]').length&&e.prepend(r(n,t[n]))})}),t.preventDefault(),o.classList.remove("modal-processing"),F(n),e(n,!1),L||c(l),void document.getElementById("newspack_modal_checkout").setAttribute("data-checkout",JSON.stringify(l))}if(n||I()){if(o.classList.remove("modal-processing"),L||c(l),L=!0,I()){t.preventDefault();const e=D(l);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?a(U(e)):D(l).then(window.location.href=e)}).catch(e=>{console.warn("Unable to generate cart:",e),z()})},onError:()=>{z()},onDismiss:()=>{s(l),L=!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 W(),document.getElementById("newspack_modal_checkout").setAttribute("data-checkout",JSON.stringify(l));R=o}else D(l).then(e=>{window.location.href=e}),(!l.is_variable||l.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>"})},U=e=>{const t=document.createElement("form");t.method="POST",t.action=e,t.target=v,t.style.display="none";const n=document.createElement("button");return n.setAttribute("type","submit"),t.appendChild(n),document.body.appendChild(t),t.addEventListener("submit",O),t},j=new ResizeObserver(e=>{if(!e||!e.length)return;if(!T.contentDocument)return;const o=e[0].contentRect;if(o){const e=.01*Math.max(document.documentElement.clientHeight,window.innerHeight||0)*90-(t.querySelector(`.${S}__header`)?.offsetHeight||0),c=o.top+o.bottom,r=Math.min(c,e);if(0===r)return void(T.style.visibility="hidden");n.style.height=r+"px",T.style.height=r+"px"}}),z=()=>{const e=T?.contentDocument?.querySelector(`#${b}`),o=e?.querySelector('input[name="after_success_url"]'),c=e?.querySelector('input[name="after_success_behavior"]'),r=document?.querySelector(".newspack-newsletters-signup-modal"),a=i(e?.querySelector("#modal-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 u=!(T.contentDocument&&o&&c&&e?.checkoutComplete);if((u||r)&&(l.style.display="flex",T&&n.contains(T)&&(T._ready=!1,T.src="about:blank",T.style.height=B,T.style.visibility="hidden",n.style.height=B,n.removeChild(T)),j&&j.disconnect(),document.querySelectorAll(`.${S}-container`).forEach(e=>M(e)),x&&x.focus(),document.dispatchEvent(C)),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?.(),L=!1};"subscription_switch"!==a.action_type&&window?.newspackReaderActivation?.openNewslettersSignupModal?window.newspackReaderActivation.openNewslettersSignupModal({onSuccess:e,onError:e,closeOnSuccess:u}):e(),u&&($=newspackBlocksModal.labels.checkout_modal_title,J(),H($))}else window?.newspackReaderActivation?.setPendingCheckout?.(),s(),L=!1,document.getElementById("newspack_modal_checkout").removeAttribute("data-checkout");document.removeEventListener("keydown",K)},W=o=>{o&&(T.src=o),l.style.display="flex",F(t),n.appendChild(T),t.addEventListener("click",e=>{e.target===t&&z()}),e(t,T),document.addEventListener("keydown",K)},F=e=>{window.newspackReaderActivation?.overlays&&(e.overlayId=window.newspackReaderActivation?.overlays.add()),e.setAttribute("data-state","open"),document.body.style.overflow="hidden"},H=e=>{const n=t.querySelector(`.${S}__header h2`);n&&(n.innerText=e)},J=(e="default")=>{const n=t.querySelector(`.${S}`);n&&("small"===e?n.classList.add(`${S}--small`):n.classList.remove(`${S}--small`))};t.querySelectorAll(`.${S}__close`).forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),z()})}),document.querySelectorAll(".newspack-blocks__modal-variation").forEach(e=>{e.addEventListener("click",t=>{t.target===e&&z()}),e.querySelectorAll(`.${S}__close`).forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),z()})})});const K=e=>{"Escape"===e.key&&z()};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=v,e.addEventListener("submit",O)})});const V=["checkout","type","layout","frequency","amount","other","product_id","variation_id"],G=()=>{const e=new URL(window.location.href);V.forEach(t=>e.searchParams.delete(t)),window.history.replaceState(null,null,e.href)},Q=(e,t,n,o=null)=>{const c=function(e,{layout:t,frequency:n,amount:o}){if(!function(e,t,n){return!(!_.includes(e)||!w.includes(t))&&("other"===n?"frequency"===e:/^\d+(\.\d+)?$/.test(n))}(t,n,o))return{status:"invalid-params"};let c=null;for(const r of e.querySelectorAll(".wpbnbd.wpbnbd--platform-wc form")){const e=r.closest(".wpbnbd--tiers-based");if("tiered"===t){if(!e)continue;const t=r.querySelector(`.wpbnbd__tiers__amount [data-frequency-slug="${n}"][data-amount="${o}"]`);if(!t)continue;const a=parseInt(t.getAttribute("data-tier-index"));if(isNaN(a))continue;const i=r.querySelector(`button[data-frequency-slug="${n}"]`);if(!i&&!r.querySelector(`input[name="donation_frequency"][value="${n}"]`))continue;if(!e.hasAttribute("data-tiers-based-ready")){c||(c=r);continue}return{status:"tiered",form:r,frequencyButton:i,tierIndex:a}}if(e)continue;const a=r.querySelector(`input[name="donation_frequency"][value="${n}"]`);if(!a)continue;const i="untiered"===t?r.querySelector(`input[name="donation_value_${n}_untiered"]`):r.querySelector(`input[name="donation_value_${n}"][value="${o}"]`);if(i)return{status:t,form:r,frequencyInput:a,amountInput:i}}return c?{status:"not-ready",form:c}:{status:"no-match"}}(document,{layout:e,frequency:t,amount:n}),r=`layout "${e}", frequency "${t}" and amount "${n}"`;if("invalid-params"===c.status)return console.warn(`Newspack modal checkout: invalid donate trigger parameters (${r}). The checkout was not triggered.`),!1;if("no-match"===c.status)return console.warn(`Newspack modal checkout: no donate form matches ${r}. The checkout was not triggered.`),!1;if("not-ready"===c.status){const c=setTimeout(()=>{console.warn(`Newspack modal checkout: the donate form matching ${r} 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),Q(e,t,n,o)&&G()},{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 ${r}. 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()?(a(i),!0):(console.warn(`Newspack modal checkout: the donate form rejected the values for ${r}. The checkout was not triggered.`),!1)};(function(e){const{readyState:t}=document;"complete"===t||"interactive"===t&&function(){const[e]=window.performance?.getEntriesByType?.("navigation")||[];return!e||e.domContentLoadedEventStart>0}()?e():document.addEventListener("DOMContentLoaded",e,{once:!0})})(()=>{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"),r=e.get("other");n&&o&&c?t=Q(n,o,c,r):(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={}){if(null==n||""===String(n))return d(e,t,null,{synthesized:!1})||d(e,t,null,{synthesized:!0});const c=d(e,t,n,{synthesized:!1});if(c)return c;const r=p(e,t,{synthesized:!1});if(r){const c=m(e,t,n,o);if(c)return f(r,c),c}const a=d(e,t,n,{synthesized:!0});if(a)return a;const i=m(e,t,n,o);return i?(f(p(e,t),i),i):null}(document,e,t,{variationModalClassPrefix:E,iframeName:v});if(n){const e=function(e,t){const n=new URLSearchParams(t);return y.filter(t=>n.get(t)&&!(e&&e.elements.namedItem(t)))}(n,window.location.search);return e.length&&console.warn(`Newspack modal checkout: the resolved checkout form does not carry ${e.join(", ")} from the URL. The page block's own settings apply instead.`),a(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&&a(U(e))}t&&G()}),window.newspackOpenModalCheckout=({url:e=null,title:t=null,actionType:n=null,afterSuccess:o={},quantity:c=null,onCheckoutComplete:r=null,onClose:a=null})=>{if($=t||newspackBlocksModal.labels.checkout_modal_title,H($),(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),r){const e=({detail:{action:e,data:t}})=>{"checkout_completed"===e&&r(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(a){const e=()=>{a(),document.removeEventListener("checkout-closed",e)};document.addEventListener("checkout-closed",e)}W(e.toString())},window.newspackCloseModalCheckout=z},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",x):x())})();
@@ -9,6 +9,19 @@
9
9
  * `Newspack_Blocks_API` is a wrapper for `register_rest_fields()`
10
10
  */
11
11
  class Newspack_Blocks_API {
12
+ /**
13
+ * Most block queries one batch request may carry. Bounds the work a single request can
14
+ * ask for; the editor splits a larger page into consecutive batches.
15
+ */
16
+ const POSTS_BATCH_MAX_QUERIES = 50;
17
+
18
+ /**
19
+ * Most posts one batch request may be asked to exclude up front. The editor's list is the
20
+ * specific posts its blocks pin plus the post being edited, so this is far above what a page
21
+ * produces; it bounds what a caller can make every query in the batch carry.
22
+ */
23
+ const POSTS_BATCH_MAX_EXCLUDE = 1000;
24
+
12
25
  /**
13
26
  * Get thumbnail featured image source for the rest field.
14
27
  *
@@ -230,6 +243,87 @@ class Newspack_Blocks_API {
230
243
  return new \WP_REST_Response( newspack_blocks_get_video_playlist( $args ), 200 );
231
244
  }
232
245
 
246
+ /**
247
+ * Posts batch endpoint.
248
+ *
249
+ * Answers every Homepage Posts block on a page in one request. Deduplication makes each
250
+ * block depend on the posts every block above it shows, so the editor used to wait for one
251
+ * request before sending the next; on a page with dozens of blocks the per-request startup
252
+ * cost added up to most of the load time. Each query still goes through the single-block
253
+ * route, so its argument schema, defaults, and permission check apply unchanged.
254
+ *
255
+ * @param WP_REST_Request $request Request object.
256
+ * @return WP_REST_Response List of { clientId, posts } or { clientId, error }, in request order.
257
+ */
258
+ public static function posts_batch_endpoint( $request ) {
259
+ $exclude = array_map( 'intval', (array) $request->get_param( 'exclude' ) );
260
+ $results = [];
261
+ // Each query must start from the state a standalone request would, because two pieces of
262
+ // per-request state outlive one: the global post, which posts_endpoint() leaves on the last
263
+ // post it formatted, and the deduplication list, which a Homepage Posts or Carousel block
264
+ // embedded in a formatted post writes its rendered IDs into while `the_content` runs. Left
265
+ // in place, that list lands in the next query's post__not_in and silently drops posts.
266
+ $original_post = $GLOBALS['post'] ?? null;
267
+
268
+ foreach ( $request->get_param( 'queries' ) as $query ) {
269
+ $client_id = $query['clientId'];
270
+ $deduplicate = ! empty( $query['deduplicate'] );
271
+ $params = (array) ( $query['postsQuery'] ?? [] );
272
+ if ( $deduplicate ) {
273
+ $params['exclude'] = $exclude; // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
274
+ }
275
+
276
+ $single = new WP_REST_Request( 'GET', '/newspack-blocks/v1/newspack-blocks-posts' );
277
+ $single->set_query_params( $params );
278
+
279
+ try {
280
+ $response = rest_do_request( $single );
281
+ } catch ( \Throwable $e ) {
282
+ self::reset_batch_query_state( $original_post );
283
+ // A throw skips the excerpt filter posts_endpoint() would have removed itself.
284
+ Newspack_Blocks::remove_excerpt_filter();
285
+ // One bad query must not cost the rest of the page its posts. The message itself
286
+ // can carry a query or a path, so the block gets a generic one.
287
+ error_log( 'Newspack Blocks batch query failed: ' . $e->getMessage() ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
288
+ $results[] = [
289
+ 'clientId' => $client_id,
290
+ 'error' => __( 'The posts for this block could not be loaded.', 'newspack-blocks' ),
291
+ ];
292
+ continue;
293
+ }
294
+ self::reset_batch_query_state( $original_post );
295
+
296
+ if ( $response->is_error() ) {
297
+ $results[] = [
298
+ 'clientId' => $client_id,
299
+ 'error' => $response->as_error()->get_error_message(),
300
+ ];
301
+ continue;
302
+ }
303
+
304
+ $posts = $response->get_data();
305
+ if ( $deduplicate ) {
306
+ $exclude = array_merge( $exclude, array_map( 'intval', wp_list_pluck( $posts, 'id' ) ) );
307
+ }
308
+ $results[] = [
309
+ 'clientId' => $client_id,
310
+ 'posts' => $posts,
311
+ ];
312
+ }
313
+
314
+ return new \WP_REST_Response( $results );
315
+ }
316
+
317
+ /**
318
+ * Return the state a batched query leaves behind to what a standalone request starts from.
319
+ *
320
+ * @param WP_Post|null $original_post The global post as the batch request found it.
321
+ */
322
+ private static function reset_batch_query_state( $original_post ) {
323
+ $GLOBALS['post'] = $original_post; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
324
+ Newspack_Blocks::reset_deduplication();
325
+ }
326
+
233
327
  /**
234
328
  * Posts endpoint
235
329
  *
@@ -192,7 +192,7 @@ class Newspack_Blocks_Caching {
192
192
  * @param string $message Message to log.
193
193
  */
194
194
  protected static function debug_log( $message ) {
195
- if ( defined( 'NEWSPACK_LOG_LEVEL' ) && (int) NEWSPACK_LOG_LEVEL >= 4 && class_exists( 'Newspack\Logger' ) ) {
195
+ if ( defined( 'NEWSPACK_LOG_LEVEL' ) && (int) NEWSPACK_LOG_LEVEL >= 4 && class_exists( 'Newspack\Logger' ) ) { // phpcs:ignore phpcsSniffs.Constants.ConstantDocblock.Missing -- Documented in plugins/newspack-plugin/includes/class-logger.php.
196
196
  Newspack\Logger::log( $message );
197
197
  }
198
198
  }
@@ -255,6 +255,8 @@ class Newspack_Blocks {
255
255
  $localized_data = [
256
256
  'patterns' => self::get_patterns_for_post_type( get_post_type() ),
257
257
  'posts_rest_url' => rest_url( 'newspack-blocks/v1/newspack-blocks-posts' ),
258
+ 'posts_batch_rest_url' => rest_url( 'newspack-blocks/v1/newspack-blocks-posts-batch' ),
259
+ 'posts_batch_max_queries' => Newspack_Blocks_API::POSTS_BATCH_MAX_QUERIES,
258
260
  'specific_posts_rest_url' => rest_url( 'newspack-blocks/v1/newspack-blocks-specific-posts' ),
259
261
  'authors_rest_url' => rest_url( 'newspack-blocks/v1/authors' ),
260
262
  'assets_path' => plugins_url( '/src/assets', NEWSPACK_BLOCKS__PLUGIN_FILE ),
@@ -0,0 +1 @@
1
+ {"translation-revision-date":"2024-08-30 08:45-0700","generator":"WP-CLI\/2.12.0","source":"src\/blocks\/homepage-articles\/store.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"de","plural-forms":"nplurals=2; plural=(n != 1);"},"The posts for this block could not be loaded.":[""]}}}
@@ -1 +1 @@
1
- {"translation-revision-date":"2024-08-30 08:45-0700","generator":"WP-CLI\/2.12.0","source":"dist\/editor.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"de","plural-forms":"nplurals=2; plural=(n != 1);"},"Close":[""],"%1$s: %2$s":[""],"Update":[""],"Cancel":[""],"Draft":[""],"Scheduled":[""],"per %s":[""],"Donate":["Spenden"],"Author Profile":[""],"More by %s":[""],"block style\u0004Default":["Standard"],"block style\u0004Centered":[""],"once":[""],"One-time":["Einmal"],"Monthly":["Monatlich"],"Annually":["J\u00e4hrlich"],"Donation amount":["Spendenbetrag"],"Other":["Andere"],"Load more posts":["Mehr Beitr\u00e4ge laden"],"Slide %s":[""],"Slide %1$s of %2$s":[""],"Image: %s,":[""],"Playing":[""],"Paused":[""],"Small":["Klein"],"S":["S"],"Medium":["Mittel"],"M":["M"],"Large":["Gro\u00df"],"L":["L"],"Extra Large":["Extra Gro\u00df"],"XL":["XL"],"Extra-large":["Extra Gro\u00df"],"Select a layout to start with:":[""],"No authors or guest authors found for ID %s.":[""],"Error fetching authors for this post.":[""],"Error fetching byline authors.":[""],"Display":[""],"Show authors without bio":[""],"Display author profiles even if their bio is empty.":[""],"Settings":[""],"Text size":[""],"Avatar":[""],"Display avatar":[""],"Hide default avatar":[""],"Size":[""],"Avatar size":[""],"Border radius":[""],"Avatar border radius":[""],"Fetching authors\u2026":[""],"Show avatar on left":[""],"Show avatar on right":[""],"Edit selection":[""],"Select a type:":[""],"Contextual":[""],"Specific":[""],"This block was created with a block theme and is not supported in the current theme. It will render using the classic layout on the frontend.":[""],"Author bio is hidden because Custom Byline is active on this post.":[""],"Search for an author to display":[""],"Begin typing name, click autocomplete result to select.":[""],"(no name)":["(kein Name)"],"author":[""],"authors":[""],"No authors found for this post.":[""],"Preview author":[""],"Previewing 1 of %d authors. All authors display on frontend.":[""],"Square":[""],"1:1":[""],"4:3":[""],"16:9":[""],"3:4":[""],"9:16":[""],"Hide Controls":[""],"Remove navigation indicators from view.":[""],"Autoplay":["Autoplay"],"Automatically advance through slides.":[""],"Transition delay":[""],"Set the waiting time between automatic slide transitions in seconds.":[""],"Slides per view":[""],"Choose how many slides appear on screen simultaneously.":[""],"Featured Image":[""],"Aspect ratio":[""],"All slides will share the same aspect ratio, for consistency.":[""],"Fit":[""],"The image will fill the entire slide and will be cropped if necessary.":[""],"The image will be resized to fit inside the slide without being cropped.":[""],"Cover":[""],"Contain":[""],"Show caption":[""],"Show credit":[""],"Post Meta":[""],"Show title":[""],"Show date":[""],"Show category":[""],"Show tag labels":[""],"Show author":[""],"Show avatar":[""],"Content Carousel":[""],"posts":["Beitr\u00e4ge"],"articles":["Artikel"],"latest":["letzten"],"query":[""],"An advanced block that displays content in a carousel format with customizable parameters and visual configurations.":[""],"The post content.":[""],"The post excerpt.":[""],"Full post content.":[""],"Post Subtitle":[""],"Post Title":[""],"by":["von"],"Category":[""],"Featured image caption":[""],"Biographical info":[""],"Social links":[""],"Email address":[""],"Link to author archive":[""],"Display the following fields:":[""],"Listings":[""],"Post Types":[""],"Additional Post Statuses":[""],"Selection here has effect only for editors, regular users will only see published posts.":[""],"Move Up":[""],"Move Down":[""],"(no title)":["(kein Titel)"],"%d item ready to reorder.":[""],"%1$s moved to position %2$d of %3$d.":[""],"Loading content\u2026":[""],"The content could not be loaded, so the order cannot be saved.":[""],"Save":[""],"Discard the new order?":[""],"Discard":[""],"Keep editing":[""],"The order you set will be lost.":[""],"Reorder Content":["Inhalt"],"Content":["Inhalt"],"Begin typing any word in a title. Click on an autocomplete result to select it.":[""],"Pick at least two items to reorder them.":[""],"Unavailable content (%d)":[""],"Deleted category":[""],"Deleted tag":[""],"Mode":[""],"The block will display only the specifically selected content.":[""],"The block will display content based on the filtering settings below.":[""],"Dynamic":[""],"Static":[""],"is one of":[""],"is all of":[""],"Include subcategories":[""],"Tags":["Schlagw\u00f6rter"],"Authors":["Autoren"],"Excluded categories":[""],"Excluded tags":[""],"Excluded %s":[""],"Allow duplicate content":[""],"Exclude this block from the page's deduplication logic.":[""],"Post-Checkout Button":[""],"After a successful purchase, a button will be presented to finish the process.":[""],"Close the modal":[""],"Go to a custom URL":[""],"Go to the previous page":[""],"Button Label":[""],"Custom URL":[""],"https:\/\/example.com":[""],"post author\u0004and":[""],"Author List":[""],"profile":[""],"Display a list of author profile cards.":[""],"Error fetching authors.":[""],"Author List Settings":[""],"Author Type":[""],"%s will be displayed.":[""],"Both guest authors and WP users":[""],"%s only":[""],"Guest authors":[""],"WP users":[""],"All authors":[""],"Columns":["Spalten"],"WP User Roles":[""],"Display alphabetical separators":[""],"Chunk authors alphabetically.":[""],"Group authors by alphabet":[""],"Display each alphabetical chunk as a discrete section.":[""],"Exclude authors with 0 posts":[""],"Authors with no published posts will be %s.":[""],"hidden":[""],"displayed":[""],"Search by author name":[""],"Authors selected here will not be displayed.":[""],"Author Profile Settings":[""],"Text Size":[""],"List":[""],"Author Name":[""],"Job Title":[""],"Role":[""],"Employer":[""],"Biography":[""],"Avatar left":[""],"Avatar on the left, content on the right.":[""],"Avatar right":[""],"Content on the left, avatar on the right.":[""],"Centered":[""],"Large centered avatar with center-aligned text.":[""],"Compact":[""],"No avatar, vertical stack.":[""],"Display an author profile card.":[""],"Coupon":[""],"Edit":[""],"Remove":[""],"Coupons are not available":[""],"Type to search for a coupon\u2026":[""],"Width":[""],"Could not find a product with ID %s. Please select a different product.":[""],"Product":[""],"Change the selected product":[""],"Type to search for a product\u2026":[""],"Allow the reader to select the variation before checkout.":[""],"Variation":[""],"Select the product variation to be added to cart.":[""],"Donation products do not support coupons. \"%s\" will not be applied.":[""],"Donation products do not support coupons.":[""],"After purchase":[""],"Name Your Price":[""],"This product has \"Name Your Price\" toggled on. You can set the custom price for this checkout.":[""],"Suggested price:":[""],"Minimum price:":[""],"Maximum price:":[""],"Custom Price":[""],"Seats":[""],"Optional. Pre-fill the number of seats. Readers can change it before paying.":[""],"Default seats":["Standard"],"per `Frequency`\u0004per %s":[""],"Frequency":[""],"Tiers":[""],"Heading\u2026":[""],"\u2026":[""],"Button text\u2026":[""],"Description\u2026":[""],"Thank you text\u2026":[""],"Low-tier":[""],"Mid-tier":[""],"High-tier":[""],"donate":["Spenden"],"memberships":["Mitgliedschaften"],"subscriptions":["Abonnements"],"Manually place a donation block on any post or page on your site.":[""],"Support reference":[""],"Could not fetch the donation settings.":[""],"Error":["Fehler"],"Go to checkout & payment settings to troubleshoot.":[""],"The Donate block will not be rendered.":[""],"The Reader Revenue platform is set to \"other\".":[""],"Go to checkout & payment settings to update the platform.":[""],"Grid View":[""],"List View":[""],"Warning: suggested donations should be at least the minimum donation amount (%1$s%2$d).":[""],"Layout":[""],"Tiers layout is disabled if the block is set to render untiered.":[""],"Default Tab":[""],"Suggested Donations":[""],"Configure manually":[""],"Tiered":[""],"Minimum donation":[""],"The Donate Block allows you to collect donations from readers. The fields are automatically defined based on your donation settings.":[""],"Edit donation settings":[""],"Styling":[""],"Button Color":[""],"News Revenue Hub Settings":[""],"Campaign ID":[""],"Alternate":[""],"Minimal":[""],"Modern":[""],"Grid":[""],"Show \"Load more posts\" button":[""],"This site is private, therefore this feature is not active.":[""],"Infinite scroll":[""],"Text":[""],"None":[""],"Excerpt":[""],"Full Post":[""],"Max number of words in excerpt":[""],"Keep reading":[""],"Show featured image":[""],"Stack on mobile":[""],"Minimum height":["Mindesth\u00f6he"],"Sets a minimum height for the block, using a percentage of the screen's current height.":[""],"Show subtitle":[""],"Color":[""],"Typography":[""],"Type Scale":[""],"Dimensions":[""],"Grid Spacing":[""],"List view":[""],"Grid view":[""],"Show media on top":[""],"Show media on left":[""],"Show media on right":[""],"Show media behind":[""],"Landscape image shape":[""],"portrait image shape":[""],"Square image shape":[""],"Uncropped":[""],"Write header\u2026":[""],"Sorry, no posts were found.":["Entschuldigung, wir konnten keine Beitr\u00e4ge finden."],"Content Loop":[""],"homepage":[""],"An advanced block that allows displaying content based on different parameters and visual configurations.":[""],"block style\u0004Borders":["Rahmen"],"Upload a document file (PDF, Word, Excel sheet, or a PPT), choose one from the media library, %s.":[""],"embed from a URL, or upload a .zip archive containing HTML assets":[""],"or embed from a URL":[""],"Upload":[""],"Media Library":[""],"Update from URL":[""],"Embed from URL":[""],"Iframe":[""],"iframe":[""],"project iframe":[""],"Embed an iframe.":[""],"Hide iframe preview":[""],"Show iframe preview":[""],"Iframe Settings":[""],"Fullscreen":[""],"If enabled, the iframe will be full screen and hide all the post content.":[""],"Height":[""],"This block will take over the page content.":[""],"Newspack embedded iframe":[""],"An error occured when uploading the iframe archive.":[""],"An error occured when setting the iframe from the archive media.":[""],"No videos found":[""],"Consider using <a href=\"%1$s\">YouTube Playlists<\/a> instead, which can be <a href=\"%2$s\">embedded<\/a> into post or page content.":[""],"YouTube Video Playlist (DEPRECATED)":[""],"video":[""],"playlist":[""],"youtube":[""],"Embed a playlist of latest YouTube videos.":[""]}}}
1
+ {"translation-revision-date":"2024-08-30 08:45-0700","generator":"WP-CLI\/2.12.0","source":"dist\/editor.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"de","plural-forms":"nplurals=2; plural=(n != 1);"},"Close":[""],"%1$s: %2$s":[""],"Update":[""],"Cancel":[""],"The posts for this block could not be loaded.":[""],"Draft":[""],"Scheduled":[""],"per %s":[""],"Donate":["Spenden"],"Author Profile":[""],"More by %s":[""],"block style\u0004Default":["Standard"],"block style\u0004Centered":[""],"once":[""],"One-time":["Einmal"],"Monthly":["Monatlich"],"Annually":["J\u00e4hrlich"],"Donation amount":["Spendenbetrag"],"Other":["Andere"],"Load more posts":["Mehr Beitr\u00e4ge laden"],"Slide %s":[""],"Slide %1$s of %2$s":[""],"Image: %s,":[""],"Playing":[""],"Paused":[""],"Small":["Klein"],"S":["S"],"Medium":["Mittel"],"M":["M"],"Large":["Gro\u00df"],"L":["L"],"Extra Large":["Extra Gro\u00df"],"XL":["XL"],"Extra-large":["Extra Gro\u00df"],"Select a layout to start with:":[""],"No authors or guest authors found for ID %s.":[""],"Error fetching authors for this post.":[""],"Error fetching byline authors.":[""],"Display":[""],"Show authors without bio":[""],"Display author profiles even if their bio is empty.":[""],"Settings":[""],"Text size":[""],"Avatar":[""],"Display avatar":[""],"Hide default avatar":[""],"Size":[""],"Avatar size":[""],"Border radius":[""],"Avatar border radius":[""],"Fetching authors\u2026":[""],"Show avatar on left":[""],"Show avatar on right":[""],"Edit selection":[""],"Select a type:":[""],"Contextual":[""],"Specific":[""],"This block was created with a block theme and is not supported in the current theme. It will render using the classic layout on the frontend.":[""],"Author bio is hidden because Custom Byline is active on this post.":[""],"Search for an author to display":[""],"Begin typing name, click autocomplete result to select.":[""],"(no name)":["(kein Name)"],"author":[""],"authors":[""],"No authors found for this post.":[""],"Preview author":[""],"Previewing 1 of %d authors. All authors display on frontend.":[""],"Square":[""],"1:1":[""],"4:3":[""],"16:9":[""],"3:4":[""],"9:16":[""],"Hide Controls":[""],"Remove navigation indicators from view.":[""],"Autoplay":["Autoplay"],"Automatically advance through slides.":[""],"Transition delay":[""],"Set the waiting time between automatic slide transitions in seconds.":[""],"Slides per view":[""],"Choose how many slides appear on screen simultaneously.":[""],"Featured Image":[""],"Aspect ratio":[""],"All slides will share the same aspect ratio, for consistency.":[""],"Fit":[""],"The image will fill the entire slide and will be cropped if necessary.":[""],"The image will be resized to fit inside the slide without being cropped.":[""],"Cover":[""],"Contain":[""],"Show caption":[""],"Show credit":[""],"Post Meta":[""],"Show title":[""],"Show date":[""],"Show category":[""],"Show tag labels":[""],"Show author":[""],"Show avatar":[""],"Content Carousel":[""],"posts":["Beitr\u00e4ge"],"articles":["Artikel"],"latest":["letzten"],"query":[""],"An advanced block that displays content in a carousel format with customizable parameters and visual configurations.":[""],"The post content.":[""],"The post excerpt.":[""],"Full post content.":[""],"Post Subtitle":[""],"Post Title":[""],"by":["von"],"Category":[""],"Featured image caption":[""],"Biographical info":[""],"Social links":[""],"Email address":[""],"Link to author archive":[""],"Display the following fields:":[""],"Listings":[""],"Post Types":[""],"Additional Post Statuses":[""],"Selection here has effect only for editors, regular users will only see published posts.":[""],"Move Up":[""],"Move Down":[""],"(no title)":["(kein Titel)"],"%d item ready to reorder.":[""],"%1$s moved to position %2$d of %3$d.":[""],"Loading content\u2026":[""],"The content could not be loaded, so the order cannot be saved.":[""],"Save":[""],"Discard the new order?":[""],"Discard":[""],"Keep editing":[""],"The order you set will be lost.":[""],"Reorder Content":["Inhalt"],"Content":["Inhalt"],"Begin typing any word in a title. Click on an autocomplete result to select it.":[""],"Pick at least two items to reorder them.":[""],"Unavailable content (%d)":[""],"Deleted category":[""],"Deleted tag":[""],"Mode":[""],"The block will display only the specifically selected content.":[""],"The block will display content based on the filtering settings below.":[""],"Dynamic":[""],"Static":[""],"is one of":[""],"is all of":[""],"Include subcategories":[""],"Tags":["Schlagw\u00f6rter"],"Authors":["Autoren"],"Excluded categories":[""],"Excluded tags":[""],"Excluded %s":[""],"Allow duplicate content":[""],"Exclude this block from the page's deduplication logic.":[""],"Post-Checkout Button":[""],"After a successful purchase, a button will be presented to finish the process.":[""],"Close the modal":[""],"Go to a custom URL":[""],"Go to the previous page":[""],"Button Label":[""],"Custom URL":[""],"https:\/\/example.com":[""],"post author\u0004and":[""],"Author List":[""],"profile":[""],"Display a list of author profile cards.":[""],"Error fetching authors.":[""],"Author List Settings":[""],"Author Type":[""],"%s will be displayed.":[""],"Both guest authors and WP users":[""],"%s only":[""],"Guest authors":[""],"WP users":[""],"All authors":[""],"Columns":["Spalten"],"WP User Roles":[""],"Display alphabetical separators":[""],"Chunk authors alphabetically.":[""],"Group authors by alphabet":[""],"Display each alphabetical chunk as a discrete section.":[""],"Exclude authors with 0 posts":[""],"Authors with no published posts will be %s.":[""],"hidden":[""],"displayed":[""],"Search by author name":[""],"Authors selected here will not be displayed.":[""],"Author Profile Settings":[""],"Text Size":[""],"List":[""],"Author Name":[""],"Job Title":[""],"Role":[""],"Employer":[""],"Biography":[""],"Avatar left":[""],"Avatar on the left, content on the right.":[""],"Avatar right":[""],"Content on the left, avatar on the right.":[""],"Centered":[""],"Large centered avatar with center-aligned text.":[""],"Compact":[""],"No avatar, vertical stack.":[""],"Display an author profile card.":[""],"Coupon":[""],"Edit":[""],"Remove":[""],"Coupons are not available":[""],"Type to search for a coupon\u2026":[""],"Width":[""],"Could not find a product with ID %s. Please select a different product.":[""],"Product":[""],"Change the selected product":[""],"Type to search for a product\u2026":[""],"Allow the reader to select the variation before checkout.":[""],"Variation":[""],"Select the product variation to be added to cart.":[""],"Donation products do not support coupons. \"%s\" will not be applied.":[""],"Donation products do not support coupons.":[""],"After purchase":[""],"Name Your Price":[""],"This product has \"Name Your Price\" toggled on. You can set the custom price for this checkout.":[""],"Suggested price:":[""],"Minimum price:":[""],"Maximum price:":[""],"Custom Price":[""],"Seats":[""],"Optional. Pre-fill the number of seats. Readers can change it before paying.":[""],"Default seats":["Standard"],"per `Frequency`\u0004per %s":[""],"Frequency":[""],"Tiers":[""],"Heading\u2026":[""],"\u2026":[""],"Button text\u2026":[""],"Description\u2026":[""],"Thank you text\u2026":[""],"Low-tier":[""],"Mid-tier":[""],"High-tier":[""],"donate":["Spenden"],"memberships":["Mitgliedschaften"],"subscriptions":["Abonnements"],"Manually place a donation block on any post or page on your site.":[""],"Support reference":[""],"Could not fetch the donation settings.":[""],"Error":["Fehler"],"Go to checkout & payment settings to troubleshoot.":[""],"The Donate block will not be rendered.":[""],"The Reader Revenue platform is set to \"other\".":[""],"Go to checkout & payment settings to update the platform.":[""],"Grid View":[""],"List View":[""],"Warning: suggested donations should be at least the minimum donation amount (%1$s%2$d).":[""],"Layout":[""],"Tiers layout is disabled if the block is set to render untiered.":[""],"Default Tab":[""],"Suggested Donations":[""],"Configure manually":[""],"Tiered":[""],"Minimum donation":[""],"The Donate Block allows you to collect donations from readers. The fields are automatically defined based on your donation settings.":[""],"Edit donation settings":[""],"Styling":[""],"Button Color":[""],"News Revenue Hub Settings":[""],"Campaign ID":[""],"Alternate":[""],"Minimal":[""],"Modern":[""],"Grid":[""],"Show \"Load more posts\" button":[""],"This site is private, therefore this feature is not active.":[""],"Infinite scroll":[""],"Text":[""],"None":[""],"Excerpt":[""],"Full Post":[""],"Max number of words in excerpt":[""],"Keep reading":[""],"Show featured image":[""],"Stack on mobile":[""],"Minimum height":["Mindesth\u00f6he"],"Sets a minimum height for the block, using a percentage of the screen's current height.":[""],"Show subtitle":[""],"Color":[""],"Typography":[""],"Type Scale":[""],"Dimensions":[""],"Grid Spacing":[""],"List view":[""],"Grid view":[""],"Show media on top":[""],"Show media on left":[""],"Show media on right":[""],"Show media behind":[""],"Landscape image shape":[""],"portrait image shape":[""],"Square image shape":[""],"Uncropped":[""],"Write header\u2026":[""],"Sorry, no posts were found.":["Entschuldigung, wir konnten keine Beitr\u00e4ge finden."],"Content Loop":[""],"homepage":[""],"An advanced block that allows displaying content based on different parameters and visual configurations.":[""],"block style\u0004Borders":["Rahmen"],"Upload a document file (PDF, Word, Excel sheet, or a PPT), choose one from the media library, %s.":[""],"embed from a URL, or upload a .zip archive containing HTML assets":[""],"or embed from a URL":[""],"Upload":[""],"Media Library":[""],"Update from URL":[""],"Embed from URL":[""],"Iframe":[""],"iframe":[""],"project iframe":[""],"Embed an iframe.":[""],"Hide iframe preview":[""],"Show iframe preview":[""],"Iframe Settings":[""],"Fullscreen":[""],"If enabled, the iframe will be full screen and hide all the post content.":[""],"Height":[""],"This block will take over the page content.":[""],"Newspack embedded iframe":[""],"An error occured when uploading the iframe archive.":[""],"An error occured when setting the iframe from the archive media.":[""],"No videos found":[""],"Consider using <a href=\"%1$s\">YouTube Playlists<\/a> instead, which can be <a href=\"%2$s\">embedded<\/a> into post or page content.":[""],"YouTube Video Playlist (DEPRECATED)":[""],"video":[""],"playlist":[""],"youtube":[""],"Embed a playlist of latest YouTube videos.":[""]}}}
@@ -2,7 +2,7 @@ msgid ""
2
2
  msgstr ""
3
3
  "Project-Id-Version: Newspack Blocks\n"
4
4
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/newspack-blocks\n"
5
- "POT-Creation-Date: 2026-09-28T17:15:16+00:00\n"
5
+ "POT-Creation-Date: 2026-10-02T12:25:46+00:00\n"
6
6
  "PO-Revision-Date: 2024-08-30 08:45-0700\n"
7
7
  "Last-Translator: \n"
8
8
  "Language-Team: \n"
@@ -283,6 +283,11 @@ msgid ""
283
283
  "Thank you for supporting %s. Your transaction was completed successfully."
284
284
  msgstr ""
285
285
 
286
+ #: includes/class-newspack-blocks-api.php:290 dist/editor.js:23
287
+ #: src/blocks/homepage-articles/store.js:182
288
+ msgid "The posts for this block could not be loaded."
289
+ msgstr ""
290
+
286
291
  #: includes/class-newspack-blocks-patterns.php:130
287
292
  msgid "Support our publication"
288
293
  msgstr ""
@@ -314,45 +319,45 @@ msgstr ""
314
319
  msgid "Newspack Subscribe"
315
320
  msgstr ""
316
321
 
317
- #: includes/class-newspack-blocks.php:1132
322
+ #: includes/class-newspack-blocks.php:1134
318
323
  msgid "Common"
319
324
  msgstr ""
320
325
 
321
326
  #. translators: separates last two sponsor names; needs a space on either side.
322
- #: includes/class-newspack-blocks.php:1233
327
+ #: includes/class-newspack-blocks.php:1235
323
328
  msgid " and "
324
329
  msgstr " und "
325
330
 
326
331
  #. translators: separates all but the last two sponsor names; needs a space at the end.
327
- #: includes/class-newspack-blocks.php:1236
332
+ #: includes/class-newspack-blocks.php:1238
328
333
  msgid ", "
329
334
  msgstr ""
330
335
 
331
- #: includes/class-newspack-blocks.php:1571
336
+ #: includes/class-newspack-blocks.php:1573
332
337
  msgid "Jetpack donations is disabled in favour of Newspack donations."
333
338
  msgstr ""
334
339
 
335
- #: includes/class-newspack-blocks.php:1604 dist/editor.js:30
340
+ #: includes/class-newspack-blocks.php:1606 dist/editor.js:30
336
341
  #: src/shared/js/utils.js:54
337
342
  msgid "Draft"
338
343
  msgstr ""
339
344
 
340
- #: includes/class-newspack-blocks.php:1605 dist/editor.js:30
345
+ #: includes/class-newspack-blocks.php:1607 dist/editor.js:30
341
346
  #: src/shared/js/utils.js:54
342
347
  msgid "Scheduled"
343
348
  msgstr ""
344
349
 
345
350
  #. Translators: %s is the %s is the frequency.
346
- #: includes/class-newspack-blocks.php:1803 dist/editor.js:52
351
+ #: includes/class-newspack-blocks.php:1805 dist/editor.js:52
347
352
  #, php-format
348
353
  msgid "per %s"
349
354
  msgstr ""
350
355
 
351
- #: includes/class-newspack-blocks.php:1834
356
+ #: includes/class-newspack-blocks.php:1836
352
357
  msgid " once"
353
358
  msgstr ""
354
359
 
355
- #: includes/class-newspack-blocks.php:1837
360
+ #: includes/class-newspack-blocks.php:1839
356
361
  msgid " per "
357
362
  msgstr ""
358
363
 
@@ -0,0 +1 @@
1
+ {"translation-revision-date":"2025-08-12T14:56:45+00:00","generator":"WP-CLI\/2.12.0","source":"src\/blocks\/homepage-articles\/store.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"es","plural-forms":"nplurals=2; plural=(n != 1);"},"The posts for this block could not be loaded.":[""]}}}
@@ -1 +1 @@
1
- {"translation-revision-date":"2025-08-12T14:56:45+00:00","generator":"WP-CLI\/2.12.0","source":"dist\/editor.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"es","plural-forms":"nplurals=2; plural=(n != 1);"},"Close":[""],"%1$s: %2$s":[""],"Update":[""],"Cancel":[""],"Draft":[""],"Scheduled":[""],"per %s":[""],"Donate":[""],"Author Profile":[""],"More by %s":[""],"block style\u0004Default":[""],"block style\u0004Centered":[""],"once":[""],"One-time":["Una vez"],"Monthly":["Mensual"],"Annually":["Anual"],"Donation amount":["Monto de la donaci\u00f3n"],"Other":["Otro"],"Load more posts":[""],"Slide %s":[""],"Slide %1$s of %2$s":[""],"Image: %s,":[""],"Playing":[""],"Paused":[""],"Small":[""],"S":[""],"Medium":[""],"M":[""],"Large":[""],"L":[""],"Extra Large":[""],"XL":[""],"Extra-large":[""],"Select a layout to start with:":[""],"No authors or guest authors found for ID %s.":[""],"Error fetching authors for this post.":[""],"Error fetching byline authors.":[""],"Display":[""],"Show authors without bio":[""],"Display author profiles even if their bio is empty.":[""],"Settings":[""],"Text size":[""],"Avatar":[""],"Display avatar":[""],"Hide default avatar":[""],"Size":[""],"Avatar size":[""],"Border radius":[""],"Avatar border radius":[""],"Fetching authors\u2026":[""],"Show avatar on left":[""],"Show avatar on right":[""],"Edit selection":[""],"Select a type:":[""],"Contextual":[""],"Specific":[""],"This block was created with a block theme and is not supported in the current theme. It will render using the classic layout on the frontend.":[""],"Author bio is hidden because Custom Byline is active on this post.":[""],"Search for an author to display":[""],"Begin typing name, click autocomplete result to select.":[""],"(no name)":[""],"author":[""],"authors":[""],"No authors found for this post.":[""],"Preview author":[""],"Previewing 1 of %d authors. All authors display on frontend.":[""],"Square":[""],"1:1":[""],"4:3":[""],"16:9":[""],"3:4":[""],"9:16":[""],"Hide Controls":[""],"Remove navigation indicators from view.":[""],"Autoplay":[""],"Automatically advance through slides.":[""],"Transition delay":[""],"Set the waiting time between automatic slide transitions in seconds.":[""],"Slides per view":[""],"Choose how many slides appear on screen simultaneously.":[""],"Featured Image":[""],"Aspect ratio":[""],"All slides will share the same aspect ratio, for consistency.":[""],"Fit":[""],"The image will fill the entire slide and will be cropped if necessary.":[""],"The image will be resized to fit inside the slide without being cropped.":[""],"Cover":[""],"Contain":[""],"Show caption":[""],"Show credit":[""],"Post Meta":[""],"Show title":[""],"Show date":[""],"Show category":[""],"Show tag labels":[""],"Show author":[""],"Show avatar":[""],"Content Carousel":[""],"posts":[""],"articles":[""],"latest":[""],"query":[""],"An advanced block that displays content in a carousel format with customizable parameters and visual configurations.":[""],"The post content.":[""],"The post excerpt.":[""],"Full post content.":[""],"Post Subtitle":[""],"Post Title":[""],"by":["por"],"Category":[""],"Featured image caption":[""],"Biographical info":[""],"Social links":[""],"Email address":[""],"Link to author archive":[""],"Display the following fields:":[""],"Listings":[""],"Post Types":[""],"Additional Post Statuses":[""],"Selection here has effect only for editors, regular users will only see published posts.":[""],"Move Up":[""],"Move Down":[""],"(no title)":[""],"%d item ready to reorder.":[""],"%1$s moved to position %2$d of %3$d.":[""],"Loading content\u2026":[""],"The content could not be loaded, so the order cannot be saved.":[""],"Save":[""],"Discard the new order?":[""],"Discard":[""],"Keep editing":[""],"The order you set will be lost.":[""],"Reorder Content":[""],"Content":[""],"Begin typing any word in a title. Click on an autocomplete result to select it.":[""],"Pick at least two items to reorder them.":[""],"Unavailable content (%d)":[""],"Deleted category":[""],"Deleted tag":[""],"Mode":[""],"The block will display only the specifically selected content.":[""],"The block will display content based on the filtering settings below.":[""],"Dynamic":[""],"Static":[""],"is one of":[""],"is all of":[""],"Include subcategories":[""],"Tags":[""],"Authors":[""],"Excluded categories":[""],"Excluded tags":[""],"Excluded %s":[""],"Allow duplicate content":[""],"Exclude this block from the page's deduplication logic.":[""],"Post-Checkout Button":[""],"After a successful purchase, a button will be presented to finish the process.":[""],"Close the modal":[""],"Go to a custom URL":[""],"Go to the previous page":[""],"Button Label":[""],"Custom URL":[""],"https:\/\/example.com":[""],"post author\u0004and":[""],"Author List":[""],"profile":[""],"Display a list of author profile cards.":[""],"Error fetching authors.":[""],"Author List Settings":[""],"Author Type":[""],"%s will be displayed.":[""],"Both guest authors and WP users":[""],"%s only":[""],"Guest authors":[""],"WP users":[""],"All authors":[""],"Columns":[""],"WP User Roles":[""],"Display alphabetical separators":[""],"Chunk authors alphabetically.":[""],"Group authors by alphabet":[""],"Display each alphabetical chunk as a discrete section.":[""],"Exclude authors with 0 posts":[""],"Authors with no published posts will be %s.":[""],"hidden":[""],"displayed":[""],"Search by author name":[""],"Authors selected here will not be displayed.":[""],"Author Profile Settings":[""],"Text Size":[""],"List":[""],"Author Name":[""],"Job Title":[""],"Role":[""],"Employer":[""],"Biography":[""],"Avatar left":[""],"Avatar on the left, content on the right.":[""],"Avatar right":[""],"Content on the left, avatar on the right.":[""],"Centered":[""],"Large centered avatar with center-aligned text.":[""],"Compact":[""],"No avatar, vertical stack.":[""],"Display an author profile card.":[""],"Coupon":[""],"Edit":[""],"Remove":[""],"Coupons are not available":[""],"Type to search for a coupon\u2026":[""],"Width":[""],"Could not find a product with ID %s. Please select a different product.":[""],"Product":[""],"Change the selected product":[""],"Type to search for a product\u2026":[""],"Allow the reader to select the variation before checkout.":[""],"Variation":[""],"Select the product variation to be added to cart.":[""],"Donation products do not support coupons. \"%s\" will not be applied.":[""],"Donation products do not support coupons.":[""],"After purchase":[""],"Name Your Price":[""],"This product has \"Name Your Price\" toggled on. You can set the custom price for this checkout.":[""],"Suggested price:":[""],"Minimum price:":[""],"Maximum price:":[""],"Custom Price":[""],"Seats":[""],"Optional. Pre-fill the number of seats. Readers can change it before paying.":[""],"Default seats":[""],"per `Frequency`\u0004per %s":[""],"Frequency":[""],"Tiers":[""],"Heading\u2026":[""],"\u2026":[""],"Button text\u2026":[""],"Description\u2026":[""],"Thank you text\u2026":[""],"Low-tier":[""],"Mid-tier":[""],"High-tier":[""],"donate":[""],"memberships":[""],"subscriptions":[""],"Manually place a donation block on any post or page on your site.":[""],"Support reference":[""],"Could not fetch the donation settings.":[""],"Error":[""],"Go to checkout & payment settings to troubleshoot.":[""],"The Donate block will not be rendered.":[""],"The Reader Revenue platform is set to \"other\".":[""],"Go to checkout & payment settings to update the platform.":[""],"Grid View":[""],"List View":[""],"Warning: suggested donations should be at least the minimum donation amount (%1$s%2$d).":[""],"Layout":[""],"Tiers layout is disabled if the block is set to render untiered.":[""],"Default Tab":[""],"Suggested Donations":[""],"Configure manually":[""],"Tiered":[""],"Minimum donation":[""],"The Donate Block allows you to collect donations from readers. The fields are automatically defined based on your donation settings.":[""],"Edit donation settings":[""],"Styling":[""],"Button Color":[""],"News Revenue Hub Settings":[""],"Campaign ID":[""],"Alternate":[""],"Minimal":[""],"Modern":[""],"Grid":[""],"Show \"Load more posts\" button":[""],"This site is private, therefore this feature is not active.":[""],"Infinite scroll":[""],"Text":[""],"None":[""],"Excerpt":[""],"Full Post":[""],"Max number of words in excerpt":[""],"Keep reading":[""],"Show featured image":[""],"Stack on mobile":[""],"Minimum height":[""],"Sets a minimum height for the block, using a percentage of the screen's current height.":[""],"Show subtitle":[""],"Color":[""],"Typography":[""],"Type Scale":[""],"Dimensions":[""],"Grid Spacing":[""],"List view":[""],"Grid view":[""],"Show media on top":[""],"Show media on left":[""],"Show media on right":[""],"Show media behind":[""],"Landscape image shape":[""],"portrait image shape":[""],"Square image shape":[""],"Uncropped":[""],"Write header\u2026":[""],"Sorry, no posts were found.":[""],"Content Loop":[""],"homepage":[""],"An advanced block that allows displaying content based on different parameters and visual configurations.":[""],"block style\u0004Borders":[""],"Upload a document file (PDF, Word, Excel sheet, or a PPT), choose one from the media library, %s.":[""],"embed from a URL, or upload a .zip archive containing HTML assets":[""],"or embed from a URL":[""],"Upload":[""],"Media Library":[""],"Update from URL":[""],"Embed from URL":[""],"Iframe":[""],"iframe":[""],"project iframe":[""],"Embed an iframe.":[""],"Hide iframe preview":[""],"Show iframe preview":[""],"Iframe Settings":[""],"Fullscreen":[""],"If enabled, the iframe will be full screen and hide all the post content.":[""],"Height":[""],"This block will take over the page content.":[""],"Newspack embedded iframe":[""],"An error occured when uploading the iframe archive.":[""],"An error occured when setting the iframe from the archive media.":[""],"No videos found":[""],"Consider using <a href=\"%1$s\">YouTube Playlists<\/a> instead, which can be <a href=\"%2$s\">embedded<\/a> into post or page content.":[""],"YouTube Video Playlist (DEPRECATED)":[""],"video":[""],"playlist":[""],"youtube":[""],"Embed a playlist of latest YouTube videos.":[""]}}}
1
+ {"translation-revision-date":"2025-08-12T14:56:45+00:00","generator":"WP-CLI\/2.12.0","source":"dist\/editor.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"es","plural-forms":"nplurals=2; plural=(n != 1);"},"Close":[""],"%1$s: %2$s":[""],"Update":[""],"Cancel":[""],"The posts for this block could not be loaded.":[""],"Draft":[""],"Scheduled":[""],"per %s":[""],"Donate":[""],"Author Profile":[""],"More by %s":[""],"block style\u0004Default":[""],"block style\u0004Centered":[""],"once":[""],"One-time":["Una vez"],"Monthly":["Mensual"],"Annually":["Anual"],"Donation amount":["Monto de la donaci\u00f3n"],"Other":["Otro"],"Load more posts":[""],"Slide %s":[""],"Slide %1$s of %2$s":[""],"Image: %s,":[""],"Playing":[""],"Paused":[""],"Small":[""],"S":[""],"Medium":[""],"M":[""],"Large":[""],"L":[""],"Extra Large":[""],"XL":[""],"Extra-large":[""],"Select a layout to start with:":[""],"No authors or guest authors found for ID %s.":[""],"Error fetching authors for this post.":[""],"Error fetching byline authors.":[""],"Display":[""],"Show authors without bio":[""],"Display author profiles even if their bio is empty.":[""],"Settings":[""],"Text size":[""],"Avatar":[""],"Display avatar":[""],"Hide default avatar":[""],"Size":[""],"Avatar size":[""],"Border radius":[""],"Avatar border radius":[""],"Fetching authors\u2026":[""],"Show avatar on left":[""],"Show avatar on right":[""],"Edit selection":[""],"Select a type:":[""],"Contextual":[""],"Specific":[""],"This block was created with a block theme and is not supported in the current theme. It will render using the classic layout on the frontend.":[""],"Author bio is hidden because Custom Byline is active on this post.":[""],"Search for an author to display":[""],"Begin typing name, click autocomplete result to select.":[""],"(no name)":[""],"author":[""],"authors":[""],"No authors found for this post.":[""],"Preview author":[""],"Previewing 1 of %d authors. All authors display on frontend.":[""],"Square":[""],"1:1":[""],"4:3":[""],"16:9":[""],"3:4":[""],"9:16":[""],"Hide Controls":[""],"Remove navigation indicators from view.":[""],"Autoplay":[""],"Automatically advance through slides.":[""],"Transition delay":[""],"Set the waiting time between automatic slide transitions in seconds.":[""],"Slides per view":[""],"Choose how many slides appear on screen simultaneously.":[""],"Featured Image":[""],"Aspect ratio":[""],"All slides will share the same aspect ratio, for consistency.":[""],"Fit":[""],"The image will fill the entire slide and will be cropped if necessary.":[""],"The image will be resized to fit inside the slide without being cropped.":[""],"Cover":[""],"Contain":[""],"Show caption":[""],"Show credit":[""],"Post Meta":[""],"Show title":[""],"Show date":[""],"Show category":[""],"Show tag labels":[""],"Show author":[""],"Show avatar":[""],"Content Carousel":[""],"posts":[""],"articles":[""],"latest":[""],"query":[""],"An advanced block that displays content in a carousel format with customizable parameters and visual configurations.":[""],"The post content.":[""],"The post excerpt.":[""],"Full post content.":[""],"Post Subtitle":[""],"Post Title":[""],"by":["por"],"Category":[""],"Featured image caption":[""],"Biographical info":[""],"Social links":[""],"Email address":[""],"Link to author archive":[""],"Display the following fields:":[""],"Listings":[""],"Post Types":[""],"Additional Post Statuses":[""],"Selection here has effect only for editors, regular users will only see published posts.":[""],"Move Up":[""],"Move Down":[""],"(no title)":[""],"%d item ready to reorder.":[""],"%1$s moved to position %2$d of %3$d.":[""],"Loading content\u2026":[""],"The content could not be loaded, so the order cannot be saved.":[""],"Save":[""],"Discard the new order?":[""],"Discard":[""],"Keep editing":[""],"The order you set will be lost.":[""],"Reorder Content":[""],"Content":[""],"Begin typing any word in a title. Click on an autocomplete result to select it.":[""],"Pick at least two items to reorder them.":[""],"Unavailable content (%d)":[""],"Deleted category":[""],"Deleted tag":[""],"Mode":[""],"The block will display only the specifically selected content.":[""],"The block will display content based on the filtering settings below.":[""],"Dynamic":[""],"Static":[""],"is one of":[""],"is all of":[""],"Include subcategories":[""],"Tags":[""],"Authors":[""],"Excluded categories":[""],"Excluded tags":[""],"Excluded %s":[""],"Allow duplicate content":[""],"Exclude this block from the page's deduplication logic.":[""],"Post-Checkout Button":[""],"After a successful purchase, a button will be presented to finish the process.":[""],"Close the modal":[""],"Go to a custom URL":[""],"Go to the previous page":[""],"Button Label":[""],"Custom URL":[""],"https:\/\/example.com":[""],"post author\u0004and":[""],"Author List":[""],"profile":[""],"Display a list of author profile cards.":[""],"Error fetching authors.":[""],"Author List Settings":[""],"Author Type":[""],"%s will be displayed.":[""],"Both guest authors and WP users":[""],"%s only":[""],"Guest authors":[""],"WP users":[""],"All authors":[""],"Columns":[""],"WP User Roles":[""],"Display alphabetical separators":[""],"Chunk authors alphabetically.":[""],"Group authors by alphabet":[""],"Display each alphabetical chunk as a discrete section.":[""],"Exclude authors with 0 posts":[""],"Authors with no published posts will be %s.":[""],"hidden":[""],"displayed":[""],"Search by author name":[""],"Authors selected here will not be displayed.":[""],"Author Profile Settings":[""],"Text Size":[""],"List":[""],"Author Name":[""],"Job Title":[""],"Role":[""],"Employer":[""],"Biography":[""],"Avatar left":[""],"Avatar on the left, content on the right.":[""],"Avatar right":[""],"Content on the left, avatar on the right.":[""],"Centered":[""],"Large centered avatar with center-aligned text.":[""],"Compact":[""],"No avatar, vertical stack.":[""],"Display an author profile card.":[""],"Coupon":[""],"Edit":[""],"Remove":[""],"Coupons are not available":[""],"Type to search for a coupon\u2026":[""],"Width":[""],"Could not find a product with ID %s. Please select a different product.":[""],"Product":[""],"Change the selected product":[""],"Type to search for a product\u2026":[""],"Allow the reader to select the variation before checkout.":[""],"Variation":[""],"Select the product variation to be added to cart.":[""],"Donation products do not support coupons. \"%s\" will not be applied.":[""],"Donation products do not support coupons.":[""],"After purchase":[""],"Name Your Price":[""],"This product has \"Name Your Price\" toggled on. You can set the custom price for this checkout.":[""],"Suggested price:":[""],"Minimum price:":[""],"Maximum price:":[""],"Custom Price":[""],"Seats":[""],"Optional. Pre-fill the number of seats. Readers can change it before paying.":[""],"Default seats":[""],"per `Frequency`\u0004per %s":[""],"Frequency":[""],"Tiers":[""],"Heading\u2026":[""],"\u2026":[""],"Button text\u2026":[""],"Description\u2026":[""],"Thank you text\u2026":[""],"Low-tier":[""],"Mid-tier":[""],"High-tier":[""],"donate":[""],"memberships":[""],"subscriptions":[""],"Manually place a donation block on any post or page on your site.":[""],"Support reference":[""],"Could not fetch the donation settings.":[""],"Error":[""],"Go to checkout & payment settings to troubleshoot.":[""],"The Donate block will not be rendered.":[""],"The Reader Revenue platform is set to \"other\".":[""],"Go to checkout & payment settings to update the platform.":[""],"Grid View":[""],"List View":[""],"Warning: suggested donations should be at least the minimum donation amount (%1$s%2$d).":[""],"Layout":[""],"Tiers layout is disabled if the block is set to render untiered.":[""],"Default Tab":[""],"Suggested Donations":[""],"Configure manually":[""],"Tiered":[""],"Minimum donation":[""],"The Donate Block allows you to collect donations from readers. The fields are automatically defined based on your donation settings.":[""],"Edit donation settings":[""],"Styling":[""],"Button Color":[""],"News Revenue Hub Settings":[""],"Campaign ID":[""],"Alternate":[""],"Minimal":[""],"Modern":[""],"Grid":[""],"Show \"Load more posts\" button":[""],"This site is private, therefore this feature is not active.":[""],"Infinite scroll":[""],"Text":[""],"None":[""],"Excerpt":[""],"Full Post":[""],"Max number of words in excerpt":[""],"Keep reading":[""],"Show featured image":[""],"Stack on mobile":[""],"Minimum height":[""],"Sets a minimum height for the block, using a percentage of the screen's current height.":[""],"Show subtitle":[""],"Color":[""],"Typography":[""],"Type Scale":[""],"Dimensions":[""],"Grid Spacing":[""],"List view":[""],"Grid view":[""],"Show media on top":[""],"Show media on left":[""],"Show media on right":[""],"Show media behind":[""],"Landscape image shape":[""],"portrait image shape":[""],"Square image shape":[""],"Uncropped":[""],"Write header\u2026":[""],"Sorry, no posts were found.":[""],"Content Loop":[""],"homepage":[""],"An advanced block that allows displaying content based on different parameters and visual configurations.":[""],"block style\u0004Borders":[""],"Upload a document file (PDF, Word, Excel sheet, or a PPT), choose one from the media library, %s.":[""],"embed from a URL, or upload a .zip archive containing HTML assets":[""],"or embed from a URL":[""],"Upload":[""],"Media Library":[""],"Update from URL":[""],"Embed from URL":[""],"Iframe":[""],"iframe":[""],"project iframe":[""],"Embed an iframe.":[""],"Hide iframe preview":[""],"Show iframe preview":[""],"Iframe Settings":[""],"Fullscreen":[""],"If enabled, the iframe will be full screen and hide all the post content.":[""],"Height":[""],"This block will take over the page content.":[""],"Newspack embedded iframe":[""],"An error occured when uploading the iframe archive.":[""],"An error occured when setting the iframe from the archive media.":[""],"No videos found":[""],"Consider using <a href=\"%1$s\">YouTube Playlists<\/a> instead, which can be <a href=\"%2$s\">embedded<\/a> into post or page content.":[""],"YouTube Video Playlist (DEPRECATED)":[""],"video":[""],"playlist":[""],"youtube":[""],"Embed a playlist of latest YouTube videos.":[""]}}}
@@ -2,7 +2,7 @@ msgid ""
2
2
  msgstr ""
3
3
  "Project-Id-Version: Newspack Blocks 1.0.0-alpha.20\n"
4
4
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/newspack-blocks\n"
5
- "POT-Creation-Date: 2026-09-28T17:15:16+00:00\n"
5
+ "POT-Creation-Date: 2026-10-02T12:25:46+00:00\n"
6
6
  "PO-Revision-Date: 2025-08-12T14:56:45+00:00\n"
7
7
  "Last-Translator: \n"
8
8
  "Language-Team: \n"
@@ -275,6 +275,11 @@ msgid ""
275
275
  "Thank you for supporting %s. Your transaction was completed successfully."
276
276
  msgstr ""
277
277
 
278
+ #: includes/class-newspack-blocks-api.php:290 dist/editor.js:23
279
+ #: src/blocks/homepage-articles/store.js:182
280
+ msgid "The posts for this block could not be loaded."
281
+ msgstr ""
282
+
278
283
  #: includes/class-newspack-blocks-patterns.php:130
279
284
  msgid "Support our publication"
280
285
  msgstr ""
@@ -306,45 +311,45 @@ msgstr ""
306
311
  msgid "Newspack Subscribe"
307
312
  msgstr ""
308
313
 
309
- #: includes/class-newspack-blocks.php:1132
314
+ #: includes/class-newspack-blocks.php:1134
310
315
  msgid "Common"
311
316
  msgstr ""
312
317
 
313
318
  #. translators: separates last two sponsor names; needs a space on either side.
314
- #: includes/class-newspack-blocks.php:1233
319
+ #: includes/class-newspack-blocks.php:1235
315
320
  msgid " and "
316
321
  msgstr " y "
317
322
 
318
323
  #. translators: separates all but the last two sponsor names; needs a space at the end.
319
- #: includes/class-newspack-blocks.php:1236
324
+ #: includes/class-newspack-blocks.php:1238
320
325
  msgid ", "
321
326
  msgstr ""
322
327
 
323
- #: includes/class-newspack-blocks.php:1571
328
+ #: includes/class-newspack-blocks.php:1573
324
329
  msgid "Jetpack donations is disabled in favour of Newspack donations."
325
330
  msgstr ""
326
331
 
327
- #: includes/class-newspack-blocks.php:1604 dist/editor.js:30
332
+ #: includes/class-newspack-blocks.php:1606 dist/editor.js:30
328
333
  #: src/shared/js/utils.js:54
329
334
  msgid "Draft"
330
335
  msgstr ""
331
336
 
332
- #: includes/class-newspack-blocks.php:1605 dist/editor.js:30
337
+ #: includes/class-newspack-blocks.php:1607 dist/editor.js:30
333
338
  #: src/shared/js/utils.js:54
334
339
  msgid "Scheduled"
335
340
  msgstr ""
336
341
 
337
342
  #. Translators: %s is the %s is the frequency.
338
- #: includes/class-newspack-blocks.php:1803 dist/editor.js:52
343
+ #: includes/class-newspack-blocks.php:1805 dist/editor.js:52
339
344
  #, php-format
340
345
  msgid "per %s"
341
346
  msgstr ""
342
347
 
343
- #: includes/class-newspack-blocks.php:1834
348
+ #: includes/class-newspack-blocks.php:1836
344
349
  msgid " once"
345
350
  msgstr ""
346
351
 
347
- #: includes/class-newspack-blocks.php:1837
352
+ #: includes/class-newspack-blocks.php:1839
348
353
  msgid " per "
349
354
  msgstr ""
350
355
 
@@ -0,0 +1 @@
1
+ {"translation-revision-date":"2024-08-30 08:46-0700","generator":"WP-CLI\/2.12.0","source":"src\/blocks\/homepage-articles\/store.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr_BE","plural-forms":"nplurals=2; plural=(n > 1);"},"The posts for this block could not be loaded.":[""]}}}