@guardian/support-dotcom-components 2.5.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/shared/src/lib/tracking.d.ts +1 -1
- package/dist/shared/src/lib/tracking.d.ts.map +1 -1
- package/dist/shared/src/types/abTests/banner.d.ts +57 -1
- package/dist/shared/src/types/abTests/banner.d.ts.map +1 -1
- package/dist/shared/src/types/abTests/shared.d.ts +1 -1
- package/dist/shared/src/types/abTests/shared.d.ts.map +1 -1
- package/dist/shared/src/types/index.d.ts +0 -1
- package/dist/shared/src/types/index.d.ts.map +1 -1
- package/dist/shared/src/types/props/banner.d.ts +22 -6
- package/dist/shared/src/types/props/banner.d.ts.map +1 -1
- package/dist/shared/src/types/props/epic.d.ts +2 -6
- package/dist/shared/src/types/props/epic.d.ts.map +1 -1
- package/dist/shared/src/types/props/header.d.ts +1 -1
- package/dist/shared/src/types/props/header.d.ts.map +1 -1
- package/dist/shared/src/types/props/shared.d.ts +32 -0
- package/dist/shared/src/types/props/shared.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/shared/src/types/ophan.d.ts +0 -28
- package/dist/shared/src/types/ophan.d.ts.map +0 -1
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"zod";const n="gu.contributions.views",t=e=>e.get(n)||void 0,a=e=>{const t=localStorage.getItem(n),a=t?JSON.parse(t).value:[];a.push({date:(new Date).getTime(),testId:e});const i={value:a.slice(-50)};localStorage.setItem(n,JSON.stringify(i))},i="gu.history.weeklyArticleCount",r="gu.history.articleCountsThisWeek",o=e=>{const n=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(n-1))/864e5},s=e=>e.get(i)||void 0,l=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes"]),u=(e,n={})=>(e.forEach((e=>{l.has(e)&&(n[e]=(n[e]??0)+1)})),n),c=(e,n,t)=>{const a=((e,n)=>{const t=o(new Date),a=e.get(r);if(a&&a.week===t){const i=a.articles[n]||0;return e.set(r,{week:t,articles:{...a.articles,[n]:i+1}}),i>0}return e.set(r,{week:t,articles:{[n]:1}}),!1})(e,n);if(!a){const n=o(new Date),a=e.get(i)||[],r=a[0];if(r&&r.week&&r.week===n)r.count+=1,r.tags=u(t,r.tags),e.set(i,a);else{a.unshift({week:n,count:1,tags:u(t,{})});const r=n-365,o=a.filter((e=>e.week>=r));e.set(i,o)}}},d=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],g=e.enum(d),m={GBPCountries:{name:"United Kingdom",currency:"GBP",countries:["GB","FK","GI","GG","IM","JE","SH"],supportRegionId:"UK"},UnitedStates:{name:"United States",currency:"USD",countries:["US"],supportRegionId:"US"},AUDCountries:{name:"Australia",currency:"AUD",countries:["AU","KI","NR","NF","TV"],supportRegionId:"AU"},EURCountries:{name:"Europe",currency:"EUR",countries:["AD","AL","AT","BA","BE","BG","BL","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GF","GL","GP","GR","HR","HU","IE","IT","LI","LT","LU","LV","MC","ME","MF","IS","MQ","MT","NL","NO","PF","PL","PM","PT","RE","RO","RS","SE","SI","SJ","SK","SM","TF","TR","WF","YT","VA","AX","AZ","AM","GE","BY","MD","UA","MK"],supportRegionId:"EU"},International:{name:"International",currency:"USD",countries:["AE","AF","AG","AI","AO","AQ","AR","AS","AW","BB","BD","BF","BH","BI","BJ","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BZ","CC","CD","CF","CG","CI","CL","CM","CN","CO","CR","CU","CV","CW","CX","DJ","DM","DO","DZ","EC","EG","EH","ER","ET","FJ","FM","GA","GD","GH","GM","GN","GQ","GS","GT","GU","GW","GY","HK","HM","HN","HT","ID","IL","IN","IO","IQ","IR","JM","JO","JP","KE","KG","KH","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LK","LR","LS","LY","MA","MG","MH","ML","MM","MN","MO","MP","MR","MS","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NG","NI","NP","NU","OM","PA","PE","PG","PH","PK","PN","PR","PS","PW","PY","QA","RU","RW","SA","SB","SC","SD","SG","SL","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TT","TW","TZ","UG","UM","UY","UZ","VC","VE","VG","VI","VN","VU","WS","YE","ZA","ZM","ZW"],supportRegionId:"INT"},NZDCountries:{name:"New Zealand",currency:"NZD",countries:["NZ","CK"],supportRegionId:"NZ"},Canada:{name:"Canada",currency:"CAD",countries:["CA"],supportRegionId:"CA"}},C={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},p={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},b=e=>Object.keys(m).find((n=>m[n].countries.includes(e??"")))||"International",S=(e,n=[])=>0===n.length||!!e&&n.includes(b(e.toUpperCase())),h=e=>{if(e){const n=b(e);return p[n]}return"£"},y=e=>{if(e)return C[e]},A=(e,n)=>{if(n){const t=(e=>m[b(e)]?.supportRegionId)(n);if(t)return e.replace(/(support.theguardian.com)\/(contribute-in-epic|contribute|subscribe)/,((e,n,a)=>`${n}/${t.toLowerCase()}/${a}`))}return e},T=(e,n,t,a)=>{if(a){const i=a[b(t)];if(i){return`${h(t)}${i[e][n].price}`}}},I={CURRENCY_SYMBOL:({countryCode:e})=>h(e),COUNTRY_NAME:({countryCode:e})=>y(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:n})=>T("Digisub","Monthly",e,n),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:n})=>T("Digisub","Annual",e,n),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:n})=>T("GuardianWeekly","Monthly",e,n),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:n})=>T("GuardianWeekly","Annual",e,n),DAY_OF_THE_WEEK:()=>((e=new Date)=>e.toLocaleString("en-GB",{weekday:"long"}))(),DATE:()=>((e=new Date)=>e.toLocaleString("en-GB",{day:"numeric",month:"long",year:"numeric"}))()},N=(e,n,t)=>e?e.replace(M,(e=>{const a=e.substring(2,e.length-2),i=I[a];if(i){const e=i({countryCode:n,prices:t});if(e)return e}return e})):"",M=/%%.*?%%/g,E=e=>{const n=e.match(M)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!n&&n.length>0},G=e=>{const n=(e=>{const n=new Date(e,10,1).getDay();return new Date(e,10,22+(11-n)%7)})(e);return n.setDate(n.getDate()+5),n},U=(e=new Date)=>{const n=(e=>{const n=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+n),e})(e),t=(n.getMonth()+1).toString().padStart(2,"0"),a=n.toLocaleString("default",{month:"long"}),i=n.getFullYear();return{reminderCta:`Remind me in ${a}`,reminderPeriod:`${i}-${t}-01`,reminderLabel:`${a} ${i}`}},R=new Date("2023-12-31"),B=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<G(e.getFullYear()),P=(e,n=new Date)=>{return"US"===e&&B(n)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${t=n.getFullYear()}-${(G(t).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${t}`}:"US"===e&&(e=>e>=G(e.getFullYear())&&e<R)(n)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(n.getFullYear()):U(n);var t},L=e.object({text:e.string(),baseUrl:e.string()});let D=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});e.nativeEnum(D);const w=e.object({type:e.literal(D.Custom),cta:L}),O=e.object({type:e.literal(D.ContributionsReminder)}),f=e.discriminatedUnion("type",[w,O]);let k=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const K=e.nativeEnum(k);let F=function(e){return e.money="money",e}({});const v=e.nativeEnum(F),H=e.object({countLabel:e.string(),goalReachedPrimary:e.string(),goalReachedSecondary:e.string()}),Y=e.object({total:e.number(),goal:e.number()}),j=e.enum(["US","AU"]),V=e.object({endType:K,countType:v,currencySymbol:e.string(),copy:H,name:j,tickerData:Y.optional()}),W=e.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),Z=e.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),x=e.object({abTestName:e.string(),abTestVariant:e.string(),campaignCode:e.string(),componentType:Z,products:e.array(W).nullish(),labels:e.array(e.string()).nullish(),ophanPageId:e.string(),platformId:e.string(),referrerUrl:e.string(),clientName:e.string()}),$=e.object({mainUrl:e.string(),mobileUrl:e.string().optional(),tabletUrl:e.string().optional(),desktopUrl:e.string().optional(),leftColUrl:e.string().optional(),wideUrl:e.string().optional(),altText:e.string()}),_=e.object({name:e.string(),description:e.string().optional(),headshot:$.optional()}),J=e.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),Q=e.enum(["new","guest","current"]),z=e.enum(["Live","Draft","Archived"]),q=e.enum(["Mobile","Desktop","All","iOS","Android"]),X=e.enum(["SignedIn","SignedOut","All"]),ee=e.enum(["HasConsented","HasNotConsented","All"]),ne=e.object({name:e.string(),status:z,priority:e.number(),controlProportionSettings:e.object({proportion:e.number(),offset:e.number()}).optional(),deviceType:q.optional(),signedInStatus:X.optional(),consentStatus:ee.optional()}),te=e.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),ae=e.object({minViews:e.number(),maxViews:e.number().optional(),periodInWeeks:e.number(),tagIds:e.array(e.string()).optional()});e.object({userType:e.array(Q),product:e.array(J)}),e.object({tagIds:e.array(e.string()),sectionIds:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSectionIds:e.array(e.string())});const ie=e.enum(["for52Weeks","forTargetedWeeks"]),re=e.object({for52Weeks:e.number(),forTargetedWeeks:e.number()}),oe=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),se=e.object({type:e.literal("above"),copy:e.string().optional(),countType:ie.optional()}),le=e.object({reminderCta:e.string(),reminderLabel:e.string(),reminderPeriod:e.string()}),ue=e.enum(["ONE_OFF","MONTHLY","ANNUAL"]),ce=e.object({testName:e.string(),variantName:e.string(),defaultContributionType:ue,displayContributionType:ue.array(),amountsCardData:e.object({ONE_OFF:e.object({amounts:e.array(e.number()),defaultAmount:e.number(),hideChooseYourAmount:e.boolean().optional()}),MONTHLY:e.object({amounts:e.array(e.number()),defaultAmount:e.number(),hideChooseYourAmount:e.boolean().optional()}),ANNUAL:e.object({amounts:e.array(e.number()),defaultAmount:e.number(),hideChooseYourAmount:e.boolean().optional()})})}),de=e.object({url:e.string()}),ge=e.object({name:e.string(),heading:e.string().optional(),paragraphs:e.array(e.string()),highlightedText:e.string().optional(),tickerSettings:V.optional(),cta:L.optional(),secondaryCta:f.optional(),newsletterSignup:de.optional(),image:$.optional(),showReminderFields:le.optional(),separateArticleCount:se.optional(),maxViews:oe.optional(),showSignInLink:e.boolean().optional(),bylineWithImage:_.optional(),showChoiceCards:e.boolean().optional(),choiceCardAmounts:ce.optional(),defaultChoiceCardFrequency:ue.optional()}),me=e.object({variant:ge,tracking:x,countryCode:e.string().nullish(),articleCounts:re,onReminderOpen:e.any().nullish(),fetchEmail:e.any().nullish(),submitComponentEvent:e.any().nullish(),openCmp:e.any().nullish(),hasConsentForArticleCount:e.boolean().nullish(),stage:e.string().nullish()}),Ce=/^[0-9A-F]{2}$/,pe=e.string().refine((e=>Ce.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),be=e.object({r:pe,g:pe,b:pe,kind:e.literal("hex")}),Se=e.object({mobileUrl:e.string(),tabletUrl:e.string(),desktopUrl:e.string(),altText:e.string(),kind:e.literal("Image")}),he=e.object({buttonColour:be.nullish(),buttonTextColour:be.nullish(),buttonBorderColour:be.nullish(),buttonSelectColour:be.nullish(),buttonSelectTextColour:be.nullish(),buttonSelectBorderColour:be.nullish(),kind:e.literal("ChoiceCards")}),ye=e.discriminatedUnion("kind",[Se,he]),Ae=e.object({visual:ye.nullish(),colours:e.object({basic:e.object({background:be,bodyText:be})})}),Te=e.enum(["contributions","subscriptions","signIn","abandonedBasket"]),Ie=e.object({heading:e.string().optional(),messageText:e.string().optional(),paragraphs:e.array(e.string()).optional(),mobileMessageText:e.string().optional(),highlightedText:e.string().optional(),cta:L.optional(),secondaryCta:f.optional()});e.object({tracking:x,bannerChannel:Te,content:Ie.nullish(),mobileContent:Ie.nullish(),countryCode:e.string().nullish(),isSupporter:e.boolean().nullish(),tickerSettings:V.nullish(),submitComponentEvent:e.any(),numArticles:e.number().nullish(),hasOptedOutOfArticleCount:e.boolean().nullish(),fetchEmail:e.any().nullish(),separateArticleCount:e.boolean().nullish(),design:Ae.nullish()});const Ne=e.object({heading:e.string(),subheading:e.string(),primaryCta:L.optional(),secondaryCta:L.optional(),benefits:e.array(e.string()).optional()}),Me=e.object({content:Ne,tracking:x,mobileContent:Ne.optional(),countryCode:e.string().optional(),submitComponentEvent:e.any(),numArticles:e.number().optional()}),Ee=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),Ge=["ONE_OFF","MONTHLY","ANNUAL"];ne.extend({name:e.string(),status:z,locations:e.array(g),tagIds:e.array(e.string()),sections:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSections:e.array(e.string()),alwaysAsk:e.boolean(),maxViews:Ee.optional(),userCohort:te,hasCountryName:e.boolean(),highPriority:e.boolean(),useLocalViewLog:e.boolean(),articlesViewedSettings:ae.optional(),priority:e.number(),variants:ge.array(),isBanditTest:e.boolean().optional()});const Ue=e.object({amount:e.union([e.number(),e.literal("other")]),billingPeriod:e.union([e.literal("ONE_OFF"),e.literal("MONTHLY"),e.literal("ANNUAL")]),product:e.union([e.literal("Contribution"),e.literal("SupporterPlus"),e.literal("PremiumTier"),e.literal("DailyEdition"),e.literal("GuardianWeekly"),e.literal("Paper"),e.literal("PaperAndDigital")]),region:e.union([e.literal("uk"),e.literal("us"),e.literal("au"),e.literal("eu"),e.literal("int"),e.literal("nz"),e.literal("ca")])}),Re=(e,n,t)=>{const a=(e=>{if(URLSearchParams){const n=new URLSearchParams(window.location.search).get(`force-${e}`);if(n)return n}return null})(e);return fetch(`${n}/${e}${a?`?force=${a}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((n=>{if(!n.ok)throw Error(n.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${n.status}`);return n})).then((e=>e.json()))},Be=(e,n)=>Re("epic",e,n),Pe=(e,n)=>Re("liveblog-epic",e,n),Le=(e,n)=>Re("banner",e,n),De=(e,n)=>Re("header",e,n);export{d as CountryGroupId,D as SecondaryCtaType,F as TickerCountType,k as TickerEndType,Ue as abandonedBasketSchema,A as addRegionIdToSupportUrl,U as buildReminderFields,E as containsNonArticleCountPlaceholder,Ge as contributionTabFrequencies,b as countryCodeToCountryGroupId,g as countryGroupIdSchema,me as epicPropsSchema,Le as getBanner,y as getCountryName,Be as getEpic,t as getEpicViewLog,De as getHeader,Pe as getLiveblogEpic,h as getLocalCurrencySymbol,P as getReminderFields,s as getWeeklyArticleHistory,Me as headerPropsSchema,S as inCountryGroups,c as incrementWeeklyArticleCount,a as logEpicView,N as replaceNonArticleCountPlaceholders};
|
|
1
|
+
import*as e from"zod";const n="gu.contributions.views",t=e=>e.get(n)||void 0,a=e=>{const t=localStorage.getItem(n),a=t?JSON.parse(t).value:[];a.push({date:(new Date).getTime(),testId:e});const i={value:a.slice(-50)};localStorage.setItem(n,JSON.stringify(i))},i="gu.history.weeklyArticleCount",r="gu.history.articleCountsThisWeek",o=e=>{const n=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(n-1))/864e5},s=e=>e.get(i)||void 0,l=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes"]),u=(e,n={})=>(e.forEach((e=>{l.has(e)&&(n[e]=(n[e]??0)+1)})),n),c=(e,n,t)=>{const a=((e,n)=>{const t=o(new Date),a=e.get(r);if(a&&a.week===t){const i=a.articles[n]||0;return e.set(r,{week:t,articles:{...a.articles,[n]:i+1}}),i>0}return e.set(r,{week:t,articles:{[n]:1}}),!1})(e,n);if(!a){const n=o(new Date),a=e.get(i)||[],r=a[0];if(r&&r.week&&r.week===n)r.count+=1,r.tags=u(t,r.tags),e.set(i,a);else{a.unshift({week:n,count:1,tags:u(t,{})});const r=n-365,o=a.filter((e=>e.week>=r));e.set(i,o)}}},d=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],g=e.enum(d),m={GBPCountries:{name:"United Kingdom",currency:"GBP",countries:["GB","FK","GI","GG","IM","JE","SH"],supportRegionId:"UK"},UnitedStates:{name:"United States",currency:"USD",countries:["US"],supportRegionId:"US"},AUDCountries:{name:"Australia",currency:"AUD",countries:["AU","KI","NR","NF","TV"],supportRegionId:"AU"},EURCountries:{name:"Europe",currency:"EUR",countries:["AD","AL","AT","BA","BE","BG","BL","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GF","GL","GP","GR","HR","HU","IE","IT","LI","LT","LU","LV","MC","ME","MF","IS","MQ","MT","NL","NO","PF","PL","PM","PT","RE","RO","RS","SE","SI","SJ","SK","SM","TF","TR","WF","YT","VA","AX","AZ","AM","GE","BY","MD","UA","MK"],supportRegionId:"EU"},International:{name:"International",currency:"USD",countries:["AE","AF","AG","AI","AO","AQ","AR","AS","AW","BB","BD","BF","BH","BI","BJ","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BZ","CC","CD","CF","CG","CI","CL","CM","CN","CO","CR","CU","CV","CW","CX","DJ","DM","DO","DZ","EC","EG","EH","ER","ET","FJ","FM","GA","GD","GH","GM","GN","GQ","GS","GT","GU","GW","GY","HK","HM","HN","HT","ID","IL","IN","IO","IQ","IR","JM","JO","JP","KE","KG","KH","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LK","LR","LS","LY","MA","MG","MH","ML","MM","MN","MO","MP","MR","MS","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NG","NI","NP","NU","OM","PA","PE","PG","PH","PK","PN","PR","PS","PW","PY","QA","RU","RW","SA","SB","SC","SD","SG","SL","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TT","TW","TZ","UG","UM","UY","UZ","VC","VE","VG","VI","VN","VU","WS","YE","ZA","ZM","ZW"],supportRegionId:"INT"},NZDCountries:{name:"New Zealand",currency:"NZD",countries:["NZ","CK"],supportRegionId:"NZ"},Canada:{name:"Canada",currency:"CAD",countries:["CA"],supportRegionId:"CA"}},C={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},p={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},b=e=>Object.keys(m).find((n=>m[n].countries.includes(e??"")))||"International",S=(e,n=[])=>0===n.length||!!e&&n.includes(b(e.toUpperCase())),h=e=>{if(e){const n=b(e);return p[n]}return"£"},y=e=>{if(e)return C[e]},A=(e,n)=>{if(n){const t=(e=>m[b(e)]?.supportRegionId)(n);if(t)return e.replace(/(support.theguardian.com)\/(contribute-in-epic|contribute|subscribe)/,((e,n,a)=>`${n}/${t.toLowerCase()}/${a}`))}return e},T=(e,n,t,a)=>{if(a){const i=a[b(t)];if(i){return`${h(t)}${i[e][n].price}`}}},I={CURRENCY_SYMBOL:({countryCode:e})=>h(e),COUNTRY_NAME:({countryCode:e})=>y(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:n})=>T("Digisub","Monthly",e,n),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:n})=>T("Digisub","Annual",e,n),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:n})=>T("GuardianWeekly","Monthly",e,n),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:n})=>T("GuardianWeekly","Annual",e,n),DAY_OF_THE_WEEK:()=>((e=new Date)=>e.toLocaleString("en-GB",{weekday:"long"}))(),DATE:()=>((e=new Date)=>e.toLocaleString("en-GB",{day:"numeric",month:"long",year:"numeric"}))()},N=(e,n,t)=>e?e.replace(M,(e=>{const a=e.substring(2,e.length-2),i=I[a];if(i){const e=i({countryCode:n,prices:t});if(e)return e}return e})):"",M=/%%.*?%%/g,E=e=>{const n=e.match(M)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!n&&n.length>0},G=e=>{const n=(e=>{const n=new Date(e,10,1).getDay();return new Date(e,10,22+(11-n)%7)})(e);return n.setDate(n.getDate()+5),n},U=(e=new Date)=>{const n=(e=>{const n=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+n),e})(e),t=(n.getMonth()+1).toString().padStart(2,"0"),a=n.toLocaleString("default",{month:"long"}),i=n.getFullYear();return{reminderCta:`Remind me in ${a}`,reminderPeriod:`${i}-${t}-01`,reminderLabel:`${a} ${i}`}},R=new Date("2023-12-31"),B=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<G(e.getFullYear()),P=(e,n=new Date)=>{return"US"===e&&B(n)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${t=n.getFullYear()}-${(G(t).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${t}`}:"US"===e&&(e=>e>=G(e.getFullYear())&&e<R)(n)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(n.getFullYear()):U(n);var t},L=e.object({text:e.string(),baseUrl:e.string()});let D=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});e.nativeEnum(D);const w=e.object({type:e.literal(D.Custom),cta:L}),O=e.object({type:e.literal(D.ContributionsReminder)}),f=e.discriminatedUnion("type",[w,O]);let k=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const K=e.nativeEnum(k);let F=function(e){return e.money="money",e}({});const v=e.nativeEnum(F),H=e.object({countLabel:e.string(),goalReachedPrimary:e.string(),goalReachedSecondary:e.string()}),Y=e.object({total:e.number(),goal:e.number()}),j=e.enum(["US","AU"]),V=e.object({endType:K,countType:v,currencySymbol:e.string(),copy:H,name:j,tickerData:Y.optional()}),W=e.object({for52Weeks:e.number(),forTargetedWeeks:e.number()}),Z=e.enum(["for52Weeks","forTargetedWeeks"]),x=e.object({type:e.literal("above"),copy:e.string().optional(),countType:Z.optional()}),$=e.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),_=e.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),J=e.object({abTestName:e.string(),abTestVariant:e.string(),campaignCode:e.string(),componentType:_,products:e.array($).nullish(),labels:e.array(e.string()).nullish(),ophanPageId:e.string(),platformId:e.string(),referrerUrl:e.string(),clientName:e.string()}),Q=e.object({mainUrl:e.string(),mobileUrl:e.string().optional(),tabletUrl:e.string().optional(),desktopUrl:e.string().optional(),leftColUrl:e.string().optional(),wideUrl:e.string().optional(),altText:e.string()}),z=e.object({name:e.string(),description:e.string().optional(),headshot:Q.optional()}),q=e.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),X=e.enum(["new","guest","current"]),ee=e.enum(["Live","Draft","Archived"]),ne=e.enum(["Mobile","Desktop","All","iOS","Android"]),te=e.enum(["SignedIn","SignedOut","All"]),ae=e.enum(["HasConsented","HasNotConsented","All"]),ie=e.object({name:e.string(),status:ee,priority:e.number(),controlProportionSettings:e.object({proportion:e.number(),offset:e.number()}).optional(),deviceType:ne.optional(),signedInStatus:te.optional(),consentStatus:ae.optional()}),re=e.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),oe=e.object({minViews:e.number(),maxViews:e.number().optional(),periodInWeeks:e.number(),tagIds:e.array(e.string()).optional()});e.object({userType:e.array(X),product:e.array(q)}),e.object({tagIds:e.array(e.string()),sectionIds:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSectionIds:e.array(e.string())});const se=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),le=e.object({reminderCta:e.string(),reminderLabel:e.string(),reminderPeriod:e.string()}),ue=e.enum(["ONE_OFF","MONTHLY","ANNUAL"]),ce=e.object({testName:e.string(),variantName:e.string(),defaultContributionType:ue,displayContributionType:ue.array(),amountsCardData:e.object({ONE_OFF:e.object({amounts:e.array(e.number()),defaultAmount:e.number(),hideChooseYourAmount:e.boolean().optional()}),MONTHLY:e.object({amounts:e.array(e.number()),defaultAmount:e.number(),hideChooseYourAmount:e.boolean().optional()}),ANNUAL:e.object({amounts:e.array(e.number()),defaultAmount:e.number(),hideChooseYourAmount:e.boolean().optional()})})}),de=e.object({url:e.string()}),ge=e.object({name:e.string(),heading:e.string().optional(),paragraphs:e.array(e.string()),highlightedText:e.string().optional(),tickerSettings:V.optional(),cta:L.optional(),secondaryCta:f.optional(),newsletterSignup:de.optional(),image:Q.optional(),showReminderFields:le.optional(),separateArticleCount:x.optional(),maxViews:se.optional(),showSignInLink:e.boolean().optional(),bylineWithImage:z.optional(),showChoiceCards:e.boolean().optional(),choiceCardAmounts:ce.optional(),defaultChoiceCardFrequency:ue.optional()}),me=e.object({variant:ge,tracking:J,countryCode:e.string().nullish(),articleCounts:W,onReminderOpen:e.any().nullish(),fetchEmail:e.any().nullish(),submitComponentEvent:e.any().nullish(),openCmp:e.any().nullish(),hasConsentForArticleCount:e.boolean().nullish(),stage:e.string().nullish()}),Ce=/^[0-9A-F]{2}$/,pe=e.string().refine((e=>Ce.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),be=e.object({r:pe,g:pe,b:pe,kind:e.literal("hex")}),Se=e.object({mobileUrl:e.string(),tabletUrl:e.string(),desktopUrl:e.string(),altText:e.string(),kind:e.literal("Image")}),he=e.object({buttonColour:be.nullish(),buttonTextColour:be.nullish(),buttonBorderColour:be.nullish(),buttonSelectColour:be.nullish(),buttonSelectTextColour:be.nullish(),buttonSelectBorderColour:be.nullish(),kind:e.literal("ChoiceCards")}),ye=e.discriminatedUnion("kind",[Se,he]),Ae=e.object({visual:ye.nullish(),colours:e.object({basic:e.object({background:be,bodyText:be})})}),Te=e.enum(["contributions","subscriptions","signIn","abandonedBasket"]),Ie=e.object({heading:e.string().optional(),messageText:e.string().optional(),paragraphs:e.array(e.string()).optional(),mobileMessageText:e.string().optional(),highlightedText:e.string().optional(),cta:L.optional(),secondaryCta:f.optional()});e.object({tracking:J,bannerChannel:Te,content:Ie.nullish(),mobileContent:Ie.nullish(),countryCode:e.string().nullish(),isSupporter:e.boolean().nullish(),tickerSettings:V.nullish(),submitComponentEvent:e.any(),articleCounts:W,hasOptedOutOfArticleCount:e.boolean().nullish(),fetchEmail:e.any().nullish(),separateArticleCount:e.boolean().nullish(),design:Ae.nullish()});const Ne=e.object({heading:e.string(),subheading:e.string(),primaryCta:L.optional(),secondaryCta:L.optional(),benefits:e.array(e.string()).optional()}),Me=e.object({content:Ne,tracking:J,mobileContent:Ne.optional(),countryCode:e.string().optional(),submitComponentEvent:e.any(),numArticles:e.number().optional()}),Ee=e.object({maxViewsCount:e.number(),maxViewsDays:e.number(),minDaysBetweenViews:e.number()}),Ge=["ONE_OFF","MONTHLY","ANNUAL"];ie.extend({name:e.string(),status:ee,locations:e.array(g),tagIds:e.array(e.string()),sections:e.array(e.string()),excludedTagIds:e.array(e.string()),excludedSections:e.array(e.string()),alwaysAsk:e.boolean(),maxViews:Ee.optional(),userCohort:re,hasCountryName:e.boolean(),highPriority:e.boolean(),useLocalViewLog:e.boolean(),articlesViewedSettings:oe.optional(),priority:e.number(),variants:ge.array(),isBanditTest:e.boolean().optional()});const Ue=e.object({amount:e.union([e.number(),e.literal("other")]),billingPeriod:e.union([e.literal("ONE_OFF"),e.literal("MONTHLY"),e.literal("ANNUAL")]),product:e.union([e.literal("Contribution"),e.literal("SupporterPlus"),e.literal("PremiumTier"),e.literal("DailyEdition"),e.literal("GuardianWeekly"),e.literal("Paper"),e.literal("PaperAndDigital")]),region:e.union([e.literal("uk"),e.literal("us"),e.literal("au"),e.literal("eu"),e.literal("int"),e.literal("nz"),e.literal("ca")])}),Re=(e,n,t)=>{const a=(e=>{if(URLSearchParams){const n=new URLSearchParams(window.location.search).get(`force-${e}`);if(n)return n}return null})(e);return fetch(`${n}/${e}${a?`?force=${a}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((n=>{if(!n.ok)throw Error(n.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${n.status}`);return n})).then((e=>e.json()))},Be=(e,n)=>Re("epic",e,n),Pe=(e,n)=>Re("liveblog-epic",e,n),Le=(e,n)=>Re("banner",e,n),De=(e,n)=>Re("header",e,n);export{d as CountryGroupId,D as SecondaryCtaType,F as TickerCountType,k as TickerEndType,Ue as abandonedBasketSchema,A as addRegionIdToSupportUrl,U as buildReminderFields,E as containsNonArticleCountPlaceholder,Ge as contributionTabFrequencies,b as countryCodeToCountryGroupId,g as countryGroupIdSchema,me as epicPropsSchema,Le as getBanner,y as getCountryName,Be as getEpic,t as getEpicViewLog,De as getHeader,Pe as getLiveblogEpic,h as getLocalCurrencySymbol,P as getReminderFields,s as getWeeklyArticleHistory,Me as headerPropsSchema,S as inCountryGroups,c as incrementWeeklyArticleCount,a as logEpicView,N as replaceNonArticleCountPlaceholders};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,a.get?a:{enumerable:!0,get:function(){return e[t]}})}})),n.default=e,Object.freeze(n)}Object.defineProperty(exports,"__esModule",{value:!0});var n=e(require("zod"));const t="gu.contributions.views",a="gu.history.weeklyArticleCount",r="gu.history.articleCountsThisWeek",o=e=>{const n=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(n-1))/864e5},i=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes"]),s=(e,n={})=>(e.forEach((e=>{i.has(e)&&(n[e]=(n[e]??0)+1)})),n),l=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],u=n.enum(l),c={GBPCountries:{name:"United Kingdom",currency:"GBP",countries:["GB","FK","GI","GG","IM","JE","SH"],supportRegionId:"UK"},UnitedStates:{name:"United States",currency:"USD",countries:["US"],supportRegionId:"US"},AUDCountries:{name:"Australia",currency:"AUD",countries:["AU","KI","NR","NF","TV"],supportRegionId:"AU"},EURCountries:{name:"Europe",currency:"EUR",countries:["AD","AL","AT","BA","BE","BG","BL","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GF","GL","GP","GR","HR","HU","IE","IT","LI","LT","LU","LV","MC","ME","MF","IS","MQ","MT","NL","NO","PF","PL","PM","PT","RE","RO","RS","SE","SI","SJ","SK","SM","TF","TR","WF","YT","VA","AX","AZ","AM","GE","BY","MD","UA","MK"],supportRegionId:"EU"},International:{name:"International",currency:"USD",countries:["AE","AF","AG","AI","AO","AQ","AR","AS","AW","BB","BD","BF","BH","BI","BJ","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BZ","CC","CD","CF","CG","CI","CL","CM","CN","CO","CR","CU","CV","CW","CX","DJ","DM","DO","DZ","EC","EG","EH","ER","ET","FJ","FM","GA","GD","GH","GM","GN","GQ","GS","GT","GU","GW","GY","HK","HM","HN","HT","ID","IL","IN","IO","IQ","IR","JM","JO","JP","KE","KG","KH","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LK","LR","LS","LY","MA","MG","MH","ML","MM","MN","MO","MP","MR","MS","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NG","NI","NP","NU","OM","PA","PE","PG","PH","PK","PN","PR","PS","PW","PY","QA","RU","RW","SA","SB","SC","SD","SG","SL","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TT","TW","TZ","UG","UM","UY","UZ","VC","VE","VG","VI","VN","VU","WS","YE","ZA","ZM","ZW"],supportRegionId:"INT"},NZDCountries:{name:"New Zealand",currency:"NZD",countries:["NZ","CK"],supportRegionId:"NZ"},Canada:{name:"Canada",currency:"CAD",countries:["CA"],supportRegionId:"CA"}},d={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},g={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},p=e=>Object.keys(c).find((n=>c[n].countries.includes(e??"")))||"International",m=e=>{if(e){const n=p(e);return g[n]}return"£"},C=e=>{if(e)return d[e]},b=(e,n,t,a)=>{if(a){const r=a[p(t)];if(r){return`${m(t)}${r[e][n].price}`}}},S={CURRENCY_SYMBOL:({countryCode:e})=>m(e),COUNTRY_NAME:({countryCode:e})=>C(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:n})=>b("Digisub","Monthly",e,n),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:n})=>b("Digisub","Annual",e,n),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:n})=>b("GuardianWeekly","Monthly",e,n),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:n})=>b("GuardianWeekly","Annual",e,n),DAY_OF_THE_WEEK:()=>((e=new Date)=>e.toLocaleString("en-GB",{weekday:"long"}))(),DATE:()=>((e=new Date)=>e.toLocaleString("en-GB",{day:"numeric",month:"long",year:"numeric"}))()},h=/%%.*?%%/g,y=e=>{const n=(e=>{const n=new Date(e,10,1).getDay();return new Date(e,10,22+(11-n)%7)})(e);return n.setDate(n.getDate()+5),n},A=(e=new Date)=>{const n=(e=>{const n=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+n),e})(e),t=(n.getMonth()+1).toString().padStart(2,"0"),a=n.toLocaleString("default",{month:"long"}),r=n.getFullYear();return{reminderCta:`Remind me in ${a}`,reminderPeriod:`${r}-${t}-01`,reminderLabel:`${a} ${r}`}},T=new Date("2023-12-31"),I=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<y(e.getFullYear()),N=n.object({text:n.string(),baseUrl:n.string()});let M=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});n.nativeEnum(M);const E=n.object({type:n.literal(M.Custom),cta:N}),G=n.object({type:n.literal(M.ContributionsReminder)}),R=n.discriminatedUnion("type",[E,G]);let U=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const B=n.nativeEnum(U);let P=function(e){return e.money="money",e}({});const L=n.nativeEnum(P),D=n.object({countLabel:n.string(),goalReachedPrimary:n.string(),goalReachedSecondary:n.string()}),w=n.object({total:n.number(),goal:n.number()}),O=n.enum(["US","AU"]),f=n.object({endType:B,countType:L,currencySymbol:n.string(),copy:D,name:O,tickerData:w.optional()}),k=n.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),F=n.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),K=n.object({abTestName:n.string(),abTestVariant:n.string(),campaignCode:n.string(),componentType:F,products:n.array(k).nullish(),labels:n.array(n.string()).nullish(),ophanPageId:n.string(),platformId:n.string(),referrerUrl:n.string(),clientName:n.string()}),x=n.object({mainUrl:n.string(),mobileUrl:n.string().optional(),tabletUrl:n.string().optional(),desktopUrl:n.string().optional(),leftColUrl:n.string().optional(),wideUrl:n.string().optional(),altText:n.string()}),v=n.object({name:n.string(),description:n.string().optional(),headshot:x.optional()}),j=n.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),H=n.enum(["new","guest","current"]),V=n.enum(["Live","Draft","Archived"]),Y=n.enum(["Mobile","Desktop","All","iOS","Android"]),W=n.enum(["SignedIn","SignedOut","All"]),Z=n.enum(["HasConsented","HasNotConsented","All"]),_=n.object({name:n.string(),status:V,priority:n.number(),controlProportionSettings:n.object({proportion:n.number(),offset:n.number()}).optional(),deviceType:Y.optional(),signedInStatus:W.optional(),consentStatus:Z.optional()}),$=n.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),J=n.object({minViews:n.number(),maxViews:n.number().optional(),periodInWeeks:n.number(),tagIds:n.array(n.string()).optional()});n.object({userType:n.array(H),product:n.array(j)}),n.object({tagIds:n.array(n.string()),sectionIds:n.array(n.string()),excludedTagIds:n.array(n.string()),excludedSectionIds:n.array(n.string())});const Q=n.enum(["for52Weeks","forTargetedWeeks"]),z=n.object({for52Weeks:n.number(),forTargetedWeeks:n.number()}),q=n.object({maxViewsCount:n.number(),maxViewsDays:n.number(),minDaysBetweenViews:n.number()}),X=n.object({type:n.literal("above"),copy:n.string().optional(),countType:Q.optional()}),ee=n.object({reminderCta:n.string(),reminderLabel:n.string(),reminderPeriod:n.string()}),ne=n.enum(["ONE_OFF","MONTHLY","ANNUAL"]),te=n.object({testName:n.string(),variantName:n.string(),defaultContributionType:ne,displayContributionType:ne.array(),amountsCardData:n.object({ONE_OFF:n.object({amounts:n.array(n.number()),defaultAmount:n.number(),hideChooseYourAmount:n.boolean().optional()}),MONTHLY:n.object({amounts:n.array(n.number()),defaultAmount:n.number(),hideChooseYourAmount:n.boolean().optional()}),ANNUAL:n.object({amounts:n.array(n.number()),defaultAmount:n.number(),hideChooseYourAmount:n.boolean().optional()})})}),ae=n.object({url:n.string()}),re=n.object({name:n.string(),heading:n.string().optional(),paragraphs:n.array(n.string()),highlightedText:n.string().optional(),tickerSettings:f.optional(),cta:N.optional(),secondaryCta:R.optional(),newsletterSignup:ae.optional(),image:x.optional(),showReminderFields:ee.optional(),separateArticleCount:X.optional(),maxViews:q.optional(),showSignInLink:n.boolean().optional(),bylineWithImage:v.optional(),showChoiceCards:n.boolean().optional(),choiceCardAmounts:te.optional(),defaultChoiceCardFrequency:ne.optional()}),oe=n.object({variant:re,tracking:K,countryCode:n.string().nullish(),articleCounts:z,onReminderOpen:n.any().nullish(),fetchEmail:n.any().nullish(),submitComponentEvent:n.any().nullish(),openCmp:n.any().nullish(),hasConsentForArticleCount:n.boolean().nullish(),stage:n.string().nullish()}),ie=/^[0-9A-F]{2}$/,se=n.string().refine((e=>ie.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),le=n.object({r:se,g:se,b:se,kind:n.literal("hex")}),ue=n.object({mobileUrl:n.string(),tabletUrl:n.string(),desktopUrl:n.string(),altText:n.string(),kind:n.literal("Image")}),ce=n.object({buttonColour:le.nullish(),buttonTextColour:le.nullish(),buttonBorderColour:le.nullish(),buttonSelectColour:le.nullish(),buttonSelectTextColour:le.nullish(),buttonSelectBorderColour:le.nullish(),kind:n.literal("ChoiceCards")}),de=n.discriminatedUnion("kind",[ue,ce]),ge=n.object({visual:de.nullish(),colours:n.object({basic:n.object({background:le,bodyText:le})})}),pe=n.enum(["contributions","subscriptions","signIn","abandonedBasket"]),me=n.object({heading:n.string().optional(),messageText:n.string().optional(),paragraphs:n.array(n.string()).optional(),mobileMessageText:n.string().optional(),highlightedText:n.string().optional(),cta:N.optional(),secondaryCta:R.optional()});n.object({tracking:K,bannerChannel:pe,content:me.nullish(),mobileContent:me.nullish(),countryCode:n.string().nullish(),isSupporter:n.boolean().nullish(),tickerSettings:f.nullish(),submitComponentEvent:n.any(),numArticles:n.number().nullish(),hasOptedOutOfArticleCount:n.boolean().nullish(),fetchEmail:n.any().nullish(),separateArticleCount:n.boolean().nullish(),design:ge.nullish()});const Ce=n.object({heading:n.string(),subheading:n.string(),primaryCta:N.optional(),secondaryCta:N.optional(),benefits:n.array(n.string()).optional()}),be=n.object({content:Ce,tracking:K,mobileContent:Ce.optional(),countryCode:n.string().optional(),submitComponentEvent:n.any(),numArticles:n.number().optional()}),Se=n.object({maxViewsCount:n.number(),maxViewsDays:n.number(),minDaysBetweenViews:n.number()});_.extend({name:n.string(),status:V,locations:n.array(u),tagIds:n.array(n.string()),sections:n.array(n.string()),excludedTagIds:n.array(n.string()),excludedSections:n.array(n.string()),alwaysAsk:n.boolean(),maxViews:Se.optional(),userCohort:$,hasCountryName:n.boolean(),highPriority:n.boolean(),useLocalViewLog:n.boolean(),articlesViewedSettings:J.optional(),priority:n.number(),variants:re.array(),isBanditTest:n.boolean().optional()});const he=n.object({amount:n.union([n.number(),n.literal("other")]),billingPeriod:n.union([n.literal("ONE_OFF"),n.literal("MONTHLY"),n.literal("ANNUAL")]),product:n.union([n.literal("Contribution"),n.literal("SupporterPlus"),n.literal("PremiumTier"),n.literal("DailyEdition"),n.literal("GuardianWeekly"),n.literal("Paper"),n.literal("PaperAndDigital")]),region:n.union([n.literal("uk"),n.literal("us"),n.literal("au"),n.literal("eu"),n.literal("int"),n.literal("nz"),n.literal("ca")])}),ye=(e,n,t)=>{const a=(e=>{if(URLSearchParams){const n=new URLSearchParams(window.location.search).get(`force-${e}`);if(n)return n}return null})(e);return fetch(`${n}/${e}${a?`?force=${a}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((n=>{if(!n.ok)throw Error(n.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${n.status}`);return n})).then((e=>e.json()))};exports.CountryGroupId=l,exports.SecondaryCtaType=M,exports.TickerCountType=P,exports.TickerEndType=U,exports.abandonedBasketSchema=he,exports.addRegionIdToSupportUrl=(e,n)=>{if(n){const t=(e=>c[p(e)]?.supportRegionId)(n);if(t)return e.replace(/(support.theguardian.com)\/(contribute-in-epic|contribute|subscribe)/,((e,n,a)=>`${n}/${t.toLowerCase()}/${a}`))}return e},exports.buildReminderFields=A,exports.containsNonArticleCountPlaceholder=e=>{const n=e.match(h)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!n&&n.length>0},exports.contributionTabFrequencies=["ONE_OFF","MONTHLY","ANNUAL"],exports.countryCodeToCountryGroupId=p,exports.countryGroupIdSchema=u,exports.epicPropsSchema=oe,exports.getBanner=(e,n)=>ye("banner",e,n),exports.getCountryName=C,exports.getEpic=(e,n)=>ye("epic",e,n),exports.getEpicViewLog=e=>e.get(t)||void 0,exports.getHeader=(e,n)=>ye("header",e,n),exports.getLiveblogEpic=(e,n)=>ye("liveblog-epic",e,n),exports.getLocalCurrencySymbol=m,exports.getReminderFields=(e,n=new Date)=>{return"US"===e&&I(n)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${t=n.getFullYear()}-${(y(t).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${t}`}:"US"===e&&(e=>e>=y(e.getFullYear())&&e<T)(n)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(n.getFullYear()):A(n);var t},exports.getWeeklyArticleHistory=e=>e.get(a)||void 0,exports.headerPropsSchema=be,exports.inCountryGroups=(e,n=[])=>0===n.length||!!e&&n.includes(p(e.toUpperCase())),exports.incrementWeeklyArticleCount=(e,n,t)=>{const i=((e,n)=>{const t=o(new Date),a=e.get(r);if(a&&a.week===t){const o=a.articles[n]||0;return e.set(r,{week:t,articles:{...a.articles,[n]:o+1}}),o>0}return e.set(r,{week:t,articles:{[n]:1}}),!1})(e,n);if(!i){const n=o(new Date),r=e.get(a)||[],i=r[0];if(i&&i.week&&i.week===n)i.count+=1,i.tags=s(t,i.tags),e.set(a,r);else{r.unshift({week:n,count:1,tags:s(t,{})});const o=n-365,i=r.filter((e=>e.week>=o));e.set(a,i)}}},exports.logEpicView=e=>{const n=localStorage.getItem(t),a=n?JSON.parse(n).value:[];a.push({date:(new Date).getTime(),testId:e});const r={value:a.slice(-50)};localStorage.setItem(t,JSON.stringify(r))},exports.replaceNonArticleCountPlaceholders=(e,n,t)=>e?e.replace(h,(e=>{const a=e.substring(2,e.length-2),r=S[a];if(r){const e=r({countryCode:n,prices:t});if(e)return e}return e})):"";
|
|
1
|
+
"use strict";function e(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,a.get?a:{enumerable:!0,get:function(){return e[t]}})}})),n.default=e,Object.freeze(n)}Object.defineProperty(exports,"__esModule",{value:!0});var n=e(require("zod"));const t="gu.contributions.views",a="gu.history.weeklyArticleCount",r="gu.history.articleCountsThisWeek",o=e=>{const n=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(n-1))/864e5},i=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes"]),s=(e,n={})=>(e.forEach((e=>{i.has(e)&&(n[e]=(n[e]??0)+1)})),n),l=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],u=n.enum(l),c={GBPCountries:{name:"United Kingdom",currency:"GBP",countries:["GB","FK","GI","GG","IM","JE","SH"],supportRegionId:"UK"},UnitedStates:{name:"United States",currency:"USD",countries:["US"],supportRegionId:"US"},AUDCountries:{name:"Australia",currency:"AUD",countries:["AU","KI","NR","NF","TV"],supportRegionId:"AU"},EURCountries:{name:"Europe",currency:"EUR",countries:["AD","AL","AT","BA","BE","BG","BL","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GF","GL","GP","GR","HR","HU","IE","IT","LI","LT","LU","LV","MC","ME","MF","IS","MQ","MT","NL","NO","PF","PL","PM","PT","RE","RO","RS","SE","SI","SJ","SK","SM","TF","TR","WF","YT","VA","AX","AZ","AM","GE","BY","MD","UA","MK"],supportRegionId:"EU"},International:{name:"International",currency:"USD",countries:["AE","AF","AG","AI","AO","AQ","AR","AS","AW","BB","BD","BF","BH","BI","BJ","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BZ","CC","CD","CF","CG","CI","CL","CM","CN","CO","CR","CU","CV","CW","CX","DJ","DM","DO","DZ","EC","EG","EH","ER","ET","FJ","FM","GA","GD","GH","GM","GN","GQ","GS","GT","GU","GW","GY","HK","HM","HN","HT","ID","IL","IN","IO","IQ","IR","JM","JO","JP","KE","KG","KH","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LK","LR","LS","LY","MA","MG","MH","ML","MM","MN","MO","MP","MR","MS","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NG","NI","NP","NU","OM","PA","PE","PG","PH","PK","PN","PR","PS","PW","PY","QA","RU","RW","SA","SB","SC","SD","SG","SL","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TT","TW","TZ","UG","UM","UY","UZ","VC","VE","VG","VI","VN","VU","WS","YE","ZA","ZM","ZW"],supportRegionId:"INT"},NZDCountries:{name:"New Zealand",currency:"NZD",countries:["NZ","CK"],supportRegionId:"NZ"},Canada:{name:"Canada",currency:"CAD",countries:["CA"],supportRegionId:"CA"}},d={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},g={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},p=e=>Object.keys(c).find((n=>c[n].countries.includes(e??"")))||"International",m=e=>{if(e){const n=p(e);return g[n]}return"£"},C=e=>{if(e)return d[e]},b=(e,n,t,a)=>{if(a){const r=a[p(t)];if(r){return`${m(t)}${r[e][n].price}`}}},S={CURRENCY_SYMBOL:({countryCode:e})=>m(e),COUNTRY_NAME:({countryCode:e})=>C(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:n})=>b("Digisub","Monthly",e,n),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:n})=>b("Digisub","Annual",e,n),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:n})=>b("GuardianWeekly","Monthly",e,n),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:n})=>b("GuardianWeekly","Annual",e,n),DAY_OF_THE_WEEK:()=>((e=new Date)=>e.toLocaleString("en-GB",{weekday:"long"}))(),DATE:()=>((e=new Date)=>e.toLocaleString("en-GB",{day:"numeric",month:"long",year:"numeric"}))()},h=/%%.*?%%/g,y=e=>{const n=(e=>{const n=new Date(e,10,1).getDay();return new Date(e,10,22+(11-n)%7)})(e);return n.setDate(n.getDate()+5),n},A=(e=new Date)=>{const n=(e=>{const n=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+n),e})(e),t=(n.getMonth()+1).toString().padStart(2,"0"),a=n.toLocaleString("default",{month:"long"}),r=n.getFullYear();return{reminderCta:`Remind me in ${a}`,reminderPeriod:`${r}-${t}-01`,reminderLabel:`${a} ${r}`}},T=new Date("2023-12-31"),I=e=>e>=(e=>new Date(e.getFullYear(),9,20))(e)&&e<y(e.getFullYear()),N=n.object({text:n.string(),baseUrl:n.string()});let M=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});n.nativeEnum(M);const E=n.object({type:n.literal(M.Custom),cta:N}),G=n.object({type:n.literal(M.ContributionsReminder)}),R=n.discriminatedUnion("type",[E,G]);let U=function(e){return e.unlimited="unlimited",e.hardstop="hardstop",e}({});const B=n.nativeEnum(U);let P=function(e){return e.money="money",e}({});const L=n.nativeEnum(P),D=n.object({countLabel:n.string(),goalReachedPrimary:n.string(),goalReachedSecondary:n.string()}),w=n.object({total:n.number(),goal:n.number()}),O=n.enum(["US","AU"]),f=n.object({endType:B,countType:L,currencySymbol:n.string(),copy:D,name:O,tickerData:w.optional()}),k=n.object({for52Weeks:n.number(),forTargetedWeeks:n.number()}),F=n.enum(["for52Weeks","forTargetedWeeks"]),K=n.object({type:n.literal("above"),copy:n.string().optional(),countType:F.optional()}),x=n.enum(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),v=n.enum(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),j=n.object({abTestName:n.string(),abTestVariant:n.string(),campaignCode:n.string(),componentType:v,products:n.array(x).nullish(),labels:n.array(n.string()).nullish(),ophanPageId:n.string(),platformId:n.string(),referrerUrl:n.string(),clientName:n.string()}),H=n.object({mainUrl:n.string(),mobileUrl:n.string().optional(),tabletUrl:n.string().optional(),desktopUrl:n.string().optional(),leftColUrl:n.string().optional(),wideUrl:n.string().optional(),altText:n.string()}),V=n.object({name:n.string(),description:n.string().optional(),headshot:H.optional()}),Y=n.enum(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),W=n.enum(["new","guest","current"]),Z=n.enum(["Live","Draft","Archived"]),_=n.enum(["Mobile","Desktop","All","iOS","Android"]),$=n.enum(["SignedIn","SignedOut","All"]),J=n.enum(["HasConsented","HasNotConsented","All"]),Q=n.object({name:n.string(),status:Z,priority:n.number(),controlProportionSettings:n.object({proportion:n.number(),offset:n.number()}).optional(),deviceType:_.optional(),signedInStatus:$.optional(),consentStatus:J.optional()}),z=n.enum(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),q=n.object({minViews:n.number(),maxViews:n.number().optional(),periodInWeeks:n.number(),tagIds:n.array(n.string()).optional()});n.object({userType:n.array(W),product:n.array(Y)}),n.object({tagIds:n.array(n.string()),sectionIds:n.array(n.string()),excludedTagIds:n.array(n.string()),excludedSectionIds:n.array(n.string())});const X=n.object({maxViewsCount:n.number(),maxViewsDays:n.number(),minDaysBetweenViews:n.number()}),ee=n.object({reminderCta:n.string(),reminderLabel:n.string(),reminderPeriod:n.string()}),ne=n.enum(["ONE_OFF","MONTHLY","ANNUAL"]),te=n.object({testName:n.string(),variantName:n.string(),defaultContributionType:ne,displayContributionType:ne.array(),amountsCardData:n.object({ONE_OFF:n.object({amounts:n.array(n.number()),defaultAmount:n.number(),hideChooseYourAmount:n.boolean().optional()}),MONTHLY:n.object({amounts:n.array(n.number()),defaultAmount:n.number(),hideChooseYourAmount:n.boolean().optional()}),ANNUAL:n.object({amounts:n.array(n.number()),defaultAmount:n.number(),hideChooseYourAmount:n.boolean().optional()})})}),ae=n.object({url:n.string()}),re=n.object({name:n.string(),heading:n.string().optional(),paragraphs:n.array(n.string()),highlightedText:n.string().optional(),tickerSettings:f.optional(),cta:N.optional(),secondaryCta:R.optional(),newsletterSignup:ae.optional(),image:H.optional(),showReminderFields:ee.optional(),separateArticleCount:K.optional(),maxViews:X.optional(),showSignInLink:n.boolean().optional(),bylineWithImage:V.optional(),showChoiceCards:n.boolean().optional(),choiceCardAmounts:te.optional(),defaultChoiceCardFrequency:ne.optional()}),oe=n.object({variant:re,tracking:j,countryCode:n.string().nullish(),articleCounts:k,onReminderOpen:n.any().nullish(),fetchEmail:n.any().nullish(),submitComponentEvent:n.any().nullish(),openCmp:n.any().nullish(),hasConsentForArticleCount:n.boolean().nullish(),stage:n.string().nullish()}),ie=/^[0-9A-F]{2}$/,se=n.string().refine((e=>ie.test(e)),(e=>({message:`"${e}" is not a valid hex value`}))),le=n.object({r:se,g:se,b:se,kind:n.literal("hex")}),ue=n.object({mobileUrl:n.string(),tabletUrl:n.string(),desktopUrl:n.string(),altText:n.string(),kind:n.literal("Image")}),ce=n.object({buttonColour:le.nullish(),buttonTextColour:le.nullish(),buttonBorderColour:le.nullish(),buttonSelectColour:le.nullish(),buttonSelectTextColour:le.nullish(),buttonSelectBorderColour:le.nullish(),kind:n.literal("ChoiceCards")}),de=n.discriminatedUnion("kind",[ue,ce]),ge=n.object({visual:de.nullish(),colours:n.object({basic:n.object({background:le,bodyText:le})})}),pe=n.enum(["contributions","subscriptions","signIn","abandonedBasket"]),me=n.object({heading:n.string().optional(),messageText:n.string().optional(),paragraphs:n.array(n.string()).optional(),mobileMessageText:n.string().optional(),highlightedText:n.string().optional(),cta:N.optional(),secondaryCta:R.optional()});n.object({tracking:j,bannerChannel:pe,content:me.nullish(),mobileContent:me.nullish(),countryCode:n.string().nullish(),isSupporter:n.boolean().nullish(),tickerSettings:f.nullish(),submitComponentEvent:n.any(),articleCounts:k,hasOptedOutOfArticleCount:n.boolean().nullish(),fetchEmail:n.any().nullish(),separateArticleCount:n.boolean().nullish(),design:ge.nullish()});const Ce=n.object({heading:n.string(),subheading:n.string(),primaryCta:N.optional(),secondaryCta:N.optional(),benefits:n.array(n.string()).optional()}),be=n.object({content:Ce,tracking:j,mobileContent:Ce.optional(),countryCode:n.string().optional(),submitComponentEvent:n.any(),numArticles:n.number().optional()}),Se=n.object({maxViewsCount:n.number(),maxViewsDays:n.number(),minDaysBetweenViews:n.number()});Q.extend({name:n.string(),status:Z,locations:n.array(u),tagIds:n.array(n.string()),sections:n.array(n.string()),excludedTagIds:n.array(n.string()),excludedSections:n.array(n.string()),alwaysAsk:n.boolean(),maxViews:Se.optional(),userCohort:z,hasCountryName:n.boolean(),highPriority:n.boolean(),useLocalViewLog:n.boolean(),articlesViewedSettings:q.optional(),priority:n.number(),variants:re.array(),isBanditTest:n.boolean().optional()});const he=n.object({amount:n.union([n.number(),n.literal("other")]),billingPeriod:n.union([n.literal("ONE_OFF"),n.literal("MONTHLY"),n.literal("ANNUAL")]),product:n.union([n.literal("Contribution"),n.literal("SupporterPlus"),n.literal("PremiumTier"),n.literal("DailyEdition"),n.literal("GuardianWeekly"),n.literal("Paper"),n.literal("PaperAndDigital")]),region:n.union([n.literal("uk"),n.literal("us"),n.literal("au"),n.literal("eu"),n.literal("int"),n.literal("nz"),n.literal("ca")])}),ye=(e,n,t)=>{const a=(e=>{if(URLSearchParams){const n=new URLSearchParams(window.location.search).get(`force-${e}`);if(n)return n}return null})(e);return fetch(`${n}/${e}${a?`?force=${a}`:""}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((n=>{if(!n.ok)throw Error(n.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${n.status}`);return n})).then((e=>e.json()))};exports.CountryGroupId=l,exports.SecondaryCtaType=M,exports.TickerCountType=P,exports.TickerEndType=U,exports.abandonedBasketSchema=he,exports.addRegionIdToSupportUrl=(e,n)=>{if(n){const t=(e=>c[p(e)]?.supportRegionId)(n);if(t)return e.replace(/(support.theguardian.com)\/(contribute-in-epic|contribute|subscribe)/,((e,n,a)=>`${n}/${t.toLowerCase()}/${a}`))}return e},exports.buildReminderFields=A,exports.containsNonArticleCountPlaceholder=e=>{const n=e.match(h)?.filter((e=>"%%ARTICLE_COUNT%%"!==e));return!!n&&n.length>0},exports.contributionTabFrequencies=["ONE_OFF","MONTHLY","ANNUAL"],exports.countryCodeToCountryGroupId=p,exports.countryGroupIdSchema=u,exports.epicPropsSchema=oe,exports.getBanner=(e,n)=>ye("banner",e,n),exports.getCountryName=C,exports.getEpic=(e,n)=>ye("epic",e,n),exports.getEpicViewLog=e=>e.get(t)||void 0,exports.getHeader=(e,n)=>ye("header",e,n),exports.getLiveblogEpic=(e,n)=>ye("liveblog-epic",e,n),exports.getLocalCurrencySymbol=m,exports.getReminderFields=(e,n=new Date)=>{return"US"===e&&I(n)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${t=n.getFullYear()}-${(y(t).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${t}`}:"US"===e&&(e=>e>=y(e.getFullYear())&&e<T)(n)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(n.getFullYear()):A(n);var t},exports.getWeeklyArticleHistory=e=>e.get(a)||void 0,exports.headerPropsSchema=be,exports.inCountryGroups=(e,n=[])=>0===n.length||!!e&&n.includes(p(e.toUpperCase())),exports.incrementWeeklyArticleCount=(e,n,t)=>{const i=((e,n)=>{const t=o(new Date),a=e.get(r);if(a&&a.week===t){const o=a.articles[n]||0;return e.set(r,{week:t,articles:{...a.articles,[n]:o+1}}),o>0}return e.set(r,{week:t,articles:{[n]:1}}),!1})(e,n);if(!i){const n=o(new Date),r=e.get(a)||[],i=r[0];if(i&&i.week&&i.week===n)i.count+=1,i.tags=s(t,i.tags),e.set(a,r);else{r.unshift({week:n,count:1,tags:s(t,{})});const o=n-365,i=r.filter((e=>e.week>=o));e.set(a,i)}}},exports.logEpicView=e=>{const n=localStorage.getItem(t),a=n?JSON.parse(n).value:[];a.push({date:(new Date).getTime(),testId:e});const r={value:a.slice(-50)};localStorage.setItem(t,JSON.stringify(r))},exports.replaceNonArticleCountPlaceholders=(e,n,t)=>e?e.replace(h,(e=>{const a=e.substring(2,e.length-2),r=S[a];if(r){const e=r({countryCode:n,prices:t});if(e)return e}return e})):"";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OphanComponentEvent } from '
|
|
1
|
+
import { OphanComponentEvent } from '@guardian/libs';
|
|
2
2
|
import { Tracking, BannerTest, BannerVariant, EpicTest, EpicVariant, ContributionFrequency, AbandonedBasket } from '../types';
|
|
3
3
|
export declare const addTrackingParams: (baseUrl: string, params: Tracking, numArticles?: number, amountsAbTestName?: string, amountsAbTestVariant?: string) => string;
|
|
4
4
|
export declare const addAbandonedBasketParamsToUrl: (baseUrl: string, abandonedBasket: AbandonedBasket) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracking.d.ts","sourceRoot":"","sources":["../../../../../shared/src/lib/tracking.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"tracking.d.ts","sourceRoot":"","sources":["../../../../../shared/src/lib/tracking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAe,MAAM,gBAAgB,CAAC;AAElE,OAAO,EACH,QAAQ,EACR,UAAU,EACV,aAAa,EAEb,QAAQ,EACR,WAAW,EACX,qBAAqB,EACrB,eAAe,EAClB,MAAM,UAAU,CAAC;AAgFlB,eAAO,MAAM,iBAAiB,YACjB,MAAM,UACP,QAAQ,gBACF,MAAM,sBACA,MAAM,yBACH,MAAM,KAC9B,MAYF,CAAC;AASF,eAAO,MAAM,6BAA6B,YAC7B,MAAM,mBACE,eAAe,KACjC,MAQF,CAAC;AAEF,eAAO,MAAM,wCAAwC,YACxC,MAAM,mBACE,eAAe,YACtB,QAAQ,WAGrB,CAAC;AAEF,eAAO,MAAM,YAAY,YAAa,MAAM,KAAG,OAAsC,CAAC;AAEtF,eAAO,MAAM,wCAAwC,YACxC,MAAM,YACL,QAAQ,gBACJ,MAAM,gBACN,MAAM,sBACA,MAAM,yBACH,MAAM,KAC9B,MAaF,CAAC;AAGF,eAAO,MAAM,4BAA4B,SAC/B,MAAM,YACF,QAAQ,gBACJ,MAAM,gBACN,MAAM,KACrB,MAYF,CAAC;AAUF,eAAO,MAAM,wBAAwB,YAAa,MAAM,UAAU,QAAQ,KAAG,MAgC5E,CAAC;AAEF,eAAO,MAAM,oBAAoB,QACxB,MAAM,aACA,qBAAqB,UACxB,MAAM,GAAG,OAAO,KACzB,MAIF,CAAC;AAEF,eAAO,MAAM,YAAY,YAAa,MAAM,KAAG,OAAsC,CAAC;AACtF,eAAO,MAAM,6BAA6B,YAAa,MAAM,YAAY,QAAQ,KAAG,MAEnF,CAAC;AAKF,eAAO,MAAM,iBAAiB,SAAU,QAAQ,WAAW,WAAW,KAAG,MACF,CAAC;AAExE,eAAO,MAAM,uBAAuB,SAAU,UAAU,WAAW,aAAa,KAAG,MACjD,CAAC;AAEnC,eAAO,MAAM,wBAAwB,aAAc,MAAM,eAAe,MAAM,KAAG,MAC3C,CAAC;AA0CvC,eAAO,MAAM,kBAAkB,aAAc,QAAQ,SAAS,MAAM,KAAG,QAYtE,CAAC;AAEF,eAAO,MAAM,4BAA4B,aArDnB,QAAQ,eAAe,MAAM,KAAG,mBAqDsB,CAAC;AAE7E,eAAO,MAAM,2BAA2B,aAvDlB,QAAQ,eAAe,MAAM,KAAG,mBAuDoB,CAAC;AAE3E,eAAO,MAAM,6BAA6B,aAzDpB,QAAQ,eAAe,MAAM,KAAG,mBAyDwB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BannerChannel, ConfigurableDesign } from '../props';
|
|
2
2
|
import { TargetingAbTest } from './shared';
|
|
3
|
-
import { OphanComponentType, OphanProduct } from '../ophan';
|
|
4
3
|
import { BannerTargeting, PageTracking } from '../targeting';
|
|
5
4
|
import { PurchaseInfoTest } from './shared';
|
|
6
5
|
import * as z from 'zod';
|
|
6
|
+
import { OphanComponentType, OphanProduct } from '@guardian/libs';
|
|
7
7
|
export declare enum BannerTemplate {
|
|
8
8
|
ContributionsBanner = "ContributionsBanner",
|
|
9
9
|
ContributionsBannerWithSignIn = "ContributionsBannerWithSignIn",
|
|
@@ -256,6 +256,19 @@ export declare const bannerVariantFromToolSchema: z.ZodObject<{
|
|
|
256
256
|
} | undefined;
|
|
257
257
|
}>>;
|
|
258
258
|
separateArticleCount: z.ZodOptional<z.ZodBoolean>;
|
|
259
|
+
separateArticleCountSettings: z.ZodOptional<z.ZodObject<{
|
|
260
|
+
type: z.ZodLiteral<"above">;
|
|
261
|
+
copy: z.ZodOptional<z.ZodString>;
|
|
262
|
+
countType: z.ZodOptional<z.ZodEnum<["for52Weeks", "forTargetedWeeks"]>>;
|
|
263
|
+
}, "strip", z.ZodTypeAny, {
|
|
264
|
+
type: "above";
|
|
265
|
+
copy?: string | undefined;
|
|
266
|
+
countType?: "for52Weeks" | "forTargetedWeeks" | undefined;
|
|
267
|
+
}, {
|
|
268
|
+
type: "above";
|
|
269
|
+
copy?: string | undefined;
|
|
270
|
+
countType?: "for52Weeks" | "forTargetedWeeks" | undefined;
|
|
271
|
+
}>>;
|
|
259
272
|
}, "strip", z.ZodTypeAny, {
|
|
260
273
|
name: string;
|
|
261
274
|
template: (BannerTemplate | {
|
|
@@ -319,6 +332,11 @@ export declare const bannerVariantFromToolSchema: z.ZodObject<{
|
|
|
319
332
|
} | undefined;
|
|
320
333
|
} | undefined;
|
|
321
334
|
separateArticleCount?: boolean | undefined;
|
|
335
|
+
separateArticleCountSettings?: {
|
|
336
|
+
type: "above";
|
|
337
|
+
copy?: string | undefined;
|
|
338
|
+
countType?: "for52Weeks" | "forTargetedWeeks" | undefined;
|
|
339
|
+
} | undefined;
|
|
322
340
|
}, {
|
|
323
341
|
name: string;
|
|
324
342
|
template: (BannerTemplate | {
|
|
@@ -382,6 +400,11 @@ export declare const bannerVariantFromToolSchema: z.ZodObject<{
|
|
|
382
400
|
} | undefined;
|
|
383
401
|
} | undefined;
|
|
384
402
|
separateArticleCount?: boolean | undefined;
|
|
403
|
+
separateArticleCountSettings?: {
|
|
404
|
+
type: "above";
|
|
405
|
+
copy?: string | undefined;
|
|
406
|
+
countType?: "for52Weeks" | "forTargetedWeeks" | undefined;
|
|
407
|
+
} | undefined;
|
|
385
408
|
}>;
|
|
386
409
|
export type BannerVariantFromTool = z.infer<typeof bannerVariantFromToolSchema>;
|
|
387
410
|
export interface BannerVariant extends BannerVariantFromTool {
|
|
@@ -679,6 +702,19 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
679
702
|
} | undefined;
|
|
680
703
|
}>>;
|
|
681
704
|
separateArticleCount: z.ZodOptional<z.ZodBoolean>;
|
|
705
|
+
separateArticleCountSettings: z.ZodOptional<z.ZodObject<{
|
|
706
|
+
type: z.ZodLiteral<"above">;
|
|
707
|
+
copy: z.ZodOptional<z.ZodString>;
|
|
708
|
+
countType: z.ZodOptional<z.ZodEnum<["for52Weeks", "forTargetedWeeks"]>>;
|
|
709
|
+
}, "strip", z.ZodTypeAny, {
|
|
710
|
+
type: "above";
|
|
711
|
+
copy?: string | undefined;
|
|
712
|
+
countType?: "for52Weeks" | "forTargetedWeeks" | undefined;
|
|
713
|
+
}, {
|
|
714
|
+
type: "above";
|
|
715
|
+
copy?: string | undefined;
|
|
716
|
+
countType?: "for52Weeks" | "forTargetedWeeks" | undefined;
|
|
717
|
+
}>>;
|
|
682
718
|
}, "strip", z.ZodTypeAny, {
|
|
683
719
|
name: string;
|
|
684
720
|
template: (BannerTemplate | {
|
|
@@ -742,6 +778,11 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
742
778
|
} | undefined;
|
|
743
779
|
} | undefined;
|
|
744
780
|
separateArticleCount?: boolean | undefined;
|
|
781
|
+
separateArticleCountSettings?: {
|
|
782
|
+
type: "above";
|
|
783
|
+
copy?: string | undefined;
|
|
784
|
+
countType?: "for52Weeks" | "forTargetedWeeks" | undefined;
|
|
785
|
+
} | undefined;
|
|
745
786
|
}, {
|
|
746
787
|
name: string;
|
|
747
788
|
template: (BannerTemplate | {
|
|
@@ -805,6 +846,11 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
805
846
|
} | undefined;
|
|
806
847
|
} | undefined;
|
|
807
848
|
separateArticleCount?: boolean | undefined;
|
|
849
|
+
separateArticleCountSettings?: {
|
|
850
|
+
type: "above";
|
|
851
|
+
copy?: string | undefined;
|
|
852
|
+
countType?: "for52Weeks" | "forTargetedWeeks" | undefined;
|
|
853
|
+
} | undefined;
|
|
808
854
|
}>, "many">;
|
|
809
855
|
articlesViewedSettings: z.ZodOptional<z.ZodObject<{
|
|
810
856
|
minViews: z.ZodNumber;
|
|
@@ -891,6 +937,11 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
891
937
|
} | undefined;
|
|
892
938
|
} | undefined;
|
|
893
939
|
separateArticleCount?: boolean | undefined;
|
|
940
|
+
separateArticleCountSettings?: {
|
|
941
|
+
type: "above";
|
|
942
|
+
copy?: string | undefined;
|
|
943
|
+
countType?: "for52Weeks" | "forTargetedWeeks" | undefined;
|
|
944
|
+
} | undefined;
|
|
894
945
|
}[];
|
|
895
946
|
contextTargeting: {
|
|
896
947
|
tagIds: string[];
|
|
@@ -980,6 +1031,11 @@ export declare const bannerTestFromToolSchema: z.ZodObject<{
|
|
|
980
1031
|
} | undefined;
|
|
981
1032
|
} | undefined;
|
|
982
1033
|
separateArticleCount?: boolean | undefined;
|
|
1034
|
+
separateArticleCountSettings?: {
|
|
1035
|
+
type: "above";
|
|
1036
|
+
copy?: string | undefined;
|
|
1037
|
+
countType?: "for52Weeks" | "forTargetedWeeks" | undefined;
|
|
1038
|
+
} | undefined;
|
|
983
1039
|
}[];
|
|
984
1040
|
contextTargeting: {
|
|
985
1041
|
tagIds: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/abTests/banner.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EAEb,kBAAkB,
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/abTests/banner.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,MAAM,MAAM,oBAAoB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,kBAAkB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
-
import { OphanComponentType, OphanProduct } from '../ophan';
|
|
3
2
|
import { purchaseInfoProduct, purchaseInfoUser } from '../purchaseInfo';
|
|
3
|
+
import { OphanComponentType, OphanProduct } from '@guardian/libs';
|
|
4
4
|
declare const TestStatus: readonly ["Live", "Draft", "Archived"];
|
|
5
5
|
export type TestStatus = (typeof TestStatus)[number];
|
|
6
6
|
export declare const testStatusSchema: z.ZodEnum<["Live", "Draft", "Archived"]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/abTests/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/abTests/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EACH,mBAAmB,EAEnB,gBAAgB,EAEnB,MAAM,iBAAiB,C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
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../shared/src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../shared/src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSX } from '@emotion/react/jsx-runtime';
|
|
2
|
-
import { Cta, SecondaryCta, TickerSettings, Tracking } from './shared';
|
|
3
|
-
import { OphanComponentEvent } from '../ophan';
|
|
2
|
+
import { ArticleCounts, Cta, SecondaryCta, SeparateArticleCount, TickerSettings, Tracking } from './shared';
|
|
4
3
|
import * as z from 'zod';
|
|
5
4
|
import { Prices } from '../prices';
|
|
6
5
|
import { SelectedAmountsVariant } from '../abTests';
|
|
7
6
|
import { ConfigurableDesign } from './design';
|
|
8
7
|
import { AbandonedBasket } from '../targeting';
|
|
8
|
+
import { OphanComponentEvent } from '@guardian/libs';
|
|
9
9
|
export declare const bannerChannelSchema: z.ZodEnum<["contributions", "subscriptions", "signIn", "abandonedBasket"]>;
|
|
10
10
|
export type BannerChannel = z.infer<typeof bannerChannelSchema>;
|
|
11
11
|
export interface BannerContent {
|
|
@@ -112,10 +112,11 @@ export interface BannerProps extends JSX.IntrinsicAttributes {
|
|
|
112
112
|
isSupporter?: boolean;
|
|
113
113
|
tickerSettings?: TickerSettings;
|
|
114
114
|
submitComponentEvent?: (componentEvent: OphanComponentEvent) => void;
|
|
115
|
-
|
|
115
|
+
articleCounts: ArticleCounts;
|
|
116
116
|
hasOptedOutOfArticleCount?: boolean;
|
|
117
117
|
fetchEmail?: () => Promise<string | null>;
|
|
118
118
|
separateArticleCount?: boolean;
|
|
119
|
+
separateArticleCountSettings?: SeparateArticleCount;
|
|
119
120
|
prices?: Prices;
|
|
120
121
|
choiceCardAmounts?: SelectedAmountsVariant;
|
|
121
122
|
design?: ConfigurableDesign;
|
|
@@ -389,7 +390,16 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
389
390
|
} | undefined;
|
|
390
391
|
}>>>;
|
|
391
392
|
submitComponentEvent: z.ZodAny;
|
|
392
|
-
|
|
393
|
+
articleCounts: z.ZodObject<{
|
|
394
|
+
for52Weeks: z.ZodNumber;
|
|
395
|
+
forTargetedWeeks: z.ZodNumber;
|
|
396
|
+
}, "strip", z.ZodTypeAny, {
|
|
397
|
+
for52Weeks: number;
|
|
398
|
+
forTargetedWeeks: number;
|
|
399
|
+
}, {
|
|
400
|
+
for52Weeks: number;
|
|
401
|
+
forTargetedWeeks: number;
|
|
402
|
+
}>;
|
|
393
403
|
hasOptedOutOfArticleCount: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
394
404
|
fetchEmail: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
|
|
395
405
|
separateArticleCount: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
@@ -817,6 +827,10 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
817
827
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
818
828
|
labels?: string[] | null | undefined;
|
|
819
829
|
};
|
|
830
|
+
articleCounts: {
|
|
831
|
+
for52Weeks: number;
|
|
832
|
+
forTargetedWeeks: number;
|
|
833
|
+
};
|
|
820
834
|
bannerChannel: "contributions" | "subscriptions" | "signIn" | "abandonedBasket";
|
|
821
835
|
content?: {
|
|
822
836
|
heading?: string | undefined;
|
|
@@ -876,7 +890,6 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
876
890
|
} | undefined;
|
|
877
891
|
} | null | undefined;
|
|
878
892
|
submitComponentEvent?: any;
|
|
879
|
-
numArticles?: number | null | undefined;
|
|
880
893
|
hasOptedOutOfArticleCount?: boolean | null | undefined;
|
|
881
894
|
fetchEmail?: any;
|
|
882
895
|
separateArticleCount?: boolean | null | undefined;
|
|
@@ -956,6 +969,10 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
956
969
|
products?: ("CONTRIBUTION" | "MEMBERSHIP_SUPPORTER" | "DIGITAL_SUBSCRIPTION" | "PRINT_SUBSCRIPTION")[] | null | undefined;
|
|
957
970
|
labels?: string[] | null | undefined;
|
|
958
971
|
};
|
|
972
|
+
articleCounts: {
|
|
973
|
+
for52Weeks: number;
|
|
974
|
+
forTargetedWeeks: number;
|
|
975
|
+
};
|
|
959
976
|
bannerChannel: "contributions" | "subscriptions" | "signIn" | "abandonedBasket";
|
|
960
977
|
content?: {
|
|
961
978
|
heading?: string | undefined;
|
|
@@ -1015,7 +1032,6 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
1015
1032
|
} | undefined;
|
|
1016
1033
|
} | null | undefined;
|
|
1017
1034
|
submitComponentEvent?: any;
|
|
1018
|
-
numArticles?: number | null | undefined;
|
|
1019
1035
|
hasOptedOutOfArticleCount?: boolean | null | undefined;
|
|
1020
1036
|
fetchEmail?: any;
|
|
1021
1037
|
separateArticleCount?: boolean | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/props/banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AACjD,OAAO,EACH,GAAG,EAEH,YAAY,EAEZ,cAAc,EAEd,QAAQ,EAEX,MAAM,UAAU,CAAC;AAClB,OAAO,
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/props/banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcvB,CAAC"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { JSX } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
-
import { Stage, Tracking } from './shared';
|
|
4
|
-
import { OphanComponentEvent } from '../ophan';
|
|
3
|
+
import { Stage, Tracking, ArticleCounts } from './shared';
|
|
5
4
|
import { EpicVariant } from '../abTests';
|
|
6
|
-
|
|
7
|
-
export type ArticleCounts = {
|
|
8
|
-
[type in ArticleCountType]: number;
|
|
9
|
-
};
|
|
5
|
+
import { OphanComponentEvent } from '@guardian/libs';
|
|
10
6
|
export interface EpicProps extends JSX.IntrinsicAttributes {
|
|
11
7
|
variant: EpicVariant;
|
|
12
8
|
tracking: Tracking;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/props/epic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,
|
|
1
|
+
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/props/epic.ts"],"names":[],"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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW1B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
-
import { OphanComponentEvent } from '
|
|
3
|
+
import { OphanComponentEvent } from '@guardian/libs';
|
|
4
4
|
import { Tracking, Cta } from './shared';
|
|
5
5
|
export interface HeaderContent {
|
|
6
6
|
heading: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/props/header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/props/header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAkB,GAAG,EAAa,MAAM,UAAU,CAAC;AAEpE,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM9B,CAAC;AAEH,MAAM,WAAW,WAAY,SAAQ,GAAG,CAAC,mBAAmB;IACxD,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,CAAC,cAAc,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO5B,CAAC"}
|
|
@@ -199,6 +199,38 @@ export declare const tickerSettingsSchema: z.ZodObject<{
|
|
|
199
199
|
goal: number;
|
|
200
200
|
} | undefined;
|
|
201
201
|
}>;
|
|
202
|
+
export declare const articleCountsSchema: z.ZodObject<{
|
|
203
|
+
for52Weeks: z.ZodNumber;
|
|
204
|
+
forTargetedWeeks: z.ZodNumber;
|
|
205
|
+
}, "strip", z.ZodTypeAny, {
|
|
206
|
+
for52Weeks: number;
|
|
207
|
+
forTargetedWeeks: number;
|
|
208
|
+
}, {
|
|
209
|
+
for52Weeks: number;
|
|
210
|
+
forTargetedWeeks: number;
|
|
211
|
+
}>;
|
|
212
|
+
export type ArticleCountType = 'for52Weeks' | 'forTargetedWeeks';
|
|
213
|
+
export type ArticleCounts = {
|
|
214
|
+
[type in ArticleCountType]: number;
|
|
215
|
+
};
|
|
216
|
+
export declare const separateArticleCountSchema: z.ZodObject<{
|
|
217
|
+
type: z.ZodLiteral<"above">;
|
|
218
|
+
copy: z.ZodOptional<z.ZodString>;
|
|
219
|
+
countType: z.ZodOptional<z.ZodEnum<["for52Weeks", "forTargetedWeeks"]>>;
|
|
220
|
+
}, "strip", z.ZodTypeAny, {
|
|
221
|
+
type: "above";
|
|
222
|
+
copy?: string | undefined;
|
|
223
|
+
countType?: "for52Weeks" | "forTargetedWeeks" | undefined;
|
|
224
|
+
}, {
|
|
225
|
+
type: "above";
|
|
226
|
+
copy?: string | undefined;
|
|
227
|
+
countType?: "for52Weeks" | "forTargetedWeeks" | undefined;
|
|
228
|
+
}>;
|
|
229
|
+
export interface SeparateArticleCount {
|
|
230
|
+
type: 'above';
|
|
231
|
+
copy?: string;
|
|
232
|
+
countType?: ArticleCountType;
|
|
233
|
+
}
|
|
202
234
|
export declare const ophanProductSchema: z.ZodEnum<["CONTRIBUTION", "MEMBERSHIP_SUPPORTER", "DIGITAL_SUBSCRIPTION", "PRINT_SUBSCRIPTION"]>;
|
|
203
235
|
export declare const ophanComponentTypeSchema: z.ZodEnum<["ACQUISITIONS_EPIC", "ACQUISITIONS_ENGAGEMENT_BANNER", "ACQUISITIONS_SUBSCRIPTIONS_BANNER", "ACQUISITIONS_HEADER", "ACQUISITIONS_OTHER"]>;
|
|
204
236
|
export type Tracking = TestTracking & PageTracking;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/props/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAE5C,MAAM,WAAW,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,SAAS;;;;;;;;;EAGpB,CAAC;AAEH,oBAAY,gBAAgB;IACxB,MAAM,uBAAuB;IAC7B,qBAAqB,sCAAs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AAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC;CACpB;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIhC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Note - zod validators for these ophan types are in /props/shared.ts
|
|
3
|
-
* This is to avoid including zod in the dotcom library
|
|
4
|
-
*/
|
|
5
|
-
export type OphanProduct = 'CONTRIBUTION' | 'RECURRING_CONTRIBUTION' | 'MEMBERSHIP_SUPPORTER' | 'MEMBERSHIP_PATRON' | 'MEMBERSHIP_PARTNER' | 'DIGITAL_SUBSCRIPTION' | 'PRINT_SUBSCRIPTION';
|
|
6
|
-
export type OphanAction = 'INSERT' | 'VIEW' | 'EXPAND' | 'LIKE' | 'DISLIKE' | 'SUBSCRIBE' | 'ANSWER' | 'VOTE' | 'CLICK' | 'ACCEPT_DEFAULT_CONSENT' | 'MANAGE_CONSENT' | 'CONSENT_ACCEPT_ALL' | 'CONSENT_REJECT_ALL' | 'STICK' | 'CLOSE' | 'RETURN' | 'SIGN_IN' | 'CREATE_ACCOUNT';
|
|
7
|
-
export type OphanComponentType = 'READERS_QUESTIONS_ATOM' | 'QANDA_ATOM' | 'PROFILE_ATOM' | 'GUIDE_ATOM' | 'TIMELINE_ATOM' | 'NEWSLETTER_SUBSCRIPTION' | 'SURVEYS_QUESTIONS' | 'ACQUISITIONS_EPIC' | 'ACQUISITIONS_ENGAGEMENT_BANNER' | 'ACQUISITIONS_THANK_YOU_EPIC' | 'ACQUISITIONS_HEADER' | 'ACQUISITIONS_FOOTER' | 'ACQUISITIONS_INTERACTIVE_SLICE' | 'ACQUISITIONS_NUGGET' | 'ACQUISITIONS_STANDFIRST' | 'ACQUISITIONS_THRASHER' | 'ACQUISITIONS_EDITORIAL_LINK' | 'ACQUISITIONS_MANAGE_MY_ACCOUNT' | 'ACQUISITIONS_BUTTON' | 'ACQUISITIONS_OTHER' | 'APP_ADVERT' | 'APP_AUDIO' | 'APP_BUTTON' | 'APP_CARD' | 'APP_CROSSWORDS' | 'APP_ENGAGEMENT_BANNER' | 'APP_EPIC' | 'APP_GALLERY' | 'APP_LINK' | 'APP_NAVIGATION_ITEM' | 'APP_SCREEN' | 'APP_THRASHER' | 'APP_VIDEO' | 'AUDIO_ATOM' | 'CHART_ATOM' | 'ACQUISITIONS_MERCHANDISING' | 'ACQUISITIONS_HOUSE_ADS' | 'SIGN_IN_GATE' | 'ACQUISITIONS_SUBSCRIPTIONS_BANNER' | 'MOBILE_STICKY_AD' | 'IDENTITY_AUTHENTICATION' | 'RETENTION_ENGAGEMENT_BANNER' | 'ACQUISITION_SUPPORT_SITE' | 'RETENTION_EPIC' | 'CONSENT' | 'LIVE_BLOG_PINNED_POST' | 'STICKY_VIDEO' | 'KEY_EVENT_CARD' | 'RETENTION_HEADER' | 'SLIDESHOW' | 'APP_FEATURE' | 'CARD' | 'CAROUSEL';
|
|
8
|
-
export type OphanComponent = {
|
|
9
|
-
componentType: OphanComponentType;
|
|
10
|
-
id?: string;
|
|
11
|
-
products?: OphanProduct[];
|
|
12
|
-
campaignCode?: string;
|
|
13
|
-
labels?: string[];
|
|
14
|
-
};
|
|
15
|
-
interface OphanAbTest {
|
|
16
|
-
name: string;
|
|
17
|
-
variant: string;
|
|
18
|
-
}
|
|
19
|
-
export type OphanComponentEvent = {
|
|
20
|
-
component: OphanComponent;
|
|
21
|
-
action: OphanAction;
|
|
22
|
-
value?: string;
|
|
23
|
-
id?: string;
|
|
24
|
-
abTest?: OphanAbTest;
|
|
25
|
-
targetingAbTest?: OphanAbTest;
|
|
26
|
-
};
|
|
27
|
-
export {};
|
|
28
|
-
//# sourceMappingURL=ophan.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ophan.d.ts","sourceRoot":"","sources":["../../../../../shared/src/types/ophan.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,YAAY,GAClB,cAAc,GACd,wBAAwB,GACxB,sBAAsB,GACtB,mBAAmB,GACnB,oBAAoB,GACpB,sBAAsB,GACtB,oBAAoB,CAAC;AAC3B,MAAM,MAAM,WAAW,GACjB,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,MAAM,GACN,SAAS,GACT,WAAW,GACX,QAAQ,GACR,MAAM,GACN,OAAO,GACP,wBAAwB,GACxB,gBAAgB,GAChB,oBAAoB,GACpB,oBAAoB,GACpB,OAAO,GACP,OAAO,GACP,QAAQ,GACR,SAAS,GACT,gBAAgB,CAAC;AACvB,MAAM,MAAM,kBAAkB,GACxB,wBAAwB,GACxB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,eAAe,GACf,yBAAyB,GACzB,mBAAmB,GACnB,mBAAmB,GACnB,gCAAgC,GAChC,6BAA6B,GAC7B,qBAAqB,GACrB,qBAAqB,GACrB,gCAAgC,GAChC,qBAAqB,GACrB,yBAAyB,GACzB,uBAAuB,GACvB,6BAA6B,GAC7B,gCAAgC,GAChC,qBAAqB,GACrB,oBAAoB,GACpB,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,UAAU,GACV,gBAAgB,GAChB,uBAAuB,GACvB,UAAU,GACV,aAAa,GACb,UAAU,GACV,qBAAqB,GACrB,YAAY,GACZ,cAAc,GACd,WAAW,GACX,YAAY,GACZ,YAAY,GACZ,4BAA4B,GAC5B,wBAAwB,GACxB,cAAc,GACd,mCAAmC,GACnC,kBAAkB,GAClB,yBAAyB,GACzB,6BAA6B,GAC7B,0BAA0B,GAC1B,gBAAgB,GAChB,SAAS,GACT,uBAAuB,GACvB,cAAc,GACd,gBAAgB,GAChB,kBAAkB,GAClB,WAAW,GACX,aAAa,GACb,MAAM,GACN,UAAU,CAAC;AAEjB,MAAM,MAAM,cAAc,GAAG;IACzB,aAAa,EAAE,kBAAkB,CAAC;IACl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