enqueueScripts([function(){ !function(e){function n(n){for(var r,c,u=n[0],a=n[1],l=n[2],w=0,f=[];wt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}r.d(e,"a",(function(){return n}))}]); },function(){ (window.webpackJsonpcolorblue_wrapper_pdp_0_1_25=window.webpackJsonpcolorblue_wrapper_pdp_0_1_25||[]).push([[0],{13:function(e,n,i){"use strict";i.d(n,"b",(function(){return g}));var a=i(7),t=i(0),d=i.n(t),m=i(2),r=i(12),l=i.n(r),u=i(21),s=i(44),c=i.n(s),k=i(45),v=i.n(k),o=Object(t.createContext)(null),p=o.Provider,g=function(){return Object(t.useContext)(o)},N=function(e){var n=l()(),i=Object(t.useState)([]),r=Object(a.a)(i,2),s=r[0],k=r[1],o=Object(t.useState)([]),g=Object(a.a)(o,2),N=g[0],F=g[1],f=Object(t.useState)(0),S=Object(a.a)(f,2),b=S[0],y=S[1],_=Object(u.useLazyQuery)(c.a),h=Object(a.a)(_,2),O=h[0],D=h[1].data,V=Object(u.useLazyQuery)(v.a),j=Object(a.a)(V,2),I=j[0],P=j[1].data,w=Object(t.useMemo)((function(){return Object(m.pathOr)("",["product","productId"],n)}),[n]),T=Object(t.useMemo)((function(){return Object(m.pathOr)("",["type"],e)}),[e]),x=Object(t.useMemo)((function(){return Object(m.pathOr)([],["children"],e)}),[e]),A=Object(t.useMemo)((function(){return Object(m.pathOr)([],["product","categoryTree"],n).map((function(e){return e.id})).join("/")}),[n]),E=Object(t.useMemo)((function(){return Object(m.pathOr)([],["product","categoryTree"],n).map((function(e){return"c"})).join("/")}),[n]),C=Object(t.useMemo)((function(){return Object(m.pathOr)([],["product","categoryTree"],n).map((function(e){return{key:"c",value:e.id.toString()}}))}),[n]);Object(t.useEffect)((function(){T&&w&&O({variables:{field:"id",value:w,type:T}})}),[w,T]),Object(t.useEffect)((function(){A&&I({variables:{query:A,map:E,to:30,selectedFacets:C}})}),[A,E,C]),Object(t.useEffect)((function(){D&&k(Object(m.pathOr)([],["productRecommendations"],D))}),[D]),Object(t.useEffect)((function(){P&&F(Object(m.pathOr)([],["productSearch","products"],P))}),[P]),Object(t.useEffect)((function(){if(0!=N.length){var e=N.findIndex((function(e){return e.productId===w}));-1!=e&&y(e)}}),[N,w]);var q=Object(t.useMemo)((function(){return{products:s,productsDepartment:N,position:b,productId:w,setPosition:y}}),[s,N,b,w,y]);return d.a.createElement(p,{value:q},x)};N.defaultProps={type:"buy"},N.getSchema=function(){return{title:"Wrapper PDP",type:"object",properties:{type:{title:"Type",type:"string",enum:["buy","similars","view","viewAndBought","accessories","suggestions"]}}}},n.a=N},44:function(e,n){var i={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"ProductFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Product"}},directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"colorblue.wrapper-pdp@0.1.25",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cacheId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"productId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"description"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"productName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"productReference"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"linkText"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"brand"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"brandId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"link"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"categories"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"categoryId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"priceRange"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sellingPrice"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"highPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lowPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"listPrice"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"highPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lowPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"specificationGroups"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"originalName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"specifications"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"originalName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"values"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"skuSpecifications"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"originalName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"values"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"originalName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"productClusters"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"clusterHighlights"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"properties"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"values"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ItemFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SKU"}},directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"colorblue.wrapper-pdp@0.1.25",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"itemId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nameComplete"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"complementName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ean"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"variations"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"values"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"referenceId"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"Key"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"Value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"measurementUnit"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"unitMultiplier"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"images"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cacheId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageLabel"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageTag"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageText"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"SellerFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Seller"}},directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"colorblue.wrapper-pdp@0.1.25",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sellerId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sellerName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sellerDefault"},arguments:[],directives:[]}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"CommertialOfferFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Offer"}},directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"colorblue.wrapper-pdp@0.1.25",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"discountHighlights"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"teasers"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"conditions"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"minimumQuantity"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"parameters"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"effects"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"parameters"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"Price"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ListPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"Tax"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"taxPercentage"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"spotPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"PriceWithoutDiscount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"RewardValue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"PriceValidUntil"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"AvailableQuantity"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"field"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ProductUniqueIdentifierField"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"value"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"type"}},type:{kind:"NamedType",name:{kind:"Name",value:"CrossSelingInputEnum"}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"colorblue.wrapper-pdp@0.1.25",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"productRecommendations"},arguments:[{kind:"Argument",name:{kind:"Name",value:"identifier"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"field"},value:{kind:"Variable",name:{kind:"Name",value:"field"}}},{kind:"ObjectField",name:{kind:"Name",value:"value"},value:{kind:"Variable",name:{kind:"Name",value:"value"}}}]}},{kind:"Argument",name:{kind:"Name",value:"type"},value:{kind:"Variable",name:{kind:"Name",value:"type"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"2efd618e1c904d939542566694e1a5203c6a30cebec09c527b2c6b6a09485d81",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ProductFragment"},directives:[]},{kind:"Field",name:{kind:"Name",value:"items"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filter"},value:{kind:"EnumValue",value:"ALL"}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ItemFragment"},directives:[]},{kind:"Field",name:{kind:"Name",value:"sellers"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SellerFragment"},directives:[]},{kind:"Field",name:{kind:"Name",value:"commertialOffer"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"CommertialOfferFragment"},directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:2556}};i.loc.source={body:'fragment ProductFragment on Product @context(sender: "colorblue.wrapper-pdp@0.1.25") {\n cacheId\n productId\n description\n productName\n productReference\n linkText\n brand\n brandId\n link\n categories\n categoryId\n priceRange {\n sellingPrice {\n highPrice\n lowPrice\n __typename\n }\n listPrice {\n highPrice\n lowPrice\n __typename\n }\n __typename\n }\n specificationGroups {\n name\n originalName\n specifications {\n name\n originalName\n values\n __typename\n }\n __typename\n }\n skuSpecifications {\n field {\n name\n originalName\n __typename\n }\n values {\n name\n originalName\n __typename\n }\n __typename\n }\n productClusters {\n id\n name\n __typename\n }\n clusterHighlights {\n id\n name\n __typename\n }\n properties {\n name\n values\n __typename\n }\n}\n\nfragment ItemFragment on SKU @context(sender: "colorblue.wrapper-pdp@0.1.25") {\n itemId\n name\n nameComplete\n complementName\n ean\n variations {\n name\n values\n __typename\n }\n referenceId {\n Key\n Value\n __typename\n }\n measurementUnit\n unitMultiplier\n images {\n cacheId\n imageId\n imageLabel\n imageTag\n imageUrl\n imageText\n __typename\n }\n}\n\nfragment SellerFragment on Seller @context(sender: "colorblue.wrapper-pdp@0.1.25") {\n sellerId\n sellerName\n sellerDefault\n}\n\nfragment CommertialOfferFragment on Offer @context(sender: "colorblue.wrapper-pdp@0.1.25") {\n discountHighlights {\n name\n __typename\n }\n teasers {\n name\n conditions {\n minimumQuantity\n parameters {\n name\n value\n __typename\n }\n __typename\n }\n effects {\n parameters {\n name\n value\n __typename\n }\n __typename\n }\n __typename\n }\n Price\n ListPrice\n Tax\n taxPercentage\n spotPrice\n PriceWithoutDiscount\n RewardValue\n PriceValidUntil\n AvailableQuantity\n}\n\nquery ($field: ProductUniqueIdentifierField!, $value: ID!, $type: CrossSelingInputEnum) @context(sender: "colorblue.wrapper-pdp@0.1.25") {\n productRecommendations(identifier: {field: $field, value: $value}, type: $type) @runtimeMeta(hash: "2efd618e1c904d939542566694e1a5203c6a30cebec09c527b2c6b6a09485d81") {\n ...ProductFragment\n items(filter: ALL) {\n ...ItemFragment\n sellers {\n ...SellerFragment\n commertialOffer {\n ...CommertialOfferFragment\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var a={};i.definitions.forEach((function(e){if(e.name){var n=new Set;!function e(n,i){if("FragmentSpread"===n.kind)i.add(n.name.value);else if("VariableDefinition"===n.kind){var a=n.type;"NamedType"===a.kind&&i.add(a.name.value)}n.selectionSet&&n.selectionSet.selections.forEach((function(n){e(n,i)})),n.variableDefinitions&&n.variableDefinitions.forEach((function(n){e(n,i)})),n.definitions&&n.definitions.forEach((function(n){e(n,i)}))}(e,n),a[e.name.value]=n}})),e.exports=i},45:function(e,n){var i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"map"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"to"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"selectedFacets"}},type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"SelectedFacetInput"}}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"colorblue.wrapper-pdp@0.1.25",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"productSearch"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}},{kind:"Argument",name:{kind:"Name",value:"map"},value:{kind:"Variable",name:{kind:"Name",value:"map"}}},{kind:"Argument",name:{kind:"Name",value:"to"},value:{kind:"Variable",name:{kind:"Name",value:"to"}}},{kind:"Argument",name:{kind:"Name",value:"selectedFacets"},value:{kind:"Variable",name:{kind:"Name",value:"selectedFacets"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"a654797b487e98b29bf5ecc8a715abd8e7e7ec8f7509adc2a30856ee69abb361",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"products"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"linkText"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"productId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:400}};i.loc.source={body:'query ($query: String, $map: String, $to: Int, $selectedFacets: [SelectedFacetInput]) @context(sender: "colorblue.wrapper-pdp@0.1.25") {\n productSearch(query: $query, map: $map, to: $to, selectedFacets: $selectedFacets) @runtimeMeta(hash: "a654797b487e98b29bf5ecc8a715abd8e7e7ec8f7509adc2a30856ee69abb361") {\n products {\n linkText\n productId\n __typename\n }\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var a={};i.definitions.forEach((function(e){if(e.name){var n=new Set;!function e(n,i){if("FragmentSpread"===n.kind)i.add(n.name.value);else if("VariableDefinition"===n.kind){var a=n.type;"NamedType"===a.kind&&i.add(a.name.value)}n.selectionSet&&n.selectionSet.selections.forEach((function(n){e(n,i)})),n.variableDefinitions&&n.variableDefinitions.forEach((function(n){e(n,i)})),n.definitions&&n.definitions.forEach((function(n){e(n,i)}))}(e,n),a[e.name.value]=n}})),e.exports=i}}]); },function(){ (window.webpackJsonpcolorblue_wrapper_pdp_0_1_25=window.webpackJsonpcolorblue_wrapper_pdp_0_1_25||[]).push([["TagLook"],{0:function(t,e){t.exports=React},12:function(t,e){t.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProduct"]},2:function(t,e){t.exports=R},21:function(t,e){t.exports=ReactApollo},52:function(t,e,o){t.exports={tagLook:"colorblue-wrapper-pdp-0-x-tagLook"}},67:function(t,e,o){"use strict";o.r(e),function(t){var e=o(8);o.p=Object(e.getPublicPath)("colorblue.wrapper-pdp@0.1.25");var r=Object(e.register)((function(){return o(73)}),t,"colorblue.wrapper-pdp@0.1.25","colorblue.wrapper-pdp@0.x","TagLook");r.renderHotReload,r.setupHMR}.call(this,o(29)(t))},73:function(t,e,o){"use strict";o.r(e),o.d(e,"default",(function(){return s}));var r=o(7),n=o(0),c=o.n(n),u=o(52),p=o.n(u),a=o(12),i=o.n(a),l=o(2),d=o(13),s=function(){var t=i()(),e=Object(d.b)(),o=Object(n.useState)(!1),u=Object(r.a)(o,2),a=u[0],s=u[1],b=Object(n.useMemo)((function(){return Object(l.pathOr)("",["product","productId"],t)}),[t]),f=Object(n.useMemo)((function(){return Object(l.pathOr)([],["products"],e)}),[e]);return Object(n.useEffect)((function(){if(f&&b){var t=f.find((function(t){return(null==t?void 0:t.productId)===b}));s(!!t)}}),[b,f]),a?c.a.createElement("div",{className:p.a.tagLook},"LOOK"):c.a.createElement(n.Fragment,null)}}},[[67,"common",0]]]); },function(){ (window.webpackJsonpcolorblue_wrapper_pdp_0_1_25=window.webpackJsonpcolorblue_wrapper_pdp_0_1_25||[]).push([["AllDetailLink"],{0:function(t,e){t.exports=React},12:function(t,e){t.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProduct"]},2:function(t,e){t.exports=R},30:function(t,e){t.exports=__RENDER_8_RUNTIME__},43:function(t,e,r){t.exports={linkProduct:"colorblue-wrapper-pdp-0-x-linkProduct"}},56:function(t,e,r){"use strict";r.r(e),function(t){var e=r(8);r.p=Object(e.getPublicPath)("colorblue.wrapper-pdp@0.1.25");var n=Object(e.register)((function(){return r(71)}),t,"colorblue.wrapper-pdp@0.1.25","colorblue.wrapper-pdp@0.x","AllDetailLink");n.renderHotReload,n.setupHMR}.call(this,r(29)(t))},71:function(t,e,r){"use strict";r.r(e),r.d(e,"default",(function(){return d}));var n=r(0),o=r.n(n),c=r(30),p=r(12),u=r.n(p),l=r(2),i=r(43),a=r.n(i),d=function(){var t=Object(c.useRuntime)(),e=u()(),r=t.navigate,p=Object(n.useMemo)((function(){return Object(l.pathOr)("",["product","linkText"],e)}),[e]);return o.a.createElement("div",{onClick:function(){return r({to:"/".concat(p,"/p")})},className:a.a.linkProduct},"Ver más detalles del producto")}}},[[56,"common"]]]); },function(){ !function(t){function e(e){for(var r,u,a=e[0],c=e[1],l=e[2],s=0,d=[];st.length)&&(e=t.length);for(var n=0,r=new Array(e);n0;){var r=s;s=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(i){var t=a(e,i);t&&n.definitions.push(t)})),n}(n,"Profile")},,,,function(e,i,n){e.exports={iconSize:"vtex-wish-list-1-x-iconSize",fill:"vtex-wish-list-1-x-fill",outline:"vtex-wish-list-1-x-outline",clearLink:"vtex-wish-list-1-x-clearLink"}},,,,,,,,function(e,i){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/ProductContext"]},function(e,i){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Button"]},function(e,i){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/ToastContext"]},function(e,i){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"CheckItem"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopperId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"productId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sku"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.wish-list@1.18.2",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"checkList"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopperId"},value:{kind:"Variable",name:{kind:"Name",value:"shopperId"}}},{kind:"Argument",name:{kind:"Name",value:"productId"},value:{kind:"Variable",name:{kind:"Name",value:"productId"}}},{kind:"Argument",name:{kind:"Name",value:"sku"},value:{kind:"Variable",name:{kind:"Name",value:"sku"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"b83f1b8b01e40466f97a33cbb1c32b980a4c715f4e567fb79efe5c3d2ed34baf",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"inList"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"listNames"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"listIds"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"message"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:344}};n.loc.source={body:'query CheckItem($shopperId: String!, $productId: String!, $sku: String) @context(sender: "vtex.wish-list@1.18.2") {\n checkList(shopperId: $shopperId, productId: $productId, sku: $sku) @runtimeMeta(hash: "b83f1b8b01e40466f97a33cbb1c32b980a4c715f4e567fb79efe5c3d2ed34baf") {\n inList\n listNames\n listIds\n message\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var t={};function a(e,i){for(var n=0;n0;){var r=s;s=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(i){var t=a(e,i);t&&n.definitions.push(t)})),n}(n,"CheckItem")},function(e,i){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AddToList"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"listItem"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ListItemInputType"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopperId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.wish-list@1.18.2",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"996e55ed3e6fe9d4195c58f9491c5687226a5094396638fa88944a113ebc67ed",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"addToList"},arguments:[{kind:"Argument",name:{kind:"Name",value:"listItem"},value:{kind:"Variable",name:{kind:"Name",value:"listItem"}}},{kind:"Argument",name:{kind:"Name",value:"shopperId"},value:{kind:"Variable",name:{kind:"Name",value:"shopperId"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],directives:[]}]}}],loc:{start:0,end:289}};n.loc.source={body:'mutation AddToList($listItem: ListItemInputType!, $shopperId: String!, $name: String!) @context(sender: "vtex.wish-list@1.18.2") @runtimeMeta(hash: "996e55ed3e6fe9d4195c58f9491c5687226a5094396638fa88944a113ebc67ed") {\n addToList(listItem: $listItem, shopperId: $shopperId, name: $name)\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var t={};function a(e,i){for(var n=0;n0;){var r=s;s=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(i){var t=a(e,i);t&&n.definitions.push(t)})),n}(n,"AddToList")},function(e,i){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RemoveFromList"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopperId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.wish-list@1.18.2",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"9aed358e26ce21ab217ccc495a954aca608506e22f2d2d06af6051874cda8f6e",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"removeFromList"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"shopperId"},value:{kind:"Variable",name:{kind:"Name",value:"shopperId"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],directives:[]}]}}],loc:{start:0,end:265}};n.loc.source={body:'mutation RemoveFromList($shopperId: String!, $id: ID!, $name: String) @context(sender: "vtex.wish-list@1.18.2") @runtimeMeta(hash: "9aed358e26ce21ab217ccc495a954aca608506e22f2d2d06af6051874cda8f6e") {\n removeFromList(id: $id, shopperId: $shopperId, name: $name)\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var t={};function a(e,i){for(var n=0;n0;){var r=s;s=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(i){var t=a(e,i);t&&n.definitions.push(t)})),n}(n,"RemoveFromList")},,,,,,,,,,,,,,,,,,function(e,i,n){"use strict";n.r(i),function(e){var i=n(2);n.p=Object(i.getPublicPath)("vtex.wish-list@1.18.2");var t=Object(i.register)((function(){return n(48)}),e,"vtex.wish-list@1.18.2","vtex.wish-list@1.x","AddProductBtn");t.renderHotReload,t.setupHMR}.call(this,n(6)(e))},function(e,i,n){"use strict";n.r(i);var t,a,d,o,s=n(1),r=n(0),l=n.n(r),u=n(3),c=n(4),m=n(24),v=n.n(m),f=n(25),k=n.n(f),p=n(26),h=n.n(p),g=n(5),b=n(8),N=n.n(b),S=n(9),I=n.n(S),w=n(10),_=n(11),y=n(27),x=n.n(y),E=n(28),O=n.n(E),D=n(12),L=n.n(D),T=n(29),V=n.n(T),A=n(16),P=n.n(A),R=Object(_.a)((function(){return sessionStorage})),j=["wishlistIconContainer","wishlistIcon"],F=null!==(t=JSON.parse(String(R.getItem("wishlist_isAuthenticated"))))&&void 0!==t&&t,C=null!==(a=R.getItem("wishlist_shopperId"))&&void 0!==a?a:null,M=null!==(d=R.getItem("wishlist_addAfterLogin"))&&void 0!==d?d:null,$=null!==(o=JSON.parse(R.getItem("wishlist_wishlisted")))&&void 0!==o?o:[],q={},W="Wishlist",z=Object(c.defineMessages)({addButton:{id:"store/wishlist.addButton"},seeLists:{id:"store/wishlist-see-lists"},productAddedToList:{id:"store/wishlist-product-added-to-list"},addProductFail:{id:"store/wishlist-add-product-fail"},listNameDefault:{id:"store/wishlist-default-list-name"},login:{id:"store/wishlist-login"},notLogged:{id:"store/wishlist-not-logged"}}),J=function(e,i){void 0===$.find((function(n){return n.productId&&n.sku&&n.productId===e&&n.sku===i}))&&$.push({productId:e,sku:i}),Q($)},Q=function(e){return R.setItem("wishlist_wishlisted",JSON.stringify(e)),e};i.default=function(e){var i,n,t,a,d,o,m,f,p,b,S,_,y,E,D,T,A,B,G,U=e.toastURL,H=void 0===U?"/account/#wishlist":U,K=Object(c.useIntl)(),X=Object(r.useState)({isLoading:!0,isWishlistPage:null}),Y=Object(s.a)(X,2),Z=Y[0],ee=Y[1],ie=Object(u.useMutation)(V.a,{onCompleted:function(){var e=String(ke.productId).split("-"),i=Object(s.a)(e,1)[0];q[i]&&(q[i]={isWishlisted:!1,wishListId:"",sku:""}),$=$.filter((function(e){return e.productId!==i&&e.sku!==Ee})),Q($),ee(Object.assign(Object.assign({},Z),{isWishlistPage:!1}))}}),ne=Object(s.a)(ie,2),te=ne[0],ae=ne[1].loading,de=Object(g.useRuntime)(),oe=de.navigate,se=de.history,re=de.route,le=de.account,ue=I()().push,ce=N()(j),me=Object(r.useContext)(h.a).showToast,ve=Object(r.useContext)(v.a),fe=ve.selectedItem,ke=ve.product,pe=(D=Object(r.useState)(),T=Object(s.a)(D,2),A=T[0],B=T[1],G=Object(w.a)(),Object(r.useEffect)((function(){G&&G.then((function(e){var i=e.response;B(i)}))}),[G]),A),he=Object(u.useLazyQuery)(x.a),ge=Object(s.a)(he,2),be=ge[0],Ne=ge[1],Se=Ne.data,Ie=Ne.loading,we=Ne.called,_e=Object(u.useQuery)(L.a,{ssr:!1}).data,ye=String(null==ke?void 0:ke.productId).split("-"),xe=Object(s.a)(ye,1)[0],Ee=null===(i=null==ke?void 0:ke.sku)||void 0===i?void 0:i.itemId;$=null!==(n=JSON.parse(R.getItem("wishlist_wishlisted")))&&void 0!==n?n:[];var Oe=function(e,i){var n;"notLogged"===e&&(n={label:K.formatMessage(z.login),onClick:function(){var e,i;return oe({page:"store.login",query:"returnUrl=".concat(encodeURIComponent(String(null===(e=null==se?void 0:se.location)||void 0===e?void 0:e.pathname)+String(null===(i=null==se?void 0:se.location)||void 0===i?void 0:i.search)))})}}),"productAddedToList"===e&&(n={label:K.formatMessage(z.seeLists),onClick:function(){return oe({to:i,fetchPage:!0})}}),me({message:K.formatMessage(z[e]),action:n})},De=Object(u.useMutation)(O.a,{onCompleted:function(e){q[xe]={wishListId:e.addToList,isWishlisted:!0,sku:Ee},J(xe,Ee),Oe("productAddedToList",H)}}),Le=Object(s.a)(De,2),Te=Le[0],Ve=Le[1],Ae=Ve.loading;Ve.error&&Oe("addProductFail",H),pe&&(F="true"===(null===(d=null===(a=null===(t=null==pe?void 0:pe.namespaces)||void 0===t?void 0:t.profile)||void 0===a?void 0:a.isAuthenticated)||void 0===d?void 0:d.value),C=(null===(o=null==_e?void 0:_e.profile)||void 0===o?void 0:o.pii)?null!==(y=null===(_=null===(S=null===(b=null==pe?void 0:pe.namespaces)||void 0===b?void 0:b.profile)||void 0===S?void 0:S.id)||void 0===_?void 0:_.value)&&void 0!==y?y:null:null===(p=null===(f=null===(m=null==pe?void 0:pe.namespaces)||void 0===m?void 0:m.profile)||void 0===f?void 0:f.email)||void 0===p?void 0:p.value,R.setItem("wishlist_isAuthenticated",JSON.stringify(F)),R.setItem("wishlist_shopperId",String(C)),F||C||R.getItem("wishlist_wishlisted")&&R.removeItem("wishlist_wishlisted"));var Pe=Z.isWishlistPage;if(!ke)return null;null===Pe&&(null==ke?void 0:ke.wishlistPage)&&ee(Object.assign(Object.assign({},Z),{isWishlistPage:!0}));F&&ke&&!we&&C&&(F&&M&&M===xe?(Te({variables:{listItem:{productId:xe,title:ke.productName,sku:fe.itemId},shopperId:C,name:W}}),M=null,R.removeItem("wishlist_addAfterLogin")):be({variables:{shopperId:String(C),productId:xe,sku:Ee}}));var Re,je,Fe,Ce=function(){var e,i,n;return"false"!==(null===(n=null===(i=null===(e=null==pe?void 0:pe.namespaces)||void 0===e?void 0:e.profile)||void 0===i?void 0:i.isAuthenticated)||void 0===n?void 0:n.value)&&void 0!==$.find((function(e){return e.productId===xe}))};if((null===(E=null==Se?void 0:Se.checkList)||void 0===E?void 0:E.inList)&&(!q[xe]||null===q[xe].wishListId)){var Me=(Re=W,je=Se.checkList,Fe=je.listNames.findIndex((function(e){return Re===e})),je.listIds[Fe]);q[xe]={isWishlisted:Se.checkList.inList,wishListId:Me,sku:Ee},Se.checkList.inList&&void 0===$.find((function(e){return e.productId===xe&&e.sku===Ee}))&&xe&&Ee&&J(xe,Ee)}return(null==Se?void 0:Se.checkList)&&!0!==Se.checkList.inList&&void 0===q[xe]&&void 0!==$.find((function(e){return e.productId===xe&&e.sku===Ee}))&&($=$.filter((function(e){return e.productId!==xe&&e.sku!==Ee})),Q($),ee(Object.assign(Object.assign({},Z),{isWishlistPage:!1}))),l.a.createElement(g.NoSSR,null,l.a.createElement("div",{className:ce.wishlistIconContainer},l.a.createElement(k.a,{variation:"tertiary",onClick:function(e){var i;if(e.preventDefault(),e.stopPropagation(),F){var n={list:null===(i=null==re?void 0:re.canonicalPath)||void 0===i?void 0:i.replace("/",""),items:{product:ke,selectedItem:fe,account:le}};Ce()&&C?(te({variables:{id:q[xe].wishListId,shopperId:C,name:W}}),n.event="removeToWishlist"):(Te({variables:{listItem:{productId:xe,title:ke.productName,sku:fe.itemId},shopperId:C,name:W}}),n.event="addToWishlist"),ue(n)}else R.setItem("wishlist_addAfterLogin",String(xe)),Oe("notLogged",H)},isLoading:Ie||Ae||ae},l.a.createElement("span",{className:"".concat(ce.wishlistIcon," ").concat(Ce()?P.a.fill:P.a.outline," ").concat(P.a.iconSize)}))))}}],[[47,"common"]]]); },function(){ !function(e){var n={};function i(t){if(n[t])return n[t].exports;var a=n[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=e,i.c=n,i.d=function(e,n,t){i.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,n){if(1&n&&(e=i(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var a in e)i.d(t,a,function(n){return e[n]}.bind(null,a));return t},i.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(n,"a",n),n},i.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},i.p="",i(i.s=8)}([function(e,n){e.exports=React},function(e,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getPublicPath=n.register=void 0;var t="__RENDER_8_RUNTIME__",a="__RENDER_8_COMPONENTS__",r=!("undefined"==typeof window||!window.document);r&&!window.global&&(window.global=window),window[a]=window[a]||{},n.register=function(e,n,i,r,o){var d="".concat(i,"/").concat(o),c="".concat(r,"/").concat(o),l=function(){return function(e,n){try{var i=e();return i.__esModule?i.default:i.default||i}catch(e){throw new Error("An error happened while requiring the app ".concat(n,", please check your app's code.\\n").concat(e.stack))}}(e,d)};if(window[t]&&window[t].registerComponent){var u=!!window.__RENDER_LAZY__;window[t].registerComponent(n,u?l:l(),i,o,u)}else{var s=l();window[t]&&window[t].withHMR?window[a][d]=window[a][c]=window[t].withHMR(n,s):window[a][d]=window[a][c]=s}return{}},n.getPublicPath=function(e){var n=window.__hostname__,i="/_v/public/assets/v1/published/";return r&&window.__RUNTIME__&&(n=__RUNTIME__.assetServerPublishedHost||window.location.hostname,i=__RUNTIME__.assetServerPublishedPath||"/_v/public/assets/v1/published/"),"https://"+n+i+"".concat(e,"/public/react/")}},function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProduct"]},function(e,n){e.exports=ReactApollo},function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/useCssHandles"]},function(e,n){e.exports=__RENDER_8_RUNTIME__},function(e,n){e.exports=ReactIntl},function(e,n){var i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ProductRecommendations"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"identifier"}},type:{kind:"NamedType",name:{kind:"Name",value:"ProductUniqueIdentifier"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"type"}},type:{kind:"NamedType",name:{kind:"Name",value:"CrossSelingInputEnum"}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"colorblue.similar-variants@0.0.7",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"productRecommendations"},arguments:[{kind:"Argument",name:{kind:"Name",value:"identifier"},value:{kind:"Variable",name:{kind:"Name",value:"identifier"}}},{kind:"Argument",name:{kind:"Name",value:"type"},value:{kind:"Variable",name:{kind:"Name",value:"type"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"provider"},value:{kind:"StringValue",value:"vtex.search-graphql",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"e6eaac432bf49fc386ae42df61c9db781e47c394417208af5fe9a5f7476ad184",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"productId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"linkText"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"specificationGroups"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"originalName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"specifications"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"originalName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"values"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"items"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"images"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"imageLabel"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"variations"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"values"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:758}};i.loc.source={body:'query ProductRecommendations($identifier: ProductUniqueIdentifier, $type: CrossSelingInputEnum) @context(sender: "colorblue.similar-variants@0.0.7") {\n productRecommendations(identifier: $identifier, type: $type) @context(provider: "vtex.search-graphql") @runtimeMeta(hash: "e6eaac432bf49fc386ae42df61c9db781e47c394417208af5fe9a5f7476ad184") {\n productId\n linkText\n specificationGroups {\n name\n originalName\n specifications {\n name\n originalName\n values\n __typename\n }\n __typename\n }\n items {\n images {\n imageLabel\n imageUrl\n __typename\n }\n variations {\n name\n values\n __typename\n }\n __typename\n }\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var t={};function a(e,n){for(var i=0;i0;){var c=d;d=new Set,c.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){d.add(e)})))}))}return o.forEach((function(n){var t=a(e,n);t&&i.definitions.push(t)})),i}(i,"ProductRecommendations")},function(e,n,i){"use strict";i.r(n),function(e){var n=i(1);i.p=Object(n.getPublicPath)("colorblue.similar-variants@0.0.7");var t=Object(n.register)((function(){return i(10)}),e,"colorblue.similar-variants@0.0.7","colorblue.similar-variants@0.x","Index");t.renderHotReload,t.setupHMR}.call(this,i(9)(e))},function(e,n){e.exports=function(e){if(!e.webpackPolyfill){var n=Object.create(e);n.children||(n.children=[]),Object.defineProperty(n,"loaded",{enumerable:!0,get:function(){return n.l}}),Object.defineProperty(n,"id",{enumerable:!0,get:function(){return n.i}}),Object.defineProperty(n,"exports",{enumerable:!0}),n.webpackPolyfill=1}return n}},function(e,n,i){"use strict";function t(e,n){(null==n||n>e.length)&&(n=e.length);for(var i=0,t=new Array(n);i0}));return Boolean(t)},hasMoreSellersThan:function(e){var n=e.values,t=e.args,r=n.sellers,l=null==r?void 0:r.filter((function(e){return e.commertialOffer.AvailableQuantity>0}));return(null==l?void 0:l.length)>(null==t?void 0:t.quantity)},hasBestPrice:function(e){var n,t,r,l=e.values,i=e.args,u=(null!==(t=null===(n=l.sellers)||void 0===n?void 0:n.find((function(e){return e.sellerDefault})))&&void 0!==t?t:l.sellers[0]).commertialOffer;return u.ListPrice!==u.Price===(null===(r=null==i?void 0:i.value)||void 0===r||r)},sellerId:function(e){var n=e.values,t=e.args,r=n.sellers,l=null==r?void 0:r.filter((function(e){return e.commertialOffer.AvailableQuantity>0}));return null==l?void 0:l.some((function(e){var n;return null===(n=null==t?void 0:t.ids)||void 0===n?void 0:n.includes(e.sellerId)}))}},d=function(e){var n,t=e.Else,i=e.Then,d=e.matchType,c=e.conditions,s=e.children,v=null!==(n=u()())&&void 0!==n?n:{},f=v.product,g=v.selectedItem,p=v.skuSelector,m=(p=void 0===p?{}:p).areAllVariationsSelected,y=void 0!==m&&m,I=null!=f?f:{},h=I.productId,S=I.categoryId,_=I.brandId,b=I.productClusters,T=I.categoryTree,P=I.properties,x=null!=g?g:{},E=x.itemId,A=x.sellers,O=Object(r.useMemo)((function(){return{productId:h,categoryId:S,brandId:_,productClusters:b,categoryTree:T,selectedItemId:E,specificationProperties:P,areAllVariationsSelected:y,sellers:A}}),[_,S,T,b,h,E,P,y,A]);return null==O.selectedItemId||null==O.productId?null:l.a.createElement(o.default,{Else:t,Then:i,matchType:d,conditions:c,values:O,handlers:a},s)};d.schema={title:"admin/editor.condition-layout.wrapper.product"},n.default=d}],[[12,"common"]]]); },function(){ !function(t){function e(e){for(var r,u,a=e[0],c=e[1],f=e[2],s=0,d=[];st.length)&&(e=t.length);for(var n=0,r=new Array(e);n0;){var o=s;s=new Set,o.forEach((function(e){d.has(e)||(d.add(e),(i[e]||new Set).forEach((function(e){s.add(e)})))}))}return d.forEach((function(n){var i=t(e,n);i&&a.definitions.push(i)})),a}(a,"AverageRatingByProductId")},23:function(e,n){var a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AppSettings"},variableDefinitions:[],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.reviews-and-ratings@3.15.1",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appSettings"},arguments:[],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"provider"},value:{kind:"StringValue",value:"vtex.reviews-and-ratings",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"c6740545f2a16014cf431976a4da68d28e42e8d845bdfd3133f12849017739a2",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"allowAnonymousReviews"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"requireApproval"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"useLocation"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"defaultOpen"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"defaultStarsRating"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"defaultOpenCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"showGraph"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"displaySummaryIfNone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"displayInlineIfNone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"displaySummaryTotalReviews"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"displaySummaryAddButton"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:487}};a.loc.source={body:'query AppSettings @context(sender: "vtex.reviews-and-ratings@3.15.1") {\n appSettings @context(provider: "vtex.reviews-and-ratings") @runtimeMeta(hash: "c6740545f2a16014cf431976a4da68d28e42e8d845bdfd3133f12849017739a2") {\n allowAnonymousReviews\n requireApproval\n useLocation\n defaultOpen\n defaultStarsRating\n defaultOpenCount\n showGraph\n displaySummaryIfNone\n displayInlineIfNone\n displaySummaryTotalReviews\n displaySummaryAddButton\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var i={};function t(e,n){for(var a=0;a0;){var o=s;s=new Set,o.forEach((function(e){d.has(e)||(d.add(e),(i[e]||new Set).forEach((function(e){s.add(e)})))}))}return d.forEach((function(n){var i=t(e,n);i&&a.definitions.push(i)})),a}(a,"AppSettings")},3:function(e,n,a){e.exports={stars:"vtex-reviews-and-ratings-3-x-stars",starpicker:"vtex-reviews-and-ratings-3-x-starpicker",star:"vtex-reviews-and-ratings-3-x-star","star--filled":"vtex-reviews-and-ratings-3-x-star--filled","star--empty":"vtex-reviews-and-ratings-3-x-star--empty",graphContent:"vtex-reviews-and-ratings-3-x-graphContent",graphContainer:"vtex-reviews-and-ratings-3-x-graphContainer",graphText:"vtex-reviews-and-ratings-3-x-graphText",graphTextLabel:"vtex-reviews-and-ratings-3-x-graphTextLabel",graphBarContainer:"vtex-reviews-and-ratings-3-x-graphBarContainer",graphBar:"vtex-reviews-and-ratings-3-x-graphBar",graphBarPercent:"vtex-reviews-and-ratings-3-x-graphBarPercent"}}}]); },function(){ (window.webpackJsonpvtex_reviews_and_ratings_3_15_1=window.webpackJsonpvtex_reviews_and_ratings_3_15_1||[]).push([["RatingSummary"],{0:function(e,t){e.exports=React},1:function(e,t){e.exports=ReactIntl},103:function(e,t,n){"use strict";n.r(t),function(e){var t=n(5);n.p=Object(t.getPublicPath)("vtex.reviews-and-ratings@3.15.1");var a=Object(t.register)((function(){return n(104)}),e,"vtex.reviews-and-ratings@3.15.1","vtex.reviews-and-ratings@3.x","RatingSummary");a.renderHotReload,a.setupHMR}.call(this,n(17)(e))},104:function(e,t,n){"use strict";n.r(t);var a=n(2),i=n(0),r=n.n(i),o=n(35),s=n(4),c=n(12),u=n.n(c),l=n(9),d=n.n(l),v=n(1),m=n(8),f=n(7),g=n.n(f),p=n(23),w=n.n(p),_=n(13),E=n(34),h=n.n(E),y=n(22),b=n.n(y),k=n(36),S=n(24),N={total:0,average:0,hasTotal:!1,hasAverage:!1,settings:{defaultOpen:!1,defaultStarsRating:5,defaultOpenCount:0,allowAnonymousReviews:!1,requireApproval:!0,useLocation:!1,showGraph:!1,displaySummaryIfNone:!1,displayInlineIfNone:!1,displaySummaryTotalReviews:!0,displaySummaryAddButton:!1},userAuthenticated:!1},R=function(e,t){switch(t.type){case"SET_TOTAL":return Object.assign(Object.assign({},e),{total:t.args.total,hasTotal:!0});case"SET_AVERAGE":return Object.assign(Object.assign({},e),{average:t.args.average,hasAverage:!0});case"SET_SETTINGS":return Object.assign(Object.assign({},e),{settings:t.args.settings});case"SET_AUTHENTICATED":return Object.assign(Object.assign({},e),{userAuthenticated:t.args.authenticated});default:return e}},T=["summaryContainer","loginLink","summaryButtonContainer","summaryTotalReviews"],O=Object(v.defineMessages)({loadingReviews:{id:"store/reviews.list.loadingReviews",defaultMessage:"Loading reviews..."}});t.default=function(){var e,t,n=Object(v.useIntl)(),c=Object(s.useApolloClient)(),l=d()(T),f=(null!==(e=u()())&&void 0!==e?e:{}).product,p=null!=f?f:{},E=p.productId,y=p.productName,I=p.linkText,x=Object(i.useReducer)(R,N),A=Object(a.a)(x,2),j=A[0],P=A[1],D=(m.canUseDOM?{url:window.location.pathname+window.location.hash,pathName:window.location.pathname}:{url:global.__pathname__,pathName:global.__pathname__}).url,C=Object(s.useQuery)(h.a,{variables:{productId:E},skip:!E,fetchPolicy:"network-only",ssr:!1}),M=C.data,B=C.loading,U=C.refetch,V=Object(s.useQuery)(b.a,{variables:{productId:E},skip:!E,fetchPolicy:"network-only",ssr:!1}),L=V.data,q=V.loading,H=V.refetch;Object(i.useEffect)((function(){c.query({query:w.a}).then((function(e){var t=e.data.appSettings;P({type:"SET_SETTINGS",args:{settings:t}})}))}),[c]),Object(i.useEffect)((function(){if(!B&&M){var e=M.totalReviewsByProductId;P({type:"SET_TOTAL",args:{total:e}})}}),[M,B,U]),Object(i.useEffect)((function(){if(!q&&L){var e=L.averageRatingByProductId.average;P({type:"SET_AVERAGE",args:{average:e}})}}),[L,q,H]),Object(i.useEffect)((function(){var e=function(){U(),H()};return S.a.on("reviewSaved",e),window.__RENDER_8_SESSION__.sessionPromise.then((function(e){var t,n,a=e.response;if(a&&a.namespaces){var i=a.namespaces;(null===(n=null===(t=null==i?void 0:i.authentication)||void 0===t?void 0:t.storeUserId)||void 0===n?void 0:n.value)&&P({type:"SET_AUTHENTICATED",args:{authenticated:!0}})}})),function(){return S.a.remove("reviewSaved",e)}}),[U,H]);var F=Object(k.a)();return r.a.createElement("div",{className:"".concat(l.summaryContainer," review-summary mw8 center")},E&&j.hasTotal&&j.hasAverage?0!==j.total||j.settings.displaySummaryIfNone?r.a.createElement(i.Fragment,null,j.total>0&&r.a.createElement(o.Helmet,null,r.a.createElement("script",{type:"application/ld+json"},JSON.stringify({"@context":"http://schema.org","@type":"Product","@id":"".concat(F,"/").concat(I,"/p"),aggregateRating:{"@type":"AggregateRating",ratingValue:j.average.toString(),reviewCount:j.total.toString()},name:y}))),r.a.createElement("span",{className:"t-heading-4 v-mid"},r.a.createElement(_.a,{rating:j.average}))," ",j.settings.displaySummaryTotalReviews?r.a.createElement("span",{className:"".concat(l.summaryTotalReviews," review__rating--count dib v-mid")},"(",j.total,")"):null,j.settings.displaySummaryAddButton?(null===(t=j.settings)||void 0===t?void 0:t.allowAnonymousReviews)||j.settings&&!j.settings.allowAnonymousReviews&&j.userAuthenticated?r.a.createElement("div",{className:"".concat(l.summaryButtonContainer)},r.a.createElement(g.a,{onClick:function(){var e;(e=document.getElementById("reviews-main-container"))&&e.scrollIntoView()}},r.a.createElement(v.FormattedMessage,{id:"store/reviews.list.writeReview"}))):r.a.createElement("div",{className:"".concat(l.summaryButtonContainer)},r.a.createElement(m.Link,{page:"store.login",query:"returnUrl=".concat(encodeURIComponent(D)),className:"".concat(l.loginLink," h1 w2 tc flex items-center w-100-s h-100-s pa4-s")},r.a.createElement(v.FormattedMessage,{id:"store/reviews.list.login"}))):null):null:r.a.createElement(i.Fragment,null,n.formatMessage(O.loadingReviews)))}},12:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProduct"]},24:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var a={on:function(e,t){document.addEventListener(e,(function(e){return t(e.detail)}))},dispatch:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;document.dispatchEvent(new CustomEvent(e,{detail:t}))},remove:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;document.removeEventListener(e,t)}}},34:function(e,t){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"TotalReviewsByProductId"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"productId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.reviews-and-ratings@3.15.1",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalReviewsByProductId"},arguments:[{kind:"Argument",name:{kind:"Name",value:"productId"},value:{kind:"Variable",name:{kind:"Name",value:"productId"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"provider"},value:{kind:"StringValue",value:"vtex.reviews-and-ratings",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"c7665958cc9cbec64955497d6ffb94c307ebf244e88f98d678661c1d9284a33f",block:!1}}]}]}]}}],loc:{start:0,end:290}};n.loc.source={body:'query TotalReviewsByProductId($productId: String!) @context(sender: "vtex.reviews-and-ratings@3.15.1") {\n totalReviewsByProductId(productId: $productId) @context(provider: "vtex.reviews-and-ratings") @runtimeMeta(hash: "c7665958cc9cbec64955497d6ffb94c307ebf244e88f98d678661c1d9284a33f")\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var a={};function i(e,t){for(var n=0;n0;){var c=s;s=new Set,c.forEach((function(e){o.has(e)||(o.add(e),(a[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var a=i(e,t);a&&n.definitions.push(a)})),n}(n,"TotalReviewsByProductId")},35:function(e,t){e.exports=ReactHelmet},36:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(8),i=function(){var e=a.canUseDOM?window.location.hostname:global.__hostname__,t=a.canUseDOM?window.__RUNTIME__.rootPath:global.__RUNTIME__.rootPath;return"".concat("https","://").concat(e).concat(null!=t?t:"")}},4:function(e,t){e.exports=ReactApollo},7:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Button"]},8:function(e,t){e.exports=__RENDER_8_RUNTIME__},9:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/useCssHandles"]}},[[103,"common",0]]]); },function(){ !function(e){function t(t){for(var n,u,a=t[0],c=t[1],l=t[2],f=0,p=[];fe.length)&&(t=e.length);for(var r=0,n=new Array(t);re?e:t},_=function(t,e){var n=parseInt(t,10);return Number.isNaN(n)?1:y(parseInt(t,10),e)},b=["quantitySelectorDropdownMobileContainer","quantitySelectorDropdownContainer","quantitySelectorInputMobileContainer","quantitySelectorInputContainer"],f=function(t){var e=t.itemId,n=t.selectedQuantity,o=t.size,u=void 0===o?"small":o,c=t.onChange,d=t.availableQuantity,v=Object(a.useState)("dropdown"),f=Object(l.a)(v,2),h=f[0],x=f[1],E=Object(a.useState)("".concat(n)),q=Object(l.a)(E,2),N=q[0],S=q[1],w=m()().isMobile,C=r()(b),M=function(t){for(var e=Math.min(9,t),n=[],a=1;a<=e;++a)n.push({value:a,label:"".concat(a)});return t>=10&&n.push({value:10,label:"".concat(10,"+")}),n}(d),O=function(t){var e=_(t,d),n=function(t,e){var n=parseInt(t,10);return Number.isNaN(n)||n<1?"":"".concat(y(n,e))}(t,d);"dropdown"===h&&e>=Math.min(d+1,10)&&x("input"),S(n),c({value:e})};return"dropdown"===h?i.a.createElement("div",{className:w?C.quantitySelectorDropdownMobileContainer:C.quantitySelectorDropdownContainer},i.a.createElement(s.a,{id:"".concat(w?"quantity-dropdown-mobile":"quantity-dropdown","-").concat(e),testId:"".concat(w?"quantity-dropdown-mobile":"quantity-dropdown","-").concat(e),options:M,size:u,value:n,onChange:function(t){return O(t.target.value)},placeholder:" "})):i.a.createElement("div",{className:w?C.quantitySelectorInputMobileContainer:C.quantitySelectorInputContainer},i.a.createElement(p.a,{id:"".concat(w?"quantity-input-mobile":"quantity-input","-").concat(e),size:u,value:N,maxLength:5,onChange:function(t){return O(t.target.value)},onBlur:function(){""===N&&S("1");var t=_(N,d);tt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0;){var s=o;o=new Set,s.forEach((function(e){r.has(e)||(r.add(e),(t[e]||new Set).forEach((function(e){o.add(e)})))}))}return r.forEach((function(a){var t=n(e,a);t&&i.definitions.push(t)})),i}(i,"AvailabilitySubscribe")},32:function(e,a,i){"use strict";i.r(a),function(e){var a=i(8);i.p=Object(a.getPublicPath)("vtex.availability-notify@1.13.1");var t=Object(a.register)((function(){return i(42)}),e,"vtex.availability-notify@1.13.1","vtex.availability-notify@1.x","AvailabilityNotifier");t.renderHotReload,t.setupHMR}.call(this,i(14)(e))},42:function(e,a,i){"use strict";i.r(a);var t=i(3),n=i.n(t),l=i(18),r=i(9),o=i(2),s=i(0),c=i.n(s),u=i(6),d=i(5),m=i(10),v=i.n(m),b=i(7),f=i.n(b),y=i(19),k=i.n(y),p=i(20),N=i(21),g=i.n(N),x=i(1),E=i.n(x);a.default=function(e){var a,i,t,m,b,y=k()(),N=Object(s.useState)(""),x=Object(o.a)(N,2),S=x[0],O=x[1],_=Object(s.useState)(""),h=Object(o.a)(_,2),j=h[0],w=h[1],D=Object(s.useState)(!1),I=Object(o.a)(D,2),M=I[0],A=I[1],V=Object(s.useState)(!1),T=Object(o.a)(V,2),R=T[0],C=T[1],$=Object(s.useState)(!1),L=Object(o.a)($,2),P=L[0],z=L[1],Q=Object(d.useMutation)(g.a),B=Object(o.a)(Q,2),F=B[0],H=B[1],J=H.loading,Z=H.error,q=H.data,G=Object(u.useIntl)(),U=function(e){if(!e||0===e.length)return null;var a=e.find((function(e){return e.sellerDefault}));return a||e[0]}(null===(a=y.selectedItem)||void 0===a?void 0:a.sellers),K=null!==(i=e.available)&&void 0!==i?i:(b=null==U?void 0:U.commertialOffer)&&(Number.isNaN(+b.AvailableQuantity)||b.AvailableQuantity>0),W=null!==(t=e.skuId)&&void 0!==t?t:null===(m=null==y?void 0:y.selectedItem)||void 0===m?void 0:m.itemId,X=Object(p.useRuntime)().culture.locale,Y={sellerName:null==U?void 0:U.sellerName,sellerId:null==U?void 0:U.sellerId,addToCartLink:null==U?void 0:U.addToCartLink,sellerDefault:null==U?void 0:U.sellerDefault};if(K||!W)return null;var ee=function(){var e=Object(r.a)(n.a.mark((function e(a){var i,t,r,o;return n.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a.preventDefault(),i={skuId:W,name:S,email:j,locale:X,sellerObj:{sellerId:Y.sellerId,sellerName:Y.sellerName,addToCartLink:Y.addToCartLink,sellerDefault:Y.sellerDefault}},e.next=4,F({variables:i});case 4:(t=e.sent).errors||(O(""),w("")),r=new CustomEvent("message:success",{detail:{success:!0,message:G.formatMessage({id:"store/availability-notify.added-message"})}}),o=new CustomEvent("message:success",{detail:{success:!1,message:G.formatMessage({id:"store/availability-notify.error-register"})}}),"object"===Object(l.a)(t)&&!0===t.data.availabilitySubscribe?(C(!1),document.dispatchEvent(r)):(C(!0),document.dispatchEvent(o));case 9:case"end":return e.stop()}}),e)})));return function(a){return e.apply(this,arguments)}}(),ae="";P&&M&&(ae=G.formatMessage({id:"store/availability-notify.invalid-email"}));var ie=""===S||""===j||M||J;return c.a.createElement("div",{className:E.a.notiferContainer},c.a.createElement("div",{className:"".concat(E.a.title," t-body mb3")},G.formatMessage({id:"store/availability-notify.title"})),c.a.createElement("div",{className:"".concat(E.a.notifyLabel," t-small fw3")},G.formatMessage({id:"store/availability-notify.notify-label"})),c.a.createElement("form",{className:"".concat(E.a.form," mb4"),onSubmit:function(e){return ee(e)}},c.a.createElement("div",{className:"".concat(E.a.content," flex-ns justify-between mt4 mw6")},c.a.createElement("div",{className:"".concat(E.a.input," ").concat(E.a.inputName," w-100 mr5 mb4")},c.a.createElement(f.a,{name:"name",type:"text",placeholder:G.formatMessage({id:"store/availability-notify.name-placeholder"}),value:S,onChange:function(e){O(e.target.value)}})),c.a.createElement("div",{className:"".concat(E.a.input," ").concat(E.a.inputEmail," w-100 mr5 mb4")},c.a.createElement(f.a,{name:"email",type:"text",placeholder:G.formatMessage({id:"store/availability-notify.email-placeholder"}),value:j,onChange:function(e){var a;w(e.target.value),a=e.target.value,A(!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(a.toLowerCase()))},onBlur:function(){return z(!0)},error:P&&M,errorMessage:ae})),c.a.createElement("div",{className:"".concat(E.a.submit," flex items-center mb4")},c.a.createElement(v.a,{type:"submit",variation:"primary",size:"small",disabled:ie,isLoading:J},G.formatMessage({id:"store/availability-notify.send-label"})))),!Z&&!R&&q&&c.a.createElement("div",{className:"".concat(E.a.success," t-body c-success")},G.formatMessage({id:"store/availability-notify.added-message"})),R&&c.a.createElement("div",{className:"".concat(E.a.success," t-body c-danger")},G.formatMessage({id:"store/availability-notify.error-register"})),Z&&c.a.createElement("div",{className:"".concat(E.a.error," c-danger")},G.formatMessage({id:"store/availability-notify.error-message"}))))}},5:function(e,a){e.exports=ReactApollo},6:function(e,a){e.exports=ReactIntl},7:function(e,a){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Input"]}},[[32,"common"]]]); },function(){ !function(e){function t(t){for(var n,u,a=t[0],c=t[1],l=t[2],f=0,s=[];fe.length)&&(t=e.length);for(var r=0,n=new Array(t);r