(window.webpackJsonpvtex_search_1_5_1=window.webpackJsonpvtex_search_1_5_1||[]).push([[0],{20:function(e,n,i){"use strict";i.d(n,"a",(function(){return g}));var a=i(4),t=i.n(a),d=i(13),r=i(8),m=i(9);function l(e,n,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"/",t="";if(i&&i>0){var d=new Date;d.setTime((new Date).getTime()+i),t="expires=".concat(d.toUTCString(),";")}document.cookie="".concat(e,"=").concat(encodeURIComponent(n),";").concat(t,"path=").concat(a)}var s=i(28),u=i.n(s),c=i(29),v=i.n(c),o=i(30),k=i.n(o),g=function(){function e(n){Object(r.a)(this,e),this.client=n,this.historyKey="biggy-search-history"}var n,i,a;return Object(m.a)(e,[{key:"topSearches",value:(a=Object(d.a)(t.a.mark((function e(){return t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.client.query({query:k.a}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"suggestionSearches",value:(i=Object(d.a)(t.a.mark((function e(n){return t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.client.query({query:v.a,variables:{term:n}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"suggestionProducts",value:(n=Object(d.a)(t.a.mark((function e(n,i,a){var d,r,m=arguments;return t.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d=m.length>3&&void 0!==m[3]?m[3]:"BIGGY",r=m.length>4&&void 0!==m[4]?m[4]:"API",e.abrupt("return",this.client.query({query:u.a,variables:{term:n,attributeKey:i,attributeValue:a,productOrigin:d,indexingType:r},fetchPolicy:"network-only"}));case 3:case"end":return e.stop()}}),e,this)}))),function(e,i,a){return n.apply(this,arguments)})},{key:"searchHistory",value:function(){return(function(e){var n=new RegExp("(^|;)[ ]*".concat(e,"=([^;]*)")).exec(document.cookie);if(!n)return null;try{return decodeURIComponent(n[2])}catch(e){return n[2]}}(this.historyKey)||"").split(",").filter((function(e){return!!e}))}},{key:"prependSearchHistory",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(null!=e&&""!==e.trim()){var i=this.searchHistory();i.indexOf(e)<0&&(i.unshift(e),i=i.slice(0,n)),l(this.historyKey,i.join(","))}}}]),e}()},28:function(e,n){var i={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"Product"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Product"}},directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"provider"},value:{kind:"StringValue",value:"vtex.search",block:!1}},{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.search@1.5.1",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cacheId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"productId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"description"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"productName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"productReference"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"linkText"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"brand"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"brandId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"link"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"categories"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"priceRange"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sellingPrice"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"highPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lowPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"listPrice"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"highPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lowPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"specificationGroups"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"specifications"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"values"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"items"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"itemId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nameComplete"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"complementName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ean"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"variations"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"values"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"referenceId"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"Key"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"Value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"measurementUnit"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"unitMultiplier"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"images"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cacheId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageLabel"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageTag"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageText"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"sellers"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sellerId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sellerName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"commertialOffer"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"discountHighlights"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"teasers"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"conditions"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"minimumQuantity"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"parameters"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"effects"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"parameters"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"Installments"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"Value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"InterestRate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"TotalValuePlusInterestRate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"NumberOfInstallments"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"Name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"Price"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ListPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"taxPercentage"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"PriceWithoutDiscount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"RewardValue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"PriceValidUntil"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"AvailableQuantity"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"productClusters"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"properties"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"values"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"suggestionProducts"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"term"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"attributeKey"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"attributeValue"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"productOrigin"}},type:{kind:"NamedType",name:{kind:"Name",value:"Origin"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"indexingType"}},type:{kind:"NamedType",name:{kind:"Name",value:"IndexingType"}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.search@1.5.1",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"suggestionProducts"},arguments:[{kind:"Argument",name:{kind:"Name",value:"term"},value:{kind:"Variable",name:{kind:"Name",value:"term"}}},{kind:"Argument",name:{kind:"Name",value:"attributeKey"},value:{kind:"Variable",name:{kind:"Name",value:"attributeKey"}}},{kind:"Argument",name:{kind:"Name",value:"attributeValue"},value:{kind:"Variable",name:{kind:"Name",value:"attributeValue"}}},{kind:"Argument",name:{kind:"Name",value:"indexingType"},value:{kind:"Variable",name:{kind:"Name",value:"indexingType"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"provider"},value:{kind:"StringValue",value:"vtex.search",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"704c20442c5227eb5d8c75bfd410cb86d3b07c1fc719fbd960239f04586728e0",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"count"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"products"},arguments:[{kind:"Argument",name:{kind:"Name",value:"origin"},value:{kind:"Variable",name:{kind:"Name",value:"productOrigin"}}},{kind:"Argument",name:{kind:"Name",value:"indexingType"},value:{kind:"Variable",name:{kind:"Name",value:"indexingType"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Product"},directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:2510}};i.loc.source={body:'fragment Product on Product @context(provider: "vtex.search", sender: "vtex.search@1.5.1") {\n cacheId\n productId\n description\n productName\n productReference\n linkText\n brand\n brandId\n link\n categories\n priceRange {\n sellingPrice {\n highPrice\n lowPrice\n __typename\n }\n listPrice {\n highPrice\n lowPrice\n __typename\n }\n __typename\n }\n specificationGroups {\n name\n specifications {\n name\n values\n __typename\n }\n __typename\n }\n items {\n itemId\n name\n nameComplete\n complementName\n ean\n variations {\n name\n values\n __typename\n }\n referenceId {\n Key\n Value\n __typename\n }\n measurementUnit\n unitMultiplier\n images {\n cacheId\n imageId\n imageLabel\n imageTag\n imageUrl\n imageText\n __typename\n }\n sellers {\n sellerId\n sellerName\n commertialOffer {\n discountHighlights {\n name\n __typename\n }\n teasers {\n name\n conditions {\n minimumQuantity\n parameters {\n name\n value\n __typename\n }\n __typename\n }\n effects {\n parameters {\n name\n value\n __typename\n }\n __typename\n }\n __typename\n }\n Installments {\n Value\n InterestRate\n TotalValuePlusInterestRate\n NumberOfInstallments\n Name\n __typename\n }\n Price\n ListPrice\n taxPercentage\n PriceWithoutDiscount\n RewardValue\n PriceValidUntil\n AvailableQuantity\n __typename\n }\n __typename\n }\n __typename\n }\n productClusters {\n id\n name\n __typename\n }\n properties {\n name\n values\n __typename\n }\n}\n\nquery suggestionProducts($term: String!, $attributeKey: String, $attributeValue: String, $productOrigin: Origin, $indexingType: IndexingType) @context(sender: "vtex.search@1.5.1") {\n suggestionProducts(term: $term, attributeKey: $attributeKey, attributeValue: $attributeValue, indexingType: $indexingType) @context(provider: "vtex.search") @runtimeMeta(hash: "704c20442c5227eb5d8c75bfd410cb86d3b07c1fc719fbd960239f04586728e0") {\n count\n products(origin: $productOrigin, indexingType: $indexingType) {\n ...Product\n __typename\n }\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var a={};function t(e,n){for(var i=0;i0;){var l=m;m=new Set,l.forEach((function(e){r.has(e)||(r.add(e),(a[e]||new Set).forEach((function(e){m.add(e)})))}))}return r.forEach((function(n){var a=t(e,n);a&&i.definitions.push(a)})),i}(i,"suggestionProducts")},29:function(e,n){var i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"suggestionSearches"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"term"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.search@1.5.1",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"suggestionSearches"},arguments:[{kind:"Argument",name:{kind:"Name",value:"term"},value:{kind:"Variable",name:{kind:"Name",value:"term"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"provider"},value:{kind:"StringValue",value:"vtex.search",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"079eeedd920fdb9a4dd750a2cf5a62c66ddb09e15657053363287f92eacf1594",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searches"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"term"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"attributes"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"labelKey"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"labelValue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:416}};i.loc.source={body:'query suggestionSearches($term: String!) @context(sender: "vtex.search@1.5.1") {\n suggestionSearches(term: $term) @context(provider: "vtex.search") @runtimeMeta(hash: "079eeedd920fdb9a4dd750a2cf5a62c66ddb09e15657053363287f92eacf1594") {\n searches {\n term\n attributes {\n key\n value\n labelKey\n labelValue\n __typename\n }\n __typename\n }\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var a={};function t(e,n){for(var i=0;i0;){var l=m;m=new Set,l.forEach((function(e){r.has(e)||(r.add(e),(a[e]||new Set).forEach((function(e){m.add(e)})))}))}return r.forEach((function(n){var a=t(e,n);a&&i.definitions.push(a)})),i}(i,"suggestionSearches")},30:function(e,n){var i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"topSearches"},variableDefinitions:[],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.search@1.5.1",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"topSearches"},arguments:[],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"provider"},value:{kind:"StringValue",value:"vtex.search",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"3716a7e9b7fc6fa498d6f6007175b1d948abc31c5291347add48a7f9fa74bbb0",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searches"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"term"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:265}};i.loc.source={body:'query topSearches @context(sender: "vtex.search@1.5.1") {\n topSearches @context(provider: "vtex.search") @runtimeMeta(hash: "3716a7e9b7fc6fa498d6f6007175b1d948abc31c5291347add48a7f9fa74bbb0") {\n searches {\n term\n __typename\n }\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var a={};function t(e,n){for(var i=0;i0;){var l=m;m=new Set,l.forEach((function(e){r.has(e)||(r.add(e),(a[e]||new Set).forEach((function(e){m.add(e)})))}))}return r.forEach((function(n){var a=t(e,n);a&&i.definitions.push(a)})),i}(i,"topSearches")}}]);; (window.webpackJsonpvtex_search_1_5_1=window.webpackJsonpvtex_search_1_5_1||[]).push([["Autocomplete"],[function(t,e){t.exports=React},function(t,e){t.exports=__RENDER_8_RUNTIME__},function(t,e){t.exports=ReactIntl},,,,function(t,e){t.exports=ReactApollo},function(t,e,r){t.exports={itemList:"vtex-search-1-x-itemList",itemListList:"vtex-search-1-x-itemListList",itemListTitle:"vtex-search-1-x-itemListTitle",itemListItem:"vtex-search-1-x-itemListItem",itemListSubItem:"vtex-search-1-x-itemListSubItem",itemListPrefix:"vtex-search-1-x-itemListPrefix",itemListIcon:"vtex-search-1-x-itemListIcon","itemList--suggestion":"vtex-search-1-x-itemList--suggestion","itemList--history":"vtex-search-1-x-itemList--history","itemList--top-search":"vtex-search-1-x-itemList--top-search"}},,,,,,,function(t,e,r){t.exports={clearLink:"vtex-search-1-x-clearLink",element:"vtex-search-1-x-element",imageContainer:"vtex-search-1-x-imageContainer",image:"vtex-search-1-x-image",information:"vtex-search-1-x-information",productNameContainer:"vtex-search-1-x-productNameContainer",productBrand:"vtex-search-1-x-productBrand",priceContainer:"vtex-search-1-x-priceContainer",priceOld:"vtex-search-1-x-priceOld",priceNew:"vtex-search-1-x-priceNew",discount:"vtex-search-1-x-discount"}},function(t,e,r){t.exports={tileList:"vtex-search-1-x-tileList",tileListTitle:"vtex-search-1-x-tileListTitle",tileListItem:"vtex-search-1-x-tileListItem",tileListSeeMore:"vtex-search-1-x-tileListSeeMore",tileListSpinner:"vtex-search-1-x-tileListSpinner"}},function(t,e,r){t.exports={"biggy-autocomplete-wrapper":"vtex-search-1-x-biggy-autocomplete-wrapper","biggy-autocomplete":"vtex-search-1-x-biggy-autocomplete","close-btn":"vtex-search-1-x-close-btn","history-and-top-wrapper":"vtex-search-1-x-history-and-top-wrapper","biggy-js-container--hidden":"vtex-search-1-x-biggy-js-container--hidden"}},,,,,function(t,e){t.exports=regeneratorRuntime},function(t,e){t.exports=R},function(t,e){t.exports=__RENDER_8_COMPONENTS__["vtex.product-price@1.x/SellingPrice"]},function(t,e){t.exports=__RENDER_8_COMPONENTS__["vtex.product-price@1.x/ListPrice"]},function(t,e){t.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/ProductContextProvider"]},function(t,e){t.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Spinner"]},function(t,e){t.exports=__RENDER_8_COMPONENTS__["vtex.product-summary@2.x/ProductSummaryCustom"]},,,,function(t,e){t.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/IconClose"]},function(t,e){t.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/IconClock"]},function(t,e){t.exports=__RENDER_8_COMPONENTS__["vtex.product-list-context@0.x/ProductListContext"]},function(t,e){t.exports=__RENDER_8_COMPONENTS__["vtex.device-detector@0.x/withDevice"]},function(t,e){function r(t,e,r){var n,i,s,a,o;function c(){var u=Date.now()-a;u=0?n=setTimeout(c,e-u):(n=null,r||(o=t.apply(s,i),s=i=null))}null==e&&(e=100);var u=function(){s=this,i=arguments,a=Date.now();var u=r&&!n;return n||(n=setTimeout(c,e)),u&&(o=t.apply(s,i),s=i=null),o};return u.clear=function(){n&&(clearTimeout(n),n=null)},u.flush=function(){n&&(o=t.apply(s,i),s=i=null,clearTimeout(n),n=null)},u}r.debounce=r,t.exports=r},,,,function(t,e,r){"use strict";r.r(e),function(t){var e=r(3);r.p=Object(e.getPublicPath)("vtex.search@1.5.1");var n=Object(e.register)((function(){return r(45)}),t,"vtex.search@1.5.1","vtex.search@1.x","Autocomplete");n.renderHotReload,n.setupHMR}.call(this,r(18)(t))},,,,,,function(t,e,r){"use strict";r.r(e);var n=r(4),i=r.n(n),s=r(13),a=r(8),o=r(9),c=r(12),u=r(11),l=r(5),p=r(0),m=r.n(p),h=r(6),d=r(7),f=r.n(d),v=r(1),g=function(t){return t.item&&t.item.attributes?m.a.createElement("ul",{className:f.a.itemListSubList},t.item.attributes.map((function(e,r){return m.a.createElement("li",{key:r,className:"".concat(f.a.itemListSubItem," c-on-base pointer"),onMouseOver:function(r){return t.handleMouseOver(r,e)},onMouseOut:function(){return t.handleMouseOut()}},m.a.createElement(v.Link,{className:"c-on-base",to:"/".concat(t.item.value,"/").concat(e.value),query:"map=ft,".concat(e.key)},e.label))}))):null};function x(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Object(l.a)(t);if(e){var i=Object(l.a)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Object(u.a)(this,r)}}var y=function(t){Object(c.a)(r,t);var e=x(r);function r(){var t;return Object(a.a)(this,r),(t=e.apply(this,arguments)).state={currentTimeoutId:null},t}return Object(o.a)(r,[{key:"handleMouseOver",value:function(t,e){var r=this;if(t.stopPropagation(),!this.state.currentTimeoutId){var n=setTimeout((function(){r.props.onItemHover&&r.props.onItemHover(e),r.setState({currentTimeoutId:null})}),100);this.setState({currentTimeoutId:n})}}},{key:"handleMouseOut",value:function(){var t=this.state.currentTimeoutId;t&&(clearTimeout(t),this.setState({currentTimeoutId:null}))}},{key:"render",value:function(){var t=this;if(0===this.props.items.length&&!this.props.showTitleOnEmpty)return null;var e=this.props.modifier?f.a["itemList--".concat(this.props.modifier)]:"";return p.createElement("article",{className:"".concat(f.a.itemList," ").concat(e)},this.props.showTitle?p.createElement("p",{className:"".concat(f.a.itemListTitle," c-on-base")},this.props.title):null,p.createElement("ol",{className:f.a.itemListList},this.props.items.map((function(e){return p.createElement("li",{key:e.value,className:"".concat(f.a.itemListItem),onMouseOver:function(r){return t.handleMouseOver(r,e)},onMouseOut:function(){return t.handleMouseOut()}},p.createElement(v.Link,{to:e.link,query:"map=ft"},e.icon?p.createElement("span",{className:f.a.itemListIcon},e.icon):null,e.prefix?p.createElement("span",{className:f.a.itemListPrefix},e.prefix):null,p.createElement("span",{className:"c-on-base"},e.label)),p.createElement(g,{item:e,handleMouseOver:t.handleMouseOver.bind(t),handleMouseOut:t.handleMouseOut.bind(t)}))}))))}}]),r}(p.Component);var E=r(15),b=r.n(E),O=r(22),_=r(14),L=r.n(_),N=r(23),P=r.n(N),S=r(24),w=r.n(S),T=r(25),R=r.n(T);function I(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Object(l.a)(t);if(e){var i=Object(l.a)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Object(u.a)(this,r)}}var k=function(t){Object(c.a)(r,t);var e=I(r);function r(){return Object(a.a)(this,r),e.apply(this,arguments)}return Object(o.a)(r,[{key:"render",value:function(){var t,e,r,n=this.props.product,i=Object(O.path)(["sku"],n),s=null===(r=null===(e=null===(t=null==i?void 0:i.sellers)||void 0===t?void 0:t[0])||void 0===e?void 0:e.commertialOffer)||void 0===r?void 0:r.taxPercentage;return p.createElement("div",null,p.createElement(v.Link,{params:{slug:n&&n.linkText,id:n&&n.productId},page:"store.product",className:"no-underline"},p.createElement("article",{className:"".concat(L.a.element," flex flex-row justify-start items-center pa3 bg-animate hover-bg-light-gray")},p.createElement("div",{className:"".concat(L.a.imageContainer," h3")},p.createElement("img",{className:"".concat(L.a.image," h-100 w-auto mw-none"),src:i.image.imageUrl})),p.createElement("div",{className:"".concat(L.a.information," flex flex-column justify-between items-start ml4")},p.createElement("div",{className:L.a.productNameContainer},p.createElement("span",{className:"".concat(L.a.productBrand," f5 c-on-base")},n.productName)),p.createElement("div",{className:L.a.priceContainer},p.createElement(R.a,{product:n,query:{skuId:i&&i.itemId}},p.createElement("span",{className:"db f7 c-muted-2"},p.createElement(w.a,{message:s?"{listPriceWithTax}":"{listPriceValue}"})),p.createElement("span",{className:"dib t-small c-muted-2"},p.createElement(P.a,{message:s?"{sellingPriceWithTax}":"{sellingPriceValue}"}))))))))}}]),r}(p.Component),M=r(26),C=r.n(M),j=r(27),H=r.n(j),D=r(2);function V(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Object(l.a)(t);if(e){var i=Object(l.a)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Object(u.a)(this,r)}}var F=function(t){Object(c.a)(r,t);var e=V(r);function r(){return Object(a.a)(this,r),e.apply(this,arguments)}return Object(o.a)(r,[{key:"render",value:function(){var t=this;return 0!==this.props.products.length||this.props.isLoading?p.createElement("section",{className:b.a.tileList},this.props.showTitle?p.createElement("p",{className:"".concat(b.a.tileListTitle," c-on-base")},this.props.title):null,this.props.isLoading?p.createElement("div",{className:b.a.tileListSpinner},p.createElement(C.a,null)):p.createElement(p.Fragment,null,p.createElement("ul",{className:b.a.tileListList,style:{flexDirection:this.props.layout===tt.Horizontal?"column":"row"}},this.props.products.map((function(e){var r=H.a.mapCatalogProductToProductSummary(e);return p.createElement("li",{key:e.productId,className:b.a.tileListItem},t.props.layout===tt.Horizontal?p.createElement(k,{product:r}):p.createElement(v.ExtensionPoint,{id:"product-summary",product:r}))}))),p.createElement("footer",null,this.props.totalProducts>0?p.createElement(v.Link,{to:"/".concat(this.props.term),query:"map=ft",className:b.a.tileListSeeMore},p.createElement(D.FormattedMessage,{id:"store/seeMore",values:{count:this.props.totalProducts}})):null))):null}}]),r}(p.Component),W=r(16),A=r.n(W),q=r(20),B=r(31),U=r.n(B),z=r(32),Q=r.n(z),G=r(33),J=r.n(G),X=r(34),Y=r.n(X),Z=r(35),K=r.n(Z);function $(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Object(l.a)(t);if(e){var i=Object(l.a)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Object(u.a)(this,r)}}var tt;!function(t){t.Horizontal="HORIZONTAL",t.Vertical="VERTICAL"}(tt||(tt={}));var et=J.a.ProductListProvider,rt=function(t){Object(c.a)(l,t);var e,r,n,u=$(l);function l(t){var e;return Object(a.a)(this,l),(e=u.call(this,t)).state={topSearchedItems:[],history:[],products:[],suggestionItems:[],totalProducts:0,queryFromHover:{},dynamicTerm:"",isProductsLoading:!1,currentHeightWhenOpen:0},e.getProductLayout=function(){var t=e.props,r=t.productLayout,n=t.isMobile;return void 0!==r?r:n?tt.Horizontal:tt.Vertical},e.client=new q.a(e.props.client),e.autocompleteRef=m.a.createRef(),e.isIOS=navigator&&!!navigator.userAgent.match(/(iPod|iPhone|iPad)/),e}return Object(o.a)(l,[{key:"fitAutocompleteInWindow",value:function(){if(window&&this.autocompleteRef.current&&this.props.isMobile&&!this.isIOS){var t=window.innerHeight,e=this.autocompleteRef.current.getBoundingClientRect().y,r=this.autocompleteRef.current.offsetHeight,n=r-(e+r-t);this.autocompleteRef.current.style.maxHeight="".concat(n,"px")}}},{key:"addEvents",value:function(){window.addEventListener("resize",K()(this.fitAutocompleteInWindow.bind(this),100))}},{key:"componentDidMount",value:function(){this.updateTopSearches(),this.updateHistory(),this.addEvents()}},{key:"shouldUpdate",value:function(t){return t.inputValue!==this.props.inputValue||!t.isOpen&&this.props.isOpen}},{key:"addTermToHistory",value:function(){var t=window.location.href.split("_q=");if(t[1]){var e=t[1].split("&")[0];try{this.client.prependSearchHistory(decodeURI(e))}catch(t){this.client.prependSearchHistory(e)}}}},{key:"componentDidUpdate",value:function(t){var e=this;if(this.shouldUpdate(t)){this.addTermToHistory(),this.fitAutocompleteInWindow();var r=this.props.inputValue;this.setState({dynamicTerm:r}),null===r||""===r?(this.updateTopSearches(),this.updateHistory(),this.setState({suggestionItems:[],products:[]})):this.updateSuggestions().then((function(){return e.fitAutocompleteInWindow(),e.updateProducts()})).then((function(){return e.fitAutocompleteInWindow()}))}}},{key:"highlightTerm",value:function(t,e){var r=t.split(e);return m.a.createElement(m.a.Fragment,null,r.map((function(t,n){return m.a.createElement(m.a.Fragment,null,t,n!==r.length-1?m.a.createElement("span",{className:"b"},e):null)})))}},{key:"updateSuggestions",value:(n=Object(s.a)(i.a.mark((function t(){var e,r,n,s,a,o,c=this;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.client.suggestionSearches(this.props.inputValue);case 2:e=t.sent,r=e.data.suggestionSearches.searches,n=this.props.maxSuggestedTerms,s=void 0===n?5:n,a=r.slice(0,s).map((function(t){var e=t.attributes||[];return{term:t.term,attributes:e.map((function(e){return{label:e.labelValue,value:e.value,link:"/".concat(t.term,"/").concat(e.value,"/?map=ft,").concat(e.key),groupValue:t.term,key:e.key}}))}})),o=a.map((function(t){return{label:c.highlightTerm(t.term.toLowerCase(),c.props.inputValue.toLocaleLowerCase()),value:t.term,groupValue:t.term,link:"/".concat(t.term,"?map=ft"),attributes:t.attributes}})),this.setState({suggestionItems:o});case 8:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"updateProducts",value:(r=Object(s.a)(i.a.mark((function t(){var e,r,n,s,a,o,c,u,l,p;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.state.dynamicTerm,r=this.props,n=r.__unstableProductOrigin,s=r.__unstableProductOriginVtex,a=void 0!==s&&s,o=r.__unstableIndexingType,c=this.state.queryFromHover,e){t.next=6;break}return this.setState({products:[],totalProducts:0}),t.abrupt("return");case 6:return n&&console.warn("The prop `__unstableProductOrigin` has been deprecated. Use the boolean prop `__unstableProductOriginVtex` instead."),this.setState({isProductsLoading:!0}),t.next=10,this.client.suggestionProducts(e,c?c.key:void 0,c?c.value:void 0,"VTEX"===n||!0===a?"VTEX":"BIGGY",o);case 10:u=t.sent,this.setState({isProductsLoading:!1}),l=u.data.suggestionProducts,p=l.products.slice(0,this.getProductCount()),this.setState({products:p,totalProducts:l.count});case 15:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"updateTopSearches",value:(e=Object(s.a)(i.a.mark((function t(){var e,r,n,s,a;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.client.topSearches();case 2:e=t.sent,r=e.data.topSearches.searches,n=this.props.maxTopSearches,s=void 0===n?10:n,a=r.slice(0,s).map((function(t,e){return{prefix:m.a.createElement(m.a.Fragment,null,"".concat(e+1),m.a.createElement(D.FormattedMessage,{id:"store/ordinalNumber"})),value:t.term,label:t.term,link:"/".concat(t.term,"?map=ft")}})),this.setState({topSearchedItems:a});case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"updateHistory",value:function(){var t=this.client.searchHistory().slice(0,this.props.maxHistory||5).map((function(t){return{label:t,value:t,link:"/".concat(t,"?map=ft"),icon:m.a.createElement(Q.a,null)}}));this.setState({history:t})}},{key:"updateQueryByItemHover",value:function(t){"groupValue"in t?this.setState({dynamicTerm:t.groupValue,queryFromHover:{key:t.key,value:t.value}}):this.setState({dynamicTerm:t.value,queryFromHover:{key:void 0,value:void 0}}),this.updateProducts()}},{key:"renderSuggestions",value:function(){var t=!!this.state.suggestionItems&&this.state.suggestionItems.length>0,e=t?m.a.createElement(D.FormattedMessage,{id:"store/suggestions"}):m.a.createElement(D.FormattedMessage,{id:"store/emptySuggestion"});return m.a.createElement(y,{title:e,items:this.state.suggestionItems||[],modifier:"suggestion",showTitle:!t||!this.props.hideTitles,onItemHover:this.updateQueryByItemHover.bind(this),showTitleOnEmpty:0!==this.props.maxSuggestedTerms})}},{key:"contentWhenQueryIsEmpty",value:function(){return m.a.createElement("div",{className:A.a["history-and-top-wrapper"],style:{flexDirection:this.props.historyFirst?"row-reverse":"row"}},!this.props.isMobile||this.props.isMobile&&!this.props.historyFirst||0===this.state.history.length?m.a.createElement(y,{modifier:"top-search",title:m.a.createElement(D.FormattedMessage,{id:"store/topSearches"}),items:this.state.topSearchedItems||[],showTitle:!this.props.hideTitles}):null,!this.props.isMobile||this.props.isMobile&&this.props.historyFirst?m.a.createElement(y,{modifier:"history",title:m.a.createElement(D.FormattedMessage,{id:"store/history"}),items:this.state.history||[],showTitle:!this.props.hideTitles}):null)}},{key:"contentWhenQueryIsNotEmpty",value:function(){return m.a.createElement(m.a.Fragment,null,this.renderSuggestions(),m.a.createElement(F,{term:this.props.inputValue||"",shelfProductCount:this.getProductCount(),title:m.a.createElement(D.FormattedMessage,{id:"store/suggestedProducts",values:{term:this.props.inputValue}}),products:this.state.products||[],showTitle:!this.props.hideTitles,totalProducts:this.state.totalProducts||0,layout:this.getProductLayout(),isLoading:this.state.isProductsLoading}))}},{key:"renderContent",value:function(){var t=this.props.inputValue.trim();return t&&""!==t?this.contentWhenQueryIsNotEmpty():this.contentWhenQueryIsEmpty()}},{key:"hasContent",value:function(){var t=this.state,e=t.topSearchedItems,r=t.suggestionItems,n=t.history,i=t.products;return e.length>0||r.length>0||n.length>0||i.length>0}},{key:"getProductCount",value:function(){var t=this.props,e=t.customBreakpoints,r=t.isMobile,n=t.maxSuggestedProducts,i=void 0===n?3:n;if(!window||r||!e)return i;var s=window.innerWidth;return e.md&&e.lg&&e.xlg?s>=e.xlg.width?e.xlg.maxSuggestedProducts:s>=e.lg.width?e.lg.maxSuggestedProducts:s>=e.md.width?e.md.maxSuggestedProducts:i:i}},{key:"render",value:function(){var t=this.props.isOpen&&this.hasContent()?"":A.a["biggy-js-container--hidden"];return m.a.createElement("div",{className:A.a["biggy-autocomplete-wrapper"],style:{width:this.props.autocompleteWidth?"".concat(this.props.autocompleteWidth,"vw"):void 0}},m.a.createElement("section",{ref:this.autocompleteRef,className:"".concat(A.a["biggy-autocomplete"]," ").concat(t," w-100"),style:{flexDirection:this.getProductLayout()===tt.Horizontal?"column":"row"}},m.a.createElement(et,{listName:"autocomplete-result-list"},this.renderContent(),this.props.isMobile?m.a.createElement("button",{className:A.a["close-btn"]},m.a.createElement(U.a,null)):null)))}}]),l}(m.a.Component),nt=Y()(Object(h.withApollo)(rt));e.default=nt}],[[39,"common",0]]]);;