@postnord/pn-marketweb-components 2.2.11 → 2.3.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.
Files changed (45) hide show
  1. package/cjs/{MarketWebContextService-392b4585.js → MarketWebContextService-f77b4a5f.js} +61 -59
  2. package/cjs/pn-language-selector_9.cjs.entry.js +22 -13
  3. package/cjs/pn-marketweb-sitefooter.cjs.entry.js +1 -1
  4. package/cjs/pn-marketweb-siteheader.cjs.entry.js +1 -1
  5. package/cjs/pn-proxio-findprice.cjs.entry.js +1 -1
  6. package/cjs/pn-proxio-pricegroup.cjs.entry.js +1 -1
  7. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.stories.js +3 -2
  8. package/collection/components/navigation/pn-language-selector/translations.js +22 -13
  9. package/collection/globals/MarketWebContextService.js +61 -59
  10. package/custom-elements/index.js +83 -72
  11. package/esm/{MarketWebContextService-872043cc.js → MarketWebContextService-3ed3fe80.js} +61 -59
  12. package/esm/pn-language-selector_9.entry.js +22 -13
  13. package/esm/pn-marketweb-sitefooter.entry.js +1 -1
  14. package/esm/pn-marketweb-siteheader.entry.js +1 -1
  15. package/esm/pn-proxio-findprice.entry.js +1 -1
  16. package/esm/pn-proxio-pricegroup.entry.js +1 -1
  17. package/esm-es5/MarketWebContextService-3ed3fe80.js +1 -0
  18. package/esm-es5/pn-language-selector_9.entry.js +1 -1
  19. package/esm-es5/pn-marketweb-sitefooter.entry.js +1 -1
  20. package/esm-es5/pn-marketweb-siteheader.entry.js +1 -1
  21. package/esm-es5/pn-proxio-findprice.entry.js +1 -1
  22. package/esm-es5/pn-proxio-pricegroup.entry.js +1 -1
  23. package/package.json +1 -1
  24. package/pn-market-web-components/{p-5176eaf3.entry.js → p-30d3dc6f.entry.js} +1 -1
  25. package/pn-market-web-components/p-67887512.system.js +1 -1
  26. package/pn-market-web-components/{p-befd7c8d.entry.js → p-77c907d9.entry.js} +1 -1
  27. package/pn-market-web-components/p-783b4892.js +1 -0
  28. package/pn-market-web-components/{p-dc714241.entry.js → p-803088a3.entry.js} +1 -1
  29. package/pn-market-web-components/p-861def61.entry.js +1 -0
  30. package/pn-market-web-components/p-8f1b7c70.system.entry.js +1 -0
  31. package/pn-market-web-components/{p-fe417bbb.system.entry.js → p-906719be.system.entry.js} +1 -1
  32. package/pn-market-web-components/{p-dd0b02de.entry.js → p-9c2c1aa2.entry.js} +1 -1
  33. package/pn-market-web-components/p-cb53b67f.system.js +1 -0
  34. package/pn-market-web-components/{p-9c18464d.system.entry.js → p-efe598a8.system.entry.js} +1 -1
  35. package/pn-market-web-components/{p-ed990629.system.entry.js → p-f008015e.system.entry.js} +1 -1
  36. package/pn-market-web-components/{p-5b802a17.system.entry.js → p-f583fba4.system.entry.js} +1 -1
  37. package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
  38. package/types/components/navigation/pn-language-selector/translations.d.ts +9 -0
  39. package/umd/pn-marketweb-init.js +1 -1
  40. package/umd/pn-marketweb-salesforce.js +2 -1
  41. package/esm-es5/MarketWebContextService-872043cc.js +0 -1
  42. package/pn-market-web-components/p-31fd7a95.system.js +0 -1
  43. package/pn-market-web-components/p-74120b9b.js +0 -1
  44. package/pn-market-web-components/p-84193b02.system.entry.js +0 -1
  45. package/pn-market-web-components/p-b3bf353f.entry.js +0 -1
