PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.5
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
← All changes | assets/SearchBarApp.js +1 -1 1.3.21 → 1.6.5 View file →
@@ -1 +1 @@
1 -var q=s=>{throw TypeError(s)};var E=(s,i,e)=>i.has(s)||q("Cannot "+e);var t=(s,i,e)=>(E(s,i,"read from private field"),e?e.call(s):i.get(s)),p=(s,i,e)=>i.has(s)?q("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(s):i.set(s,e),o=(s,i,e,r)=>(E(s,i,"write to private field"),r?r.call(s,e):i.set(s,e),e),L=(s,i,e)=>(E(s,i,"access private method"),e);import{U as M}from"./chunks/Utils.js?ver=1.3.21";import"./chunks/Translator.js?ver=1.3.21";import"./chunks/vue.esm-bundler.js?ver=1.3.21";import"./chunks/Arr.js?ver=1.3.21";import"./chunks/dayjs.min.js?ver=1.3.21";import"./chunks/timezone.js?ver=1.3.21";document.addEventListener("DOMContentLoaded",()=>{var e,r,h,a,c,f,d,w,A,y,k;class s{constructor(n){p(this,y);p(this,e);p(this,r);p(this,h);p(this,a);p(this,c);p(this,f,"new-tab");p(this,d,!1);p(this,w,n=>{var m;n.preventDefault();const u=t(this,r),U=(m=t(this,c))==null?void 0:m.value,v=u.value;t(this,A).call(this,U,v)});p(this,A,(n,u)=>{t(this,r).classList.add("is-active"),t(this,d)?t(this,a).parentElement.style.display="none":t(this,a).parentElement.style.display="block";const v=`${window.fluentcart_search_bar_vars.rest.url}/public/product-search/`;if(this.isLinkedWithShopApp()){const l={};u?l.wildcard=u:l.wildcard="",n&&(l["product-categories"]=n),window.fluentCartShopApps[0].applyFilters(l);return}let m=new URL(v);const g={post_title:u,url_mode:t(this,f),termId:n||""};if(Object.keys(g).length>0)for(let[l,S]of Object.entries(g))m.searchParams.append(l,S);const B=m.href;if(u)fetch(B).then(l=>l.json()).then(l=>{const S=l.htmlView;t(this,a).innerHTML=S,t(this,a).parentElement.style.display="block";const b=t(this,a).parentElement.querySelector("h5");b&&(b.style.display="block"),S.trim()===""&&(t(this,a).innerHTML='<li class="is-empty">No results found.</li>',b&&(b.style.display="none"))}).catch(l=>{console.error("Error fetching data:",l)});else{L(this,y,k).call(this);return}});o(this,e,n),o(this,c,t(this,e).querySelector("[data-fluent-cart-search-bar-app-taxonomy]")),o(this,r,t(this,e).querySelector("[data-fluent-cart-search-bar]")),o(this,h,t(this,e).querySelector("[data-fluent-cart-search-clear]")),o(this,a,t(this,e).querySelector("[data-fluent-cart-search-bar-lists-wrapper]")),o(this,f,t(this,e).dataset.urlMode||"new-tab"),this.init(),o(this,d,t(this,e).dataset.linkWithShopApp||!1)}isLinkedWithShopApp(){const n=Array.isArray(window.fluentCartShopApps)&&window.fluentCartShopApps.length>0;return t(this,d)&&n}init(){const n=M.debounce(t(this,w),300);t(this,r).addEventListener("keyup",n),t(this,c)&&t(this,c).addEventListener("change",n),t(this,a).parentElement.style.display="none",t(this,r).addEventListener("input",()=>{t(this,r).value.trim()!==""?t(this,h).style.display="block":t(this,h).style.display="none"}),t(this,h).addEventListener("click",()=>{t(this,r).value="",t(this,h).style.display="none",L(this,y,k).call(this)})}}e=new WeakMap,r=new WeakMap,h=new WeakMap,a=new WeakMap,c=new WeakMap,f=new WeakMap,d=new WeakMap,w=new WeakMap,A=new WeakMap,y=new WeakSet,k=function(){t(this,r).classList.remove("is-active"),t(this,a).parentElement.style.display="none",t(this,a).innerHTML="",t(this,d)&&typeof window.fluentCartShopApps<"u"&&window.fluentCartShopApps.length>0&&window.fluentCartShopApps[0].applyFilters({wildcard:"","product-categories":""})},document.querySelectorAll("[data-fluent-cart-search-bar-app-wrapper]").forEach(C=>{new s(C)})});
1 +var T=s=>{throw TypeError(s)};var E=(s,a,e)=>a.has(s)||T("Cannot "+e);var t=(s,a,e)=>(E(s,a,"read from private field"),e?e.call(s):a.get(s)),n=(s,a,e)=>a.has(s)?T("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(s):a.set(s,e),p=(s,a,e,r)=>(E(s,a,"write to private field"),r?r.call(s,e):a.set(s,e),e),k=(s,a,e)=>(E(s,a,"access private method"),e);import{U as B}from"./chunks/Utils.js?ver=1.6.5";import"./chunks/Translator.js?ver=1.6.5";import"./chunks/vue.esm-bundler.js?ver=1.6.5";import"./chunks/Arr.js?ver=1.6.5";import"./chunks/dayjs.min.js?ver=1.6.5";import"./chunks/timezone.js?ver=1.6.5";import"./chunks/weekOfYear.js?ver=1.6.5";import"./chunks/CurrencyFormatter.js?ver=1.6.5";document.addEventListener("DOMContentLoaded",()=>{var e,r,o,i,c,y,d,f,b,S,m,U;class s{constructor(l){n(this,m);n(this,e);n(this,r);n(this,o);n(this,i);n(this,c);n(this,y,"");n(this,d,!1);n(this,f,!0);n(this,b,l=>{var w;l.preventDefault();const u=t(this,r),C=(w=t(this,c))==null?void 0:w.value,L=u.value;t(this,S).call(this,C,L)});n(this,S,(l,u)=>{t(this,r).classList.add("is-active"),t(this,d)?t(this,i).parentElement.style.display="none":t(this,i).parentElement.style.display="block";const L=`${window.fluentcart_search_bar_vars.rest.url}/public/product-search/`;if(this.isLinkedWithShopApp()){const h={};u?h.wildcard=u:h.wildcard="",l&&(h["product-categories"]=l),window.fluentCartShopApps[0].applyFilters(h);return}let w=new URL(L);const M={post_title:u,url_mode:t(this,y),termId:l||"",show_thumbnail:t(this,f)};if(Object.keys(M).length>0)for(let[h,A]of Object.entries(M))w.searchParams.append(h,A);const q=w.href;if(u)t(this,i).innerHTML='<li class="fct-search-loading" aria-live="polite" aria-label="Loading"></li>',t(this,i).parentElement.style.display="block",fetch(q).then(h=>h.json()).then(h=>{const A=h.htmlView;t(this,i).innerHTML=A,t(this,i).parentElement.style.display="block";const v=t(this,i).parentElement.querySelector("h5");v&&(v.style.display="block"),A.trim()===""&&(t(this,i).innerHTML='<li class="is-empty">No results found.</li>',v&&(v.style.display="none"))}).catch(()=>{t(this,i).innerHTML='<li class="is-empty">Unable to load results. Please try again.</li>'});else{k(this,m,U).call(this);return}});p(this,e,l),p(this,c,t(this,e).querySelector("[data-fluent-cart-search-bar-app-taxonomy]")),p(this,r,t(this,e).querySelector("[data-fluent-cart-search-bar]")),p(this,o,t(this,e).querySelector("[data-fluent-cart-search-clear]")),p(this,i,t(this,e).querySelector("[data-fluent-cart-search-bar-lists-wrapper]")),p(this,y,t(this,e).dataset.urlMode||""),p(this,f,JSON.parse(t(this,e).dataset.showThumbnail??"true")),this.init(),p(this,d,t(this,e).dataset.linkWithShopApp||!1)}isLinkedWithShopApp(){const l=Array.isArray(window.fluentCartShopApps)&&window.fluentCartShopApps.length>0;return t(this,d)&&l}init(){const l=B.debounce(t(this,b),300);t(this,r).addEventListener("keyup",l),t(this,c)&&t(this,c).addEventListener("change",l),t(this,i).parentElement.style.display="none",t(this,r).addEventListener("input",()=>{t(this,r).value.trim()!==""?t(this,o).style.display="block":t(this,o).style.display="none"}),t(this,o).addEventListener("click",()=>{t(this,r).value="",t(this,o).style.display="none",k(this,m,U).call(this)})}}e=new WeakMap,r=new WeakMap,o=new WeakMap,i=new WeakMap,c=new WeakMap,y=new WeakMap,d=new WeakMap,f=new WeakMap,b=new WeakMap,S=new WeakMap,m=new WeakSet,U=function(){t(this,r).classList.remove("is-active"),t(this,i).parentElement.style.display="none",t(this,i).innerHTML="",t(this,d)&&typeof window.fluentCartShopApps<"u"&&window.fluentCartShopApps.length>0&&window.fluentCartShopApps[0].applyFilters({wildcard:"","product-categories":""})},document.querySelectorAll("[data-fluent-cart-search-bar-app-wrapper]").forEach(g=>{new s(g)})});