1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2191],{42191:function(t,e,n){n.d(e,{H:function(){return E}});var o=n(85893),l=n(67294),c=n(12963),i=n(57207),r=n(84300),u=n(80490);let a=(0,l.createContext)({currentQuantity:0,getFormattedOptions:()=>[],handleSelectedProducts:()=>void 0,selectedProducts:[],resetSelectedProducts:()=>void 0}),BuildYourKitProvider=t=>{let{children:e}=t,[n,c]=(0,l.useState)([]),{items:i}=(0,u.jD)(),r=n.reduce((t,e)=>t+e.quantity,0),s=(0,l.useCallback)((t,e)=>{var o,l;let c=(null===(o=i.find(e=>e.product.code===t))||void 0===o?void 0:o.quantity)||0,r=(null===(l=n.find(e=>e.variantCode===t))||void 0===l?void 0:l.quantity)||0;return e.stockLevel-r-c},[i,n]),d=(0,l.useCallback)(t=>t.map(t=>{let{code:e,displayText:n,sellable:o,stock:l}=t,c=s(e,l),i=function(t,e){let n=t>0,o=t<=3;return o&&n?"".concat(e," - Restam ").concat(t):e}(c,n);return{value:e,label:i,isDisabled:!c||!o}}),[s]);return(0,o.jsx)(a.Provider,{value:{currentQuantity:r,getFormattedOptions:d,handleSelectedProducts:function(t){c(e=>{let n=!1,o=e.map(e=>e.code===t.code?(n=!0,{...t,quantity:e.quantity+1}):e);return n?o:[...e,t]})},selectedProducts:n,resetSelectedProducts:function(){c([])}},children:e})},useBuildYourKit=()=>(0,l.useContext)(a);var s=n(29777),d=n(62854),w=n(5632),m=n(84661),x=n(13892),_=n(18253),p=n(43550),h=n(35131),f=n(91474),S=n(21867),b=n(37340),C=n(7011),z=n(73445);function _templateObject(){let t=(0,b._)(["[&_.CustomSelect__menu]:tw-hidden"],["[&_.CustomSelect\\_\\_menu]:tw-hidden"]);return _templateObject=function(){return t},t}function _templateObject1(){let t=(0,b._)(["tw-flex-1 [&_.CustomSelect__control]:tw-h-10\n [&_.CustomSelect__option--is-disabled>div]:tw-cursor-not-allowed\n [&_.CustomSelect__option--is-disabled>div]:tw-text-zorba-dark\n [&_.CustomSelect__placeholder]:tw-p-1.5\n [&_.custom-select__label]:tw-p-2.5"],["tw-flex-1 [&_.CustomSelect\\_\\_control]:tw-h-10\n [&_.CustomSelect\\_\\_option--is-disabled>div]:tw-cursor-not-allowed\n [&_.CustomSelect\\_\\_option--is-disabled>div]:tw-text-zorba-dark\n [&_.CustomSelect\\_\\_placeholder]:tw-p-1.5\n [&_.custom-select\\_\\_label]:tw-p-2.5"]);return _templateObject1=function(){return t},t}function _templateObject2(){let t=(0,b._)(["[&_.CustomSelect__control]:tw-border-schutz-neutral-medium\n [&_.CustomSelect__option--is-disabled>div]:tw-text-schutz-neutral-medium\n [&_.CustomSelect__placeholder]:tw-text-schutz-neutral-medium tw-w-full\n tw-flex-1 [&_.CustomSelect__control]:tw-h-10\n [&_.CustomSelect__control]:tw-rounded-none\n [&_.CustomSelect__control]:tw-border-b\n [&_.CustomSelect__indicators]:tw-mx-3\n [&_.CustomSelect__option--is-disabled>div]:tw-cursor-not-allowed\n [&_.CustomSelect__placeholder]:tw-p-1.5\n [&_.CustomSelect__placeholder]:tw-text-sm\n [&_.custom-select__label]:tw-text-sm"],["[&_.CustomSelect\\_\\_control]:tw-border-schutz-neutral-medium\n [&_.CustomSelect\\_\\_option--is-disabled>div]:tw-text-schutz-neutral-medium\n [&_.CustomSelect\\_\\_placeholder]:tw-text-schutz-neutral-medium tw-w-full\n tw-flex-1 [&_.CustomSelect\\_\\_control]:tw-h-10\n [&_.CustomSelect\\_\\_control]:tw-rounded-none\n [&_.CustomSelect\\_\\_control]:tw-border-b\n [&_.CustomSelect\\_\\_indicators]:tw-mx-3\n [&_.CustomSelect\\_\\_option--is-disabled>div]:tw-cursor-not-allowed\n [&_.CustomSelect\\_\\_placeholder]:tw-p-1.5\n [&_.CustomSelect\\_\\_placeholder]:tw-text-sm\n [&_.custom-select\\_\\_label]:tw-text-sm"]);return _templateObject2=function(){return t},t}function SizeSelect(t){let{className:e,product:n,selectedOption:c,setSelectedOption:i}=t,[r,u]=(0,l.useState)(!1),[a,s]=(0,l.useState)(!1),[w,m]=(0,l.useState)([]),x=(0,l.useRef)([]),{getFormattedOptions:_}=useBuildYourKit();async function handleSelectClick(){try{if(u(!0),w.length>0){let t=_(x.current);m(t);return}let{code:t}=n,{result:e}=await z.M.getProductStock(t);if(!(null==e?void 0:e.variantOptions))return;m(_(e.variantOptions)),x.current=e.variantOptions}catch(t){console.log(t)}finally{u(!1),s(!0)}}
1let p=a?"":String.raw(_templateObject());return(0,o.jsx)(C.A,{className:(0,d.C$)({_common:"".concat(e," ").concat(p),arezzo:String.raw(_templateObject1()),schutz:String.raw(_templateObject2())}),classNamePrefix:"CustomSelect",options:w,onClick:handleSelectClick,onTouchStart:handleSelectClick,onChange:function(t){i(t),s(!1)},isSearchable:!1,isLoading:r,placeholder:"Selecione o tamanho",value:c})}let v="Limite de produtos por tamanho",g={label:"Selecione",value:""};function ProductActions(t){let[e,n]=(0,l.useState)(g),[c,u]=(0,l.useState)(""),{currentSize:a,isLimitOfProductsPerKit:s,product:w}=t,{handleSelectedProducts:m,selectedProducts:b}=useBuildYourKit(),C=(0,S.Dp)(w);(0,l.useEffect)(()=>{let t=a&&(null==e?void 0:e.value)===(null==a?void 0:a.code);(null==e?void 0:e.value)&&u(""),t&&u("")},[a,null==e?void 0:e.value]),(0,l.useEffect)(()=>{if(!a)return;let{code:t,displayText:e}=a,o=t.split("-")[0],l=o===w.code;l&&n({label:e,value:t})},[a,w.code]);let z=(0,l.useMemo)(()=>b.some(t=>{let{code:n,quantity:o}=t;return 5===o&&n===(null==e?void 0:e.value)}),[b,e]);function handleAddProductToKit(){let t=C||(null==e?void 0:e.value);if(!t){u("Selecione um tamanho antes de continuar");return}let o=C?"".concat(w.code,"-UN"):e.value;m({...w,quantity:1,variantCode:o}),u(""),n(g)}return(0,o.jsxs)("div",{className:(0,d.C$)({_common:"tw-mt-4 tw-flex tw-flex-wrap tw-items-center",arezzo:"tw-mb-6 tw-gap-x-4 tw-px-4 lg:tw-mb-10",schutz:"tw-relative tw-w-full tw-justify-between tw-gap-2"}),children:[C?null:(0,o.jsx)(SizeSelect,{className:z||c?"error":"",product:w,selectedOption:e,setSelectedOption:n}),function(){let t=C?r.vV.ICON_SIZE_SINGLE_VARIANT:r.vV.ICON_SIZE_WITH_VARIANTS;return(0,o.jsxs)(x.z,{className:(0,d.C$)({_common:"".concat(C?"tw-w-full tw-text-white tw-text-xs tw-gap-2":"tw-w-10"," tw-m-0 tw-flex tw-h-10 tw-min-h-0\n tw-items-center tw-justify-center tw-rounded-full tw-bg-black tw-p-0\n disabled:tw-bg-spanish-gray"),schutz:"tw-size-9 tw-gap-4 tw-rounded-none tw-border-none tw-text-sm"}),isDisabled:z||s,onClick:handleAddProductToKit,children:[C?"Adicionar produto":"",(0,o.jsx)(i.X,{className:(0,d.C$)({_common:"tw-text-white",arezzo:"[&>svg>circle]:tw-text-black"}),name:r.DB,size:t})]})}(),function(){let t=(0,f.k)(h.BrandId.Schutz);return c||z?t?(0,o.jsx)(_.x,{type:p.n.Error,text:c||(C?"Limite de produtos por modelo":v),iconSize:12,textClassName:"tw-text-xs tw-text-schutz-accent",className:"tw-text-schutz-accent tw-absolute -tw-bottom-5 tw-w-fit"}):(0,o.jsx)("span",{className:(0,d.C$)({_common:"tw-w-full",arezzo:"tw-h-0 tw-text-xs tw-text-upsdell-red"}),children:c||v}):null}()]})}function SelectedQuantity(t){let{product:e}=t,{selectedProducts:n}=useBuildYourKit(),l=n.find(t=>t.code===e.code);return function(){if(!l)return null;let t=function(t,e){let n=t.filter(t=>t.code===e.code);return n?n.reduce((t,e)=>t+e.quantity,0):0}(n,e);return(0,o.jsx)("span",{className:(0,d.C$)({_common:"tw-absolute tw-flex tw-items-center tw-justify-center\n tw-rounded-full tw-text-xs",arezzo:"-tw-right-2 -tw-top-2 tw-size-10 tw-bg-fruit-salad-colder\n tw-text-white lg:-tw-top-3",schutz:"tw-bg-schutz-black tw-text-schutz-white tw-right-0 tw-top-0\n tw-z-10 tw-size-9 tw-rounded-none"}),children:t})}()}function ProductSlide(t){let{product:e,...n}=t;return(0,o.jsxs)(w.q,{children:[(0,o.jsx)(m.C,{className:(0,d.C$)({arezzo:"[&>a]:tw-aspect-[12/17] tw-text-black"}),product:e,shouldRenderVideo:!1,hasFavoriteButton:!1,...n}),(0,o.jsx)(SelectedQuantity,{product:e}),(0,o.jsx)(ProductActions,{...t})]})}var N=n(61499),j=n(70697),k=n(93088),I=n(8259),T=n(22263);let A="Kit adicionado com sucesso ao carrinho";function AddKitToCart(t){let{component:e}=t,[n,c]=(0,l.useState)(!1),[a,w]=(0,l.useState)(!1),[m,S]=(0,l.useState)(!1),b=(0,f.k)(h.BrandId.Schutz),{addListToCart:C,items:z}=(0,u.jD)(),{currentQuantity:v,selectedProducts:g,resetSelectedProducts:E}=useBuildYourKit(),y=(0,s.o)(),B=(0,I.b)();(0,l.useEffect)(()=>{setTimeout(()=>{w(!1)},5e3)},[a]);let{discountPercentage:K,fixedDiscount:O,fixedValue:L,minimumNumberOfProducts:P,maximumNumberOfProducts:$,productGift:R}=e,Y=(0,l.useMemo)(()=>{let t=g.reduce((t,e)=>{var n;let o=(null===(n=e.discountPrice)||void 0===n?void 0:n.value)||e.price.value;return t+o*e.quantity},0);return K?t*((100-K)/100):O.value?t-O.value:L.value},[K,O,L.value,g]),V=T.W(Y),H=v>=P,q=H?r.l$:r.hg;async function handleAddKitToCart(){c(!0);let t=g.map(t=>({product:{...t,code:t.variantCode},quantity:t.quantity,size:t.displayText})),n=z.map(t=>y.cartEntryToProduct(t)),o=t.map(t=>{let{product:e,quantity:n,size:o}=t;return{...e,quantity:n,size:o}}),{hasError:l}=await C(t);S(l),B(function(){N.Fr.addToCart({products:o,options:{brandName:j.k}})},function(){y.addKitToCart(()=>({component:e,productsList:t,quantity:v}),[...n,...o])}),c(!1),E(),w(!l)}return(0,o.jsxs)("div",{className:"tw-mb-10 tw-flex tw-flex-col tw-items-center tw-justify-center tw-gap-2 tw-px-6",children:[(0,o.jsxs)("div",{className:(0,d.C$)({_common:"tw-flex tw-items-center tw-gap-1 tw-text-xs tw-uppercase\n tw-leading-none",arezzo:H?"tw-text-zorba-dark":"tw-text-black",schutz:"tw-items-start tw-gap-2"}),children:[H?(0,o.jsx)("span",{className:(0,d.C$)({_common:"tw-leading-normal",arezzo:"tw-text-zorba-dark",schutz:"tw-text-schutz-black tw-text-xs tw-font-medium"}),children:"Kit habilitado"}):(0,o.jsxs)("span",{className:"tw-leading-normal",children:[(0,o.jsx)("b",{children:v})," de ",(0,o.jsx)("b",{children:P})," para habilitar o kit"]}),(0,o.jsx)(i.X,{name:q,size:15})]}),function(){let t=H?R?"Adicionar kit e ganhar brinde":"Adicionar kit por ".concat(V):R?k.Wy.GIFT:K?"Adicionar kit com ".concat(K,"% de desconto"):O.formattedValue?"Adicionar kit com ".concat(O.formattedValue," de desconto"):"Adicionar kit por ".concat(null==L?void 0:L.formattedValue);return a?null:(0,o.jsx)(x.z,{className:(0,d.C$)({arezzo:"tw-m-0 tw-w-full tw-border-viridian tw-bg-viridian\n tw-uppercase disabled:tw-border-transparent disabled:tw-bg-viridian/40\n lg:tw-w-auto",schutz:"tw-text-schutz-white disabled:tw-bg-schutz-neutral-medium\n disabled:tw-text-schutz-white\n disabled:hover:tw-bg-schutz-neutral-medium tw-m-0 tw-min-h-9\n tw-border-none tw-p-2 tw-text-sm disabled:hover:tw-border-none"}),isDisabled:!H||n,isLoading:n,onClick:handleAddKitToCart,children:t})}(),function(){if(!(v>=$||m))return null;let t=m?"Erro ao adicionar seu kit ao carrinho! Tente novamente.":"Limite de produtos do kit atingido";return b?(0,o.jsx)(_.x,{type:p.n.Error,text:t,className:"tw-w-fit",textClassName:"tw-text-[9px] tw-uppercase md:tw-text-[10px]"}):(0,o.jsx)("span",{className:(0,d.C$)({_common:"tw-text-xs tw-text-red-lighter",arezzo:"tw-mt-2"}),children:t})}(),a?b?(0,o.jsx)(_.x,{type:p.n.Success,text:A,className:"tw-w-fit",textClassName:"tw-uppercase tw-text-[9px] md:tw-text-[10px]"}):(0,o.jsx)("span",{className:(0,d.C$)({_common:"tw-text-xs tw-text-viridian",arezzo:"tw-mt-2"}),children:A}):null]})}function KitInfo(t){let{component:e}=t,{description:n,kitDescription:l,title:c}=e;return(0,o.jsxs)("div",{className:(0,d.C$)({_common:"kit-description t
1w-flex tw-flex-col tw-gap-y-2 tw-px-6 lg:tw-px-8",schutz:"tw-gap-y-1 tw-text-center lg:tw-px-24"}),children:[(0,o.jsx)("h2",{className:(0,d.C$)({_common:"tw-uppercase lg:tw-text-2xl",arezzo:"tw-text-xl tw-font-light tw-tracking-widest",schutz:"tw-text-schutz-black tw-mb-4 tw-font-heading tw-text-2xl\n tw-font-bold tw-leading-8 lg:tw-text-4xl lg:tw-leading-[48px]"}),children:c}),(0,o.jsx)("p",{className:(0,d.C$)({_common:"tw-text-black",arezzo:"tw-text-base lg:tw-text-xl",schutz:"tw-text-schutz-black tw-text-xs tw-leading-[18px] lg:tw-mx-auto"}),children:n}),l?(0,o.jsx)("small",{className:(0,d.C$)({_common:"tw-block tw-text-xs tw-text-black",arezzo:"tw-pt-2",schutz:"tw-text-schutz-black tw-text-sm tw-font-semibold lg:tw-text-base"}),children:l}):null]})}let E=(0,l.memo)(function(t){let{component:e,currentSize:n,classNames:l,parentProduct:u,style:a}=t,{description:w,maximumNumberOfProducts:m,minimumNumberOfProducts:x,productList:_,title:p}=e,{currentQuantity:h}=useBuildYourKit(),f=(0,s.o)(),S=function(t){let{parentProductCode:e="",productList:n}=t;if(!e)return n;let o=n.findIndex(t=>t.code===e),l=n[o],c=[...n];return c.splice(o,1),c.unshift(l),c}({productList:_,parentProductCode:null==u?void 0:u.code}),b=h===m,C=p&&w,z=x&&m,v=(null==_?void 0:_.length)>0;return function(){if(!(C&&z&&v))return null;let s=f.getBuildYourKitAttr({component:e,isProductContainer:!1,parentProduct:u});return(0,o.jsx)(BuildYourKitProvider,{children:(0,o.jsxs)("section",{className:(0,d.C$)({_common:"tw-mt-2 tw-flex tw-flex-col tw-gap-8 lg:tw-mt-14\n lg:tw-gap-10 ".concat(l),schutz:"tw-bg-schutz-white tw-m-0 tw-gap-6 tw-pt-6 lg:tw-mt-0\n lg:tw-gap-6 lg:tw-pt-10"}),style:a,...s,children:[(0,o.jsx)(KitInfo,{component:e}),function(){let{carouselClassNames:l,carouselOptions:a}=t;return(0,o.jsx)(c.l,{className:l,options:a,renderNextButtonContent:()=>(0,o.jsx)(i.X,{name:"arrowRight",size:r.eG}),renderPrevButtonContent:()=>(0,o.jsx)(i.X,{name:"arrowLeft",size:r.eG}),children:function(){let t=f.getBuildYourKitAttr({component:e,isProductContainer:!0,parentProduct:u});return S.map(e=>{if(e)return(0,o.jsx)(ProductSlide,{currentSize:n,isLimitOfProductsPerKit:b,product:e,...t},e.code)})}()})}(),(0,o.jsx)(AddKitToCart,{component:e})]})})}()})},93088:function(t,e,n){n.d(e,{Wy:function(){return c},jL:function(){return o},vV:function(){return l}});let o={WIDTH:0,HEIGHT:0},l={ICON_SIZE_SINGLE_VARIANT:0,ICON_SIZE_WITH_VARIANTS:0},c={GIFT:"Adicionar kit com brinde"}},84300:function(t,e,n){n.d(e,{eG:function(){return u},DB:function(){return r},vV:function(){return i},jL:function(){return c},hg:function(){return a},l$:function(){return s},A0:function(){return l}});var o=n(93088);let l={HEADER:"",FOOTER:"",STYLE:"",BANNER:"",BANNER_MOBILE:"",TEXT:"",KIT_LIST:"",HEADER:"Header",FOOTER:"Footer",STYLE:"SectionSchutzCoStyleBuildYourKitList",BANNER:"SectionSchutzCoBannerBuildYourKitList",BANNER_MOBILE:"SectionSchutzCoBannerBuildYourKitListMobile",TEXT:"SectionSchutzCoTextBuildYourKitList",KIT_LIST:"SectionSchutzBuildYourKitList"},c={...o.jL,WIDTH:452,HEIGHT:452},i={...o.vV,ICON_SIZE_SINGLE_VARIANT:10,ICON_SIZE_WITH_VARIANTS:10},r="plus",u=12,a="newLock",s="newUnlock"}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.