@faststore/core 3.100.4 → 3.100.7
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +22 -22
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/webpack/client-production/0.pack +2 -2
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +2 -2
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/prerender-manifest.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/react-loadable-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/948.js +2 -2
- package/.next/server/functions-config-manifest.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/api/graphql.js +3 -3
- package/.next/server/pages/api/preview.js +1 -1
- package/.next/server/pages/en-US/404.html +2 -2
- package/.next/server/pages/en-US/500.html +2 -2
- package/.next/server/pages/en-US/checkout.html +2 -2
- package/.next/server/pages/en-US/login.html +2 -2
- package/.next/server/pages/en-US/password-protection.html +2 -2
- package/.next/server/pages/en-US/s.html +2 -2
- package/.next/server/pages/en-US.html +2 -2
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/chunks/3802.9744a010fe6a4d07.js +1 -0
- package/.next/static/chunks/{webpack-6a844a3f6a390f62.js → webpack-bde714c56fd09a0c.js} +1 -1
- package/.next/trace +156 -156
- package/.turbo/turbo-build.log +11 -11
- package/.turbo/turbo-test.log +11 -9
- package/CHANGELOG.md +18 -0
- package/package.json +2 -2
- package/src/pages/api/graphql.ts +40 -26
- package/src/server/content/service.ts +69 -21
- package/src/utils/trustedForwardedHost.ts +50 -0
- package/test/server/content/service.test.ts +222 -0
- package/test/utils/trustedForwardedHost.test.ts +103 -0
- package/.next/static/chunks/3802.904f302bf009f795.js +0 -1
- /package/.next/static/{s20QxDT2pZcGbsFUk-djq → Oxei21wY_TrPYtPGUrFiR}/_buildManifest.js +0 -0
- /package/.next/static/{s20QxDT2pZcGbsFUk-djq → Oxei21wY_TrPYtPGUrFiR}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import {
|
|
2
|
+
singleForwardedHost,
|
|
3
|
+
isHostAllowed,
|
|
4
|
+
removeCookieDomain,
|
|
5
|
+
} from '../../src/utils/trustedForwardedHost'
|
|
6
|
+
|
|
7
|
+
const ALLOW_LIST = ['localhost', '.vtex.app', '.localhost']
|
|
8
|
+
|
|
9
|
+
describe('isHostAllowed', () => {
|
|
10
|
+
it.each([
|
|
11
|
+
'localhost',
|
|
12
|
+
'store.vtex.app',
|
|
13
|
+
'sfj-1--acc.preview.vtex.app',
|
|
14
|
+
'a.localhost',
|
|
15
|
+
])('allows %s', (host: string) => {
|
|
16
|
+
expect(isHostAllowed(host, ALLOW_LIST)).toBe(true)
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it.each([
|
|
20
|
+
'evil-localhost',
|
|
21
|
+
'notlocalhost',
|
|
22
|
+
'evil-vtex.app',
|
|
23
|
+
'vtex.app.evil.com',
|
|
24
|
+
'evil.com',
|
|
25
|
+
])('rejects %s', (host: string) => {
|
|
26
|
+
expect(isHostAllowed(host, ALLOW_LIST)).toBe(false)
|
|
27
|
+
})
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
describe('isHostAllowed normalization', () => {
|
|
31
|
+
it('is case-insensitive', () => {
|
|
32
|
+
expect(isHostAllowed('Store.VTEX.app', ALLOW_LIST)).toBe(true)
|
|
33
|
+
expect(isHostAllowed('LOCALHOST', ALLOW_LIST)).toBe(true)
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it.each([
|
|
37
|
+
'x;max-age=0;y.vtex.app',
|
|
38
|
+
'a b.vtex.app',
|
|
39
|
+
'x"y.vtex.app',
|
|
40
|
+
'x=y.vtex.app',
|
|
41
|
+
'x,y.vtex.app',
|
|
42
|
+
'x\r\nSet-Cookie: evil=1.vtex.app',
|
|
43
|
+
'x\ny.vtex.app',
|
|
44
|
+
'x\ry.vtex.app',
|
|
45
|
+
])('rejects %s, which would inject cookie attributes', (host: string) => {
|
|
46
|
+
expect(isHostAllowed(host, ALLOW_LIST)).toBe(false)
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
it('accepts punycode hostnames', () => {
|
|
50
|
+
expect(isHostAllowed('xn--lja-bma.vtex.app', ALLOW_LIST)).toBe(true)
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
it('expects a hostname: a port is not stripped here', () => {
|
|
54
|
+
expect(isHostAllowed('store.vtex.app:8080', ALLOW_LIST)).toBe(false)
|
|
55
|
+
expect(isHostAllowed('evil.com:vtex.app', ALLOW_LIST)).toBe(false)
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
describe('singleForwardedHost', () => {
|
|
60
|
+
it('returns the value when there is exactly one', () => {
|
|
61
|
+
expect(singleForwardedHost('a.vtex.app')).toBe('a.vtex.app')
|
|
62
|
+
expect(singleForwardedHost(' a.vtex.app ')).toBe('a.vtex.app')
|
|
63
|
+
expect(singleForwardedHost(['a.vtex.app'])).toBe('a.vtex.app')
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
it('returns undefined when missing or empty', () => {
|
|
67
|
+
expect(singleForwardedHost(undefined)).toBeUndefined()
|
|
68
|
+
expect(singleForwardedHost('')).toBeUndefined()
|
|
69
|
+
expect(singleForwardedHost([])).toBeUndefined()
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
it('ignores multi-value headers instead of picking one', () => {
|
|
73
|
+
expect(singleForwardedHost('a.vtex.app, evil.com')).toBeUndefined()
|
|
74
|
+
expect(singleForwardedHost('evil.com, a.vtex.app')).toBeUndefined()
|
|
75
|
+
expect(singleForwardedHost(['a.vtex.app', 'evil.com'])).toBeUndefined()
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
describe('removeCookieDomain', () => {
|
|
80
|
+
it('drops the Domain attribute and keeps the rest', () => {
|
|
81
|
+
expect(
|
|
82
|
+
removeCookieDomain(
|
|
83
|
+
'checkout.vtex.com=__ofid=abc; expires=Sun, 04 Apr 2027 18:31:26 GMT; domain=acc.vtexcommercestable.com.br; path=/; secure; samesite=lax; httponly'
|
|
84
|
+
)
|
|
85
|
+
).toBe(
|
|
86
|
+
'checkout.vtex.com=__ofid=abc; expires=Sun, 04 Apr 2027 18:31:26 GMT; path=/; secure; samesite=lax; httponly'
|
|
87
|
+
)
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
it('is case-insensitive and removes repeated Domain attributes', () => {
|
|
91
|
+
expect(removeCookieDomain('a=1; Domain=x.com; DOMAIN=y.com; Path=/')).toBe(
|
|
92
|
+
'a=1; Path=/'
|
|
93
|
+
)
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
it('does not touch a cookie whose name is domain', () => {
|
|
97
|
+
expect(removeCookieDomain('domain=1; path=/')).toBe('domain=1; path=/')
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
it('keeps cookies without a Domain attribute unchanged', () => {
|
|
101
|
+
expect(removeCookieDomain('a=1; path=/')).toBe('a=1; path=/')
|
|
102
|
+
})
|
|
103
|
+
})
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3802],{35095:function(e,t,n){"use strict";var r=n(77900),i=n(41325),o=n(90427),s=n.n(o),c=n(31549);function Incentives(e){var{incentives:t,label:n}=e;return(0,c.jsx)(i.Z,{className:"".concat(s().section," section-incentives layout__section"),children:(0,c.jsx)(r.Z,{incentives:t,colored:!0,label:null!=n?n:""})})}Incentives.$componentKey="Incentives",t.Z=Incentives},3802:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return LandingPage},getLandingPageBySlug:function(){return X}});var r,i,o,s,c,a,l,d,p,u,v,f=n(74988),g=n(33067),y=n(35935),b=n(27322),P=n(19173),O=n(35949),j=n(93143),h=n(94173),m=n(25758),w=n(33882),S=n(35095),_=n(31841),I=n(80552),E=n(45859),C=n(76924),T=n(23091),Z=n(43412),x=n.n(Z);let MissingContentError=class MissingContentError extends Error{constructor(e){super("Missing content on the ".concat(Z.contentSource.type," for content type ").concat(e.contentType,". Add content before proceeding. Context: ").concat(JSON.stringify(e,null,2)))}};var D=n(56272),L=n(34235),B=n(18626),M=n.n(B),K=n(72692);let MultipleContentError=class MultipleContentError extends Error{constructor(e){super("Multiple content defined on the ".concat(Z.contentSource.type," for content type ").concat(e.contentType,". Remove duplicated content before proceeding. Context: ").concat(JSON.stringify(e,null,2)))}};var k=n(4018);function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){(0,g.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var isLocator=e=>"string"==typeof e.contentType&&("string"==typeof e.releaseId||"string"==typeof e.documentId||"string"==typeof e.versionId),N=new K.Z({workspace:x().api.workspace,tenant:x().api.storeId,builder:null!==(u=null===(v=x().contentSource)||void 0===v?void 0:v.project)&&void 0!==u?u:"faststore",host:(0,k.Y1)(x().storeUrl)}),F=(r=(0,f.Z)(function*(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:N;if(isLocator(e))return yield t.getCMSPage(e).then(e=>({data:[e]}));var n=[],r=yield t.getCMSPagesByContentType(e.contentType,_objectSpread(_objectSpread({},e.filters),{},{page:1,perPage:10}));n.push(...r.data);var i=Array.from({length:Math.ceil(r.totalItems/10)-1},(e,t)=>t+2);return r.totalItems>n.length&&(yield Promise.all(i.map(n=>t.getCMSPagesByContentType(e.contentType,_objectSpread(_objectSpread({},e.filters),{},{page:n,perPage:10}))))).forEach(e=>{n.push(...e.data)}),{data:n}}),function(e){return r.apply(this,arguments)}),W=(i=(0,f.Z)(function*(e){var t=(yield F(e)).data;if(t.length>1)throw new MultipleContentError(e);return t[0]}),function(e){return i.apply(this,arguments)});function normalizePLPSlug(e){var t=e.replace(/^\/+|\/+$/g,"");return"/"+(t=t.replace(/\/+/g,"/").replace(/\s+/g,"")).toLowerCase()}function findPLPTemplateBySlug(e,t,n){return e.find(e=>{if(!(null!==(r=e.settings)&&void 0!==r&&null!==(i=r.template)&&void 0!==i&&i.value))return!1;var r,i,o,s,c=normalizePLPSlug(null===(o=e.settings)||void 0===o?void 0:null===(s=o.template)||void 0===s?void 0:s.value);return c===t||function(e){var{rewrites:t,templateValue:n,slug:r}=e;return!!t&&!!(Array.isArray(t)?t:[...(null==t?void 0:t.beforeFiles)||[],...(null==t?void 0:t.afterFiles)||[],...(null==t?void 0:t.fallback)||[]]).find(e=>e.source===n&&e.destination===r)}({rewrites:n,templateValue:c,slug:t})})}function findBestPLPTemplate(e,t,n){for(var r=normalizePLPSlug(t),i=findPLPTemplateBySlug(e,r,n);!i&&-1!==r.lastIndexOf("/");)i=findPLPTemplateBySlug(e,r=r.substring(0,r.lastIndexOf("/")),n);return i||e.find(e=>{var t,n;return!(null!==(t=e.settings)&&void 0!==t&&null!==(n=t.template)&&void 0!==n&&n.value)})||e[0]}var getSlugsWithoutSkuIdFromPDP=e=>{for(var t=[],n=e,r=n.match(/-\d+\/p$/);r;){var i=n.replace(/-\d+\/p$/,"/p");t.push(i),r=(n=i).match(/-\d+\/p$/)}return t};function findBestPDPTemplate(e,t){for(var n of function(e){var{itemListElement:t=[]}=e,n=[...t].reverse().map(e=>{var{item:t}=e;return t}),r=n[0],i=getSlugsWithoutSkuIdFromPDP(r);return[r,...i,...n.slice(1)].filter((e,t,n)=>e&&n.indexOf(e)===t)}({itemListElement:null!==(i=t.breadcrumbList.itemListElement)&&void 0!==i?i:[]}))for(var r of e)if(null!==(o=r.settings)&&void 0!==o&&null!==(s=o.template)&&void 0!==s&&s.value){var i,o,s;if(function(e){var t=e.trim().replace(/^\/+|\/+$/g,"");return t.startsWith("/")||(t="/"+t),t.endsWith("/p")||(t+="/"),(t=t.replace(/\/+/g,"/").replace(/\s+/g,"")).toLowerCase()}(r.settings.template.value)===n)return r}return e.find(e=>{var t,n;return!(null!==(t=e.settings)&&void 0!==t&&null!==(n=t.template)&&void 0!==n&&n.value)})||e[0]}function plp_ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function plp_objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?plp_ownKeys(Object(n),!0).forEach(function(t){(0,g.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):plp_ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var A=(o=(0,f.Z)(function*(e,t,n){if(x().cms.data){var r=JSON.parse(x().cms.data).plp;return yield $("/".concat(e,"/"),r,plp_objectSpread(plp_objectSpread({},(null==t?void 0:t.contentType)==="plp"?t:null),{},{contentType:"plp"}),n)}return yield J("/".concat(e,"/"),plp_objectSpread(plp_objectSpread({},(null==t?void 0:t.contentType)==="plp"?t:null),{},{contentType:"plp"}),n)}),function(e,t,n){return o.apply(this,arguments)}),$=(s=(0,f.Z)(function*(e,t,n,r){var i=null!=t?t:[];if(!i[0])throw new MissingContentError(n);var o=findBestPLPTemplate(i,e,r);return W({contentType:"plp",documentId:o.documentId,versionId:o.versionId})}),function(e,t,n,r){return s.apply(this,arguments)}),J=(c=(0,f.Z)(function*(e,t,n){var r=(yield F(t)).data;if(!r[0])throw new MissingContentError(t);return findBestPLPTemplate(r,e,n)}),function(e,t,n){return c.apply(this,arguments)});function pdp_ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pdp_objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pdp_ownKeys(Object(n),!0).forEach(function(t){(0,g.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pdp_ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var U=(a=(0,f.Z)(function*(e,t){if(x().cms.data){var n=JSON.parse(x().cms.data).pdp;return yield q(e,n,pdp_objectSpread(pdp_objectSpread({},(null==t?void 0:t.contentType)==="pdp"?t:null),{},{contentType:"pdp"}))}return yield z(e,pdp_objectSpread(pdp_objectSpread({},(null==t?void 0:t.contentType)==="pdp"?t:null),{},{contentType:"pdp"}))}),function(e,t){return a.apply(this,arguments)}),q=(l=(0,f.Z)(function*(e,t,n){var r=null!=t?t:[];if(!r[0])throw new MissingContentError(n);var i=findBestPDPTemplate(r,e);return W({contentType:"pdp",documentId:i.documentId,versionId:i.versionId})}),function(e,t,n){return l.apply(this,arguments)}),z=(d=(0,f.Z)(function*(e,t){var n=(yield F(t)).data;if(!n[0])throw new MissingContentError(t);return findBestPDPTemplate(n,e)}),function(e,t){return d.apply(this,arguments)}),G=n(20306),R=["slug"];function service_ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function service_objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?service_ownKeys(Object(n),!0).forEach(function(t){(0,g.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):service_ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var V=new class{constructor(){(0,g.Z)(this,"clientCP",void 0),this.clientCP=new(M())({tenant:x().api.storeId})}getSingleContent(e){var t=this;return(0,f.Z)(function*(){var n=t.createContentOptions(e);return(0,G.w)()?t.getFromCP(n):W(n.cmsOptions)})()}getMultipleContent(e){var t=this;return(0,f.Z)(function*(){var n=t.createContentOptions(e);if((0,G.w)()){var r=t.convertOptionsToParams(n),i=[],o=0;do{var s,c,a=yield t.clientCP.listEntries(r,s);i.push(...a.entries);var l=null!==(c=a.scroll)&&void 0!==c?c:void 0;if(l&&l===s)break;s=l}while(s&&++o<25);return o>=25&&console.warn("listEntries pagination hit MAX_PAGES cap",r),t.fillEntriesWithData(i,r,n.isPreview)}return F(n.cmsOptions)})()}getPlpContent(e,t){var n=this;return(0,f.Z)(function*(){var r=service_objectSpread(service_objectSpread({},e),{},{contentType:"plp"}),i=n.createContentOptions(r);if((0,G.w)()){var o=yield n.getSingleContent(r);if(o)return o;var s=(yield n.getMultipleContent(r)).data;if(!(null!=s&&s.length))throw new MissingContentError(i.cmsOptions);return findBestPLPTemplate(s,i.slug,t)}return A(i.slug,i.cmsOptions,t)})()}getPdpContent(e,t){var n=this;return(0,f.Z)(function*(){var r=service_objectSpread(service_objectSpread({},t),{},{contentType:"pdp"}),i=n.createContentOptions(r);if((0,G.w)()){var o=yield n.getSingleContent(r);if(o)return o;var s=(yield n.getMultipleContent(r)).data;if(!s.length)throw new MissingContentError(i.cmsOptions);return findBestPDPTemplate(s,e)}return U(e,i.cmsOptions)})()}getFromCP(e){var t=this;return(0,f.Z)(function*(){var n=t.convertOptionsToParams(e);try{return yield t.getEntry(n,e.isPreview)}catch(e){if(!(e instanceof MissingContentError||e instanceof Error&&/\b404\b/.test(e.message)))throw e;console.warn("Content not found",e)}})()}fillEntriesWithData(e,t,n){var r=this;return(0,f.Z)(function*(){var i;return{data:yield Promise.all(e.map((i=(0,f.Z)(function*(e){var i=yield r.getEntryData(service_objectSpread(service_objectSpread({},t),{},{entryId:e.id}),n);return r.mergeEntryWithData(e,i)}),function(e){return i.apply(this,arguments)})))}})()}getEntry(e,t){var n=this;return(0,f.Z)(function*(){return e.entryId||e.slug?yield n.getEntryData(e,t):yield n.fetchFirstEntryFromList(e,t)})()}getEntryData(e,t){var n=this;return(0,f.Z)(function*(){if(!e.entryId&&!e.slug)throw Error("".concat(t?"Preview":"getEntry"," requires entryId or slug"));return t?e.entryId?n.clientCP.previewEntryById(e):n.clientCP.previewEntryBySlug(e):e.entryId?n.clientCP.getEntry(e):n.clientCP.getEntryBySlug(e)})()}fetchFirstEntryFromList(e,t){var n=this;return(0,f.Z)(function*(){var{entries:r}=yield n.clientCP.listEntries(e);if(!r||0===r.length)return console.warn("No entries found for params",e),{};if(r.length>1)throw new MultipleContentError(e);return n.getEntryData(service_objectSpread(service_objectSpread({},e),{},{entryId:r[0].id}),t)})()}createContentOptions(e){var{contentType:t,previewData:n,slug:r}=e,i=(null==n?void 0:n.contentType)===t,o=(0,G.b)(n);return service_objectSpread(service_objectSpread({cmsOptions:this.buildCmsOptions(e,i,o)},void 0!==r&&{slug:r}),{},{isPreview:i||o})}convertOptionsToParams(e){var t,n,{cmsOptions:r}=e,i={accountName:x().api.storeId,storeId:null!==(t=null===(n=x().contentSource)||void 0===n?void 0:n.project)&&void 0!==t?t:"faststore",contentType:r.contentType,slug:e.slug};if("documentId"in r&&r.documentId&&(i.entryId=r.documentId),"versionId"in r&&r.versionId&&(i.branchId=r.versionId),"releaseId"in r&&r.releaseId&&(i.branchId=r.releaseId),"filters"in r&&r.filters){var o=r.filters.filters;if(o&&o["settings.seo.slug"]){var s=o["settings.seo.slug"];i.slug=s.replace(/^\//,"")}Object.assign(i,r.filters)}return i}buildCmsOptions(e,t,n){var{contentType:r,previewData:i,documentId:o,versionId:s,releaseId:c,filters:a}=e,l=i||{},{slug:d}=l,p=(0,L.Z)(l,R);return service_objectSpread(service_objectSpread(service_objectSpread(service_objectSpread(service_objectSpread(service_objectSpread({contentType:r},t?p:{}),n&&{versionId:null==i?void 0:i.versionId,releaseId:null==i?void 0:i.releaseId}),void 0!==o&&{documentId:o}),void 0!==s&&{versionId:s}),void 0!==c&&{releaseId:c}),a&&{filters:a})}mergeEntryWithData(e,t){return service_objectSpread(service_objectSpread(service_objectSpread({},e),t),{},{id:e.id,name:e.name||""})}},H=n(31549);function LandingPage_ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function LandingPage_objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LandingPage_ownKeys(Object(n),!0).forEach(function(t){(0,g.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LandingPage_ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Q=LandingPage_objectSpread(LandingPage_objectSpread(LandingPage_objectSpread({},b.Z),{},{[(0,O.x)(w.V,"Hero")]:w.V,[(0,O.x)(h.OverriddenDefaultBannerText,"BannerText")]:h.OverriddenDefaultBannerText,[(0,O.x)(j.default,"BannerNewsletter")]:j.default,[(0,O.x)(S.Z,"Incentives")]:S.Z,[(0,O.x)(m.Z,"CrossSellingShelf")]:m.Z,[(0,O.x)(_.OverriddenDefaultNewsletter,"Newsletter")]:_.OverriddenDefaultNewsletter,[(0,O.x)(I.OverriddenDefaultProductShelf,"ProductShelf")]:I.OverriddenDefaultProductShelf,[(0,O.x)(E.Z,"ProductTiles")]:E.Z},T.Z),C.Z);function LandingPage(e){var t,n,r,i,o,s,c,a,l,d,p,u,v,f,{page:{sections:g,settings:b},slug:O,serverData:j,globalSections:h,globalSettings:m}=e;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(y.PB,{title:null!==(t=null==b?void 0:null===(n=b.seo)||void 0===n?void 0:n.title)&&void 0!==t?t:x().seo.title,description:null!==(r=null==b?void 0:null===(i=b.seo)||void 0===i?void 0:i.description)&&void 0!==r?r:null===(o=x().seo)||void 0===o?void 0:o.description,titleTemplate:null!==(s=null===(c=x().seo)||void 0===c?void 0:c.titleTemplate)&&void 0!==s?s:null===(a=x().seo)||void 0===a?void 0:a.title,canonical:null!==(l=null==b?void 0:null===(d=b.seo)||void 0===d?void 0:d.canonical)&&void 0!==l?l:"".concat(x().storeUrl,"/").concat(O),openGraph:{type:"website",url:x().storeUrl,title:null!==(p=null==b?void 0:null===(u=b.seo)||void 0===u?void 0:u.title)&&void 0!==p?p:x().seo.title,description:null!==(v=null==b?void 0:null===(f=b.seo)||void 0===f?void 0:f.description)&&void 0!==v?v:x().seo.description}}),(0,H.jsx)(y.iu,{url:x().storeUrl,potentialActions:[{target:"".concat(x().storeUrl,"/s/?q"),queryInput:"search_term_string"}]}),(0,H.jsx)(D.ZP,{context:{data:j,globalSettings:m},children:(0,H.jsx)(P.ZP,{sections:g,globalSections:h,components:Q})})]})}var X=(p=(0,f.Z)(function*(e,t){try{if(x().cms.data){var n,r,i=JSON.parse(x().cms.data).landingPage.find(e=>{var t,n;null===(t=e.settings)||void 0===t||null===(n=t.seo)||void 0===n||n.slug});if(i)return yield V.getSingleContent({contentType:"landingPage",previewData:t,documentId:i.documentId,versionId:i.versionId,releaseId:i.releaseId,slug:null===(n=i.settings)||void 0===n?void 0:null===(r=n.seo)||void 0===r?void 0:r.slug})}return yield V.getSingleContent({contentType:"landingPage",previewData:t,slug:e,filters:(null==t?void 0:t.contentType)!=="landingPage"?{filters:{"settings.seo.slug":"/".concat(e)}}:void 0})}catch(e){if(e instanceof MissingContentError)return null;throw e}}),function(e,t){return p.apply(this,arguments)})},77900:function(e,t,n){"use strict";var r=n(94564),i=n(42659),o=n(2614),s=n(31549);t.Z=function(e){var{incentives:t,variant:n="horizontal",colored:c=!1,label:a}=e;return(0,s.jsx)("section",{"data-fs-incentives":!0,"data-fs-incentives-colored":c,"data-fs-incentives-variant":n,"aria-label":"Incentives List ".concat(a),children:(0,s.jsx)(r.Z,{"data-fs-content":"incentives",children:t.map((e,t)=>(0,s.jsx)("li",{role:"listitem",children:(0,s.jsxs)(i.Z,{tabIndex:0,children:[(0,s.jsx)(o.Z,{"data-fs-incentive-icon":!0,"aria-label":e.alt,name:e.icon,width:32,height:32}),(0,s.jsxs)("section",{"data-fs-incentive-content":!0,children:[(0,s.jsx)("p",{"data-fs-incentive-title":!0,children:e.title}),(0,s.jsx)("span",{"data-fs-incentive-description":!0,children:e.firstLineText}),e.secondLineText&&(0,s.jsx)("span",{"data-fs-incentive-description":!0,children:e.secondLineText})]})]})},String(t)))})})}},90427:function(e){e.exports={section:"section_section__jnQ3q"}},42659:function(e,t,n){"use strict";var r=n(44194);let i=(0,r.forwardRef)(function({testId:e="store-incentive",children:t,...n},i){return r.createElement("section",{ref:i,"data-fs-incentive":!0,"data-testid":e,...n},t)});t.Z=i}}]);
|
|
File without changes
|
|
File without changes
|