@getlupa/client 1.1.2 → 1.1.4

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.
@@ -6853,6 +6853,20 @@ var DocumentElementType = /* @__PURE__ */ ((DocumentElementType2) => {
6853
6853
  DocumentElementType2["CUSTOM_HTML"] = "customHtml";
6854
6854
  return DocumentElementType2;
6855
6855
  })(DocumentElementType || {});
6856
+ var SearchBoxPanelType = /* @__PURE__ */ ((SearchBoxPanelType2) => {
6857
+ SearchBoxPanelType2["SUGGESTION"] = "suggestion";
6858
+ SearchBoxPanelType2["DOCUMENT"] = "document";
6859
+ return SearchBoxPanelType2;
6860
+ })(SearchBoxPanelType || {});
6861
+ var BadgeType = /* @__PURE__ */ ((BadgeType2) => {
6862
+ BadgeType2["DISCOUNTPERCENTAGE"] = "discountPercentage";
6863
+ BadgeType2["DISCOUNTAMOUNT"] = "discountAmount";
6864
+ BadgeType2["NEWITEM"] = "newItem";
6865
+ BadgeType2["TEXT"] = "text";
6866
+ BadgeType2["IMAGE"] = "image";
6867
+ BadgeType2["CUSTOM_HTML"] = "customHtml";
6868
+ return BadgeType2;
6869
+ })(BadgeType || {});
6856
6870
  const retrieveHistory = () => {
6857
6871
  try {
6858
6872
  const historyString = window.localStorage.getItem(HISTORY_LOCAL_STORAGE_KEY);
@@ -7442,11 +7456,6 @@ const useParamsStore = defineStore("params", () => {
7442
7456
  setSearchResultsLink
7443
7457
  };
7444
7458
  });
7445
- var SearchBoxPanelType = /* @__PURE__ */ ((SearchBoxPanelType2) => {
7446
- SearchBoxPanelType2["SUGGESTION"] = "suggestion";
7447
- SearchBoxPanelType2["DOCUMENT"] = "document";
7448
- return SearchBoxPanelType2;
7449
- })(SearchBoxPanelType || {});
7450
7459
  const flattenFacet = (key, facets, suggestion, inputValue) => {
7451
7460
  return facets.map((f2) => ({
7452
7461
  displayHighlight: getHint(suggestion.suggestion, inputValue != null ? inputValue : ""),
@@ -7634,7 +7643,7 @@ const useSearchBoxStore = defineStore("searchBox", () => {
7634
7643
  const _hoisted_1$12 = { id: "lupa-search-box-input-container" };
7635
7644
  const _hoisted_2$I = { class: "lupa-input-clear" };
7636
7645
  const _hoisted_3$u = { id: "lupa-search-box-input" };
7637
- const _hoisted_4$m = ["value"];
7646
+ const _hoisted_4$n = ["value"];
7638
7647
  const _hoisted_5$c = ["placeholder"];
7639
7648
  const _hoisted_6$6 = {
7640
7649
  key: 0,
@@ -7729,7 +7738,7 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
7729
7738
  class: "lupa-hint",
7730
7739
  value: showHint.value ? suggestedValue.value.item.suggestion : "",
7731
7740
  disabled: ""
7732
- }, null, 8, _hoisted_4$m),
7741
+ }, null, 8, _hoisted_4$n),
7733
7742
  withDirectives(createBaseVNode("input", mergeProps({
7734
7743
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event)
7735
7744
  }, inputAttributes.value, {
@@ -7896,7 +7905,7 @@ const _hoisted_3$t = {
7896
7905
  class: "lupa-suggestion-facet",
7897
7906
  "data-cy": "lupa-suggestion-facet"
7898
7907
  };
7899
- const _hoisted_4$l = {
7908
+ const _hoisted_4$m = {
7900
7909
  class: "lupa-suggestion-facet-label",
7901
7910
  "data-cy": "lupa-suggestion-facet-label"
7902
7911
  };
@@ -7942,7 +7951,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
7942
7951
  innerHTML: _ctx.suggestion.displayHighlight
7943
7952
  }, null, 8, _hoisted_1$$)) : (openBlock(), createElementBlock("div", _hoisted_2$G, toDisplayString(_ctx.suggestion.display), 1)),
7944
7953
  _ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$t, [
7945
- createBaseVNode("span", _hoisted_4$l, toDisplayString(facetLabel.value), 1),
7954
+ createBaseVNode("span", _hoisted_4$m, toDisplayString(facetLabel.value), 1),
7946
7955
  createBaseVNode("span", _hoisted_5$b, toDisplayString(_ctx.suggestion.facet.title), 1)
7947
7956
  ])) : createCommentVNode("", true)
7948
7957
  ]);
@@ -8344,7 +8353,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
8344
8353
  const _hoisted_1$U = ["innerHTML"];
8345
8354
  const _hoisted_2$D = { key: 0 };
8346
8355
  const _hoisted_3$s = { key: 1 };
8347
- const _hoisted_4$k = { class: "lupa-search-box-custom-label" };
8356
+ const _hoisted_4$l = { class: "lupa-search-box-custom-label" };
8348
8357
  const _hoisted_5$a = { class: "lupa-search-box-custom-text" };
8349
8358
  const _sfc_main$Z = /* @__PURE__ */ defineComponent({
8350
8359
  __name: "SearchBoxProductCustom",
@@ -8377,7 +8386,7 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
8377
8386
  class: [className.value, "lupa-search-box-product-custom"]
8378
8387
  }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
8379
8388
  !label.value ? (openBlock(), createElementBlock("div", _hoisted_2$D, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$s, [
8380
- createBaseVNode("div", _hoisted_4$k, toDisplayString(label.value), 1),
8389
+ createBaseVNode("div", _hoisted_4$l, toDisplayString(label.value), 1),
8381
8390
  createBaseVNode("div", _hoisted_5$a, toDisplayString(text.value), 1)
8382
8391
  ]))
8383
8392
  ], 16));
