2025-04-25 12:30:07 +02:00
|
|
|
|
/*! For license information please see newsletter-widget.min.js.LICENSE.txt */
|
2025-12-12 13:13:07 +01:00
|
|
|
|
(()=>{var e={69:(e,t,n)=>{var r=n(44558);r.prototype.formulaEval=function(){"use strict";for(var e,t,n,r=[],i=this.value,o=0;o<i.length;o++)1===i[o].type||3===i[o].type?r.push({value:3===i[o].type?i[o].show:i[o].value,type:1}):13===i[o].type?r.push({value:i[o].show,type:1}):0===i[o].type?r[r.length-1]={value:i[o].show+("-"!=i[o].show?"(":"")+r[r.length-1].value+("-"!=i[o].show?")":""),type:0}:7===i[o].type?r[r.length-1]={value:(1!=r[r.length-1].type?"(":"")+r[r.length-1].value+(1!=r[r.length-1].type?")":"")+i[o].show,type:7}:10===i[o].type?(e=r.pop(),t=r.pop(),"P"===i[o].show||"C"===i[o].show?r.push({value:"<sup>"+t.value+"</sup>"+i[o].show+"<sub>"+e.value+"</sub>",type:10}):r.push({value:(1!=t.type?"(":"")+t.value+(1!=t.type?")":"")+"<sup>"+e.value+"</sup>",type:1})):2===i[o].type||9===i[o].type?(e=r.pop(),t=r.pop(),r.push({value:(1!=t.type?"(":"")+t.value+(1!=t.type?")":"")+i[o].show+(1!=e.type?"(":"")+e.value+(1!=e.type?")":""),type:i[o].type})):12===i[o].type&&(e=r.pop(),t=r.pop(),n=r.pop(),r.push({value:i[o].show+"("+n.value+","+t.value+","+e.value+")",type:12}));return r[0].value},e.exports=r},270:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(80226),i=n(91363),o=n(66212),u=n(13656);function a(e){return Math.sign(e)*e*e}function s(){var e,t=(0,r.Ay)(),n=[0,1],l=!1;function c(n){var r=function(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}(t(n));return isNaN(r)?e:l?Math.round(r):r}return c.invert=function(e){return t.invert(a(e))},c.domain=function(e){return arguments.length?(t.domain(e),c):t.domain()},c.range=function(e){return arguments.length?(t.range((n=Array.from(e,u.A)).map(a)),c):n.slice()},c.rangeRound=function(e){return c.range(e).round(!0)},c.round=function(e){return arguments.length?(l=!!e,c):l},c.clamp=function(e){return arguments.length?(t.clamp(e),c):t.clamp()},c.unknown=function(t){return arguments.length?(e=t,c):e},c.copy=function(){return s(t.domain(),n).round(l).clamp(t.clamp()).unknown(e)},i.C.apply(c,arguments),(0,o.C)(c)}},785:(e,t,n)=>{"use strict";function r(e){return function(){return e}}n.d(t,{A:()=>r})},792:(e,t,n)=>{e.exports=n(91418)},880:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(95883);const i={draw:function(e,t){var n=Math.sqrt(t/r.pi);e.moveTo(n,0),e.arc(0,0,n,0,r.FA)}}},976:(e,t,n)=>{"use strict";n.d(t,{A:()=>h});var r=n(52141),i=n(68514),o=n(84422),u=n(75909),a=n(33361),s=n(23892),l=n(63134),c=n(56876),f=Array.prototype.map,d=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function h(e){var t=void 0===e.grouping||void 0===e.thousands?c.A:(0,i.A)(f.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",h=void 0===e.currency?"":e.currency[1]+"",p=void 0===e.decimal?".":e.decimal+"",y=void 0===e.numerals?c.A:(0,o.A)(f.call(e.numerals,String)),g=void 0===e.percent?"%":e.percent+"",v=void 0===e.minus?"−":e.minus+"",m=void 0===e.nan?"NaN":e.nan+"";function b(e){var r=(e=(0,u.A)(e)).fill,i=e.align,o=e.sign,c=e.symbol,f=e.zero,b=e.width,_=e.comma,w=e.precision,x=e.trim,M=e.type;"n"===M?(_=!0,M="g"):s.A[M]||(void 0===w&&(w=12),x=!0,M="g"),(f||"0"===r&&"="===i)&&(f=!0,r="0",i="=");var A="$"===c?n:"#"===c&&/[boxX]/.test(M)?"0"+M.toLowerCase():"",O="$"===c?h:/[%p]/.test(M)?g:"",j=s.A[M],P=/[defgprs%]/.test(M);function k(e){var n,u,s,c=A,h=O;if("c"===M)h=j(e)+h,e="";else{var g=(e=+e)<0||1/e<0;if(e=isNaN(e)?m:j(Math.abs(e),w),x&&(e=(0,a.A)(e)),g&&0===+e&&"+"!==o&&(g=!1),c=(g?"("===o?o:v:"-"===o||"("===o?"":o)+c,h=("s"===M?d[8+l.u/3]:"")+h+(g&&"("===o?")":""),P)for(n=-1,u=e.length;++n<u;)if(48>(s=e.charCodeAt(n))||s>57){h=(46===s?p+e.slice(n+1):e.slice(n))+h,e=e.slice(0,n);break}}_&&!f&&(e=t(e,1/0));var k=c.length+e.length+h.length,T=k<b?new Array(b-k+1).join(r):"";switch(_&&f&&(e=t(T+e,T.length?b-h.length:1/0),T=""),i){case"<":e=c+e+h+T;break;case"=":e=c+T+e+h;break;case"^":e=T.slice(0,k=T.length>>1)+c+e+h+T.slice(k);break;default:e=T+c+e+h}return y(e)}return w=void 0===w?6:/[gprs]/.test(M)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w)),k.toString=function(){return e+""},k}return{format:b,formatPrefix:function(e,t){var n=b(((e=(0,u.
|
2025-04-25 12:30:07 +02:00
|
|
|
|
//translators: %1$s is the total number of subscribers, %2$s is the number of email subscribers
|
2025-07-27 19:58:08 +02:00
|
|
|
|
_n("%1$s subscriber (%2$s via email)","%1$s subscribers (%2$s via email)",m,"jetpack"),(0,f.ZV)(m),(0,f.ZV)(g)),A=(0,a.sprintf)(
|
2025-04-25 12:30:07 +02:00
|
|
|
|
//translators: %s is the number of paid subscribers
|
2025-12-12 13:13:07 +01:00
|
|
|
|
_n("%s paid subscriber","%s paid subscribers",v,"jetpack"),(0,f.ZV)(v));return(0,p.jsxs)("div",{className:"newsletter-widget",children:[_&&(0,p.jsx)("div",{className:"newsletter-widget__header",children:(0,p.jsxs)("div",{className:"newsletter-widget__stats",children:[(0,p.jsxs)("span",{className:"newsletter-widget__stat-item",children:[(0,p.jsx)("span",{className:"newsletter-widget__icon",children:(0,p.jsx)(o.Icon,{icon:s.A,size:24})}),(0,p.jsx)("span",{className:"newsletter-widget__stat-content",children:(0,p.jsx)("span",{className:"newsletter-widget__stat-label",children:(0,d.j)(!0,(0,f.R8)(e,t),"all_subscribers_click",M)})})]}),(0,p.jsxs)("span",{className:"newsletter-widget__stat-item",children:[(0,p.jsx)("span",{className:"newsletter-widget__icon",children:(0,p.jsx)(o.Icon,{icon:l.A,size:24})}),(0,p.jsx)("span",{className:"newsletter-widget__stat-content",children:(0,p.jsx)("span",{className:"newsletter-widget__stat-label",children:(0,d.j)(!0,(0,f.R8)(e,t),"paid_subscribers_click",A)})})]})]})}),w&&(0,p.jsxs)("div",{className:"newsletter-widget__chart",children:[(0,p.jsx)("h3",{className:"newsletter-widget__heading",children:__("Total Subscribers","jetpack")}),(0,p.jsx)(h.w,{subscriberTotalsByDate:b})]}),(0,p.jsxs)("div",{className:"newsletter-widget__footer",children:[(0,p.jsx)("p",{className:"newsletter-widget__footer-msg",children:(0,u.createInterpolateElement)(__("Effortlessly turn posts into emails with our Newsletter feature. Expand your reach, engage readers, and monetize your writing. No coding required. <link>Learn more</link>","jetpack"),{link:(0,d.j)(n,n?"https://wordpress.com/learn/courses/newsletters-101/wordpress-com-newsletter":"https://jetpack.com/support/newsletter","learn_more_click")})}),(0,p.jsxs)("div",{children:[(0,p.jsx)("h3",{className:"newsletter-widget__heading",children:__("Quick Links","jetpack")}),(0,p.jsxs)("ul",{className:"newsletter-widget__footer-list",children:[(0,p.jsx)("li",{children:(0,p.jsx)("a",{href:`${t}post-new.php`,onClick:(0,f.R)(x,"publish_post_click"),children:__("Publish your next post","jetpack")})}),y&&(0,p.jsx)("li",{children:(0,d.j)(!0,(0,f.R8)(e,t),"view_stats_click",__("View subscriber stats","jetpack"))}),(0,p.jsx)("li",{children:(0,d.j)(n,(0,r.A)((0,f.Qj)(`subscribers/${e}`,n),{anchor:"add-subscribers"}),"import_subscribers_click",__("Import subscribers","jetpack"))}),(0,p.jsx)("li",{children:(0,d.j)(n,(0,r.A)((0,f.Qj)(`subscribers/${e}`,n)),"manage_subscribers_click",__("Manage subscribers","jetpack"))}),(0,p.jsx)("li",{children:(0,d.j)(n,(0,r.A)((0,f.Qj)(`${n?"earn":"monetize"}/${e}`,n)),"monetize_click",__("Monetize","jetpack"))}),(0,p.jsx)("li",{children:(0,d.j)(!0,(0,f.iP)(e,n,t),"newsletter_settings_click",__("Newsletter settings","jetpack"))})]})]})]})]})}},22079:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(e,t){t.range&&e.range(t.range)}},22564:(e,t,n)=>{"use strict";n.d(t,{A:()=>m,B:()=>v});var r=n(74680),i=n(31184),o=n(88566),u=n(70788),a=n(41208),s=n(4836),l=n(10289),c=n(91208),f=n(68979),d=n(80226),h=n(91363),p=n(94492);function y(e){return new Date(e)}function g(e){return e instanceof Date?+e:+new Date(+e)}function v(e,t,n,r,i,o,u,a,s,l){var c=(0,d.Ay)(),f=c.invert,h=c.domain,m=l(".%L"),b=l(":%S"),_=l("%I:%M"),w=l("%I %p"),x=l("%a %d"),M=l("%b %d"),A=l("%B"),O=l("%Y");function j(e){return(s(e)<e?m:a(e)<e?b:u(e)<e?_:o(e)<e?w:r(e)<e?i(e)<e?x:M:n(e)<e?A:O)(e)}return c.invert=function(e){return new Date(f(e))},c.domain=function(e){return arguments.length?h(Array.from(e,g)):h().map(y)},c.ticks=function(t){var n=h();return e(n[0],n[n.length-1],null==t?10:t)},c.tickFormat=function(e,t){return null==t?j:l(t)},c.nice=function(e){var n=h();return e&&"function"==typeof e.range||(e=t(n[0],n[n.length-1],null==e?10:e)),e?h((0,p.A)(n,e)):c},c.copy=function(){return(0,d.C)(c,v(e,t,n,r,i,o,u,a,s,l))},c}function m(){return h.C.apply(v(c.Cf,c.yE,l.he,s.Ui,a.YP,u.UA,o.Ag,i.wX,r.R,f.DC).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}},22604:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},22776:(e,t,n)=>{var r=n(11665);e.exports=function(){re
|
2025-04-25 12:30:07 +02:00
|
|
|
|
// translators: %s is the total number of subscribers.
|
2025-07-27 19:58:08 +02:00
|
|
|
|
__("All: %s","jetpack"),(0,v.ZV)(x(t)))})]}),(0,m.jsxs)("div",{className:"subscribers-chart__tooltip-stat",children:[(0,m.jsx)("div",{style:{backgroundColor:g.hg.paid},className:"subscribers-chart__tooltip-indicator"}),(0,m.jsx)("span",{children:(0,y.sprintf)(
|
2025-04-25 12:30:07 +02:00
|
|
|
|
// translators: %s is the number of paid subscribers.
|
2025-12-12 13:13:07 +01:00
|
|
|
|
__("Paid: %s","jetpack"),(0,v.ZV)(M(t)))})]})]})]})},k=({subscriberTotalsByDate:e})=>{const{tracks:t}=(0,r.st)();if((0,p.useEffect)(()=>{t.recordEvent(`${g.xe}chart_view`)},[t]),0===Object.keys(e).length)return(0,m.jsx)("div",{children:__("No data available","jetpack")});const n=(0,v.tX)(e);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{className:"subscribers-chart",children:(0,m.jsx)(u.A,{children:({width:e,height:t})=>e&&t?(0,m.jsxs)(f.A,{height:t,width:e,xScale:{type:"time"},yScale:{type:"linear",nice:!0},theme:_,margin:{top:10,right:30,bottom:30,left:(0,v.oO)(n)},children:[(0,m.jsx)(l.A,{columns:!1,numTicks:5}),(0,m.jsx)(d.A,{dataKey:"all",data:n,xAccessor:w,yAccessor:x,colorAccessor:A,strokeWidth:2,curve:i.G}),(0,m.jsx)(d.A,{dataKey:"paid",data:n,xAccessor:w,yAccessor:M,colorAccessor:A,strokeWidth:2,curve:i.G}),(0,m.jsx)(s.A,{orientation:"left",hideAxisLine:!0,hideTicks:!0,hideZero:!0,numTicks:5}),(0,m.jsx)(s.A,{orientation:"bottom",tickFormat:v.Ac,hideAxisLine:!0,hideTicks:!0,numTicks:5,tickValues:(0,v.NL)(n)}),(0,m.jsx)(c.A,{showVerticalCrosshair:!0,showSeriesGlyphs:!0,className:"subscribers-chart__tooltip",renderTooltip:P,renderGlyph:j})]}):null})}),(0,m.jsx)(o.A,{scale:b,direction:"row",labelFormat:O,shape:"circle",shapeWidth:10,shapeHeight:10,itemMargin:5,className:"subscribers-chart__legend"})]})}},54889:(e,t,n)=>{"use strict";function r(e){return null!=e&&"number"==typeof e&&!Number.isNaN(e)&&Number.isFinite(e)}n.d(t,{A:()=>r})},54992:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=a.default,t=u.default,n=c.default;function f(r){Array.isArray(r)||(r=Array.from(r));var o,a,c,f=r.length,d=new Array(f);for(o=0;o<f;++o)d[o]=e(r[o],o,r);var h=t(d),p=h[0],y=h[1],g=n(d,p,y);if(!Array.isArray(g)){const e=y,n=+g;if(t===u.default&&([p,y]=(0,s.default)(p,y,n)),(g=(0,l.default)(p,y,n))[0]<=p&&(c=(0,l.tickIncrement)(p,y,n)),g[g.length-1]>=y)if(e>=y&&t===u.default){const e=(0,l.tickIncrement)(p,y,n);isFinite(e)&&(e>0?y=(Math.floor(y/e)+1)*e:e<0&&(y=(Math.ceil(y*-e)+1)/-e))}else g.pop()}for(var v=g.length,m=0,b=v;g[m]<=p;)++m;for(;g[b-1]>y;)--b;(m||b<v)&&(g=g.slice(m,b),v=b-m);var _,w=new Array(v+1);for(o=0;o<=v;++o)(_=w[o]=[]).x0=o>0?g[o-1]:p,_.x1=o<v?g[o]:y;if(isFinite(c)){if(c>0)for(o=0;o<f;++o)null!=(a=d[o])&&p<=a&&a<=y&&w[Math.min(v,Math.floor((a-p)/c))].push(r[o]);else if(c<0)for(o=0;o<f;++o)if(null!=(a=d[o])&&p<=a&&a<=y){const e=Math.floor((p-a)*c);w[Math.min(v,e+(g[e]<=a))].push(r[o])}}else for(o=0;o<f;++o)null!=(a=d[o])&&p<=a&&a<=y&&w[(0,i.default)(g,a,0,v)].push(r[o]);return w}return f.value=function(t){return arguments.length?(e="function"==typeof t?t:(0,o.default)(t),f):e},f.domain=function(e){return arguments.length?(t="function"==typeof e?e:(0,o.default)([e[0],e[1]]),f):t},f.thresholds=function(e){return arguments.length?(n="function"==typeof e?e:(0,o.default)(Array.isArray(e)?r.slice.call(e):e),f):n},f};var r=n(8668),i=d(n(50331)),o=d(n(84633)),u=d(n(58605)),a=d(n(19723)),s=d(n(54388)),l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var u=i?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(94487)),c=d(n(37696));function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function d(e){return e&&e.__esModule?e:{default:e}}},55108:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(11390),i=(0,n(93144).A)("domain","range","reverse","align","padding","round");function o(e){return i((0,r.z)(),e)}},55154:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n,o=0,u=1/0,a){if(n=Math.floor(n),o=Math.floor(Math.max(0,o)),u=Math.floor(Math.min(t.length-1,u)),!(o<=n&&n<=u))return t;a=void 0===a?r.ascendingDefined:(0,r.com
|