geno/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/reviews-frontend.js
2024-02-01 11:54:18 +00:00

4 lines
No EOL
20 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(()=>{var e={4184:(e,t)=>{var r;!function(){"use strict";var s={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var n=typeof r;if("string"===n||"number"===n)e.push(r);else if(Array.isArray(r)){if(r.length){var i=o.apply(null,r);i&&e.push(i)}}else if("object"===n)if(r.toString===Object.prototype.toString)for(var a in r)s.call(r,a)&&r[a]&&e.push(a);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},4578:()=>{},7349:()=>{},8204:()=>{},4093:()=>{},8543:()=>{}},t={};function r(s){var o=t[s];if(void 0!==o)return o.exports;var n=t[s]={exports:{}};return e[s](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.React,t=window.wp.element;function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==s(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!==s(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===s(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const n=window.wp.i18n,i=window.wc.wcSettings;var a,l,c,d,p,u,w,m,g,h;const v=(0,i.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),b=v.pluginUrl+"images/",y=(v.pluginUrl,v.buildPhase,null===(a=i.STORE_PAGES.shop)||void 0===a||a.permalink,null===(l=i.STORE_PAGES.checkout)||void 0===l||l.id,null===(c=i.STORE_PAGES.checkout)||void 0===c||c.permalink,null===(d=i.STORE_PAGES.privacy)||void 0===d||d.permalink,null===(p=i.STORE_PAGES.privacy)||void 0===p||p.title,null===(u=i.STORE_PAGES.terms)||void 0===u||u.permalink,null===(w=i.STORE_PAGES.terms)||void 0===w||w.title,null===(m=i.STORE_PAGES.cart)||void 0===m||m.id,null===(g=i.STORE_PAGES.cart)||void 0===g||g.permalink,null!==(h=i.STORE_PAGES.myaccount)&&void 0!==h&&h.permalink?i.STORE_PAGES.myaccount.permalink:(0,i.getSetting)("wpLoginUrl","/wp-login.php"),(0,i.getSetting)("localPickupEnabled",!1),(0,i.getSetting)("countries",{})),_=(0,i.getSetting)("countryData",{}),f=(Object.fromEntries(Object.keys(_).filter((e=>!0===_[e].allowBilling)).map((e=>[e,y[e]||""]))),Object.fromEntries(Object.keys(_).filter((e=>!0===_[e].allowBilling)).map((e=>[e,_[e].states||[]]))),Object.fromEntries(Object.keys(_).filter((e=>!0===_[e].allowShipping)).map((e=>[e,y[e]||""]))),Object.fromEntries(Object.keys(_).filter((e=>!0===_[e].allowShipping)).map((e=>[e,_[e].states||[]]))),Object.fromEntries(Object.keys(_).map((e=>[e,_[e].locale||[]]))),({imageUrl:t=`${b}/block-error.svg`,header:r=(0,n.__)("Oops!","woocommerce"),text:s=(0,n.__)("There was an error loading the content.","woocommerce"),errorMessage:o,errorMessagePrefix:i=(0,n.__)("Error:","woocommerce"),button:a,showErrorBlock:l=!0})=>l?(0,e.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&(0,e.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),(0,e.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&(0,e.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),s&&(0,e.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},s),o&&(0,e.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},i?i+" ":"",o),a&&(0,e.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},a))):null);r(4578);class k extends t.Component{constructor(...e){super(...e),o(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(t){return void 0!==t.statusText&&void 0!==t.status?{errorMessage:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("strong",null,t.status),": ",t.statusText),hasError:!0}:{errorMessage:t.message,hasError:!0}}render(){const{header:t,imageUrl:r,showErrorMessage:s=!0,showErrorBlock:o=!0,text:n,errorMessagePrefix:i,renderError:a,button:l}=this.props,{errorMessage:c,hasError:d}=this.state;return d?"function"==typeof a?a({errorMessage:c}):(0,e.createElement)(f,{showErrorBlock:o,errorMessage:s?c:null,header:t,imageUrl:r,text:n,errorMessagePrefix:i,button:l}):this.props.children}}const E=k,R=[".wp-block-woocommerce-cart"],S=({Block:r,containers:s,getProps:o=(()=>({})),getErrorBoundaryProps:n=(()=>({}))})=>{0!==s.length&&Array.prototype.forEach.call(s,((s,i)=>{const a=o(s,i),l=n(s,i),c={...s.dataset,...a.attributes||{}};(({Block:r,container:s,attributes:o={},props:n={},errorBoundaryProps:i={}})=>{(0,t.render)((0,e.createElement)(E,{...i},(0,e.createElement)(t.Suspense,{fallback:(0,e.createElement)("div",{className:"wc-block-placeholder"})},r&&(0,e.createElement)(r,{...n,attributes:o}))),s,(()=>{s.classList&&s.classList.remove("is-loading")}))})({Block:r,container:s,props:a,attributes:c,errorBoundaryProps:l})}))},O=window.wp.a11y,P=window.wp.apiFetch;var L=r.n(P),x=r(4184),T=r.n(x);r(7349);const A=({label:r,screenReaderLabel:s,wrapperElement:o,wrapperProps:n={}})=>{let i;const a=null!=r,l=null!=s;return!a&&l?(i=o||"span",n={...n,className:T()(n.className,"screen-reader-text")},(0,e.createElement)(i,{...n},s)):(i=o||t.Fragment,a&&l&&r!==s?(0,e.createElement)(i,{...n},(0,e.createElement)("span",{"aria-hidden":"true"},r),(0,e.createElement)("span",{className:"screen-reader-text"},s)):(0,e.createElement)(i,{...n},r))},N=({onClick:t,label:r=(0,n.__)("Load more","woocommerce"),screenReaderLabel:s=(0,n.__)("Load more","woocommerce")})=>(0,e.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},(0,e.createElement)("button",{className:"wp-block-button__link",onClick:t},(0,e.createElement)(A,{label:r,screenReaderLabel:s}))),M=window.wc.blocksComponents;r(8543);const C=({onChange:t,readOnly:r,value:s})=>(0,e.createElement)(M.SortSelect,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",label:(0,n.__)("Order by","woocommerce"),onChange:t,options:[{key:"most-recent",label:(0,n.__)("Most recent","woocommerce")},{key:"highest-rating",label:(0,n.__)("Highest rating","woocommerce")},{key:"lowest-rating",label:(0,n.__)("Lowest rating","woocommerce")}],readOnly:r,screenReaderLabel:(0,n.__)("Order reviews by","woocommerce"),value:s});function B(e){let t,r,s,o=[];for(let n=0;n<e.length;n++)t=e.substring(n),r=t.match(/^&[a-z0-9#]+;/),r?(s=r[0],o.push(s),n+=s.length-1):o.push(e[n]);return o}const j=(e,t,r="...")=>{const s=function(e,t){const r=(t=t||{}).limit||100,s=void 0===t.preserveTags||t.preserveTags,o=void 0!==t.wordBreak&&t.wordBreak,n=t.suffix||"...",i=t.moreLink||"",a=t.moreText||"»",l=t.preserveWhiteSpace||!1,c=e.replace(/</g,"\n<").replace(/>/g,">\n").replace(/\n\n/g,"\n").replace(/^\n/g,"").replace(/\n$/g,"").split("\n");let d,p,u,w,m,g,h=0,v=[],b=!1;for(let e=0;e<c.length;e++){if(d=c[e],w=l?d:d.replace(/[ ]+/g," "),!d.length)continue;const t=B(w);if("<"!==d[0])if(h>=r)d="";else if(h+t.length>=r){if(p=r-h," "===t[p-1])for(;p&&(p-=1," "===t[p-1]););else u=t.slice(p).indexOf(" "),o||(-1!==u?p+=u:p=d.length);d=t.slice(0,p).join("")+n,i&&(d+='<a href="'+i+'" style="display:inline">'+a+"</a>"),h=r,b=!0}else h+=t.length;else if(s){if(h>=r)if(m=d.match(/[a-zA-Z]+/),g=m?m[0]:"",g)if("</"!==d.substring(0,2))v.push(g),d="";else{for(;v[v.length-1]!==g&&v.length;)v.pop();v.length&&(d=""),v.pop()}else d=""}else d="";c[e]=d}return{html:c.join("\n").replace(/\n/g,""),more:b}}(e,{suffix:r,limit:t});return s.html},D=(e,t,r)=>(t<=r?e.start=e.middle+1:e.end=e.middle-1,e),I=(e,t,r,s)=>{const o=((e,t,r)=>{let s={start:0,middle:0,end:e.length};for(;s.start<=s.end;)s.middle=Math.floor((s.start+s.end)/2),t.innerHTML=j(e,s.middle),s=D(s,t.clientHeight,r);return s.middle})(e,t,r);return j(e,o-s.length,s)},G={className:"read-more-content",ellipsis:"&hellip;",lessText:(0,n.__)("Read less","woocommerce"),maxLines:3,moreText:(0,n.__)("Read more","woocommerce")};class H extends t.Component{constructor(e){super(e),o(this,"reviewSummary",void 0),o(this,"reviewContent",void 0),this.state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},this.reviewContent=(0,t.createRef)(),this.reviewSummary=(0,t.createRef)(),this.getButton=this.getButton.bind(this),this.onClick=this.onClick.bind(this)}componentDidMount(){this.setSummary()}componentDidUpdate(e){e.maxLines===this.props.maxLines&&e.children===this.props.children||this.setState({clampEnabled:null,summary:"."},this.setSummary)}setSummary(){if(this.props.children){const{maxLines:e,ellipsis:t}=this.props;if(!this.reviewSummary.current||!this.reviewContent.current)return;const r=(this.reviewSummary.current.clientHeight+1)*e+1,s=this.reviewContent.current.clientHeight+1>r;this.setState({clampEnabled:s}),s&&this.setState({summary:I(this.reviewContent.current.innerHTML,this.reviewSummary.current,r,t)})}}getButton(){const{isExpanded:t}=this.state,{className:r,lessText:s,moreText:o}=this.props,n=t?s:o;if(n)return(0,e.createElement)("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!t,role:"button"},n)}onClick(e){e.preventDefault();const{isExpanded:t}=this.state;this.setState({isExpanded:!t})}render(){const{className:t}=this.props,{content:r,summary:s,clampEnabled:o,isExpanded:n}=this.state;return r?!1===o?(0,e.createElement)("div",{className:t},(0,e.createElement)("div",{ref:this.reviewContent},r)):(0,e.createElement)("div",{className:t},(!n||null===o)&&(0,e.createElement)("div",{ref:this.reviewSummary,"aria-hidden":n,dangerouslySetInnerHTML:{__html:s}}),(n||null===o)&&(0,e.createElement)("div",{ref:this.reviewContent,"aria-hidden":!n},r),this.getButton()):null}}o(H,"defaultProps",G);const U=H;r(8204);const F=({attributes:t,review:r={}})=>{const{imageType:s,showReviewDate:o,showReviewerName:i,showReviewImage:a,showReviewRating:l,showReviewContent:c,showProductName:d}=t,{rating:p}=r,u=!(Object.keys(r).length>0),w=Number.isFinite(p)&&l;return(0,e.createElement)("li",{className:T()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":u,"wc-block-components-review-list-item__item--has-image":a}),"aria-hidden":u},(d||o||i||a||w)&&(0,e.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},a&&function(t,r,s){var o,i;return s||!t?(0,e.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"}):(0,e.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===r?(0,e.createElement)("img",{"aria-hidden":"true",alt:(null===(o=t.product_image)||void 0===o?void 0:o.alt)||"",src:(null===(i=t.product_image)||void 0===i?void 0:i.thumbnail)||""}):(0,e.createElement)("img",{"aria-hidden":"true",alt:"",src:t.reviewer_avatar_urls[96]||""}),t.verified&&(0,e.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:(0,n.__)("Verified buyer","woocommerce")},(0,n.__)("Verified buyer","woocommerce")))}(r,s,u),(d||i||w||o)&&(0,e.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},w&&function(t){const{rating:r}=t,s={width:r/5*100+"%"},o=(0,n.sprintf)(/* translators: %f is referring to the average rating value */
(0,n.__)("Rated %f out of 5","woocommerce"),r),i={__html:(0,n.sprintf)(/* translators: %s is referring to the average rating value */
(0,n.__)("Rated %s out of 5","woocommerce"),(0,n.sprintf)('<strong class="rating">%f</strong>',r))};return(0,e.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},(0,e.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":o},(0,e.createElement)("span",{style:s,dangerouslySetInnerHTML:i})))}(r),d&&function(t){return(0,e.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},(0,e.createElement)("a",{href:t.product_permalink,dangerouslySetInnerHTML:{__html:t.product_name}}))}(r),i&&function(t){const{reviewer:r=""}=t;return(0,e.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},r)}(r),o&&function(t){const{date_created:r,formatted_date_created:s}=t;return(0,e.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:r},s)}(r))),c&&function(t){return(0,e.createElement)(U,{maxLines:10,moreText:(0,n.__)("Read full review","woocommerce"),lessText:(0,n.__)("Hide full review","woocommerce"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},(0,e.createElement)("div",{dangerouslySetInnerHTML:{__html:t.review||""}}))}(r))};r(4093);const q=({attributes:t,reviews:r})=>{const s=(0,i.getSetting)("showAvatars",!0),o=(0,i.getSetting)("reviewRatingsEnabled",!0),n=(s||"product"===t.imageType)&&t.showReviewImage,a=o&&t.showReviewRating,l={...t,showReviewImage:n,showReviewRating:a};return(0,e.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?(0,e.createElement)(F,{attributes:l}):r.map(((t,r)=>(0,e.createElement)(F,{key:t.id||r,attributes:l,review:t}))))},V=window.wp.isShallowEqual;var W=r.n(V);const $=(r=>{class s extends t.Component{constructor(...e){super(...e),o(this,"isPreview",!!this.props.attributes.previewReviews),o(this,"delayedAppendReviews",this.props.delayFunction(this.appendReviews)),o(this,"isMounted",!1),o(this,"state",{error:null,loading:!0,reviews:this.isPreview?this.props.attributes.previewReviews:[],totalReviews:this.isPreview?this.props.attributes.previewReviews.length:0}),o(this,"setError",(async e=>{if(!this.isMounted)return;const{onReviewsLoadError:t}=this.props,r=await(async e=>{if(!("json"in e))return{message:e.message,type:e.type||"general"};try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}})(e);this.setState({reviews:[],loading:!1,error:r}),t(r)}))}componentDidMount(){this.isMounted=!0,this.replaceReviews()}componentDidUpdate(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}shouldReplaceReviews(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!W()(e.categoryIds,t.categoryIds)}componentWillUnmount(){this.isMounted=!1,this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}getArgs(e){const{categoryIds:t,order:r,orderby:s,productId:o,reviewsToDisplay:n}=this.props,i={order:r,orderby:s,per_page:n-e,offset:e};if(t){const e=Array.isArray(t)?t:JSON.parse(t);i.category_id=Array.isArray(e)?e.join(","):e}return o&&(i.product_id=o),i}replaceReviews(){if(this.isPreview)return;const{onReviewsReplaced:e}=this.props;this.updateListOfReviews().then(e)}appendReviews(){if(this.isPreview)return;const{onReviewsAppended:e,reviewsToDisplay:t}=this.props,{reviews:r}=this.state;t<=r.length||this.updateListOfReviews(r).then(e)}updateListOfReviews(e=[]){const{reviewsToDisplay:t}=this.props,{totalReviews:r}=this.state,s=Math.min(r,t)-e.length;return this.setState({loading:!0,reviews:e.concat(Array(s).fill({}))}),(o=this.getArgs(e.length),L()({path:"/wc/store/v1/products/reviews?"+Object.entries(o).map((e=>e.join("="))).join("&"),parse:!1}).then((e=>e.json().then((t=>({reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)})))))).then((({reviews:t,totalReviews:r})=>(this.isMounted&&this.setState({reviews:e.filter((e=>Object.keys(e).length)).concat(t),totalReviews:r,loading:!1,error:null}),{newReviews:t}))).catch(this.setError);var o}render(){const{reviewsToDisplay:t}=this.props,{error:s,loading:o,reviews:n,totalReviews:i}=this.state;return(0,e.createElement)(r,{...this.props,error:s,isLoading:o,reviews:n.slice(0,t),totalReviews:i})}}o(s,"defaultProps",{delayFunction:e=>e,onReviewsAppended:()=>{},onReviewsLoadError:()=>{},onReviewsReplaced:()=>{}});const{displayName:n=r.name||"Component"}=r;return s.displayName=`WithReviews( ${n} )`,s})((({attributes:t,onAppendReviews:r,onChangeOrderby:s,reviews:o,sortSelectValue:a,totalReviews:l})=>{if(0===o.length)return null;const c=(0,i.getSetting)("reviewRatingsEnabled",!0);return(0,e.createElement)(e.Fragment,null,t.showOrderby&&c&&(0,e.createElement)(C,{value:a,onChange:s}),(0,e.createElement)(q,{attributes:t,reviews:o}),t.showLoadMore&&l>o.length&&(0,e.createElement)(N,{onClick:r,screenReaderLabel:(0,n.__)("Load more reviews","woocommerce")}))}));class z extends t.Component{constructor(e){super(e);const{attributes:t}=this.props;this.state={orderby:null==t?void 0:t.orderby,reviewsToDisplay:this.getReviewsOnPageLoad()},this.onAppendReviews=this.onAppendReviews.bind(this),this.onChangeOrderby=this.onChangeOrderby.bind(this)}getReviewsOnPageLoad(){const{attributes:e}=this.props;return"number"==typeof e.reviewsOnPageLoad?e.reviewsOnPageLoad:parseInt(e.reviewsOnPageLoad,10)}getReviewsOnLoadMore(){const{attributes:e}=this.props;return"number"==typeof e.reviewsOnLoadMore?e.reviewsOnLoadMore:parseInt(e.reviewsOnLoadMore,10)}onAppendReviews(){const{reviewsToDisplay:e}=this.state;this.setState({reviewsToDisplay:e+this.getReviewsOnLoadMore()})}onChangeOrderby(e){this.setState({orderby:e.target.value,reviewsToDisplay:this.getReviewsOnPageLoad()})}onReviewsAppended({newReviews:e}){(0,O.speak)((0,n.sprintf)(/* translators: %d is the count of reviews loaded. */
(0,n._n)("%d review loaded.","%d reviews loaded.",e.length,"woocommerce"),e.length))}onReviewsReplaced(){(0,O.speak)((0,n.__)("Reviews list updated.","woocommerce"))}onReviewsLoadError(){(0,O.speak)((0,n.__)("There was an error loading the reviews.","woocommerce"))}render(){const{attributes:t}=this.props,{categoryIds:r,productId:s}=t,{reviewsToDisplay:o}=this.state,{order:n,orderby:a}=(e=>{if((0,i.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}})(this.state.orderby);return(0,e.createElement)($,{attributes:t,categoryIds:r,onAppendReviews:this.onAppendReviews,onChangeOrderby:this.onChangeOrderby,onReviewsAppended:this.onReviewsAppended,onReviewsLoadError:this.onReviewsLoadError,onReviewsReplaced:this.onReviewsReplaced,order:n,orderby:a,productId:s,reviewsToDisplay:o,sortSelectValue:this.state.orderby})}}(e=>{const t=document.body.querySelectorAll(R.join(",")),{Block:r,getProps:s,getErrorBoundaryProps:o,selector:n}=e;(({Block:e,getProps:t,getErrorBoundaryProps:r,selector:s,wrappers:o})=>{const n=document.body.querySelectorAll(s);o&&o.length>0&&Array.prototype.filter.call(n,(e=>!((e,t)=>Array.prototype.some.call(t,(t=>t.contains(e)&&!t.isSameNode(e))))(e,o))),S({Block:e,containers:n,getProps:t,getErrorBoundaryProps:r})})({Block:r,getProps:s,getErrorBoundaryProps:o,selector:n,wrappers:t}),Array.prototype.forEach.call(t,(t=>{t.addEventListener("wc-blocks_render_blocks_frontend",(()=>{(({Block:e,getProps:t,getErrorBoundaryProps:r,selector:s,wrapper:o})=>{const n=o.querySelectorAll(s);S({Block:e,containers:n,getProps:t,getErrorBoundaryProps:r})})({...e,wrapper:t})}))}))})({selector:"\n\t.wp-block-woocommerce-all-reviews,\n\t.wp-block-woocommerce-reviews-by-product,\n\t.wp-block-woocommerce-reviews-by-category\n",Block:z,getProps:e=>({attributes:{showOrderby:"true"===e.dataset.showOrderby,showLoadMore:"true"===e.dataset.showLoadMore,showReviewDate:e.classList.contains("has-date"),showReviewerName:e.classList.contains("has-name"),showReviewImage:e.classList.contains("has-image"),showReviewRating:e.classList.contains("has-rating"),showReviewContent:e.classList.contains("has-content"),showProductName:e.classList.contains("has-product-name")}})})})()})();