!function(e){function n(n){for(var r,c,u=n[0],a=n[1],l=n[2],w=0,p=[];w0}));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(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);n/gi,"\n"),r=t[n]),r}},{key:"onResize",value:function(){this.calcTargetWidth()}},{key:"onTruncate",value:function(e){var t=this.props.onTruncate;"function"==typeof t&&(this.timeout=window.requestAnimationFrame((function(){t(e)})))}},{key:"calcTargetWidth",value:function(e){var t=this.elements.target,n=this.calcTargetWidth,r=this.canvasContext,i=this.props.width;if(t){var a=i||Math.floor(t.parentNode.getBoundingClientRect().width);if(!a)return window.requestAnimationFrame((function(){return n(e)}));var o=window.getComputedStyle(t),s=[o["font-weight"],o["font-style"],o["font-size"],o["font-family"]].join(" ");r.font=s,this.setState({targetWidth:a},e)}}},{key:"measureWidth",value:function(e){return this.canvasContext.measureText(e).width}},{key:"ellipsisWidth",value:function(e){return e.offsetWidth}},{key:"trimRight",value:function(e){return e.replace(/\s+$/,"")}},{key:"getLines",value:function(){for(var e=this.elements,t=this.props,n=t.lines,r=t.ellipsis,a=t.trimWhitespace,o=this.state.targetWidth,s=this.innerText,l=this.measureWidth,c=this.onTruncate,u=this.trimRight,f=[],p=s(e.text).split("\n").map((function(e){return e.split(" ")})),h=!0,d=this.ellipsisWidth(this.elements.ellipsis),m=1;m<=n;m++){var v=p[0];if(0!==v.length){var y=v.join(" ");if(l(y)<=o&&1===p.length){h=!1,f.push(y);break}if(m===n){for(var b=v.join(" "),g=0,w=b.length-1;g<=w;){var T=Math.floor((g+w)/2);l(b.slice(0,T+1))+d<=o?g=T+1:w=T-1}var _=b.slice(0,g);if(a)for(_=u(_);!_.length&&f.length;){_=u(f.pop())}y=i.a.createElement("span",null,_,r)}else{for(var E=0,O=v.length-1;E<=O;){var k=Math.floor((E+O)/2);l(v.slice(0,k+1).join(" "))<=o?E=k+1:O=k-1}if(0===E){m=n-1;continue}y=v.slice(0,E).join(" "),p[0].splice(0,E)}f.push(y)}else f.push(),p.shift(),m--}return c(h),f}},{key:"renderLine",value:function(e,t,n){if(t===n.length-1)return i.a.createElement("span",{key:t},e);var r=i.a.createElement("br",{key:t+"br"});return e?[i.a.createElement("span",{key:t},e),r]:r}},{key:"render",value:function(){var e=this,t=this.elements.target,n=this.props,r=n.children,a=n.ellipsis,o=n.lines,l=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(n,["children","ellipsis","lines"]),c=this.state.targetWidth,u=this.getLines,f=this.renderLine,p=this.onTruncate,h=void 0;return"undefined"!=typeof window&&!(!t||!c)&&(o>0?h=u().map(f):(h=r,p(!1))),delete l.onTruncate,delete l.trimWhitespace,i.a.createElement("span",s({},l,{ref:function(t){e.elements.target=t}}),i.a.createElement("span",null,h),i.a.createElement("span",{ref:function(t){e.elements.text=t}},r),i.a.createElement("span",{ref:function(t){e.elements.ellipsis=t},style:this.styles.ellipsis},a))}}]),t}(r.Component);f.propTypes={children:o.a.node,ellipsis:o.a.node,lines:o.a.oneOfType([o.a.oneOf([!1]),o.a.number]),trimWhitespace:o.a.bool,width:o.a.number,onTruncate:o.a.func},f.defaultProps={children:"",ellipsis:"…",lines:1,trimWhitespace:!1,width:0},t.default=f}}]);; (window.webpackJsonpvtex_reviews_and_ratings_2_13_0=window.webpackJsonpvtex_reviews_and_ratings_2_13_0||[]).push([[0],{13:function(e,n,a){"use strict";var i=a(0),t=a.n(i),r=a(18),d=a(6),o=a.n(d);n.a=function(e){var n=e.rating,a=Object(i.useMemo)((function(){return[null,null,null,null,null].map((function(e,a){return a0;){var s=o;o=new Set,s.forEach((function(e){d.has(e)||(d.add(e),(i[e]||new Set).forEach((function(e){o.add(e)})))}))}return d.forEach((function(n){var i=t(e,n);i&&a.definitions.push(i)})),a}(a,"AverageRatingByProductId")},22: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@2.13.0",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:"cbf7d713deb000abc7212681f497bf2b7acde92f81c62774af3b245de8de194c",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:"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:464}};a.loc.source={body:'query AppSettings @context(sender: "vtex.reviews-and-ratings@2.13.0") {\n appSettings @context(provider: "vtex.reviews-and-ratings") @runtimeMeta(hash: "cbf7d713deb000abc7212681f497bf2b7acde92f81c62774af3b245de8de194c") {\n allowAnonymousReviews\n requireApproval\n useLocation\n defaultOpen\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 s=o;o=new Set,s.forEach((function(e){d.has(e)||(d.add(e),(i[e]||new Set).forEach((function(e){o.add(e)})))}))}return d.forEach((function(n){var i=t(e,n);i&&a.definitions.push(i)})),a}(a,"AppSettings")},6:function(e,n,a){e.exports={stars:"vtex-reviews-and-ratings-2-x-stars",starpicker:"vtex-reviews-and-ratings-2-x-starpicker",star:"vtex-reviews-and-ratings-2-x-star","star--filled":"vtex-reviews-and-ratings-2-x-star--filled","star--empty":"vtex-reviews-and-ratings-2-x-star--empty",graphContent:"vtex-reviews-and-ratings-2-x-graphContent",graphContainer:"vtex-reviews-and-ratings-2-x-graphContainer",graphText:"vtex-reviews-and-ratings-2-x-graphText",graphTextLabel:"vtex-reviews-and-ratings-2-x-graphTextLabel",graphBarContainer:"vtex-reviews-and-ratings-2-x-graphBarContainer",graphBar:"vtex-reviews-and-ratings-2-x-graphBar",graphBarPercent:"vtex-reviews-and-ratings-2-x-graphBarPercent"}}}]);; (window.webpackJsonpvtex_reviews_and_ratings_2_13_0=window.webpackJsonpvtex_reviews_and_ratings_2_13_0||[]).push([[2],{51:function(e,a,i){"use strict";i.r(a),i.d(a,"ReviewForm",(function(){return V}));var n=i(54),t=i.n(n),r=i(68),s=i(2),o=i(0),l=i.n(o),d=i(12),c=i.n(d),m=i(7),u=i(1),v=i(9),f=i.n(v),g=i(49),b=i.n(g),p=i(23),h=i.n(p),E=i(8),k=i.n(E),S=i(50),w=i.n(S),N=i(69),T=i.n(N),I=i(55),y=i.n(I),O=i(18),_=i(6),M=i.n(_),j=function(e){var a=e.onStarClick,i=e.rating,n=e.label,t=Object(o.useMemo)((function(){return[null,null,null,null,null].map((function(e,a){return a0;){var l=o;o=new Set,l.forEach((function(e){s.has(e)||(s.add(e),(n[e]||new Set).forEach((function(e){o.add(e)})))}))}return s.forEach((function(a){var n=t(e,a);n&&i.definitions.push(n)})),i}(i,"HasShopperReviewed")},69:function(e,a){var i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"NewReview"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"review"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ReviewInput"}}},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@2.13.0",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"43dd12446f56ee5e75e4c864c1d8cd12ccb6783f70fe7b3bfa7a9c83e09c37f4",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"newReview"},arguments:[{kind:"Argument",name:{kind:"Name",value:"review"},value:{kind:"Variable",name:{kind:"Name",value:"review"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"cacheId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"productId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"rating"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"text"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"reviewerName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"reviewDateTime"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sku"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:342}};i.loc.source={body:'mutation NewReview($review: ReviewInput!) @context(sender: "vtex.reviews-and-ratings@2.13.0") @runtimeMeta(hash: "43dd12446f56ee5e75e4c864c1d8cd12ccb6783f70fe7b3bfa7a9c83e09c37f4") {\n newReview(review: $review) {\n id\n cacheId\n productId\n rating\n title\n text\n reviewerName\n reviewDateTime\n sku\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var n={};function t(e,a){for(var i=0;i0;){var l=o;o=new Set,l.forEach((function(e){s.has(e)||(s.add(e),(n[e]||new Set).forEach((function(e){o.add(e)})))}))}return s.forEach((function(a){var n=t(e,a);n&&i.definitions.push(n)})),i}(i,"NewReview")}}]);; (window.webpackJsonpvtex_reviews_and_ratings_2_13_0=window.webpackJsonpvtex_reviews_and_ratings_2_13_0||[]).push([["Reviews"],{0:function(e,t){e.exports=React},1:function(e,t){e.exports=ReactIntl},12:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProduct"]},15:function(e,t){e.exports=PropTypes},23:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Input"]},31:function(e,t){e.exports=ReactHelmet},32:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(5),s=function(){var e=n.canUseDOM?window.location.hostname:global.__hostname__,t=n.canUseDOM?window.__RUNTIME__.rootPath:global.__RUNTIME__.rootPath;return"".concat("https","://").concat(e).concat(null!=t?t:"")}},34:function(e,t,a){"use strict";a.r(t);var n=a(0),s=a.n(n),i=a(9),r=a.n(i),o=a(1),c=["graphContent","graphContainer","graphText","graphTextLabel","graphBarContainer","graphBar","graphBarPercent"];t.default=function(e){var t=r()(c);return s.a.createElement("div",{className:"".concat(t.graphContent," mv5")},s.a.createElement("div",{className:"".concat(t.graphContainer," mv5 flex")},s.a.createElement("div",{className:"".concat(t.graphText," mr5")},s.a.createElement("span",{className:"".concat(t.graphTextLabel)},s.a.createElement(o.FormattedMessage,{id:"store/reviews.list.graph.stars",values:{value:5}}))),s.a.createElement("div",{className:"".concat(t.graphBarContainer)},s.a.createElement("span",{className:"".concat(t.graphBarPercent)},e.reviewsStats[0]?"".concat((e.reviewsStats[5]/e.reviewsStats[0]*100).toFixed(0).toString(),"%"):"0%"),s.a.createElement("div",{className:"".concat(t.graphBar," h-100"),style:{width:e.reviewsStats[0]?"".concat((e.reviewsStats[5]/e.reviewsStats[0]*100).toString(),"%"):"0%"}}))),s.a.createElement("div",{className:"".concat(t.graphContainer," mv5 flex")},s.a.createElement("div",{className:"".concat(t.graphText," mr5")},s.a.createElement("span",{className:"".concat(t.graphTextLabel)},s.a.createElement(o.FormattedMessage,{id:"store/reviews.list.graph.stars",values:{value:4}}))),s.a.createElement("div",{className:"".concat(t.graphBarContainer)},s.a.createElement("span",{className:"".concat(t.graphBarPercent)},e.reviewsStats[0]?"".concat((e.reviewsStats[4]/e.reviewsStats[0]*100).toFixed(0).toString(),"%"):"0%"),s.a.createElement("div",{className:"".concat(t.graphBar," h-100"),style:{width:e.reviewsStats[0]?"".concat((e.reviewsStats[4]/e.reviewsStats[0]*100).toString(),"%"):"0%"}}))),s.a.createElement("div",{className:"".concat(t.graphContainer," mv5 flex")},s.a.createElement("div",{className:"".concat(t.graphText," mr5")},s.a.createElement("span",{className:"".concat(t.graphTextLabel)},s.a.createElement(o.FormattedMessage,{id:"store/reviews.list.graph.stars",values:{value:3}}))),s.a.createElement("div",{className:"".concat(t.graphBarContainer)},s.a.createElement("span",{className:"".concat(t.graphBarPercent)},e.reviewsStats[0]?"".concat((e.reviewsStats[3]/e.reviewsStats[0]*100).toFixed(0).toString(),"%"):"0%"),s.a.createElement("div",{className:"".concat(t.graphBar," h-100"),style:{width:e.reviewsStats[0]?"".concat((e.reviewsStats[3]/e.reviewsStats[0]*100).toString(),"%"):"0%"}}))),s.a.createElement("div",{className:"".concat(t.graphContainer," mv5 flex")},s.a.createElement("div",{className:"".concat(t.graphText," mr5")},s.a.createElement("span",{className:"".concat(t.graphTextLabel)},s.a.createElement(o.FormattedMessage,{id:"store/reviews.list.graph.stars",values:{value:2}}))),s.a.createElement("div",{className:"".concat(t.graphBarContainer)},s.a.createElement("span",{className:"".concat(t.graphBarPercent)},e.reviewsStats[0]?"".concat((e.reviewsStats[2]/e.reviewsStats[0]*100).toFixed(0).toString(),"%"):"0%"),s.a.createElement("div",{className:"".concat(t.graphBar," h-100"),style:{width:e.reviewsStats[0]?"".concat((e.reviewsStats[2]/e.reviewsStats[0]*100).toString(),"%"):"0%"}}))),s.a.createElement("div",{className:"".concat(t.graphContainer," mv5 flex")},s.a.createElement("div",{className:"".concat(t.graphText," mr5")},s.a.createElement("span",{className:"".concat(t.graphTextLabel)},s.a.createElement(o.FormattedMessage,{id:"store/reviews.list.graph.stars",values:{value:1}}))),s.a.createElement("div",{className:"".concat(t.graphBarContainer)},s.a.createElement("span",{className:"".concat(t.graphBarPercent)},e.reviewsStats[0]?"".concat((e.reviewsStats[1]/e.reviewsStats[0]*100).toFixed(0).toString(),"%"):"0%"),s.a.createElement("div",{className:"".concat(t.graphBar," h-100"),style:{width:e.reviewsStats[0]?"".concat((e.reviewsStats[1]/e.reviewsStats[0]*100).toString(),"%"):"0%"}}))))}},49:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Card"]},5:function(e,t){e.exports=__RENDER_8_RUNTIME__},50:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Textarea"]},56:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/IconSuccess"]},57:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Collapsible"]},58:function(e,t){e.exports=regeneratorRuntime},7:function(e,t){e.exports=ReactApollo},71:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Pagination"]},72:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Dropdown"]},73:function(e,t){var a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ReviewsByProductId"},variableDefinitions:[{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:"from"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},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:"orderBy"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"status"}},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@2.13.0",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"reviewsByProductId"},arguments:[{kind:"Argument",name:{kind:"Name",value:"productId"},value:{kind:"Variable",name:{kind:"Name",value:"productId"}}},{kind:"Argument",name:{kind:"Name",value:"from"},value:{kind:"Variable",name:{kind:"Name",value:"from"}}},{kind:"Argument",name:{kind:"Name",value:"to"},value:{kind:"Variable",name:{kind:"Name",value:"to"}}},{kind:"Argument",name:{kind:"Name",value:"orderBy"},value:{kind:"Variable",name:{kind:"Name",value:"orderBy"}}},{kind:"Argument",name:{kind:"Name",value:"status"},value:{kind:"Variable",name:{kind:"Name",value:"status"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"a0fef6260cb9e86daaa22f8b5bb4f531453bde5f83a4f7e858de1c7d70d9efc3",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"cacheId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"productId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"rating"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"text"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"reviewerName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"location"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"reviewDateTime"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verifiedPurchaser"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sku"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"approved"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"range"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"total"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"from"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"to"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:649}};a.loc.source={body:'query ReviewsByProductId($productId: String!, $from: Int, $to: Int, $orderBy: String, $status: String) @context(sender: "vtex.reviews-and-ratings@2.13.0") {\n reviewsByProductId(productId: $productId, from: $from, to: $to, orderBy: $orderBy, status: $status) @runtimeMeta(hash: "a0fef6260cb9e86daaa22f8b5bb4f531453bde5f83a4f7e858de1c7d70d9efc3") {\n data {\n id\n cacheId\n productId\n rating\n title\n text\n reviewerName\n location\n reviewDateTime\n verifiedPurchaser\n sku\n approved\n __typename\n }\n range {\n total\n from\n to\n __typename\n }\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var n={};function s(e,t){for(var a=0;a0;){var c=o;o=new Set,c.forEach((function(e){r.has(e)||(r.add(e),(n[e]||new Set).forEach((function(e){o.add(e)})))}))}return r.forEach((function(t){var n=s(e,t);n&&a.definitions.push(n)})),a}(a,"ReviewsByProductId")},8:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Button"]},83:function(e,t,a){"use strict";a.r(t),function(e){var t=a(4);a.p=Object(t.getPublicPath)("vtex.reviews-and-ratings@2.13.0");var n=Object(t.register)((function(){return a(84)}),e,"vtex.reviews-and-ratings@2.13.0","vtex.reviews-and-ratings@2.x","Reviews");n.renderHotReload,n.setupHMR}.call(this,a(17)(e))},84:function(e,t,a){"use strict";a.r(t);var n=a(2),s=a(19),i=a(0),r=a.n(i),o=a(31),c=a(7),l=a(1),m=a(12),d=a.n(m),v=a(5),u=a(9),g=a.n(u),w=a(70),p=a.n(w),E=a(56),f=a.n(E),h=a(71),N=a.n(h),_=a(57),b=a.n(_),k=a(72),S=a.n(k),y=a(13),R=a(51),M=a(22),O=a.n(M),T=a(73),A=a.n(T),x=a(21),C=a.n(x),P=a(34),D=a(32),F={sort:"ReviewDateTime:desc",from:1,to:10,reviews:null,total:0,average:0,hasTotal:!1,hasAverage:!1,showForm:!1,openReviews:[],settings:{defaultOpen:!1,defaultOpenCount:0,allowAnonymousReviews:!1,requireApproval:!0,useLocation:!1,showGraph:!1},userAuthenticated:!1,reviewsStats:[]},I=function(e,t){switch(t.type){case"SET_NEXT_PAGE":return Object.assign(Object.assign({},e),{from:e.total<11?e.from:e.from+10,to:e.to+10>e.total?e.total:e.to+10});case"SET_PREV_PAGE":return Object.assign(Object.assign({},e),{from:e.from-(e.from<11?0:10),to:e.from>10?e.from-1:e.to});case"TOGGLE_REVIEW_FORM":return Object.assign(Object.assign({},e),{showForm:!e.showForm});case"TOGGLE_REVIEW_ACCORDION":return Object.assign(Object.assign({},e),{openReviews:e.openReviews.includes(t.args.reviewNumber)?e.openReviews.filter((function(e){return e!==t.args.reviewNumber})):[].concat(Object(s.a)(e.openReviews),[t.args.reviewNumber])});case"SET_OPEN_REVIEWS":return Object.assign(Object.assign({},e),{openReviews:t.args.reviewNumbers});case"SET_SELECTED_SORT":return Object.assign(Object.assign({},e),{sort:t.args.sort});case"SET_REVIEWS":return Object.assign(Object.assign({},e),{reviews:t.args.reviews||[],total:t.args.total,reviewsStats:t.args.graphArray||[],hasTotal:!0});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}},B=Object(l.defineMessages)({sortPlaceholder:{id:"store/reviews.list.sortOptions.placeholder",defaultMessage:"Sort by:"},sortMostRecent:{id:"store/reviews.list.sortOptions.mostRecent",defaultMessage:"Most Recent"},sortOldest:{id:"store/reviews.list.sortOptions.oldest",defaultMessage:"Oldest"},sortHighestRated:{id:"store/reviews.list.sortOptions.highestRated",defaultMessage:"Highest Rated"},sortLowestRated:{id:"store/reviews.list.sortOptions.lowestRated",defaultMessage:"Lowest Rated"},timeAgo:{id:"store/reviews.list.timeAgo",defaultMessage:"ago"},timeAgoYear:{id:"store/reviews.list.timeAgo.year",defaultMessage:"year"},timeAgoYears:{id:"store/reviews.list.timeAgo.years",defaultMessage:"years"},timeAgoMonth:{id:"store/reviews.list.timeAgo.month",defaultMessage:"month"},timeAgoMonths:{id:"store/reviews.list.timeAgo.months",defaultMessage:"months"},timeAgoWeek:{id:"store/reviews.list.timeAgo.week",defaultMessage:"week"},timeAgoWeeks:{id:"store/reviews.list.timeAgo.weeks",defaultMessage:"weeks"},timeAgoDay:{id:"store/reviews.list.timeAgo.day",defaultMessage:"day"},timeAgoDays:{id:"store/reviews.list.timeAgo.days",defaultMessage:"days"},timeAgoHour:{id:"store/reviews.list.timeAgo.hour",defaultMessage:"hour"},timeAgoHours:{id:"store/reviews.list.timeAgo.hours",defaultMessage:"hours"},timeAgoMinute:{id:"store/reviews.list.timeAgo.minute",defaultMessage:"minute"},timeAgoMinutes:{id:"store/reviews.list.timeAgo.minutes",defaultMessage:"minutes"},timeAgoJustNow:{id:"store/reviews.list.timeAgo.justNow",defaultMessage:"just now"},anonymous:{id:"store/reviews.list.anonymous",defaultMessage:"Anonymous"},textOf:{id:"store/reviews.list.pagination.textOf",defaultMessage:"of"}}),j=["container","writeReviewContainer","writeReviewButton","loginLink","reviewsRating","starsContainer","reviewsHeading","reviewsRatingAverage","reviewsRatingCount","reviewCommentsContainer","reviewsOrderBy","reviewsPaging","reviewComment","reviewCommentMessage","reviewCommentRating","reviewCommentUser","reviewInfo","reviewVerifiedPurchase","reviewDate","reviewDateSubmitted","reviewDateValue","reviewAuthor","reviewAuthorBy","reviewAuthorName","graphContent","graphContainer","graphText","graphTextLabel","graphBarContainer","graphBar","graphBarPercent"];t.default=function(){var e,t=Object(c.useApolloClient)(),a=Object(l.useIntl)(),m=g()(j),u=(null!==(e=d()())&&void 0!==e?e:{}).product,w=null!=u?u:{},E=w.productId,h=w.productName,_=w.linkText,k=Object(i.useReducer)(I,F),M=Object(n.a)(k,2),T=M[0],x=M[1],V=[{label:a.formatMessage(B.sortMostRecent),value:"ReviewDateTime:desc"},{label:a.formatMessage(B.sortOldest),value:"ReviewDateTime:asc"},{label:a.formatMessage(B.sortHighestRated),value:"Rating:desc"},{label:a.formatMessage(B.sortLowestRated),value:"Rating:asc"}],L=function(e){var t=new Date("".concat(e," UTC")),n=new Date,s=new Date(n.valueOf()-t.valueOf()),i=s.getUTCMinutes(),r=s.getUTCHours(),o=s.getUTCDate()-1,c=s.getUTCMonth(),l=s.getUTCFullYear()-1970;return l>0?"".concat(l," ").concat(l>1?a.formatMessage(B.timeAgoYears):a.formatMessage(B.timeAgoYear)," ").concat(a.formatMessage(B.timeAgo)):c>0?"".concat(c," ").concat(c>1?a.formatMessage(B.timeAgoMonths):a.formatMessage(B.timeAgoMonth)," ").concat(a.formatMessage(B.timeAgo)):o>0?"".concat(o," ").concat(o>1?a.formatMessage(B.timeAgoDays):a.formatMessage(B.timeAgoDay)," ").concat(a.formatMessage(B.timeAgo)):r>0?"".concat(r," ").concat(r>1?a.formatMessage(B.timeAgoHours):a.formatMessage(B.timeAgoHour)," ").concat(a.formatMessage(B.timeAgo)):i>0?"".concat(i," ").concat(i>1?a.formatMessage(B.timeAgoMinutes):a.formatMessage(B.timeAgoMinute)," ").concat(a.formatMessage(B.timeAgo)):a.formatMessage(B.timeAgoJustNow)},U=(v.canUseDOM?{url:window.location.pathname+window.location.hash,pathName:window.location.pathname}:{url:global.__pathname__,pathName:global.__pathname__}).url;Object(i.useEffect)((function(){window.__RENDER_8_SESSION__.sessionPromise.then((function(e){var t,a,n=e.response;if(n&&n.namespaces){var s=n.namespaces;(null===(a=null===(t=null==s?void 0:s.authentication)||void 0===t?void 0:t.storeUserId)||void 0===a?void 0:a.value)&&x({type:"SET_AUTHENTICATED",args:{authenticated:!0}})}}))}),[]),Object(i.useEffect)((function(){t.query({query:O.a}).then((function(e){var t=e.data.appSettings;x({type:"SET_SETTINGS",args:{settings:t}})}))}),[t]),Object(i.useEffect)((function(){E&&t.query({query:C.a,variables:{productId:E}}).then((function(e){var t=e.data.averageRatingByProductId;x({type:"SET_AVERAGE",args:{average:t}})}))}),[t,E]),Object(i.useEffect)((function(){E&&t.query({query:A.a,variables:{productId:E,from:T.from,to:T.to,orderBy:T.sort,status:T.settings&&!T.settings.requireApproval?"":"true"}}).then((function(e){var t=e.data.reviewsByProductId.data,a=e.data.reviewsByProductId.range.total,n=[0,0,0,0,0,0];n[0]=a,t&&t.forEach((function(e){var t=e.rating;n[t]+=1})),x({type:"SET_REVIEWS",args:{reviews:t,total:a,graphArray:n}});var i=Math.min(T.settings.defaultOpenCount,a);x({type:"SET_OPEN_REVIEWS",args:{reviewNumbers:Object(s.a)(Array(i).keys())}})}))}),[t,E,T.from,T.to,T.sort,T.settings]);var G=Object(D.a)();return r.a.createElement("div",{className:"".concat(m.container," review mw8 center ph5"),id:"reviews-main-container"},r.a.createElement("h3",{className:"".concat(m.reviewsHeading," review__title t-heading-3 bb b--muted-5 mb5")},r.a.createElement(l.FormattedMessage,{id:"store/reviews.list.title"})),r.a.createElement("div",{className:"".concat(m.reviewsRating," review__rating")},T.hasTotal&&T.hasAverage?T.total?r.a.createElement(i.Fragment,null,r.a.createElement("div",{className:"".concat(m.starsContainer," t-heading-4")},r.a.createElement(y.a,{rating:T.average})),r.a.createElement("span",{className:"".concat(m.reviewsRatingAverage," review__rating--average dib v-mid")},r.a.createElement(l.FormattedMessage,{id:"store/reviews.list.summary.averageRating",values:{average:T.average}}))," ",r.a.createElement("span",{className:"".concat(m.reviewsRatingCount," review__rating--count dib v-mid")},r.a.createElement(l.FormattedMessage,{id:"store/reviews.list.summary.totalReviews",values:{total:T.total}}))):null:r.a.createElement(l.FormattedMessage,{id:"store/reviews.list.summary.loading"})),T.settings.showGraph?r.a.createElement(P.default,{reviewsStats:T.reviewsStats}):null,r.a.createElement("div",{className:"".concat(m.writeReviewContainer," mv5")},T.settings&&T.settings.allowAnonymousReviews||T.settings&&!T.settings.allowAnonymousReviews&&T.userAuthenticated?r.a.createElement(b.a,{header:r.a.createElement("span",{className:"".concat(m.writeReviewButton," c-action-primary hover-c-action-primary")},r.a.createElement(l.FormattedMessage,{id:"store/reviews.list.writeReview"})),onClick:function(){x({type:"TOGGLE_REVIEW_FORM"})},isOpen:T.showForm},r.a.createElement(R.default,{settings:T.settings})):r.a.createElement(v.Link,{page:"store.login",query:"returnUrl=".concat(encodeURIComponent(U)),className:"".concat(m.loginLink," h1 w2 tc flex items-center w-100-s h-100-s pa4-s")},r.a.createElement(l.FormattedMessage,{id:"store/reviews.list.login"}))),r.a.createElement("div",{className:"".concat(m.reviewCommentsContainer," review__comments")},null===T.reviews?r.a.createElement(l.FormattedMessage,{id:"store/reviews.list.loading"}):T.reviews.length?r.a.createElement(i.Fragment,null,r.a.createElement("div",{className:"".concat(m.reviewsOrderBy," flex mb7")},r.a.createElement("div",{className:"mr4"},r.a.createElement(S.a,{options:V,placeholder:a.formatMessage(B.sortPlaceholder),onChange:function(e){x({type:"SET_SELECTED_SORT",args:{sort:e.currentTarget.value}})},value:T.sort}))),T.reviews.map((function(e,t){return r.a.createElement("div",{key:t,className:"".concat(m.reviewComment," review__comment bw2 bb b--muted-5 mb5 pb4")},r.a.createElement(o.Helmet,null,r.a.createElement("script",{type:"application/ld+json"},JSON.stringify({"@context":"http://schema.org","@type":"Product","@id":"".concat(G,"/").concat(_,"/p"),review:{"@type":"Review",reviewRating:{ratingValue:e.rating.toString(),bestRating:"5"},author:{"@type":"Person",name:e.reviewerName||a.formatMessage(B.anonymous)},datePublished:e.reviewDateTime,reviewBody:e.text},name:h}))),T.settings.defaultOpen?r.a.createElement("div",null,r.a.createElement("div",{className:"".concat(m.reviewCommentRating," review__comment--rating t-heading-5")},r.a.createElement(y.a,{rating:e.rating})," "," ",r.a.createElement("span",{className:"".concat(m.reviewCommentUser," review__comment--user lh-copy mw9 t-heading-5 mt0 mb2")},e.title)),r.a.createElement("div",{className:"".concat(m.reviewInfo," pa0 mv2 t-small")},e.verifiedPurchaser?r.a.createElement("span",{className:"".concat(m.reviewVerifiedPurchase," dib mr5")},r.a.createElement(f.a,null)," ",r.a.createElement(l.FormattedMessage,{id:"store/reviews.list.verifiedPurchaser"})):null,r.a.createElement("span",{className:"".concat(m.reviewDate," dib mr2")},r.a.createElement("span",{className:"".concat(m.reviewDateSubmitted," dib mr2")},r.a.createElement(l.FormattedMessage,{id:"store/reviews.list.submitted"})),r.a.createElement("strong",{className:m.reviewDateValue},L(e.reviewDateTime))),r.a.createElement("span",{className:"".concat(m.reviewAuthor," dib mr5")},r.a.createElement("span",{className:"".concat(m.reviewAuthorBy," dib mr2")},r.a.createElement(l.FormattedMessage,{id:"store/reviews.list.by"})),r.a.createElement("strong",{className:m.reviewAuthorName},e.reviewerName||a.formatMessage(B.anonymous)),T.settings&&T.settings.useLocation&&e.location&&r.a.createElement("span",null,", ",e.location))),r.a.createElement("div",{className:"".concat(m.reviewCommentMessage," t-body lh-copy mw9")},r.a.createElement(p.a,{lines:3,more:"Show more",less:"Show less",anchorClass:""},e.text))):r.a.createElement(b.a,{header:r.a.createElement("div",{className:"".concat(m.reviewCommentRating," review__comment--rating t-heading-5")},r.a.createElement(y.a,{rating:e.rating})," "," ",r.a.createElement("span",{className:"".concat(m.reviewCommentUser," review__comment--user lh-copy mw9 t-heading-5 mt0 mb2")},e.title)),onClick:function(){x({type:"TOGGLE_REVIEW_ACCORDION",args:{reviewNumber:t}})},isOpen:T.openReviews.includes(t)},r.a.createElement("ul",{className:"pa0 mv2 t-small"},e.verifiedPurchaser?r.a.createElement("li",{className:"dib mr5"},r.a.createElement(f.a,null)," ",r.a.createElement(l.FormattedMessage,{id:"store/reviews.list.verifiedPurchaser"})):null,r.a.createElement("li",{className:"dib mr2"},r.a.createElement(l.FormattedMessage,{id:"store/reviews.list.submitted"})," ",r.a.createElement("strong",null,L(e.reviewDateTime))),r.a.createElement("li",{className:"dib mr5"},r.a.createElement(l.FormattedMessage,{id:"store/reviews.list.by"})," ",r.a.createElement("strong",null,e.reviewerName||a.formatMessage(B.anonymous)),T.settings&&T.settings.useLocation&&e.location&&r.a.createElement("span",null,", ",e.location))),r.a.createElement("p",{className:"t-body lh-copy mw9"},e.text)))})),r.a.createElement("div",{className:"".concat(m.reviewsPaging," review__paging")},r.a.createElement(N.a,{textShowRows:"",currentItemFrom:T.from,currentItemTo:T.to,textOf:a.formatMessage(B.textOf),totalItems:T.total,onNextClick:function(){x({type:"SET_NEXT_PAGE"})},onPrevClick:function(){x({type:"SET_PREV_PAGE"})}}))):r.a.createElement("div",{className:"review__comment bw2 bb b--muted-5 mb5 pb4"},r.a.createElement("h5",{className:"review__comment--user lh-copy mw9 t-heading-5 mv5"},r.a.createElement(l.FormattedMessage,{id:"store/reviews.list.emptyState"})))))}},9:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/useCssHandles"]}},[[83,"common",3,0,2]]]);; (window.webpackJsonpvtex_reviews_and_ratings_2_13_0=window.webpackJsonpvtex_reviews_and_ratings_2_13_0||[]).push([["RatingInline"],{0:function(e,n){e.exports=React},12:function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProduct"]},30:function(e,n){var a={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@2.13.0",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:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"1670454bbafec49d1d1b1520f2e5fa82aaf7d7f21dec8e965b18da0a99f7ee49",block:!1}}]}]}]}}],loc:{start:0,end:243}};a.loc.source={body:'query TotalReviewsByProductId($productId: String!) @context(sender: "vtex.reviews-and-ratings@2.13.0") {\n totalReviewsByProductId(productId: $productId) @runtimeMeta(hash: "1670454bbafec49d1d1b1520f2e5fa82aaf7d7f21dec8e965b18da0a99f7ee49")\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var t={};function i(e,n){for(var a=0;a0;){var d=s;s=new Set,d.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(n){var t=i(e,n);t&&a.definitions.push(t)})),a}(a,"TotalReviewsByProductId")},7:function(e,n){e.exports=ReactApollo},77:function(e,n,a){"use strict";a.r(n),function(e){var n=a(4);a.p=Object(n.getPublicPath)("vtex.reviews-and-ratings@2.13.0");var t=Object(n.register)((function(){return a(78)}),e,"vtex.reviews-and-ratings@2.13.0","vtex.reviews-and-ratings@2.x","RatingInline");t.renderHotReload,t.setupHMR}.call(this,a(17)(e))},78:function(e,n,a){"use strict";a.r(n);var t=a(2),i=a(0),r=a.n(i),o=a(7),s=a(9),d=a.n(s),u=a(12),c=a.n(u),l=a(13),v=a(30),f=a.n(v),m=a(21),p=a.n(m),g=a(22),y=a.n(g),b={total:0,average:0,hasTotal:!1,hasAverage:!1,settings:{defaultOpen:!1,defaultOpenCount:0,allowAnonymousReviews:!1,requireApproval:!0,useLocation:!1,showGraph:!1,displaySummaryIfNone:!1,displayInlineIfNone:!1,displaySummaryTotalReviews:!0,displaySummaryAddButton:!1}},k=function(e,n){switch(n.type){case"SET_TOTAL":return Object.assign(Object.assign({},e),{total:n.args.total,hasTotal:!0});case"SET_AVERAGE":return Object.assign(Object.assign({},e),{average:n.args.average,hasAverage:!0});case"SET_SETTINGS":return Object.assign(Object.assign({},e),{settings:n.args.settings});default:return e}},h=["inlineContainer"];n.default=function(){var e,n=Object(o.useApolloClient)(),a=d()(h),s=(null!==(e=c()())&&void 0!==e?e:{}).product,u=(null!=s?s:{}).productId,v=Object(i.useReducer)(k,b),m=Object(t.a)(v,2),g=m[0],w=m[1];return Object(i.useEffect)((function(){u&&(n.query({query:f.a,variables:{productId:u}}).then((function(e){var n=e.data.totalReviewsByProductId;w({type:"SET_TOTAL",args:{total:n}})})),n.query({query:p.a,variables:{productId:u}}).then((function(e){var n=e.data.averageRatingByProductId;w({type:"SET_AVERAGE",args:{average:n}})})),n.query({query:y.a}).then((function(e){var n=e.data.appSettings;w({type:"SET_SETTINGS",args:{settings:n}})})))}),[n,u]),r.a.createElement("div",{className:"".concat(a.inlineContainer," review-summary mw8 center")},g.hasTotal&&g.hasAverage&&(0!==g.total||g.settings.displayInlineIfNone)?r.a.createElement(i.Fragment,null,r.a.createElement("span",{className:"t-heading-5 v-mid"},r.a.createElement(l.a,{rating:g.average}))):null)}},9:function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/useCssHandles"]}},[[77,"common",0]]]);; (window.webpackJsonpvtex_reviews_and_ratings_2_13_0=window.webpackJsonpvtex_reviews_and_ratings_2_13_0||[]).push([["RatingSummary"],{0:function(e,t){e.exports=React},1:function(e,t){e.exports=ReactIntl},12:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProduct"]},30:function(e,t){var a={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@2.13.0",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:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"1670454bbafec49d1d1b1520f2e5fa82aaf7d7f21dec8e965b18da0a99f7ee49",block:!1}}]}]}]}}],loc:{start:0,end:243}};a.loc.source={body:'query TotalReviewsByProductId($productId: String!) @context(sender: "vtex.reviews-and-ratings@2.13.0") {\n totalReviewsByProductId(productId: $productId) @runtimeMeta(hash: "1670454bbafec49d1d1b1520f2e5fa82aaf7d7f21dec8e965b18da0a99f7ee49")\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var n={};function i(e,t){for(var a=0;a0;){var c=s;s=new Set,c.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&a.definitions.push(n)})),a}(a,"TotalReviewsByProductId")},31:function(e,t){e.exports=ReactHelmet},32:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(5),i=function(){var e=n.canUseDOM?window.location.hostname:global.__hostname__,t=n.canUseDOM?window.__RUNTIME__.rootPath:global.__RUNTIME__.rootPath;return"".concat("https","://").concat(e).concat(null!=t?t:"")}},5:function(e,t){e.exports=__RENDER_8_RUNTIME__},7:function(e,t){e.exports=ReactApollo},79:function(e,t,a){"use strict";a.r(t),function(e){var t=a(4);a.p=Object(t.getPublicPath)("vtex.reviews-and-ratings@2.13.0");var n=Object(t.register)((function(){return a(80)}),e,"vtex.reviews-and-ratings@2.13.0","vtex.reviews-and-ratings@2.x","RatingSummary");n.renderHotReload,n.setupHMR}.call(this,a(17)(e))},8:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Button"]},80:function(e,t,a){"use strict";a.r(t);var n=a(2),i=a(0),r=a.n(i),o=a(31),s=a(7),c=a(12),u=a.n(c),l=a(9),d=a.n(l),m=a(1),v=a(5),g=a(8),f=a.n(g),p=a(22),_=a.n(p),w=a(13),y=a(30),E=a.n(y),h=a(21),b=a.n(h),N=a(32),R={total:0,average:0,hasTotal:!1,hasAverage:!1,settings:{defaultOpen:!1,defaultOpenCount:0,allowAnonymousReviews:!1,requireApproval:!0,useLocation:!1,showGraph:!1,displaySummaryIfNone:!1,displayInlineIfNone:!1,displaySummaryTotalReviews:!0,displaySummaryAddButton:!1},userAuthenticated:!1},S=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"],k=Object(m.defineMessages)({loadingReviews:{id:"store/reviews.list.loadingReviews",defaultMessage:"Loading reviews..."}});t.default=function(){var e,t=Object(m.useIntl)(),a=Object(s.useApolloClient)(),c=d()(T),l=(null!==(e=u()())&&void 0!==e?e:{}).product,g=null!=l?l:{},p=g.productId,y=g.productName,h=g.linkText,O=Object(i.useReducer)(S,R),I=Object(n.a)(O,2),x=I[0],A=I[1],j=(v.canUseDOM?{url:window.location.pathname+window.location.hash,pathName:window.location.pathname}:{url:global.__pathname__,pathName:global.__pathname__}).url;Object(i.useEffect)((function(){p&&(a.query({query:E.a,variables:{productId:p}}).then((function(e){var t=e.data.totalReviewsByProductId;A({type:"SET_TOTAL",args:{total:t}})})),a.query({query:b.a,variables:{productId:p}}).then((function(e){var t=e.data.averageRatingByProductId;A({type:"SET_AVERAGE",args:{average:t}})})),a.query({query:_.a}).then((function(e){var t=e.data.appSettings;A({type:"SET_SETTINGS",args:{settings:t}})})))}),[a,p]),Object(i.useEffect)((function(){window.__RENDER_8_SESSION__.sessionPromise.then((function(e){var t,a,n=e.response;if(n&&n.namespaces){var i=n.namespaces;(null===(a=null===(t=null==i?void 0:i.authentication)||void 0===t?void 0:t.storeUserId)||void 0===a?void 0:a.value)&&A({type:"SET_AUTHENTICATED",args:{authenticated:!0}})}}))}),[]);var D=Object(N.a)();return r.a.createElement("div",{className:"".concat(c.summaryContainer," review-summary mw8 center")},x.hasTotal&&x.hasAverage?0!==x.total||x.settings.displaySummaryIfNone?r.a.createElement(i.Fragment,null,r.a.createElement(o.Helmet,null,r.a.createElement("script",{type:"application/ld+json"},JSON.stringify({"@context":"http://schema.org","@type":"Product","@id":"".concat(D,"/").concat(h,"/p"),aggregateRating:{"@type":"AggregateRating",ratingValue:x.average.toString(),reviewCount:x.total.toString()},name:y}))),r.a.createElement("span",{className:"t-heading-4 v-mid"},r.a.createElement(w.a,{rating:x.average}))," ",x.settings.displaySummaryTotalReviews?r.a.createElement("span",{className:"".concat(c.summaryTotalReviews," review__rating--count dib v-mid")},"(",x.total,")"):null,x.settings.displaySummaryAddButton?x.settings&&x.settings.allowAnonymousReviews||x.settings&&!x.settings.allowAnonymousReviews&&x.userAuthenticated?r.a.createElement("div",{className:"".concat(c.summaryButtonContainer)},r.a.createElement(f.a,{onClick:function(){var e;(e=document.getElementById("reviews-main-container"))&&e.scrollIntoView()}},r.a.createElement(m.FormattedMessage,{id:"store/reviews.list.writeReview"}))):r.a.createElement("div",{className:"".concat(c.summaryButtonContainer)},r.a.createElement(v.Link,{page:"store.login",query:"returnUrl=".concat(encodeURIComponent(j)),className:"".concat(c.loginLink," h1 w2 tc flex items-center w-100-s h-100-s pa4-s")},r.a.createElement(m.FormattedMessage,{id:"store/reviews.list.login"}))):null):null:r.a.createElement(i.Fragment,null,t.formatMessage(k.loadingReviews)))}},9:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/useCssHandles"]}},[[79,"common",0]]]);; !function(e){function t(t){for(var n,u,a=t[0],c=t[1],l=t[2],d=0,s=[];de.length)&&(t=e.length);for(var r=0,n=new Array(t);re?e:t},S=function(t,e){var n=parseInt(t,10);return Number.isNaN(n)?1:q(parseInt(t,10),e)},f=["quantitySelectorDropdownMobileContainer","quantitySelectorDropdownContainer","quantitySelectorInputMobileContainer","quantitySelectorInputContainer"],h=function(t){var e=t.itemId,n=t.selectedQuantity,a=t.size,l=void 0===a?"small":a,u=t.onChange,c=t.availableQuantity,s=Object(i.useState)("dropdown"),m=Object(d.a)(s,2),y=m[0],h=m[1],w=Object(i.useState)("".concat(n)),C=Object(d.a)(w,2),g=C[0],M=C[1],Q=b()().isMobile,E=r()(f),I=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}(c),N=function(t){var e=S(t,c),n=function(t,e){var n=parseInt(t,10);return Number.isNaN(n)||n<1?"":"".concat(q(n,e))}(t,c);"dropdown"===y&&e>=Math.min(c+1,10)&&h("input"),M(n),u({value:e})};return"dropdown"===y?o.a.createElement("div",{className:Q?E.quantitySelectorDropdownMobileContainer:E.quantitySelectorDropdownContainer},o.a.createElement(v.a,{id:"".concat(Q?"quantity-dropdown-mobile":"quantity-dropdown","-").concat(e),testId:"".concat(Q?"quantity-dropdown-mobile":"quantity-dropdown","-").concat(e),options:I,size:l,value:n,onChange:function(t){return N(t.target.value)},placeholder:" "})):o.a.createElement("div",{className:Q?E.quantitySelectorInputMobileContainer:E.quantitySelectorInputContainer},o.a.createElement(p.a,{id:"".concat(Q?"quantity-input-mobile":"quantity-input","-").concat(e),size:l,value:g,maxLength:5,onChange:function(t){return N(t.target.value)},onBlur:function(){""===g&&M("1");var t=S(g,c);t1&&console.warn('[product-specification-badges] The specification "'.concat(e.specification.name,'" have multiple values (').concat(o.join(","),') but the "multipleValuesSeparator" prop was not set. Please refer to this app\'s documentation for further detail on how to show all the values at once: https://vtex.io/docs/app/vtex.product-specification-badges')))}if(t===n.specificationName&&(a=e.specification.name),!t)return console.warn("You need to set a `displayValue` for the `product-specification-badges` block, either `SPECIFICATION_VALUE` or `SPECIFICATION_NAME`"),null;var r=f(e.specification.name),s=a&&f(a),p=function(e,i,t){var a="";return e&&(i||(a+="mt2 "),t||(a+="mb2 ")),e||(i||(a+="ml2 "),t||(a+="mr2 ")),a.trim()}(O,0===i,i===y.length-1),u=Object(m.useIntl)();return c.a.createElement("div",{"aria-label":u.formatMessage({id:"store/product-specification-badges.baseSpecificationBadges.aria-label"},{Badge:t}),key:"".concat(e.specification.name,"-").concat(a),className:"".concat(l()(E.badgeContainer,r)," ").concat(p,' bg-base flex items-center justify-center"')},c.a.createElement("span",{className:"".concat(l()(E.badgeText,s||"")," ma3 t-body c-muted-1 tc")},a))})))};b.schema={type:"object",properties:{specificationGroupName:{type:"string",title:"admin/editor.product-specification-badges.specificationGroupName.title",description:"admin/editor.product-specification-badges.specificationGroupName.description"},specificationName:{type:"string",title:"admin/editor.product-specification-badges.specificationName.title",description:"admin/editor.product-specification-badges.specificationName.description"},visibleWhen:{type:"string",title:"admin/editor.product-specification-badges.visibleWhen.title",description:"admin/editor.product-specification-badges.visibleWhen.description"},displayValue:{type:"string",title:"admin/editor.product-specification-badges.displayValue.title",description:"admin/editor.product-specification-badges.displayValue.description"},orientation:{title:"admin/editor.product-specification-badges.orientation.title",description:"admin/editor.product-specification-badges.orientation.description",enum:["vertical","horizontal"],enumNames:["admin/editor.product-specification-badges.orientation.vertical","admin/editor.product-specification-badges.orientation.horizontal"],type:"string",default:"vertical",widget:{"ui:widget":"radio","ui:options":{inline:!0}}},specificationsOptions:{type:"array",title:"admin/editor.product-specification-badges.specificationsOptions.title",description:"admin/editor.product-specification-badges.specificationsOptions.description",items:{title:"admin/editor.product-specification-badges.specificationsOptions.item.title",type:"object",properties:{specificationName:{type:"string",title:"admin/editor.product-specification-badges.specificationName.title"},visibleWhen:{type:"string",title:"admin/editor.product-specification-badges.visibleWhen.title"},displayValue:{type:"string",title:"admin/editor.product-specification-badges.displayValue.title"}}}}}};i.a=b},7:function(e,i,t){var a;a=function(){var e=JSON.parse('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","‘":"\'","’":"\'","“":"\\"","”":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial"}'),i=JSON.parse('{"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue"},"vi":{"Đ":"D","đ":"d"}}');function t(t,a){if("string"!=typeof t)throw new Error("slugify: string argument expected");var n=i[(a="string"==typeof a?{replacement:a}:a||{}).locale]||{},o=void 0===a.replacement?"-":a.replacement,c=t.split("").reduce((function(i,t){return i+(n[t]||e[t]||t).replace(a.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")}),"").trim().replace(new RegExp("[\\s"+o+"]+","g"),o);return a.lower&&(c=c.toLowerCase()),a.strict&&(c=c.replace(new RegExp("[^a-zA-Z0-9"+o+"]","g"),"").replace(new RegExp("[\\s"+o+"]+","g"),o)),c}return t.extend=function(i){for(var t in i)e[t]=i[t]},t},e.exports=a(),e.exports.default=a()}}]);; (window.webpackJsonpvtex_product_specification_badges_0_4_1=window.webpackJsonpvtex_product_specification_badges_0_4_1||[]).push([["index"],[function(e,t){e.exports=React},,,function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/applyModifiers"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/useCssHandles"]},function(e,t){e.exports=ReactIntl},,,function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProduct"]},,,function(e,t,i){"use strict";i.r(t),function(e){var t=i(1);i.p=Object(t.getPublicPath)("vtex.product-specification-badges@0.4.1");var c=Object(t.register)((function(){return i(12)}),e,"vtex.product-specification-badges@0.4.1","vtex.product-specification-badges@0.x","index");c.renderHotReload,c.setupHMR}.call(this,i(6)(e))},function(e,t,i){"use strict";i.r(t);var c=i(0),n=i.n(c),o=i(8),s=i.n(o),a=i(2),p=function(e){var t=e.specificationGroupName,i=e.visibleWhen,c=e.specificationsOptions,o=e.specificationName,p=e.displayValue,r=e.orientation,u=e.multipleValuesSeparator,d=s()();if(null==(null==d?void 0:d.product))return null;var l=d.product;return n.a.createElement(a.a,{product:l,orientation:r,specificationGroupName:t,visibleWhen:i,specificationsOptions:c,specificationName:o,displayValue:p,multipleValuesSeparator:u})};p.schema=Object.assign(Object.assign({},a.a.schema),{title:"admin/editor.product-specification-badges.title",description:"admin/editor.product-specification-badges.description"}),t.default=p}],[[11,"common",0]]]);; !function(t){function e(e){for(var r,u,c=e[0],a=e[1],l=e[2],s=0,d=[];st.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(e){function t(t){for(var n,a,u=t[0],c=t[1],l=t[2],s=0,d=[];se.length)&&(t=e.length);for(var r=0,n=new Array(t);r0;){var r=l;l=new Set,r.forEach((function(e){m.has(e)||(m.add(e),(a[e]||new Set).forEach((function(e){l.add(e)})))}))}return m.forEach((function(n){var a=t(e,n);a&&i.definitions.push(a)})),i}(i,"Product")}}]);; (window.webpackJsonpvtex_store_resources_0_104_2=window.webpackJsonpvtex_store_resources_0_104_2||[]).push([["QueryProduct"],{82:function(e,r,t){"use strict";t.r(r),function(e){var r=t(0);t.p=Object(r.getPublicPath)("vtex.store-resources@0.104.2");var s=Object(r.register)((function(){return t(83)}),e,"vtex.store-resources@0.104.2","vtex.store-resources@0.x","QueryProduct");s.renderHotReload,s.setupHMR}.call(this,t(2)(e))},83:function(e,r,t){"use strict";t.r(r);var s=t(18),o=t.n(s);r.default=o.a}},[[82,"common",4]]]);; (window.webpackJsonpvtex_store_resources_0_104_2=window.webpackJsonpvtex_store_resources_0_104_2||[]).push([[5],{23:function(e,n){var i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ProductBenefits"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"slug"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"identifier"}},type:{kind:"NamedType",name:{kind:"Name",value:"ProductUniqueIdentifier"}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.store-resources@0.104.2",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"product"},arguments:[{kind:"Argument",name:{kind:"Name",value:"slug"},value:{kind:"Variable",name:{kind:"Name",value:"slug"}}},{kind:"Argument",name:{kind:"Name",value:"identifier"},value:{kind:"Variable",name:{kind:"Name",value:"identifier"}}}],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:"fad2dcd77bd0b253a4e65d3831cef8ba02ba5d6790b63f8222bcf4cf874f01fc",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cacheId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"benefits"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"featured"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"items"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"benefitProduct"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cacheId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"productName"},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:"linkText"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"categoryId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"brand"},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:"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:"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:"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:"imageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageLabel"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageTag"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageText"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"sellers"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sellerId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sellerName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"addToCartLink"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sellerDefault"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"commertialOffer"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"Price"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ListPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"PriceWithoutDiscount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"RewardValue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"PriceValidUntil"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"AvailableQuantity"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"Tax"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"CacheVersionUsedToCallCheckout"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"Installments"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"Value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"InterestRate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"TotalValuePlusInterestRate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"NumberOfInstallments"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"Name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"PaymentSystemName"},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:"variations"},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:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"discount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"minQuantity"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"benefitSKUIds"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"teaserType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:2397}};i.loc.source={body:'query ProductBenefits($slug: String, $identifier: ProductUniqueIdentifier) @context(sender: "vtex.store-resources@0.104.2") {\n product(slug: $slug, identifier: $identifier) @context(provider: "vtex.search-graphql") @runtimeMeta(hash: "fad2dcd77bd0b253a4e65d3831cef8ba02ba5d6790b63f8222bcf4cf874f01fc") {\n cacheId\n benefits {\n featured\n id\n name\n items {\n benefitProduct {\n cacheId\n productName\n productId\n description\n linkText\n categoryId\n brand\n properties {\n name\n values\n __typename\n }\n specificationGroups {\n name\n originalName\n specifications {\n name\n originalName\n values\n __typename\n }\n __typename\n }\n items {\n itemId\n name\n nameComplete\n complementName\n ean\n referenceId {\n Key\n Value\n __typename\n }\n measurementUnit\n unitMultiplier\n images {\n imageId\n imageLabel\n imageTag\n imageUrl\n imageText\n __typename\n }\n sellers {\n sellerId\n sellerName\n addToCartLink\n sellerDefault\n commertialOffer {\n Price\n ListPrice\n PriceWithoutDiscount\n RewardValue\n PriceValidUntil\n AvailableQuantity\n Tax\n CacheVersionUsedToCallCheckout\n Installments {\n Value\n InterestRate\n TotalValuePlusInterestRate\n NumberOfInstallments\n Name\n PaymentSystemName\n __typename\n }\n __typename\n }\n __typename\n }\n variations {\n name\n __typename\n }\n __typename\n }\n __typename\n }\n discount\n minQuantity\n benefitSKUIds\n __typename\n }\n teaserType\n __typename\n }\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var a={};function d(e,n){for(var i=0;i0;){var r=l;l=new Set,r.forEach((function(e){m.has(e)||(m.add(e),(a[e]||new Set).forEach((function(e){l.add(e)})))}))}return m.forEach((function(n){var a=d(e,n);a&&i.definitions.push(a)})),i}(i,"ProductBenefits")}}]);;