!function(e,t){for(var n in t)e[n]=t[n]}(exports,function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t){e.exports=require("react")},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:[];return e.includes("100")||e.includes("110")||e.includes("120")?"wall_retargeting":"wall_standard"}function V(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(",").map(function(e){return e.replace(/\/|^wp - /g,"").replace(/,/g,";").trim()}).join(";").toLocaleLowerCase()}function X(e,t){var n,r,o,a,i,l;return{label:"o1",browserUserAgentHit:navigator.userAgent,promoCode:"o1",acqEntranceType:z(null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.actionCodes),geoMarket:(a=M().DMA===N,i=M().country_code,l=U(),a&&"US"===i?"L":i&&"US"!==i&&"CA"!==i&&!l?"I":l?"E":"CA"===i?"C":"N"),acqTemplate:"",acqEntrancePage:k(),arcId:t||"",contentTags:V(null===(r=window)||void 0===r?void 0:null===(o=r.wpMetaData)||void 0===o?void 0:o.ct_tags),actionCode:"".concat(null==e?void 0:e.action)}}var Y=function(e,t){var n=e.pwapiResponse,r=e.arcId,o=function(e){window.dataLayer=window.dataLayer||[],window.dataLayer.push(e)};return{GAData:H(H({},X(n,r)),t),addEvent:o,addEventWithArticleData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(H(H(H({userAgentHit:window.navigator.userAgent,userAgentSession:window.navigator.userAgent},X(n,r)),t),e))},addMarketingEvent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"paywall";o({event:"acq_marketing_".concat(e),category:"acquisition",action:"acq_marketing"})},addGAParamsToURL:function(e,o){var a=H(H(H({},X(n,r)),t),o),i=encodeURIComponent(F()),l={promo:a.promoCode,arcId:a.arcId,acqEntType:a.acqEntranceType,destination:i,next_url:i,p:a.subscription_pricing,s_l:a.subscription_location,e:a.subscription_experience},c=new URL(e);return Object.keys(l).forEach(function(e){l[e]&&c.searchParams.append(e,l[e])}),c.toString()}}},q="wp_nl";function K(e){return{softwall:"sw","softwall-nl":"sw","softwall-subscribe":"sw",regwall:"rw","paywall-purchase":"pw","paywall-default":"pw"}[e]}function $(){return"undefined"!=typeof window?JSON.parse(localStorage.getItem(q)||"{}"):{}}function Q(e){localStorage.setItem(q,JSON.stringify(e))}function J(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:48,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:720,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"softwall",a=$(),i=K(o);if(t){var l=Date.now()+60*n*60*1e3;a[i]=l,Q(a)}else if(e){var c=Date.now()+60*r*60*1e3;a[e]=c,Q(a)}}function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=$(),n=(t[e]||0)+1;t[e]=n,Q(t)}var ee=function(){return"1"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")},te=function(){return"2"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")};function ne(){var e=D("wp_devicetype");return te(e)?"tablet":ee(e)?"mobile":"desktop"}var re=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(",").map(function(e){return e.trim()}).includes(ne())};function oe(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=re(e.EXCLUDING_PLATFORMS),r=!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"softwall",n=$(),r=K(t);if(!n[r]&&!n[e])return!0;var o=Date.now(),a=!n[r]||n[r]0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=$()[e]||0;return n>=t&&0!==n||-1===n}(e.PAYWALL_TEMPLATE_ID,e.MAX_SNOOZE);return{isExcluded:n,shouldCloseWall:!/\/wall-builder\//.test(location.href)&&(t||n||!(null!=e&&e.SHOW_ALWAYS)&&r)&&!window.pendingIframeResize}}var ae=function(){var e=Object(r.useContext)(a).setSizes,t=function(){requestAnimationFrame(function(){e&&e({isSmall:v(),isMedium:m(),isLarge:h(),isExtraLarge:w()})})};return Object(r.useEffect)(function(){return"undefined"!=typeof window&&(e&&e({isExtraLarge:w()}),window.addEventListener("resize",t,!1)),function(){"undefined"!=typeof window&&window.removeEventListener("resize",t,!1)}},[]),null},ie={NODE_ENV:"production",SERVICE_URL:"https://subscribe.washingtonpost.com",WALL_CONFIG:{SOFTWALL_V2_RIGHT_IMAGE_URL:"https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/PQBESXDB4FENRB4SO7L7VNSLQE.png",ACQ_BASE_URL:"https://subscribe.washingtonpost.com",HAS_PROMO_LABEL:"none",COLLAPSED_HEADER_DESKTOP:"Stay informed with your free trial to The Washington Post.",SUBSCRIPTION_LOCATION:"ONSITE_SOFTWALL_EXPANDED",SUPPORTING_TEXT:"24/7 coverage from 1000+ journalists. Subscriber-exclusive events. Unmatched political and international news.",PAYWALL_TEMPLATE_ID:"softwall-8496cd48b47",MIN_SUBSCRIPTION_LOCATION:"ONSITE_SOFTWALL_COLLAPSED",SOFTWALL_V2_EXPANDED_BODY_STYLE:"left",SOFTWALL_V2_CTA_BUTTON_HEX_COLOR_OVERRIDE:"",SOFTWALL_V2_COLLAPSED_HEADER_DESKTOP:"Stay informed with your free trial to The Washington Post.",MIN_ON_LOAD:!1,SOFTWALL_V2_MIN_CTA_PROMO_CODE:"o_wb",SOFTWALL_V2_CTA_LINK:"",PROMO_LABEL_HAS_LOGO:!1,SOFTWALL_V2_BACKGROUND_COLOR:"Pale blue",GTM_LOADER:"gtm",PROMO_LABEL_PRIMARY_COLOR:"Offblack",CTA_BUTTON_COLOR:"Blue",PROMO_LABEL_SECONDARY:"2 DAYS ONLY",PROMO_LABEL_SECONDARY_COLOR:"Offblack",EEA:{},CLOSE_BUTTON_EXPIRATION_HOUR:24,SOFTWALL_V2_EXPANDED_HEADER:"Stay informed with your free trial to The Washington Post.",DEPLOYMENT_TOKEN:1650047909012,CTA_PROMO_CODE:"o_wb",SOFTWALL_V2_CTA_BUTTON_TEXT:"Get 4 weeks free",CTA_LINK:"",DEFAULT_FONT_COLOR:"offblack",REGION:"US",WALL_CONFIG_ID:"6cd48b47-4f85-4c3c-ad3d-a6bdbe75be9d",BACKGROUND_COLOR:"Pale blue",EXCLUDING_PLATFORMS:"mobile",AU:{},SHOW_ALWAYS:!1,SOFTWALL_V2_CLICK_TRIGGER:"You can cancel anytime",DEFAULT_LINK_COLOR:"gray-dark",COLLAPSED_HEADER_MOBILE:"Support journalism.",SOFTWALL_V2_CTA_PROMO_CODE:"o_wb",RIGHT_IMAGE_URL:"https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/PQBESXDB4FENRB4SO7L7VNSLQE.png",AUTO_COLLAPSED:!1,CTA_BUTTON_HEX_COLOR_OVERRIDE:"",AUTO_COLLAPSED_SECOND:5,LEFT_IMAGE_URL:"http://placehold.jp/400x400.png",REGION_LIST:[],SCREEN_STATE:"Default",SOFTWALL_V2_CTA_BUTTON_COLOR:"Blue",SHOW_CLOSE_ON_EXPAND:!1,EXPANDED_HEADER:"Stay informed with your free trial to The Washington Post.",TEMPLATE_ID:"softwall-subscribe",SOFTWALL_V2_CTA_BUTTON_STYLE:"Button",SOFTWALL_V2_SUPPORTING_TEXT:"24/7 coverage from 1000+ journalists. Subscriber-exclusive events. Unmatched political and international news.",SOFTWALL_V2_MOBILE_IMAGE_URL:"https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/PQBESXDB4FENRB4SO7L7VNSLQE.png",PROMO_LABEL_PRIMARY:"LIMITED TIME OFFER",ASSET_BASE_URL:"https://www.washingtonpost.com/subscribe",NOTE:"",CTA_BUTTON_TEXT:"Get 4 weeks free",INCLUDE_LOGGING:!0,PRICING_STRATEGY:"Annual",GB:{},EXPAND_ON_SCROLL:!1,CA:{},SOFTWALL_V2_COLLAPSED_HEADER_MOBILE:"Support journalism.",SUBMIT_EXPIRATION_HOUR:720,SHOW_CLOSE_ON_MIN:!0,EXPANDED_BODY_STYLE:"left",SOFTWALL_TYPE:"Default",MIN_CTA_PROMO_CODE:"o_wb",CTA_BUTTON_STYLE:"Button",EXPANDABLE:!0,CLICK_TRIGGER:"You can cancel anytime",COLLAPSE_ON_SCROLL:!1,SOFTWALL_V2_LEFT_IMAGE_URL:"http://placehold.jp/400x400.png",MOBILE_IMAGE_URL:"https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/PQBESXDB4FENRB4SO7L7VNSLQE.png",SUBSCRIPTION_EXPERIENCE:"FTP_US_0422_4WF",SUBSCRIPTION_PRICING:"US_0422_4WF",INTL:{},US:{}},VERSION:"3.2.9"};function le(e){var t=D("wp_geo").split("|"),n=t[0],r=t[t.length-1];return e.includes(n)||(n=r),n}function ce(e){var t,n,r,i=e.wallState,l=e.children,c="default";!parent.location.href.includes("wall-builder")&&(null==i?void 0:null===(t=i.wallConfig)||void 0===t?void 0:null===(n=t.REGION_LIST)||void 0===n?void 0:n.length)>0&&(c=le(null==i?void 0:null===(r=i.wallConfig)||void 0===r?void 0:r.REGION_LIST).toLowerCase());return o.a.createElement(a.Provider,{value:i},l,o.a.createElement(ae,null),o.a.createElement("span",{id:"wall-templates-version","data-qa":"region-".concat(c),style:{display:"none"}},ie.VERSION))}function ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function se(e){for(var t=1;t$/,"").trim())))))}}};function me(){return(me=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var qe=function(e){var t=e.children,n=e.color,i=void 0===n?"WaPo blue":n,c=e.href,u=e.className,s=e.style,f=e.onClick,d=e.rounded,p=e.sendMessages,O=void 0!==p&&p,b=e.contentId,y=void 0===b?"":b,g=e.buttonStyle,v=void 0===g?"Button":g,m=e.innerHTML,h=void 0===m?"Subscribe":m,w=e.isLoading,E=void 0!==w&&w,L=Ye(e,He),_=ve(y),S=_.onChange,j=_.isContentEditable,P=Object(r.useContext)(a).wallConfig,T=null==P?void 0:P.DEFAULT_FONT_COLOR,C="",I="Link"===v||"Arrow"===v||"Text"===v,x="Text"===v;C=I||"White"!==i&&"Black"!==i&&"WaPo blue"!==i?I?l()({"subs-theme":"White"!==i&&"WaPo blue"!==i&&"Black"!==i},"".concat([A[i]]," bold")):"btn subs-theme bg-".concat(A[i]):"btn btn-".concat(A[i]),h=E?" ".concat(h):h;var R=t||o.a.createElement("span",{dangerouslySetInnerHTML:{__html:h},id:y,contentEditable:!!y&&j}),D=Ve({role:"button",href:c,style:Ve(Ve({whiteSpace:I?"normal":"nowrap",boxSizing:"border-box",borderRadius:d?"31px":0},s),{},{borderColor:"White"!==i?"unset":void 0,padding:I?"":null==s?void 0:s.padding,border:"white"===T?"unset":"initial"}),onBlur:S,onClick:function(e){y&&!j||!y?f&&f(e):j&&e.preventDefault()},className:l()(u,"ma-0",{pointer:!x},{dib:!I},C),children:o.a.createElement(o.a.Fragment,null,R,"Arrow"===v?o.a.createElement(We,{angle:0,size:16,color:(null==s?void 0:s.color)||i,style:{marginLeft:"5px",verticalAlign:"middle"}}):null)},L),N="".concat(y,"_CTA_WRAPPER");if(c||j&&y||I&&!x){var M="_self";return c&&O&&!parent.location.href.includes("wall-builder")&&(M="_top"),o.a.createElement("a",Ge({id:N},D,{target:M}))}return x?o.a.createElement("div",Ge({id:N},D)):o.a.createElement("button",Ge({id:N},D))};var Ke=function(e){var t=e.color,n=e.acquisitionURL,i=e.buttonStyle,l=e.hexOverride,c=e.buttonText,u=e.sendMessages,s=void 0!==u&&u,f=Object(r.useContext)(a),d=f.isSmall,p=f.wallConfig;return d&&"Button"===i&&(i="Link"),o.a.createElement(qe,{contentId:"CTA_BUTTON_TEXT",color:t,buttonStyle:i,href:n,rounded:!0,sendMessages:s,className:"dib",style:{padding:d||"Button"!==i?"":"7px 32px",backgroundColor:"Button"===i?l:void 0,color:"Button"!==i?l:void 0,borderColor:l,marginLeft:d?"0px":void 0,marginRight:d?"16px":void 0},onClick:function(){J("",!0,p.CLOSE_BUTTON_EXPIRATION_HOUR)},innerHTML:c})};function $e(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Qe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qe(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=gt(Object(r.useState)(!1),2),i=a[0],l=a[1];var c=!1;function u(r,o){console.info("Opt - NAME/VALUE: ".concat(o,"/").concat(r," - ended? ").concat(c));var a=window.dataLayer&&window.dataLayer.filter(function(e){return e["optimize.".concat(t,".").concat(o,".").concat(r,".complete")]})[0]||!1;if(!c&&e.includes(o)&&(a||"timeout"===r)){if(n(window["".concat(o).concat(r,"_").concat(t,"Cfg")]||{}),l(!0),"timeout"!==r){var i={optExpActive:"".concat(t,"|").concat(o,".").concat(r)};window&&window.dataLayer&&window.dataLayer.push(i)}c=!0,console.info("Opt - NAME/VALUE: ".concat(o,"/").concat(r," complete"))}}var s=Object(r.useCallback)(function(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"optimize.wall"})},[t]);return Object(r.useEffect)(function(){if(e.length>0){!function(){window.dataLayer&&window.dataLayer.push(arguments)}("event","optimize.callback",{callback:u});var t=2e3,n=o&&parent&&!parent.location.href.includes("wall-builder");e.forEach(function(e){var r,o=void 0!==(null===(r=window.google_optimize)||void 0===r?void 0:r.get(e));t=o||n?t:0}),s(),setTimeout(function(){e.forEach(function(e){u("timeout",e)})},t)}else l(!0)},[e]),{isOptimize:e.length>0,isExperimentComplete:i}};function ht(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return wt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&(c(!1),s())};return Object(r.useEffect)(function(){var e;return t&&u?(a.postMessage("CloseRegwall","*"),c(!1)):u&&!n?(c(!0),window.addEventListener("message",f,!1),!(e=a.document.getElementById("slug_fixedBottom"))||e&&e.offsetHeight<=0?(c(!1),s()):e&&e.offsetHeight>0&&setTimeout(function(){e=a.document.getElementById("slug_fixedBottom");var t=a.googletag||{};Array.isArray(t.cmd)&&0===t.cmd.length&&(!e||e.childElementCount<=0)&&(c(!1),s())},2e3)):c(!1),function(){s()}},[t]),l};function Lt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _t(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _t(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2],o=Lt(Object(r.useState)(!1),2),a=o[0],i=o[1],l=Lt(Object(r.useState)(!1),2),c=l[0],u=l[1],s=Lt(Object(r.useState)([]),2),f=s[0],d=s[1],p=Lt(Object(r.useState)(null),2),O=p[0],b=p[1],y=n&&parent&&!parent.location.href.includes("wall-builder"),g=y?parent:window,v=function e(t){var n;if(t.lineItemId)b(t.lineItemId),n=t.lineItemId;else{var r=t.slot;if(r&&r.getResponseInformation){var o=(r.getResponseInformation()||{}).sourceAgnosticLineItemId;b(o),n=o}}n&&(g.googletag.pubads().removeEventListener("slotRenderEnded",e),g.googletag.pubads().removeEventListener("impressionViewable",e))};return Object(r.useEffect)(function(){var n=ne(),r=(t||"").indexOf(n)>-1;if(!/wall-builder/.test(g.location.href)&&r&&e&&"undefined"!=typeof window){var o=g.wpMetaData||{},a=g.googletag||{};Array.isArray(a.cmd)&&0===a.cmd.length?u(!0):(o.adTrackerId||(g.googletag=g.googletag||{cmd:[]},g.googletag.cmd.push(function(){g.googletag.pubads().addEventListener("slotRenderEnded",v)}),g.googletag.cmd.push(function(){g.googletag.pubads().addEventListener("impressionViewable",v)})),fetch("https://sponsorship-lines.zeustechnology.com/washingtonpost/washingtonpost/lineItems.json").then(function(e){return e.json()}).then(function(e){if(!e||!Array.isArray(e)||e&&0===e.length)u(!0);else if(g=y?parent:window,(o=g.wpMetaData||{}).adTrackerId||O){var t=o.adTrackerId||O,n=St.indexOf(t)<0&&e.indexOf(t)>-1;i(n),u(!0)}else d(e)}).catch(function(e){console.error(e,"Failed to retrieve ids from the sponsorship tracker."),u(!0)}))}else u(!0)},[]),Object(r.useEffect)(function(){if(!c&&O&&f.length>0){var e=St.indexOf(O||0)<0&&f.indexOf(O)>-1;i(e),u(!0)}},[O,f,c]),{hideWallDueToAds:a,isSponsorAdChecked:c}};function jt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"both",o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:70,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],l=arguments.length>4&&void 0!==arguments[4]&&arguments[4],c=jt(Object(r.useState)({scrollUp:!1,scrollDown:!1}),2),u=c[0],s=c[1],f=l&&parent&&!parent.location.href.includes("wall-builder")?parent:window,d=function(){t&&f.cancelAnimationFrame(t),t=f.requestAnimationFrame(function(){var t=f.pageYOffset||f.document.documentElement.scrollTop,r=t>e+a;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){var o,a=le(null===(o=e)||void 0===o?void 0:o.REGION_LIST);e=Dt(Dt({},e),e[a])}return e}(s,n.currentRegion),parent.location.href.includes("wall-builder")||(n.wallConfig=s),Object.keys(c).length&&(n.wallConfig=Bt(Bt({},s),c),s=n.wallConfig);var f=mt(null===(t=s)||void 0===t?void 0:t.EXPERIMENT_ID,"softwall",u,i),d=f.isOptimize,p=f.isExperimentComplete,O=s,b=O.MIN_ON_LOAD,y=O.PRICING_STRATEGY,g=O.GA_ACTION,v=O.GA_CATEGORY,m=O.GA_LABEL,h=O.ITID,w=O.CTA_PROMO_CODE,E=O.SUBSCRIPTION_PRICING,L=O.SUBSCRIPTION_EXPERIENCE,_=O.SUBSCRIPTION_LOCATION,S=O.CTA_LINK,A=O.MIN_SUBSCRIPTION_LOCATION,j=O.PAYWALL_TEMPLATE_ID,P=O.BACKGROUND_COLOR,T=O.EXPANDABLE,C=O.SCREEN_STATE,I=O.LISTEN_FOR_ADS,x=O.LISTEN_FOR_ADS_PLATFORMS,D=At(I,x,i),N=D.hideWallDueToAds,M=D.isSponsorAdChecked,U=Object(r.useMemo)(function(){return oe(s,N)},[M]),k=U.isExcluded,W=U.shouldCloseWall,H=Et({shouldCloseWall:W,isExcluded:k,sendMessages:i}),G=Ft(Object(r.useState)(!1),2),z=G[0],V=G[1],X=Ft(Object(r.useState)(!!b),2),q=X[0],K=X[1],$=Ft(Object(r.useState)(!1),2),Q=$[0],J=$[1],Z=Ft(Object(r.useState)(""),2),ee=Z[0],te=Z[1],ne=Ft(Object(r.useState)(""),2),re=ne[0],ae=ne[1];Object(r.useEffect)(function(){i&&parent&&!parent.location.href.includes("wall-builder")&&parent.postMessage(JSON.stringify({background:"transparent",bottom:"0px",scrollAllowed:!0,wallAction:"open",wallType:"softwall"}),"*")},[]),Object(r.useLayoutEffect)(function(){if(i&&parent){var e="Default";b&&Q?e="Expanded":b||Q||!q||(e="Collapsed"),parent.location.href.includes("wall-builder")&&parent.postMessage({newScreenState:e},"*")}},[Q]);var ue="Annual"===y||void 0===y?void 0:"wall_standard",se=function(e,t){if("undefined"!=typeof window){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t||location.search);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))}return""}("promoCode",S),fe={label:m||w,promoCode:"Custom Link"===s.SOFTWALL_TYPE?se:w,arcId:null==a?void 0:a._id,event:g||"acquisition-softwall-subscribe",category:v||"acquisition",action:g||"acquisition-softwall-subscribe"};"Default"===s.SOFTWALL_TYPE&&(fe=Bt(Bt({},fe),{subscription_pricing:E,subscription_location:A,subscription_experience:L,acqEntranceType:ue}));var de=Y(n,fe),pe=de.addEventWithArticleData,Oe=de.addMarketingEvent,be=de.addGAParamsToURL;Object(r.useEffect)(function(){i&&parent&&!parent.location.href.includes("wall-builder")&&W&&parent.postMessage(JSON.stringify({wall:!0,wallType:"softwall",wallAction:"close"}),"*")},[W]),Object(r.useEffect)(function(){M&&!W&&pe()},[w,E,L,M]),Object(r.useEffect)(function(){if(M&&!W)if(S)ye();else{var e={prod:"https://subscribe.washingtonpost.com/acquisition?",sandbox:"https://subs-stage.washingtonpost.com/acquisition?",dev:"https://subscribe.digitalink.com/acquisition?"}[B()];te(be(e,{subscription_location:_})),ae(be(e,{subscription_location:A}))}},[s,M]);var ye=function(){var e=S||"";try{var t=new URL(e);if(h&&(t.searchParams.delete("itid"),t.searchParams.append("itid",h)),t){t.searchParams.append("next_url",F()),t.searchParams.append("arcId",(null==a?void 0:a._id)||"");var n=Q?_||"":A||"";t.searchParams.append("s_l",n),t.searchParams.append("e",L||"")}e=t.toString()}catch(e){}te(e),ae(e)};Object(r.useEffect)(function(){q&&J(!b&&"Collapsed"!==C||"Expanded"===C)},[T,C,b,q]),Object(r.useEffect)(function(){M&&!W&&Oe("softwall")},[M]);var ge=xt(s,!!T,H,i),ve=ge.collapseOnScroll,me=ge.expandOnScroll,he=ge.activateAutoCollapse;Object(r.useEffect)(function(){M&&(!Q&&me&&!W||Q&&ve&&!W)&&we()},[me,ve,M]);var we=function(){J(!Q),V(!0);var e=he?"auto-minimize":"minimize";he?e="collapse-auto":ve&&(e="collapse-scroll");var t=me?"expand-scroll":"expand";"Custom Link"===s.SOFTWALL_TYPE?(ye(),pe({event:"".concat(fe.event,"-").concat(Q?e:t),category:fe.category,action:"".concat(fe.action,"-").concat(Q?e:t)})):"Default"===s.SOFTWALL_TYPE&&pe({event:"".concat(fe.event,"-").concat(Q?e:t),category:fe.category,action:"".concat(fe.action,"-").concat(Q?e:t),subscription_location:Q?A:_})},Ee={wallConfig:s,GAEventData:fe,handleExpand:we,isExpanded:Q,sendMessages:i};return!M||!/\/wall-builder\//.test(location.href)&&(W||!n.isShowing&&"test"!==ie.NODE_ENV||H)?null:o.a.createElement(ce,e,o.a.createElement(R,{id:j,backgroundColor:P||"White",triggerResize:Q?0:1,sendMessages:i,style:d&&!p?{height:0}:{},templateId:s.TEMPLATE_ID},b&&0==T?null:o.a.createElement(yt,Mt({},Ee,{CTAURL:ee,onImageLoad:K,sendMessages:i})),q?o.a.createElement(tt,Mt({},Ee,{hasExpanded:z,CTAURL:re,sendMessages:i})):null))});Ht.displayName="SoftwallSubscribe";t.default=Ht}])); //# sourceURL=browsertools://www.washingtonpost.com/subscribe/remote-component1650047917779.js