PageSourceSearch

https://www.planters.com/wp-content/themes/planters/js/faqs-grid.b045405f.js

js planters.com collected 2026-10-02 07:34:02 UTC 2,565 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[777],{7905:(e,t,s)=>{s.r(t),s.d(t,{init:()=>o});var r=s(5152),a=s(414),n=s(1669),i=s.n(n);function o(){i()(".faqs-grid.c-expandable-blocks").each(function(){new u(i()(this))})}var u=function(){return(0,a.A)(function e(t){(0,r.A)(this,e),this.$el=t,this.baseUrl=i()('link[rel="https://api.w.org/"]').attr("href"),this.ajaxUrl=this.baseUrl+"planters/v1/faqs",this.currentQuery=this.wpQueryToAjax(this.$el.data("query")),this.currentPage=this.currentQuery.paged?parseInt(this.currentQuery.paged):1,this.$noResults=t.find(".c-expandable-blocks__no-results"),this.$moreButton=t.find(".c-expandable-blocks__more-button .js-load-more"),this.$moreButton&&this.$moreButton.on("click",this.onLoadMoreClicked.bind(this)),document.addEventListener("planters:searchHeader:searchTermUpdate",this.onSearchHeaderSearchTermUpdate.bind(this))},[{key:"expandableBlocks",get:function(){return window.Planters.expandableBlocks.find(function(e){return e.$el.is(this.$el)}.bind(this))}},{key:"getResults",value:function(e){void 0===e&&(e={clear:!0}),this.expandableBlocks.setLoading(!0),e.clear&&this.expandableBlocks.clear(),this.$moreButton.hide(),this.$noResults.hide(),i().ajax({type:"GET",xhr:window.Planters.getXhr,url:this.ajaxUrl,data:this.currentQuery}).done(function(e,t,s){if(this.expandableBlocks.setLoading(!1),this.numPages=parseInt(s.getResponseHeader("X-WP-TotalPages"),10),this.currentPage>=this.numPages?this.$el.removeClass("c-expandable-blocks--has-more"):this.$el.addClass("c-expandable-blocks--has-more"),this.$moreButton.removeAttr("style"),0===e.length)this.$noResults.show();else{this.$noResults.hide();var r=e.map(function(e){return e.content_html}).join(""),a=i()(r);this.expandableBlocks.addItems(a)}}.bind(this)).fail(function(e){console.error("faqs ajax fail"),console.error(e)})}},{key:"nextPage",value:function(){this.currentPage++,this.currentQuery.content=1,this.currentQuery.paged=this.currentPage,this.getResults({clear:!1})}},{key:"onLoadMoreClicked",value:function(e){e.preventDefault(),this.nextPage()}},{key:"onSearchHeaderSearchTermUpdate",value:function(e){this.currentQuery.s=e.detail.searchTerm,this.currentPage=1,this.currentQuery.paged=1,this.getResults()}},{key:"wpQueryToAjax",value:function(e){var t=i().extend({},e);t.query.posts_per_page&&(t.posts_per_page=t.query.posts_per_page);
1var s=["s","query","query_vars","max_num_pages","found_posts","request","paged","posts_per_page"];return Object.keys(t).forEach(function(e){s.includes(e)||delete t[e]}),t}}])}()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.