(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5166],{1191:function(n,e,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/marcas/[...url]",function(){return t(6797)}])},6797:function(n,e,t){"use strict";t.r(e),t.d(e,{__N_SSP:function(){return v},default:function(){return w}});var r=t(5893),a=t(9008),i=t.n(a),o=t(1163),c=t(7294),s=t(2091),l=t(7696),d=t(6042),u=t(9396),m=t(4835),p=t(80),h=t(4638),f=t(7297),x=t(7379);function g(){var n=(0,f.Z)(["\n  display: flex;\n  margin-top: 1rem;\n  flex-direction: column;\n  button.btn-fill {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    width: 100%;\n    background: none;\n    border: 1px solid #888;\n    color: #888;\n    transition: 300ms;\n    &:hover {\n      background: #888;\n      color: #fff;\n    }\n  }\n  .grid-list {\n    button {\n      display: grid;\n      grid-gap: 4px;\n      border: none;\n      background: none;\n      width: 30px;\n      height: 30px;\n    }\n    button + button {\n      margin-left: 1rem;\n    }\n    div.circle-item {\n      display: block;\n      width: 100%;\n      height: 100%;\n      background: ",";\n    }\n  }\n\n  div.filter-header {\n    > button:nth-child(1) {\n      display: none;\n    }\n  }\n\n  > div:nth-child(1) {\n    background: #fff;\n    padding: 1rem;\n    @media screen and (max-width: 768px) {\n      padding: 0;\n    }\n    button {\n      padding: 0;\n    }\n    .block-filter {\n      padding: 0.5rem 1rem;\n      border: 1px solid rgba(0, 0, 0, 0.1);\n      border-radius: 0.25rem;\n    }\n    .block-filter + .block-filter {\n      margin-top: 1rem;\n    }\n  }\n  div.list_items {\n    padding: 1.5rem;\n    display: flex;\n    flex-wrap: wrap;\n    justify-content: space-between;\n    justify-content: flex-start;\n    > div {\n      padding: 1rem;\n      display: flex;\n      flex-direction: column;\n      justify-content: flex-start;\n      width: 25%;\n    }\n  }\n  .total_products {\n    font-size: 14px;\n  }\n  button.pagination_item {\n    width: 2.5rem;\n    height: 2.5rem;\n    color: #444;\n    border-radius: 1.5rem;\n    display: flex;\n    border: none;\n    justify-content: center;\n    align-items: center;\n    background: #eee;\n    &.active {\n      background: ",";\n      color: #fff;\n    }\n    & + button {\n      margin-left: 0.4rem;\n    }\n  }\n\n  @media screen and (max-width: 768px) {\n    & {\n      grid-template-columns: 1fr;\n      div.list_items {\n        padding: 0;\n        > div {\n          width: 50%;\n        }\n      }\n      .filters {\n        position: fixed;\n        top: 0;\n        left: 0;\n        z-index: 50;\n        height: 100vh;\n        width: 100vw;\n        transition: 500ms;\n        transform: translateX(-100vh);\n        overflow: auto;\n        &.open {\n          transform: translateX(0);\n        }\n      }\n      div.filter-header {\n        > button:nth-child(1) {\n          display: block;\n          padding: 0.5rem 1rem !important;\n          border-radius: 0.45rem;\n          background: none;\n          border: 1px solid #888;\n          color: #888;\n        }\n      }\n    }\n  }\n"]);return g=function(){return n},n}var b=x.ZP.div.withConfig({componentId:"sc-9cd3ef5c-0"})(g(),function(n){return n.theme.colors.secondary},function(n){return n.theme.colors.secondary}),j=function(n){var e=n.marketplaces,t=void 0===e?[]:e,a=n.products,i=n.brands,o=n.categories,s=n.total,l=n.lastPage,f=n.query,x=n.order,g=f.page,j=f.perpage,v=f.url,w=f.brand,N=f.category,k=f.marketplace,_=(0,c.useState)({brand:w||null,marketplace:k,page:g,perpage:j,order:x||"default"}),y=_[0],C=_[1],Z=(0,c.useCallback)(function(n,e,t,r,a,i){var o=[];e!==j&&(n=1),x!==t&&(n=1),o.push("page=".concat(n)),o.push("perpage=".concat(e)),o.push("order=".concat(t)),r&&o.push("brand=".concat(r)),a&&o.push("category=".concat(a)),i&&o.push("marketplace=".concat(i)),window.location.href.indexOf("categorias")>-1?window.location.href="/categorias/".concat(v,"?").concat(o.map(function(n){return n}).join("&")):window.location.href.indexOf("marcas")>-1?window.location.href="/marcas/".concat(v,"?").concat(o.map(function(n){return n}).join("&")):window.location.href.indexOf("busca")>-1&&(window.location.href="/busca/?q=".concat(v,"&").concat(o.map(function(n){return n}).join("&")))},[]);return(0,r.jsx)(b,{children:(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"align-items-center d-flex filter-header flex-wrap justify-content-between pb-1 pt-3 pt-md-0",children:[(0,r.jsxs)("div",{className:"d-flex flex-wrap",children:[t.length>1&&(0,r.jsx)(m.Z.Group,{className:"mr-2",children:(0,r.jsxs)(m.Z.Control,{as:"select",value:k,onChange:function(n){C((0,u.Z)((0,d.Z)({},y),{marketplace:n.target.value})),Z(g,j,x,w,N,n.target.value)},children:[(0,r.jsx)("option",{value:"",children:"Vendido e entregue por"}),t.map(function(n){return(0,r.jsx)("option",{value:n.id,selected:Number(k)===n.id,children:n.name},n.id)})]})}),o.length>1&&(0,r.jsx)(m.Z.Group,{className:"mr-2",children:(0,r.jsxs)(m.Z.Control,{as:"select",onChange:function(n){""!==n.target.value&&(window.location.href.indexOf("categorias")>-1?window.location.href="/categorias/".concat(n.target.value):window.location.href.indexOf("marcas")>-1&&(window.location.href="/marcas/".concat(v,"?category=").concat(n.target.value)))},children:[(0,r.jsx)("option",{value:"",children:"Categorias"}),o.map(function(n){return(0,r.jsx)("option",{value:n.slug,selected:Number(N)===n.id,children:n.name},n.id)})]})}),i.length>1&&(0,r.jsx)(m.Z.Group,{className:"mr-2",children:(0,r.jsxs)(m.Z.Control,{as:"select",value:w,onChange:function(n){C((0,u.Z)((0,d.Z)({},y),{brand:n.target.value})),Z(g,j,x,n.target.value,N,k)},children:[(0,r.jsx)("option",{value:"",children:"Marcas"}),i.map(function(n){return(0,r.jsx)("option",{value:n.id,children:n.name},n.id)})]})})]}),(0,r.jsxs)("div",{className:"d-flex",children:[""!==x&&(0,r.jsx)(m.Z.Group,{className:"mr-2",children:(0,r.jsxs)(m.Z.Control,{as:"select",value:x,onChange:function(n){C((0,u.Z)((0,d.Z)({},y),{order:n.target.value})),Z(g,j,n.target.value,w,N,k)},children:[(0,r.jsx)("option",{value:"",children:"Ordena\xe7\xe3o"}),(0,r.jsx)("option",{value:"name",children:"Alfab\xe9tica"}),(0,r.jsx)("option",{value:"price_asc",children:"Menor Pre\xe7o"}),(0,r.jsx)("option",{value:"price_desc",children:"Maior Pre\xe7o"})]})}),(0,r.jsx)(m.Z.Group,{className:"mr-3",children:(0,r.jsxs)(m.Z.Control,{as:"select",value:j,onChange:function(n){Z(g,n.target.value,x,w,N,k)},children:[(0,r.jsx)("option",{value:"20",children:"20"}),(0,r.jsx)("option",{value:"40",children:"40"}),(0,r.jsx)("option",{value:"100",children:"100"})]})})]})]}),a.length>0&&(0,r.jsx)("div",{className:"list_items",children:a.map(function(n){return(0,r.jsx)(h.Z,{product:n},n.id)})}),0===a.length&&(0,r.jsx)("div",{className:"d-flex justify-content-center align-items-center p-5",style:{minHeight:"50vh"},children:(0,r.jsx)("h5",{children:"Nenhum produto encontrado"})}),(0,r.jsxs)("div",{className:"d-flex justify-content-between align-items-center flex-wrap pt-3 pb-5 pl-4 pr-4",style:{borderTop:"1px solid #eee"},children:[(0,r.jsxs)("div",{className:"d-flex",children:[Number(g)>2&&(0,r.jsxs)("button",{className:"pagination_item",onClick:function(){Z(1,j,x,w,N,k)},children:[(0,r.jsx)(p.sG8,{}),(0,r.jsx)(p.sG8,{style:{marginLeft:"-12px"}})]}),Number(g)>1&&(0,r.jsx)("button",{className:"pagination_item",onClick:function(){Z(Number(g)-1,j,x,w,N)},children:(0,r.jsx)(p.sG8,{})}),Number(g)-1>0&&(0,r.jsx)("button",{className:"pagination_item",onClick:function(){Z(Number(g)-1,j,x,w,N,k)},children:Number(g)-1}),(0,r.jsx)("button",{className:"pagination_item active",disabled:!0,children:g}),Number(g)+1<=l&&(0,r.jsx)("button",{className:"pagination_item",onClick:function(){Z(Number(g)+1,j,x,w,N,k)},children:Number(g)+1}),Number(l)>Number(g)&&(0,r.jsx)("button",{className:"pagination_item",onClick:function(){Z(Number(g)+1,j,x,w,N,k)},children:(0,r.jsx)(p.AeI,{})}),Number(l)-1>Number(g)&&(0,r.jsxs)("button",{className:"pagination_item",onClick:function(){Z(l,j,x,w,N,k)},children:[(0,r.jsx)(p.AeI,{}),(0,r.jsx)(p.AeI,{style:{marginLeft:"-12px"}})]})]}),(0,r.jsxs)("span",{className:"total_products",children:[s," Itens econtrados"]})]})]})})},v=!0;function w(n){var e=n.products,t=(n.category,n.total),a=n.lastPage,c=n.brand,d=n.brands,u=n.categories,m=n.query,p=n.order,h=(0,o.useRouter)();return(0,r.jsx)("div",{className:"bg-white",children:(0,r.jsxs)("div",{className:"container",children:[(0,r.jsx)(i(),{children:(0,r.jsxs)("title",{children:[null==c?void 0:c.name," - Imp\xe9rio M\xf3veis e Eletro"]})}),(0,r.jsxs)("div",{className:"p-3 ml-auto mr-auto",children:[c&&(0,r.jsxs)("ul",{className:"breadcrumb_categories",children:[(0,r.jsx)("li",{children:(0,r.jsx)("a",{href:"/",onClick:function(n){n.preventDefault(),h.push(n.currentTarget.href)},children:(0,r.jsx)(s.xng,{})})}),(0,r.jsx)("li",{children:(0,r.jsx)(l.Cs$,{})}),(0,r.jsx)("li",{children:(0,r.jsx)("a",{href:"/marcas/".concat(c.slug),onClick:function(n){n.preventDefault(),h.push(n.currentTarget.href)},children:c.name})})]}),(0,r.jsx)(j,{products:e,brands:d,categories:u,total:t,lastPage:a,query:m,order:p})]})]})})}}},function(n){n.O(0,[9317,9774,2888,179],function(){return n(n.s=1191)}),_N_E=n.O()}]);