@@ -8773,7 +8782,7 @@ const useTrackingStore = defineStore("tracking", () => {
8773
8782
  const _hoisted_1$R = ["href"];
8774
8783
  const _hoisted_2$B = { class: "lupa-search-box-product-image-section" };
8775
8784
  const _hoisted_3$q = { class: "lupa-search-box-product-details-section" };
8776
- const _hoisted_4$j = {
8785
+ const _hoisted_4$k = {
8777
8786
  key: 0,
8778
8787
  class: "lupa-search-box-product-add-to-cart-section"
8779
8788
  };
@@ -8894,7 +8903,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
8894
8903
  }, null, 8, ["item", "element", "labels", "link"]);
8895
8904
  }), 128))
8896
8905
  ]),
8897
- addToCartElement.value ? (openBlock(), createElementBlock("div", _hoisted_4$j, [
8906
+ addToCartElement.value ? (openBlock(), createElementBlock("div", _hoisted_4$k, [
8898
8907
  createVNode(_sfc_main$W, {
8899
8908
  class: "lupa-search-box-product-element",
8900
8909
  item: _ctx.item,
@@ -9026,14 +9035,17 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
9026
9035
  }
9027
9036
  });
9028
9037
  const _hoisted_1$P = {
9038
+ key: 0,
9039
+ id: "lupa-search-box-panel"
9040
+ };
9041
+ const _hoisted_2$A = {
9029
9042
  class: "lupa-main-panel",
9030
9043
  "data-cy": "lupa-main-panel"
9031
9044
  };
9032
- const _hoisted_2$A = ["data-cy"];
9033
- const _hoisted_3$p = {
9045
+ const _hoisted_3$p = ["data-cy"];
9046
+ const _hoisted_4$j = {
9034
9047
  key: 1,
9035
- id: "lupa-search-box-panel",
9036
- ref: "panel"
9048
+ id: "lupa-search-box-panel"
9037
9049
  };
9038
9050
  const __default__$3 = {
9039
9051
  components: {
@@ -9099,7 +9111,9 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
9099
9111
  onMounted(() => {
9100
9112
  window.addEventListener("resize", appHeight);
9101
9113
  window.addEventListener("keydown", handleNavigation);
9102
- appHeight();
9114
+ setTimeout(() => {
9115
+ appHeight();
9116
+ });
9103
9117
  });
9104
9118
  onBeforeUnmount(() => {
9105
9119
  highlightChange({ action: "clear" });
@@ -9149,59 +9163,58 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
9149
9163
  };
9150
9164
  return (_ctx, _cache) => {
9151
9165
  var _a;
9152
- return displayResults.value ? (openBlock(), createElementBlock("div", {
9153
- key: 0,
9154
- id: "lupa-search-box-panel",
9166
+ return openBlock(), createElementBlock("div", {
9155
9167
  ref_key: "panelContainer",
9156
9168
  ref: panelContainer
9157
9169
  }, [
9158
- createBaseVNode("div", _hoisted_1$P, [
9159
- (openBlock(true), createElementBlock(Fragment, null, renderList(displayPanels.value, (panel, index) => {
9160
- return openBlock(), createElementBlock("div", {
9161
- key: index,
9162
- class: normalizeClass([
9163
- "lupa-panel-" + panel.type + "-index",
9164
- panel.customClassName ? panel.customClassName : ""
9165
- ]),
9166
- "data-cy": "lupa-panel-" + panel.type + "-index"
9167
- }, [
9168
- panel.queryKey ? (openBlock(), createBlock(resolveDynamicComponent(getComponent(panel.type)), {
9169
- key: 0,
9170
- panel,
9171
- options: sdkOptions.value,
9172
- debounce: _ctx.options.debounce,
9173
- inputValue: getInput(panel),
9174
- labels: labels.value,
9175
- onFetched: _cache[0] || (_cache[0] = (data) => _ctx.$emit("fetched", data)),
9176
- onItemSelect: _cache[1] || (_cache[1] = (item) => _ctx.$emit("itemSelect", item)),
9177
- onProductClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("product-click"))
9178
- }, createSlots({ _: 2 }, [
9179
- _ctx.$slots.productCard ? {
9180
- name: "productCard",
9181
- fn: withCtx((props2) => [
9182
- renderSlot(_ctx.$slots, "productCard", normalizeProps(guardReactiveProps(props2)))
9183
- ]),
9184
- key: "0"
9185
- } : void 0
9186
- ]), 1064, ["panel", "options", "debounce", "inputValue", "labels"])) : createCommentVNode("", true)
9187
- ], 10, _hoisted_2$A);
9188
- }), 128))
9189
- ]),
9190
- createVNode(_sfc_main$19, {
9191
- labels: labels.value,
9192
- showTotalCount: (_a = _ctx.options.showTotalCount) != null ? _a : false,
9193
- onGoToResults: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("go-to-results"))
9194
- }, null, 8, ["labels", "showTotalCount"])
9195
- ], 512)) : displayHistory.value ? (openBlock(), createElementBlock("div", _hoisted_3$p, [
9196
- createVNode(_sfc_main$17, {
9197
- ref: "panel",
9198
- options: _ctx.options.history,
9199
- history: history.value,
9200
- onGoToResults: handleGoToResults,
9201
- onRemove: remove2,
9202
- onRemoveAll: removeAll
9203
- }, null, 8, ["options", "history"])
9204
- ], 512)) : createCommentVNode("", true);
9170
+ displayResults.value ? (openBlock(), createElementBlock("div", _hoisted_1$P, [
9171
+ createBaseVNode("div", _hoisted_2$A, [
9172
+ (openBlock(true), createElementBlock(Fragment, null, renderList(displayPanels.value, (panel, index) => {
9173
+ return openBlock(), createElementBlock("div", {
9174
+ key: index,
9175
+ class: normalizeClass([
9176
+ "lupa-panel-" + panel.type + "-index",
9177
+ panel.customClassName ? panel.customClassName : ""
9178
+ ]),
9179
+ "data-cy": "lupa-panel-" + panel.type + "-index"
9180
+ }, [
9181
+ panel.queryKey ? (openBlock(), createBlock(resolveDynamicComponent(getComponent(panel.type)), {
9182
+ key: 0,
9183
+ panel,
9184
+ options: sdkOptions.value,
9185
+ debounce: _ctx.options.debounce,
9186
+ inputValue: getInput(panel),
9187
+ labels: labels.value,
9188
+ onFetched: _cache[0] || (_cache[0] = (data) => _ctx.$emit("fetched", data)),
9189
+ onItemSelect: _cache[1] || (_cache[1] = (item) => _ctx.$emit("itemSelect", item)),
9190
+ onProductClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("product-click"))
9191
+ }, createSlots({ _: 2 }, [
9192
+ _ctx.$slots.productCard ? {
9193
+ name: "productCard",
9194
+ fn: withCtx((props2) => [
9195
+ renderSlot(_ctx.$slots, "productCard", normalizeProps(guardReactiveProps(props2)))
9196
+ ]),
9197
+ key: "0"
9198
+ } : void 0
9199
+ ]), 1064, ["panel", "options", "debounce", "inputValue", "labels"])) : createCommentVNode("", true)
9200
+ ], 10, _hoisted_3$p);
9201
+ }), 128))
9202
+ ]),
9203
+ createVNode(_sfc_main$19, {
9204
+ labels: labels.value,
9205
+ showTotalCount: (_a = _ctx.options.showTotalCount) != null ? _a : false,
9206
+ onGoToResults: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("go-to-results"))
9207
+ }, null, 8, ["labels", "showTotalCount"])
9208
+ ])) : displayHistory.value ? (openBlock(), createElementBlock("div", _hoisted_4$j, [
9209
+ createVNode(_sfc_main$17, {
9210
+ options: _ctx.options.history,
9211
+ history: history.value,
9212
+ onGoToResults: handleGoToResults,
9213
+ onRemove: remove2,
9214
+ onRemoveAll: removeAll
9215
+ }, null, 8, ["options", "history"])
9216
+ ])) : createCommentVNode("", true)
9217
+ ], 512);
9205
9218
  };
9206
9219
  }
9207
9220
  }));
@@ -9901,7 +9914,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
9901
9914
  props: {
9902
9915
  options: {}
9903
9916
  },
9904
- setup(__props) {
9917
+ setup(__props, { expose: __expose }) {
9905
9918
  const props = __props;
9906
9919
  const categoryChildren = ref([]);
9907
9920
  const optionStore = useOptionsStore();
@@ -9980,6 +9993,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
9980
9993
  }
9981
9994
  handleRoutingEvent(backUrlLink.value, event, hasEventRouting.value);
9982
9995
  };
9996
+ __expose({ fetch: fetch2 });
9983
9997
  return (_ctx, _cache) => {
9984
9998
  return openBlock(), createElementBlock("div", _hoisted_1$H, [
9985
9999
  createBaseVNode("div", _hoisted_2$t, [
@@ -11807,8 +11821,9 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
11807
11821
  options: {},
11808
11822
  expandable: { type: Boolean }
11809
11823
  },
11810
- setup(__props) {
11824
+ setup(__props, { expose: __expose }) {
11811
11825
  const props = __props;
11826
+ const categoryFilters = ref(null);
11812
11827
  const desktopFiltersVisible = computed(() => {
11813
11828
  var _a, _b, _c;
11814
11829
  return (_c = (_b = (_a = props.options.currentFilters) == null ? void 0 : _a.visibility) == null ? void 0 : _b.desktopSidebar) != null ? _c : true;
@@ -11820,6 +11835,13 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
11820
11835
  const showCurrentFilters = computed(() => {
11821
11836
  return currentFiltersVisible.value ? Boolean(props.options.facets) : false;
11822
11837
  });
11838
+ const fetch2 = () => {
11839
+ var _a;
11840
+ if (categoryFilters.value) {
11841
+ (_a = categoryFilters.value) == null ? void 0 : _a.fetch();
11842
+ }
11843
+ };
11844
+ __expose({ fetch: fetch2 });
11823
11845
  return (_ctx, _cache) => {
11824
11846
  var _a;
11825
11847
  return openBlock(), createElementBlock("div", _hoisted_1$z, [
@@ -11831,7 +11853,8 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
11831
11853
  _ctx.options.categories ? (openBlock(), createBlock(_sfc_main$K, {
11832
11854
  key: 1,
11833
11855
  options: _ctx.options.categories,
11834
- ref: "categoryFilters"
11856
+ ref_key: "categoryFilters",
11857
+ ref: categoryFilters
11835
11858
  }, null, 8, ["options"])) : createCommentVNode("", true),
11836
11859
  _ctx.options.facets ? (openBlock(), createBlock(_sfc_main$D, {
11837
11860
  key: 2,
@@ -12418,15 +12441,6 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
12418
12441
  };
12419
12442
  }
12420
12443
  });
12421
- var BadgeType = /* @__PURE__ */ ((BadgeType2) => {
12422
- BadgeType2["DISCOUNTPERCENTAGE"] = "discountPercentage";
12423
- BadgeType2["DISCOUNTAMOUNT"] = "discountAmount";
12424
- BadgeType2["NEWITEM"] = "newItem";
12425
- BadgeType2["TEXT"] = "text";
12426
- BadgeType2["IMAGE"] = "image";
12427
- BadgeType2["CUSTOM_HTML"] = "customHtml";
12428
- return BadgeType2;
12429
- })(BadgeType || {});
12430
12444
  const _hoisted_1$p = { class: "lupa-generated-badges" };
12431
12445
  const _sfc_main$s = /* @__PURE__ */ defineComponent({
12432
12446
  __name: "SearchResultGeneratedBadges",
@@ -13874,7 +13888,7 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
13874
13888
  isContainer: { type: Boolean },
13875
13889
  initialData: {}
13876
13890
  },
13877
- setup(__props) {
13891
+ setup(__props, { expose: __expose }) {
13878
13892
  const props = __props;
13879
13893
  const searchResultStore = useSearchResultStore();
13880
13894
  const optionStore = useOptionsStore();
@@ -13905,12 +13919,10 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
13905
13919
  onMounted(() => {
13906
13920
  var _a, _b;
13907
13921
  window.addEventListener("resize", handleResize);
13908
- optionStore.setSearchResultOptions({ options: props.options });
13909
13922
  if (props.initialData) {
13910
13923
  searchResultStore.add(__spreadValues2({}, props.initialData));
13911
13924
  }
13912
13925
  handleMounted();
13913
- optionStore.setInitialFilters({ initialFilters: initialFilters.value });
13914
13926
  (_b = (_a = props.options.callbacks) == null ? void 0 : _a.onMounted) == null ? void 0 : _b.call(_a);
13915
13927
  mounted.value = true;
13916
13928
  });
@@ -13996,6 +14008,8 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
13996
14008
  };
13997
14009
  const handleMounted = () => {
13998
14010
  var _a;
14011
+ optionStore.setSearchResultOptions({ options: props.options });
14012
+ optionStore.setInitialFilters({ initialFilters: initialFilters.value });
13999
14013
  handleResize();
14000
14014
  if (props.isProductList) {
14001
14015
  const pageTitle = props.options.labels.htmlTitleTemplate;
@@ -14049,6 +14063,7 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
14049
14063
  }
14050
14064
  };
14051
14065
  handleCreated();
14066
+ __expose({ handleMounted, handleUrlChange });
14052
14067
  return (_ctx, _cache) => {
14053
14068
  var _a, _b, _c, _d, _e;
14054
14069
  return openBlock(), createElementBlock("div", {
@@ -26457,26 +26472,29 @@ const createVue = (selector, rootComponent, options, mountToParent = false) => {
26457
26472
  const parent = element == null ? void 0 : element.parentElement;
26458
26473
  const mountElement = mountToParent ? parent : element;
26459
26474
  if (!mountElement) {
26460
- console.error(`Cannot mount LupaSearch componbent. Element "${selector}" not found`);
26475
+ console.error(`Cannot mount LupaSearch component. Element "${selector}" not found`);
26461
26476
  return;
26462
26477
  }
26478
+ let mountedComponent = null;
26463
26479
  const props = reactive(__spreadValues({}, options));
26464
- const app2 = createApp(rootComponent, props);
26480
+ const app2 = createApp({
26481
+ render: () => mountedComponent = h$1(rootComponent, props)
26482
+ });
26465
26483
  app2.use(pinia);
26466
26484
  const mountedApp = app2.mount(mountElement);
26467
26485
  if (mountToParent) {
26468
26486
  element == null ? void 0 : element.remove();
26469
26487
  }
26470
- return mountedApp;
26488
+ return { mountedApp, mountedComponent, props, app: app2, mountElement };
26471
26489
  };
26472
26490
  const applySearchBox = (options, mountOptions) => {
26473
26491
  const existingInstance = app.box[options.inputSelector];
26474
26492
  if (existingInstance) {
26475
- existingInstance.searchBoxOptions = options;
26493
+ existingInstance.props.searchBoxOptions = options;
26476
26494
  if (mountOptions == null ? void 0 : mountOptions.fetch) {
26477
26495
  setTimeout(() => {
26478
- var _a;
26479
- (_a = existingInstance.fetch) == null ? void 0 : _a.call(existingInstance);
26496
+ var _a, _b, _c, _d;
26497
+ (_d = (_c = (_b = (_a = existingInstance.mountedComponent) == null ? void 0 : _a.component) == null ? void 0 : _b.exposed) == null ? void 0 : _c.fetch) == null ? void 0 : _d.call(_c);
26480
26498
  });
26481
26499
  }
26482
26500
  return;
@@ -26502,11 +26520,11 @@ const searchBox = (options, mountOptions) => {
26502
26520
  const searchResults = (options, mountOptions) => {
26503
26521
  const existingInstance = app.results[options.containerSelector];
26504
26522
  if (existingInstance) {
26505
- existingInstance.searchResultsOptions = options;
26523
+ existingInstance.props.searchResultsOptions = options;
26506
26524
  if (mountOptions == null ? void 0 : mountOptions.fetch) {
26507
26525
  setTimeout(() => {
26508
- var _a;
26509
- (_a = existingInstance.fetch) == null ? void 0 : _a.call(existingInstance);
26526
+ var _a, _b, _c, _d;
26527
+ (_d = (_c = (_b = (_a = existingInstance.mountedComponent) == null ? void 0 : _a.component) == null ? void 0 : _b.exposed) == null ? void 0 : _c.fetch) == null ? void 0 : _d.call(_c);
26510
26528
  });
26511
26529
  }
26512
26530
  return;
@@ -26522,11 +26540,11 @@ const searchResults = (options, mountOptions) => {
26522
26540
  const productList = (options, mountOptions) => {
26523
26541
  const existingInstance = app.productList[options.containerSelector];
26524
26542
  if (existingInstance) {
26525
- existingInstance.productListOptions = options;
26543
+ existingInstance.props.productListOptions = options;
26526
26544
  if (mountOptions == null ? void 0 : mountOptions.fetch) {
26527
26545
  setTimeout(() => {
26528
- var _a;
26529
- (_a = existingInstance.fetch) == null ? void 0 : _a.call(existingInstance);
26546
+ var _a, _b, _c, _d;
26547
+ (_d = (_c = (_b = (_a = existingInstance.mountedComponent) == null ? void 0 : _a.component) == null ? void 0 : _b.exposed) == null ? void 0 : _c.fetch) == null ? void 0 : _d.call(_c);
26530
26548
  });
26531
26549
  }
26532
26550
  return;
@@ -26540,16 +26558,15 @@ const productList = (options, mountOptions) => {
26540
26558
  app.productList[options.containerSelector] = instance;
26541
26559
  };
26542
26560
  const searchContainer = (options, mountOptions) => {
26543
- var _a, _b;
26561
+ var _a, _b, _c, _d, _e, _f;
26544
26562
  const existingInstance = app.searchContainer[options.trigger];
26545
26563
  if (existingInstance) {
26546
- existingInstance.searchContainerOptions.value = options;
26547
- existingInstance.reloadOptions();
26548
- console.log(existingInstance);
26564
+ existingInstance.props.searchContainerOptions = options;
26565
+ (_d = (_c = (_b = (_a = existingInstance.mountedComponent) == null ? void 0 : _a.component) == null ? void 0 : _b.exposed) == null ? void 0 : _c.reloadOptions) == null ? void 0 : _d.call(_c);
26549
26566
  if (mountOptions == null ? void 0 : mountOptions.fetch) {
26550
26567
  setTimeout(() => {
26551
- var _a2;
26552
- (_a2 = existingInstance.fetch) == null ? void 0 : _a2.call(existingInstance);
26568
+ var _a2, _b2, _c2, _d2;
26569
+ (_d2 = (_c2 = (_b2 = (_a2 = existingInstance.mountedComponent) == null ? void 0 : _a2.component) == null ? void 0 : _b2.exposed) == null ? void 0 : _c2.fetch) == null ? void 0 : _d2.call(_c2);
26553
26570
  });
26554
26571
  }
26555
26572
  return;
@@ -26560,7 +26577,7 @@ const searchContainer = (options, mountOptions) => {
26560
26577
  attatchShadowDom({
26561
26578
  host,
26562
26579
  manager,
26563
- styleUrl: (_b = (_a = options.options) == null ? void 0 : _a.styleLink) != null ? _b : DEFAULT_CONTAINER_STYLE,
26580
+ styleUrl: (_f = (_e = options.options) == null ? void 0 : _e.styleLink) != null ? _f : DEFAULT_CONTAINER_STYLE,
26564
26581
  options: options.options
26565
26582
  });
26566
26583
  document.body.appendChild(host);
@@ -26575,11 +26592,11 @@ const searchContainer = (options, mountOptions) => {
26575
26592
  const recommendations = (options, mountOptions) => {
26576
26593
  const existingInstance = app.recommendations[options.containerSelector];
26577
26594
  if (existingInstance) {
26578
- existingInstance.recommendationOptions = options;
26595
+ existingInstance.props.recommendationOptions = options;
26579
26596
  if (mountOptions == null ? void 0 : mountOptions.fetch) {
26580
26597
  setTimeout(() => {
26581
- var _a;
26582
- (_a = existingInstance.fetch) == null ? void 0 : _a.call(existingInstance);
26598
+ var _a, _b, _c, _d;
26599
+ (_d = (_c = (_b = (_a = existingInstance.mountedComponent) == null ? void 0 : _a.component) == null ? void 0 : _b.exposed) == null ? void 0 : _c.fetch) == null ? void 0 : _d.call(_c);
26583
26600
  });
26584
26601
  }
26585
26602
  return;
@@ -26592,21 +26609,20 @@ const recommendations = (options, mountOptions) => {
26592
26609
  }
26593
26610
  app.recommendations[options.containerSelector] = instance;
26594
26611
  };
26595
- const clearInstance = (selector) => {
26596
- const element = document.querySelector(selector);
26597
- if (!element) {
26598
- return;
26599
- }
26600
- document.body.removeChild(element);
26612
+ const clearInstance = (element, app2) => {
26613
+ var _a;
26614
+ const content = element.innerHTML;
26615
+ (_a = app2 == null ? void 0 : app2.unmount) == null ? void 0 : _a.call(app2);
26616
+ element.innerHTML = content;
26601
26617
  };
26602
26618
  const clearSearchBox = (selector) => {
26603
26619
  try {
26604
26620
  if (selector) {
26605
26621
  app.box[selector] = null;
26606
- clearInstance(selector);
26622
+ clearInstance(app.box[selector].mountElement, app.box[selector].app);
26607
26623
  }
26608
26624
  for (const key in app.box) {
26609
- clearInstance(key);
26625
+ clearInstance(app.box[key].mountElement, app.box[key].app);
26610
26626
  }
26611
26627
  app.box = {};
26612
26628
  } catch (e) {
@@ -26616,10 +26632,10 @@ const clearSearchResults = (selector) => {
26616
26632
  try {
26617
26633
  if (selector) {
26618
26634
  app.results[selector] = null;
26619
- clearInstance(selector);
26635
+ clearInstance(app.results[selector].mountElement, app.results[selector].app);
26620
26636
  }
26621
26637
  for (const key in app.results) {
26622
- clearInstance(key);
26638
+ clearInstance(app.results[key].mountElement, app.results[key].app);
26623
26639
  }
26624
26640
  app.results = {};
26625
26641
  } catch (e) {
@@ -26629,10 +26645,10 @@ const clearProductList = (selector) => {
26629
26645
  try {
26630
26646
  if (selector) {
26631
26647
  app.productList[selector] = null;
26632
- clearInstance(selector);
26648
+ clearInstance(app.productList[selector].mountElement, app.productList[selector].app);
26633
26649
  }
26634
26650
  for (const key in app.productList) {
26635
- clearInstance(key);
26651
+ clearInstance(app.productList[key].mountElement, app.productList[key].app);
26636
26652
  }
26637
26653
  app.productList = {};
26638
26654
  } catch (e) {
@@ -26642,10 +26658,10 @@ const clearSearchContainer = (selector) => {
26642
26658
  try {
26643
26659
  if (selector) {
26644
26660
  app.searchContainer[selector] = null;
26645
- clearInstance(selector);
26661
+ clearInstance(app.searchContainer[selector].mountElement, app.searchContainer[selector].app);
26646
26662
  }
26647
26663
  for (const key in app.searchContainer) {
26648
- clearInstance(key);
26664
+ clearInstance(app.searchContainer[key].mountElement, app.searchContainer[key].app);
26649
26665
  }
26650
26666
  app.searchContainer = {};
26651
26667
  } catch (e) {
@@ -26655,10 +26671,10 @@ const clearRecommendations = (selector) => {
26655
26671
  try {
26656
26672
  if (selector) {
26657
26673
  app.recommendations[selector] = null;
26658
- clearInstance(selector);
26674
+ clearInstance(app.recommendations[selector].mountElement, app.recommendations[selector].app);
26659
26675
  }
26660
26676
  for (const key in app.recommendations) {
26661
- clearInstance(key);
26677
+ clearInstance(app.recommendations[key].mountElement, app.recommendations[key].app);
26662
26678
  }
26663
26679
  app.recommendations = {};
26664
26680
  } catch (e) {
@@ -26682,6 +26698,8 @@ if (window) {
26682
26698
  window.lupaSearch = lupaSearch;
26683
26699
  }
26684
26700
  export {
26701
+ BadgeType,
26685
26702
  DocumentElementType,
26703
+ SearchBoxPanelType,
26686
26704
  lupaSearch as default
26687
26705
  };