@getlupa/client 0.5.1-alpha-14 → 0.5.1-alpha-15

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.
@@ -5491,11 +5491,11 @@ var String$2 = global$d.String;
5491
5491
  var counter$1 = 0;
5492
5492
  var queue$1 = {};
5493
5493
  var ONREADYSTATECHANGE = 'onreadystatechange';
5494
- var location$1, defer, channel, port;
5494
+ var location, defer, channel, port;
5495
5495
 
5496
5496
  try {
5497
5497
  // Deno throws a ReferenceError on `location` access without `--location` flag
5498
- location$1 = global$d.location;
5498
+ location = global$d.location;
5499
5499
  } catch (error) {
5500
5500
  /* empty */
5501
5501
  }
@@ -5520,7 +5520,7 @@ var listener = function (event) {
5520
5520
 
5521
5521
  var post = function (id) {
5522
5522
  // old engines have not location.origin
5523
- global$d.postMessage(String$2(id), location$1.protocol + '//' + location$1.host);
5523
+ global$d.postMessage(String$2(id), location.protocol + '//' + location.host);
5524
5524
  }; // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
5525
5525
 
5526
5526
 
@@ -5558,7 +5558,7 @@ if (!set$1 || !clear) {
5558
5558
  channel.port1.onmessage = listener;
5559
5559
  defer = bind$5(port.postMessage, port); // Browsers with postMessage, skip WebWorkers
5560
5560
  // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
5561
- } else if (global$d.addEventListener && isCallable$1(global$d.postMessage) && !global$d.importScripts && location$1 && location$1.protocol !== 'file:' && !fails$8(post)) {
5561
+ } else if (global$d.addEventListener && isCallable$1(global$d.postMessage) && !global$d.importScripts && location && location.protocol !== 'file:' && !fails$8(post)) {
5562
5562
  defer = post;
5563
5563
  global$d.addEventListener('message', listener, false); // IE8-
5564
5564
  } else if (ONREADYSTATECHANGE in createElement$2('script')) {
@@ -19687,13 +19687,6 @@ var generateResultLink = function generateResultLink(link, searchText, facet) {
19687
19687
  var queryParam = "?".concat(QUERY_PARAMS.QUERY, "=").concat(encodeParam(searchText));
19688
19688
  return "".concat(link).concat(queryParam).concat(facetParam);
19689
19689
  };
19690
- var getPathName = function getPathName(resultPageLink) {
19691
- var pathname = window.location.pathname;
19692
- if (pathname.charAt(pathname.length - 1) === "/") pathname = pathname.substr(0, pathname.length - 1);
19693
- if (resultPageLink.charAt(0) !== "/") pathname += "/";
19694
- pathname += !location.pathname.includes(resultPageLink) ? resultPageLink : "";
19695
- return pathname;
19696
- };
19697
19690
  var getRelativePath = function getRelativePath(link) {
19698
19691
  try {
19699
19692
  var url = new URL(link);
@@ -19712,6 +19705,53 @@ var linksMatch = function linksMatch(link1, link2) {
19712
19705
  return link1 === link2 || getRelativePath(link1) === getRelativePath(link2);
19713
19706
  };
19714
19707
 
19708
+ // `SameValue` abstract operation
19709
+ // https://tc39.es/ecma262/#sec-samevalue
19710
+ // eslint-disable-next-line es/no-object-is -- safe
19711
+ var sameValue$1 = Object.is || function is(x, y) {
19712
+ // eslint-disable-next-line no-self-compare -- NaN check
19713
+ return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
19714
+ };
19715
+
19716
+ var call = functionCall;
19717
+
19718
+ var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
19719
+
19720
+ var anObject = anObject$k;
19721
+
19722
+ var requireObjectCoercible = requireObjectCoercible$c;
19723
+
19724
+ var sameValue = sameValue$1;
19725
+
19726
+ var toString = toString$h;
19727
+
19728
+ var getMethod = getMethod$7;
19729
+
19730
+ var regExpExec = regexpExecAbstract; // @@search logic
19731
+
19732
+
19733
+ fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCallNative) {
19734
+ return [// `String.prototype.search` method
19735
+ // https://tc39.es/ecma262/#sec-string.prototype.search
19736
+ function search(regexp) {
19737
+ var O = requireObjectCoercible(this);
19738
+ var searcher = regexp == undefined ? undefined : getMethod(regexp, SEARCH);
19739
+ return searcher ? call(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString(O));
19740
+ }, // `RegExp.prototype[@@search]` method
19741
+ // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
19742
+ function (string) {
19743
+ var rx = anObject(this);
19744
+ var S = toString(string);
19745
+ var res = maybeCallNative(nativeSearch, rx, S);
19746
+ if (res.done) return res.value;
19747
+ var previousLastIndex = rx.lastIndex;
19748
+ if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
19749
+ var result = regExpExec(rx, S);
19750
+ if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
19751
+ return result === null ? -1 : result.index;
19752
+ }];
19753
+ });
19754
+
19715
19755
  var emitRoutingEvent = function emitRoutingEvent(url) {
19716
19756
  var event = new CustomEvent(LUPA_ROUTING_EVENT, {
19717
19757
  detail: url
@@ -19738,6 +19778,10 @@ var redirectToResultsPage = function redirectToResultsPage(link, searchText, fac
19738
19778
  window.location.assign(url);
19739
19779
  }
19740
19780
  };
19781
+ var getPageUrl = function getPageUrl(pathnameOverride) {
19782
+ var pathname = pathnameOverride || window.location.pathname;
19783
+ return new URL(window.location.origin + pathname + window.location.search);
19784
+ };
19741
19785
 
19742
19786
  var history$3 = namespace("history");
19743
19787
  var tracking$5 = namespace("tracking");
@@ -21776,53 +21820,6 @@ var __vue_component__$P = /*#__PURE__*/normalizeComponent({
21776
21820
  staticRenderFns: __vue_staticRenderFns__$P
21777
21821
  }, __vue_inject_styles__$P, __vue_script__$P, __vue_scope_id__$P, __vue_is_functional_template__$P, __vue_module_identifier__$P, false, undefined, undefined, undefined);
21778
21822
 
21779
- // `SameValue` abstract operation
21780
- // https://tc39.es/ecma262/#sec-samevalue
21781
- // eslint-disable-next-line es/no-object-is -- safe
21782
- var sameValue$1 = Object.is || function is(x, y) {
21783
- // eslint-disable-next-line no-self-compare -- NaN check
21784
- return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
21785
- };
21786
-
21787
- var call = functionCall;
21788
-
21789
- var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
21790
-
21791
- var anObject = anObject$k;
21792
-
21793
- var requireObjectCoercible = requireObjectCoercible$c;
21794
-
21795
- var sameValue = sameValue$1;
21796
-
21797
- var toString = toString$h;
21798
-
21799
- var getMethod = getMethod$7;
21800
-
21801
- var regExpExec = regexpExecAbstract; // @@search logic
21802
-
21803
-
21804
- fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCallNative) {
21805
- return [// `String.prototype.search` method
21806
- // https://tc39.es/ecma262/#sec-string.prototype.search
21807
- function search(regexp) {
21808
- var O = requireObjectCoercible(this);
21809
- var searcher = regexp == undefined ? undefined : getMethod(regexp, SEARCH);
21810
- return searcher ? call(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString(O));
21811
- }, // `RegExp.prototype[@@search]` method
21812
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
21813
- function (string) {
21814
- var rx = anObject(this);
21815
- var S = toString(string);
21816
- var res = maybeCallNative(nativeSearch, rx, S);
21817
- if (res.done) return res.value;
21818
- var previousLastIndex = rx.lastIndex;
21819
- if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
21820
- var result = regExpExec(rx, S);
21821
- if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
21822
- return result === null ? -1 : result.index;
21823
- }];
21824
- });
21825
-
21826
21823
  var DEFAULT_OPTIONS_RESULTS = {
21827
21824
  options: {
21828
21825
  environment: "production"
@@ -34319,7 +34316,7 @@ var ParamsModule = /*#__PURE__*/function (_VuexModule) {
34319
34316
  }, {
34320
34317
  key: "removeAllFilters",
34321
34318
  value: function removeAllFilters() {
34322
- var url = new URL(window.location.origin + getPathName(this.searchResultsLink) + window.location.search);
34319
+ var url = getPageUrl();
34323
34320
  var paramsToRemove = Array.from(url.searchParams.keys()).filter(isFacetKey);
34324
34321
 
34325
34322
  removeParams(url, paramsToRemove);
@@ -34336,7 +34333,7 @@ var ParamsModule = /*#__PURE__*/function (_VuexModule) {
34336
34333
  var paramsToRemove = _ref2.paramsToRemove,
34337
34334
  _ref2$save = _ref2.save,
34338
34335
  save = _ref2$save === void 0 ? true : _ref2$save;
34339
- var url = new URL(window.location.origin + getPathName(this.searchResultsLink) + window.location.search);
34336
+ var url = getPageUrl();
34340
34337
  paramsToRemove = getRemovableParams(url, paramsToRemove);
34341
34338
 
34342
34339
  removeParams(url, paramsToRemove);
@@ -34387,7 +34384,8 @@ var ParamsModule = /*#__PURE__*/function (_VuexModule) {
34387
34384
  name: QUERY_PARAMS.QUERY,
34388
34385
  value: searchText
34389
34386
  }].concat(facetParam),
34390
- paramsToRemove: "all"
34387
+ paramsToRemove: "all",
34388
+ searchResultsLink: this.searchResultsLink
34391
34389
  });
34392
34390
  } else {
34393
34391
  var routing = (_a = this.context.rootGetters["options/boxRoutingBehavior"]) !== null && _a !== void 0 ? _a : "direct-link";
@@ -34413,7 +34411,8 @@ var ParamsModule = /*#__PURE__*/function (_VuexModule) {
34413
34411
  _ref5$encode = _ref5.encode,
34414
34412
  encode = _ref5$encode === void 0 ? true : _ref5$encode,
34415
34413
  _ref5$save = _ref5.save,
34416
- save = _ref5$save === void 0 ? true : _ref5$save;
34414
+ save = _ref5$save === void 0 ? true : _ref5$save,
34415
+ searchResultsLink = _ref5.searchResultsLink;
34417
34416
 
34418
34417
  if (!(params === null || params === void 0 ? void 0 : params.length)) {
34419
34418
  return {
@@ -34421,7 +34420,7 @@ var ParamsModule = /*#__PURE__*/function (_VuexModule) {
34421
34420
  };
34422
34421
  }
34423
34422
 
34424
- var url = new URL(window.location.origin + getPathName(this.searchResultsLink) + window.location.search);
34423
+ var url = getPageUrl(searchResultsLink);
34425
34424
  paramsToRemove = getRemovableParams(url, paramsToRemove);
34426
34425
 
34427
34426
  removeParams(url, paramsToRemove);
@@ -40,7 +40,7 @@ export default class ParamsModule extends VuexModule {
40
40
  searchText: string;
41
41
  facet?: InputSuggestionFacet;
42
42
  }): void;
43
- appendParams({ params, paramsToRemove, encode, save, }: {
43
+ appendParams({ params, paramsToRemove, encode, save, searchResultsLink, }: {
44
44
  params: {
45
45
  name: string;
46
46
  value: string;
@@ -48,6 +48,7 @@ export default class ParamsModule extends VuexModule {
48
48
  paramsToRemove?: "all" | string[];
49
49
  encode?: boolean;
50
50
  save?: boolean;
51
+ searchResultsLink?: string;
51
52
  }): {
52
53
  params?: QueryParams;
53
54
  searchString?: string;
@@ -3,3 +3,4 @@ import { RoutingBehavior } from "..";
3
3
  export declare const emitRoutingEvent: (url: string) => void;
4
4
  export declare const handleRoutingEvent: (link: string, event?: Event | undefined, hasEventRouting?: boolean) => void;
5
5
  export declare const redirectToResultsPage: (link: string, searchText: string, facet?: InputSuggestionFacet | undefined, routingBehavior?: RoutingBehavior) => void;
6
+ export declare const getPageUrl: (pathnameOverride?: string | undefined) => URL;
@@ -5487,11 +5487,11 @@ var String$2 = global$d.String;
5487
5487
  var counter$1 = 0;
5488
5488
  var queue$1 = {};
5489
5489
  var ONREADYSTATECHANGE = 'onreadystatechange';
5490
- var location$1, defer, channel, port;
5490
+ var location, defer, channel, port;
5491
5491
 
5492
5492
  try {
5493
5493
  // Deno throws a ReferenceError on `location` access without `--location` flag
5494
- location$1 = global$d.location;
5494
+ location = global$d.location;
5495
5495
  } catch (error) {
5496
5496
  /* empty */
5497
5497
  }
@@ -5516,7 +5516,7 @@ var listener = function (event) {
5516
5516
 
5517
5517
  var post = function (id) {
5518
5518
  // old engines have not location.origin
5519
- global$d.postMessage(String$2(id), location$1.protocol + '//' + location$1.host);
5519
+ global$d.postMessage(String$2(id), location.protocol + '//' + location.host);
5520
5520
  }; // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
5521
5521
 
5522
5522
 
@@ -5554,7 +5554,7 @@ if (!set$1 || !clear) {
5554
5554
  channel.port1.onmessage = listener;
5555
5555
  defer = bind$5(port.postMessage, port); // Browsers with postMessage, skip WebWorkers
5556
5556
  // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
5557
- } else if (global$d.addEventListener && isCallable$1(global$d.postMessage) && !global$d.importScripts && location$1 && location$1.protocol !== 'file:' && !fails$8(post)) {
5557
+ } else if (global$d.addEventListener && isCallable$1(global$d.postMessage) && !global$d.importScripts && location && location.protocol !== 'file:' && !fails$8(post)) {
5558
5558
  defer = post;
5559
5559
  global$d.addEventListener('message', listener, false); // IE8-
5560
5560
  } else if (ONREADYSTATECHANGE in createElement$2('script')) {
@@ -19683,13 +19683,6 @@ var generateResultLink = function generateResultLink(link, searchText, facet) {
19683
19683
  var queryParam = "?".concat(QUERY_PARAMS.QUERY, "=").concat(encodeParam(searchText));
19684
19684
  return "".concat(link).concat(queryParam).concat(facetParam);
19685
19685
  };
19686
- var getPathName = function getPathName(resultPageLink) {
19687
- var pathname = window.location.pathname;
19688
- if (pathname.charAt(pathname.length - 1) === "/") pathname = pathname.substr(0, pathname.length - 1);
19689
- if (resultPageLink.charAt(0) !== "/") pathname += "/";
19690
- pathname += !location.pathname.includes(resultPageLink) ? resultPageLink : "";
19691
- return pathname;
19692
- };
19693
19686
  var getRelativePath = function getRelativePath(link) {
19694
19687
  try {
19695
19688
  var url = new URL(link);
@@ -19708,6 +19701,53 @@ var linksMatch = function linksMatch(link1, link2) {
19708
19701
  return link1 === link2 || getRelativePath(link1) === getRelativePath(link2);
19709
19702
  };
19710
19703
 
19704
+ // `SameValue` abstract operation
19705
+ // https://tc39.es/ecma262/#sec-samevalue
19706
+ // eslint-disable-next-line es/no-object-is -- safe
19707
+ var sameValue$1 = Object.is || function is(x, y) {
19708
+ // eslint-disable-next-line no-self-compare -- NaN check
19709
+ return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
19710
+ };
19711
+
19712
+ var call = functionCall;
19713
+
19714
+ var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
19715
+
19716
+ var anObject = anObject$k;
19717
+
19718
+ var requireObjectCoercible = requireObjectCoercible$c;
19719
+
19720
+ var sameValue = sameValue$1;
19721
+
19722
+ var toString = toString$h;
19723
+
19724
+ var getMethod = getMethod$7;
19725
+
19726
+ var regExpExec = regexpExecAbstract; // @@search logic
19727
+
19728
+
19729
+ fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCallNative) {
19730
+ return [// `String.prototype.search` method
19731
+ // https://tc39.es/ecma262/#sec-string.prototype.search
19732
+ function search(regexp) {
19733
+ var O = requireObjectCoercible(this);
19734
+ var searcher = regexp == undefined ? undefined : getMethod(regexp, SEARCH);
19735
+ return searcher ? call(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString(O));
19736
+ }, // `RegExp.prototype[@@search]` method
19737
+ // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
19738
+ function (string) {
19739
+ var rx = anObject(this);
19740
+ var S = toString(string);
19741
+ var res = maybeCallNative(nativeSearch, rx, S);
19742
+ if (res.done) return res.value;
19743
+ var previousLastIndex = rx.lastIndex;
19744
+ if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
19745
+ var result = regExpExec(rx, S);
19746
+ if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
19747
+ return result === null ? -1 : result.index;
19748
+ }];
19749
+ });
19750
+
19711
19751
  var emitRoutingEvent = function emitRoutingEvent(url) {
19712
19752
  var event = new CustomEvent(LUPA_ROUTING_EVENT, {
19713
19753
  detail: url
@@ -19734,6 +19774,10 @@ var redirectToResultsPage = function redirectToResultsPage(link, searchText, fac
19734
19774
  window.location.assign(url);
19735
19775
  }
19736
19776
  };
19777
+ var getPageUrl = function getPageUrl(pathnameOverride) {
19778
+ var pathname = pathnameOverride || window.location.pathname;
19779
+ return new URL(window.location.origin + pathname + window.location.search);
19780
+ };
19737
19781
 
19738
19782
  var history$3 = namespace("history");
19739
19783
  var tracking$5 = namespace("tracking");
@@ -21772,53 +21816,6 @@ var __vue_component__$P = /*#__PURE__*/normalizeComponent({
21772
21816
  staticRenderFns: __vue_staticRenderFns__$P
21773
21817
  }, __vue_inject_styles__$P, __vue_script__$P, __vue_scope_id__$P, __vue_is_functional_template__$P, __vue_module_identifier__$P, false, undefined, undefined, undefined);
21774
21818
 
21775
- // `SameValue` abstract operation
21776
- // https://tc39.es/ecma262/#sec-samevalue
21777
- // eslint-disable-next-line es/no-object-is -- safe
21778
- var sameValue$1 = Object.is || function is(x, y) {
21779
- // eslint-disable-next-line no-self-compare -- NaN check
21780
- return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
21781
- };
21782
-
21783
- var call = functionCall;
21784
-
21785
- var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
21786
-
21787
- var anObject = anObject$k;
21788
-
21789
- var requireObjectCoercible = requireObjectCoercible$c;
21790
-
21791
- var sameValue = sameValue$1;
21792
-
21793
- var toString = toString$h;
21794
-
21795
- var getMethod = getMethod$7;
21796
-
21797
- var regExpExec = regexpExecAbstract; // @@search logic
21798
-
21799
-
21800
- fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCallNative) {
21801
- return [// `String.prototype.search` method
21802
- // https://tc39.es/ecma262/#sec-string.prototype.search
21803
- function search(regexp) {
21804
- var O = requireObjectCoercible(this);
21805
- var searcher = regexp == undefined ? undefined : getMethod(regexp, SEARCH);
21806
- return searcher ? call(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString(O));
21807
- }, // `RegExp.prototype[@@search]` method
21808
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
21809
- function (string) {
21810
- var rx = anObject(this);
21811
- var S = toString(string);
21812
- var res = maybeCallNative(nativeSearch, rx, S);
21813
- if (res.done) return res.value;
21814
- var previousLastIndex = rx.lastIndex;
21815
- if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
21816
- var result = regExpExec(rx, S);
21817
- if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
21818
- return result === null ? -1 : result.index;
21819
- }];
21820
- });
21821
-
21822
21819
  var DEFAULT_OPTIONS_RESULTS = {
21823
21820
  options: {
21824
21821
  environment: "production"
@@ -34315,7 +34312,7 @@ var ParamsModule = /*#__PURE__*/function (_VuexModule) {
34315
34312
  }, {
34316
34313
  key: "removeAllFilters",
34317
34314
  value: function removeAllFilters() {
34318
- var url = new URL(window.location.origin + getPathName(this.searchResultsLink) + window.location.search);
34315
+ var url = getPageUrl();
34319
34316
  var paramsToRemove = Array.from(url.searchParams.keys()).filter(isFacetKey);
34320
34317
 
34321
34318
  removeParams(url, paramsToRemove);
@@ -34332,7 +34329,7 @@ var ParamsModule = /*#__PURE__*/function (_VuexModule) {
34332
34329
  var paramsToRemove = _ref2.paramsToRemove,
34333
34330
  _ref2$save = _ref2.save,
34334
34331
  save = _ref2$save === void 0 ? true : _ref2$save;
34335
- var url = new URL(window.location.origin + getPathName(this.searchResultsLink) + window.location.search);
34332
+ var url = getPageUrl();
34336
34333
  paramsToRemove = getRemovableParams(url, paramsToRemove);
34337
34334
 
34338
34335
  removeParams(url, paramsToRemove);
@@ -34383,7 +34380,8 @@ var ParamsModule = /*#__PURE__*/function (_VuexModule) {
34383
34380
  name: QUERY_PARAMS.QUERY,
34384
34381
  value: searchText
34385
34382
  }].concat(facetParam),
34386
- paramsToRemove: "all"
34383
+ paramsToRemove: "all",
34384
+ searchResultsLink: this.searchResultsLink
34387
34385
  });
34388
34386
  } else {
34389
34387
  var routing = (_a = this.context.rootGetters["options/boxRoutingBehavior"]) !== null && _a !== void 0 ? _a : "direct-link";
@@ -34409,7 +34407,8 @@ var ParamsModule = /*#__PURE__*/function (_VuexModule) {
34409
34407
  _ref5$encode = _ref5.encode,
34410
34408
  encode = _ref5$encode === void 0 ? true : _ref5$encode,
34411
34409
  _ref5$save = _ref5.save,
34412
- save = _ref5$save === void 0 ? true : _ref5$save;
34410
+ save = _ref5$save === void 0 ? true : _ref5$save,
34411
+ searchResultsLink = _ref5.searchResultsLink;
34413
34412
 
34414
34413
  if (!(params === null || params === void 0 ? void 0 : params.length)) {
34415
34414
  return {
@@ -34417,7 +34416,7 @@ var ParamsModule = /*#__PURE__*/function (_VuexModule) {
34417
34416
  };
34418
34417
  }
34419
34418
 
34420
- var url = new URL(window.location.origin + getPathName(this.searchResultsLink) + window.location.search);
34419
+ var url = getPageUrl(searchResultsLink);
34421
34420
  paramsToRemove = getRemovableParams(url, paramsToRemove);
34422
34421
 
34423
34422
  removeParams(url, paramsToRemove);
@@ -40,7 +40,7 @@ export default class ParamsModule extends VuexModule {
40
40
  searchText: string;
41
41
  facet?: InputSuggestionFacet;
42
42
  }): void;
43
- appendParams({ params, paramsToRemove, encode, save, }: {
43
+ appendParams({ params, paramsToRemove, encode, save, searchResultsLink, }: {
44
44
  params: {
45
45
  name: string;
46
46
  value: string;
@@ -48,6 +48,7 @@ export default class ParamsModule extends VuexModule {
48
48
  paramsToRemove?: "all" | string[];
49
49
  encode?: boolean;
50
50
  save?: boolean;
51
+ searchResultsLink?: string;
51
52
  }): {
52
53
  params?: QueryParams;
53
54
  searchString?: string;
@@ -3,3 +3,4 @@ import { RoutingBehavior } from "..";
3
3
  export declare const emitRoutingEvent: (url: string) => void;
4
4
  export declare const handleRoutingEvent: (link: string, event?: Event | undefined, hasEventRouting?: boolean) => void;
5
5
  export declare const redirectToResultsPage: (link: string, searchText: string, facet?: InputSuggestionFacet | undefined, routingBehavior?: RoutingBehavior) => void;
6
+ export declare const getPageUrl: (pathnameOverride?: string | undefined) => URL;