(globalThis.webpackChunknewspack=globalThis.webpackChunknewspack||[]).push([[4223],{2:(e,t,n)=>{var r=n(2199),o=n(4664),a=n(5950);e.exports=function(e){return r(e,a,o)}},76:e=>{"use strict";e.exports=Function.prototype.call},79:(e,t,n)=>{var r=n(3702),o=n(80),a=n(4739),i=n(8655),s=n(1175);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6025),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},104:(e,t,n)=>{var r=n(3661);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=e.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},124:(e,t,n)=>{var r=n(9325);e.exports=function(){return r.Date.now()}},133:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(7723),o=n(1455),a=n.n(o),i=n(6087),s=n(5928),c=n(7896),l=n(3737),u=n(790);function p({onUpdate:e,onSuccess:t}){const n=(0,i.useRef)(null),[o,p]=(0,i.useState)(""),[d,f]=(0,i.useState)(!1),[h,g]=(0,i.useState)(""),[m,v]=(0,i.useState)(!1),[y,w]=(0,i.useState)(null);return(0,i.useEffect)(()=>{"function"==typeof e&&e({networkCode:h})},[h]),(0,u.jsx)(s.Zp,{noBorder:!0,children:(0,u.jsxs)("div",{className:"ads-onboarding",children:[newspack_ads_wizard.can_connect_google&&(!0===y||null===y)&&(0,u.jsxs)(i.Fragment,{children:[y&&(0,u.jsx)("p",{children:(0,r.__)("Authenticate with Google in order to connect your Google Ad Manager account:","newspack-plugin")}),(0,u.jsx)(c.A,{onInit:e=>w(!e),onSuccess:t,isOnboarding:!0})]}),(!newspack_ads_wizard.can_connect_google||!1===y)&&(0,u.jsx)(i.Fragment,{children:m?(0,u.jsx)(s.$T,{isSuccess:!0,noticeText:(0,r.__)("We're all set here!","newspack-plugin")}):(0,u.jsxs)(i.Fragment,{children:[(0,u.jsx)("p",{children:(0,r.__)("Enter your Google Ad Manager network code and service account credentials for a full integration:","newspack-plugin")}),(0,u.jsx)(s.xt,{disabled:d,isWide:!0,name:"network_code",label:(0,r.__)("Network code","newspack-plugin"),value:h,onChange:g}),(0,u.jsx)(s.dr,{disabled:d,onClick:()=>n.current.click(),title:(0,r.__)("Upload credentials","newspack-plugin"),desc:[(0,r.__)("Upload your Service Account credentials file to connect your GAM account.","newspack-plugin"),o&&(0,u.jsx)(s.$T,{noticeText:o,isError:!0})],chevron:!0}),(0,u.jsxs)("p",{children:[(0,u.jsx)("a",{href:"https://developers.google.com/ad-manager/api/authentication",target:"_blank",rel:"noopener noreferrer",children:(0,r.__)("How to get a service account user for API access","newspack-plugin")}),"."]}),(0,u.jsx)("input",{type:"file",accept:".json",ref:n,style:{display:"none"},onChange:e=>{e.target.files.length&&e.target.files[0]&&(0,l.b)(e.target.files[0]).then(e=>(e=>{f(!0),a()({path:"/newspack/v1/wizard/billboard/credentials",method:"post",data:{credentials:e,onboarding:!0}}).then(()=>{v(!0),"function"==typeof t&&t()}).finally(()=>{f(!1)})})(e)).catch(e=>p(e))}})]})})]})})}},181:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},200:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(5573),o=n(790);const a=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"M20 4H22.5V5.5H20V8H18.5V5.5H16V4H18.5V1.5H20V4ZM14 12.25H10C9.27065 12.25 8.57118 12.5397 8.05546 13.0555C7.53973 13.5712 7.25 14.2707 7.25 15V17H8.75V15C8.75 14.31 9.31 13.75 10 13.75H14C14.69 13.75 15.25 14.31 15.25 15V17H16.75V15C16.75 14.2707 16.4603 13.5712 15.9445 13.0555C15.4288 12.5397 14.7293 12.25 14 12.25ZM9.5 8.5C9.5 7.83696 9.76339 7.20107 10.2322 6.73223C10.7011 6.26339 11.337 6 12 6C12.663 6 13.2989 6.26339 13.7678 6.73223C14.2366 7.20107 14.5 7.83696 14.5 8.5C14.5 9.16304 14.2366 9.79893 13.7678 10.2678C13.2989 10.7366 12.663 11 12 11C11.337 11 10.7011 10.7366 10.2322 10.2678C9.76339 9.79893 9.5 9.16304 9.5 8.5ZM11 8.5C11 8.76522 11.1054 9.01957 11.2929 9.20711C11.4804 9.39464 11.7348 9.5 12 9.5C12.2652 9.5 12.5196 9.39464 12.7071 9.20711C12.8946 9.01957 13 8.76522 13 8.5C13 8.23478 12.8946 7.98043 12.7071 7.79289C12.5196 7.60536 12.2652 7.5 12 7.5C11.7348 7.5 11.4804 7.60536 11.2929 7.79289C11.1054 7.98043 11 8.23478 11 8.5Z"})}),i=/^(2617|9406)$/.test(n.j)?a:null},227:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(5573),o=n(790);const a=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"M4 18.5H13V20H4V18.5ZM4 16H20V14.5H4V16ZM9 7.5C9.39782 7.5 9.77936 7.34196 10.0607 7.06066C10.342 6.77936 10.5 6.39782 10.5 6C10.5 5.60218 10.342 5.22064 10.0607 4.93934C9.77936 4.65804 9.39782 4.5 9 4.5C8.60218 4.5 8.22064 4.65804 7.93934 4.93934C7.65804 5.22064 7.5 5.60218 7.5 6C7.5 6.39782 7.65804 6.77936 7.93934 7.06066C8.22064 7.34196 8.60218 7.5 9 7.5ZM4 7C4 5.67392 4.52678 4.40215 5.46447 3.46447C6.40215 2.52678 7.67392 2 9 2C10.3261 2 11.5979 2.52678 12.5355 3.46447C13.4732 4.40215 14 5.67392 14 7C14 8.32608 13.4732 9.59785 12.5355 10.5355C11.5979 11.4732 10.3261 12 9 12C7.67392 12 6.40215 11.4732 5.46447 10.5355C4.52678 9.59785 4 8.32608 4 7ZM10.632 10.097C10.5644 9.99092 10.4711 9.90361 10.3608 9.84313C10.2506 9.78265 10.1268 9.75097 10.001 9.751H7.999C7.87321 9.75097 7.74945 9.78265 7.63916 9.84313C7.52886 9.90361 7.4356 9.99092 7.368 10.097C7.855 10.354 8.41 10.5 9 10.5C9.59 10.5 10.145 10.354 10.632 10.097ZM5.5 7C5.5 7.8 5.768 8.536 6.219 9.125C6.42896 8.85274 6.69865 8.63235 7.00727 8.48082C7.31589 8.32928 7.65519 8.25066 7.999 8.251H10.001C10.725 8.251 11.37 8.593 11.781 9.125C12.1185 8.68329 12.346 8.16752 12.4446 7.62041C12.5431 7.0733 12.5099 6.51059 12.3478 5.97885C12.1856 5.44712 11.8991 4.96166 11.512 4.56268C11.1248 4.1637 10.6483 3.86266 10.1217 3.68451C9.59508 3.50635 9.03362 3.45619 8.48378 3.53818C7.93395 3.62017 7.41155 3.83196 6.95984 4.156C6.50814 4.48005 6.14012 4.90703 5.88625 5.40159C5.63239 5.89616 5.49998 6.44408 5.5 7Z"})}),i=/^(1740|2617|9406)$/.test(n.j)?a:null},270:(e,t,n)=>{var r=n(7068),o=n(346);e.exports=function e(t,n,a,i,s){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,a,i,e,s))}},289:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).get(e)}},294:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},317:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},361:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e{"use strict";n.d(t,{A:()=>w});var r=n(4715),o=n(7723),a=n(6087),i=n(2039),s=n(3582),c=n(7143),l=n(2135),u=n(1508);function p(){const{avatarURL:e}=(0,c.useSelect)(e=>{const{getSettings:t}=e(r.store),{__experimentalDiscussionSettings:n}=t();return n});return e}var d=n(2668),f=n(4164),h=n(3832),g=n(790);const m=({avatar:e,size:t,attributes:n,placeholder:i=!1,overlapMaskStyle:s={}})=>{var c;const l=(0,r.__experimentalUseBorderProps)(n),[u,p]=(0,a.useState)(null!==(c=n?.size)&&void 0!==c?c:48);(0,a.useEffect)(()=>{const e=setTimeout(()=>{var e;return p(null!==(e=n?.size)&&void 0!==e?e:48)},500);return()=>clearTimeout(e)},[n?.size]);const d=e?.src;if(!d&&!i)return null;if(i)return(0,g.jsx)("div",{className:"newspack-avatar-wrapper newspack-avatar-wrapper--placeholder",style:{"--avatar-size":t+"px",...l.style},role:"img","aria-label":(0,o.__)("No avatar available","newspack-plugin"),children:(0,g.jsx)("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",preserveAspectRatio:"none","aria-hidden":"true",focusable:"false",children:(0,g.jsx)("path",{vectorEffect:"non-scaling-stroke",d:"M60 60 0 0"})})});const m=(0,h.addQueryArgs)((0,h.removeQueryArgs)(d,["s"]),{s:2*u}),v=(0,g.jsx)("img",{src:m,alt:e.alt||"",className:(0,f.A)("avatar","avatar-"+t,"photo","wp-block-newspack-avatar__image",l.className),style:{width:t,height:t,...l.style}});return(0,g.jsx)("div",{className:"newspack-avatar-wrapper",style:{"--avatar-size":t+"px",...s},children:n.linkToAuthorArchive?(0,g.jsx)("a",{href:"#avatar-pseudo-link",className:"wp-block-newspack-avatar__link",onClick:e=>e.preventDefault(),children:v}):v})};var v=n(6427);const y=({setAttributes:e,attributes:t})=>(0,g.jsx)(r.InspectorControls,{children:(0,g.jsxs)(v.PanelBody,{title:(0,o.__)("Settings","newspack-plugin"),children:[(0,g.jsx)(v.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,o.__)("Image size","newspack-plugin"),onChange:t=>e({size:t}),min:16,max:128,initialPosition:t.size,value:t.size}),(0,g.jsx)(v.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,o.__)("Link to author archive","newspack-plugin"),onChange:()=>e({linkToAuthorArchive:!t.linkToAuthorArchive}),checked:t.linkToAuthorArchive})]})}),w=({attributes:e,context:t,setAttributes:n})=>{const f=(0,a.useMemo)(()=>(0,d.l)(e),[e.className,e?.style?.border?.radius,e.size]),h=(0,r.useBlockProps)(),v=t["newspack-blocks/author"],w=(0,i.Y)(),_=(0,a.useContext)(w),b=v||_,x=p(),{postId:k,postType:j}=t,S=function({postId:e,postType:t}){const{authorDetails:n}=(0,c.useSelect)(n=>{const{getEditedEntityRecord:r,getUser:o}=n(s.store),a=r("postType",t,e)?.author;return{authorDetails:a?o(a):null}},[t,e]),r=n?.avatar_urls?Object.values(n.avatar_urls):null,a=n?.avatar_urls?Object.keys(n.avatar_urls):null,{minSize:i,maxSize:l}=function(e){const t=e?e[0]:24,n=e?e[e.length-1]:128;return{minSize:t,maxSize:Math.floor(2.5*n)}}(a),u=p();return{src:r?r[r.length-1]:u,minSize:i,maxSize:l,alt:n? // translators: %s: Author name. // translators: %s: Author name. (0,o.sprintf)((0,o.__)("%s Avatar","newspack-plugin"),n?.name):(0,o.__)("Default Avatar","newspack-plugin")}}({userId:e?.userId,postId:k,postType:j}),A=function({postId:e,postType:t="post"}){const{bylineActive:n,bylineContent:r}=(0,u.k)(e,t),{authors:o}=(0,l.C)(e,t,n),i=p(),d=(0,a.useMemo)(()=>n&&r?(0,u.o)(r):[],[n,r]),f=d.length>0,h=n&&!f,g=(0,c.useSelect)(e=>{if(h)return null;const{getUser:t}=e(s.store);if(f){const e={};return d.forEach(n=>{e[n]=t(n)||null}),e}if(o&&o.length>0){const e={};return o.forEach(n=>{n.id&&!n.isGuest&&(e[n.id]=t(n.id)||null)}),e}return null},[h,f,d,o]),m=(0,a.useMemo)(()=>h||!g?[]:f?d.map(e=>{const t=g[e];return t?{id:e,name:t.name||"",display_name:t.name||"",avatar_urls:t.avatar_urls||null}:null}).filter(Boolean):o&&o.length>0?o.map(e=>{const t=e.id&&!e.isGuest?g[e.id]:null;return{id:e.id,name:e.display_name,display_name:e.display_name,user_nicename:e.user_nicename,author_link:e.author_link,avatar_urls:t?.avatar_urls||e.avatar_urls||null}}):[],[h,f,d,o,g]);return(0,a.useMemo)(()=>m.map(e=>({...e,avatarSrc:e.avatar_urls?.[96]||i})),[m,i])}({postId:k,postType:j}),{bylineActive:C,bylineContent:E}=(0,u.k)(k,j),P=(0,a.useMemo)(()=>(0,u.o)(E),[E]),O=(t,n)=>(0,g.jsx)(m,{avatar:t,size:e.size,attributes:e,overlapMaskStyle:f},n);if(b){let t="";if(b.avatar)if(b.avatar.includes("{const n={src:e.avatarSrc,alt:e?.name||e?.display_name||""};return O(n,e.id||t)}):O(S,"single-author")})]}):(0,g.jsx)("div",{...h,children:(0,o.__)("Loading avatar…","newspack-plugin")})}},392:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},414:e=>{"use strict";e.exports=Math.round},453:(e,t,n)=>{"use strict";var r,o=n(9612),a=n(9383),i=n(1237),s=n(9290),c=n(9538),l=n(8068),u=n(9675),p=n(5345),d=n(1514),f=n(8968),h=n(6188),g=n(8002),m=n(3499),v=n(414),y=n(3093),w=Function,_=function(e){try{return w('"use strict"; return ('+e+").constructor;")()}catch(e){}},b=n(5795),x=n(655),k=function(){throw new u},j=b?function(){try{return k}catch(e){try{return b(arguments,"callee").get}catch(e){return k}}}():k,S=n(4039)(),A=n(3628),C=n(1064),E=n(8648),P=n(1002),O=n(76),N={},L="undefined"!=typeof Uint8Array&&A?A(Uint8Array):r,T={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":S&&A?A([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":i,"%Float16Array%":"undefined"==typeof Float16Array?r:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":w,"%GeneratorFunction%":N,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":S&&A?A(A([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&S&&A?A((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":s,"%ReferenceError%":c,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&S&&A?A((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":S&&A?A(""[Symbol.iterator]()):r,"%Symbol%":S?Symbol:r,"%SyntaxError%":l,"%ThrowTypeError%":j,"%TypedArray%":L,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":p,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet,"%Function.prototype.call%":O,"%Function.prototype.apply%":P,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":C,"%Math.abs%":d,"%Math.floor%":f,"%Math.max%":h,"%Math.min%":g,"%Math.pow%":m,"%Math.round%":v,"%Math.sign%":y,"%Reflect.getPrototypeOf%":E};if(A)try{null.error}catch(e){var M=A(A(e));T["%Error.prototype%"]=M}var I=function e(t){var n;if("%AsyncFunction%"===t)n=_("async function () {}");else if("%GeneratorFunction%"===t)n=_("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=_("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&A&&(n=A(o.prototype))}return T[t]=n,n},R={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},D=n(6743),$=n(9957),F=D.call(O,Array.prototype.concat),z=D.call(P,Array.prototype.splice),V=D.call(O,String.prototype.replace),H=D.call(O,String.prototype.slice),B=D.call(O,RegExp.prototype.exec),U=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,q=/\\(\\)?/g,W=function(e,t){var n,r=e;if($(R,r)&&(r="%"+(n=R[r])[0]+"%"),$(T,r)){var o=T[r];if(o===N&&(o=I(r)),void 0===o&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new l("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===B(/^%?[^%]*%?$/,e))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=H(e,0,1),n=H(e,-1);if("%"===t&&"%"!==n)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new l("invalid intrinsic syntax, expected opening `%`");var r=[];return V(e,U,function(e,t,n,o){r[r.length]=n?V(o,q,"$1"):t||e}),r}(e),r=n.length>0?n[0]:"",o=W("%"+r+"%",t),a=o.name,i=o.value,s=!1,c=o.alias;c&&(r=c[0],z(n,F([0,1],c)));for(var p=1,d=!0;p=n.length){var m=b(i,f);i=(d=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:i[f]}else d=$(i,f),i=i[f];d&&!s&&(T[a]=i)}}return i}},507:(e,t,n)=>{"use strict";var r=n(453),o=n(6556),a=n(1240),i=n(9675),s=r("%Map%",!0),c=o("Map.prototype.get",!0),l=o("Map.prototype.set",!0),u=o("Map.prototype.has",!0),p=o("Map.prototype.delete",!0),d=o("Map.prototype.size",!0);e.exports=!!s&&function(){var e,t={assert:function(e){if(!t.has(e))throw new i("Side channel does not contain "+a(e))},delete:function(t){if(e){var n=p(e,t);return 0===d(e)&&(e=void 0),n}return!1},get:function(t){if(e)return c(e,t)},has:function(t){return!!e&&u(e,t)},set:function(t,n){e||(e=new s),l(e,t,n)}};return t}},514:(e,t,n)=>{var r=n(4932);e.exports=function(e,t){return r(t,function(t){return e[t]})}},550:(e,t,n)=>{"use strict";function r(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,o=e.length;ra});const a=/^(2(001|084|617)|(66|94)06|6930|7841|828|8498)$/.test(n.j)?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e&&e.split("/")||[],a=t&&t.split("/")||[],i=e&&r(e),s=t&&r(t),c=i||s;if(e&&r(e)?a=n:n.length&&(a.pop(),a=a.concat(n)),!a.length)return"/";var l=void 0;if(a.length){var u=a[a.length-1];l="."===u||".."===u||""===u}else l=!1;for(var p=0,d=a.length;d>=0;d--){var f=a[d];"."===f?o(a,d):".."===f?(o(a,d),p++):p&&(o(a,d),p--)}if(!c)for(;p--;p)a.unshift("..");!c||""===a[0]||a[0]&&r(a[0])||a.unshift("");var h=a.join("/");return l&&"/"!==h.substr(-1)&&(h+="/"),h}:null},583:(e,t,n)=>{var r=n(7237),o=n(7255),a=n(8586),i=n(7797);e.exports=function(e){return a(e)?r(i(e)):o(e)}},591:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(790),o=n(5573),a=(0,r.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)(o.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"})})},631:(e,t,n)=>{var r=n(8077),o=n(9326);e.exports=function(e,t){return null!=e&&o(e,t,r)}},641:(e,t,n)=>{var r=n(6649),o=n(5950);e.exports=function(e,t){return e&&r(e,t,o)}},655:e=>{"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},659:(e,t,n)=>{var r=n(1873),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=i.call(e);return r&&(t?e[s]=n:delete e[s]),o}},689:(e,t,n)=>{var r=n(2),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,a,i,s){var c=1&n,l=r(e),u=l.length;if(u!=r(t).length&&!c)return!1;for(var p=u;p--;){var d=l[p];if(!(c?d in t:o.call(t,d)))return!1}var f=s.get(e),h=s.get(t);if(f&&h)return f==t&&h==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=c;++p{var r=n(8096),o=n(2428),a=n(6449),i=n(3656),s=n(361),c=n(7167),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=a(e),u=!n&&o(e),p=!n&&!u&&i(e),d=!n&&!u&&!p&&c(e),f=n||u||p||d,h=f?r(e.length,String):[],g=h.length;for(var m in e)!t&&!l.call(e,m)||f&&("length"==m||p&&("offset"==m||"parent"==m)||d&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,g))||h.push(m);return h}},756:(e,t,n)=>{var r=n(3805);e.exports=function(e){return e==e&&!r(e)}},776:(e,t,n)=>{var r=n(756),o=n(5950);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var a=t[n],i=e[a];t[n]=[a,i,r(i)]}return t}},909:(e,t,n)=>{var r=n(641),o=n(8329)(r);e.exports=o},916:(e,t,n)=>{var r=n(909);e.exports=function(e,t){var n;return r(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}},920:(e,t,n)=>{"use strict";var r=n(9675),o=n(1240),a=n(4803),i=n(507),s=n(4652)||i||a;e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new r("Side channel does not contain "+o(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,n){e||(e=s()),e.set(t,n)}};return t}},938:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},945:(e,t,n)=>{var r=n(79),o=n(8223),a=n(3661);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var i=n.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(i)}return n.set(e,t),this.size=n.size,this}},999:(e,t,n)=>{var r=n(9302),o=n(6800);e.exports=function(e){return r(function(t,n){var r=-1,a=n.length,i=a>1?n[a-1]:void 0,s=a>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(a--,i):void 0,s&&o(n[0],n[1],s)&&(i=a<3?void 0:i,a=1),t=Object(t);++r{"use strict";e.exports=Function.prototype.apply},1033:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},1042:(e,t,n)=>{var r=n(6110)(Object,"create");e.exports=r},1064:(e,t,n)=>{"use strict";var r=n(9612);e.exports=r.getPrototypeOf||null},1093:(e,t,n)=>{"use strict";n.d(t,{J:()=>r});const r="newspack_wizard_handoff_message"},1125:(e,t,n)=>{"use strict";n.r(t),n.d(t,{BrowserRouter:()=>me,HashRouter:()=>ve,Link:()=>ke,MemoryRouter:()=>U,NavLink:()=>Ae,Prompt:()=>W,Redirect:()=>J,Route:()=>ne,Router:()=>B,StaticRouter:()=>ce,Switch:()=>le,generatePath:()=>Q,matchPath:()=>te,useHistory:()=>de,useLocation:()=>fe,useParams:()=>he,useRouteMatch:()=>ge,withRouter:()=>ue});var r=n(3662);function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,r.A)(e,t)}var a=n(1609),i=n.n(a),s=n(5556),c=n.n(s),l=n(8168),u=n(550),p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};const d=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every(function(t,r){return e(t,n[r])});var r=void 0===t?"undefined":p(t);if(r!==(void 0===n?"undefined":p(n)))return!1;if("object"===r){var o=t.valueOf(),a=n.valueOf();if(o!==t||a!==n)return e(o,a);var i=Object.keys(t),s=Object.keys(n);return i.length===s.length&&i.every(function(r){return e(t[r],n[r])})}return!1};var f=n(1561);function h(e){return"/"===e.charAt(0)?e:"/"+e}function g(e){return"/"===e.charAt(0)?e.substr(1):e}function m(e,t){return function(e,t){return new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)}(e,t)?e.substr(t.length):e}function v(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function y(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function w(e,t,n,r){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var a=t.indexOf("?");return-1!==a&&(n=t.substr(a),t=t.substr(0,a)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=(0,l.A)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=(0,u.A)(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o}function _(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&d(e.state,t.state)}function b(){var e=null,t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var a="function"==typeof e?e(t,n):e;"string"==typeof a?"function"==typeof r?r(a,o):o(!0):o(!1!==a)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter(function(e){return e!==r})}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r=0?t:0)+"#"+e)}function N(e,t,n){return Math.min(Math.max(e,t),n)}var L=n(5302),T=n.n(L);function M(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}n(4363);var I=n(4146),R=n.n(I),D=1073741823,$="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},F=i().createContext||function(e,t){var n,r,a,s="__create-react-context-"+(($[a="__global_unique_id__"]=($[a]||0)+1)+"__"),l=function(e){function n(){for(var t,n,r,o=arguments.length,a=new Array(o),i=0;it?n.splice(t,n.length-t,o):n.push(o),p({action:r,location:o,index:t,entries:n})}})},replace:function(e,t){var r="REPLACE",o=w(e,t,d(),v.location);u.confirmTransitionTo(o,r,n,function(e){e&&(v.entries[v.index]=o,p({action:r,location:o}))})},go:m,goBack:function(){m(-1)},goForward:function(){m(1)},canGo:function(e){var t=v.index+e;return t>=0&&t{var r=n(6025);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},1237:e=>{"use strict";e.exports=EvalError},1240:(e,t,n)=>{var r="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,a=r&&o&&"function"==typeof o.get?o.get:null,i=r&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=s&&c&&"function"==typeof c.get?c.get:null,u=s&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,g=Object.prototype.toString,m=Function.prototype.toString,v=String.prototype.match,y=String.prototype.slice,w=String.prototype.replace,_=String.prototype.toUpperCase,b=String.prototype.toLowerCase,x=RegExp.prototype.test,k=Array.prototype.concat,j=Array.prototype.join,S=Array.prototype.slice,A=Math.floor,C="function"==typeof BigInt?BigInt.prototype.valueOf:null,E=Object.getOwnPropertySymbols,P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,O="function"==typeof Symbol&&"object"==typeof Symbol.iterator,N="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,L=Object.prototype.propertyIsEnumerable,T=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function M(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||x.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var r=e<0?-A(-e):A(e);if(r!==e){var o=String(r),a=y.call(t,o.length+1);return w.call(o,n,"$&_")+"."+w.call(w.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return w.call(t,n,"$&_")}var I=n(2634),R=I.custom,D=q(R)?R:null,$={__proto__:null,double:'"',single:"'"},F={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function z(e,t,n){var r=n.quoteStyle||t,o=$[r];return o+e+o}function V(e){return w.call(String(e),/"/g,""")}function H(e){return!N||!("object"==typeof e&&(N in e||void 0!==e[N]))}function B(e){return"[object Array]"===Z(e)&&H(e)}function U(e){return"[object RegExp]"===Z(e)&&H(e)}function q(e){if(O)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!P)return!1;try{return P.call(e),!0}catch(e){}return!1}e.exports=function e(t,r,o,s){var c=r||{};if(G(c,"quoteStyle")&&!G($,c.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var g=!G(c,"customInspect")||c.customInspect;if("boolean"!=typeof g&&"symbol"!==g)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var _=c.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return Q(t,c);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var x=String(t);return _?M(t,x):x}if("bigint"==typeof t){var A=String(t)+"n";return _?M(t,A):A}var E=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=E&&E>0&&"object"==typeof t)return B(t)?"[Array]":"[Object]";var R,F=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=j.call(Array(e.indent+1)," ")}return{base:n,prev:j.call(Array(t+1),n)}}(c,o);if(void 0===s)s=[];else if(K(s,t)>=0)return"[Circular]";function W(t,n,r){if(n&&(s=S.call(s)).push(n),r){var a={depth:c.depth};return G(c,"quoteStyle")&&(a.quoteStyle=c.quoteStyle),e(t,a,o+1,s)}return e(t,c,o+1,s)}if("function"==typeof t&&!U(t)){var J=function(e){if(e.name)return e.name;var t=v.call(m.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),re=ne(t,W);return"[Function"+(J?": "+J:" (anonymous)")+"]"+(re.length>0?" { "+j.call(re,", ")+" }":"")}if(q(t)){var oe=O?w.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):P.call(t);return"object"!=typeof t||O?oe:Y(oe)}if((R=t)&&"object"==typeof R&&("undefined"!=typeof HTMLElement&&R instanceof HTMLElement||"string"==typeof R.nodeName&&"function"==typeof R.getAttribute)){for(var ae="<"+b.call(String(t.nodeName)),ie=t.attributes||[],se=0;se"}if(B(t)){if(0===t.length)return"[]";var ce=ne(t,W);return F&&!function(e){for(var t=0;t=0)return!1;return!0}(ce)?"["+te(ce,F)+"]":"[ "+j.call(ce,", ")+" ]"}if(function(e){return"[object Error]"===Z(e)&&H(e)}(t)){var le=ne(t,W);return"cause"in Error.prototype||!("cause"in t)||L.call(t,"cause")?0===le.length?"["+String(t)+"]":"{ ["+String(t)+"] "+j.call(le,", ")+" }":"{ ["+String(t)+"] "+j.call(k.call("[cause]: "+W(t.cause),le),", ")+" }"}if("object"==typeof t&&g){if(D&&"function"==typeof t[D]&&I)return I(t,{depth:E-o});if("symbol"!==g&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!a||!e||"object"!=typeof e)return!1;try{a.call(e);try{l.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ue=[];return i&&i.call(t,function(e,n){ue.push(W(n,t,!0)+" => "+W(e,t))}),ee("Map",a.call(t),ue,F)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e);try{a.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var pe=[];return u&&u.call(t,function(e){pe.push(W(e,t))}),ee("Set",l.call(t),pe,F)}if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return X("WeakMap");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return X("WeakSet");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{return f.call(e),!0}catch(e){}return!1}(t))return X("WeakRef");if(function(e){return"[object Number]"===Z(e)&&H(e)}(t))return Y(W(Number(t)));if(function(e){if(!e||"object"!=typeof e||!C)return!1;try{return C.call(e),!0}catch(e){}return!1}(t))return Y(W(C.call(t)));if(function(e){return"[object Boolean]"===Z(e)&&H(e)}(t))return Y(h.call(t));if(function(e){return"[object String]"===Z(e)&&H(e)}(t))return Y(W(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||void 0!==n.g&&t===n.g)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===Z(e)&&H(e)}(t)&&!U(t)){var de=ne(t,W),fe=T?T(t)===Object.prototype:t instanceof Object||t.constructor===Object,he=t instanceof Object?"":"null prototype",ge=!fe&&N&&Object(t)===t&&N in t?y.call(Z(t),8,-1):he?"Object":"",me=(fe||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(ge||he?"["+j.call(k.call([],ge||[],he||[]),": ")+"] ":"");return 0===de.length?me+"{}":F?me+"{"+te(de,F)+"}":me+"{ "+j.call(de,", ")+" }"}return String(t)};var W=Object.prototype.hasOwnProperty||function(e){return e in this};function G(e,t){return W.call(e,t)}function Z(e){return g.call(e)}function K(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return Q(y.call(e,0,t.maxStringLength),t)+r}var o=F[t.quoteStyle||"single"];return o.lastIndex=0,z(w.call(w.call(e,o,"\\$1"),/[\x00-\x1f]/g,J),"single",t)}function J(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+_.call(t.toString(16))}function Y(e){return"Object("+e+")"}function X(e){return e+" { ? }"}function ee(e,t,n,r){return e+" ("+t+") {"+(r?te(n,r):j.call(n,", "))+"}"}function te(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+j.call(e,","+n)+"\n"+t.prev}function ne(e,t){var n=B(e),r=[];if(n){r.length=e.length;for(var o=0;o{var r=n(2552),o=n(8879),a=n(346),i=Function.prototype,s=Object.prototype,c=i.toString,l=s.hasOwnProperty,u=c.call(Object);e.exports=function(e){if(!a(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==u}},1333:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var r in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(42!==a.value||!0!==a.enumerable)return!1}return!0}},1349:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r={"primary-000":"#dfe7f4","primary-050":"#bfcfe9","primary-100":"#9fb6dd","primary-200":"#809ed2","primary-300":"#6086c7","primary-400":"#406ebc","primary-500":"#2055b0","primary-600":"#003da5","primary-700":"#00296e","primary-800":"#001f53","primary-900":"#001437","primary-1000":"#000a1c","secondary-000":"#eff9f2","secondary-050":"#ddf3e3","secondary-100":"#c8ecd4","secondary-200":"#b1e6c3","secondary-300":"#95dfaf","secondary-400":"#6fd898","secondary-500":"#26d07c","secondary-600":"#1fb36a","secondary-700":"#1ba25f","secondary-800":"#178e53","secondary-900":"#117644","secondary-1000":"#09552f","tertiary-000":"#fff4f6","tertiary-050":"#fee8ed","tertiary-100":"#fedbe3","tertiary-200":"#fcded8","tertiary-300":"#fdbfcd","tertiary-400":"#fcaec0","tertiary-500":"#fc9bb3","tertiary-600":"#d9859a","tertiary-700":"#c5788b","tertiary-800":"#ad697a","tertiary-900":"#905665","tertiary-1000":"#683d48","quaternary-000":"#fff5ee","quaternary-050":"#ffeadc","quaternary-100":"#ffdec7","quaternary-200":"#ffd1af","quaternary-300":"#ffc392","quaternary-400":"#ffb46a","quaternary-500":"#ffa300","quaternary-600":"#dc8c00","quaternary-700":"#c77e00","quaternary-800":"#af6e00","quaternary-900":"#925b00","quaternary-1000":"#6a4100","neutral-000":"#fff","neutral-050":"#f7f7f7","neutral-100":"#f0f0f0","neutral-200":"#e0e0e0","neutral-300":"#ddd","neutral-400":"#ccc","neutral-500":"#949494","neutral-600":"#6c6c6c","neutral-700":"rgba(0,0,0,.702)","neutral-800":"#3e3e3e","neutral-900":"#1e1e1e","neutral-1000":"#000","success-000":"#edfaef","success-050":"#b8e6bf","success-500":"#008a20","success-600":"#007017","error-000":"#fcf0f1","error-050":"#facfd2","error-500":"#d63638","error-600":"#b32d2e","warning-000":"#fcf9e8","warning-050":"#f5e6ab","warning-300":"#dba617","warning-400":"#bd8600"}},1380:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1420:(e,t,n)=>{var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},1459:e=>{e.exports=function(e){return this.__data__.has(e)}},1472:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(5573),o=n(790);const a=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"M19 5H5C4.46957 5 3.96086 5.21071 3.58579 5.58579C3.21071 5.96086 3 6.46957 3 7V17C3 17.5304 3.21071 18.0391 3.58579 18.4142C3.96086 18.7893 4.46957 19 5 19H19C19.5304 19 20.0391 18.7893 20.4142 18.4142C20.7893 18.0391 21 17.5304 21 17V7C21 6.46957 20.7893 5.96086 20.4142 5.58579C20.0391 5.21071 19.5304 5 19 5ZM19.5 17C19.5 17.1326 19.4473 17.2598 19.3536 17.3536C19.2598 17.4473 19.1326 17.5 19 17.5H5C4.86739 17.5 4.74021 17.4473 4.64645 17.3536C4.55268 17.2598 4.5 17.1326 4.5 17V7C4.5 6.86739 4.55268 6.74021 4.64645 6.64645C4.74021 6.55268 4.86739 6.5 5 6.5H19C19.1326 6.5 19.2598 6.55268 19.3536 6.64645C19.4473 6.74021 19.5 6.86739 19.5 7V17ZM16.602 9.4H17.626V15H16.786L14.226 11.16V15H13.202V9.4H14.21L16.602 13.016V9.4ZM11.291 9.4H12.291L10.147 15.68H9.147L11.29 9.4H11.291ZM7.15 9.4H7.934V15H6.91V10.848C6.80429 10.9156 6.69325 10.9744 6.578 11.024C6.45891 11.076 6.33402 11.1136 6.206 11.136L6.118 10.272C6.25527 10.2381 6.38534 10.1799 6.502 10.1C6.643 10.01 6.774 9.903 6.894 9.78C7.014 9.655 7.099 9.528 7.15 9.4Z"})}),i=/^(2617|3104|9406)$/.test(n.j)?a:null},1489:(e,t,n)=>{var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},1508:(e,t,n)=>{"use strict";n.d(t,{k:()=>a,o:()=>i});var r=n(7143),o=n(3582);function a(e,t){const{bylineActive:n,bylineContent:a}=(0,r.useSelect)(n=>{const{getEditedEntityRecord:r}=n(o.store),a=r("postType",t,e);return{bylineActive:a?.meta?._newspack_byline_active||!1,bylineContent:a?.meta?._newspack_byline||""}},[e,t]);return{bylineActive:n,bylineContent:a}}function i(e){if(!e)return[];const t=/\[Author\s+id\s*=\s*(\d+)\]/gi,n=[];let r;for(;null!==(r=t.exec(e));)n.push(parseInt(r[1],10));return n}},1514:e=>{"use strict";e.exports=Math.abs},1549:(e,t,n)=>{var r=n(2032),o=n(3862),a=n(6721),i=n(2749),s=n(5749);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{"use strict";n.d(t,{A:()=>a});var r=!!/^(2(001|084|617)|(66|94)06|6930|7841|828|8498)$/.test(n.j)||null,o="Invariant failed";function a(e,t){if(!e){if(r)throw new Error(o);var n="function"==typeof t?t():t,a=n?"".concat(o,": ").concat(n):o;throw new Error(a)}}},1622:(e,t,n)=>{"use strict";function r(e){"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",e):e())}function o(e){const t=e%60;return`${Math.floor(e/60)}:${t<10?"0":""}${t}`}function a(e,t=[]){return Array.from(e.entries()).reduce((e,[n,r])=>t.includes(n)?(n.indexOf("[]")>-1?(e[n=n.replace("[]","")]=e[n]||[],e[n].push(r)):e[n]=r,e):e,{})}n.d(t,{Qc:()=>r,fU:()=>o,wJ:()=>a})},1702:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(7723);if(/^(2617|5795)$/.test(n.j))var o=n(4818);var a=n(7143),i=n(6087),s=n(4871),c=n.n(s),l=n(4715),u=n(6427),p=n(9782),d=n(790);function f({attributes:e,setAttributes:t}){const[n,s]=(0,i.useState)(!1),f=(0,a.useSelect)(e=>e("core/editor").getCurrentPostType(),[]),h=(0,l.useBlockProps)();function g(){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{children:(0,r.__)("This is the Corrections block, it will display all the corrections and clarifications.","newspack-plugin")}),(0,d.jsx)("p",{children:(0,r.__)("If there are no corrections or clarifications, this block will not be displayed.","newspack-plugin")})]})}function m(){return(0,d.jsx)(l.InspectorControls,{children:(0,d.jsx)(u.PanelBody,{title:(0,r.__)("Correction Box Settings","newspack-plugin"),children:(0,d.jsx)(u.PanelRow,{children:(0,d.jsx)(u.SelectControl,{label:(0,r.__)("Corrections by Priority","newspack-plugin"),help:(0,r.__)("Filter corrections by their priority.","newspack-plugin"),value:e.priority,options:[{label:(0,r.__)("High","newspack-plugin"),value:"high"},{label:(0,r.__)("Low","newspack-plugin"),value:"low"},{label:(0,r.__)("All","newspack-plugin"),value:"all"}],onChange:e=>t({priority:e})})})})})}return"wp_template"===f?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(m,{}),(0,d.jsx)("div",{...h,children:(0,d.jsx)(g,{})})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(m,{}),(0,d.jsx)(l.BlockControls,{children:(0,d.jsx)(u.ToolbarGroup,{children:(0,d.jsx)(u.ToolbarButton,{icon:o.A,label:(0,r.__)("Refresh","newspack-plugin"),onClick:()=>{s(!n)}})})}),(0,d.jsx)("div",{...h,children:(0,d.jsx)(c(),{block:p.name,EmptyResponsePlaceholder:g,refresh:n,attributes:e})})]})}},1769:(e,t,n)=>{var r=n(6449),o=n(8586),a=n(1802),i=n(3222);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:a(i(e))}},1791:(e,t,n)=>{var r=n(6547),o=n(3360);e.exports=function(e,t,n,a){var i=!n;n||(n={});for(var s=-1,c=t.length;++s{var r=n(7217),o=n(270);e.exports=function(e,t,n,a){var i=n.length,s=i,c=!a;if(null==e)return!s;for(e=Object(e);i--;){var l=n[i];if(c&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},1802:(e,t,n)=>{var r=n(2224),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,i=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,function(e,n,r,o){t.push(r?o.replace(a,"$1"):n||e)}),t});e.exports=i},1811:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var o=t(),a=16-(o-r);if(r=o,a>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},1873:(e,t,n)=>{var r=n(9325).Symbol;e.exports=r},1882:(e,t,n)=>{var r=n(2552),o=n(3805);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1961:(e,t,n)=>{var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},1986:(e,t,n)=>{var r=n(1873),o=n(7828),a=n(5288),i=n(5911),s=n(317),c=n(4247),l=r?r.prototype:void 0,u=l?l.valueOf:void 0;e.exports=function(e,t,n,r,l,p,d){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!p(new o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return a(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=s;case"[object Set]":var h=1&r;if(f||(f=c),e.size!=t.size&&!h)return!1;var g=d.get(e);if(g)return g==t;r|=2,d.set(e,t);var m=i(f(e),f(t),r,l,p,d);return d.delete(e),m;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},2005:(e,t,n)=>{"use strict";n.d(t,{L:()=>d});var r=n(7143),o=n(8537),a=n(6087),i=n(3076),s=n(7153);function c(e){var t;return null!==(t=e.split("?").at(0))&&void 0!==t?t:e}let l={};const u=e=>{const t={message:"An unknown API error occurred.",statusCode:500,errorCode:"api_unknown_error",details:""};if(!e)return null;if("string"==typeof e)t.message=e;else if(e instanceof Error||"message"in e){var n,r,o;t.message=null!==(n=e.message)&&void 0!==n?n:t.message,t.statusCode=null!==(r=e.data?.status)&&void 0!==r?r:t.statusCode,t.errorCode=null!==(o=e.code)&&void 0!==o?o:t.errorCode,t.details=""}return new s.Ss(t.message,t.statusCode,t.errorCode,t.details)},p=e=>({on(t,n=null){const r=e?.[t];r&&"function"==typeof r&&r(n)}});function d(e){var t;const[n,s]=(0,a.useState)(!1),{wizardApiFetch:d,updateWizardSettings:f}=(0,r.useDispatch)(i.S),h=(0,r.useSelect)(t=>t(i.S).getWizardData(e),[e]),[g,m]=(0,a.useState)(null!==(t=h.error)&&void 0!==t?t:null),v=(0,a.useRef)([]);function y(){m(null)}return(0,a.useEffect)(()=>{var e;h?.error!==g&&m(null!==(e=h?.error)&&void 0!==e?e:null)},[h?.error,g]),(0,a.useEffect)(()=>{f({slug:e,path:["error"],value:g})},[g,f,e]),{wizardApiFetch:(0,a.useCallback)(async(t,n)=>{const{on:r}=p(null!=n?n:{}),o=function(t){return(n,r,o=t)=>{const a=o?c(o):o;f({slug:e,path:[a,...Array.isArray(n)?n:[n]].filter(e=>"string"==typeof e),value:r})}}(t.path),{path:a,method:i="GET"}=t,g=c(null!=a?a:""),{isCached:y="GET"===i,updateCacheKey:w=null,updateCacheMethods:_=[],...b}=t,{error:x,[g]:{[i]:k=null}={}}=h;function j(e){if(y&&o(i,e),w&&w.constructor===Object){const[t,n]=Object.entries(w)[0],r=h[t][n];let a;a=r&&r.constructor===Object?{...r,...e}:e,o(Object.entries(w)[0],a,null)}for(const t of _)o(t,e);return r("onSuccess",e),e}function S(e){const t=u(e);throw m(t),r("onError",t),t}function A(){const{[g]:e,...t}=l;l=t,v.current=v.current.filter(e=>e!==g),s(v.current.length>0),r("onFinally")}return l[g]?(s(!0),l[g].then(j).catch(S).finally(A)):y&&(x||k)?(m(x),r("onSuccess",k),k):(s(!0),r("onStart"),v.current.push(g),l[g]=d({isQuietFetch:!0,isLocalError:!0,...b}).then(j).catch(S).finally(A),l[e])},[d,h,f,n,e]),isFetching:n,errorMessage:g?(0,o.decodeEntities)(g.message):null,error:g,cache:t=>({get:(e="GET")=>h[t][e],set(n,r="GET"){f({slug:e,path:[t,r],value:n})}}),setError(e){null===e?y():m(u(e))},resetError:y}}},2006:(e,t,n)=>{var r=n(5389),o=n(4894),a=n(5950);e.exports=function(e){return function(t,n,i){var s=Object(t);if(!o(t)){var c=r(n,3);t=a(t),n=function(e){return c(s[e],e,s)}}var l=e(t,n,i);return l>-1?s[c?t[l]:l]:void 0}}},2032:(e,t,n)=>{var r=n(1042);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},2039:(e,t,n)=>{"use strict";n.d(t,{Y:()=>i});var r=n(6087);const o="NewspackAuthorContext",a=(0,r.createContext)(null),i=()=>"undefined"!=typeof window&&window[o]?window[o]:a},2135:(e,t,n)=>{"use strict";n.d(t,{C:()=>f});var r=n(7143),o=n(6087),a=n(3582),i=n(1455),s=n.n(i);const c="cap/authors",l="/coauthors/v1/coauthors",u={},p={};function d(e){if(!e)return;const t=e.split("?")[0].split("#")[0].replace(/\/$/,"").split("/"),n=t.pop(),r=t[t.length-1];return n&&r?n:void 0}function f(e,t="post",n=!1){const{capAuthors:i,restAuthors:f,isCapAvailable:h}=(0,r.useSelect)(r=>{if(n)return{capAuthors:null,restAuthors:null,isCapAvailable:!1};const o=r(c),i=Boolean(o&&"function"==typeof o.getAuthors),s=r("core/editor"),l=s?.getCurrentPostId?.(),u=e&&l&&e!==l;if(i&&!u)return{capAuthors:e?o.getAuthors(e):null,restAuthors:null,isCapAvailable:!0};if(u&&e){const{getEntityRecord:n}=r(a.store),o=n("postType",t,e),s=o?.newspack_author_info||null;return{capAuthors:null,restAuthors:s,isCapAvailable:!!s||i}}return{capAuthors:null,restAuthors:null,isCapAvailable:i}},[e,t,n]),g=(0,o.useMemo)(()=>i&&i.length>0?i.map(e=>({id:e.id,display_name:e.display||e.value||e.label,user_nicename:e.value,isGuest:"guest-author"===e.userType})):f&&Array.isArray(f)&&f.length>0?f.map(e=>({id:e.id,display_name:e.display_name,author_link:e.author_link,user_nicename:e.user_nicename||d(e.author_link),..."boolean"==typeof e.is_guest?{isGuest:e.is_guest}:{},...e.avatar_urls?{avatar_urls:e.avatar_urls}:{}})):[],[i,f]),[m,v]=(0,o.useState)({}),y=g.filter(e=>!1!==e.isGuest&&e.user_nicename&&!e.avatar_urls),w=y.map(e=>e.user_nicename).join(",");return(0,o.useEffect)(()=>{if(n||!h||!w)return;let e=!1;return Promise.all(y.map(e=>{return(t=e.user_nicename)in u?Promise.resolve():(p[t]||(p[t]=s()({path:`${l}/${encodeURIComponent(t)}`}).then(e=>{u[t]=e?.avatar_urls||!1}).catch(()=>{u[t]=!1}).finally(()=>{delete p[t]})),p[t]);var t})).then(()=>{if(e)return;const t={};y.forEach(e=>{u[e.user_nicename]&&(t[e.id]=u[e.user_nicename])}),v(t)}),()=>{e=!0}},[n,h,w]),{authors:g.map(e=>{if(!1===e.isGuest||!e.user_nicename)return e;const t=m[e.id]||u[e.user_nicename];return t?{...e,avatar_urls:t}:e}),isCapAvailable:h}}},2177:(e,t,n)=>{var r=n(1489);e.exports=function(e,t){var n;if("function"!=typeof t)throw new TypeError("Expected a function");return e=r(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}},2193:(e,t,n)=>{var r=n(8984),o=n(5861),a=n(2428),i=n(6449),s=n(4894),c=n(3656),l=n(5527),u=n(7167),p=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(i(e)||"string"==typeof e||"function"==typeof e.splice||c(e)||u(e)||a(e)))return!e.length;var t=o(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(l(e))return!r(e).length;for(var n in e)if(p.call(e,n))return!1;return!0}},2199:(e,t,n)=>{var r=n(4528),o=n(6449);e.exports=function(e,t,n){var a=t(e);return o(e)?a:r(a,n(e))}},2224:(e,t,n)=>{var r=n(104);e.exports=function(e){var t=r(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}},2247:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>o}),/^(2(001|084|617)|(66|94)06|6930|7841|828|8498)$/.test(n.j))var r=n(1125);const o=/^(2(001|084|617)|(66|94)06|6930|7841|828|8498)$/.test(n.j)?r:null},2426:(e,t,n)=>{var r=n(4248),o=n(5389),a=n(916),i=n(6449),s=n(6800);e.exports=function(e,t,n){var c=i(e)?r:a;return n&&s(e,t,n)&&(t=void 0),c(e,o(t,3))}},2428:(e,t,n)=>{var r=n(7534),o=n(346),a=Object.prototype,i=a.hasOwnProperty,s=a.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return o(e)&&i.call(e,"callee")&&!s.call(e,"callee")};e.exports=c},2485:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(790),o=n(5573),a=(0,r.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)(o.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})})},2523:e=>{e.exports=function(e,t,n,r){for(var o=e.length,a=n+(r?1:-1);r?a--:++a{var r=n(1873),o=n(659),a=n(9350),i=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},2578:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(790),o=n(5573),a=(0,r.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)(o.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 12v-1.5h1.5V16h-1.5Zm0-8v5h1.5V8h-1.5Z"})})},2634:()=>{},2642:(e,t,n)=>{"use strict";var r=n(7720),o=Object.prototype.hasOwnProperty,a=Array.isArray,i={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},s=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},c=function(e,t,n){if(e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&n>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},l=function(e,t,n,a){if(e){var i=function(e,t){var n=t.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(t.depth<=0){if(!t.plainObjects&&o.call(Object.prototype,n)&&!t.allowPrototypes)return;return[n]}var r=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(n),i=a?n.slice(0,a.index):n,s=[];if(i){if(!t.plainObjects&&o.call(Object.prototype,i)&&!t.allowPrototypes)return;s[s.length]=i}for(var c=0;null!==(a=r.exec(n))&&c0&&"[]"===e[e.length-1]){var i=e.slice(0,-1).join("");a=Array.isArray(t)&&t[i]?t[i].length:0}for(var s=o?t:c(t,n,a),l=e.length-1;l>=0;--l){var u,p=e[l];if("[]"===p&&n.parseArrays)u=r.isOverflow(s)?s:n.allowEmptyArrays&&(""===s||n.strictNullHandling&&null===s)?[]:r.combine([],s,n.arrayLimit,n.plainObjects);else{u=n.plainObjects?{__proto__:null}:{};var d="["===p.charAt(0)&&"]"===p.charAt(p.length-1)?p.slice(1,-1):p,f=n.decodeDotInKeys?d.replace(/%2E/g,"."):d,h=parseInt(f,10),g=!isNaN(h)&&p!==f&&String(h)===f&&h>=0&&n.parseArrays;if(n.parseArrays||""!==f)if(g&&hu)throw new RangeError("Parameter limit exceeded. Only "+u+" parameter"+(1===u?"":"s")+" allowed.");var d,f=-1,h=t.charset;if(t.charsetSentinel)for(d=0;d-1&&(m=a(m)?[m]:m),t.comma&&a(m)&&m.length>t.arrayLimit){if(t.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");m=r.combine([],m,t.arrayLimit,t.plainObjects)}if(null!==g){var _=o.call(n,g);_&&("combine"===t.duplicates||v.indexOf("[]=")>-1)?n[g]=r.combine(n[g],m,t.arrayLimit,t.plainObjects):_&&"last"!==t.duplicates||(n[g]=m)}}return n}(e,n):e,p=n.plainObjects?{__proto__:null}:{},d=Object.keys(u),f=0;f{var r=n(4218);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},2668:(e,t,n)=>{"use strict";n.d(t,{l:()=>r});const r=e=>{var t;if(!(e.className||"").includes("is-style-overlapped"))return{};let n=null!==(t=e?.style?.border?.radius)&&void 0!==t?t:"100%";if("object"==typeof n){const e=Object.values(n);if(1!==new Set(e).size)return{};n=e[0]}if("string"!=typeof n)return{};const r=e.size||48,o=1.1*r,a=(o-r)/2;let i;if(i=n.endsWith("%")?parseFloat(n)/100*r:n.endsWith("rem")||n.endsWith("em")?16*parseFloat(n):parseFloat(n),Number.isNaN(i))return{};const s=Math.round(100*Math.max(0,Math.min(o/2,i+a)))/100;return{"--overlap-mask":`url("data:image/svg+xml,${encodeURIComponent(``)}")`}}},2694:(e,t,n)=>{"use strict";var r=n(6925);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},2749:(e,t,n)=>{var r=n(1042),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},2799:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,p=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,w=n?Symbol.for("react.responder"):60118,_=n?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case p:case a:case s:case i:case f:return e;default:switch(e=e&&e.$$typeof){case l:case d:case m:case g:case c:return e;default:return t}}case o:return t}}}function x(e){return b(e)===p}t.AsyncMode=u,t.ConcurrentMode=p,t.ContextConsumer=l,t.ContextProvider=c,t.Element=r,t.ForwardRef=d,t.Fragment=a,t.Lazy=m,t.Memo=g,t.Portal=o,t.Profiler=s,t.StrictMode=i,t.Suspense=f,t.isAsyncMode=function(e){return x(e)||b(e)===u},t.isConcurrentMode=x,t.isContextConsumer=function(e){return b(e)===l},t.isContextProvider=function(e){return b(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return b(e)===d},t.isFragment=function(e){return b(e)===a},t.isLazy=function(e){return b(e)===m},t.isMemo=function(e){return b(e)===g},t.isPortal=function(e){return b(e)===o},t.isProfiler=function(e){return b(e)===s},t.isStrictMode=function(e){return b(e)===i},t.isSuspense=function(e){return b(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===s||e===i||e===f||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===g||e.$$typeof===c||e.$$typeof===l||e.$$typeof===d||e.$$typeof===y||e.$$typeof===w||e.$$typeof===_||e.$$typeof===v)},t.typeOf=b},2804:(e,t,n)=>{var r=n(6110)(n(9325),"Promise");e.exports=r},2824:(e,t,n)=>{var r=n(7805),o=n(3290),a=n(1961),i=n(3007),s=n(5529),c=n(2428),l=n(6449),u=n(3693),p=n(3656),d=n(1882),f=n(3805),h=n(1331),g=n(7167),m=n(4974),v=n(9884);e.exports=function(e,t,n,y,w,_,b){var x=m(e,n),k=m(t,n),j=b.get(k);if(j)r(e,n,j);else{var S=_?_(x,k,n+"",e,t,b):void 0,A=void 0===S;if(A){var C=l(k),E=!C&&p(k),P=!C&&!E&&g(k);S=k,C||E||P?l(x)?S=x:u(x)?S=i(x):E?(A=!1,S=o(k,!0)):P?(A=!1,S=a(k,!0)):S=[]:h(k)||c(k)?(S=x,c(x)?S=v(x):f(x)&&!d(x)||(S=s(k))):A=!1}A&&(b.set(k,S),w(S,k,y,_,b),b.delete(k)),r(e,n,S)}}},2865:(e,t,n)=>{var r=n(9570),o=n(1811)(r);e.exports=o},2903:(e,t,n)=>{var r=n(3805),o=n(5527),a=n(181),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return a(e);var t=o(e),n=[];for(var s in e)("constructor"!=s||!t&&i.call(e,s))&&n.push(s);return n}},2949:(e,t,n)=>{var r=n(2651);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},2952:(e,t,n)=>{"use strict";function r(e){if(!e)return"";const t=`; ${document.cookie}`.split(`; ${e}=`);return 2===t.length?decodeURIComponent(t.pop().split(";").shift()):""}function o(e,t,n=365){const r=new Date;r.setTime(r.getTime()+24*n*60*60*1e3),document.cookie=`${e}=${t}; expires=${r.toUTCString()}; path=/`}function a(e=9){let t="";for(let n=0;n{setTimeout(()=>{if(t.overlays.get().length){const n=({detail:{overlays:t}})=>{setTimeout(()=>{t.length||(e(),window.newspackReaderActivation.off("overlay",n))},50)};return void t.on("overlay",n)}e()},50)})}function c(){s(()=>window.location.reload())}n.d(t,{Ri:()=>r,TV:()=>o,ZZ:()=>s,cY:()=>i,ni:()=>a,q9:()=>c})},3007:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n{var r=n(1549),o=n(79),a=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(a||o),string:new r}}},3076:(e,t,n)=>{"use strict";n.d(t,{A:()=>y,S:()=>f});var r=n(3560),o=n.n(r),a=n(8156),i=n.n(a),s=n(2193),c=n.n(s),l=n(1455),u=n.n(l),p=n(7143),d=n(5186);const f="newspack/wizards",h={headerData:{actions:[],backNav:"",badges:[],sectionDescription:"",sectionName:"",sectionTitle:""},isLoading:!1,isQuietLoading:!1,apiData:{},notices:[],error:null},g=e=>JSON.parse(JSON.stringify(e)),m={setHeaderData:(0,d.V)("SET_HEADER_DATA"),resetHeaderData:(0,d.V)("RESET_HEADER_DATA"),startLoadingData:(0,d.V)("START_LOADING_DATA"),finishLoadingData:(0,d.V)("FINISH_LOADING_DATA"),fetchFromAPI:(0,d.V)("FETCH_FROM_API"),setAPIDataForWizard:(0,d.V)("SET_API_DATA"),updateWizardSettings:(0,d.V)("UPDATE_WIZARD_SETTINGS"),addNotice:(0,d.V)("ADD_NOTICE"),removeNotice:(0,d.V)("REMOVE_NOTICE"),resetNotices:(0,d.V)("RESET_NOTICES"),setError:(0,d.V)("SET_ERROR"),*saveWizardSettings({slug:e,section:t="",payloadPath:n=!1,auxData:r={},updatePayload:o=null}){o&&(yield m.updateWizardSettings({slug:e,...o}));const a=(0,p.select)(f).getWizardAPIData(e),s=n?i()(a,n):a,l=yield m.fetchFromAPI({path:`/newspack/v1/wizard/${e}/${t}`,method:"POST",data:{...s,...r},isQuietFetch:!0});if(!c()(l)&&!l.error)return m.setAPIDataForWizard({slug:e,data:l})},*wizardApiFetch(e){return yield m.fetchFromAPI(e)}},v=(0,p.createReduxStore)(f,{reducer:(e=h,{type:t,payload:n={}})=>{switch(t){case"SET_HEADER_DATA":return{...e,headerData:{...e.headerData,...n}};case"RESET_HEADER_DATA":return{...e,headerData:{...h.headerData}};case"START_LOADING_DATA":return n.isQuietLoading?{...e,isQuietLoading:!0}:{...e,isLoading:!0};case"FINISH_LOADING_DATA":return{...e,isLoading:!1,isQuietLoading:!1};case"SET_API_DATA":return o()(g(e),["apiData",n.slug],n.data);case"UPDATE_WIZARD_SETTINGS":return o()(g(e),["apiData",n.slug,...n.path],n.value);case"ADD_NOTICE":return{...e,notices:[...e.notices,n]};case"REMOVE_NOTICE":return{...e,notices:e.notices.filter(e=>e.id!==n)};case"SET_ERROR":return{...e,error:n};case"RESET_NOTICES":return{...e,notices:h.notices};default:return e}},actions:m,selectors:{getHeaderData:e=>e.headerData,isLoading:e=>e.isLoading,isQuietLoading:e=>e.isQuietLoading,getWizardAPIData:(e,t)=>e.apiData[t]||{},getWizardData:(e,t)=>{var n;return null!==(n=e.apiData[t])&&void 0!==n?n:{}},getNotices:e=>e.notices,getError:e=>e.error},controls:{FETCH_FROM_API:e=>{const{isLocalError:t=!1,isQuietFetch:n=!1}=e.payload;return(0,p.dispatch)(f).startLoadingData({isQuietLoading:Boolean(n)}),u()(e.payload).then(e=>((0,p.dispatch)(f).setError(null),e)).catch(e=>{if(t)throw e;(0,p.dispatch)(f).setError(e)}).finally(e=>((0,p.dispatch)(f).finishLoadingData(),e))}},resolvers:{*getWizardAPIData(e){if(e){const t=yield m.fetchFromAPI({path:`/newspack/v1/wizard/${e}`});return m.setAPIDataForWizard({slug:e,data:t})}return m.finishLoadingData()}}}),y=()=>(0,p.register)(v)},3093:(e,t,n)=>{"use strict";var r=n(4459);e.exports=function(e){return r(e)||0===e?e:e<0?-1:1}},3126:(e,t,n)=>{"use strict";var r=n(6743),o=n(9675),a=n(76),i=n(3144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return i(r,a,e)}},3144:(e,t,n)=>{"use strict";var r=n(6743),o=n(1002),a=n(76),i=n(7119);e.exports=i||r.call(a,o)},3170:(e,t,n)=>{var r=n(6547),o=n(1769),a=n(361),i=n(3805),s=n(7797);e.exports=function(e,t,n,c){if(!i(e))return e;for(var l=-1,u=(t=o(t,e)).length,p=u-1,d=e;null!=d&&++l{e.exports=function(e){return function(t,n,r){for(var o=-1,a=Object(t),i=r(t),s=i.length;s--;){var c=i[e?s:++o];if(!1===n(a[c],c,a))break}return t}}},3222:(e,t,n)=>{var r=n(7556);e.exports=function(e){return null==e?"":r(e)}},3243:(e,t,n)=>{var r=n(6110),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},3290:(e,t,n)=>{e=n.nmd(e);var r=n(9325),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o?r.Buffer:void 0,s=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},3345:e=>{e.exports=function(){return[]}},3360:(e,t,n)=>{var r=n(3243);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},3488:e=>{e.exports=function(e){return e}},3497:(e,t,n)=>{"use strict";function r(e){e.on("activity",({detail:{action:t,data:n,timestamp:r}})=>{if("article_view"!==t)return;const o=new Date(r);o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0);const a=6-o.getDay();o.setDate(o.getDate()+a);const i=o.getTime(),s=e.store.get("article_view_per_week")||{};s[i]||(s[i]={}),s[i][n.post_id]=!0,e.store.set("article_view_per_week",s),o.setMonth(o.getMonth()+1),o.setDate(1);const c=o.getTime(),l=e.store.get("article_view_per_month")||{};l[c]||(l[c]={}),l[c][n.post_id]=!0,e.store.set("article_view_per_month",l)})}n.d(t,{A:()=>r})},3499:e=>{"use strict";e.exports=Math.pow},3560:(e,t,n)=>{var r=n(3170);e.exports=function(e,t,n){return null==e?e:r(e,t,n)}},3605:e=>{e.exports=function(e){return this.__data__.get(e)}},3628:(e,t,n)=>{"use strict";var r=n(8648),o=n(1064),a=n(7176);e.exports=r?function(e){return r(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return o(e)}:a?function(e){return a(e)}:null},3650:(e,t,n)=>{var r=n(4335)(Object.keys,Object);e.exports=r},3656:(e,t,n)=>{e=n.nmd(e);var r=n(9325),o=n(9935),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,s=i&&i.exports===a?r.Buffer:void 0,c=(s?s.isBuffer:void 0)||o;e.exports=c},3661:(e,t,n)=>{var r=n(3040),o=n(7670),a=n(289),i=n(4509),s=n(2949);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{A:()=>r})},3663:(e,t,n)=>{var r=n(1799),o=n(776),a=n(7197);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},3693:(e,t,n)=>{var r=n(4894),o=n(346);e.exports=function(e){return o(e)&&r(e)}},3702:e=>{e.exports=function(){this.__data__=[],this.size=0}},3737:(e,t,n)=>{"use strict";n.d(t,{b:()=>o});var r=n(7723);function o(e){return new Promise((t,n)=>{const o=new FileReader;o.readAsText(e,"UTF-8"),o.onload=function(e){let o;try{o=JSON.parse(e.target.result)}catch(e){n((0,r.__)("Invalid JSON file","newspack-plugin"))}t(o)},o.onerror=function(){n((0,r.__)("Unable to read file","newspack-plugin"))}})}},3756:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(790),o=n(5573),a=(0,r.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)(o.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})})},3784:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(790),o=n(5573),a=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"})})},3805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},3862:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},3916:(e,t,n)=>{var r=n(3360),o=n(641),a=n(5389);e.exports=function(e,t){var n={};return t=a(t,3),o(e,function(e,o,a){r(n,o,t(e,o,a))}),n}},3988:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(790),o=n(5573),a=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})})},4039:(e,t,n)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,o=n(1333);e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&o()}},4058:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});class r extends Error{constructor(e,t,n=""){super(e),this.name="WizardError",this.errorCode=t,this.details=n,Object.setPrototypeOf&&Object.setPrototypeOf(this,new.target.prototype)}toJSON(){return{name:this.name,message:this.message,errorCode:this.errorCode,details:this.details,stackTrace:this.stack}}}const o=/^(2001|6930|828)$/.test(n.j)?r:null},4128:(e,t,n)=>{var r=n(1800),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},4146:(e,t,n)=>{"use strict";var r=n(4363),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return r.isMemo(e)?i:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=i;var l=Object.defineProperty,u=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=f(n);o&&o!==h&&e(t,o,r)}var i=u(n);p&&(i=i.concat(p(n)));for(var s=c(t),g=c(n),m=0;m{"use strict";function r(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;to});const o=/^(1740|2617)$/.test(n.j)?function(){for(var e,t,n=0,o="",a=arguments.length;n{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},4247:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},4248:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{e.exports=function(e,t){return function(n){return e(t(n))}}},4363:(e,t,n)=>{"use strict";e.exports=n(2799)},4394:(e,t,n)=>{var r=n(2552),o=n(346);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},4459:e=>{"use strict";e.exports=Number.isNaN||function(e){return e!=e}},4509:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).has(e)}},4528:e=>{e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n{"use strict";n.d(t,{A:()=>k});var r=n(6942),o=n.n(r),a=n(6427),i=n(7143),s=n(6087),c=n(7723),l=n(591),u=n(8169),p=n(5928),d=n(2247),f=n(3076),h=n(790);const g=({children:e,position:t="bottom-left",type:n="info",actions:r=[],...s})=>{const c=o()("newspack-wizard__snackbar",s.className,`newspack-wizard__snackbar--${t}`,`newspack-wizard__snackbar--${n}`),{removeNotice:l,resetNotices:u}=(0,i.useDispatch)(f.S);return(0,h.jsx)(a.Snackbar,{className:c,...s,onRemove:()=>{s.onRemove&&s.onRemove(),s.id?l(s.id):u()},actions:r,children:e})},m=()=>{const e=(0,i.useSelect)(e=>e(f.S).getError());if(!e)return null;const{level:t,message:n}=(({data:e,message:t,code:n})=>{let r="fatal";return e&&"level"in e?r=e.level:"rest_invalid_param"===n&&(r="notice"),{message:t,level:r}})(e);if("fatal"===t){const e="undefined"!=typeof newspack_urls&&newspack_urls.dashboard;return(0,h.jsxs)(p.aF,{title:(0,c.__)("Unrecoverable error"),onRequestClose:e?()=>window.location=e:void 0,children:[(0,h.jsx)(p.$T,{noticeText:n,isError:!0,rawHTML:!0}),e&&(0,h.jsx)(p.Zp,{buttonsCard:!0,noBorder:!0,className:"justify-end",children:(0,h.jsx)(p.$n,{isPrimary:!0,href:e,children:(0,c.__)("Return to Dashboard","newspack-plugin")})})]})}return(0,h.jsx)(p.$T,{isError:!0,className:"newspack-wizard__above-header",noticeText:n,rawHTML:!0})};(0,f.A)();const{HashRouter:v,Redirect:y,Route:w,Switch:_,useLocation:b}=d.A,x=()=>{const e=b(),{resetHeaderData:t}=(0,i.useDispatch)(f.S);return(0,s.useEffect)(()=>{t(),window.scrollTo(0,0)},[e.pathname,t]),null},k=(0,s.forwardRef)(({sections:e=[],headerText:t,apiSlug:n,sharedProps:r={},subHeaderText:d,hasSimpleFooter:b,className:k,renderAboveSections:j,requiredPlugins:S=[],isInitialFetchTriggered:A=!0,fixedHeader:C=!1},E)=>{const P=(0,i.useSelect)(e=>e(f.S).isLoading()),O=(0,i.useSelect)(e=>e(f.S).isQuietLoading()),N=(0,i.useSelect)(e=>e(f.S).getHeaderData()),L=(0,i.useSelect)(e=>e(f.S).getNotices()),{actions:T,backNav:M,badges:I,sectionDescription:R,sectionName:D,sectionTitle:$,sectionPrimaryAction:F,sectionSecondaryAction:z}=N,V=T?.filter(e=>"primary"===e.type||"secondary"===e.type),H=T?.filter(e=>"more"===e.type);(0,i.useSelect)(e=>A&&e(f.S).getWizardAPIData(n));let B=e.filter(e=>!e.isHidden);const[U,q]=(0,s.useState)(0===S.length);U||(t=S.length>1?(0,c.__)("Required plugins","newspack-plugin"):(0,c.__)("Required plugin","newspack-plugin"),B=[{path:"/",render:()=>(0,h.jsx)(p.I2,{plugins:S,onStatus:({complete:e})=>q(e)})}]);const W=U?e:B,G=window.location.href.split("#")[0];return(0,h.jsxs)("div",{ref:E,children:[(0,h.jsxs)("div",{className:o()(P?"newspack-wizard__is-loading":"newspack-wizard__is-loaded",{"newspack-wizard__is-loading-quiet":O,"newspack-wizard__fixed-header":C}),children:[(0,h.jsxs)(v,{hashType:"slash",children:[newspack_aux_data.is_debug_mode&&(0,h.jsx)(p.$T,{debugMode:!0}),(0,h.jsxs)("div",{className:"newspack-wizard__header",children:[(0,h.jsx)("div",{className:"newspack-wizard__header__inner",children:(0,h.jsxs)("div",{className:"newspack-wizard__title",children:[newspack_urls.dashboard!==G?(0,h.jsx)(p.$n,{isLink:!0,href:newspack_urls.dashboard,label:(0,c.__)("Return to Dashboard","newspack-plugin"),showTooltip:!0,icon:l.A,iconSize:36,children:(0,h.jsx)(p.qV,{size:36})}):(0,h.jsx)(p.qV,{size:36}),(0,h.jsxs)("div",{children:[t&&(0,h.jsxs)("h2",{className:"newspack-wizard__header__title",children:[t,D&&(0,h.jsxs)("span",{className:"newspack-wizard__header__section",children:[(0,h.jsx)("span",{className:"newspack-wizard__header__section__separator",children:" / "})," ",D]})]}),d&&(0,h.jsx)("span",{children:d})]})]})}),T?.length>0&&(0,h.jsxs)("div",{className:"newspack-wizard__header__actions",children:[V.map((e,t)=>(0,h.jsx)(p.$n,{className:"newspack-wizard__header__actions__main",icon:e.icon,variant:e.type,onClick:e.action,disabled:e.disabled||!1,isDestructive:e.destructive||!1,children:e.label},t)),(0,h.jsx)(a.DropdownMenu,{className:0===H?.length?"newspack-wizard__header__actions__more--primary-only":"",icon:u.A,label:(0,c.__)("More","newspack-plugin"),popoverProps:{className:"newspack-wizard__header__actions__more"},children:()=>T.map((e,t)=>(0,h.jsx)(a.MenuItem,{className:"primary"===e.type||"secondary"===e.type?"newspack-wizard__header__actions__more__main":"newspack-wizard__header__actions__more__more",icon:e.icon,onClick:e.action,disabled:e.disabled||!1,isDestructive:e.destructive||!1,children:e.label},t))})]})]}),B.length>1&&(0,h.jsx)(p.pe,{items:B,children:(0,h.jsx)(m,{})}),(0,h.jsx)(p.uC,{}),e.length>1&&(0,h.jsx)(x,{}),(0,h.jsx)("div",{className:"newspack-wizard__main",children:(0,h.jsxs)(_,{children:[W.map((e,t)=>{var n;const a=e.render,i=e.props||{};return(0,h.jsx)(w,{exact:null!==(n=e.exact)&&void 0!==n&&n,path:e.path,render:t=>(0,h.jsxs)("div",{className:o()("newspack-wizard__content",k),children:["function"==typeof j?j():null,($||e.title)&&(0,h.jsx)(p.X3,{className:"newspack-wizard__section-header",backNav:M||e.backNav,title:$||e.title,description:R||e.description,badges:I||e.badges,primaryAction:F||e.primaryAction,secondaryAction:z||e.secondaryAction,heading:1,noMargin:!0}),(0,h.jsx)(a,{...t,...i,...r})]})},t)}),(0,h.jsx)(y,{to:B[0].path})]})})]}),L?.length>0&&L.map((e,t)=>(0,h.jsx)(g,{type:e.type,id:e.id,actions:e.actions,children:e.message},e.id||t))]}),!P&&(0,h.jsx)(p.wi,{simple:b})]})})},4652:(e,t,n)=>{"use strict";var r=n(453),o=n(6556),a=n(1240),i=n(507),s=n(9675),c=r("%WeakMap%",!0),l=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),p=o("WeakMap.prototype.has",!0),d=o("WeakMap.prototype.delete",!0);e.exports=c?function(){var e,t,n={assert:function(e){if(!n.has(e))throw new s("Side channel does not contain "+a(e))},delete:function(n){if(c&&n&&("object"==typeof n||"function"==typeof n)){if(e)return d(e,n)}else if(i&&t)return t.delete(n);return!1},get:function(n){return c&&n&&("object"==typeof n||"function"==typeof n)&&e?l(e,n):t&&t.get(n)},has:function(n){return c&&n&&("object"==typeof n||"function"==typeof n)&&e?p(e,n):!!t&&t.has(n)},set:function(n,r){c&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new c),u(e,n,r)):i&&(t||(t=i()),t.set(n,r))}};return n}:i},4664:(e,t,n)=>{var r=n(9770),o=n(3345),a=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,s=i?function(e){return null==e?[]:(e=Object(e),r(i(e),function(t){return a.call(e,t)}))}:o;e.exports=s},4707:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(790),o=n(5573),a=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})})},4713:(e,t,n)=>{var r=n(2523),o=n(5389),a=n(1489),i=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var c=null==n?0:a(n);return c<0&&(c=i(s+c,0)),r(e,o(t,3),c)}},4739:(e,t,n)=>{var r=n(6025);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},4765:e=>{"use strict";var t=String.prototype.replace,n=/%20/g,r="RFC3986";e.exports={default:r,formatters:{RFC1738:function(e){return t.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:r}},4803:(e,t,n)=>{"use strict";var r=n(1240),o=n(9675),a=function(e,t,n){for(var r,o=e;null!=(r=o.next);o=r)if(r.key===t)return o.next=r.next,n||(r.next=e.next,e.next=r),r};e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new o("Side channel does not contain "+r(e))},delete:function(t){var n=e&&e.next,r=function(e,t){if(e)return a(e,t,!0)}(e,t);return r&&n&&n===r&&(e=void 0),!!r},get:function(t){return function(e,t){if(e){var n=a(e,t);return n&&n.value}}(e,t)},has:function(t){return function(e,t){return!!e&&!!a(e,t)}(e,t)},set:function(t,n){e||(e={next:void 0}),function(e,t,n){var r=a(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(e,t,n)}};return t}},4818:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(790),o=n(5573),a=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"m11.3 17.2-5-5c-.1-.1-.1-.3 0-.4l2.3-2.3-1.1-1-2.3 2.3c-.7.7-.7 1.8 0 2.5l5 5H7.5v1.5h5.3v-5.2h-1.5v2.6zm7.5-6.4-5-5h2.7V4.2h-5.2v5.2h1.5V6.8l5 5c.1.1.1.3 0 .4l-2.3 2.3 1.1 1.1 2.3-2.3c.6-.7.6-1.9-.1-2.5z"})})},4840:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},4894:(e,t,n)=>{var r=n(1882),o=n(294);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},4901:(e,t,n)=>{var r=n(2552),o=n(294),a=n(346),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&o(e.length)&&!!i[r(e)]}},4916:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(5920);window.newspack_reader_data=window.newspack_reader_data||{};const o={storePrefix:newspack_reader_data?.store_prefix||"np_reader_",storage:newspack_reader_data?.is_temporary?window.sessionStorage:window.localStorage,collections:{maxItems:1e3,maxAge:2592e6}};function a(e=!1){const t=[o.storePrefix];return e&&t.push("_"),t.join("")}function i(e,t=!1){if(!e)throw new Error("Key is required.");return a(t)+e}function s(e){const t=u("unsynced",!0)||[];t.includes(e)||(t.push(e),p("unsynced",t,!0))}function c(e){return e&&"string"==typeof e?JSON.parse(e):e}function l(e){if((newspack_reader_data?.read_only_keys||[]).includes(e))throw new Error(`Key '${e}' is read-only.`)}function u(e,t=!1){if(!e)throw new Error("Key is required.");return c(o.storage.getItem(i(e,t)))}function p(e,t,n=!1){if(!e)throw new Error("Key is required.");if(null==t)throw new Error("Value cannot be undefined or null.");if("_"===e[0])throw new Error("Key cannot start with an underscore.");var a;o.storage.setItem(i(e,n),(a=t,JSON.stringify(a))),n||(0,r.Ic)(r.qY.data,{key:e,value:t})}function d(){if(window.newspackRASInitialized&&window.newspackReaderActivation?.store)return window.newspackReaderActivation.store;const e=[];var t;t=e,setInterval(()=>{if(!t.length||newspack_reader_data?.is_temporary)return;const e=t.shift();(function(e){if(!e)return Promise.reject("Key is required.");if(!newspack_reader_data.api_url||!newspack_reader_data.nonce)return Promise.reject("API not available.");const t=u(e),n={key:e};if(t&&(n.value=JSON.stringify(t)),newspack_reader_data?.items&&newspack_reader_data.items[e]===n.value)return Promise.resolve();const r=new XMLHttpRequest;return r.open(n.value?"POST":"DELETE",newspack_reader_data.api_url,!0),r.setRequestHeader("Content-Type","application/json"),r.setRequestHeader("X-WP-Nonce",newspack_reader_data.nonce),r.send(JSON.stringify(n)),new Promise((t,o)=>{r.onreadystatechange=()=>{if(4===r.readyState)return 200!==r.status?o(r):(newspack_reader_data.items[e]=n.value,t(r))}})})(e).then(()=>function(e){const t=u("unsynced",!0)||[];t.includes(e)&&(t.splice(t.indexOf(e),1),p("unsynced",t,!0))}(e)).catch(()=>s(e))},1e3);const n=newspack_reader_data?.read_only_keys||[],d=(u("unsynced",!0)||[]).filter(e=>!n.includes(e));p("unsynced",d,!0);for(const t of d)e.includes(t)||e.push(t);if(newspack_reader_data?.items&&!newspack_reader_data?.is_temporary){const e=Object.keys(newspack_reader_data.items);for(const t of e)d.includes(t)||p(t,JSON.parse(newspack_reader_data.items[t]))}return{get:e=>{if(!e)throw new Error("Key is required.");return u(e)},getAll:()=>{const e={},t=a(!1),n=a(!0);for(let r=0;r{l(t),p(t,n,!1),r&&(s(t),e.push(t))},delete:t=>{if(!t)throw new Error("Key is required.");l(t),o.storage.removeItem(i(t)),(0,r.Ic)(r.qY.data,{key:t,value:void 0}),s(t),e.push(t)},add:(e,t)=>{if(!e)throw new Error("Key cannot be empty.");if(l(e),!t)throw new Error("Value cannot be empty.");let n=u(e)||[];if(!Array.isArray(n))throw new Error(`Store key '${e}' is not an array.`);if(o.collections.maxAge){const e=Date.now();n=n.filter(t=>!t.timestamp||e-t.timestamp{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},5015:(e,t,n)=>{var r=n(2552),o=n(6449),a=n(346);e.exports=function(e){return"string"==typeof e||!o(e)&&a(e)&&"[object String]"==r(e)}},5095:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(790),o=n(5573),a=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})})},5160:e=>{e.exports=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(o);++r{"use strict";n.d(t,{V:()=>a,l:()=>i});var r=n(7143),o=n(3076);const a=e=>t=>({type:e,payload:t}),i=(e,t={})=>(0,r.useSelect)(t=>t(o.S).getWizardAPIData(e))||t},5250:(e,t,n)=>{var r=n(7217),o=n(7805),a=n(6649),i=n(2824),s=n(3805),c=n(7241),l=n(4974);e.exports=function e(t,n,u,p,d){t!==n&&a(n,function(a,c){if(d||(d=new r),s(a))i(t,n,c,u,e,p,d);else{var f=p?p(l(t,c),a,c+"",t,n,d):void 0;void 0===f&&(f=a),o(t,c,f)}},c)}},5288:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},5302:(e,t,n)=>{var r=n(7291);e.exports=function e(t,n,o){return r(n)||(o=n||o,n=[]),o=o||{},t instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r{"use strict";n.d(t,{_:()=>a,m:()=>i});var r=n(5920),o=n(8621);function a(e=!1){o.M_.set("pending_checkout",e,!1),(0,r.Ic)(r.qY.reader,(0,o.OO)())}function i(){return o.M_.get("pending_checkout")||!1}},5345:e=>{"use strict";e.exports=URIError},5373:(e,t,n)=>{"use strict";var r=n(8636),o=n(2642),a=n(4765);e.exports={formats:a,parse:o,stringify:r}},5389:(e,t,n)=>{var r=n(3663),o=n(7978),a=n(3488),i=n(6449),s=n(583);e.exports=function(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?i(e)?o(e[0],e[1]):r(e):s(e)}},5402:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(5573),o=n(790);const a=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"M18.5 12C18.5 10.2761 17.8152 8.62279 16.5962 7.40381C15.3772 6.18482 13.7239 5.5 12 5.5C10.2761 5.5 8.62279 6.18482 7.40381 7.40381C6.18482 8.62279 5.5 10.2761 5.5 12C5.5 13.7239 6.18482 15.3772 7.40381 16.5962C8.62279 17.8152 10.2761 18.5 12 18.5C13.7239 18.5 15.3772 17.8152 16.5962 16.5962C17.8152 15.3772 18.5 13.7239 18.5 12ZM20 12C20 14.1217 19.1571 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20C9.87827 20 7.84344 19.1571 6.34315 17.6569C4.84285 16.1566 4 14.1217 4 12C4 9.87827 4.84285 7.84344 6.34315 6.34315C7.84344 4.84285 9.87827 4 12 4C14.1217 4 16.1566 4.84285 17.6569 6.34315C19.1571 7.84344 20 9.87827 20 12ZM15.5 12C15.5 11.5404 15.4095 11.0852 15.2336 10.6606C15.0577 10.236 14.7999 9.85013 14.4749 9.52513C14.1499 9.20012 13.764 8.94231 13.3394 8.76642C12.9148 8.59053 12.4596 8.5 12 8.5C11.5404 8.5 11.0852 8.59053 10.6606 8.76642C10.236 8.94231 9.85013 9.20012 9.52513 9.52513C9.20012 9.85013 8.94231 10.236 8.76642 10.6606C8.59053 11.0852 8.5 11.5404 8.5 12C8.5 12.9283 8.86875 13.8185 9.52513 14.4749C10.1815 15.1313 11.0717 15.5 12 15.5C12.9283 15.5 13.8185 15.1313 14.4749 14.4749C15.1313 13.8185 15.5 12.9283 15.5 12ZM17 12C17 13.3261 16.4732 14.5979 15.5355 15.5355C14.5979 16.4732 13.3261 17 12 17C10.6739 17 9.40215 16.4732 8.46447 15.5355C7.52678 14.5979 7 13.3261 7 12C7 10.6739 7.52678 9.40215 8.46447 8.46447C9.40215 7.52678 10.6739 7 12 7C13.3261 7 14.5979 7.52678 15.5355 8.46447C16.4732 9.40215 17 10.6739 17 12ZM12.5 12C12.5 11.8674 12.4473 11.7402 12.3536 11.6464C12.2598 11.5527 12.1326 11.5 12 11.5C11.8674 11.5 11.7402 11.5527 11.6464 11.6464C11.5527 11.7402 11.5 11.8674 11.5 12C11.5 12.1326 11.5527 12.2598 11.6464 12.3536C11.7402 12.4473 11.8674 12.5 12 12.5C12.1326 12.5 12.2598 12.4473 12.3536 12.3536C12.4473 12.2598 12.5 12.1326 12.5 12ZM14 12C14 12.5304 13.7893 13.0391 13.4142 13.4142C13.0391 13.7893 12.5304 14 12 14C11.4696 14 10.9609 13.7893 10.5858 13.4142C10.2107 13.0391 10 12.5304 10 12C10 11.4696 10.2107 10.9609 10.5858 10.5858C10.9609 10.2107 11.4696 10 12 10C12.5304 10 13.0391 10.2107 13.4142 10.5858C13.7893 10.9609 14 11.4696 14 12Z"})}),i=/^9(001|406)$/.test(n.j)?a:null},5481:(e,t,n)=>{var r=n(9325)["__core-js_shared__"];e.exports=r},5527:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},5529:(e,t,n)=>{var r=n(9344),o=n(8879),a=n(5527);e.exports=function(e){return"function"!=typeof e.constructor||a(e)?{}:r(o(e))}},5547:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>a}),/^(193|3619)$/.test(n.j))var r=n(1622);if(/^(193|3619)$/.test(n.j))var o=n(2952);function a(){(0,r.Qc)(()=>{const e=new URLSearchParams(window.location.search),t=e.get("upgrade-subscription")||e.get("switch");if(e.get("upgrade-subscription")||e.get("tiers-modal")||e.get("switch")){const t=new URLSearchParams(e);t.delete("upgrade-subscription"),t.delete("tiers-modal"),t.delete("switch");const n=t.toString()?"?"+t.toString():"";window.history.replaceState({},"",window.location.pathname+n)}window.newspackRAS.push(n=>{const r=n.getReader();t&&!r?.authenticated&&n.openAuthModal({labels:{signin:{title:window.newspack_reader_activation_labels.sign_in_to_upgrade},register:{title:window.newspack_reader_activation_labels.register_to_upgrade}},skipSuccess:!0,skipNewslettersSignup:!0,closeOnSuccess:!1,onSuccess:()=>{window.location.href=window.location.pathname+"?"+e.toString()}})});const n=document.querySelectorAll(".newspack__subscription-tiers__form");n.length&&[...n].forEach(e=>{const n=e.closest(".newspack-ui__modal-container"),r=e.querySelector('button[type="submit"]'),a=e.querySelector(".newspack-ui__modal__cancel"),i=e.classList.contains("nyp"),s=r.textContent;let c=!1;const l=()=>{e.querySelectorAll('input[type="radio"], input[type="number"], select').forEach(e=>{e.addEventListener("input",u),e.addEventListener("change",u)}),u()},u=()=>{if(i){const t=e.querySelector("#nyp_amount");if(t?.value){const e=parseFloat(t.value).toLocaleString(document.documentElement.lang,{style:"currency",currency:t.dataset.currency,currencyDisplay:"narrowSymbol"});r.textContent=s+": "+e+" / "+t.dataset.frequency}else r.textContent=s}if(i){const t=e.querySelector("#nyp_amount.current");!t||t.value&&t.value!==t.dataset.originalValue?(e.querySelector('button[type="submit"]').disabled=!1,c=!0):(e.querySelector('button[type="submit"]').disabled=!0,c=!1)}else e.querySelector('.current input[type="radio"]:checked')?(e.querySelector('button[type="submit"]').disabled=!0,c=!1):(e.querySelector('button[type="submit"]').disabled=!1,c=!0)},p=e.querySelector(".newspack-ui__segmented-control");p&&p.addEventListener("content-selected",l),l(),u(),n?a.addEventListener("click",()=>{n?.setAttribute("data-state","closed")}):a.style.display="none",e.addEventListener("submit",t=>{if(!c)return void t.preventDefault();if(n?.classList.contains("newspack-blocks__modal-variation"))return;if(!window.newspackOpenModalCheckout)return;t.preventDefault();let r=!1;const a=new FormData(e);n?.setAttribute("data-state","closed");const i=new URL(e.action);for(const e of a.entries())i.searchParams.append(e[0],e[1]);window.newspackOpenModalCheckout({url:i.toString(),title:e.dataset.title,onCheckoutComplete:()=>{r=!0},onClose:()=>function(e){e&&(0,o.q9)()}(r)})});const d=e.querySelector(".signin-link");d&&d.addEventListener("click",r=>{r.preventDefault(),n&&n.setAttribute("data-state","closed"),window.newspackRAS.push(r=>{r.openAuthModal({skipSuccess:!0,skipNewslettersSignup:!0,onSuccess:()=>{const n=new URLSearchParams(window.location.search);n.set("tiers-modal",e.dataset.productId||""),t&&n.set("switch","1"),window.location.href=window.location.pathname+"?"+n.toString()},onDismiss:()=>{n&&n.setAttribute("data-state","open")}})})})})})}window.newspackRAS=window.newspackRAS||[]},5556:(e,t,n)=>{e.exports=n(2694)()},5580:(e,t,n)=>{var r=n(6110)(n(9325),"DataView");e.exports=r},5724:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(5573),o=n(790);const a=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"})}),i=/^(2617|7604|9406)$/.test(n.j)?a:null},5749:(e,t,n)=>{var r=n(1042);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},5795:(e,t,n)=>{"use strict";var r=n(6549);if(r)try{r([],"length")}catch(e){r=null}e.exports=r},5861:(e,t,n)=>{var r=n(5580),o=n(8223),a=n(2804),i=n(6545),s=n(8303),c=n(2552),l=n(7473),u="[object Map]",p="[object Promise]",d="[object Set]",f="[object WeakMap]",h="[object DataView]",g=l(r),m=l(o),v=l(a),y=l(i),w=l(s),_=c;(r&&_(new r(new ArrayBuffer(1)))!=h||o&&_(new o)!=u||a&&_(a.resolve())!=p||i&&_(new i)!=d||s&&_(new s)!=f)&&(_=function(e){var t=c(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case g:return h;case m:return u;case v:return p;case y:return d;case w:return f}return t}),e.exports=_},5880:(e,t,n)=>{var r=n(514),o=n(5950);e.exports=function(e){return null==e?[]:r(e,o(e))}},5911:(e,t,n)=>{var r=n(8859),o=n(4248),a=n(9219);e.exports=function(e,t,n,i,s,c){var l=1&n,u=e.length,p=t.length;if(u!=p&&!(l&&p>u))return!1;var d=c.get(e),f=c.get(t);if(d&&f)return d==t&&f==e;var h=-1,g=!0,m=2&n?new r:void 0;for(c.set(e,t),c.set(t,e);++h{"use strict";n.d(t,{Lz:()=>s.A,wg:()=>c.A,fF:()=>y,IW:()=>g,Ex:()=>w,Kk:()=>A,$n:()=>_.A,dr:()=>j,Zp:()=>T,y2:()=>M,t9:()=>I,vn:()=>V,sk:()=>Te,Jv:()=>Ie,cG:()=>Re,wi:()=>Fe,Q5:()=>$e,Du:()=>Ye,xA:()=>Xe,Pj:()=>Be,uC:()=>qe,BR:()=>Qe,H7:()=>Ze,aF:()=>tt,qV:()=>rt,$T:()=>ct,I2:()=>ut,x5:()=>mt,g:()=>yt,AM:()=>_t,z2:()=>xt,bh:()=>jt,Ix:()=>ve.A,X3:()=>At,Yq:()=>Lt,wB:()=>Tt,_y:()=>It,Fx:()=>Dt,mi:()=>Ft,pe:()=>Ut,xt:()=>qt,E$:()=>Gt,LQ:()=>tn,sQ:()=>nn.A,JL:()=>Pe,G_:()=>Ee,Wp:()=>Ne,Aq:()=>sn,c_:()=>gn});var r=n(6087),o=n(6942),a=n.n(o),i=n(790),s=n(7093),c=n(7958),l=n(1455),u=n.n(l),p=n(6427),d=n(8537),f=n(7723),h=n(3832);const g=/^(2001|9406)$/.test(n.j)?({fetchSavedPosts:e=!1,fetchSuggestions:t=!1,help:n=(0,f.__)("Begin typing search term, click autocomplete result to select.","newspack-plugin"),hideHelp:o=!1,label:a=(0,f.__)("Search","newspack-plugin"),maxItemsToSuggest:s=0,multiSelect:l=!1,onChange:g=!1,onPostTypeChange:m=!1,postTypes:v=[{slug:"post",label:"Post"}],postTypeLabel:y=(0,f.__)("item","newspack-plugin"),postTypeLabelPlural:w=(0,f.__)("items","newspack-plugin"),selectedItems:_=[],selectedPost:b=0,suggestionsToFetch:x=10})=>{const[k,j]=(0,r.useState)(!0),[S,A]=(0,r.useState)(!1),[C,E]=(0,r.useState)([]),[P,O]=(0,r.useState)(0),[N,L]=(0,r.useState)(v[0].slug),T=["newspack-autocomplete-with-suggestions"];o&&T.push("hide-help"),(0,r.useEffect)(()=>{m&&m(N),j(!0),I(null,0,N).then(e=>{0j(!1))},[N]),(0,r.useEffect)(()=>{S&&I(null,C.length,N).then(e=>{0A(!1))},[S]);const M=e||(async(e=[],t=null)=>{const n=t||N,r="post"===n||"page"===n?n+"s":n;return(await u()({path:(0,h.addQueryArgs)("/wp/v2/"+r,{per_page:100,include:e.join(","),_fields:"id,title"})})).map(e=>({value:parseInt(e.id),label:(0,d.decodeEntities)(e.title)||(0,f.__)("(no title)","newspack-plugin")}))}),I=t||(async(e=null,t=0,n=null)=>{const r=n||N,o="post"===r||"page"===r?r+"s":r,a=await u()({parse:!1,path:(0,h.addQueryArgs)("/wp/v2/"+o,{search:e,offset:t,per_page:x,_fields:"id,title"})}),i=parseInt(a.headers.get("x-wp-total")||0),s=await a.json();return O(i),s.reduce((e,t)=>(e.push({value:parseInt(t.id),label:(0,d.decodeEntities)(t?.title.rendered)||(0,f.__)("(no title)","newspack-plugin")}),e),[])}),R=e=>{if(!l)return g(e);const t=b?[..._,b]:[..._];e.forEach(e=>{const n=t.findIndex(t=>parseInt(t.value)===parseInt(e.value));-1({...e,postType:N})))},D=e=>{if(l){const t=!!(b?[..._,b]:[..._]).find(t=>parseInt(t.value)===parseInt(e.value)&&t.label===e.label);return(0,i.jsx)(p.CheckboxControl,{checked:t,onChange:()=>R([e]),label:e.label},e.value)}return(0,i.jsx)(p.Button,{isLink:!0,onClick:()=>R([e]),children:e.label},e.value)};return(0,i.jsxs)("div",{className:T.join(" "),children:[0<_.length&&(()=>{const e=b?[..._,b]:_,t=l?(0,f.sprintf)( // Translators: %1: the length of selections. %2: the selection leabel. // Translators: %1: the length of selections. %2: the selection leabel. (0,f.__)("%1$s %2$s selected","newspack-plugin"),e.length,e.length>1?w:y):(0,f.sprintf)( // Translators: %s: The label for the selection. // Translators: %s: The label for the selection. (0,f.__)("Selected %s","newspack-plugin"),y);return(0,i.jsxs)("div",{className:"newspack-autocomplete-with-suggestions__selected-items",children:[(0,i.jsxs)("p",{className:"newspack-autocomplete-with-suggestions__label",children:[t,1g([]),isLink:!0,isDestructive:!0,children:(0,f.__)("Clear all","newspack-plugin")})]}),e.map(t=>(0,i.jsx)(p.Button,{className:"newspack-autocomplete-with-suggestions__selected-item-button",isTertiary:!0,onClick:()=>g(e.filter(e=>e.value!==t.value)),children:t.label},t.value))]})})(),1({label:e.label,value:e.slug})),onChange:e=>L(e)}),(0,i.jsx)(c.A,{tokens:[],onChange:R,fetchSuggestions:async e=>I(e,0,N),fetchSavedInfo:e=>M(e),label:a,loading:k,help:!o&&n,returnFullObjects:!0}),(()=>{if(0===C.length)return null;const e=l?"newspack-autocomplete-with-suggestions__search-suggestions-multiselect":"newspack-autocomplete-with-suggestions__search-suggestions";return(0,i.jsxs)(i.Fragment,{children:[!o&&(0,i.jsx)("p",{className:"newspack-autocomplete-with-suggestions__label",children:/* Translators: %s: the name of a post type. */ /* Translators: %s: the name of a post type. */(0,f.sprintf)((0,f.__)("Or, select a recent %s:","newspack-plugin"),y)}),(0,i.jsxs)("div",{className:e,children:[C.map(D),C.length<(s||P)&&(0,i.jsx)(p.Button,{disabled:S,isSecondary:!0,onClick:()=>A(!0),children:S?(0,f.__)("Loading…","newspack-plugin"):(0,f.__)("Load more","newspack-plugin")})]})]})})()]})}:null;var m=n(8221),v=n.n(m);const y=9406==n.j?({fetchSuggestions:e=!1,help:t=(0,f.__)("Begin typing search term, click autocomplete result to select.","newspack-plugin"),hideHelp:n=!0,hideFormTokenHelp:o=!0,label:a=(0,f.__)("Search","newspack-plugin"),maxItemsToSuggest:s=0,multiSelect:c=!1,onChange:l=!1,selectedItems:g=[],suggestionsToFetch:m=20})=>{const[y,w]=(0,r.useState)(!0),[_,b]=(0,r.useState)(!1),[x,k]=(0,r.useState)([]),[j,S]=(0,r.useState)(0),[A,C]=(0,r.useState)([]),[E,P]=(0,r.useState)({}),[O,N]=(0,r.useState)(!1),L="post",T=["newspack-autocomplete-with-latest-posts"];o&&T.push("hide-form-token-help"),n&&T.push("hide-help");const M=v()(e=>{if(!e||e.length<2)return C([]),void N(!1);N(!0),I(e,0,L).then(e=>{C(e);const t={...E};e.forEach(e=>{t[e.value]=e.label}),P(t)}).finally(()=>N(!1))},500);(0,r.useEffect)(()=>{w(!0),I(null,0,L).then(e=>{if(0{t[e.value]=e.label}),P(t)}}).finally(()=>w(!1))},[]),(0,r.useEffect)(()=>{_&&I(null,x.length,L).then(e=>{0b(!1))},[_]);const I=e||(async(e=null,t=0,n=null)=>{const r=n||L,o="post"===r||"page"===r?r+"s":r,a=await u()({parse:!1,path:(0,h.addQueryArgs)("/wp/v2/"+o,{search:e,offset:t,per_page:m,_fields:"id,title"})}),i=parseInt(a.headers.get("x-wp-total")||0),s=await a.json();return S(i),s.reduce((e,t)=>(e.push({value:parseInt(t.id),label:(0,d.decodeEntities)(t?.title.rendered)||(0,f.__)("(no title)","newspack-plugin")}),e),[])}),R=e=>{const t=e.reduce((e,t)=>(Object.keys(E).forEach(n=>{if(E[n]===t){const r=isNaN(parseInt(n))?n.toString():parseInt(n);e.push({value:r,label:t})}}),e),[]);if(!c){const e=t[t.length-1];return l(e?[{...e,postType:L}]:[])}l(t.map(e=>({...e,postType:L})))},D=()=>g.reduce((e,t)=>t?t.label?[...e,t.label]:E[t]?[...e,E[t]]:e:e,[]),$=e=>{if(c){const t=!!g.find(t=>parseInt(t.value)===parseInt(e.value)&&t.label===e.label);return(0,i.jsx)(p.CheckboxControl,{checked:t,onChange:()=>{const n=D(),r=e.label;if(t){const e=n.filter(e=>e!==r);R(e)}else R([...n,r])},label:e.label},e.value)}return(0,i.jsx)(p.Button,{isLink:!0,onClick:()=>R([...D(),e.label]),children:e.label},e.value)};return(0,i.jsxs)("div",{className:T.join(" "),children:[(0,i.jsxs)("div",{className:"newspack-autocomplete-with-latest-posts__input-container",children:[(0,i.jsx)(p.FormTokenField,{value:D(),suggestions:A.map(e=>e.label),onChange:R,onInputChange:M,label:a,help:!n&&t,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(y||O)&&(0,i.jsx)(p.Spinner,{})]}),(()=>{if(0===x.length)return null;const e=c?"newspack-autocomplete-with-latest-posts__search-suggestions-multiselect":"newspack-autocomplete-with-latest-posts__search-suggestions";return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:"newspack-autocomplete-with-latest-posts__search-suggestions-container",children:[(0,i.jsx)("p",{className:"newspack-autocomplete-with-suggestions__label",children:(0,f.__)("Latest Posts","newspack-plugin")}),(0,i.jsxs)("div",{className:e,children:[x.map($),x.length<(s||j)&&(0,i.jsx)(p.Button,{disabled:_,isSecondary:!0,onClick:()=>b(!0),children:_?(0,f.__)("Loading…","newspack-plugin"):(0,f.__)("Load more","newspack-plugin")})]})]})})})()]})}:null,w=({text:e,level:t="default"})=>{const n=a()("newspack-badge",`is-${t}`);return(0,i.jsx)("span",{className:n,children:e})};var _=n(6732);if(/^(2001|6930|828|9406)$/.test(n.j))var b=n(7677);if(/^(2001|6930|828|9406)$/.test(n.j))var x=n(6655);class k extends(/^(2001|6930|828|9406)$/.test(n.j)?r.Component:null){render(){const{chevron:e,className:t,desc:n,grouped:r,icon:o,isDestructive:s,isPressed:c,isSmall:l,title:u,...p}=this.props,d=a()("newspack-button-card",t,e&&"has-chevron",r&&"grouped",o&&"has-icon",s&&"is-destructive",c&&"is-pressed",l&&"is-small");return(0,i.jsxs)("a",{className:d,...p,children:[o&&(0,i.jsx)(b.A,{icon:o,height:48,width:48}),(0,i.jsxs)(Xe,{noMargin:!0,columns:1,gutter:8,children:[u&&(0,i.jsx)("h3",{children:u}),n&&(0,i.jsx)("p",{children:n})]}),e&&(0,i.jsx)(b.A,{icon:x.A,height:24,width:24})]})}}const j=/^(2001|6930|828|9406)$/.test(n.j)?k:null;if(/^(2001|9406)$/.test(n.j))var S=n(7022);const A=/^(2001|9406)$/.test(n.j)?({hexColor:e,isInverted:t=!1,children:n,...r})=>{let o;o="#f0f0f0"===e?"#1e1e1e":(0,S.b)(e);const a=t?{color:e,backgoundColor:o}:{backgroundColor:e,color:o};return(0,i.jsx)("div",{...r,style:a,children:n})}:null;/^(2001|6930|828|9406)$/.test(n.j)||(b=n(7677));var C=n(3784),E=n(3756),P=n(2485);/^(2001|6930|828|9406)$/.test(n.j)||(x=n(6655));var O=n(8169);const N=({actions:e,actionType:t,as:n,buttonsCard:r,className:o,footer:s,header:c,headerStyle:l,childrenStyle:u,footerStyle:d,icon:h,iconBackgroundColor:g,isActive:m,isDraggable:v,isFirstTarget:y,isLastTarget:w,isNarrow:_,isSmall:k,dragIndex:j,onDragCallback:S=()=>{},onHeaderClick:A,noBorder:N,noMargin:L,children:T=null,...M})=>{const I=a()("newspack-card--core",o,(r||"a"===n)&&"newspack-card--core__buttons-card",v&&"newspack-card--core__is-draggable",_&&"newspack-card--core__is-narrow",k&&"newspack-card--core__is-small",h&&"newspack-card--core__has-icon",g&&"newspack-card--core__has-icon-background-color",m&&"newspack-card--core__is-active",T&&"newspack-card--core__has-children",L&&"newspack-card--core__no-margin");let R=k?"small":M.size;return(r||"a"===n)&&(k||(R="large"),"a"!==n&&(M.as="a")),N&&(M.isBorderless=!0),(0,i.jsxs)(p.Card,{as:n,className:I,...M,children:[(c||h)&&(0,i.jsxs)(p.CardHeader,{as:A?"button":void 0,className:a()("newspack-card--core__header",v&&"newspack-card--core__header--is-draggable"),style:l,size:R,onClick:A,children:[v&&(0,i.jsxs)("div",{className:"newspack-card--core__header__draggable-controls",children:[(0,i.jsx)("div",{className:"newspack-card--core__header__draggable-controls__drag-handle",children:(0,i.jsx)(b.A,{icon:C.A})}),(0,i.jsxs)("div",{className:"newspack-card--core__header__draggable-controls__move-buttons",children:[(0,i.jsx)(p.Button,{icon:E.A,onClick:()=>S(j,j-1),disabled:y,label:(0,f.__)("Move one position up","newspack-plugin"),size:"small"}),(0,i.jsx)(p.Button,{icon:P.A,onClick:()=>S(j,j+1),disabled:w,label:(0,f.__)("Move one position down","newspack-plugin"),size:"small"})]})]}),h&&(0,i.jsx)("div",{className:"newspack-card--core__icon",children:(0,i.jsx)(b.A,{icon:h,height:k?24:48,width:k?24:48})}),c&&(0,i.jsx)("div",{className:"newspack-card--core__header-content",children:c}),!e?.length>0&&"chevron"===t&&(0,i.jsx)(b.A,{className:"newspack-card--core__action",icon:x.A,height:24,width:24}),!e?.length>0&&"toggle"===t&&(0,i.jsx)(p.ToggleControl,{className:"newspack-card--core__action",label:M.title,hideLabelFromVision:!0,checked:m,onChange:()=>{}}),e?.length>0&&(0,i.jsx)(p.DropdownMenu,{icon:O.A,label:(0,f.__)("More","newspack-plugin"),children:()=>e.map((e,t)=>(0,i.jsx)(p.MenuItem,{icon:e.icon,onClick:e.action,disabled:e.disabled||!1,isDestructive:e.destructive||!1,children:e.label},t))})]}),T&&(0,i.jsx)("div",{className:"newspack-card--core__body",style:u,children:T}),s&&(0,i.jsx)(p.CardFooter,{size:R,style:d,children:s})]})};class L extends r.Component{render(){const{buttonsCard:e,className:t,headerActions:n,isNarrow:r,isMedium:o,isSmall:s,isWhite:c,noBorder:l,__experimentalCoreCard:u,__experimentalCoreProps:p={actionType:null,header:null,icon:null,footer:null,noMargin:!1,isDraggable:!1,dragIndex:null,onDragCallback:()=>{}},...d}=this.props;if(u){const n={buttonsCard:e,className:t,isMedium:o,isNarrow:r,isSmall:s,isWhite:c,noBorder:l,...d,...p};return(0,i.jsx)(N,{...n})}const f=a()("newspack-card",t,e&&"newspack-card__buttons-card",n&&"newspack-card__header-actions",o&&"newspack-card__is-medium",r&&"newspack-card__is-narrow",s&&"newspack-card__is-small",c&&"newspack-card__is-white",l&&"newspack-card__no-border");return(0,i.jsx)("div",{className:f,...d})}}const T=L,M=/^(2001|9406)$/.test(n.j)?({actionType:e="chevron",children:t,icon:n=null,title:r="",description:o="",isActive:a=!1,onEnable:s=()=>{}})=>(0,i.jsx)(T,{className:"newspack-card--core--settings-group",actionType:e,isSmall:!0,__experimentalCoreCard:!0,__experimentalCoreProps:{header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h3",{children:r}),o&&(0,i.jsx)("p",{children:o})]}),onHeaderClick:s,icon:n,iconBackgroundColor:!0,isActive:a,title:r},children:a&&t}):null,I=2001==n.j?({disabled:e=!1,items:t=[],onDragCallback:n=()=>{}})=>{const[o,s]=(0,r.useState)(t),[c,l]=(0,r.useState)(null),[u,d]=(0,r.useState)(null),[f,h]=(0,r.useState)(null),[g,m]=(0,r.useState)(null),v=(0,r.useRef)(null),y=(0,r.useRef)([]),_=(0,r.useRef)(null),b=(0,r.useRef)(null),x=(0,r.useRef)(null),[k,j]=(0,r.useState)(0),S=(0,r.useRef)(null);(0,r.useEffect)(()=>{s(t)},[t]),(0,r.useEffect)(()=>()=>{_.current&&clearTimeout(_.current),b.current&&clearTimeout(b.current),S.current&&document.removeEventListener("dragover",S.current)},[]);const A=(e,t)=>{if(t<0||t>=o.length)return;const n=y.current[e],r=y.current[t];if(!n||!r)return;const a=Math.abs(r.getBoundingClientRect().top-n.getBoundingClientRect().top),i=t>e?1:-1;x.current={fromIndex:e,toIndex:t,stride:a,direction:i};const c=[...o],[l]=c.splice(e,1);c.splice(t,0,l),s(c),j(e=>e+1)};(0,r.useLayoutEffect)(()=>{const e=x.current;if(!e)return;x.current=null;const{fromIndex:t,toIndex:r,stride:o,direction:a}=e,i=(e,t)=>{e&&(e.style.transition="none",e.style.transform=`translateY(${t}px)`,e.getBoundingClientRect(),e.style.transition="transform 200ms ease-out",e.style.transform="")};i(y.current[r],-a*o),i(y.current[t],a*o),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{[t,r].forEach(e=>{const t=y.current[e];t&&(t.style.transition="",t.style.transform="")});const e=y.current[r];if(e){const t=e.querySelectorAll(".newspack-card--core__header__draggable-controls__move-buttons button"),n=a>0?t[1]:t[0],r=a>0?t[0]:t[1];n&&!n.disabled?n.focus():r&&!r.disabled&&r.focus()}n(t,r),b.current=null},200)},[k]);const C=e=>{const t=g,r=c;if(S.current&&(document.removeEventListener("dragover",S.current),S.current=null),l(null),d(null),m(null),null===t||null===r)return;const a=((e,t,n)=>{const{itemTops:r,itemStrides:o,sourceHeight:a}=t;for(let t=0;tt;if(er?a-1:a;if(i===r)return;const u=[...o],[p]=u.splice(r,1);u.splice(i,0,p),s(u),requestAnimationFrame(()=>{h(i),_.current=setTimeout(()=>{h(null),n(r,i)},400)})},E=null!==c;return(0,i.jsx)(p.__experimentalVStack,{ref:v,className:a()("newspack-card--core--sortable-list",e&&"newspack-card--core--sortable-list__is-disabled",E&&"newspack-card--core--sortable-list__is-dragging"),style:g?{height:g.lockedHeight}:void 0,spacing:4,children:o.map((t,n)=>{const r=(e=>{var t;if(null===c||null===u||!g)return 0;if(e===c)return 0;const{itemStrides:n,sourceHeight:r}=g,o=null!==(t=n[c])&&void 0!==t?t:r;if(u>c){if(e>c&&e=u&&e{y.current[n]=e},className:a()("newspack-card--core--sortable-list__item",{"is-source":c===n,"is-dropped":f===n}),style:r?{transform:`translateY(${r}px)`}:{transition:E?void 0:"none"},id:`draggable-card-${n}`,onDragOver:e=>((e,t)=>{if(e.preventDefault(),!g)return;const n=e.currentTarget.getBoundingClientRect(),r=n.top+n.height/2;d(e.clientY(e=>{b.current&&(clearTimeout(b.current),b.current=null,y.current.forEach(e=>{e&&(e.style.transition="",e.style.transform="")}));const t=v.current;if(t){var n;const r=y.current.map(e=>e?.getBoundingClientRect()),o=r.map((e,t)=>{if(!e)return 0;const n=r[t+1];return n?n.top-e.top:e.height});m({lockedHeight:t.getBoundingClientRect().height,sourceHeight:null!==(n=r[e]?.height)&&void 0!==n?n:0,itemStrides:o,itemTops:r.map(e=>{var t;return null!==(t=e?.top)&&void 0!==t?t:0})})}const r=e=>e.preventDefault();document.addEventListener("dragover",r),S.current=r,l(e),h(null)})(n),onDragEnd:C,appendToOwnerDocument:!0,children:({onDraggableStart:e,onDraggableEnd:r})=>(0,i.jsx)(T,{isSmall:!0,draggable:!0,onDragStart:e,onDragEnd:r,__experimentalCoreCard:!0,__experimentalCoreProps:{header:(0,i.jsxs)("h3",{children:[t.title,(0,i.jsx)(w,{level:t.badgeLevel,text:t.badgeText})]}),isDraggable:!0,isFirstTarget:0===n,isLastTarget:n===o.length-1,dragIndex:n,onDragCallback:A}})})})},t.id)})})}:null;var R=n(7309),D=n.n(R),$=n(7612),F=n.n($);class z extends r.Component{state={suggestions:{},allCategories:{},isLoading:!1};constructor(e){super(e),this.debouncedUpdateSuggestions=v()(this.updateSuggestions,100)}componentDidMount(){this.setState({isLoading:!0}),u()({path:(0,h.addQueryArgs)(`/wp/v2/${this.props.taxonomy}`,{per_page:-1,_fields:"id,name"})}).then(e=>this.setState({allCategories:e})).finally(()=>this.setState({isLoading:!1}))}componentWillUnmount(){this.debouncedUpdateSuggestions.cancel()}updateSuggestions(e){this.setState({isLoading:!0}),u()({path:(0,h.addQueryArgs)(`/wp/v2/${this.props.taxonomy}`,{search:e,per_page:20,_fields:"id,name",orderby:"count",order:"desc"})}).then(e=>{this.setState({suggestions:e.reduce((e,t)=>({...e,[t.name]:t}),{})})}).finally(()=>this.setState({isLoading:!1}))}handleOnChange=e=>{const{onChange:t}=this.props,{suggestions:n}=this.state;t(e.filter(e=>void 0!==e).map(e=>"string"==typeof e?n[e]:e).filter(Boolean))};getAvailableSuggestions=()=>{const{value:e}=this.props,{suggestions:t}=this.state,n=e.reduce((e,t)=>(t?.id&&e.push(t.id),e),[]);return F()(t,({id:e})=>-1===n.indexOf(e)).map(e=>e.name)};render(){const{className:e,disabled:t,description:n,hideHelpFromVision:r,hideLabelFromVision:o,label:s,value:c}=this.props,{allCategories:l,isLoading:u}=this.state,d=a()("newspack-category-autocomplete",e);return(0,i.jsxs)("div",{className:d,children:[(0,i.jsx)($e,{onInputChange:e=>this.debouncedUpdateSuggestions(e),value:c.reduce((e,t)=>{const n="number"==typeof t?D()(l,["id",t]):t;return n&&e.push({id:n.term_id||n.id,value:n.value||n.name}),e},[]),suggestions:this.getAvailableSuggestions(),onChange:this.handleOnChange,label:s,disabled:t,description:n,hideHelpFromVision:r,hideLabelFromVision:o}),u?(0,i.jsx)("span",{className:"newspack-category-autocomplete__suggestions-spinner",children:(0,i.jsx)(p.Spinner,{})}):null]})}}z.defaultProps={taxonomy:"categories"};const V=/^(2001|828)$/.test(n.j)?z:null;var H={grad:.9,turn:360,rad:360/(2*Math.PI)},B=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},U=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},q=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},W=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},G=function(e){return{r:q(e.r,0,255),g:q(e.g,0,255),b:q(e.b,0,255),a:q(e.a)}},Z=function(e){return{r:U(e.r),g:U(e.g),b:U(e.b),a:U(e.a,3)}},K=/^#([0-9a-f]{3,8})$/i,Q=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},J=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=Math.max(t,n,r),i=a-Math.min(t,n,r),s=i?a===t?(n-r)/i:a===n?2+(r-t)/i:4+(t-n)/i:0;return{h:60*(s<0?s+6:s),s:a?i/a*100:0,v:a/255*100,a:o}},Y=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),i=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6;return{r:255*[r,s,i,i,c,r][l],g:255*[c,r,r,s,i,i][l],b:255*[i,i,c,r,r,s][l],a:o}},X=function(e){return{h:W(e.h),s:q(e.s,0,100),l:q(e.l,0,100),a:q(e.a)}},ee=function(e){return{h:U(e.h),s:U(e.s),l:U(e.l),a:U(e.a,3)}},te=function(e){return Y((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},ne=function(e){return{h:(t=J(e)).h,s:(o=(200-(n=t.s))*(r=t.v)/100)>0&&o<200?n*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,n,r,o},re=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,oe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ae=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ie=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,se={string:[[function(e){var t=K.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?U(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?U(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=ae.exec(e)||ie.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:G({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=re.exec(e)||oe.exec(e);if(!t)return null;var n,r,o=X({h:(n=t[1],r=t[2],void 0===r&&(r="deg"),Number(n)*(H[r]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return te(o)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=void 0===o?1:o;return B(t)&&B(n)&&B(r)?G({r:Number(t),g:Number(n),b:Number(r),a:Number(a)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,o=e.a,a=void 0===o?1:o;if(!B(t)||!B(n)||!B(r))return null;var i=X({h:Number(t),s:Number(n),l:Number(r),a:Number(a)});return te(i)},"hsl"],[function(e){var t=e.h,n=e.s,r=e.v,o=e.a,a=void 0===o?1:o;if(!B(t)||!B(n)||!B(r))return null;var i=function(e){return{h:W(e.h),s:q(e.s,0,100),v:q(e.v,0,100),a:q(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(a)});return Y(i)},"hsv"]]},ce=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=Z(this.rgba)).r,n=e.g,r=e.b,a=(o=e.a)<1?Q(U(255*o)):"","#"+Q(t)+Q(n)+Q(r)+a;var e,t,n,r,o,a},e.prototype.toRgb=function(){return Z(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Z(this.rgba)).r,n=e.g,r=e.b,(o=e.a)<1?"rgba("+t+", "+n+", "+r+", "+o+")":"rgb("+t+", "+n+", "+r+")";var e,t,n,r,o},e.prototype.toHsl=function(){return ee(ne(this.rgba))},e.prototype.toHslString=function(){return t=(e=ee(ne(this.rgba))).h,n=e.s,r=e.l,(o=e.a)<1?"hsla("+t+", "+n+"%, "+r+"%, "+o+")":"hsl("+t+", "+n+"%, "+r+"%)";var e,t,n,r,o},e.prototype.toHsv=function(){return e=J(this.rgba),{h:U(e.h),s:U(e.s),v:U(e.v),a:U(e.a,3)};var e},e.prototype.invert=function(){return fe({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),fe(le(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),fe(le(this.rgba,-e))},e.prototype.grayscale=function(){return fe(le(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),fe(pe(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),fe(pe(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?fe({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):U(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=ne(this.rgba);return"number"==typeof e?fe({h:e,s:t.s,l:t.l,a:t.a}):U(t.h)},e.prototype.isEqual=function(e){return this.toHex()===fe(e).toHex()},e}(),fe=function(e){return e instanceof de?e:new de(e)},he=[],ge=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},me=function(e){return.2126*ge(e.r)+.7152*ge(e.g)+.0722*ge(e.b)},ve=n(2247);const{useHistory:ye}=ve.A;var we=n(6449),_e=n.n(we),be=n(6924),xe=n.n(be);const ke=(e,t)=>{if(_e()(e))return t},{useHistory:je}=ve.A,Se={small:"newspack-modal--size-small",medium:"newspack-modal--size-medium",large:"newspack-modal--size-large","x-large":"newspack-modal--size-x-large",full:"newspack-modal--size-full"},Ae=()=>{},Ce=(0,r.forwardRef)(function({className:e,size:t="small",hideTitle:n,isDestructive:o,onConfirm:s=Ae,onCancel:c=Ae,when:l=!1,isOpen:u=!1,...d},f){const[h,g]=(0,r.useState)(u),m=je(),v=(0,r.useRef)(null),y=(0,r.useCallback)(()=>{g(!1),v.current?.(),v.current=null,s()},[s,v]),w=(0,r.useCallback)(()=>{g(!1),v.current=null,c()},[c,v]);if((0,r.useEffect)(()=>{if(!l)return;const e=m.block((t,n)=>(v.current=()=>{e(),"REPLACE"===n?m.replace(t):m.push(t)},g(!0),!1));return e},[l,m]),(0,r.useEffect)(()=>{u&&g(!0)},[u]),!h)return null;const _=a()("newspack-modal",Se[t],n&&"newspack-modal--hide-title",o&&"newspack-modal--destructive",e);return(0,i.jsx)(p.__experimentalConfirmDialog,{className:_,...d,ref:f,onConfirm:y,onCancel:w,__experimentalHideHeader:!1})}),Ee=function(e){const{message:t,when:n,...o}=e,[a,s]=(0,r.useState)(null),c=(0,r.useRef)(n);c.current=n;const l=(0,r.useCallback)(e=>{!1!==c.current?s(()=>e):e()},[]);return{confirmDialog:(0,i.jsx)(Ce,{...o,when:n,isOpen:!!a,onConfirm:()=>{a?.(),s(null)},onCancel:()=>s(null),children:t}),requestConfirm:l}},Pe={usePrompt:(e,t)=>{const n=ye(),o=(0,r.useRef)(null),a=n=>{if(e)return void 0===n&&(n=window.event),t};return(0,r.useEffect)(()=>(e&&(o.current=n.block(t),window.addEventListener("beforeunload",a)),()=>{o.current&&o.current(),window.removeEventListener("beforeunload",a)}),[t,e]),o.current||(()=>{})},useObjectState:(e={})=>{const[t,n]=(0,r.useState)(e),o=e=>n(t=>xe()({},t,e,ke));return[t,e=>{if("string"==typeof e)return t=>o({[e]:t});o(e)}]},useOnClickOutside:(e,t)=>{(0,r.useEffect)(()=>{const n=n=>{e.current&&!e.current.contains(n.target)&&t(n)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t])},useUniqueId:e=>(0,r.useRef)(`${e}-${Math.round(99999*Math.random())}`).current,useConfirmDialog:Ee};var Oe=n(8558);const Ne={InteractiveDiv:({style:e={},...t})=>(0,i.jsx)("div",{tabIndex:"0",role:"button",onKeyDown:e=>Oe.ENTER===e.keyCode&&t.onClick(),style:{cursor:"pointer",...e},...t}),confirmAction:e=>!!confirm(e)};!function(e){e.forEach(function(e){he.indexOf(e)<0&&(e(de,se),he.push(e))})}([function(e){e.prototype.luminance=function(){return e=me(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,r,o,a,i,s,c,l=t instanceof e?t:new e(t);return a=this.rgba,i=l.toRgb(),n=(s=me(a))>(c=me(i))?(s+.05)/(c+.05):(c+.05)/(s+.05),void 0===(r=2)&&(r=0),void 0===o&&(o=Math.pow(10,r)),Math.floor(o*n)/o+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(a=(n=t).size)?"normal":a,"AAA"===(o=void 0===(r=n.level)?"AA":r)&&"normal"===i?7:"AA"===o&&"large"===i?3:4.5);var n,r,o,a,i}}]);const{InteractiveDiv:Le}=Ne,Te=/^(2001|6930|9406)$/.test(n.j)?({label:e,color:t="#fff",onChange:n,className:o})=>{const[s,c]=(0,r.useState)(!1),l=(0,r.useRef)(),u=fe(t);return Pe.useOnClickOutside(l,()=>c(!1)),(0,i.jsxs)("div",{className:a()("newspack-color-picker",o),children:[(0,i.jsx)("div",{className:"newspack-color-picker__label",children:e}),(0,i.jsx)(Le,{className:"newspack-color-picker__expander",onClick:()=>c(!s),style:{backgroundColor:t,color:u.contrast()>u.contrast("#000")?"#fff":"#000"},children:t}),(0,i.jsx)("div",{className:"newspack-color-picker__main",ref:l,children:s&&(0,i.jsx)(p.ColorPicker,{color:t,onChange:e=>n(e),enableAlpha:!1})})]})}:null;class Me extends(2001==n.j?r.Component:null){render(){const{className:e,...t}=this.props,n=a()("newspack-custom-select-control",e);return(0,i.jsx)(p.CustomSelectControl,{className:n,...t})}}const Ie=2001==n.j?Me:null,Re=/^(2001|9406)$/.test(n.j)?({alignment:e="none",className:t,marginBottom:n=64,marginTop:r=64,variant:o="default",...s})=>{const c=a()("newspack-divider",t,e&&`newspack-divider--alignment-${e}`,o&&`newspack-divider--variant-${o}`),l={"--divider-margin-bottom":"number"==typeof n?`${n}px`:n,"--divider-margin-top":"number"==typeof r?`${r}px`:r};return(0,i.jsx)("hr",{className:c,style:l,...s})}:null;class De extends r.Component{render(){const{className:e,description:t,hideHelpFromVision:n,hideLabelFromVision:r,...o}=this.props,s=a()("newspack-form-token-field__input-container",e);return(0,i.jsxs)("div",{className:a()({"newspack-form-token-field--label-hidden":r,"newspack-form-token-field--help-hidden":n},"newspack-form-token-field"),children:[(0,i.jsx)(p.FormTokenField,{className:s,...o}),t&&(0,i.jsx)("p",{className:"newspack-form-token-field__help",children:t})]})}}const $e=De,Fe=({simple:e})=>{const{components_demo:t=!1,support:n=!1,setup_wizard:r=!1,reset_url:o=!1,plugin_version:a={label:"Newspack"},remove_starter_content:s=!1,support_email:c}=window.newspack_urls||{},l=[{label:a.label,url:"https://newspack.com/category/release-notes/",external:!0},{label:(0,f.__)("About","newspack-plugin"),url:"https://newspack.com/",external:!0},{label:(0,f.__)("Documentation","newspack-plugin"),url:n,external:!0}];return t&&l.push({label:(0,f.__)("Components Demo","newspack-plugin"),url:t}),r&&l.push({label:(0,f.__)("Setup Wizard","newspack-plugin"),url:r}),o&&l.push({label:(0,f.__)("Reset Newspack","newspack-plugin"),url:o}),s&&l.push({label:(0,f.__)("Remove Starter Content","newspack-plugin"),url:s}),c&&l.push({label:(0,f.__)("Contact Support","newspack-plugin"),url:`mailto:${c}`}),(0,i.jsx)("div",{className:"newspack-footer",children:!e&&(0,i.jsx)("ul",{children:l.map(({url:e,label:t,external:n},r)=>(0,i.jsx)("li",{children:n?(0,i.jsx)(p.ExternalLink,{href:e,children:t}):(0,i.jsx)("a",{href:e,children:t})},r))})})};var ze=n(6139),Ve=n.n(ze);class He extends r.Component{constructor(){super(...arguments),this.state={pluginInfo:[],showModal:!1}}componentDidMount=()=>{this._isMounted=!0;const{plugin:e}=this.props;this.retrievePluginInfo(e)};componentWillUnmount=()=>{this._isMounted=!1};retrievePluginInfo=e=>{const{onReady:t}=this.props;u()({path:"/newspack/v1/plugins/"+e}).then(e=>{this._isMounted&&(t(e),this.setState({pluginInfo:e}))})};textForPlugin=e=>{const t={modalBody:null,modalTitle:e.Name&&`${(0,f.__)("Manage","newspack-plugin")} ${e.Name}`,primaryButton:e.Name&&`${(0,f.__)("Manage","newspack-plugin")} ${e.Name}`,primaryModalButton:(0,f.__)("Manage","newspack-plugin"),dismissModalButton:(0,f.__)("Dismiss","newspack-plugin")};return Ve()(t,this.props)};goToPlugin=e=>{const{editLink:t,showOnBlockEditor:n}=this.props;u()({path:"/newspack/v1/plugins/"+e+"/handoff",method:"POST",data:{editLink:t,handoffReturnUrl:window&&window.location.href,showOnBlockEditor:!!n}}).then(e=>{window.location.href=e.HandoffLink})};render(){const{className:e,children:t,compact:n,useModal:o,modalTitle:s,modalBody:c,onReady:l,editLink:u,...p}=this.props,{pluginInfo:d,showModal:h}=this.state,{modalBody:g,modalTitle:m,primaryButton:v,primaryModalButton:y,dismissModalButton:w}=this.textForPlugin(d),{Configured:b,Name:x,Slug:k,Status:j}=d,S=a()(b&&"is-configured",e);return(0,i.jsxs)(r.Fragment,{children:[x&&"active"===j&&(0,i.jsx)(_.A,{className:S,isSecondary:!p.isPrimary&&!p.isTertiary&&!p.isLink,...p,onClick:()=>o?this.setState({showModal:!0}):this.goToPlugin(k),children:t||v}),x&&"active"!==j&&(0,i.jsx)(_.A,{className:S,variant:"secondary",disabled:!0,...p,children:x+(0,f.__)(" not installed","newspack-plugin")}),!x&&(0,i.jsx)(_.A,{className:S,isSecondary:!p.isPrimary&&!p.isTertiary&&!p.isLink,...p,children:(0,i.jsxs)(r.Fragment,{children:[!n&&(0,i.jsx)(Gt,{isLeft:!0}),(0,f.__)("Retrieving Plugin Info","newspack-plugin")]})}),h&&(0,i.jsxs)(tt,{title:m,onRequestClose:()=>this.setState({showModal:!1}),children:[(0,i.jsx)("p",{children:g}),(0,i.jsxs)(T,{buttonsCard:!0,noBorder:!0,className:"justify-end",children:[(0,i.jsx)(_.A,{variant:"secondary",onClick:()=>this.setState({showModal:!1}),children:w}),(0,i.jsx)(_.A,{variant:"primary",onClick:()=>this.goToPlugin(k),children:y})]})]})]})}}He.defaultProps={onReady:()=>{}};const Be=He;var Ue=n(1093);function qe(){const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{setTimeout(()=>{const e=JSON.parse(localStorage.getItem(Ue.J));t(!!e?.message&&e.message),e?.url&&-1===window.location.href.indexOf(e.url)&&(window.localStorage.removeItem(Ue.J),t(!1))},100)},[]),e?(0,i.jsx)(ct,{isHandoff:!0,isDismissible:!1,rawHTML:!0,noticeText:e}):null}var We=n(8851);class Ge extends r.Component{render(){const{className:e,...t}=this.props;return(0,i.jsx)(p.Tooltip,{...t,children:(0,i.jsx)("span",{className:a()("newspack-info-button",e),children:(0,i.jsx)(b.A,{icon:We.A})})})}}const Ze=Ge;class Ke extends r.Component{constructor(){super(...arguments),this.state={frame:!1}}openModal=()=>{this.state.frame?this.state.frame.open():this.setState({frame:wp.media({title:(0,f.__)("Select or upload image"),button:{text:(0,f.__)("Select")},library:{type:"image"},multiple:!1})},()=>{this.state.frame.on("select",this.handleImageSelect),this.state.frame.open()})};handleImageSelect=()=>{const{onChange:e}=this.props;e(this.state.frame.state().get("selection").first().toJSON())};render=()=>{const{buttonLabel:e,className:t,disabled:n,help:r,image:o,info:s,isCovering:c,label:l,onChange:u,style:p={}}=this.props,d=a()("newspack-image-upload__image",{"newspack-image-upload__image--has-image":o},{"newspack-image-upload__image--covering":c});return(0,i.jsxs)("div",{className:a()("newspack-image-upload",t),children:[(0,i.jsxs)("div",{className:"newspack-image-upload__header",children:[l&&(0,i.jsx)("label",{className:"newspack-image-upload__label",children:l}),s&&(0,i.jsx)(Ze,{text:s})]}),(0,i.jsx)("div",{className:d,style:{...p},children:o?.url?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("img",{"data-testid":"image-upload",src:o.url,alt:(0,f.__)("Image preview","newspack-plugin")}),(0,i.jsxs)("div",{className:"newspack-image-upload__controls",children:[(0,i.jsx)(_.A,{disabled:n,onClick:this.openModal,isLink:!0,children:(0,f.__)("Replace","newspack-plugin")}),(0,i.jsx)("span",{className:"sep"}),(0,i.jsx)(_.A,{disabled:n,onClick:()=>u(null),isLink:!0,isDestructive:!0,children:(0,f.__)("Remove","newspack-plugin")})]})]}):(0,i.jsx)(_.A,{disabled:n,onClick:this.openModal,isLink:!0,children:e||(0,f.__)("Upload","newspack-plugin")})}),r&&(0,i.jsx)("p",{className:"newspack-image-upload__help",children:r})]})}}const Qe=/^(2001|6930|9406)$/.test(n.j)?Ke:null;if(/^(2001|6930)$/.test(n.j))var Je=n(5373);const Ye=/^(2001|6930)$/.test(n.j)?()=>{const e=(0,Je.parse)(window.location.search)["newspack-notice"];return e?e.split(",").map((e,t)=>0===e.indexOf("_error_")?(0,i.jsx)(ct,{isError:!0,noticeText:e.replace("_error_",""),rawHTML:!0},t):(0,i.jsx)(ct,{isSuccess:!0,noticeText:e},t)):null}:null,Xe=({className:e="",borders:t=!1,columns:n=2,gutter:r=32,noMargin:o=!1,rowGap:s=0,...c})=>{const l=a()("newspack-grid",t&&"newspack-grid__borders",o&&"newspack-grid--no-margin",n&&"newspack-grid__columns-"+n,r&&"newspack-grid__gutter-"+r,s&&"newspack-grid__row-gap-"+s,e);return(0,i.jsx)("div",{className:l,...c})},et={small:"newspack-modal--size-small",medium:"newspack-modal--size-medium",large:"newspack-modal--size-large","x-large":"newspack-modal--size-x-large",full:"newspack-modal--size-full"},tt=(0,r.forwardRef)(function({className:e,size:t="medium",hideTitle:n,...r},o){const s=a()("newspack-modal",n&&"newspack-modal--hide-title",(e=>et[e]||et.medium)(t),e);return(0,i.jsx)(p.Modal,{className:s,...r,ref:o})});class nt extends r.Component{render(){const{className:e,simple:t,size:n,white:r}=this.props,o=a()("newspack-icon",t&&"newspack-icon--simple",r&&"newspack-icon--white",e);return(0,i.jsx)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",height:n,width:n,viewBox:"0 0 24 24",className:o,children:(0,i.jsx)(p.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M24 12C24 18.6271 18.6271 24 12 24C5.37213 24 0 18.6271 0 12C0 5.3729 5.3729 0 12 0C18.6271 0 24 5.3729 24 12ZM17.4545 17.4546L6.54545 6.54545V17.4545H8.72727V11.8182L14.3636 17.4546H17.4545ZM11.2727 8.18182H17.4545V6.54545H9.63636L11.2727 8.18182ZM17.4545 11.2727H14.3636L12.7273 9.63636H17.4545V11.2727ZM17.4545 12.7273V14.3636L15.8182 12.7273H17.4545Z"})})}}nt.defaultProps={size:32};const rt=nt;var ot=n(8176),at=n(8351),it=n(8349);class st extends r.Component{render(){const{className:e,debugMode:t,isError:n,isHandoff:o,isHelp:s,isSuccess:c,isWarning:l,noticeText:u,rawHTML:p,style:d={},children:f=null}=this.props,h=a()("newspack-notice",e,t&&"newspack-notice__is-debug",n&&"newspack-notice__is-error",o&&"newspack-notice__is-handoff",s&&"newspack-notice__is-help",c&&"newspack-notice__is-success",l&&"newspack-notice__is-warning");let g;return g=s?ot.A:c?at.A:t?it.A:We.A,(0,i.jsxs)("div",{className:h,style:d,children:[(0,i.jsx)(b.A,{icon:g}),(0,i.jsxs)("div",{className:"newspack-notice__content",children:[p?(0,i.jsx)(r.RawHTML,{children:u}):u,f||null]})]})}}const ct=st;class lt extends r.Component{constructor(){super(...arguments),this.state={pluginInfo:{},installationInitialized:!1}}componentDidMount=()=>{const{plugins:e}=this.props;this.retrievePluginInfo(e).then(()=>{this.props.autoInstall&&this.installAllPlugins()})};componentDidUpdate=e=>{const{autoInstall:t,plugins:n}=this.props,{installationInitialized:r}=this.state;n!==e.plugins&&this.retrievePluginInfo(n),t&&!r&&this.installAllPlugins()};retrievePluginInfo=e=>new Promise(t=>{u()({path:"/newspack/v1/plugins/"}).then(n=>{const r=Object.keys(n).reduce((t,r)=>(-1===e.indexOf(r)||(t[r]={...n[r],installationStatus:"active"===n[r].Status?1:0}),t),{});this.updatePluginInfo(r).then(()=>t())})});installAllPlugins=()=>{const{pluginInfo:e}=this.state;this.setState({installationInitialized:!0}),Object.keys(e).filter(t=>"active"!==e[t].Status).map(e=>()=>this.installPlugin(e)).reduce((e,t)=>e.then(e=>t().then(Array.prototype.concat.bind(e))),Promise.resolve([]))};installPlugin=e=>{this.setInstallationStatus(e,2);const t={path:`/newspack/v1/plugins/${e}/configure/`,method:"post"};return u()(t).then(t=>{const{pluginInfo:n}=this.state;this.props.onInstalled(e),this.updatePluginInfo({...n,[e]:{...t,installationStatus:1}})}).catch(t=>{this.setInstallationStatus(e,3,t.message)})};setChecked=(e,t)=>{const{pluginInfo:n}=this.state;this.updatePluginInfo({...n,[e]:{...n[e],checked:t}})};setInstallationStatus=(e,t,n=null)=>{const{pluginInfo:r}=this.state;this.updatePluginInfo({...r,[e]:{...r[e],installationStatus:t,notification:n}})};updatePluginInfo=e=>new Promise(t=>{const{onStatus:n}=this.props;this.setState({pluginInfo:e},()=>{const r=Object.values(e).every(e=>"active"===e.Status);n({complete:r,pluginInfo:e}),t()})});classForInstallationStatus=e=>{switch(e){case 1:return"newspack-plugin-installer__status-active";case 2:return"newspack-plugin-installer__status-installing";case 3:return"newspack-plugin-installer__status-error";default:return"newspack-plugin-installer__status-none"}};render(){const{autoInstall:e,isSmall:t,withoutFooterButton:n}=this.props,{pluginInfo:r}=this.state,{is_managed:o}=window.newspack_aux_data||{},c=Object.keys(r),l=[];c.forEach(e=>{const t=r[e];l.push(t.Status)});const u=e=>"active"===e||"inactive"===e,p=l.every(u)?(0,f.__)("Activate","newspack-plugin"):(0,f.__)("Install","newspack-plugin"),d=c.some(e=>{const t=r[e];return"active"!==t.Status&&0===t.installationStatus});return(0,i.jsxs)(i.Fragment,{children:[(!r||!Object.keys(r).length)&&(0,i.jsxs)("div",{className:"newspack-plugin-installer_is-waiting",children:[(0,i.jsx)(Gt,{isLeft:!0}),(0,f.__)("Retrieving plugin information…","newspack-plugin")]}),r&&c.length>0&&c.map(e=>{const n=r[e],{Name:c,Description:l,Download:p,Status:d,installationStatus:h,notification:g}=n,m=2===h,v=!m&&"active"!==d,y=p||u(d);let w;2===h?w="inactive"===d?(0,f.__)("Activating…"):(0,f.__)("Installing…"):y?"uninstalled"===d?w=(0,i.jsxs)("span",{className:"newspack-plugin-installer__status",children:[(0,f.__)("Install","newspack"),(0,i.jsx)("span",{className:"newspack-checkbox-icon"})]}):"inactive"===d?w=(0,i.jsxs)("span",{className:"newspack-plugin-installer__status",children:[(0,f.__)("Activate","newspack-plugin"),(0,i.jsx)("span",{className:"newspack-checkbox-icon"})]}):"active"===d&&(w=(0,i.jsxs)("span",{className:"newspack-plugin-installer__status",children:[(0,f.__)("Installed","newspack-plugin"),(0,i.jsx)("span",{className:"newspack-checkbox-icon newspack-checkbox-icon--checked",children:(0,i.jsx)(b.A,{icon:at.A})})]})):w=(0,i.jsxs)("span",{className:"newspack-plugin-installer__status",children:[o?(0,f.__)("Contact Newspack support to install","newspack-plugin"):(0,f.__)("Plugin must be installed manually","newspack-plugin"),(0,i.jsx)("span",{className:"newspack-checkbox-icon"})]});const _=a()("newspack-action-card__plugin-installer",this.classForInstallationStatus(h)),x=v?()=>this.installPlugin(e):null;return(0,i.jsx)(s.A,{title:c,description:l,disabled:!y,actionText:w,isSmall:t,isWaiting:m,onClick:x,notification:g,notificationLevel:"error",notificationHTML:!0,className:_},e)}),!n&&!e&&r&&c.length>0&&(0,i.jsx)("div",{className:"newspack-buttons-card",children:(0,i.jsx)(_.A,{disabled:!d,isPrimary:!0,onClick:this.installAllPlugins,children:p})})]})}}lt.defaultProps={onStatus:()=>{},onInstalled:()=>{}};const ut=lt;var pt=n(2619);const dt=e=>Array.isArray(e.options)&&e.options.length,ft=e=>{switch(e.type){case"int":case"integer":case"float":case"number":return"number";case"string":case"text":return"text";case"password":return"password";case"boolean":case"checkbox":return"checkbox";default:return null}},ht=e=>{var t;const[n,o]=(0,r.useState)(!0),{error:a,sectionKey:c,active:l,title:u,description:d,fields:h,disabled:g,onChange:m,onUpdate:v}=e,y=e=>({disabled:g,name:`${e.section}_${e.key}`,type:ft(e),label:e.description,help:e.help||null,options:e.options?.map(e=>({value:e.value,label:e.name||e.label}))||null,value:e.value,multiple:!(!dt(e)||!e.multiple)||null,checked:"boolean"===e.type?!!e.value:null,onChange:t=>{m(e.key,t),o(!1)}}),w=(t,n=null)=>(0,pt.applyFilters)(`newspack.settingSection.${c}.${t}`,n,e);let b=2;return h.length%3==0?b=3:1===h.length&&(b=1),(0,i.jsx)(s.A,{id:null!==(t=e.id)&&void 0!==t?t:null,isMedium:!0,disabled:g,title:u,description:d,toggleChecked:l,hasGreyHeader:l||null===l,toggleOnChange:null!==l?e=>v({active:e}):null,actionContent:(l||null===l)&&w("buttons",(0,i.jsx)(_.A,{variant:"primary",disabled:g||n,onClick:()=>{v(),o(!0)},children:(0,f.__)("Save Settings","newspack")})),children:(l||null===l)&&(0,i.jsxs)(r.Fragment,{children:[a?.message&&(0,i.jsx)(ct,{noticeText:a.message,isError:!0}),w("beforeControls"),(0,i.jsx)(Xe,{columns:b,gutter:32,children:h.map(e=>{const t=(e=>{if(dt(e))return Lt;switch(e.type){case"checkbox":case"boolean":return p.CheckboxControl;default:return qt}})(e);return(0,pt.applyFilters)(`newspack.settingsSection.${c}.control`,(0,i.jsx)(t,{...y(e)},e.key),{sectionKey:c,setting:e,onChange:m})})})]})})};class gt extends r.Component{constructor(){super(...arguments),this.state={inFlight:!1,settings:{},error:null}}fetchSettings=()=>{const{afterFetch:e,pluginSlug:t,isWizard:n}=this.props;this.setState({inFlight:!0}),u()({path:n?`/newspack/v1/wizard/${t}/settings`:`/${t}/v1/settings`}).then(t=>{this.setState({settings:t,error:null}),"function"==typeof e&&e(t)}).catch(e=>{this.setState({error:e})}).finally(()=>{this.setState({inFlight:!1})})};componentDidMount(){this.fetchSettings()}getSettingsValues=e=>this.state.settings[e]?.reduce((e,t)=>(e[t.key]=t.value,e),{})||{};handleSettingChange=e=>(t,n)=>{const r=[...this.state.settings[e]];r.forEach(e=>{e.key===t&&(e.value=n)}),this.setState({settings:{...this.state.settings,[e]:r}})};handleSectionUpdate=e=>t=>{const{afterUpdate:n,pluginSlug:r,isWizard:o}=this.props;this.setState({inFlight:!0}),u()({path:o?`/newspack/v1/wizard/${r}/settings`:`/${r}/v1/settings`,method:"POST",data:{section:e,settings:t||this.getSettingsValues(e)}}).then(t=>{this.setState({settings:{...this.state.settings,[e]:t[e]},error:null}),"function"==typeof n&&n(t)}).catch(e=>{this.setState({error:e})}).finally(()=>{this.setState({inFlight:!1})})};getSectionInfo=e=>this.state.settings[e]?.find(e=>!e.key||"active"===e.key);getSectionTitle=e=>this.getSectionInfo(e)?.description;getSectionDescription=e=>this.getSectionInfo(e)?.help;isSectionActive=e=>{const{settings:t}=this.state,n=t[e]?.find(e=>"active"===e.key);return n?n.value:null};getSectionFields=e=>this.state.settings[e]?.filter(e=>e.key&&"active"!==e.key);render(){const{title:e,description:t,hasGreyHeader:n,children:o,titleLevel:s=1}=this.props,{settings:c,inFlight:l,error:u}=this.state;return(0,i.jsxs)(r.Fragment,{children:[e&&(0,i.jsx)(At,{title:e,heading:s,description:t}),u&&(0,i.jsx)(ct,{isError:!0,noticeText:u.message}),(0,i.jsxs)("div",{className:a()("newspack-plugin-settings",{"newspack-wizard-section__is-loading":l&&!Object.keys(c).length}),children:[Object.keys(c).map(e=>(0,i.jsx)(ht,{disabled:l,id:`plugin-settings-${e}`,sectionKey:e,title:this.getSectionTitle(e),description:this.getSectionDescription(e),active:this.isSectionActive(e),fields:this.getSectionFields(e),onChange:this.handleSettingChange(e),onUpdate:this.handleSectionUpdate(e),hasGreyHeader:n},e)),o]})]})}}gt.defaultProps={title:(0,f.__)("General Settings","newspack-plugin")},gt.Section=ht;const mt=/^(2001|828|9406)$/.test(n.j)?gt:null;class vt extends(/^(828|9406)$/.test(n.j)?r.Component:null){state={pluginInfo:{}};componentDidMount=()=>{this.retrievePluginInfo()};retrievePluginInfo=()=>new Promise(()=>{u()({path:"/newspack/v1/plugins/"}).then(e=>this.setState({pluginInfo:e}))});managePlugin=(e,t)=>{const{plugins:n}=this.props,{pluginInfo:r}=this.state,o=t?"configure":"deactivate",a={path:`/newspack/v1/plugins/${e}/${o}/`,method:"post"};this.setState({pluginInfo:{...r,[e]:{...r[e],inFlight:o}}},()=>{u()(a).then(t=>{const{shouldRefreshAfterUpdate:r}=n[e];this.setState(({pluginInfo:n})=>({pluginInfo:{...n,[e]:t}}),()=>r&&location.reload())}).catch(t=>{this.setState({pluginInfo:{...r,[e]:{...r[e],error:t.message||(0,f.__)("There was an error managing this plugin.","newspack-plugin")}}})})})};render(){const{plugins:e}=this.props,{pluginInfo:t}=this.state;return this.prepareDataForRender(e,t).map((e,t)=>{var n;const{name:r,description:o,href:a,slug:c,editPath:l}=e,u=this.isPluginInstalledAndActive(e),p=!a&&u&&l?c:null,d=this.errorForPlugin(e);return(0,i.jsx)(s.A,{className:this.classNameForPlugin(e),title:r,description:o,actionText:this.actionTextForPlugin(e),handoff:p,onClick:null!==(n=e.onClick)&&void 0!==n?n:null,href:a,toggle:!0,toggleChecked:this.isPluginInstalledAndActive(e),toggleOnChange:e=>this.managePlugin(c,e),notification:d,notificationHTML:d,notificationLevel:"error"},t)})}prepareDataForRender=(e,t)=>Object.keys(e).map(e=>t[e]?Object.keys(t[e]).reduce((n,r)=>({...n,[r.charAt(0).toLowerCase()+r.slice(1)]:t[e][r]}),{}):{}).map(t=>Object.assign(t,e[t.slug]));classNameForPlugin=e=>{const{status:t,inFlight:n}=e;return n?"in-flight":t?void 0:"loading"};actionTextForPlugin=e=>{const{actionText:t,editPath:n,href:o,inFlight:a,name:s}=e;return"configure"===a?(0,i.jsxs)(r.Fragment,{children:[(0,f.__)("Installing…","newspack-plugin")," ",(0,i.jsx)(Gt,{isRight:!0})]}):"deactivate"===a?(0,i.jsxs)(r.Fragment,{children:[(0,f.__)("Deactivating…","newspack-plugin")," ",(0,i.jsx)(Gt,{isRight:!0})]}):s?this.isPluginInstalledAndActive(e)?o||n?t||(0,f.__)("Configure","newspack-plugin"):void 0:null:(0,i.jsxs)(r.Fragment,{children:[(0,f.__)("Loading…","newspack-plugin")," ",(0,i.jsx)(Gt,{isRight:!0})]})};errorForPlugin=e=>{const{slug:t}=e,{pluginInfo:n}=this.state;return n[t]?.error||null};isPluginInstalledAndActive=e=>{const{status:t}=e;return"active"===t}}const yt=/^(828|9406)$/.test(n.j)?vt:null;class wt extends r.Component{render(){const{className:e,padding:t,...n}=this.props,r=a()("newspack-popover",t&&"newspack-popover__padding-"+t,e);return(0,i.jsx)(p.Popover,{className:r,...n})}}wt.defaultProps={padding:!1};const _t=/^(2001|828)$/.test(n.j)?wt:null;class bt extends(/^(2001|6930|9406)$/.test(n.j)?r.Component:null){getCompletionPercentage(e,t){return t?Math.max(Math.min(Math.round(e/t*100),100),0):100}render(){const{label:e,completed:t,total:n,displayFraction:r}=this.props,o=Math.max(0,parseInt(n)||0),a=Math.max(0,Math.min(parseInt(t)||0,parseInt(o))),s={width:this.getCompletionPercentage(a,o)+"%"};return(0,i.jsxs)("div",{className:"newspack-progress-bar",children:[(e||r)&&(0,i.jsxs)("div",{className:"newspack-progress-bar__headings",children:[e&&(0,i.jsx)("h2",{children:e}),r&&(0,i.jsx)("p",{className:"is-dark",children:(0,i.jsxs)("strong",{children:[a,"/",o]})})]}),(0,i.jsx)("div",{className:"newspack-progress-bar__container",children:(0,i.jsx)("div",{className:"newspack-progress-bar__bar",style:s,"data-testid":"progress-bar-indicator"})})]})}}const xt=/^(2001|6930|9406)$/.test(n.j)?bt:null;class kt extends(2001==n.j?r.Component:null){render(){const{className:e,...t}=this.props,n=a()("newspack-radio-control",e);return(0,i.jsx)(p.RadioControl,{className:n,...t})}}const jt=2001==n.j?kt:null;var St=n(3988);const At=({backNav:e="",badges:t,centered:n=!1,className:o=null,description:s="",heading:c=2,icon:l=null,isWhite:u=!1,noMargin:d=!1,pageHeader:h=!1,title:g,id:m=null,primaryAction:v,secondaryAction:y,children:x=null})=>{const k=(0,r.useRef)();(0,r.useEffect)(()=>{const e=new Proxy(new URLSearchParams(window.location.search),{get:(e,t)=>e.get(t)}).scrollTo;e&&e===m&&window.setTimeout(()=>k.current.scrollIntoView({behavior:"smooth"}),250)},[]);const j=a()("newspack-section-header",n&&"newspack-section-header--is-centered",u&&"newspack-section-header--is-white",d&&"newspack-section-header--no-margin",h&&"newspack-section-header--page-header"),S=h?"h1":`h${c}`;let A=null;return"string"==typeof g?A=(0,i.jsxs)("div",{className:"newspack-section-header__title-container",children:[(0,i.jsx)(S,{children:g}),t?.length?t.map((e,t)=>(0,i.jsx)(w,{text:e.label,level:e.level||"default"},t)):null,y&&(0,i.jsx)("div",{className:"newspack-section-header__secondary-action",children:(0,i.jsx)(_.A,{variant:"link",href:y.href,onClick:y.action,children:y.label})})]}):"function"==typeof g&&(A=(0,i.jsx)(S,{children:g()})),(0,i.jsxs)("div",{id:m,className:a()("newspack-section-header__container",e&&"newspack-section-header--has-back-nav",v&&"newspack-section-header--has-primary-action",o),ref:k,children:[(0,i.jsxs)(Xe,{columns:1,gutter:8,className:j,children:[l&&(0,i.jsx)("div",{className:"newspack-section-header__icon",children:(0,i.jsx)(b.A,{icon:l,size:48})}),e?(0,i.jsxs)(p.__experimentalHStack,{alignment:"left",style:{position:"relative"},children:[(0,i.jsx)("div",{className:"newspack-section-header__back-nav",children:(0,i.jsx)(p.Tooltip,{text:(0,f.__)("Go back","newspack-plugin"),children:(0,i.jsx)(_.A,{href:e,icon:St.A,variant:"tertiary"})})}),A]}):A,s&&"string"==typeof s&&(0,i.jsx)("p",{children:s}),"function"==typeof s&&(0,i.jsx)("p",{children:s()}),s&&"string"!=typeof s&&"function"!=typeof s&&(0,i.jsx)("p",{children:s}),x&&(0,i.jsx)("div",{className:"newspack-section-header__children",children:x})]}),v&&(0,i.jsx)("div",{className:"newspack-section-header__primary-action",children:(0,i.jsx)(_.A,{href:v.href,variant:"primary",onClick:v.action,children:v.label})})]})};var Ct=n(2426),Et=n.n(Ct);function Pt({help:e,label:t,onChange:n,optgroups:r=[],className:o,hideLabelFromVision:s,...c}){const l=Pe.useUniqueId("group-select");return(0,i.jsx)(p.BaseControl,{label:t,hideLabelFromVision:s,id:l,help:e,className:a()(o,"components-select-control"),children:(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsxs)("select",{id:l,className:"components-select-control__input",onChange:e=>{const{value:t}=e.target,o=D()(r,e=>Et()(e.options,["value",t]));n(t,o)},"aria-describedby":e?`${l}__help`:void 0,...c,children:[(0,i.jsx)("option",{value:"",children:(0,f.__)("-- Select --","newspack-plugin")}),r.map(({label:e,options:t},n)=>(0,i.jsx)("optgroup",{label:e,children:t.map((e,t)=>(0,i.jsx)("option",{value:e.value,disabled:e.disabled,children:e.label},`${e.label}-${e.value}-${t}`))},n))]}),(0,i.jsx)("div",{className:"components-select-control__arrow-wrapper",children:(0,i.jsx)(b.A,{icon:P.A,size:18})})]})})}const Ot=({buttonOptions:e,buttonSmall:t,className:n,help:r,hideLabelFromVision:o,label:s,onChange:c,value:l})=>{const u=Pe.useUniqueId("button-group");return(0,i.jsx)(p.BaseControl,{label:s,help:r,hideLabelFromVision:o,id:u.current,className:a()(n,"components-select-control"),children:(0,i.jsx)(p.ButtonGroup,{children:e.map(e=>{const n=l===e.value;let r=()=>e.label;return e.icon&&(r=()=>(0,i.jsx)(b.A,{icon:e.icon})),(0,i.jsx)(p.Button,{variant:n?"primary":null,isPressed:n,onClick:()=>c(e.value),isSmall:t,children:(0,i.jsx)(r,{})},e.value)})})})};class Nt extends r.Component{render(){const{className:e,optgroups:t,buttonOptions:n,buttonSmall:r,...o}=this.props,s=a()("newspack-select-control",t&&"newspack-grouped-select-control",n&&"newspack-buttons-select-control",e);return(0,i.jsx)("div",{className:s,children:t?(0,i.jsx)(Pt,{optgroups:t,...o}):n?(0,i.jsx)(Ot,{buttonOptions:n,buttonSmall:r,...o}):(0,i.jsx)(p.SelectControl,{...o})})}}const Lt=Nt,Tt={SettingsCard:({children:e,className:t,columns:n=3,gutter:r=32,noBorder:o,rowGap:c,...l})=>{const u=a()("newspack-settings__card",o&&"newspack-settings__no-border",t);return(0,i.jsx)(s.A,{...l,className:u,notificationLevel:"info",noBorder:o,children:(0,i.jsx)(Xe,{columns:n,gutter:r,rowGap:c,children:e})})},SettingsSection:({title:e,description:t,children:n})=>(0,i.jsxs)(Xe,{columns:1,gutter:8,className:"newspack-settings__section",children:[(0,i.jsxs)("div",{className:"newspack-settings__section__title",children:[(0,i.jsx)("span",{children:e}),t&&(0,i.jsx)(Ze,{text:t})]}),(0,i.jsx)("div",{className:"newspack-settings__section__content",children:n})]}),MinMaxSetting:({min:e,max:t,onChangeMin:n,onChangeMax:r,minPlaceholder:o,maxPlaceholder:a,...s})=>(0,i.jsxs)("div",{...s,children:[(0,i.jsxs)("div",{className:"newspack-settings__min-max",children:[(0,i.jsx)(p.CheckboxControl,{checked:e>0,onChange:e=>n(e?1:0),label:(0,f.__)("Min","newspack-plugin")}),(0,i.jsx)(qt,{"data-testid":"min",type:"number",value:e,placeholder:o,onChange:e=>n(e>0?e:0)})]}),(0,i.jsxs)("div",{className:"newspack-settings__min-max","data-testid":"max",children:[(0,i.jsx)(p.CheckboxControl,{checked:t>0,onChange:t=>r(t?e||1:0),label:(0,f.__)("Max","newspack-plugin")}),(0,i.jsx)(qt,{"data-testid":"max",type:"number",value:t,placeholder:a,onChange:e=>r(e>0?e:0)})]})]})};class Mt extends(2001==n.j?r.Component:null){render(){const{className:e,stepsListItems:t,narrowList:n,style:r={}}=this.props,o=a()("steps-list",e,n&&"steps-list__narrow-list");return(0,i.jsx)("div",{className:o,style:r,children:t.map((e,t)=>(0,i.jsx)(Dt,{listItemCount:t+1,listItemText:e},t))})}}const It=2001==n.j?Mt:null;class Rt extends(2001==n.j?r.Component:null){render(){const{className:e,listItemCount:t,listItemText:n,style:r={}}=this.props,o=a()("steps-list-item",e);return(0,i.jsxs)("div",{className:o,style:r,children:[(0,i.jsx)("div",{className:"steps-list-item__number",children:t}),(0,i.jsx)("div",{className:"steps-list-item__content",dangerouslySetInnerHTML:{__html:n}})]})}}const Dt=2001==n.j?Rt:null;class $t extends(/^(2001|6930)$/.test(n.j)?r.Component:null){render(){const{ariaLabel:e,className:t,cardTitle:n,url:r,image:o,imageType:s,isActive:c,onClick:l,id:u}=this.props,d=a()("newspack-style-card",c&&"newspack-style-card__is-active",t);return(0,i.jsxs)("div",{className:d,id:u,children:[(0,i.jsxs)("div",{className:"newspack-style-card__image",children:["html"===s?(0,i.jsx)("div",{className:"newspack-style-card__image-html",dangerouslySetInnerHTML:o}):(0,i.jsx)("img",{src:o,alt:n+" "+(0,f.__)("Thumbnail","newspack-plugin")}),(0,i.jsxs)("div",{className:"newspack-style-card__actions",children:[c?(0,i.jsx)("span",{className:"newspack-style-card__actions__badge",children:(0,f.__)("Selected","newspack-plugin")}):(0,i.jsx)(p.Button,{variant:"link",onClick:l,"aria-label":e||(0,f.__)("Select","newspack-plugin")+" "+n,tabIndex:"0",children:(0,f.__)("Select","newspack-plugin")}),r&&(0,i.jsx)(tn,{url:r,label:(0,f.__)("View Demo","newspack-plugin"),variant:"link"})]})]}),n&&(0,i.jsx)("div",{className:"newspack-style-card__title",children:n})]})}}const Ft=/^(2001|6930)$/.test(n.j)?$t:null;var zt=n(4713),Vt=n.n(zt);const{NavLink:Ht,useHistory:Bt}=ve.A,Ut=({items:e,className:t,disableUpcoming:n,children:r=null})=>{const o=e.filter(e=>!e.isHiddenInTabbedNavigation),{location:s}=Bt(),c=Vt()(o,["path",s.pathname]);return(0,i.jsxs)("div",{className:a()("newspack-tabbed-navigation",t),children:[(0,i.jsx)("ul",{children:o.map((e,t)=>(0,i.jsx)("li",{children:(0,i.jsx)(Ht,{to:e.path,isActive:(t,{pathname:n})=>function(e,t,n){return e.path===n||(Array.isArray(e?.activeTabPaths)?e.activeTabPaths.some(t=>{if(t.endsWith("*")){const e=t.slice(0,-1);return n.startsWith(e)}return e.activeTabPaths.includes(n)}):t)}(e,t,n),exact:!e.hasOwnProperty("exact")||e.exact,activeClassName:"selected",className:a()({disabled:n&&t>c}),children:e.label})},t))}),r]})},qt=({className:e="",required:t=!1,isWide:n=!1,withMargin:o=!0,...s})=>{const c=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(null===c.current)return;const e=c.current.querySelector("label");e&&e.setAttribute("data-required-text",(0,f.__)("(required)","newspack-plugin"))},[c.current]);const l=a()("newspack-text-control",{"newspack-text-control--wide":n,"newspack-text-control--with-margin":o},e);return t?(0,i.jsx)("div",{ref:c,className:"newspack-text-control--required",children:(0,i.jsx)(p.TextControl,{className:l,required:t,...s})}):(0,i.jsx)(p.TextControl,{className:l,...s})};class Wt extends r.Component{render(){const{className:e,isRight:t,isLeft:n,isCenter:r,noMargin:o,...s}=this.props,c=a()("newspack-waiting",e,{"is-right":t,"is-left":n,"is-center":r,"no-margin":o});return(0,i.jsx)(p.Spinner,{className:c,...s})}}const Gt=Wt;var Zt=n(5573),Kt=(0,i.jsx)(Zt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(Zt.Path,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"})}),Qt=(0,i.jsx)(Zt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(Zt.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"})}),Jt=(0,i.jsx)(Zt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(Zt.Path,{d:"M17 4H7c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12zm-7.5-.5h4V16h-4v1.5z"})}),Yt=n(4707);const Xt="newspack-components-web-preview-wrapper";class en extends r.Component{state={device:"desktop",loaded:!1,isPreviewVisible:!1};constructor(e){super(e),this.iframeRef=(0,r.createRef)()}componentDidMount(){const e=document.getElementById(Xt);this.modalDOMElement=e||document.createElement("div"),e||(this.modalDOMElement.id=Xt,document.body.appendChild(this.modalDOMElement))}componentDidUpdate(e,t){!0===this.state.isPreviewVisible?(document.body.classList.add("newspack-web-preview--open"),!1===t.isPreviewVisible&&document.addEventListener("keydown",this.handleKeyDown)):(document.body.classList.remove("newspack-web-preview--open"),!0===t.isPreviewVisible&&document.removeEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown),document.body.classList.remove("newspack-web-preview--open")}handleKeyDown=e=>{"Escape"===e.key&&this.state.isPreviewVisible&&this.closePreview()};closePreview=()=>{const{onClose:e=()=>{}}=this.props;e(),this.setState({isPreviewVisible:!1,loaded:!1})};getWebPreviewModal=()=>{const{beforeLoad:e=()=>{},url:t,title:n}=this.props,{device:o,loaded:s,isPreviewVisible:c}=this.state;if(!this.modalDOMElement||!c)return null;const l=a()("newspack-web-preview",o,s&&"is-loaded");let u=Kt;return"desktop"===o?u=Qt:"tablet"===o&&(u=Jt),e(),(0,r.createPortal)((0,i.jsx)("div",{className:l,children:(0,i.jsxs)("div",{className:"newspack-web-preview__interior",children:[(0,i.jsxs)("div",{className:"newspack-web-preview__toolbar",children:[n&&(0,i.jsx)("div",{className:"newspack-web-preview__toolbar-left",children:(0,i.jsx)("h3",{children:n})}),(0,i.jsxs)("div",{className:"newspack-web-preview__toolbar-right",children:[(0,i.jsx)(p.DropdownMenu,{icon:u,label:(0,f.__)("Preview Size","newspack-plugin"),children:({onClose:e})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(p.MenuItem,{icon:"desktop"===o?at.A:null,role:"menuitemradio",isSelected:"desktop"===o,onClick:()=>{this.setState({device:"desktop"}),e()},children:(0,f.__)("Desktop","newspack-plugin")}),(0,i.jsx)(p.MenuItem,{icon:"tablet"===o?at.A:null,role:"menuitemradio",isSelected:"tablet"===o,onClick:()=>{this.setState({device:"tablet"}),e()},children:(0,f.__)("Tablet","newspack-plugin")}),(0,i.jsx)(p.MenuItem,{icon:"phone"===o?at.A:null,role:"menuitemradio",isSelected:"phone"===o,onClick:()=>{this.setState({device:"phone"}),e()},children:(0,f.__)("Phone","newspack-plugin")})]})}),(0,i.jsx)(p.Button,{onClick:this.closePreview,icon:Yt.A,label:(0,f.__)("Close Preview","newspack-plugin")})]})]}),(0,i.jsxs)("div",{className:"newspack-web-preview__content",children:[!s&&(0,i.jsxs)("div",{className:"newspack-web-preview__is-waiting",children:[(0,i.jsx)(Gt,{isLeft:!0}),(0,f.__)("Loading…","newspack-plugin")]}),(0,i.jsx)("iframe",{ref:this.iframeRef,title:"web-preview",src:t,onLoad:()=>{this.setState({loaded:!0}),this.props.onLoad(this.iframeRef.current)}})]})]})}),this.modalDOMElement)};showPreview=()=>{this.setState({isPreviewVisible:!0})};render(){const{label:e,variant:t,renderButton:n}=this.props;return(0,i.jsxs)(r.Fragment,{children:[n?n({showPreview:this.showPreview}):(0,i.jsx)(p.Button,{variant:t,onClick:this.showPreview,tabIndex:"0",children:e}),this.getWebPreviewModal()]})}}en.defaultProps={url:"//newspack.com",label:(0,f.__)("Preview","newspack-plugin"),onLoad:()=>{}};const tn=/^(2001|6930|9406)$/.test(n.j)?en:null;var nn=n(4548);if(/^(2001|6930|7841|828)$/.test(n.j))var rn=n(591);const{Redirect:on,Route:an}=ve.A;function sn(e,t){return class extends r.Component{constructor(e){super(e),this.state={complete:null,error:null,loading:t&&t.length>0?1:0,quietLoading:!1,confirmation:null},this.wrappedComponentRef=(0,r.createRef)()}componentDidMount=()=>{if(!t){const e=this.wrappedComponentRef.current;e&&e.onWizardReady&&e.onWizardReady()}};setError=e=>new Promise(t=>{this.setState({error:e||null},()=>t())});getError=()=>{const{error:e}=this.state;if(!e)return null;const t=this.parseError(e),{level:n}=t;return"fatal"===n?this.getFatalError(t):this.getErrorNotice(t)};getErrorNotice=e=>{const{message:t}=e;return(0,i.jsx)(ct,{isError:!0,className:"newspack-wizard__above-header",noticeText:t,rawHTML:!0})};getFatalError=e=>{const t=this.getFallbackURL();if(!t)return null;const{message:n}=e;return(0,i.jsxs)(tt,{title:(0,f.__)("Unrecoverable error"),onRequestClose:()=>window.location=t,children:[(0,i.jsx)(ct,{noticeText:n,isError:!0,rawHTML:!0}),(0,i.jsx)(T,{buttonsCard:!0,noBorder:!0,className:"justify-end",children:(0,i.jsx)(_.A,{isPrimary:!0,href:t,children:(0,f.__)("Return to Dashboard","newspack-plugin")})})]})};parseError=e=>{const{data:t,message:n,code:r}=e;let o="fatal";return t&&"level"in t?o=t.level:"rest_invalid_param"===r&&(o="notice"),{message:n,level:o}};pluginInstallationStatus=({complete:e})=>{this.state.loading&&this.doneLoading();const t=this.wrappedComponentRef.current;this.setState({complete:e},()=>{e&&t&&t.onWizardReady&&t.onWizardReady()})};startLoading=e=>{e?this.setState(e=>({quietLoading:e.quietLoading+1})):this.setState(e=>({loading:e.loading+1}))};doneLoading=e=>{e?this.setState(e=>({quietLoading:e.quietLoading-1})):this.setState(e=>({loading:e.loading-1}))};wizardApiFetch=e=>{const{quiet:t}=e;return this.startLoading(t),new Promise((n,r)=>{u()(e).then(e=>{this.doneLoading(t),n(e)}).catch(e=>{this.doneLoading(t),r(e)})})};pluginRequirements=()=>{const{complete:e}=this.state;return e?(0,i.jsx)(on,{from:"/plugin-requirements",to:"/"}):(0,i.jsx)(an,{path:"/",render:()=>(0,i.jsxs)(r.Fragment,{children:[null!==e&&(0,i.jsx)("div",{className:"newspack-wizard__header",children:(0,i.jsx)("div",{className:"newspack-wizard__header__inner",children:(0,i.jsxs)("div",{className:"newspack-wizard__title",children:[(0,i.jsx)(_.A,{isLink:!0,href:newspack_urls.dashboard,label:(0,f.__)("Return to Dashboard","newspack-plugin"),showTooltip:!0,icon:rn.A,iconSize:36,children:(0,i.jsx)(rt,{size:36})}),(0,i.jsx)("div",{children:(0,i.jsx)("h2",{children:t.length>1?(0,f.__)("Required plugins","newspack-plugin"):(0,f.__)("Required plugin","newspack-plugin")})})]})})}),(0,i.jsx)("div",{className:"newspack-wizard newspack-wizard__content",children:(0,i.jsx)(ut,{plugins:t,onStatus:e=>this.pluginInstallationStatus(e)})})]})})};confirmAction=e=>{const t={title:null,message:(0,f.__)("Are you sure?","newpack-plugin"),confirmText:(0,f.__)("OK","newspack-plugin"),cancelText:(0,f.__)("Cancel","newspack-plugin"),callback:null,...e};this.setState({confirmation:t})};getModal=()=>{if(!this.state.confirmation)return null;const{title:e,message:t,confirmText:n,cancelText:r,callback:o}=this.state.confirmation;return t&&o&&(0,i.jsxs)(tt,{size:"small",hideTitle:!e,title:e,onRequestClose:()=>this.setState({confirmation:null}),children:[(0,i.jsx)("p",{children:t}),(0,i.jsxs)(T,{buttonsCard:!0,noBorder:!0,className:"justify-end",children:[(0,i.jsx)(_.A,{variant:"secondary",onClick:()=>this.setState({confirmation:null}),children:r}),(0,i.jsx)(_.A,{variant:"primary",onClick:()=>{this.setState({confirmation:null}),o()},children:n})]})]})};getFallbackURL=()=>{if("undefined"!=typeof newspack_urls)return newspack_urls.dashboard};render(){const{simpleFooter:n}=this.props,{loading:o,quietLoading:a,error:s}=this.state,c=[o?"newspack-wizard__is-loading":"newspack-wizard__is-loaded"];return a&&c.push("newspack-wizard__is-loading-quiet"),(0,i.jsxs)(r.Fragment,{children:[this.getError(),this.getModal(),(0,i.jsx)("div",{className:c.join(" "),children:(0,i.jsx)(e,{confirmAction:this.confirmAction,pluginRequirements:t&&this.pluginRequirements(),clearError:this.clearError,getError:this.getError,errorData:s,setError:this.setError,isLoading:o,startLoading:this.startLoading,doneLoading:this.doneLoading,wizardApiFetch:this.wizardApiFetch,ref:this.wrappedComponentRef,...this.props})}),!o&&(0,i.jsx)(Fe,{simple:n})]})}}}var cn=n(1882),ln=n.n(cn),un=n(3805),pn=n.n(un),dn=n(5015),fn=n.n(dn);function hn(e){const t={};return ln()(e)&&(t.onClick=e),fn()(e)&&(t.href=e),pn()(e)&&(e.handoff&&(t.plugin=e.handoff,e.editLink&&(t.editLink=e.editLink)),e.onClick&&(t.onClick=e.onClick),e.href&&(t.href=e.href)),t}function gn(e,{hidePrimaryButton:t}={}){return n=>{const{className:r,buttonText:o,buttonAction:s,buttonDisabled:c,headerText:l,subHeaderText:u,tabbedNavigation:p,secondaryButtonText:d,secondaryButtonAction:h,renderAboveContent:g,disableUpcomingInTabbedNavigation:m}=n,v=hn(s),y=hn(h),w=y.plugin?Be:_.A,b=o&&s,x=d&&h,k=(e={})=>v.plugin?(0,i.jsx)(Be,{isPrimary:!0,...v,...e,children:o}):(0,i.jsx)(_.A,{isPrimary:!c,isSecondary:!!c,disabled:c,children:o,...v,...e});return(0,i.jsxs)(i.Fragment,{children:[newspack_aux_data.is_debug_mode&&(0,i.jsx)(ct,{debugMode:!0}),(0,i.jsx)("div",{className:"newspack-wizard__header",children:(0,i.jsx)("div",{className:"newspack-wizard__header__inner",children:(0,i.jsxs)("div",{className:"newspack-wizard__title",children:[(0,i.jsx)(_.A,{isLink:!0,href:newspack_urls.dashboard,label:(0,f.__)("Return to Dashboard","newspack-plugin"),showTooltip:!0,icon:rn.A,iconSize:36,children:(0,i.jsx)(rt,{size:36})}),(0,i.jsxs)("div",{children:[l&&(0,i.jsx)("h2",{children:l}),u&&(0,i.jsx)("span",{children:u})]})]})})}),p&&(0,i.jsx)(Ut,{disableUpcoming:m,items:p.filter(e=>!e.isHiddenInNav)}),(0,i.jsx)(qe,{}),(0,i.jsxs)("div",{className:a()("newspack-wizard newspack-wizard__content",r),children:["function"==typeof g?g():null,(0,i.jsx)(e,{...n,renderPrimaryButton:k}),(b||x)&&(0,i.jsxs)("div",{className:"newspack-buttons-card",children:[b&&!t&&k(),x&&(0,i.jsx)(w,{isSecondary:!0,...y,children:d})]})]})]})}}},5950:(e,t,n)=>{var r=n(695),o=n(8984),a=n(4894);e.exports=function(e){return a(e)?r(e):o(e)}},5974:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(5573),o=n(790);const a=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"M5.5 17.0009V18.5009H7.5V17.0009H5.5ZM5.5 20.0009C4.67188 20.0009 4 19.329 4 18.5009V17.0009V16.2509V15.5009V8.50092V7.75092V7.00092V5.50092C4 4.6728 4.67188 4.00092 5.5 4.00092C7.33333 4.00092 9.16667 4.00092 11 4.00092C11.6438 4.00092 12.1906 4.40405 12.4062 4.9728C12.5813 4.78217 12.8094 4.63842 13.075 4.56655L14.9344 4.05092C15.7063 3.83842 16.5 4.3103 16.7063 5.10717L17.2688 7.26967L17.4563 7.99467L19.3875 15.4415L19.575 16.1665L19.9469 17.604C20.1531 18.4009 19.6969 19.2197 18.925 19.4322L17.0625 19.9478C16.2906 20.1603 15.4969 19.6884 15.2906 18.8915L14.7281 16.729L14.5406 16.004L12.6125 8.5603L12.5 8.13217V8.50092V15.5009V16.2509V17.0009V18.5009C12.5 19.329 11.8281 20.0009 11 20.0009C9.08318 20.0009 7.41682 20.0009 5.5 20.0009ZM9 18.5009H11V17.0009H9V18.5009ZM7.5 5.50092H5.5V7.00092H7.5V5.50092ZM7.5 8.50092H5.5V15.5009H7.5V8.50092ZM9 7.00092H11V5.50092H9V7.00092ZM11 15.5009V8.50092H9V15.5009H11ZM17.7531 15.1165L16.0094 8.3978L14.2437 8.8853L15.9875 15.604L17.7531 15.1165ZM16.3656 17.0572L16.7375 18.4853L18.5 17.9978C18.5 17.9947 18.5 17.9915 18.5 17.9884V17.9853L18.1344 16.5728L16.3687 17.0603L16.3656 17.0572ZM13.8687 7.43217L15.6344 6.94467L15.2625 5.51655L13.5 6.00405C13.5 6.00717 13.5 6.0103 13.5 6.01655L13.8656 7.42905L13.8687 7.43217Z"})}),i=/^(2617|9406)$/.test(n.j)?a:null},6009:(e,t,n)=>{e=n.nmd(e);var r=n(4840),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&r.process,s=function(){try{return a&&a.require&&a.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s},6025:(e,t,n)=>{var r=n(5288);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},6110:(e,t,n)=>{var r=n(7464),o=n(392);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},6122:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(5573),o=n(790);const a=(0,o.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(r.Path,{d:"M4 14.5H20V16H4V14.5ZM4 20H13V18.5H4V20ZM12 5.9L10.1 4L4.7 9.4L4.1 12L6.7 11.4L12.1 6L12 5.9Z"})}),i=/^(2617|2741|5795|9406)$/.test(n.j)?a:null},6123:(e,t,n)=>{"use strict";var r=n(1622),o=n(2952);window.newspackRAS=window.newspackRAS||[];let a=null;function i(){if(a){const e=a;a=null,(0,o.ZZ)(()=>{window.location.href=e})}else(0,o.q9)()}function s(e,t,n,r,o,s=!0){const c=document.createElement("div");c.classList.add("newspack-ui"),c.innerHTML='
';e.addEventListener("click",l=>{document.body.appendChild(c);const u=e.getAttribute("href");if(u)try{(async e=>{const c=await fetch(e);window.newspackOpenModalCheckout({url:s?c.url:null,title:t,actionType:n,onCheckoutComplete:e=>{!function(e){const{subscription_renewal:t,subscription_ids:n,order_id:r}=e;n?.length?a=`${newspackMyAccountV1.myAccountUrl}/view-subscription/${n[0]}`:t?a=`${newspackMyAccountV1.myAccountUrl}/view-subscription/${t}`:r&&(a=`${newspackMyAccountV1.myAccountUrl}/view-order/${r}`)}(e),r&&r(e)},onClose:o||i})})(u),l.preventDefault()}catch(e){document.body.removeChild(c),console.error(e)}})}window.newspackRAS=window.newspackRAS||[],(0,r.Qc)(()=>{document.querySelectorAll(".resubscribe").forEach(e=>{s(e,newspackMyAccountV1.labels.resubscribe_title,"resubscribe",e=>{window.newspackRAS.push(["subscription_reactivated",{subscription_id:e.subscription_ids?.[0]}])})}),document.querySelectorAll(".subscription_renewal_early").forEach(e=>{s(e,newspackMyAccountV1.labels.renewal_early_title,"renewal_early",e=>{window.newspackRAS.push(["renewal_early",{subscription_id:e.subscription_renewal}])})}),document.querySelectorAll(".change_payment_method").forEach(e=>{s(e,newspackMyAccountV1.labels.change_payment_method_title,"change_payment_method",e=>{window.newspackRAS.push(["change_payment_method",{subscription_id:e.subscription_ids?.[0]}])})}),document.querySelectorAll("p.order-again a").forEach(e=>{s(e,null,"order_again",e=>{window.newspackRAS.push(["product_reordered",{order_id:e.order_id,product_id:e.product_id}])},null,!1)}),document.querySelectorAll(".pay").forEach(e=>{const t=e.dataset?.subscriptionId,n=e.dataset?.action||"pay_order";s(e,e.dataset?.title||null,n,e=>{window.newspackRAS.push([n,{subscription_id:t||e.subscription_renewal?e.subscription_renewal:e.subscription_ids?.[0]}])})})})},6139:(e,t,n)=>{var r=n(6547),o=n(1791),a=n(999),i=n(4894),s=n(5527),c=n(5950),l=Object.prototype.hasOwnProperty,u=a(function(e,t){if(s(t)||i(t))o(t,c(t),e);else for(var n in t)l.call(t,n)&&r(e,n,t[n])});e.exports=u},6188:e=>{"use strict";e.exports=Math.max},6449:e=>{var t=Array.isArray;e.exports=t},6500:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(5920),o=n(2952);const a=[],i={get:function(){return a||[]},add:function(e=""){return e||(e=(0,o.ni)()),a.push(e),(0,r.Ic)(r.qY.overlay,{overlays:a,added:e}),e},remove:function(e){if(!e)return a;const t=a.indexOf(e);return t>-1&&a.splice(t,1),(0,r.Ic)(r.qY.overlay,{overlays:a,removed:e}),a}}},6545:(e,t,n)=>{var r=n(6110)(n(9325),"Set");e.exports=r},6547:(e,t,n)=>{var r=n(3360),o=n(5288),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var i=e[t];a.call(e,t)&&o(i,n)&&(void 0!==n||t in e)||r(e,t,n)}},6549:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},6556:(e,t,n)=>{"use strict";var r=n(453),o=n(3126),a=o([r("%String.prototype.indexOf%")]);e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&a(e,".prototype.")>-1?o([n]):n}},6574:(e,t,n)=>{var r=n(909);e.exports=function(e,t){var n=[];return r(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}},6649:(e,t,n)=>{var r=n(3221)();e.exports=r},6655:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(790),o=n(5573),a=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})})},6721:(e,t,n)=>{var r=n(1042),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},6732:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(6427),o=n(6087),a=n(2247),i=n(790);const{useHistory:s}=a.A,c=/^(2(001|084|617)|(66|94)06|6930|7841|828|8498)$/.test(n.j)?({href:e,loading:t,onClick:n,...a})=>{const c=s(),[l,u]=(0,o.useState)(!1);return e&&n?a.onClick=async()=>{u(!0),await n(),u(!1),c.push((e||"").replace("#",""))}:(a.href=e,a.onClick=n),l&&(a.disabled=!0),(0,i.jsx)(r.Button,{loading:!!t||void 0,...a})}:null},6743:(e,t,n)=>{"use strict";var r=n(9353);e.exports=Function.prototype.bind||r},6757:(e,t,n)=>{var r=n(1033),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var a=arguments,i=-1,s=o(a.length-t,0),c=Array(s);++i{var r=n(5288),o=n(4894),a=n(361),i=n(3805);e.exports=function(e,t,n){if(!i(n))return!1;var s=typeof t;return!!("number"==s?o(n)&&a(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},6837:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(5928),o=n(790);const a=/^(2001|6930|828)$/.test(n.j)?({description:e,error:t,isChecked:n,notificationLevel:a="error",children:i,...s})=>{let c;return void 0!==n&&(c=n?"checked":"unchecked"),(0,o.jsx)(r.Lz,{description:e,checkbox:c,notification:t,notificationLevel:a,...s,children:i})}:null},6924:(e,t,n)=>{var r=n(5250),o=n(999)(function(e,t,n,o){r(e,t,n,o)});e.exports=o},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},6942:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t{"use strict";function r(e){return"#"===e.charAt(0)&&(e=e.slice(1)),3===e.length&&(e=e.split("").map(function(e){return e+e}).join("")),(299*parseInt(e.substring(0,2),16)+587*parseInt(e.substring(2,4),16)+114*parseInt(e.substring(4),16))/1e3>=128?"black":"white"}n.d(t,{b:()=>r})},7068:(e,t,n)=>{var r=n(7217),o=n(5911),a=n(1986),i=n(689),s=n(5861),c=n(6449),l=n(3656),u=n(7167),p="[object Arguments]",d="[object Array]",f="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,m,v){var y=c(e),w=c(t),_=y?d:s(e),b=w?d:s(t),x=(_=_==p?f:_)==f,k=(b=b==p?f:b)==f,j=_==b;if(j&&l(e)){if(!l(t))return!1;y=!0,x=!1}if(j&&!x)return v||(v=new r),y||u(e)?o(e,t,n,g,m,v):a(e,t,_,n,g,m,v);if(!(1&n)){var S=x&&h.call(e,"__wrapped__"),A=k&&h.call(t,"__wrapped__");if(S||A){var C=S?e.value():e,E=A?t.value():t;return v||(v=new r),m(C,E,n,g,v)}}return!!j&&(v||(v=new r),i(e,t,n,g,m,v))}},7093:(e,t,n)=>{"use strict";n.d(t,{A:()=>g});var r=n(6427),o=n(6087),a=n(7723);if(/^(2(001|084|617)|(66|94)06|6930|7841|828|8498)$/.test(n.j))var i=n(7677);if(/^(2(001|084|617)|(66|94)06|6930|7841|828|8498)$/.test(n.j))var s=n(8351);if(/^(2(001|084|617)|(66|94)06|6930|7841|828|8498)$/.test(n.j))var c=n(2485);if(/^(2(001|084|617)|(66|94)06|6930|7841|828|8498)$/.test(n.j))var l=n(3756);if(/^(2(001|084|617)|(66|94)06|6930|7841|828|8498)$/.test(n.j))var u=n(3784);var p=n(5928),d=n(6942),f=n.n(d),h=n(790);const g=/^(2(001|084|617)|(66|94)06|6930|7841|828|8498)$/.test(n.j)?({badge:e,badgeLevel:t,className:n,checkbox:d,children:g,collapse:m,disabled:v,title:y,heading:w=2,description:_,handoff:b,editLink:x,href:k,notification:j,notificationLevel:S,notificationHTML:A,actionContent:C,actionText:E,secondaryActionText:P,secondaryDestructive:O,id:N,image:L,imageLink:T,indent:M,isSmall:I,isMedium:R,simple:D,onClick:$,onSecondaryActionClick:F,isWaiting:z,titleLink:V,toggleChecked:H=!1,toggleOnChange:B,togglePosition:U="leading",hasGreyHeader:q,hasWhiteHeader:W,noBorder:G,isPending:Z,expandable:K=!1,isExpanded:Q,isButtonEnabled:J=!1,draggable:Y=!1,dragIndex:X,dragWrapperRef:ee,onDragCallback:te})=>{const[ne,re]=(0,o.useState)(Boolean(Q)),[oe,ae]=(0,o.useState)(!1),[ie,se]=(0,o.useState)(null),[ce,le]=(0,o.useState)(null);(0,o.useEffect)(()=>{"boolean"==typeof Q&&re(Q)},[Q]),(0,o.useEffect)(()=>{ee&&!ce&&le(ee)},[ee?.current]),(0,o.useEffect)(()=>{m&&ne&&re(!1)},[m]);const ue=j||g,pe=f()("newspack-action-card",D&&"newspack-card--is-clickable",q&&"newspack-card--has-grey-header",W&&"newspack-card--has-white-header",ue&&"newspack-card--has-children",M&&"newspack-card--indent",I&&"is-small",R&&"is-medium",d&&"has-checkbox",K&&"is-expandable",Y&&"is-draggable",C&&"has-action-content",n),de=!B||V||v?{}:{onClick:()=>B(!H),tabIndex:"0"},fe="trailing"===U?"is-toggle-trailing":"is-toggle-leading",he=k&&0!==k.indexOf("http"),ge=P&&F,me=!Array.isArray(e)&&e?[e]:e,ve=`h${w}`,ye=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)("div",{className:"newspack-action-card__region newspack-action-card__region-top",children:[B&&(0,h.jsx)(r.ToggleControl,{checked:H,onChange:B,disabled:v,className:fe}),L&&!B&&(0,h.jsx)("div",{className:"newspack-action-card__region newspack-action-card__region-left",children:(0,h.jsx)("a",{href:T,children:(0,h.jsx)("div",{className:"newspack-action-card__image",style:(we=L,we?{backgroundImage:`url(${we})`}:{})})})}),d&&!B&&(0,h.jsx)("div",{className:"newspack-action-card__region newspack-action-card__region-left",children:(0,h.jsx)("span",{className:f()("newspack-checkbox-icon","is-primary","checked"===d&&"newspack-checkbox-icon--checked",Z&&"newspack-checkbox-icon--pending"),children:"checked"===d&&(0,h.jsx)(i.A,{icon:s.A})})}),(0,h.jsx)("div",{className:"newspack-action-card__region newspack-action-card__region-center",children:(0,h.jsxs)(p.xA,{columns:1,gutter:8,noMargin:!0,children:[(0,h.jsxs)(ve,{children:[(0,h.jsxs)("span",{className:"newspack-action-card__title",...de,children:[V&&(0,h.jsx)("a",{href:V,children:y}),!V&&K&&(0,h.jsx)(p.$n,{isLink:!0,onClick:()=>re(!ne),children:y}),!V&&!K&&y]}),me?.length&&me.map((e,n)=>(0,h.jsx)("span",{className:`newspack-action-card__badge newspack-action-card__badge-level-${t}`,children:e},`badge-${n}`))]}),_&&(0,h.jsxs)("p",{children:["string"==typeof _&&_,"function"==typeof _&&_()]})]})}),!K&&(E||ge||C)&&(0,h.jsxs)("div",{className:"newspack-action-card__region newspack-action-card__region-right",children:[C&&C,E&&(b?(0,h.jsx)(p.Pj,{plugin:b,editLink:x,compact:!0,isLink:!0,children:E}):$||he?(0,h.jsx)(p.$n,{disabled:v&&!J,isLink:!0,href:k,onClick:$,className:"newspack-action-card__primary_button",children:E}):k?(0,h.jsx)(r.ExternalLink,{href:k,className:"newspack-action-card__primary_button",children:E}):(0,h.jsxs)("div",{className:"newspack-action-card__container",children:[E,z&&(0,h.jsx)(p.E$,{isRight:!0})]})),ge&&(0,h.jsx)(p.$n,{isLink:!0,onClick:F,className:"newspack-action-card__secondary_button",isDestructive:O,children:P})]}),K&&(0,h.jsx)(p.$n,{onClick:()=>re(!ne),children:(0,h.jsx)(i.A,{icon:ne?l.A:c.A,height:24,width:24})})]}),j&&(0,h.jsxs)("div",{className:"newspack-action-card__notification newspack-action-card__region-children",children:["error"===S&&(0,h.jsx)(p.$T,{noticeText:j,isError:!0,rawHTML:A}),"info"===S&&(0,h.jsx)(p.$T,{noticeText:j,rawHTML:A}),"success"===S&&(0,h.jsx)(p.$T,{noticeText:j,isSuccess:!0,rawHTML:A}),"warning"===S&&(0,h.jsx)(p.$T,{noticeText:j,isWarning:!0,rawHTML:A})]}),g&&(K&&ne||!K)?(0,h.jsx)("div",{className:"newspack-action-card__region-children",children:g}):null]});var we;if(Y&&ce?.current&&"number"==typeof X&&te&&N){let e=ce.current.getBoundingClientRect(),t=Array.prototype.slice.call(ce.current.querySelectorAll(".newspack-action-card__draggable-wrapper"));const n=0===X,o=X===t.length-1,s=()=>{t=Array.prototype.slice.call(ce.current.querySelectorAll(".newspack-action-card__draggable-wrapper")),e=ce.current.getBoundingClientRect(),oe||(se(X),ae(!0))},d=()=>{null!==ie&&ie!==X&&te(ie),se(null),ae(!1)},f=n=>{const r=n.pageY<=e.top+window.scrollY,o=n.pageY>=e.bottom+window.scrollY,a=n.target.closest(".newspack-action-card__draggable-wrapper");(r||o||a)&&(se(t.indexOf(a)),(0>ie||ie===X+1)&&se(X),r&&se(0),o&&se(t.length))};return(0,h.jsx)("div",{className:"newspack-action-card__draggable-wrapper"+(oe?" is-dragging":""),id:`draggable-card-${N}`,children:(0,h.jsx)(r.Draggable,{elementId:`draggable-card-${N}`,transferData:{},onDragStart:s,onDragEnd:d,onDragOver:f,children:({onDraggableStart:e,onDraggableEnd:t})=>(0,h.jsxs)(p.Zp,{className:pe,onClick:D&&$,id:null!=N?N:null,noBorder:G,children:[(0,h.jsxs)("div",{className:"newspack-action-card__draggable-controls",children:[(0,h.jsx)("div",{className:"drag-handle",draggable:!0,onDragStart:e,onDragEnd:t,children:(0,h.jsx)(i.A,{icon:u.A})}),(0,h.jsxs)("div",{className:"movers",children:[(0,h.jsx)(p.$n,{icon:l.A,onClick:()=>te(X-1),disabled:n,label:(0,a.__)("Move one position up","newspack-plugin")}),(0,h.jsx)(p.$n,{icon:c.A,onClick:()=>te(X+1),disabled:o,label:(0,a.__)("Move one position down","newspack-plugin")})]})]}),ye]})})})}return(0,h.jsx)(p.Zp,{className:pe,onClick:D&&$,id:null!=N?N:null,noBorder:G,children:ye})}:null},7119:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},7153:(e,t,n)=>{"use strict";n.d(t,{M1:()=>i,Ss:()=>a.A,u:()=>o.A});var r=n(7723),o=n(4058),a=n(1075);const i={MAILCHIMP_API_KEY_INVALID:(0,r.__)("Invalid Mailchimp API Key.","newspack-plugin"),GOOGLEOAUTH_REFRESH_TOKEN_EXPIRED:(0,r.__)("Missing Google refresh token. Please re-authenticate site.","newspack-plugin"),GOOGLE:{OAUTH_POPUP_BLOCKED:(0,r.__)("Popup blocked by browser. Disable any popup blocking settings and try again.","newspack-plugin"),URL_INVALID:(0,r.__)("URL is invalid. Please try again or contact support if the issue persists.","newspack-plugin")}}},7167:(e,t,n)=>{var r=n(4901),o=n(7301),a=n(6009),i=a&&a.isTypedArray,s=i?o(i):r;e.exports=s},7176:(e,t,n)=>{"use strict";var r,o=n(3126),a=n(5795);try{r=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var i=!!r&&a&&a(Object.prototype,"__proto__"),s=Object,c=s.getPrototypeOf;e.exports=i&&"function"==typeof i.get?o([i.get]):"function"==typeof c&&function(e){return c(null==e?e:s(e))}},7197:e=>{e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},7209:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(4715),o=n(6427),a=n(7723);if(/^(2617|3104)$/.test(n.j))var i=n(2578);var s=n(790);function c(){const{loggedin_metered_views:e,anonymous_metered_views:t,metering_period:n}=newspack_blocks.content_gate_data||{},c=(0,r.useBlockProps)({className:"newspack-content-gate-countdown-box__wrapper"}),{children:l,...u}=(0,r.useInnerBlocksProps)({className:"newspack-content-gate-countdown-box__content"},{template:[["core/group",{layout:{type:"flex",orientation:"horizontal",flexWrap:"nowrap",justifyContent:"space-between"}},[["core/group",{layout:{type:"flex",orientation:"vertical",flexWrap:"nowrap"},style:{spacing:{blockGap:"var:preset|spacing|20"}}},[["core/group",{layout:{type:"flex",orientation:"horizontal",flexWrap:"nowrap"},style:{spacing:{blockGap:"0.25em"}}},[["newspack/content-gate-countdown",{fontSize:"small",lock:{move:!1,remove:!0},style:{typography:{fontStyle:"normal",fontWeight:"700"}}}],["core/paragraph",{content:(0,a.sprintf)(/* translators: %s is the metered period, e.g. "month" or "week". */ /* translators: %s is the metered period, e.g. "month" or "week". */ (0,a.__)("free articles this %s","newspack-plugin"),n),fontSize:"small",style:{typography:{fontStyle:"normal",fontWeight:"700",textTransform:"uppercase"}}}]]],["core/paragraph",{content:(0,a.sprintf)(/* translators: %1$s is subscribe message, %2$s is sign in link */ /* translators: %1$s is subscribe message, %2$s is sign in link */ (0,a.__)("%1$s %2$s","newspack-plugin"),(0,a.__)("Subscribe now and get unlimited access.","newspack-plugin"),''+(0,a.__)("Sign in to an existing account.","newspack-plugin")+""),fontSize:"small",style:{elements:{link:{color:{text:"var:preset|color|medium-gray"}}}},textColor:"medium-gray"}]]],["newspack-blocks/checkout-button",{text:(0,a.__)("Subscribe now","newspack-plugin")}]]]]});return e||t?(0,s.jsx)("div",{...c,children:(0,s.jsx)("div",{...u,children:l})}):(0,s.jsx)("div",{...c,children:(0,s.jsx)(o.Placeholder,{icon:i.A,label:(0,a.__)("Content Gate Countdown","newspack-plugin"),className:"newspack-content-gate-countdown-box__placeholder",children:(0,a.__)("The content gate countdown block will only display in restricted content when metering is enabled.","newspack-plugin")})})}},7217:(e,t,n)=>{var r=n(79),o=n(1420),a=n(938),i=n(3605),s=n(9817),c=n(945);function l(e){var t=this.__data__=new r(e);this.size=t.size}l.prototype.clear=o,l.prototype.delete=a,l.prototype.get=i,l.prototype.has=s,l.prototype.set=c,e.exports=l},7237:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},7241:(e,t,n)=>{var r=n(695),o=n(2903),a=n(4894);e.exports=function(e){return a(e)?r(e,!0):o(e)}},7255:(e,t,n)=>{var r=n(7422);e.exports=function(e){return function(t){return r(t,e)}}},7291:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},7296:(e,t,n)=>{var r,o=n(5481),a=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!a&&a in e}},7301:e=>{e.exports=function(e){return function(t){return e(t)}}},7309:(e,t,n)=>{var r=n(2006)(n(4713));e.exports=r},7334:e=>{e.exports=function(e){return function(){return e}}},7400:(e,t,n)=>{var r=n(9374),o=1/0;e.exports=function(e){return e?(e=r(e))===o||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},7422:(e,t,n)=>{var r=n(1769),o=n(7797);e.exports=function(e,t){for(var n=0,a=(t=r(t,e)).length;null!=e&&n{var r=n(1882),o=n(7296),a=n(3805),i=n(7473),s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,p=l.hasOwnProperty,d=RegExp("^"+u.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||o(e))&&(r(e)?d:s).test(i(e))}},7473:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},7534:(e,t,n)=>{var r=n(2552),o=n(346);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},7556:(e,t,n)=>{var r=n(1873),o=n(4932),a=n(6449),i=n(4394),s=r?r.prototype:void 0,c=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return o(t,e)+"";if(i(t))return c?c.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},7612:(e,t,n)=>{var r=n(9770),o=n(6574),a=n(5389),i=n(6449);e.exports=function(e,t){return(i(e)?r:o)(e,a(t,3))}},7670:(e,t,n)=>{var r=n(2651);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},7677:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6087),o=(0,r.forwardRef)(({icon:e,size:t=24,...n},o)=>(0,r.cloneElement)(e,{width:t,height:t,...n,ref:o}))},7720:(e,t,n)=>{"use strict";var r=n(4765),o=n(920),a=Object.prototype.hasOwnProperty,i=Array.isArray,s=o(),c=function(e,t){return s.set(e,t),e},l=function(e){return s.has(e)},u=function(e){return s.get(e)},p=function(e,t){s.set(e,t)},d=function(){for(var e=[],t=0;t<256;++t)e[e.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return e}(),f=function(e,t){for(var n=t&&t.plainObjects?{__proto__:null}:{},r=0;rn?c(f(a,{plainObjects:r}),a.length-1):a},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],o=0;o=h?i.slice(c,c+h):i,u=[],p=0;p=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||a===r.RFC1738&&(40===f||41===f)?u[u.length]=l.charAt(p):f<128?u[u.length]=d[f]:f<2048?u[u.length]=d[192|f>>6]+d[128|63&f]:f<55296||f>=57344?u[u.length]=d[224|f>>12]+d[128|f>>6&63]+d[128|63&f]:(p+=1,f=65536+((1023&f)<<10|1023&l.charCodeAt(p)),u[u.length]=d[240|f>>18]+d[128|f>>12&63]+d[128|f>>6&63]+d[128|63&f])}s+=u.join("")}return s},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isOverflow:l,isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},markOverflow:c,maybeMap:function(e,t){if(i(e)){for(var n=[],r=0;rr.arrayLimit)return c(f(t.concat(n),r),o);t[o]=n}else{if(!t||"object"!=typeof t)return[t,n];if(l(t)){var s=u(t)+1;t[s]=n,p(t,s)}else{if(r&&r.strictMerge)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!a.call(Object.prototype,n))&&(t[n]=!0)}}return t}if(!t||"object"!=typeof t){if(l(n)){for(var d=Object.keys(n),h=r&&r.plainObjects?{__proto__:null,0:t}:{0:t},g=0;gr.arrayLimit?c(f(m,r),m.length-1):m}var v=t;return i(t)&&!i(n)&&(v=f(t,r)),i(t)&&i(n)?(n.forEach(function(n,o){if(a.call(t,o)){var i=t[o];i&&"object"==typeof i&&n&&"object"==typeof n?t[o]=e(i,n,r):t[t.length]=n}else t[o]=n}),t):Object.keys(n).reduce(function(t,o){var i=n[o];if(a.call(t,o)?t[o]=e(t[o],i,r):t[o]=i,l(n)&&!l(t)&&c(t,u(n)),l(t)){var s=parseInt(o,10);String(s)===o&&s>=0&&s>u(t)&&p(t,s)}return t},v)}}},7797:(e,t,n)=>{var r=n(4394);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7805:(e,t,n)=>{var r=n(3360),o=n(5288);e.exports=function(e,t,n){(void 0!==n&&!o(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},7828:(e,t,n)=>{var r=n(9325).Uint8Array;e.exports=r},7896:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(7723),o=n(6087),a=n(5928),i=n(6837),s=n(2005),c=n(7153),l=n(790);const u=/^(2001|6930|828)$/.test(n.j)?function({onSuccess:e,isOnboarding:t}){const[n,u]=(0,o.useState)({}),p=n?.user_basic_info,d=Boolean(p&&p.email),{setError:f,errorMessage:h,wizardApiFetch:g,isFetching:m}=(0,s.L)("/newspack-settings/connections/apis/google-oauth");function v(){(function(){const e=new URLSearchParams(window.location.search),t={};for(const[n,r]of e.entries())t[n]=r;return t})().access_token||g({path:"/newspack/v1/oauth/google",isCached:!1},{onSuccess(t){u(t),t?.user_basic_info&&("function"==typeof e&&e(t),f(null))}})}return(0,o.useEffect)(()=>{t||v()},[]),(0,o.useEffect)(()=>{d&&p&&!p.has_refresh_token&&f(new c.u(c.M1.GOOGLEOAUTH_REFRESH_TOKEN_EXPIRED,"googleoauth_refresh_token_expired"))},[d]),(0,l.jsx)(i.A,{title:(0,r.__)("Google","newspack-plugin"),description:m?(0,r.__)("Loading…","newspack-plugin"):d?(0,r.sprintf)( // translators: %s: connected user's email address. // translators: %s: connected user's email address. (0,r.__)("Connected as %s","newspack-plugin"),p?.email):(0,r.__)("Not connected","newspack-plugin"),isChecked:d,actionText:(0,l.jsx)(a.$n,{variant:"link",isDestructive:d,onClick:d?function(){g({path:"/newspack/v1/oauth/google/revoke",method:"DELETE"},{onSuccess:()=>u({})})}:function(){let e=null;g({path:"/newspack/v1/oauth/google/start",isCached:!1},{onSuccess(t){if(null===t)return void f(new c.u(c.M1.GOOGLE.URL_INVALID,"googleoauth_popup_blocked"));if(e=window.open(t,"newspack_google_oauth","width=500,height=600"),null===e)return void f(new c.u(c.M1.GOOGLE.OAUTH_POPUP_BLOCKED,"googleoauth_popup_blocked"));const n=setInterval(()=>{e?.closed&&(clearInterval(n),v())},500)},onError(){e&&e.close()}})},disabled:m,children:d?(0,r.__)("Disconnect","newspack-plugin"):(0,r.__)("Connect","newspack-plugin")}),error:h,isMedium:!0})}:null},7958:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(8221),o=n.n(r),a=n(6087),i=n(6427),s=n(790);class c extends a.Component{constructor(e){super(e),this.state={suggestions:[],validValues:{},loading:this.isFetchingInfoOnLoad()},this.debouncedUpdateSuggestions=o()(this.updateSuggestions,500)}isFetchingInfoOnLoad=()=>{const{tokens:e,fetchSavedInfo:t}=this.props;return Boolean(e.length&&t)};componentDidMount(){if(this.isFetchingInfoOnLoad()){const{tokens:e,fetchSavedInfo:t}=this.props;t(e).then(e=>{const{validValues:t}=this.state;e.forEach(e=>{t[e.value]=e.label}),this.setState({validValues:t,loading:!1})})}}componentDidUpdate(e){const{tokens:t,fetchSavedInfo:n}=this.props;t!==e.tokens&&this.isFetchingInfoOnLoad()&&n(t).then(e=>{const{validValues:t}=this.state;e.forEach(e=>{t[e.value]=e.label}),this.setState({validValues:t,loading:!1})})}componentWillUnmount(){delete this.suggestionsRequest,this.debouncedUpdateSuggestions.cancel()}getLabelsForValues(e){const{validValues:t}=this.state;return e.reduce((e,n)=>n?n.label?[...e,n.label]:t[n]?[...e,t[n]]:e:e,[])}getValuesForLabels(e){const{returnFullObjects:t}=this.props,{validValues:n}=this.state;return t?e.reduce((e,t)=>(Object.keys(n).forEach(r=>{if(n[r]===t){const n=/^\d+$/.test(r.toString())?parseInt(r):r.toString();e.push({value:n,label:t})}}),e),[]):e.map(e=>Object.keys(n).map(e=>/^\d+$/.test(e.toString())?parseInt(e):e.toString()).find(t=>n[t]===e))}updateSuggestions(e){const{fetchSuggestions:t}=this.props;t&&this.setState({loading:!0},()=>{const n=t(e);n.then(e=>{if(this.suggestionsRequest!==n)return;const{validValues:t}=this.state,r=[...e];e.forEach(e=>{t[e.value]=e.label}),this.setState({suggestions:r,validValues:t,loading:!1})}).catch(()=>{this.suggestionsRequest===n&&this.setState({loading:!1})}),this.suggestionsRequest=n})}handleOnChange(e){const{onChange:t}=this.props;t(this.getValuesForLabels(e))}getTokens(){const{tokens:e}=this.props;return this.getLabelsForValues(e)}render(){const{help:e,label:t="",placeholder:n="",maxLength:r,style:o,__next40pxDefaultSize:a}=this.props,{suggestions:c,loading:l}=this.state,u=["newspack-autocomplete-tokenfield__input-container"];return t&&u.push("has-label"),(0,s.jsxs)("div",{className:"newspack-autocomplete-tokenfield",style:o,children:[(0,s.jsxs)("div",{className:u.join(" "),children:[(0,s.jsx)(i.FormTokenField,{value:this.getTokens(),suggestions:c.map(e=>e.label),onChange:e=>this.handleOnChange(e),onInputChange:e=>this.debouncedUpdateSuggestions(e),label:t,maxLength:r,placeholder:n,__next40pxDefaultSize:a}),l&&(0,s.jsx)(i.Spinner,{})]}),e&&(0,s.jsx)("p",{className:"newspack-autocomplete-tokenfield__help",children:e})]})}}const l=/^(2001|2617|9406)$/.test(n.j)?c:null},7978:(e,t,n)=>{var r=n(270),o=n(8156),a=n(631),i=n(8586),s=n(756),c=n(7197),l=n(7797);e.exports=function(e,t){return i(e)&&s(t)?c(l(e),t):function(n){var i=o(n,e);return void 0===i&&i===t?a(n,e):r(t,i,3)}}},8002:e=>{"use strict";e.exports=Math.min},8059:(e,t,n)=>{var r=n(2177);e.exports=function(e){return r(2,e)}},8068:e=>{"use strict";e.exports=SyntaxError},8077:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},8096:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n{var r=n(7422);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},8168:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;tr})},8169:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(790),o=n(5573),a=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})})},8176:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(790),o=n(5573),a=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M12 4a8 8 0 1 1 .001 16.001A8 8 0 0 1 12 4Zm0 1.5a6.5 6.5 0 1 0-.001 13.001A6.5 6.5 0 0 0 12 5.5Zm.75 11h-1.5V15h1.5v1.5Zm-.445-9.234a3 3 0 0 1 .445 5.89V14h-1.5v-1.25c0-.57.452-.958.917-1.01A1.5 1.5 0 0 0 12 8.75a1.5 1.5 0 0 0-1.5 1.5H9a3 3 0 0 1 3.305-2.984Z"})})},8209:(e,t,n)=>{"object"==typeof window&&window.newspack_urls&&(n.p=window.newspack_urls.public_path)},8221:(e,t,n)=>{var r=n(3805),o=n(124),a=n(9374),i=Math.max,s=Math.min;e.exports=function(e,t,n){var c,l,u,p,d,f,h=0,g=!1,m=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=c,r=l;return c=l=void 0,h=t,p=e.apply(r,n)}function w(e){var n=e-f;return void 0===f||n>=t||n<0||m&&e-h>=u}function _(){var e=o();if(w(e))return b(e);d=setTimeout(_,function(e){var n=t-(e-f);return m?s(n,u-(e-h)):n}(e))}function b(e){return d=void 0,v&&c?y(e):(c=l=void 0,p)}function x(){var e=o(),n=w(e);if(c=arguments,l=this,f=e,n){if(void 0===d)return function(e){return h=e,d=setTimeout(_,t),g?y(e):p}(f);if(m)return clearTimeout(d),d=setTimeout(_,t),y(f)}return void 0===d&&(d=setTimeout(_,t)),p}return t=a(t)||0,r(n)&&(g=!!n.leading,u=(m="maxWait"in n)?i(a(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),x.cancel=function(){void 0!==d&&clearTimeout(d),h=0,c=f=l=d=void 0},x.flush=function(){return void 0===d?p:b(o())},x}},8223:(e,t,n)=>{var r=n(6110)(n(9325),"Map");e.exports=r},8303:(e,t,n)=>{var r=n(6110)(n(9325),"WeakMap");e.exports=r},8329:(e,t,n)=>{var r=n(4894);e.exports=function(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var a=n.length,i=t?a:-1,s=Object(n);(t?i--:++i{"use strict";if(n.d(t,{FO:()=>o,P6:()=>a,eK:()=>i}),/^(193|2636|3619)$/.test(n.j))var r=n(9430);const o=/^(193|2636|3619)$/.test(n.j)?["signin_modal","register_modal"]:null;function a(){return document.querySelector(".newspack-reader-auth-modal .newspack-reader-auth")}function i(e={}){const t=window.newspackReaderActivation.getReader(),n=e.trigger;if(!e.skipAuthenticatedCheck&&t?.authenticated)return void(e.onSuccess&&"function"==typeof e.onSuccess&&e.onSuccess());const i=a();if(!i)return void(e.onSuccess&&"function"==typeof e.onSuccess&&e.onSuccess());const s=i.closest(".newspack-reader-auth-modal");if(!s)return void(e.onSuccess&&"function"==typeof e.onSuccess&&e.onSuccess());const c=e=>{"Escape"===e.key&&d()},l=e=>{e.preventDefault(),d()};let u=!1,p=!1;const d=()=>{if(u)return;u=!0,s.removeEventListener("closeModal",f),i.config={},s.setAttribute("data-state","closed"),document.body.classList.remove("newspack-signin"),s.overlayId&&window.newspackReaderActivation?.overlays&&window.newspackReaderActivation.overlays.remove(s.overlayId);const t=i.querySelector(".opener-content");t&&t.remove(),n&&n.focus(),!p&&e.onDismiss&&"function"==typeof e.onDismiss&&e.onDismiss(),e.onClose&&"function"==typeof e.onClose&&e.onClose(),document.removeEventListener("keydown",c),h.forEach(e=>{e.removeEventListener("click",l)})},f=()=>d();s.addEventListener("closeModal",f);const h=s.querySelectorAll("button[data-close], .newspack-ui__modal__close");if(h?.length&&h.forEach(e=>{e.addEventListener("click",l)}),document.addEventListener("keydown",c),e.labels={...newspack_reader_activation_labels,...e?.labels},i.config=e,i.authCallback=(t,n)=>{p=!0,e?.closeOnSuccess&&d(),e.onSuccess&&"function"==typeof e.onSuccess&&e.onSuccess(t,n)},i.formActionCallback=t=>{s.querySelector("h2").textContent="register"===t?e.labels.register.title:e.labels.signin.title,s.querySelectorAll("[data-action]").forEach(e=>{"none"!==e.style.display&&(e.prevDisplay=e.style.display),e.style.display="none"}),s.querySelectorAll('[data-action~="'+t+'"]').forEach(e=>{e.style.display=e.prevDisplay}),r.o(s)},e.content){const t=document.createElement("div");t.classList.add("opener-content"),t.innerHTML=e.content;const n=i.querySelector("form");n.insertBefore(t,n.firstChild)}const g=i.querySelector('input[name="npe"]');g&&(g.value=t?.email||"");let m="signin";window.newspackReaderActivation?.hasAuthLink()&&(m="otp");const v=window.location.hash.replace("#","");var y;o.includes(v)&&(m="register_modal"===v?"register":"signin"),e.initialState&&(m=e.initialState),y=()=>{i.setFormAction(m,!0),"otp"===m&&window?.newspackReaderActivation?.getOTPTimeRemaining()<=0&&i.setFormAction("signin")},document._newspackReaderAuthFormReady?y():document.addEventListener("newspack-reader-auth-form-ready",y),document.body.classList.add("newspack-signin"),s.setAttribute("data-state","open"),window.newspackReaderActivation?.overlays&&(s.overlayId=window.newspackReaderActivation.overlays.add("auth-modal"),r.o(s)),o.includes(window.location.hash.replace("#",""))&&history.pushState("",document.title,window.location.pathname+window.location.search)}},8349:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(790),o=n(5573),a=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M6.13 5.5l1.926 1.927A4.975 4.975 0 007.025 10H5v1.5h2V13H5v1.5h2.1a5.002 5.002 0 009.8 0H19V13h-2v-1.5h2V10h-2.025a4.979 4.979 0 00-1.167-2.74l1.76-1.76-1.061-1.06-1.834 1.834A4.977 4.977 0 0012 5.5c-1.062 0-2.046.33-2.855.895L7.19 4.44 6.13 5.5zm2.37 5v3a3.5 3.5 0 107 0v-3a3.5 3.5 0 10-7 0z",fillRule:"evenodd",clipRule:"evenodd"})})},8351:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(790),o=n(5573),a=(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z"})})},8586:(e,t,n)=>{var r=n(6449),o=n(4394),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||i.test(e)||!a.test(e)||null!=t&&e in Object(t)}},8636:(e,t,n)=>{"use strict";var r=n(920),o=n(7720),a=n(4765),i=Object.prototype.hasOwnProperty,s={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,l=Array.prototype.push,u=function(e,t){l.apply(e,c(t)?t:[t])},p=Date.prototype.toISOString,d=a.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:o.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:a.formatters[d],indices:!1,serializeDate:function(e){return p.call(e)},skipNulls:!1,strictNullHandling:!1},h={},g=function e(t,n,a,i,s,l,p,d,g,m,v,y,w,_,b,x,k,j){for(var S,A=t,C=j,E=0,P=!1;void 0!==(C=C.get(h))&&!P;){var O=C.get(t);if(E+=1,void 0!==O){if(O===E)throw new RangeError("Cyclic object value");P=!0}void 0===C.get(h)&&(E=0)}if("function"==typeof m?A=m(n,A):A instanceof Date?A=w(A):"comma"===a&&c(A)&&(A=o.maybeMap(A,function(e){return e instanceof Date?w(e):e})),null===A){if(l)return g&&!x?g(n,f.encoder,k,"key",_):n;A=""}if("string"==typeof(S=A)||"number"==typeof S||"boolean"==typeof S||"symbol"==typeof S||"bigint"==typeof S||o.isBuffer(A))return g?[b(x?n:g(n,f.encoder,k,"key",_))+"="+b(g(A,f.encoder,k,"value",_))]:[b(n)+"="+b(String(A))];var N,L=[];if(void 0===A)return L;if("comma"===a&&c(A))x&&g&&(A=o.maybeMap(A,g)),N=[{value:A.length>0?A.join(",")||null:void 0}];else if(c(m))N=m;else{var T=Object.keys(A);N=v?T.sort(v):T}var M=d?String(n).replace(/\./g,"%2E"):String(n),I=i&&c(A)&&1===A.length?M+"[]":M;if(s&&c(A)&&0===A.length)return I+"[]";for(var R=0;R0?b+_:""}},8648:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},8655:(e,t,n)=>{var r=n(6025);e.exports=function(e){return r(this.__data__,e)>-1}},8823:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(6942),o=n.n(r);if(/^(2617|7604)$/.test(n.j))var a=n(5724);var i=n(7723),s=n(8107),c=n(6087),l=n(4715),u=n(6427),p=n(790);const d=/^(2617|7604)$/.test(n.j)?function({attributes:e,setAttributes:t}){const{signedInLabel:n,signedOutLabel:r,style:d,className:f}=e,h=(0,l.__experimentalUseBorderProps)(e),g=(0,l.__experimentalUseColorProps)(e),m=(0,l.__experimentalGetSpacingClassesAndStyles)(e),v=(f||"").split(" "),y=!v.includes("is-style-icon-only"),w=!v.includes("is-style-text-only"),_=(0,l.useBlockProps)({className:o()(f,"wp-block-button__link","newspack-reader__account-link","wp-block-newspack-my-account-button__link",g.className,h.className,{"no-border-radius":0===d?.border?.radius}),style:{...h.style,...g.style,...m.style}}),b="undefined"==typeof newspack_blocks||newspack_blocks.has_reader_activation,[x,k]=(0,c.useState)("signedout"),j="signedout"===x,S=j?r:n,A=j?(0,i.__)("Sign in","newspack-plugin"):(0,i.__)("My Account","newspack-plugin");return b?(0,p.jsxs)(p.Fragment,{children:[y&&(0,p.jsx)(l.BlockControls,{children:(0,p.jsxs)(u.ToolbarGroup,{children:[(0,p.jsx)(u.ToolbarButton,{icon:!1,isPressed:j,label:(0,i.__)("Signed out","newspack-plugin"),onClick:()=>k("signedout"),style:{paddingLeft:"12px",paddingRight:"12px"},children:(0,i.__)("Signed out","newspack-plugin")}),(0,p.jsx)(u.ToolbarButton,{icon:!1,isPressed:!j,label:(0,i.__)("Signed in","newspack-plugin"),onClick:()=>k("signedin"),style:{paddingLeft:"12px",paddingRight:"12px"},children:(0,i.__)("Signed in","newspack-plugin")})]})}),(0,p.jsx)("div",{className:o()("wp-block-buttons","is-layout-flex",f),children:(0,p.jsx)("div",{className:"wp-block-button",children:(0,p.jsxs)("div",{..._,children:[w&&(0,p.jsx)("span",{className:"wp-block-newspack-my-account-button__icon","aria-hidden":"true",children:a.A}),(0,p.jsx)(l.RichText,{tagName:"span",className:y?void 0:"screen-reader-text","aria-label":(0,i.__)("Button text","newspack-plugin"),placeholder:A,value:S||"",onChange:function(e){t(j?{signedOutLabel:(0,s.__unstableStripHTML)(e)}:{signedInLabel:(0,s.__unstableStripHTML)(e)})},withoutInteractiveFormatting:!0})]})})})]}):(0,p.jsx)("div",{..._,style:{..._.style,display:"none"}})}:null},8851:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(790),o=n(5573),a=(0,r.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)(o.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})})},8859:(e,t,n)=>{var r=n(3661),o=n(1380),a=n(1459);function i(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t{var r=n(4335)(Object.getPrototypeOf,Object);e.exports=r},8905:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>c});const r=(e={},t={})=>{const n={...e};return t?.newspack_popup_id&&(n.newspack_popup_id=t.newspack_popup_id),t?.gate_post_id&&(n.gate_post_id=t.gate_post_id),t?.sso&&(n.sso=t.sso),n},o=(e,t="np_reader_activation_interaction")=>{if("function"==typeof window.gtag&&e){for(const t of Object.keys(e))"boolean"==typeof e[t]?e[t]=e[t]?"yes":"no":"true"===e[t]?e[t]="yes":"false"===e[t]&&(e[t]="no"),e[t]=e[t].toString();window.gtag("event",t,e)}},a={},i=(e,t,n)=>{n||(n=`np_${e}`),t||(t=e=>e),a[e]={cb:t,eventName:n}},s=()=>{i("reader_registered",e=>({registration_method:e?.registration_method||"unknown"})),i("reader_logged_in",e=>({login_method:e?.login_method||"unknown"})),i("newsletter_signup",e=>({newsletters_subscription_method:e?.newsletters_subscription_method||"unknown",lists:e?.lists||[]}),"np_newsletter_subscribed"),i("subscription_cancelled"),i("subscription_reactivated"),i("subscription_switched"),i("payment_method_deleted"),i("payment_method_added"),i("payment_method_changed"),i("address_updated"),i("product_reordered"),i("subscription_renewal_early")};function c(e){s(),e.on("activity",function(e){const{action:t,data:n}=e.detail;if(!a[t])return;const{cb:i,eventName:s}=a[t],c=i(n);o(r(c,n),s)})}},8968:e=>{"use strict";e.exports=Math.floor},8984:(e,t,n)=>{var r=n(5527),o=n(3650),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))a.call(e,n)&&"constructor"!=n&&t.push(n);return t}},9019:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(790),o=n(5573),a=(0,r.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)(o.Path,{d:"M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z"})})},9214:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(790),o=n(5573),a=(0,r.jsxs)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,r.jsx)(o.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,r.jsx)(o.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})]})},9219:e=>{e.exports=function(e,t){return e.has(t)}},9290:e=>{"use strict";e.exports=RangeError},9302:(e,t,n)=>{var r=n(3488),o=n(6757),a=n(2865);e.exports=function(e,t){return a(o(e,t,r),e+"")}},9325:(e,t,n)=>{var r=n(4840),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},9326:(e,t,n)=>{var r=n(1769),o=n(2428),a=n(6449),i=n(361),s=n(294),c=n(7797);e.exports=function(e,t,n){for(var l=-1,u=(t=r(t,e)).length,p=!1;++l{var r=n(3805),o=Object.create,a=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=a},9350:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},9353:e=>{"use strict";var t=Object.prototype.toString,n=Math.max,r=function(e,t){for(var n=[],r=0;r{var r=n(4128),o=n(3805),a=n(4394),i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):i.test(e)?NaN:+e}},9383:e=>{"use strict";e.exports=Error},9430:(e,t,n)=>{"use strict";function r(e){const t=[],n=e.querySelectorAll('button, [href], input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])');if(0===n.length)return!1;const r=n?.[0];n.forEach(function(e,n){null!==e.offsetParent&&(t[n]=e)});const o=t[t.length-1];r.focus(),document.addEventListener("keydown",function(e){("Tab"===e.key||9===e.keyCode)&&(e.shiftKey?document.activeElement===r&&(o.focus(),e.preventDefault()):document.activeElement===o&&(r.focus(),e.preventDefault()))})}n.d(t,{o:()=>r})},9538:e=>{"use strict";e.exports=ReferenceError},9570:(e,t,n)=>{var r=n(7334),o=n(3243),a=n(3488),i=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:a;e.exports=i},9612:e=>{"use strict";e.exports=Object},9653:(e,t,n)=>{var r=n(7828);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},9675:e=>{"use strict";e.exports=TypeError},9770:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,a=[];++n{e.exports=function(e){return this.__data__.has(e)}},9884:(e,t,n)=>{var r=n(1791),o=n(7241);e.exports=function(e){return r(e,o(e))}},9935:e=>{e.exports=function(){return!1}},9957:(e,t,n)=>{"use strict";var r=Function.prototype.call,o=Object.prototype.hasOwnProperty,a=n(6743);e.exports=a.call(r,o)}}]);