@@ -1,79 +1,79 @@
1
1
  class MarketWebContextService {
2
2
  constructor(href = window.location.href) {
3
- this.href = "";
4
- this.market = "";
5
- this.language = "";
6
- this.environment = "";
3
+ this.href = '';
4
+ this.market = '';
5
+ this.language = '';
6
+ this.environment = '';
7
7
  this.url = null;
8
- this.allowedLanguages = ["sv", "da", "fi", "no", "en", "de"];
9
- this.allowedMarkets = ["se", "dk", "fi", "no", "com", "de", "tpl"];
10
- this.wwwMarkets = ["se", "dk", "fi", "no", "de", "com"];
11
- this.developmentDomains = ["localhost", ".local", "local.", ".dev", "dev."];
8
+ this.allowedLanguages = ['sv', 'da', 'fi', 'no', 'en', 'de', 'zh', 'fr', 'es'];
9
+ this.allowedMarkets = ['se', 'dk', 'fi', 'no', 'com', 'de', 'tpl'];
10
+ this.wwwMarkets = ['se', 'dk', 'fi', 'no', 'de', 'com'];
11
+ this.developmentDomains = ['localhost', '.local', 'local.', '.dev', 'dev.'];
12
12
  this.markets = {
13
- "se": {
14
- fallbackLanguage: "sv",
13
+ se: {
14
+ fallbackLanguage: 'sv',
15
15
  integration: 'se-integration.postnord.com',
16
16
  preproduction: 'se-preproduction.postnord.com',
17
17
  production: 'se-production.postnord.com',
18
- live: 'www.postnord.se'
18
+ live: 'www.postnord.se',
19
19
  },
20
- "dk": {
21
- fallbackLanguage: "da",
20
+ dk: {
21
+ fallbackLanguage: 'da',
22
22
  integration: 'dk-integration.postnord.com',
23
23
  preproduction: 'dk-preproduction.postnord.com',
24
24
  production: 'dk-production.postnord.com',
25
- live: 'www.postnord.dk'
25
+ live: 'www.postnord.dk',
26
26
  },
27
- "fi": {
28
- fallbackLanguage: "fi",
27
+ fi: {
28
+ fallbackLanguage: 'fi',
29
29
  integration: 'fi-integration.postnord.com',
30
30
  preproduction: 'fi-preproduction.postnord.com',
31
31
  production: 'fi-production.postnord.com',
32
- live: 'www.postnord.fi'
32
+ live: 'www.postnord.fi',
33
33
  },
34
- "no": {
35
- fallbackLanguage: "no",
34
+ no: {
35
+ fallbackLanguage: 'no',
36
36
  integration: 'no-integration.postnord.com',
37
37
  preproduction: 'no-preproduction.postnord.com',
38
38
  production: 'no-production.postnord.com',
39
- live: 'www.postnord.no'
39
+ live: 'www.postnord.no',
40
40
  },
41
- "com": {
42
- fallbackLanguage: "en",
41
+ com: {
42
+ fallbackLanguage: 'en',
43
43
  integration: 'com-integration.postnord.com',
44
44
  preproduction: 'com-preproduction.postnord.com',
45
45
  production: 'com-production.postnord.com',
46
- live: 'www.postnord.com'
46
+ live: 'www.postnord.com',
47
47
  },
48
- "de": {
49
- fallbackLanguage: "en",
48
+ de: {
49
+ fallbackLanguage: 'en',
50
50
  integration: 'de-integration.postnord.com',
51
51
  preproduction: 'de-preproduction.postnord.com',
52
52
  production: 'de-production.postnord.com',
53
- live: 'www.postnord.de'
53
+ live: 'www.postnord.de',
54
54
  },
55
- "tpl": {
56
- fallbackLanguage: "sv",
55
+ tpl: {
56
+ fallbackLanguage: 'sv',
57
57
  integration: 'tpl-integration.postnord.com',
58
58
  preproduction: 'tpl-preproduction.postnord.com',
59
59
  production: 'tpl-production.postnord.com',
60
- live: 'tpl.postnord.com'
60
+ live: 'tpl.postnord.com',
61
61
  },
62
62
  };
63
- this.environmentTypes = ["integration", "preproduction", "production"];
63
+ this.environmentTypes = ['integration', 'preproduction', 'production'];
64
64
  this.environments = {
65
- "production": {
66
- "name": "production",
67
- "url": "https://www.postnord.xx/"
65
+ production: {
66
+ name: 'production',
67
+ url: 'https://www.postnord.xx/',
68
68
  },
69
- "preproduction": {
70
- "name": "preproduction",
71
- "url": "https://com-preproduction.postnord.com/"
69
+ preproduction: {
70
+ name: 'preproduction',
71
+ url: 'https://com-preproduction.postnord.com/',
72
+ },
73
+ integration: {
74
+ name: 'integration',
75
+ url: 'https://com-integration.postnord.com/',
72
76
  },
73
- "integration": {
74
- "name": "integration",
75
- "url": "https://com-integration.postnord.com/"
76
- }
77
77
  };
78
78
  this.href = href;
79
79
  this.url = new URL(this.href);
@@ -92,7 +92,7 @@ class MarketWebContextService {
92
92
  await this.resolveMarket();
93
93
  return this.market;
94
94
  }
95
- async getEndpoint(environmentName, marketName = "") {
95
+ async getEndpoint(environmentName, marketName = '') {
96
96
  let url = this.environments.production.url;
97
97
  if (this.markets[marketName] && this.markets[marketName][environmentName]) {
98
98
  if (environmentName === 'production' && window.location.hostname.indexOf(this.markets[marketName]['live']) === 0) {
@@ -109,18 +109,18 @@ class MarketWebContextService {
109
109
  if (environmentName === this.environments.production.name) {
110
110
  if (this.wwwMarkets.indexOf(marketName) !== -1) {
111
111
  // Handles www.postnord.xx domains
112
- url = url.replace(".xx", "." + marketName);
112
+ url = url.replace('.xx', '.' + marketName);
113
113
  }
114
114
  else {
115
- url = url.replace(".xx", ".com"); // Expect URL to end in postnord.com
116
- url = url.replace("www.", marketName + ".");
115
+ url = url.replace('.xx', '.com'); // Expect URL to end in postnord.com
116
+ url = url.replace('www.', marketName + '.');
117
117
  }
118
118
  }
119
119
  }
120
120
  return url;
121
121
  }
122
122
  async getEnvironmentName() {
123
- const likelyEnvironment = this.environmentTypes.filter(x => this.url.hostname.indexOf(('-' + x)) !== -1)[0];
123
+ const likelyEnvironment = this.environmentTypes.filter(x => this.url.hostname.indexOf('-' + x) !== -1)[0];
124
124
  if (likelyEnvironment) {
125
125
  this.environment = likelyEnvironment;
126
126
  return this.environment;
@@ -138,17 +138,17 @@ class MarketWebContextService {
138
138
  }
139
139
  async resolveMarket() {
140
140
  // Resolve market from www domains
141
- if (this.href.indexOf("//www.") !== -1) {
141
+ if (this.href.indexOf('//www.') !== -1) {
142
142
  const domainRoot = this.url.hostname.substring(this.url.hostname.lastIndexOf('.') + 1, this.url.hostname.length);
143
143
  if (domainRoot && this.markets[domainRoot]) {
144
144
  this.market = domainRoot;
145
145
  }
146
146
  else {
147
- console.warn("Unable to define market from www. domain", this.href);
147
+ console.warn('Unable to define market from www. domain', this.href);
148
148
  }
149
149
  }
150
150
  // Check if domains are on one of the integration/preproduction/production environments urls
151
- const likelyEnvironment = this.environmentTypes.filter(x => this.url.hostname.indexOf(('-' + x)) !== -1);
151
+ const likelyEnvironment = this.environmentTypes.filter(x => this.url.hostname.indexOf('-' + x) !== -1);
152
152
  if (!this.market && likelyEnvironment && likelyEnvironment.length > 0) {
153
153
  const matchedEnvironment = likelyEnvironment[0];
154
154
  const marketPrefix = this.url.hostname.substring(0, this.url.hostname.indexOf('-' + matchedEnvironment));
@@ -156,14 +156,14 @@ class MarketWebContextService {
156
156
  this.market = marketPrefix;
157
157
  }
158
158
  else {
159
- console.warn("Unable to define market from preset environment names", this.href);
159
+ console.warn('Unable to define market from preset environment names', this.href);
160
160
  }
161
161
  }
162
162
  if (!this.market) {
163
163
  if (this.url.hostname.indexOf('www') === -1 && this.url.hostname.indexOf('.postnord.') > 0) {
164
164
  const start = this.url.hostname.indexOf('.') !== this.url.hostname.indexOf('.postnord') ? this.url.hostname.indexOf('.') : 0;
165
165
  const potentialMarket = this.url.hostname.substring(start, this.url.hostname.indexOf('.postnord.'));
166
- // Break down the subdomain to the word closest to .postnord. and take that word.
166
+ // Break down the subdomain to the word closest to .postnord. and take that word.
167
167
  // Supports sub-sub domain down to 1 level.
168
168
  if (this.allowedMarkets.indexOf(potentialMarket) !== -1) {
169
169
  this.market = potentialMarket;
@@ -171,7 +171,7 @@ class MarketWebContextService {
171
171
  }
172
172
  }
173
173
  }
174
- // Check if we're on a development environment
174
+ // Check if we're on a development environment
175
175
  if (!this.market) {
176
176
  const matchedDevEnvironment = this.developmentDomains.filter(x => this.url.hostname.indexOf(x) !== -1)[0];
177
177
  if (!matchedDevEnvironment) {
@@ -179,7 +179,7 @@ class MarketWebContextService {
179
179
  this.market = this.allowedMarkets[0];
180
180
  return;
181
181
  }
182
- const urlWithoutDomain = this.href.replace(matchedDevEnvironment, "");
182
+ const urlWithoutDomain = this.href.replace(matchedDevEnvironment, '');
183
183
  // We see if the dev environment contains something like /dk
184
184
  let matchedMarket = this.allowedMarkets.filter(x => {
185
185
  const typesOfFallback = ['.' + x, x + '.', '/' + x + '/']; // Ex /dk, dk.html, /dk/
@@ -191,7 +191,7 @@ class MarketWebContextService {
191
191
  }
192
192
  else {
193
193
  // We do a similar filter for subpaths but for language this time
194
- let filteredMarket = Object.entries(this.markets).filter((item) => {
194
+ let filteredMarket = Object.entries(this.markets).filter(item => {
195
195
  const typesOfFallback = ['.' + item[1].fallbackLanguage, item[1].fallbackLanguage + '.', '/' + item[1].fallbackLanguage + '/']; // Ex /dk, dk.html, /dk/
196
196
  const matchedTypeOfFallback = typesOfFallback.filter(y => urlWithoutDomain.indexOf(y) !== -1);
197
197
  return matchedTypeOfFallback.length > 0;
@@ -202,7 +202,7 @@ class MarketWebContextService {
202
202
  }
203
203
  }
204
204
  if (!this.market) {
205
- console.info("Was unable to detect market, used fallback");
205
+ console.info('Was unable to detect market, used fallback');
206
206
  this.market = this.allowedMarkets[0];
207
207
  }
208
208
  }
@@ -212,12 +212,14 @@ class MarketWebContextService {
212
212
  return;
213
213
  }
214
214
  const potentialLanguages = [
215
- (_a = document.querySelector("html[lang]")) === null || _a === void 0 ? void 0 : _a.getAttribute("lang"),
216
- (_b = document.querySelector('[http-equiv="content-language"][content]')) === null || _b === void 0 ? void 0 : _b.getAttribute("content"),
217
- (_c = document.querySelector('[property="og:locale"][content]')) === null || _c === void 0 ? void 0 : _c.getAttribute("content"),
218
- (_d = document.querySelector("[lang]")) === null || _d === void 0 ? void 0 : _d.getAttribute("lang"),
215
+ (_a = document.querySelector('html[lang]')) === null || _a === void 0 ? void 0 : _a.getAttribute('lang'),
216
+ (_b = document.querySelector('[http-equiv="content-language"][content]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content'),
217
+ (_c = document.querySelector('[property="og:locale"][content]')) === null || _c === void 0 ? void 0 : _c.getAttribute('content'),
218
+ (_d = document.querySelector('[lang]')) === null || _d === void 0 ? void 0 : _d.getAttribute('lang'),
219
219
  ];
220
- potentialLanguages.filter(x => x).forEach((language) => {
220
+ potentialLanguages
221
+ .filter(x => x)
222
+ .forEach(language => {
221
223
  if (this.allowedLanguages.indexOf(language)) {
222
224
  this.language = language;
223
225
  return;
@@ -25150,24 +25150,33 @@ let PnfindServiceAndPriceResult = class extends HTMLElement {
25150
25150
  };
25151
25151
 
25152
25152
  const translations$a = {
25153
- 'sv': {
25154
- "heading": "Språk",
25153
+ sv: {
25154
+ heading: 'Språk',
25155
25155
  },
25156
- 'en': {
25157
- "heading": "Language"
25156
+ en: {
25157
+ heading: 'Language',
25158
25158
  },
25159
- 'da': {
25160
- "heading": "Sprog"
25159
+ da: {
25160
+ heading: 'Sprog',
25161
25161
  },
25162
- 'no': {
25163
- "heading": "Språk"
25162
+ no: {
25163
+ heading: 'Språk',
25164
25164
  },
25165
- 'fi': {
25166
- "heading": "Kieli"
25165
+ fi: {
25166
+ heading: 'Kieli',
25167
+ },
25168
+ de: {
25169
+ heading: 'Sprache',
25170
+ },
25171
+ zh: {
25172
+ heading: '语言',
25173
+ },
25174
+ fr: {
25175
+ heading: 'Langue',
25176
+ },
25177
+ es: {
25178
+ heading: 'Idioma',
25167
25179
  },
25168
- 'de': {
25169
- "heading": "Sprache"
25170
- }
25171
25180
  };
25172
25181
 
25173
25182
  const pnLanguageSelectorCss = "pn-language-selector{max-height:5.2rem}pn-language-selector pn-nav-dropdown:not([data-open]) .nav-dropdown-content-container,pn-language-selector pn-nav-dropdown[data-open=false] .nav-dropdown-content-container{display:none}pn-language-selector pn-nav-dropdown{display:block}.languageselector{position:relative}.languageselector-togglebtn{cursor:pointer;border:0;padding:0.64rem 0;background-color:#FFFFFF;color:#005D92;font-size:1.6rem}.languageselector-togglebtn:hover,.languageselector-togglebtn:focus,.languageselector-togglebtn:active{color:#0D234B;text-decoration:underline}.languageselector-togglebtn svg{width:1.9rem;height:1.9rem}.languageselector-title{padding:0.8rem 1.6rem;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.languageselector-list{margin:0;padding:0;list-style:none}";
@@ -25811,80 +25820,80 @@ class FetchHelper {
25811
25820
 
25812
25821
  class MarketWebContextService {
25813
25822
  constructor(href = window.location.href) {
25814
- this.href = "";
25815
- this.market = "";
25816
- this.language = "";
25817
- this.environment = "";
25823
+ this.href = '';
25824
+ this.market = '';
25825
+ this.language = '';
25826
+ this.environment = '';
25818
25827
  this.url = null;
25819
- this.allowedLanguages = ["sv", "da", "fi", "no", "en", "de"];
25820
- this.allowedMarkets = ["se", "dk", "fi", "no", "com", "de", "tpl"];
25821
- this.wwwMarkets = ["se", "dk", "fi", "no", "de", "com"];
25822
- this.developmentDomains = ["localhost", ".local", "local.", ".dev", "dev."];
25828
+ this.allowedLanguages = ['sv', 'da', 'fi', 'no', 'en', 'de', 'zh', 'fr', 'es'];
25829
+ this.allowedMarkets = ['se', 'dk', 'fi', 'no', 'com', 'de', 'tpl'];
25830
+ this.wwwMarkets = ['se', 'dk', 'fi', 'no', 'de', 'com'];
25831
+ this.developmentDomains = ['localhost', '.local', 'local.', '.dev', 'dev.'];
25823
25832
  this.markets = {
25824
- "se": {
25825
- fallbackLanguage: "sv",
25833
+ se: {
25834
+ fallbackLanguage: 'sv',
25826
25835
  integration: 'se-integration.postnord.com',
25827
25836
  preproduction: 'se-preproduction.postnord.com',
25828
25837
  production: 'se-production.postnord.com',
25829
- live: 'www.postnord.se'
25838
+ live: 'www.postnord.se',
25830
25839
  },
25831
- "dk": {
25832
- fallbackLanguage: "da",
25840
+ dk: {
25841
+ fallbackLanguage: 'da',
25833
25842
  integration: 'dk-integration.postnord.com',
25834
25843
  preproduction: 'dk-preproduction.postnord.com',
25835
25844
  production: 'dk-production.postnord.com',
25836
- live: 'www.postnord.dk'
25845
+ live: 'www.postnord.dk',
25837
25846
  },
25838
- "fi": {
25839
- fallbackLanguage: "fi",
25847
+ fi: {
25848
+ fallbackLanguage: 'fi',
25840
25849
  integration: 'fi-integration.postnord.com',
25841
25850
  preproduction: 'fi-preproduction.postnord.com',
25842
25851
  production: 'fi-production.postnord.com',
25843
- live: 'www.postnord.fi'
25852
+ live: 'www.postnord.fi',
25844
25853
  },
25845
- "no": {
25846
- fallbackLanguage: "no",
25854
+ no: {
25855
+ fallbackLanguage: 'no',
25847
25856
  integration: 'no-integration.postnord.com',
25848
25857
  preproduction: 'no-preproduction.postnord.com',
25849
25858
  production: 'no-production.postnord.com',
25850
- live: 'www.postnord.no'
25859
+ live: 'www.postnord.no',
25851
25860
  },
25852
- "com": {
25853
- fallbackLanguage: "en",
25861
+ com: {
25862
+ fallbackLanguage: 'en',
25854
25863
  integration: 'com-integration.postnord.com',
25855
25864
  preproduction: 'com-preproduction.postnord.com',
25856
25865
  production: 'com-production.postnord.com',
25857
- live: 'www.postnord.com'
25866
+ live: 'www.postnord.com',
25858
25867
  },
25859
- "de": {
25860
- fallbackLanguage: "en",
25868
+ de: {
25869
+ fallbackLanguage: 'en',
25861
25870
  integration: 'de-integration.postnord.com',
25862
25871
  preproduction: 'de-preproduction.postnord.com',
25863
25872
  production: 'de-production.postnord.com',
25864
- live: 'www.postnord.de'
25873
+ live: 'www.postnord.de',
25865
25874
  },
25866
- "tpl": {
25867
- fallbackLanguage: "sv",
25875
+ tpl: {
25876
+ fallbackLanguage: 'sv',
25868
25877
  integration: 'tpl-integration.postnord.com',
25869
25878
  preproduction: 'tpl-preproduction.postnord.com',
25870
25879
  production: 'tpl-production.postnord.com',
25871
- live: 'tpl.postnord.com'
25880
+ live: 'tpl.postnord.com',
25872
25881
  },
25873
25882
  };
25874
- this.environmentTypes = ["integration", "preproduction", "production"];
25883
+ this.environmentTypes = ['integration', 'preproduction', 'production'];
25875
25884
  this.environments = {
25876
- "production": {
25877
- "name": "production",
25878
- "url": "https://www.postnord.xx/"
25885
+ production: {
25886
+ name: 'production',
25887
+ url: 'https://www.postnord.xx/',
25879
25888
  },
25880
- "preproduction": {
25881
- "name": "preproduction",
25882
- "url": "https://com-preproduction.postnord.com/"
25889
+ preproduction: {
25890
+ name: 'preproduction',
25891
+ url: 'https://com-preproduction.postnord.com/',
25892
+ },
25893
+ integration: {
25894
+ name: 'integration',
25895
+ url: 'https://com-integration.postnord.com/',
25883
25896
  },
25884
- "integration": {
25885
- "name": "integration",
25886
- "url": "https://com-integration.postnord.com/"
25887
- }
25888
25897
  };
25889
25898
  this.href = href;
25890
25899
  this.url = new URL(this.href);
@@ -25903,7 +25912,7 @@ class MarketWebContextService {
25903
25912
  await this.resolveMarket();
25904
25913
  return this.market;
25905
25914
  }
25906
- async getEndpoint(environmentName, marketName = "") {
25915
+ async getEndpoint(environmentName, marketName = '') {
25907
25916
  let url = this.environments.production.url;
25908
25917
  if (this.markets[marketName] && this.markets[marketName][environmentName]) {
25909
25918
  if (environmentName === 'production' && window.location.hostname.indexOf(this.markets[marketName]['live']) === 0) {
@@ -25920,18 +25929,18 @@ class MarketWebContextService {
25920
25929
  if (environmentName === this.environments.production.name) {
25921
25930
  if (this.wwwMarkets.indexOf(marketName) !== -1) {
25922
25931
  // Handles www.postnord.xx domains
25923
- url = url.replace(".xx", "." + marketName);
25932
+ url = url.replace('.xx', '.' + marketName);
25924
25933
  }
25925
25934
  else {
25926
- url = url.replace(".xx", ".com"); // Expect URL to end in postnord.com
25927
- url = url.replace("www.", marketName + ".");
25935
+ url = url.replace('.xx', '.com'); // Expect URL to end in postnord.com
25936
+ url = url.replace('www.', marketName + '.');
25928
25937
  }
25929
25938
  }
25930
25939
  }
25931
25940
  return url;
25932
25941
  }
25933
25942
  async getEnvironmentName() {
25934
- const likelyEnvironment = this.environmentTypes.filter(x => this.url.hostname.indexOf(('-' + x)) !== -1)[0];
25943
+ const likelyEnvironment = this.environmentTypes.filter(x => this.url.hostname.indexOf('-' + x) !== -1)[0];
25935
25944
  if (likelyEnvironment) {
25936
25945
  this.environment = likelyEnvironment;
25937
25946
  return this.environment;
@@ -25949,17 +25958,17 @@ class MarketWebContextService {
25949
25958
  }
25950
25959
  async resolveMarket() {
25951
25960
  // Resolve market from www domains
25952
- if (this.href.indexOf("//www.") !== -1) {
25961
+ if (this.href.indexOf('//www.') !== -1) {
25953
25962
  const domainRoot = this.url.hostname.substring(this.url.hostname.lastIndexOf('.') + 1, this.url.hostname.length);
25954
25963
  if (domainRoot && this.markets[domainRoot]) {
25955
25964
  this.market = domainRoot;
25956
25965
  }
25957
25966
  else {
25958
- console.warn("Unable to define market from www. domain", this.href);
25967
+ console.warn('Unable to define market from www. domain', this.href);
25959
25968
  }
25960
25969
  }
25961
25970
  // Check if domains are on one of the integration/preproduction/production environments urls
25962
- const likelyEnvironment = this.environmentTypes.filter(x => this.url.hostname.indexOf(('-' + x)) !== -1);
25971
+ const likelyEnvironment = this.environmentTypes.filter(x => this.url.hostname.indexOf('-' + x) !== -1);
25963
25972
  if (!this.market && likelyEnvironment && likelyEnvironment.length > 0) {
25964
25973
  const matchedEnvironment = likelyEnvironment[0];
25965
25974
  const marketPrefix = this.url.hostname.substring(0, this.url.hostname.indexOf('-' + matchedEnvironment));
@@ -25967,14 +25976,14 @@ class MarketWebContextService {
25967
25976
  this.market = marketPrefix;
25968
25977
  }
25969
25978
  else {
25970
- console.warn("Unable to define market from preset environment names", this.href);
25979
+ console.warn('Unable to define market from preset environment names', this.href);
25971
25980
  }
25972
25981
  }
25973
25982
  if (!this.market) {
25974
25983
  if (this.url.hostname.indexOf('www') === -1 && this.url.hostname.indexOf('.postnord.') > 0) {
25975
25984
  const start = this.url.hostname.indexOf('.') !== this.url.hostname.indexOf('.postnord') ? this.url.hostname.indexOf('.') : 0;
25976
25985
  const potentialMarket = this.url.hostname.substring(start, this.url.hostname.indexOf('.postnord.'));
25977
- // Break down the subdomain to the word closest to .postnord. and take that word.
25986
+ // Break down the subdomain to the word closest to .postnord. and take that word.
25978
25987
  // Supports sub-sub domain down to 1 level.
25979
25988
  if (this.allowedMarkets.indexOf(potentialMarket) !== -1) {
25980
25989
  this.market = potentialMarket;
@@ -25982,7 +25991,7 @@ class MarketWebContextService {
25982
25991
  }
25983
25992
  }
25984
25993
  }
25985
- // Check if we're on a development environment
25994
+ // Check if we're on a development environment
25986
25995
  if (!this.market) {
25987
25996
  const matchedDevEnvironment = this.developmentDomains.filter(x => this.url.hostname.indexOf(x) !== -1)[0];
25988
25997
  if (!matchedDevEnvironment) {
@@ -25990,7 +25999,7 @@ class MarketWebContextService {
25990
25999
  this.market = this.allowedMarkets[0];
25991
26000
  return;
25992
26001
  }
25993
- const urlWithoutDomain = this.href.replace(matchedDevEnvironment, "");
26002
+ const urlWithoutDomain = this.href.replace(matchedDevEnvironment, '');
25994
26003
  // We see if the dev environment contains something like /dk
25995
26004
  let matchedMarket = this.allowedMarkets.filter(x => {
25996
26005
  const typesOfFallback = ['.' + x, x + '.', '/' + x + '/']; // Ex /dk, dk.html, /dk/
@@ -26002,7 +26011,7 @@ class MarketWebContextService {
26002
26011
  }
26003
26012
  else {
26004
26013
  // We do a similar filter for subpaths but for language this time
26005
- let filteredMarket = Object.entries(this.markets).filter((item) => {
26014
+ let filteredMarket = Object.entries(this.markets).filter(item => {
26006
26015
  const typesOfFallback = ['.' + item[1].fallbackLanguage, item[1].fallbackLanguage + '.', '/' + item[1].fallbackLanguage + '/']; // Ex /dk, dk.html, /dk/
26007
26016
  const matchedTypeOfFallback = typesOfFallback.filter(y => urlWithoutDomain.indexOf(y) !== -1);
26008
26017
  return matchedTypeOfFallback.length > 0;
@@ -26013,7 +26022,7 @@ class MarketWebContextService {
26013
26022
  }
26014
26023
  }
26015
26024
  if (!this.market) {
26016
- console.info("Was unable to detect market, used fallback");
26025
+ console.info('Was unable to detect market, used fallback');
26017
26026
  this.market = this.allowedMarkets[0];
26018
26027
  }
26019
26028
  }
@@ -26023,12 +26032,14 @@ class MarketWebContextService {
26023
26032
  return;
26024
26033
  }
26025
26034
  const potentialLanguages = [
26026
- (_a = document.querySelector("html[lang]")) === null || _a === void 0 ? void 0 : _a.getAttribute("lang"),
26027
- (_b = document.querySelector('[http-equiv="content-language"][content]')) === null || _b === void 0 ? void 0 : _b.getAttribute("content"),
26028
- (_c = document.querySelector('[property="og:locale"][content]')) === null || _c === void 0 ? void 0 : _c.getAttribute("content"),
26029
- (_d = document.querySelector("[lang]")) === null || _d === void 0 ? void 0 : _d.getAttribute("lang"),
26035
+ (_a = document.querySelector('html[lang]')) === null || _a === void 0 ? void 0 : _a.getAttribute('lang'),
26036
+ (_b = document.querySelector('[http-equiv="content-language"][content]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content'),
26037
+ (_c = document.querySelector('[property="og:locale"][content]')) === null || _c === void 0 ? void 0 : _c.getAttribute('content'),
26038
+ (_d = document.querySelector('[lang]')) === null || _d === void 0 ? void 0 : _d.getAttribute('lang'),
26030
26039
  ];
26031
- potentialLanguages.filter(x => x).forEach((language) => {
26040
+ potentialLanguages
26041
+ .filter(x => x)
26042
+ .forEach(language => {
26032
26043
  if (this.allowedLanguages.indexOf(language)) {
26033
26044
  this.language = language;
26034
26045
  return;