enqueueScripts([function(){ !function(e){function t(t){for(var r,u,c=t[0],a=t[1],l=t[2],s=0,p=[];se.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=e.hideEmptyCols,o=void 0!==n&&n,r=t.reduce((function(t,e){var n="grow"===e.width,o="number"==typeof e.width?t.availableWidth-e.width:0;return{availableWidth:n?0:o,remainingColsNum:t.remainingColsNum+(e.hasDefinedWidth?0:1),hasAnyWidthGrow:t.hasAnyWidthGrow||n}}),{availableWidth:100,remainingColsNum:0,hasAnyWidthGrow:!1}),i=r.availableWidth,a=r.remainingColsNum,c=r.hasAnyWidthGrow;if(i<0&&!c){var d=-100/i;t=t.map((function(t){return Object.assign(Object.assign({},t),{width:"number"==typeof t.width?t.width*d:t.width})}))}return t.map((function(t){var e="number"==typeof t.width?"".concat(t.width,"%"):t.width;return{element:t.element,width:t.hasDefinedWidth?e:"".concat(Math.floor(Math.max(0,i)/(o?1:a)),"%"),hasDefinedWidth:t.hasDefinedWidth}}))};var m,w,v,g=n(14),O=n.n(g);!function(t){t.equal="equal",t.auto="auto"}(w||(w={})),function(t){t.between="between",t.around="around",t.left="left",t.right="right",t.center="center"}(v||(v={}));var j=(m={},Object(r.a)(m,v.between,"justify-between"),Object(r.a)(m,v.around,"justify-around"),Object(r.a)(m,v.left,"justify-start"),Object(r.a)(m,v.center,"justify-center"),Object(r.a)(m,v.right,"justify-end"),m),y=["flexRowContent"],W=function(t){var e=t.children,n=t.colGap,r=t.rowGap,i=t.marginTop,c=t.marginBottom,d=t.paddingTop,p=t.paddingBottom,m=t.border,g=t.borderWidth,W=t.borderColor,x=t.preserveLayoutOnMobile,C=t.preventHorizontalStretch,G=t.preventVerticalStretch,k=t.horizontalAlign,R=t.colSizing,E=t.colJustify,D=void 0===E?v.between:E,N=t.experimentalHideEmptyCols,_=void 0!==N&&N,M=Object(u.c)(),A=l()(y),B=Object(f.d)({colGap:null!=n?n:M.colGap,rowGap:null!=r?r:M.rowGap}),L=Object(f.b)({marginTop:i,marginBottom:c}),P=Object(f.c)({paddingTop:d,paddingBottom:p}),T=Object(f.a)({border:m,borderWidth:g,borderColor:W}),S=function(t,e){var n="phone"===h()().device,o=e||{},r=o.preserveLayoutOnMobile,i=void 0!==r&&r,c=o.hideEmptyCols,d=void 0!==c&&c,l=a.a.Children.toArray(t).map((function(t){if(!(e=t)||!e.props)return{element:t,width:0,hasDefinedWidth:!1,isResponsive:!0};var e,o=Object(f.e)(t.props.width||t.props.blockProps&&t.props.blockProps.width);return o&&"object"===Object(s.a)(o)?{element:t,width:n?o.mobile||0:o.desktop||0,hasDefinedWidth:!0,isResponsive:!0}:!i&&n?{element:t,width:0,hasDefinedWidth:!1,isResponsive:!1}:"number"==typeof o||"string"==typeof o?{element:t,width:o,hasDefinedWidth:!0,isResponsive:!1}:{element:t,width:0,hasDefinedWidth:!1,isResponsive:!0}})),u=l.some((function(t){return t.isResponsive})),p=!i&&n&&!u;return{cols:b(l,{hideEmptyCols:d}),breakOnMobile:p}}(e,{preserveLayoutOnMobile:x,hideEmptyCols:_}),I=S.cols,z=S.breakOnMobile,J=R===w.auto,q=J?j[D]:j.left;return null!=k&&(q=j[k]),a.a.createElement(u.a,Object(o.a)({parent:u.b.ROW},B),a.a.createElement("div",{className:"".concat(z?"flex-none flex-ns":"flex"," ").concat(L," ").concat(P," ").concat(T," ").concat(q," ").concat(A.flexRowContent," items-stretch w-100")},I.map((function(t,e){var n=e===I.length-1,o=n?0:B.colGap,r=n?0:B.rowGap;return a.a.createElement("div",{key:e,className:"".concat(z?"pr".concat(o,"-ns pb").concat(r," pb0-ns"):"pr".concat(o)," ").concat(G?"":"items-stretch"," ").concat(C?"":O.a.stretchChildrenWidth," ").concat("grow"===t.width?"flex-grow-1":""," ").concat(_?O.a.col:""," flex"),style:{width:C||J&&!t.hasDefinedWidth?"auto":z?"100%":t.width}},t.element)}))))},x=Object(c.defineMessages)({title:{id:"admin/editor.row.title"},description:{id:"admin/editor.row.description"}});W.schema={title:x.title.id,description:x.description.id};e.default=W},14:function(t,e,n){t.exports={stretchChildrenWidth:"vtex-flex-layout-0-x-stretchChildrenWidth",col:"vtex-flex-layout-0-x-col"}},2:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return c})),n.d(e,"c",(function(){return d}));var o,r=n(0),i=n.n(r);!function(t){t.NONE="none",t.ROW="row",t.COL="col"}(o||(o={}));var a=i.a.createContext({parent:o.NONE,colGap:0,rowGap:0}),c=function(t){var e=t.parent,n=t.colGap,o=t.rowGap,c=t.children,d=Object(r.useMemo)((function(){return{parent:e,colGap:n,rowGap:o}}),[e,n,o]);return i.a.createElement(a.Provider,{value:d},c)},d=function(){return Object(r.useContext)(a)}},3:function(t,e,n){"use strict";n.d(e,"d",(function(){return c})),n.d(e,"e",(function(){return l})),n.d(e,"c",(function(){return s})),n.d(e,"b",(function(){return p})),n.d(e,"a",(function(){return f}));var o,r=n(7),i=n(1),a=function(t,e){return t?Object(i.range)(0,12).map(String).includes(String(t))?"string"==typeof t?parseInt(t,10):t:(e&&console.warn("Invalid ".concat(e,' value ("').concat(t,'"). It should be an integer between 0 and ').concat(11,".")),0):0},c=function(t){var e=Object(i.toPairs)(t).map((function(t){var e=Object(r.a)(t,2),n=e[0],o=e[1];return[n,a(o,n)]}));return Object(i.fromPairs)(e)},d=function(t){if("string"!=typeof t)return null;if("grow"===t)return"grow";var e=t.match(new RegExp("(\\d*)(".concat(["%"].join("|"),")")));if(!e)return null;var n=e[1];return null==n?null:parseInt(n,10)},l=(o=d,function(t){return function(t){return t&&null!=t.mobile&&null!=t.desktop}(t)?{mobile:o(t.mobile),desktop:o(t.desktop)}:o(t)}),u=function(t){return function(e){var n=Object(i.pick)(Object.keys(t),e),o=c(n);return Object(i.toPairs)(o).map((function(e){var n=Object(r.a)(e,2),o=n[0],i=n[1];return"".concat(t[o]).concat(i)})).join(" ")}},s=u({paddingTop:"pt",paddingBottom:"pb",paddingLeft:"pl",paddingRight:"pr"}),p=u({marginTop:"mt",marginBottom:"mb",marginLeft:"ml",marginRight:"mr"}),h={top:"bt",right:"br",bottom:"bb",left:"bl",all:"ba"},f=function(t){var e=t.border,n=t.borderWidth,o=t.borderColor,r=e?[].concat(e).map((function(t){return h[t]})).join(" "):"",i=n?"bw".concat(a(n,"bw")):"",c=o?"b--".concat(o.split(" ")[0]):"";return"".concat(r," ").concat(i," ").concat(c)}}}]); },function(){ (window.webpackJsonpvtex_flex_layout_0_21_3=window.webpackJsonpvtex_flex_layout_0_21_3||[]).push([["FlexLayout"],[function(e,t){e.exports=React},function(e,t){e.exports=R},,,,function(e,t){e.exports=ReactIntl},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/useCssHandles"]},,,function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.responsive-values@0.x/useResponsiveValues"]},,,function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.device-detector@0.x/useDevice"]},,,function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-components@3.x/Container"]},,,,function(e,t,n){"use strict";n.r(t),function(e){var t=n(4);n.p=Object(t.getPublicPath)("vtex.flex-layout@0.21.3");var o=Object(t.register)((function(){return n(20)}),e,"vtex.flex-layout@0.21.3","vtex.flex-layout@0.x","FlexLayout");o.renderHotReload,o.setupHMR}.call(this,n(10)(e))},function(e,t,n){"use strict";n.r(t);var o=n(0),i=n.n(o),s=n(5),a=n(6),c=n.n(a),l=n(15),r=n.n(l),u=n(9),_=n.n(u),x=n(2),d=n(13),f=["flexRow"],p=function(e){var t=_()(e),n=t.fullWidth,o=t.htmlId,s=Object(x.c)(),a=c()(f),l=i.a.createElement(d.default,t),u=s.parent===x.b.NONE;return n||!u?i.a.createElement("div",{className:a.flexRow,id:o},l):i.a.createElement("div",{className:a.flexRow,id:o},i.a.createElement(r.a,null,l))},v=Object(s.defineMessages)({title:{id:"admin/editor.row.title"},description:{id:"admin/editor.row.description"}});p.schema={title:v.title.id,description:v.description.id},t.default=p}],[[19,"common",0]]]); },function(){ (window.webpackJsonpvtex_flex_layout_0_21_3=window.webpackJsonpvtex_flex_layout_0_21_3||[]).push([["Col"],[function(t,n){t.exports=React},function(t,n){t.exports=R},function(t,n,e){"use strict";e.d(n,"b",(function(){return r})),e.d(n,"a",(function(){return a})),e.d(n,"c",(function(){return u}));var r,o=e(0),c=e.n(o);!function(t){t.NONE="none",t.ROW="row",t.COL="col"}(r||(r={}));var i=c.a.createContext({parent:r.NONE,colGap:0,rowGap:0}),a=function(t){var n=t.parent,e=t.colGap,r=t.rowGap,a=t.children,u=Object(o.useMemo)((function(){return{parent:n,colGap:e,rowGap:r}}),[n,e,r]);return c.a.createElement(i.Provider,{value:u},a)},u=function(){return Object(o.useContext)(i)}},function(t,n,e){"use strict";e.d(n,"d",(function(){return a})),e.d(n,"e",(function(){return l})),e.d(n,"c",(function(){return f})),e.d(n,"b",(function(){return p})),e.d(n,"a",(function(){return b}));var r,o=e(7),c=e(1),i=function(t,n){return t?Object(c.range)(0,12).map(String).includes(String(t))?"string"==typeof t?parseInt(t,10):t:(n&&console.warn("Invalid ".concat(n,' value ("').concat(t,'"). It should be an integer between 0 and ').concat(11,".")),0):0},a=function(t){var n=Object(c.toPairs)(t).map((function(t){var n=Object(o.a)(t,2),e=n[0],r=n[1];return[e,i(r,e)]}));return Object(c.fromPairs)(n)},u=function(t){if("string"!=typeof t)return null;if("grow"===t)return"grow";var n=t.match(new RegExp("(\\d*)(".concat(["%"].join("|"),")")));if(!n)return null;var e=n[1];return null==e?null:parseInt(e,10)},l=(r=u,function(t){return function(t){return t&&null!=t.mobile&&null!=t.desktop}(t)?{mobile:r(t.mobile),desktop:r(t.desktop)}:r(t)}),d=function(t){return function(n){var e=Object(c.pick)(Object.keys(t),n),r=a(e);return Object(c.toPairs)(r).map((function(n){var e=Object(o.a)(n,2),r=e[0],c=e[1];return"".concat(t[r]).concat(c)})).join(" ")}},f=d({paddingTop:"pt",paddingBottom:"pb",paddingLeft:"pl",paddingRight:"pr"}),p=d({marginTop:"mt",marginBottom:"mb",marginLeft:"ml",marginRight:"mr"}),s={top:"bt",right:"br",bottom:"bb",left:"bl",all:"ba"},b=function(t){var n=t.border,e=t.borderWidth,r=t.borderColor,o=n?[].concat(n).map((function(t){return s[t]})).join(" "):"",c=e?"bw".concat(i(e,"bw")):"",a=r?"b--".concat(r.split(" ")[0]):"";return"".concat(o," ").concat(c," ").concat(a)}},,function(t,n){t.exports=ReactIntl},function(t,n){t.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/useCssHandles"]},,,function(t,n){t.exports=__RENDER_8_COMPONENTS__["vtex.responsive-values@0.x/useResponsiveValues"]},,,,,,,,function(t,n,e){"use strict";e.r(n),function(t){var n=e(4);e.p=Object(n.getPublicPath)("vtex.flex-layout@0.21.3");var r=Object(n.register)((function(){return e(18)}),t,"vtex.flex-layout@0.21.3","vtex.flex-layout@0.x","Col");r.renderHotReload,r.setupHMR}.call(this,e(10)(t))},function(t,n,e){"use strict";e.r(n);var r,o,c=e(11),i=e(0),a=e.n(i),u=e(5),l=e(9),d=e.n(l),f=e(6),p=e.n(f),s=e(2),b=e(3),m=function(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);ot.length)&&(n=t.length);for(var e=0,r=new Array(n);e0?{cleanUrl:c[0],vParam:a}:{cleanUrl:e}}(e),i=r.vParam,c=r.cleanUrl;return i?"".concat(c,"-").concat(n,"-").concat(t,"?v=").concat(i):"".concat(c,"-").concat(n,"-").concat(t)}function l(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"auto";if(e){"number"==typeof n&&(n=Math.min(n,3e3)),"number"==typeof t&&(t=Math.min(t,4e3));var r=o(e,n,t),i=r.includes("?")?"&":"?";return"".concat(r).concat(i,"width=").concat(n,"&height=").concat(t,"&aspect=true")}}function s(e){return e.commertialOffer.Price}function f(e){var n=e.commertialOffer.AvailableQuantity;return null!=n&&n>0}function d(e,n){var t=e.filter(v);if(0===t.length)return e[0];if(1===t.length)return t[0];var r=t.map((function(e){return function(e,n){var t=e.sellers;if(1===t.length)return t[0].commertialOffer.Price;var r=t.filter(f).map(s);return"highest"===n?r.reduce((function(e,n){return n>e?n:e})):r.reduce((function(e,n){return nr[e]?t:e}),0):r.reduce((function(e,n,t){return n1&&void 0!==arguments[1]?arguments[1]:"FIRST_AVAILABLE",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:500;if(!e)return null;var l,s=Object.assign({},e),f=s.items||[],d=s.properties||[],m=null!==(n=d.find((function(e){return"DefaultSKUSelected"===e.name})))&&void 0!==n?n:null;if(l=1===f.length?f[0]:m?p(f,m.values,a):h(f,a)){var v=null!==(t=Object(c.a)(null==l?void 0:l.sellers))&&void 0!==t?t:P,_=null!==(i=null==l?void 0:l.referenceId)&&void 0!==i?i:[],E=Object(r.a)(_,1),S=E[0],y=void 0===S?O:S,A=null!==(u=null==l?void 0:l.images)&&void 0!==u?u:[],I=A.map((function(e){return Object.assign(Object.assign({},e),{imageUrl:b(e.imageUrl,o)})})),j=Object(r.a)(I,1),L=j[0],w=void 0===L?g:L;s.sku=Object.assign(Object.assign({},l),{seller:v,referenceId:y,image:w,images:I})}return s}},49:function(e,n,t){"use strict";t.r(n),t.d(n,"PRODUCT_LIST_PLACEMENT",(function(){return g}));var r=t(0),i=t.n(r),c=t(50),u=t.n(c),a=t(51),o=t.n(a),l=t(21),s=t.n(l),f=t(8),d=t(52),m=t.n(d);var v=function(){return m()(),null},p=t(22),h=s.a.ProductListProvider,g="home_shelf";function O(e){var n=e.children,t=e.products,c=e.ProductSummary,a=e.listName,l=e.actionOnProductClick,s=e.preferredSKU,d=o()().list,m=Object(f.useTreePath)().treePath,v=Object(r.useMemo)((function(){var e=null==t?void 0:t.map((function(e,n){var t=Object(p.b)(e,s),r=d.length+n+1,u=function(){"function"==typeof l&&l(t,{position:r})};return"function"==typeof c?i.a.createElement(c,{key:t.cacheId,product:t,listName:a,actionOnClick:u,position:r,placement:g}):i.a.createElement(f.ExtensionPoint,{id:"product-summary",key:e.cacheId,treePath:m,product:t,listName:a,actionOnClick:u,position:r,placement:g})}));return d.concat(null!=e?e:[])}),[t,d,s,c,m,a,l]);return i.a.createElement(u.a,{list:v},n)}n.default=function(e){var n=e.children,t=e.products,r=e.listName,c=e.ProductSummary,u=e.actionOnProductClick,a=e.preferredSKU;return i.a.createElement(h,{listName:null!=r?r:""},i.a.createElement(O,{preferredSKU:a,products:t,listName:r,ProductSummary:c,actionOnProductClick:u},n),i.a.createElement(v,null))}}}]); },function(){ (window.webpackJsonpvtex_product_summary_2_90_2=window.webpackJsonpvtex_product_summary_2_90_2||[]).push([["ProductSummaryList"],{0:function(t,e){t.exports=React},109:function(t,e,r){"use strict";r.r(e);var i=r(31),o=r.n(i),n=r(36),a=r(10),s=r(0),u=r.n(s),d=r(29),c=r(70),m=r.n(c),p=r(71),l=r.n(p),y=r(72),S=r.n(y),_=r(2),v=r(8),E=r(49),L=function(){var t=Object(v.useRuntime)().rootPath;return{getShippingOptionFromSession:Object(s.useCallback)(Object(n.a)(o.a.mark((function e(){var r,i,n,a,s,u,d,c;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(s=new Headers).append("Content-Type","application/json"),u={method:"GET",headers:s,redirect:"follow"},e.next=5,fetch("".concat(null!=t?t:"","/api/sessions?items=public.shippingOption"),u);case 5:return d=e.sent,e.next=8,d.json();case 8:if(c=e.sent,null===(n=null===(i=null===(r=null==c?void 0:c.namespaces)||void 0===r?void 0:r.public)||void 0===i?void 0:i.shippingOption)||void 0===n?void 0:n.value){e.next=11;break}return e.abrupt("return",null);case 11:return e.abrupt("return",null===(a=JSON.parse(c.namespaces.public.shippingOption.value))||void 0===a?void 0:a.map((function(t){return t.value})));case 12:case"end":return e.stop()}}),e)}))),[t])}},f={RELEVANCE:{name:"admin/editor.productSummaryList.orderType.relevance",value:""},TOP_SALE_DESC:{name:"admin/editor.productSummaryList.orderType.sales",value:"OrderByTopSaleDESC"},PRICE_DESC:{name:"admin/editor.productSummaryList.orderType.priceDesc",value:"OrderByPriceDESC"},PRICE_ASC:{name:"admin/editor.productSummaryList.orderType.priceAsc",value:"OrderByPriceASC"},NAME_ASC:{name:"admin/editor.productSummaryList.orderType.nameAsc",value:"OrderByNameASC"},NAME_DESC:{name:"admin/editor.productSummaryList.orderType.nameDesc",value:"OrderByNameDESC"},RELEASE_DATE_DESC:{name:"admin/editor.productSummaryList.orderType.releaseDate",value:"OrderByReleaseDateDESC"},BEST_DISCOUNT_DESC:{name:"admin/editor.productSummaryList.orderType.discount",value:"OrderByBestDiscountDESC"}};function x(t){if(!v.canUseDOM)return null;for(var e="".concat(t,"="),r=decodeURIComponent(document.cookie).split(";"),i=0;i0?o.sku.seller=null!==(n=o.sku.sellers.find((function(e){return e.sellerDefault})))&&void 0!==n?n:o.sku.sellers[0]:o.sku.seller={commertialOffer:{Price:0,ListPrice:0}},o.sku.image=t.sku.image,r(o)}}})},N=n(38),S=n.n(N),R=n(61),T=n.n(R),j=g.a.useProductSummaryDispatch;var k=function(){var e,t=(null!==(e=S()())&&void 0!==e?e:{}).selectedItem,n=j(),r=T()();return function(e){var i=t&&e.items.find((function(e){return e.itemId===t.itemId}));n({type:"SET_PRODUCT",args:{product:e}}),null==r||r({type:"SET_PRODUCT",args:{product:e}}),null==r||r({type:"SET_SELECTED_ITEM",args:{item:i}})}};var L=function(e){var t=e.product,n=e.inView,r=e.children,i=e.priceBehavior,a=g.a.useProductSummaryDispatch(),o=k();return C({product:t,inView:n,priceBehavior:i,onError:function(){a({type:"SET_PRICE_LOADING",args:{isPriceLoading:!1}})},onComplete:function(e){o(e),a({type:"SET_PRICE_LOADING",args:{isPriceLoading:!1}})}}),c.a.createElement(c.a.Fragment,null,r)},D=n(32),w=n.n(D),A=["sponsoredBadgeContainer","sponsoredBadgeText"],M=function(e){var t=e.label,n=void 0===t?"store/sponsoredBadge.title":t,r=s()(A).handles,i=a()(r.sponsoredBadgeContainer,"absolute z-1"),o=a()(r.sponsoredBadgeText,"c-muted-1 t-mini-s");return c.a.createElement("div",{className:i},c.a.createElement("span",{className:o},c.a.createElement(w.a,{id:n})))},B=function(e){var t,n=e.product,r=e.position,i=e.placement;if(!(null===(t=n.advertisement)||void 0===t?void 0:t.adId))return{};var a=n.productId,o=n.productName,c=n.advertisement;return{"data-van-prod-id":a,"data-van-prod-name":o,"data-van-position":r,"data-van-aid":c.adId,"data-van-cid":c.campaignId,"data-van-req-id":c.adRequestId,"data-van-res-id":c.adResponseId,"data-van-cpc":c.actionCost,"data-van-placement":i}},V=n(22),U=n(39),H=g.a.ProductSummaryProvider,q=g.a.useProductSummaryDispatch,Q=g.a.useProductSummary,W=["container","containerNormal","element","clearLink"];function F(e){var t,n,i=e.product,u=e.actionOnClick,l=e.children,m=e.href,p=e.priceBehavior,_=void 0===p?"default":p,g=e.placement,h=e.position,x=e.classes,b=Q(),I=b.isLoading,P=b.isHovering,y=b.selectedItem,C=b.listName,N=b.query,S=b.inView,R=b.sponsoredBadge,T=q(),j=s()(W,{classes:x}).handles,k=v.a.useProductListDispatch(),D=v.a.useProductListState(),w="autocomplete-result-list"===(null==D?void 0:D.listName),A=Object(o.useRef)(null),V=Object(o.useCallback)((function(){null==k||k({type:"SEND_IMPRESSION",args:{product:i,position:h}}),T({type:"SET_IN_VIEW",args:{inView:!0}})}),[T,k,i,h]);d()({ref:A,once:!0,onView:V}),Object(o.useEffect)((function(){i&&T({type:"SET_PRODUCT",args:{product:i}})}),[i,T]),Object(o.useEffect)((function(){h&&T({type:"SET_POSITION",args:{position:h}})}),[h,T]);var H=Object(o.useCallback)((function(){T({type:"SET_HOVER",args:{isHovering:!1}})}),[T]),F=Object(o.useCallback)((function(){T({type:"SET_HOVER",args:{isHovering:!0}})}),[T]),G=Object(o.useCallback)((function(e){T({type:"SET_LOADING",args:{isLoading:e}})}),[T]),J=Object(o.useMemo)((function(){return{product:i,isLoading:I,isHovering:P,handleItemsStateUpdate:G}}),[i,I,P,G]),z=a()(j.container,j.containerNormal,"overflow-hidden br3 h-100 w-100 flex flex-column justify-between center tc"),K=a()(j.element,"pointer pt3 pb4 flex flex-column h-100"),X=a()(j.clearLink,"h-100 flex flex-column"),Y=null!==(t=null==y?void 0:y.itemId)&&void 0!==t?t:null===(n=null==i?void 0:i.sku)||void 0===n?void 0:n.itemId,Z=m?{to:m,onClick:w?u:void 0,onClickCapture:w?void 0:u}:{page:"store.product",params:{slug:null==i?void 0:i.linkText,id:null==i?void 0:i.productId,__listName:C},query:N,onClick:w?u:void 0,onClickCapture:w?void 0:u},$=B({product:i,position:h,placement:g}),ee=Object(U.a)(i,null==R?void 0:R.position,"containerTopLeft");return c.a.createElement(O.default.Provider,{value:J},c.a.createElement(f.a,{product:i,query:{skuId:Y}},c.a.createElement(L,{product:i,inView:S,priceBehavior:_},c.a.createElement("section",Object(r.a)({className:z,onMouseEnter:F,onMouseLeave:H,style:{maxWidth:300},ref:A},$),c.a.createElement(E.Link,Object(r.a)({className:X},Z),c.a.createElement("article",{className:K},ee?c.a.createElement(M,{label:null==R?void 0:R.label}):null,l))))))}function G(e){var t=e.product,n=e.actionOnClick,r=e.href,i=e.priceBehavior,a=void 0===i?"default":i,o=e.trackListName,u=void 0===o||o,s=e.listName,l=e.position,d=e.sponsoredBadgePosition,m=e.sponsoredBadgeLabel,f=e.placement,p=e.classes,v=e.children,_={position:d,label:m};return c.a.createElement(H,{product:t,listName:u?s:void 0,sponsoredBadge:_,isPriceLoading:"async"===a||"asyncOnly1P"===a},c.a.createElement(F,{product:t,href:r,actionOnClick:n,priceBehavior:a,position:l,placement:f,classes:p},v))}G.schema={title:"admin/editor.productSummary.title",description:"admin/editor.productSummary.description"},G.mapCatalogProductToProductSummary=V.b;t.default=G},19:function(e,t,n){"use strict";function r(e){if(e&&0!==e.length){var t=e.find((function(e){return e.sellerDefault}));return t||e[0]}}n.d(t,"a",(function(){return r}))},21:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-list-context@0.x/ProductListContext"]},22:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return x}));var r=n(10),i=n(37),a=n(19),o=new RegExp(/.+ids\/(\d+)/),c=new RegExp(/http:\/\//);function u(e,t,n){if(!e.includes("/arquivos/ids/"))return e;var r=function(e){var t,n,r,i,a=o.exec(e),c=(n="v",null===(i=null!==(r=null==(t=e)?void 0:t.split("".concat(n,"="))[1])&&void 0!==r?r:"")||void 0===i?void 0:i.split("&")[0]);return a&&a.length>0?{cleanUrl:a[0],vParam:c}:{cleanUrl:e}}(e),i=r.vParam,a=r.cleanUrl;return i?"".concat(a,"-").concat(t,"-").concat(n,"?v=").concat(i):"".concat(a,"-").concat(t,"-").concat(n)}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"auto";if(e){"number"==typeof t&&(t=Math.min(t,3e3)),"number"==typeof n&&(n=Math.min(n,4e3));var r=u(e,t,n),i=r.includes("?")?"&":"?";return"".concat(r).concat(i,"width=").concat(t,"&height=").concat(n,"&aspect=true")}}function l(e){return e.commertialOffer.Price}function d(e){var t=e.commertialOffer.AvailableQuantity;return null!=t&&t>0}function m(e,t){var n=e.filter(p);if(0===n.length)return e[0];if(1===n.length)return n[0];var r=n.map((function(e){return function(e,t){var n=e.sellers;if(1===n.length)return n[0].commertialOffer.Price;var r=n.filter(d).map(l);return"highest"===t?r.reduce((function(e,t){return t>e?t:e})):r.reduce((function(e,t){return tr[e]?n:e}),0):r.reduce((function(e,t,n){return t1&&void 0!==arguments[1]?arguments[1]:"FIRST_AVAILABLE",u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:500;if(!e)return null;var s,l=Object.assign({},e),d=l.items||[],m=l.properties||[],f=null!==(t=m.find((function(e){return"DefaultSKUSelected"===e.name})))&&void 0!==t?t:null;if(s=1===d.length?d[0]:f?v(d,f.values,c):_(d,c)){var p=null!==(n=Object(a.a)(null==s?void 0:s.sellers))&&void 0!==n?n:O,x=null!==(i=null==s?void 0:s.referenceId)&&void 0!==i?i:[],b=Object(r.a)(x,1),I=b[0],P=void 0===I?E:I,y=null!==(o=null==s?void 0:s.images)&&void 0!==o?o:[],C=y.map((function(e){return Object.assign(Object.assign({},e),{imageUrl:h(e.imageUrl,u)})})),N=Object(r.a)(C,1),S=N[0],R=void 0===S?g:S;l.sku=Object.assign(Object.assign({},s),{seller:p,referenceId:P,image:R,images:C})}return l}},29:function(e,t){e.exports=ReactApollo},32:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.native-types@0.x/IOMessage"]},38:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProduct"]},39:function(e,t,n){"use strict";t.a=function(e,t,n){var r;return!!(null===(r=null==e?void 0:e.advertisement)||void 0===r?void 0:r.adId)&&t===n}},44:function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r),a=i.a.createContext(void 0),o=a.Consumer;a.Consumer=function(e){return console.error("If you are seeing this, a component it's using ProductSummaryContext from vtex.product-summary, which is deprecated. Please see the issue https://github.com/vtex-apps/store-issues#28 on how to migrate to the new component."),i.a.createElement(o,e)},t.default=a},5:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@1.x/useCssHandles"]},58:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.on-view@1.x/useOnView"]},59:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/ProductContextProvider"]},6:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-summary-context@0.x/ProductSummaryContext"]},60:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-resources@0.x/QueryItemsWithSimulation"]},61:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProductDispatch"]},7:function(e,t){e.exports=Classnames},8:function(e,t){e.exports=__RENDER_8_RUNTIME__},85:function(e,t,n){"use strict";n.r(t),function(e){var t=n(4);n.p=Object(t.getPublicPath)("vtex.product-summary@2.90.2");var r=Object(t.register)((function(){return n(105)}),e,"vtex.product-summary@2.90.2","vtex.product-summary@2.x","ProductSummaryCustom");r.renderHotReload,r.setupHMR}.call(this,n(12)(e))}},[[85,"common"]]]); },function(){ (window.webpackJsonpvtex_product_summary_2_90_2=window.webpackJsonpvtex_product_summary_2_90_2||[]).push([[1],{68:function(e,t){function n(e,t,n){var r,o,i,s,a;function c(){var u=Date.now()-s;u=0?r=setTimeout(c,t-u):(r=null,n||(a=e.apply(i,o),i=o=null))}null==t&&(t=100);var u=function(){i=this,o=arguments,s=Date.now();var u=n&&!r;return r||(r=setTimeout(c,t)),u&&(a=e.apply(i,o),i=o=null),a};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(a=e.apply(i,o),i=o=null,clearTimeout(r),r=null)},u}n.debounce=n,e.exports=n},75:function(e,t,n){"use strict";n.d(t,"a",(function(){return w}));var r=n(0);var o=function(e,t){if(!e)throw new Error("Invariant failed")};function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(){return(s=Object.assign||function(e){for(var t=1;t=0){var i=o.thresholds.some((function(e){return o.inView?n>e:n>=e}));void 0!==t&&(i=i&&t),o.inView=i,o.callback(i,e)}}))}var v=function(e){var t,n;function c(){for(var t,n=arguments.length,r=new Array(n),o=0;o=0||(o[n]=e[n]);return o}(o,["children","as","tag","triggerOnce","threshold","root","rootMargin","onChange"]));return Object(r.createElement)(a||c||"div",s({ref:this.handleNode},u),i)},c}(r.Component);i(v,"displayName","InView"),i(v,"defaultProps",{threshold:0,triggerOnce:!1});var g={inView:!1,entry:void 0};function w(e){void 0===e&&(e={});var t=Object(r.useRef)(),n=Object(r.useState)(g),o=n[0],i=n[1],s=Object(r.useCallback)((function(n){t.current&&p(t.current),n&&d(n,(function(t,r){i({inView:t,entry:r}),t&&e.triggerOnce&&p(n)}),e),t.current=n}),[e.threshold,e.root,e.rootMargin,e.triggerOnce]);return Object(r.useEffect)((function(){t.current||o===g||e.triggerOnce||i(g)})),[s,o.inView,o.entry]}}}]); },function(){ (window.webpackJsonpvtex_product_summary_2_90_2=window.webpackJsonpvtex_product_summary_2_90_2||[]).push([["ProductSummaryLegacy"],[function(e,t){e.exports=React},function(e,t){e.exports=PropTypes},function(e,t){e.exports=R},function(e,t,a){e.exports={containerInline:"vtex-product-summary-2-x-containerInline",imageContainer:"vtex-product-summary-2-x-imageContainer",container:"vtex-product-summary-2-x-container",containerSmall:"vtex-product-summary-2-x-containerSmall",containerInlinePrice:"vtex-product-summary-2-x-containerInlinePrice",information:"vtex-product-summary-2-x-information",element:"vtex-product-summary-2-x-element",image:"vtex-product-summary-2-x-image",buyButtonContainer:"vtex-product-summary-2-x-buyButtonContainer",buyButton:"vtex-product-summary-2-x-buyButton",description:"vtex-product-summary-2-x-description",quantityStepperContainer:"vtex-product-summary-2-x-quantityStepperContainer",imageInline:"vtex-product-summary-2-x-imageInline",isHidden:"vtex-product-summary-2-x-isHidden",containerNormal:"vtex-product-summary-2-x-containerNormal",nameContainer:"vtex-product-summary-2-x-nameContainer",clearLink:"vtex-product-summary-2-x-clearLink",aspectRatio:"vtex-product-summary-2-x-aspectRatio",priceContainer:"vtex-product-summary-2-x-priceContainer",SKUSelectorContainer:"vtex-product-summary-2-x-SKUSelectorContainer",attachmentListContainer:"vtex-product-summary-2-x-attachmentListContainer",attachmentItemContainer:"vtex-product-summary-2-x-attachmentItemContainer",imageNormal:"vtex-product-summary-2-x-imageNormal",addToListBtn:"vtex-product-summary-2-x-addToListBtn",imagePlaceholder:"vtex-product-summary-2-x-imagePlaceholder",attachmentChildrenContainer:"vtex-product-summary-2-x-attachmentChildrenContainer",imageStackContainer:"vtex-product-summary-2-x-imageStackContainer",hoverEffect:"vtex-product-summary-2-x-hoverEffect",hoverImage:"vtex-product-summary-2-x-hoverImage",mainImageHovered:"vtex-product-summary-2-x-mainImageHovered",priceSpinner:"vtex-product-summary-2-x-priceSpinner",spin:"vtex-product-summary-2-x-spin",sponsoredBadgeContainer:"vtex-product-summary-2-x-sponsoredBadgeContainer",sponsoredBadgeText:"vtex-product-summary-2-x-sponsoredBadgeText"}},,function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@1.x/useCssHandles"]},,function(e,t){e.exports=Classnames},function(e,t){e.exports=__RENDER_8_RUNTIME__},,,function(e,t,a){"use strict";a.d(t,"b",(function(){return i})),a.d(t,"c",(function(){return c}));var n=a(2),r={DISPLAY_ALWAYS:{name:"admin/editor.productSummary.displayBuyButton.option.always",value:"displayButtonAlways"},DISPLAY_ON_HOVER:{name:"admin/editor.productSummary.displayBuyButton.option.hover",value:"displayButtonHover"},DISPLAY_NONE:{name:"admin/editor.productSummary.displayBuyButton.option.none",value:"displayButtonNone"}};function i(){return Object(n.map)((function(e){return e.name}),Object(n.values)(r))}function c(){return Object(n.map)((function(e){return e.value}),Object(n.values)(r))}t.a=r},,,,,function(e,t,a){"use strict";a.d(t,"a",(function(){return n}));a(2);var n={SINGLE:"SINGLE",MULTIPLE:"MULTIPLE",TOGGLE:"TOGGLE"}},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-components@3.x/ProductPrice"]},function(e,t,a){"use strict";var n=a(1),r=a.n(n),i=a(16),c=r.a.shape({item:r.a.shape({name:r.a.string.isRequired,sellingPrice:r.a.number.isRequired,quantity:r.a.number.isRequired}),normalizedQuantity:r.a.number,extraQuantity:r.a.number,choiceType:r.a.oneOf([i.a.SINGLE,i.a.MULTIPLE,i.a.TOGGLE]).isRequired}),s=r.a.shape({removedQuantity:r.a.number.isRequired,initialQuantity:r.a.number.isRequired,name:r.a.string.isRequired});r.a.shape({productId:r.a.string.isRequired,linkText:r.a.string.isRequired,productName:r.a.string.isRequired,brand:r.a.string,brandId:r.a.number,sku:r.a.shape({name:r.a.string.isRequired,itemId:r.a.string.isRequired,image:r.a.shape({imageUrl:r.a.string.isRequired,imageTag:r.a.string}).isRequired,seller:r.a.shape({sellerId:r.a.string,commertialOffer:r.a.shape({Installments:r.a.arrayOf(r.a.shape({Value:r.a.number.isRequired,InterestRate:r.a.number.isRequired,TotalValuePlusInterestRate:r.a.number,NumberOfInstallments:r.a.number.isRequired,Name:r.a.string})),Price:r.a.number.isRequired,ListPrice:r.a.number.isRequired}).isRequired}).isRequired}).isRequired,productClusters:r.a.arrayOf(r.a.shape({name:r.a.string.isRequired})),assemblyOptions:r.a.shape({added:r.a.arrayOf(c),removed:r.a.arrayOf(s),parentPrice:r.a.number}),quantity:r.a.number})},,function(e,t){e.exports=ReactIntl},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-list-context@0.x/ProductListContext"]},,,,,,function(e,t,a){"use strict";var n=a(0),r=a.n(n),i=a(20),c=a(30);a(18);t.a=Object(i.injectIntl)((function(e){var t=e.removedOptions,a=e.intl;return 0===t.length?null:r.a.createElement(n.Fragment,null,t.map((function(e){var t=function(e,t){var a=e.name,n=e.removedQuantity;if(function(e){var t=e.removedQuantity,a=e.initialQuantity;return 1===t&&t===a}(e))return t.formatMessage({id:"store/productSummary.missingOptionName"},{name:a});var r={sign:"-",name:a,quantity:n};return t.formatMessage({id:"store/productSummary.attachmentName"},r)}(e,a);return r.a.createElement(c.a,{productText:t,key:t})})))}))},function(e,t,a){"use strict";var n=a(0),r=a.n(n),i=a(20),c=a(30),s=a(16),o=(a(18),function(e){var t=e.addedOptions,a=e.showItemPrice;return 0===t.length?null:r.a.createElement(n.Fragment,null,t.map((function(e){var t=e.choiceType===s.a.MULTIPLE?function(e){return r.a.createElement(i.FormattedMessage,{id:"store/productSummary.attachmentName",values:{sign:"+",name:e.item.name,quantity:e.normalizedQuantity}})}(e):e.item.name;return r.a.createElement(c.a,{productText:t,price:e.item.sellingPriceWithAssemblies*e.normalizedQuantity,key:"".concat(e.item.name,"-").concat(e.choiceType),assemblyOptions:e.item.assemblyOptions,showItemPrice:a})})))});o.defaultProps={showItemPrice:!0},t.a=o},function(e,t){e.exports=ReactApollo},function(e,t,a){"use strict";var n=a(0),r=a.n(n),i=a(17),c=a.n(i),s=a(2),o=a(5),l=a.n(o),u=a(28),m=a(27),d=["attachmentChildrenContainer"],p=function(e){var t=e.addedOptions,a=e.removedOptions,n=l()(d);return 0===t.length&&0===a.length?null:r.a.createElement("div",{className:"".concat(n.attachmentChildrenContainer," ml3")},r.a.createElement(u.a,{addedOptions:t,showItemPrice:!1}),r.a.createElement(m.a,{removedOptions:a}))},f=["attachmentItemContainer","attachmentItem","attachmentItemProductText"],b=function(e){var t=e.item;return 0===e.extraQuantity&&0===t.sellingPriceWithAssemblies},h=function(e){var t=e.productText,a=e.price,n=e.assemblyOptions,i=e.showItemPrice,o=l()(f).handles,u=n&&n.added||[],m=n&&n.removed||[],d=Object(s.reject)(b,u),h=d.length>0||m.length>0?"c-on-base":"c-muted-2";return r.a.createElement("div",{className:"".concat(o.attachmentItemContainer," flex flex-column pv1")},r.a.createElement("div",{className:"".concat(o.attachmentItem," flex items-center justify-between")},r.a.createElement("span",{className:"".concat(o.attachmentItemProductText," t-small ").concat(h," tl pr3")},t),null!=a&&i&&a>0&&r.a.createElement(c.a,{sellingPrice:a,sellingPriceContainerClass:"c-on-base",sellingPriceLabelClass:"dib",sellingPriceClass:"dib t-small c-muted-2",showListPrice:!1,showLabels:!1,showInstallments:!1})),r.a.createElement(p,{addedOptions:d,removedOptions:m}))};t.a=Object(n.memo)(h)},,function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.native-types@0.x/IOMessage"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-components@3.x/ProductName"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-components@3.x/BuyButton"]},,,,,,function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-components@3.x/CollectionBadges"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-components@3.x/DiscountBadge"]},function(e,t,a){"use strict";var n=a(0),r=a.n(n);t.a=function(e){var t=e.cssHandle;return r.a.createElement("div",{className:"relative"},r.a.createElement("div",{className:"".concat(t," absolute w-100 h-100 contain bg-center")}),r.a.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":"image-placeholder"},r.a.createElement("rect",{width:"512",height:"512",fill:"#F2F2F2"}),r.a.createElement("rect",{x:"183.857",y:"180.2",width:"144.286",height:"150.474",stroke:"#CACBCC",strokeWidth:"2"}),r.a.createElement("path",{d:"M183.78 303.688H328.214",stroke:"#CACBCC",strokeWidth:"2"}),r.a.createElement("path",{d:"M205.082 279.563L223.599 240.507L242.116 260.035L269.892 220.979L306.926 279.563H205.082Z",stroke:"#CACBCC",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),r.a.createElement("path",{d:"M252.225 213.939C252.225 219.822 247.66 224.52 242.114 224.52C236.569 224.52 232.004 219.822 232.004 213.939C232.004 208.057 236.569 203.359 242.114 203.359C247.66 203.359 252.225 208.057 252.225 213.939Z",stroke:"#CACBCC",strokeWidth:"2"})))}},,,,,,,,,,,,function(e,t){e.exports=GraphQL},,function(e,t){e.exports=regeneratorRuntime},,,,,,,,function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Spinner"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/NumericStepper"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/withToast"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.pixel-manager@1.x/PixelContext"]},,,,,,,,,,,,,,,,,,,,,,function(e,t,a){"use strict";a.r(t),function(e){var t=a(4);a.p=Object(t.getPublicPath)("vtex.product-summary@2.90.2");var n=Object(t.register)((function(){return a(104)}),e,"vtex.product-summary@2.90.2","vtex.product-summary@2.x","ProductSummaryLegacy");n.renderHotReload,n.setupHMR}.call(this,a(12)(e))},,,,,,,,,,,,,,,function(e,t,a){"use strict";a.r(t);var n=a(9),r=a(10),i=a(23),c=a(24),s=a(13),o=a(26),l=a(25),u=a(15),m=a(14),d=a(0),p=a.n(d),f=a(33),b=a.n(f),h=a(17),v=a.n(h),y=a(21),O=a.n(y),x=a(75),g=a(2),C=a(7),E=a.n(C),j=a(8),P=(a(18),a(27)),N=a(28),w=a(3),I=a.n(w),_=function(e){var t=e.item;return 0===e.extraQuantity&&0===t.sellingPriceWithAssemblies},L=function(e){var t=e.product,a=Object(g.pathOr)([],["assemblyOptions","added"],t),n=Object(g.pathOr)([],["assemblyOptions","removed"],t),r=Object(g.reject)(_,a);return 0===r.length&&0===n.length?null:p.a.createElement("div",{className:"".concat(I.a.attachmentListContainer," pv2")},p.a.createElement(N.a,{addedOptions:r}),p.a.createElement(P.a,{removedOptions:n}))},R=a(40),S=a.n(R),k=a(41),B=a.n(k),M=a(42),q=function(e){var t=e.product,a=e.showBadge,n=e.badgeText,i=e.showCollections,c=e.displayMode,s=Object(d.useState)(!1),o=Object(r.a)(s,2),l=o[0],u=o[1];if(!Object(g.path)(["sku","image","imageUrl"],t)||l)return p.a.createElement(M.a,{cssHandle:I.a.imagePlaceholder});var m,f,b,h,v=t.productClusters,y=t.productName,O=t.sku.image.imageUrl,x=E()("inline"===c?I.a.imageInline:I.a.imageNormal),C=Object(g.pathOr)({},["sku","seller","commertialOffer"],t),j=(m={listPrice:C.ListPrice,price:C.Price,label:n},f=m.listPrice,b=m.price,h=m.label,function(e){return function(t){return e?p.a.createElement(B.a,{listPrice:f,sellingPrice:b,label:h},t):t}}),P=function(e){var t=e.productClusters;return function(e){return function(a){if(e&&t&&t.length>0){var n=t.map((function(e){return e.name}));return p.a.createElement(S.a,{collectionBadgesText:n},a)}return a}}}({productClusters:v}),N=p.a.createElement("img",{className:x,src:O,alt:y,onError:function(){return u(!0)}});return Object(g.compose)(j(a),P(i))(N)},D=a(34),T=a.n(D),A=a(32),U=a.n(A),H=a(11),Q=function(e){var t=e.product,a=e.displayBuyButton,n=e.isOneClickBuy,r=e.buyButtonText,i=e.isHovering,c=e.containerClass,s=Object(j.useRuntime)().hints.mobile,o=Object(g.equals)(a,H.a.DISPLAY_ALWAYS.value)||!Object(g.equals)(a,H.a.DISPLAY_ON_HOVER.value)||i&&!s,l=!(Object(g.equals)(a,H.a.DISPLAY_NONE.value)||Object(g.equals)(a,H.a.DISPLAY_ON_HOVER.value)&&s),u=E()("".concat(I.a.buyButton," center mw-100"),!o&&I.a.isHidden),m=t.sku,d=Object(g.path)(["seller"],m),f=d&&d.commertialOffer&&d.commertialOffer.AvailableQuantity>0,b=T.a.mapCatalogItemToCart({product:t,selectedItem:m,selectedSeller:d,selectedQuantity:1});return l&&p.a.createElement("div",{className:c},p.a.createElement("div",{className:u},p.a.createElement(T.a,{available:f,skuItems:b,isOneClickBuy:n},p.a.createElement(U.a,{id:r}))))},V=a(64),Y=a.n(V),W=function(e){var t=e.product,a=e.showListPrice,n=e.showLabels,r=e.showInstallments,i=e.labelSellingPrice,c=e.labelListPrice,s=e.isLoading,o=e.containerClass,l=e.sellingPriceClass,u=Object(g.path)(["sku","seller","commertialOffer"],t);if(s)return p.a.createElement("div",{className:"flex items-end justify-end w-100 h1 pr6"},p.a.createElement(Y.a,{size:20}));var m=Object(g.prop)("Price",u);return p.a.createElement("div",{className:o},0!==m&&p.a.createElement(v.a,{className:"flex flex-column justify-start",listPriceContainerClass:"pv1 normal c-muted-2",listPriceLabelClass:"dib strike t-small t-mini",listPriceClass:"dib ph2 strike t-small-ns t-mini",sellingPriceContainerClass:"pt1 pb3 c-on-base",sellingPriceLabelClass:"dib",sellingPriceClass:l,savingsContainerClass:"t-small-ns c-muted-2",savingsClass:"dib",interestRateClass:"dib pl2",installmentContainerClass:"t-small-ns c-muted-2",listPrice:Object(g.prop)("ListPrice",u),sellingPrice:Object(g.prop)("Price",u),installments:Object(g.prop)("Installments",u),showListPrice:a,showLabels:n,showInstallments:r,labelSellingPrice:i,labelListPrice:c}))},F=function(e){var t=e.product,a=e.showFieldsProps,r=e.containerClass,i=e.brandNameClass,c=e.skuNameClass,s=Object(g.path)(["productName"],t),o=Object(g.path)(["sku","name"],t),l=Object(g.path)(["brand"],t);return p.a.createElement("div",{className:r},p.a.createElement(b.a,Object(n.a)({className:"overflow-hidden c-on-base",brandNameClass:i,skuNameClass:c,loaderClass:"pt5 overflow-hidden",name:s,skuName:o,brandName:l},a)))},G=function(e){var t=e.descriptionClasses,a=e.description;if(!a)return p.a.createElement(d.Fragment,null);var n=a.length>120?"".concat(a.substring(0,120),"..."):a;return p.a.createElement("span",{className:t},n)};function z(e){var t=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(e){return!1}}();return function(){var a,n=Object(u.a)(e);if(t){var r=Object(u.a)(this).constructor;a=Reflect.construct(n,arguments,r)}else a=n.apply(this,arguments);return Object(l.a)(this,a)}}var $=function(e){Object(o.a)(a,e);var t=z(a);function a(){return Object(i.a)(this,a),t.apply(this,arguments)}return Object(c.a)(a,[{key:"render",value:function(){var e=this.props,t=e.product,a=e.showBorders,r=e.showDescription,i=e.handleMouseEnter,c=e.handleMouseLeave,s=e.actionOnClick,o=e.imageProps,l=e.nameProps,u=e.priceProps,m=e.buyButtonProps,d=e.inViewRef,f=e.listName,b=E()(I.a.container,I.a.containerNormal,"overflow-hidden br3 h-100 w-100 flex flex-column justify-between center tc"),h="".concat(I.a.element," pointer pt3 pb4 flex flex-column h-100")+(a?" bb b--muted-4 mh2 mt2":""),v={containerClass:"flex items-start ".concat(I.a.nameContainer," justify-center pv6"),brandNameClass:"t-body"},y={containerClass:"flex flex-column justify-end items-center relative"+(a?"":" ".concat(I.a.priceContainer," pv5")),sellingPriceClass:"dib ph2 t-body t-heading-5-ns"},O={containerClass:"".concat(I.a.buyButtonContainer," pv3 w-100 db")},x="".concat(I.a.description," c-muted-2 t-small");return p.a.createElement("section",{className:b,onMouseEnter:i,onMouseLeave:c,ref:d},p.a.createElement("div",{className:"".concat(I.a.addToListBtn," absolute z-1 mt3")},p.a.createElement(j.ExtensionPoint,{id:"addon-summary-btn",product:{skuId:Object(g.path)(["sku","itemId"],t),productId:Object(g.path)(["productId"],t),quantity:1}})),p.a.createElement(j.Link,{className:"".concat(I.a.clearLink," h-100 flex flex-column"),page:"store.product",params:{slug:t&&t.linkText,id:t&&t.productId,__listName:f},onClick:s},p.a.createElement("article",{className:h},p.a.createElement("div",{className:"".concat(I.a.imageContainer," db w-100 center")},p.a.createElement(q,o)),p.a.createElement("div",{className:"".concat(I.a.information," h-100 flex flex-column justify-between")},p.a.createElement(F,Object(n.a)({},l,v)),p.a.createElement(L,{product:t}),r&&p.a.createElement(G,{description:t.description,descriptionClasses:x}),p.a.createElement("div",null,p.a.createElement(W,Object(n.a)({},u,y))))),p.a.createElement(Q,Object(n.a)({},m,O))))}}]),a}(d.Component);function J(e){var t=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(e){return!1}}();return function(){var a,n=Object(u.a)(e);if(t){var r=Object(u.a)(this).constructor;a=Reflect.construct(n,arguments,r)}else a=n.apply(this,arguments);return Object(l.a)(this,a)}}var K=function(e){Object(o.a)(a,e);var t=J(a);function a(){return Object(i.a)(this,a),t.apply(this,arguments)}return Object(c.a)(a,[{key:"render",value:function(){var e=this.props,t=e.product,a=e.showBorders,r=e.handleMouseEnter,i=e.handleMouseLeave,c=e.actionOnClick,s=e.imageProps,o=e.nameProps,l=e.priceProps,u=e.buyButtonProps,m=e.inViewRef,d=e.listName,f=E()(I.a.container,I.a.containerSmall,"overflow-hidden br3 h-100 flex flex-column justify-between center tc"),b=E()(I.a.element,"pointer pt3 pb4 flex flex-column",a&&"bb b--muted-4 mh2 mt2"),h={containerClass:"flex items-start ".concat(I.a.nameContainer," justify-center pv5 t-mini pb2"),brandNameClass:"t-body t-mini"},v={containerClass:"flex flex-column justify-end items-center"+(a?"":" ".concat(I.a.priceContainer," pv5")),sellingPriceClass:"dib ph2 t-body t-heading-5-ns"},y={containerClass:"".concat(I.a.buyButtonContainer," pv3 w-100 dn")};return p.a.createElement("section",{className:f,onMouseEnter:r,onMouseLeave:i,ref:m},p.a.createElement(j.Link,{className:"".concat(I.a.clearLink," flex flex-column"),page:"store.product",params:{slug:Object(g.path)(["linkText"],t),__listName:d},onClick:c},p.a.createElement("article",{className:b},p.a.createElement("div",{className:"".concat(I.a.imageContainer," db w-100 center")},p.a.createElement(q,s)),p.a.createElement("div",{className:I.a.information},p.a.createElement(F,Object(n.a)({},o,h)),p.a.createElement(L,{product:t}),p.a.createElement("div",null,p.a.createElement(W,Object(n.a)({},l,v))))),p.a.createElement(Q,Object(n.a)({},u,y))))}}]),a}(d.Component);function Z(e){var t=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(e){return!1}}();return function(){var a,n=Object(u.a)(e);if(t){var r=Object(u.a)(this).constructor;a=Reflect.construct(n,arguments,r)}else a=n.apply(this,arguments);return Object(l.a)(this,a)}}var X=function(e){Object(o.a)(a,e);var t=Z(a);function a(){return Object(i.a)(this,a),t.apply(this,arguments)}return Object(c.a)(a,[{key:"render",value:function(){var e=this.props,t=e.product,a=e.showBorders,r=e.handleMouseEnter,i=e.handleMouseLeave,c=e.actionOnClick,s=e.imageProps,o=e.nameProps,l=e.priceProps,u=e.buyButtonProps,m=e.inViewRef,d=e.listName,f=E()(I.a.container,I.a.containerInlinePrice,"overflow-hidden br3 h-100 w-100"),b="".concat(I.a.element," ").concat(I.a.clearLink," pointer pt3 pb4 flex flex-column")+(a?" bb b--muted-4 mh2 mh3-ns mt2":""),h={containerClass:"flex flex-column nr1"+(a?"":" ".concat(I.a.priceContainer)),sellingPriceClass:"dib ph2 t-body t-heading-5-ns"},v={containerClass:"".concat(I.a.buyButtonContainer," pt3 w-100")};return p.a.createElement("section",{className:f,onMouseEnter:r,onMouseLeave:i,ref:m},p.a.createElement(j.Link,{className:b,page:"store.product",params:{slug:t&&t.linkText,id:t&&t.productId,__listName:d},onClick:c},p.a.createElement("article",{className:"flex"},p.a.createElement("div",{className:"".concat(I.a.imageContainer," db w-70")},p.a.createElement(q,s)),p.a.createElement("div",{className:"".concat(I.a.information," w-80 pb2 pl3 flex flex-wrap flex-column justify-between")},p.a.createElement("div",{className:"flex flex-column"},p.a.createElement(F,Object(n.a)({},o,{containerClass:"flex items-start justify-left tl w-90 t-mini pb2",brandNameClass:"t-body c-on-base"})),p.a.createElement(L,{product:t}),p.a.createElement("div",{className:"nr2"},p.a.createElement(W,Object(n.a)({},l,h)))),p.a.createElement("div",{className:"flex flex-column-reverse"},p.a.createElement(Q,Object(n.a)({},u,v)))))))}}]),a}(d.Component),ee=a(31),te=a.n(ee),ae=a(36),ne=a(65),re=a.n(ne),ie=a(66),ce=a.n(ie),se=a(67),oe=a(68),le=a(20),ue=a(29),me=a(54),de=a(69);function pe(e){var t=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(e){return!1}}();return function(){var a,n=Object(u.a)(e);if(t){var r=Object(u.a)(this).constructor;a=Reflect.construct(n,arguments,r)}else a=n.apply(this,arguments);return Object(l.a)(this,a)}}var fe=Object(me.parse)("\n mutation updateItems($items: [MinicartItem]) {\n updateItems(items: $items) @client\n }\n"),be=Object(me.parse)("\n mutation updateLocalItems($items: [MinicartItem]) {\n updateLocalItems(items: $items) @client\n }\n"),he=function(e){Object(o.a)(a,e);var t=pe(a);function a(){var e;Object(i.a)(this,a);for(var n=arguments.length,r=new Array(n),c=0;c3&&void 0!==arguments[3]?arguments[3]:"/",i="";if(n&&n>0){var o=new Date;o.setTime((new Date).getTime()+n),i="expires=".concat(o.toUTCString(),";")}document.cookie="".concat(e,"=").concat(encodeURIComponent(t),";").concat(i,"path=").concat(r)}var f=function(){function e(t){Object(a.a)(this,e),this.client=t,this.historyKey="biggy-search-history"}var t,n,r;return Object(s.a)(e,[{key:"topSearches",value:(r=Object(o.a)(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.client.query({query:d.a}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"suggestionSearches",value:(n=Object(o.a)(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.client.query({query:p.a,variables:{fullText:t}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"suggestionProducts",value:(t=Object(o.a)(i.a.mark((function e(t,n,r){var o,a,s,c,l,p,m,d=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=d.length>3&&void 0!==d[3]&&d[3],a=d.length>4&&void 0!==d[4]?d[4]:"default",s=d.length>5&&void 0!==d[5]&&d[5],c=d.length>6?d[6]:void 0,l=d.length>7?d[7]:void 0,p=d.length>8?d[8]:void 0,m=d.length>9?d[9]:void 0,e.abrupt("return",this.client.query({query:u.a,variables:{simulationBehavior:a,advertisementOptions:m,hideUnavailableItems:s,orderBy:c,fullText:t,facetKey:n,facetValue:r,productOriginVtex:o,count:l,shippingOptions:p,variant:h("sp-variant")},fetchPolicy:"network-only"}));case 8:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"searchHistory",value:function(){return(h(this.historyKey)||"").split(",").filter((function(e){return!!e}))}},{key:"prependSearchHistory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(null!=e&&""!==e.trim()){var n=this.searchHistory();n.indexOf(e)<0&&(n.unshift(e),n=n.slice(0,t)),v(this.historyKey,n.join(","))}}}]),e}()},,,function(e,t){e.exports=regeneratorRuntime},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/IconClose"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/IconClock"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-list-context@0.x/ProductListContext"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.device-detector@0.x/withDevice"]},function(e,t){function n(e,t,n){var r,i,o,a,s;function c(){var u=Date.now()-a;u=0?r=setTimeout(c,t-u):(r=null,n||(s=e.apply(o,i),o=i=null))}null==t&&(t=100);var u=function(){o=this,i=arguments,a=Date.now();var u=n&&!r;return r||(r=setTimeout(c,t)),u&&(s=e.apply(o,i),o=i=null),s};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(s=e.apply(o,i),o=i=null,clearTimeout(r),r=null)},u}n.debounce=n,e.exports=n},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.pixel-manager@1.x/PixelContext"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Spinner"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-summary@2.x/ProductSummaryCustom"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-price@1.x/SellingPrice"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-price@1.x/ListPrice"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/ProductContextProvider"]},,,,,function(e,t,n){"use strict";n.r(t),function(e){var t=n(4);n.p=Object(t.getPublicPath)("vtex.search@2.18.1");var r=Object(t.register)((function(){return n(46)}),e,"vtex.search@2.18.1","vtex.search@2.x","Autocomplete");r.renderHotReload,r.setupHMR}.call(this,n(16)(e))},,,,,,function(e,t,n){"use strict";n.r(t);var r=n(1),i=n.n(r),o=n(5),a=n(9),s=n(10),c=n(23),u=n(22),l=n(13),p=n(0),m=n.n(p),d=n(7),h=n(3),v=n(25),f=n.n(v),g=n(26),x=n.n(g),y=n(27),E=n.n(y),_=n(28),b=n.n(_),k=n(29),S=n.n(k),L=n(30),O=n(21),P=n(14),N=n.n(P),T=n(2),w=n(31),C=n.n(w),I=n(32),M=n.n(I),R=n(11),H=n.n(R),j=n(33),D=n.n(j),F=n(34),V=n.n(F),q=n(35),A=n.n(q),W=n(12),U=n.n(W),B=function(e){var t,n,r,i,o=e.product,a=e.onClick,s=null==o?void 0:o.sku,c=null===(r=null===(n=null===(t=null==s?void 0:s.sellers)||void 0===t?void 0:t[0])||void 0===n?void 0:n.commertialOffer)||void 0===r?void 0:r.taxPercentage;return m.a.createElement("div",null,m.a.createElement(T.Link,{params:{slug:null==o?void 0:o.linkText,id:null==o?void 0:o.productId},page:"store.product",className:"no-underline",onClick:a},m.a.createElement("article",{className:"".concat(U.a.element," flex flex-row justify-start items-center pa3 bg-animate hover-bg-light-gray")},m.a.createElement("div",{className:"".concat(U.a.imageContainer," h3")},m.a.createElement("img",{className:"".concat(U.a.image," h-100 w-auto mw-none"),src:null===(i=null==s?void 0:s.image)||void 0===i?void 0:i.imageUrl})),m.a.createElement("div",{className:"".concat(U.a.information," flex flex-column justify-between items-start ml4")},m.a.createElement("div",{className:U.a.productNameContainer},m.a.createElement("span",{className:"".concat(U.a.productBrand," f5 c-on-base")},o.productName)),m.a.createElement("div",{className:U.a.priceContainer},m.a.createElement(A.a,{product:o,query:{skuId:null==s?void 0:s.itemId}},m.a.createElement("span",{className:"db f7 c-muted-2"},m.a.createElement(V.a,{message:c?"{listPriceWithTax}":"{listPriceValue}"})),m.a.createElement("span",{className:"dib t-small c-muted-2"},m.a.createElement(D.a,{message:c?"{sellingPriceWithTax}":"{sellingPriceValue}"}))))))))},z=function(e){var t=e.term,n=e.title,r=e.products,i=e.showTitle,o=e.totalProducts,a=e.layout,s=e.isLoading,c=e.onProductClick,u=e.onSeeAllClick,l=e.HorizontalProductSummary,p=e.customPage;return 0!==r.length||s?m.a.createElement("section",{className:H.a.tileList},i?m.a.createElement("p",{className:"".concat(H.a.tileListTitle," c-on-base")},n):null,s?m.a.createElement("div",{className:H.a.tileListSpinner},m.a.createElement(C.a,null)):m.a.createElement(m.a.Fragment,null,m.a.createElement("ul",{className:H.a.tileListList,style:{flexDirection:a===re.Horizontal?"column":"row"}},r.map((function(e,n){var r=M.a.mapCatalogProductToProductSummary(e);return m.a.createElement("li",{key:e.productId,className:H.a.tileListItem},a===re.Horizontal?l?m.a.createElement(l,{product:r,placement:"autocomplete",actionOnClick:function(){c(r.productId,n,t)}}):m.a.createElement(B,{product:r,onClick:function(){c(r.productId,n,t)}}):m.a.createElement(T.ExtensionPoint,{id:"product-summary",product:r,placement:"autocomplete",actionOnClick:function(){c(r.productId,n,t)}}))}))),m.a.createElement("footer",{className:H.a.tileListFooter},o>0?m.a.createElement(T.Link,{query:"map=ft&_q=".concat(t),params:{term:t},page:p||"store.search",className:H.a.tileListSeeMore,onClick:function(){return u(t)}},m.a.createElement(h.FormattedMessage,{id:"store/seeMore",values:{count:o}})):null))):null};var Q=n(6),K=n.n(Q),J=function(e){var t;return(null===(t=e.item)||void 0===t?void 0:t.attributes)?m.a.createElement("ul",{className:K.a.itemListSubList},e.item.attributes.map((function(t,n){return m.a.createElement("li",{key:n,className:"".concat(K.a.itemListSubItem," c-on-base pointer"),onMouseOver:function(n){return e.onMouseOver(n,t)},onFocus:function(n){return e.onMouseOver(n,t)},onMouseOut:function(){return e.onMouseOut()},onBlur:function(){return e.onMouseOut()}},m.a.createElement(T.Link,{className:"".concat(K.a.itemListSubItemLink," c-on-base"),to:"/".concat(e.item.value,"/").concat(t.value),query:"map=ft,".concat(t.key),onClick:function(){e.closeModal(),e.onItemClick(t.label,n)}},t.label))}))):null};function $(e){var t=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(e){return!1}}();return function(){var n,r=Object(l.a)(e);if(t){var i=Object(l.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(u.a)(this,n)}}var G=function(e){Object(c.a)(n,e);var t=$(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).state={currentTimeoutId:null},e.handleMouseOver=function(t,n){if(t.stopPropagation(),!e.state.currentTimeoutId){var r=setTimeout((function(){e.props.onItemHover&&e.props.onItemHover(n),e.setState({currentTimeoutId:null})}),100);e.setState({currentTimeoutId:r})}},e.handleMouseOut=function(){var t=e.state.currentTimeoutId;t&&(clearTimeout(t),e.setState({currentTimeoutId:null}))},e}return Object(s.a)(n,[{key:"render",value:function(){var e=this;if(0===this.props.items.length&&!this.props.showTitleOnEmpty)return null;var t=this.props.modifier?K.a["itemList--".concat(this.props.modifier)]:"";return p.createElement("article",{className:"".concat(K.a.itemList," ").concat(t)},this.props.showTitle?p.createElement("p",{className:"".concat(K.a.itemListTitle," c-on-base")},this.props.title):null,p.createElement("ol",{className:K.a.itemListList},this.props.items.map((function(t,n){var r;return p.createElement("li",{key:t.value,className:"".concat(K.a.itemListItem),onMouseOver:function(n){return e.handleMouseOver(n,t)},onFocus:function(n){return e.handleMouseOver(n,t)},onMouseOut:function(){return e.handleMouseOut()},onBlur:function(){return e.handleMouseOut()}},p.createElement(T.Link,{page:null!==(r=e.props.customPage)&&void 0!==r?r:"store.search",params:{term:t.value},query:"map=ft&_q=".concat(t.value),onClick:function(){return e.props.onItemClick(t.value,n)},className:K.a.itemListLink},t.icon?p.createElement("span",{className:K.a.itemListIcon},t.icon):null,t.prefix?p.createElement("span",{className:K.a.itemListPrefix},t.prefix):null,p.createElement("span",{className:"".concat(K.a.itemListLinkTitle," c-on-base")},t.label)),p.createElement(J,{item:t,onMouseOver:e.handleMouseOver,onMouseOut:e.handleMouseOut,closeModal:e.props.closeModal,onItemClick:e.props.onItemClick}))}))))}}]),n}(p.Component),X=n(36);var Z;function Y(e,t,n){return function(r,i){e({page:t,event:"autocomplete",eventType:n,search:{term:r,position:i}})}}function ee(e,t,n,r,i){try{e({event:"autocomplete",eventType:Z.Search,search:{operator:t,misspelled:n,text:decodeURI(i),match:r}})}catch(o){e({event:"autocomplete",eventType:Z.Search,search:{operator:t,misspelled:n,text:i,match:r}})}}!function(e){e.ProductClick="product_click",e.SearchSuggestionClick="search_suggestion_click",e.TopSearchClick="top_search_click",e.HistoryClick="history_click",e.Search="search",e.SeeAllClick="see_all_click"}(Z||(Z={}));var te=function(){var e=Object(o.a)(i.a.mark((function e(t){var n,r,o,a,s,c,u;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(a=new Headers).append("Content-Type","application/json"),s={method:"GET",headers:a,redirect:"follow"},e.next=5,fetch("".concat(t||"","/api/sessions?items=public.shippingOption"),s);case 5:return c=e.sent,e.next=8,c.json();case 8:if(u=e.sent,null===(o=null===(r=null===(n=null==u?void 0:u.namespaces)||void 0===n?void 0:n.public)||void 0===r?void 0:r.shippingOption)||void 0===o?void 0:o.value){e.next=11;break}return e.abrupt("return",null);case 11:return e.abrupt("return",JSON.parse(u.namespaces.public.shippingOption.value));case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function ne(e){var t=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(e){return!1}}();return function(){var n,r=Object(l.a)(e);if(t){var i=Object(l.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(u.a)(this,n)}}var re;!function(e){e.Horizontal="HORIZONTAL",e.Vertical="VERTICAL"}(re||(re={}));var ie,oe=E.a.ProductListProvider,ae=function(e){Object(c.a)(l,e);var t,n,r,u=ne(l);function l(e){var t;return Object(a.a)(this,l),(t=u.call(this,e)).state={topSearchedItems:[],history:[],products:[],suggestionItems:[],totalProducts:0,queryFromHover:{},dynamicTerm:"",isProductsLoading:!1,currentHeightWhenOpen:0},t.handleItemHover=function(e){"groupValue"in e?(t.setState({dynamicTerm:e.groupValue,queryFromHover:{key:e.key,value:e.value}}),t.updateProducts(e.groupValue)):(t.setState({dynamicTerm:e.value,queryFromHover:{key:void 0,value:void 0}}),t.updateProducts(e.value))},t.getProductLayout=function(){var e=t.props,n=e.productLayout,r=e.isMobile;return void 0!==n?n:r?re.Horizontal:re.Vertical},t.client=new O.a(t.props.client),t.autocompleteRef=m.a.createRef(),t.isIOS=navigator&&!!navigator.userAgent.match(/(iPod|iPhone|iPad)/),t}return Object(s.a)(l,[{key:"fitAutocompleteInWindow",value:function(){if(window&&this.autocompleteRef.current&&this.props.isMobile&&!this.isIOS){var e=window.innerHeight,t=this.autocompleteRef.current.getBoundingClientRect().y,n=this.autocompleteRef.current.offsetHeight,r=n-(t+n-e);this.autocompleteRef.current.style.maxHeight="".concat(r,"px")}}},{key:"addEvents",value:function(){window.addEventListener("resize",S()(this.fitAutocompleteInWindow.bind(this),100))}},{key:"componentDidMount",value:function(){this.updateTopSearches(),this.updateHistory(),this.addEvents()}},{key:"shouldUpdate",value:function(e){return e.inputValue!==this.props.inputValue||!e.isOpen&&this.props.isOpen}},{key:"addTermToHistory",value:function(){var e=window.location.href.split("_q=");if(e[1]){var t=e[1].split("&")[0];try{return this.client.prependSearchHistory(decodeURI(t))}catch(e){return this.client.prependSearchHistory(t)}}}},{key:"closeModal",value:function(){this.props.closeMenu&&this.props.closeMenu()}},{key:"componentDidUpdate",value:function(e){var t=this;if(this.shouldUpdate(e)){this.addTermToHistory(),this.fitAutocompleteInWindow();var n=this.props.inputValue;this.setState({dynamicTerm:n,queryFromHover:void 0}),null===n||""===n?(this.updateTopSearches(),this.updateHistory(),this.setState({suggestionItems:[],products:[]})):this.updateSuggestions().then((function(){return t.fitAutocompleteInWindow(),t.updateProducts(n)})).then((function(){return t.fitAutocompleteInWindow()}))}}},{key:"highlightTerm",value:function(e,t){var n=e.split(t);return m.a.createElement(m.a.Fragment,null,n.map((function(e,r){return m.a.createElement(m.a.Fragment,null,e,r!==n.length-1?m.a.createElement("span",{className:"b"},t):null)})))}},{key:"updateSuggestions",value:(r=Object(o.a)(i.a.mark((function e(){var t,n,r,o,a,s,c=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.suggestionSearches(this.props.inputValue);case 2:t=e.sent,n=t.data.autocompleteSearchSuggestions.searches,r=this.props.maxSuggestedTerms,o=void 0===r?5:r,a=n.slice(0,o).map((function(e){var t=e.attributes||[];return{term:e.term,attributes:t.map((function(t){return{label:t.labelValue,value:t.value,link:"/".concat(e.term,"/").concat(t.value,"/?map=ft,").concat(t.key),groupValue:e.term,key:t.key}}))}})),s=a.map((function(e){return{label:c.highlightTerm(e.term.toLowerCase(),c.props.inputValue.toLocaleLowerCase()),value:e.term,groupValue:e.term,link:"/".concat(e.term,"?map=ft"),attributes:e.attributes}})),this.setState({suggestionItems:s});case 8:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProducts",value:(n=Object(o.a)(i.a.mark((function e(t){var n,r,o,a,s,c,u,l,p,m,d,h,v,f,g,x,y,E,_,b,k,S;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t,o=this.props,a=o.__unstableProductOrigin,s=o.__unstableProductOriginVtex,c=void 0!==s&&s,u=o.simulationBehavior,l=void 0===u?"default":u,p=o.hideUnavailableItems,m=void 0!==p&&p,d=o.orderBy,h=this.state.queryFromHover,r){e.next=6;break}return this.setState({products:[],totalProducts:0}),e.abrupt("return");case 6:return a&&console.warn("The prop `__unstableProductOrigin` has been deprecated. Use the boolean prop `__unstableProductOriginVtex` instead."),this.setState({isProductsLoading:!0}),e.next=10,te(this.props.runtime.rootPath);case 10:return v=e.sent,f=null!==(n=null==v?void 0:v.map((function(e){return e.value})))&&void 0!==n?n:[],g={showSponsored:!0,sponsoredCount:2,repeatSponsoredProducts:!1,advertisementPlacement:"autocomplete"},e.next=15,this.client.suggestionProducts(r,h?h.key:void 0,h?h.value:void 0,"VTEX"===a||c,l,m,d,this.props.maxSuggestedProducts||3,f,g);case 15:x=e.sent,h||(y=x.data.productSuggestions,E=y.count,_=y.operator,b=y.misspelled,ee(this.props.push,_,b,E,r)),this.setState({isProductsLoading:!1}),k=x.data.productSuggestions,S=k.products.slice(0,this.getProductCount()),this.setState({products:S,totalProducts:k.count});case 21:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"updateTopSearches",value:(t=Object(o.a)(i.a.mark((function e(){var t,n,r,o,a;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.topSearches();case 2:t=e.sent,n=t.data.topSearches.searches,r=this.props.maxTopSearches,o=void 0===r?10:r,a=n.slice(0,o).map((function(e,t){return{prefix:m.a.createElement(m.a.Fragment,null,"".concat(t+1),m.a.createElement(h.FormattedMessage,{id:"store/ordinalNumber"})),value:e.term,label:e.term,link:"/".concat(e.term,"?map=ft")}})),this.setState({topSearchedItems:a});case 7:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"updateHistory",value:function(){var e=this.client.searchHistory().slice(0,this.props.maxHistory||5).map((function(e){return{label:(t=e,t.replace(/\$2F/gi,"/")),value:e,link:"/".concat(e,"?map=ft"),icon:m.a.createElement(x.a,null)};var t}));this.setState({history:e})}},{key:"renderSuggestions",value:function(){var e=this,t=!!this.state.suggestionItems&&this.state.suggestionItems.length>0,n=t?m.a.createElement(h.FormattedMessage,{id:"store/suggestions"}):m.a.createElement(h.FormattedMessage,{id:"store/emptySuggestion"});return m.a.createElement(G,{title:n,items:this.state.suggestionItems||[],modifier:"suggestion",showTitle:!t||!this.props.hideTitles,onItemHover:this.handleItemHover,showTitleOnEmpty:0!==this.props.maxSuggestedTerms,onItemClick:function(t,n){Y(e.props.push,e.props.runtime.page,Z.SearchSuggestionClick)(t,n),e.closeModal()},customPage:this.props.customPage,closeModal:function(){return e.closeModal()}})}},{key:"contentWhenQueryIsEmpty",value:function(){var e=this;return m.a.createElement("div",{className:N.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(G,{modifier:"top-search",title:m.a.createElement(h.FormattedMessage,{id:"store/topSearches"}),items:this.state.topSearchedItems||[],showTitle:!this.props.hideTitles,onItemClick:function(t,n){Y(e.props.push,e.props.runtime.page,Z.TopSearchClick)(t,n),e.closeModal()},customPage:this.props.customPage,closeModal:function(){return e.closeModal()}}):null,!this.props.isMobile||this.props.isMobile&&this.props.historyFirst?m.a.createElement(G,{modifier:"history",title:m.a.createElement(h.FormattedMessage,{id:"store/history"}),items:this.state.history||[],showTitle:!this.props.hideTitles,onItemClick:function(t,n){Y(e.props.push,e.props.runtime.page,Z.HistoryClick)(t,n),e.closeModal()},customPage:this.props.customPage,closeModal:function(){return e.closeModal()}}):null)}},{key:"contentWhenQueryIsNotEmpty",value:function(){var e=this,t=this.state,n=t.products,r=t.totalProducts,i=t.isProductsLoading,o=this.props,a=o.hideTitles,s=o.push,c=o.runtime,u=o.inputValue,l=u.replace(/\//gi,"$2F");return m.a.createElement(m.a.Fragment,null,this.renderSuggestions(),m.a.createElement(z,{term:l||"",customPage:this.props.customPage,shelfProductCount:this.getProductCount(),title:m.a.createElement(h.FormattedMessage,{id:"store/suggestedProducts",values:{term:u}}),products:n||[],showTitle:!a,totalProducts:r||0,layout:this.getProductLayout(),isLoading:i,onProductClick:function(t,n,r){!function(e,t){return function(n,r,i){return e({page:t,event:"autocomplete",eventType:Z.ProductClick,product:{productId:n,position:r},term:i})}}(s,c.page)(t,n,r),e.closeModal()},onSeeAllClick:function(t){!function(e,t){return function(n){return e({page:t,event:"autocomplete",eventType:Z.SeeAllClick,search:{term:n}})}}(s,c.page)(t),e.closeModal()},HorizontalProductSummary:this.props.HorizontalProductSummary}))}},{key:"renderContent",value:function(){var e=this.props.inputValue.trim();return e&&""!==e?this.contentWhenQueryIsNotEmpty():this.contentWhenQueryIsEmpty()}},{key:"hasContent",value:function(){var e=this.state,t=e.topSearchedItems,n=e.suggestionItems,r=e.history,i=e.products;return t.length>0||n.length>0||r.length>0||i.length>0}},{key:"getProductCount",value:function(){var e=this.props,t=e.customBreakpoints,n=e.isMobile,r=e.maxSuggestedProducts,i=void 0===r?3:r;if(!window||n||!t)return i;var o=window.innerWidth;return t.md&&t.lg&&t.xlg?o>=t.xlg.width?t.xlg.maxSuggestedProducts:o>=t.lg.width?t.lg.maxSuggestedProducts:o>=t.md.width?t.md.maxSuggestedProducts:i:i}},{key:"render",value:function(){var e=this,t=this.props.isOpen&&this.hasContent()?"":N.a["biggy-js-container--hidden"];return m.a.createElement("div",{className:N.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(N.a["biggy-autocomplete"]," ").concat(t," w-100"),style:{flexDirection:this.getProductLayout()===re.Horizontal?"column":"row"}},m.a.createElement(oe,{listName:"autocomplete-result-list"},this.renderContent(),this.props.isMobile?m.a.createElement("button",{onClick:function(){return e.closeModal()},className:N.a["close-btn"]},m.a.createElement(f.a,null)):null)))}}]),l}(m.a.Component),se=Object(L.withPixel)(b()(Object(d.withApollo)((ie=ae,function(e){return m.a.createElement(ie,Object(X.a)({},e,{runtime:Object(T.useRuntime)()}))}))));t.default=se}],[[40,"common"]]]); }], document.currentScript.dataset.index)