!function(){"use strict";var e,t={7005:function(e,t,r){var n=r(1609),a=Symbol.for("react.element"),o=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var n,s={},i=null,u=null;for(n in void 0!==r&&(i=""+r),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(u=t.ref),t)o.call(t,n)&&!c.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===s[n]&&(s[n]=t[n]);return{$$typeof:a,type:e,key:i,ref:u,props:s,_owner:l.current}}t.jsx=s,t.jsxs=s},9255:function(e,t,r){e.exports=r(7005)},5459:function(e,t,r){var n=window.wp.blocks,a=window.wp.primitives,o=r(9255),l=(0,o.jsxs)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)(a.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z",fillRule:"evenodd",clipRule:"evenodd"}),(0,o.jsx)(a.Path,{d:"M15 15V15C15 13.8954 14.1046 13 13 13L11 13C9.89543 13 9 13.8954 9 15V15",fillRule:"evenodd",clipRule:"evenodd"}),(0,o.jsx)(a.Circle,{cx:"12",cy:"9",r:"2",fillRule:"evenodd",clipRule:"evenodd"})]}),c=window.wp.blockEditor,s=window.wp.components,i=window.wp.i18n,u=JSON.parse('{"UU":"surecart/product-review-reviewer-name"}');(0,n.registerBlockType)(u.UU,{icon:l,edit:e=>{let{attributes:t,setAttributes:r,context:n}=e;const a=(0,c.useBlockProps)(),{review:o}=n,{format:l}=t;return React.createElement(React.Fragment,null,React.createElement(c.InspectorControls,null,React.createElement(s.PanelBody,{title:(0,i.__)("Settings","surecart")},React.createElement(s.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,i.__)("Name Format","surecart"),value:l,options:[{label:(0,i.__)("Display Name","surecart"),value:"display_name"},{label:(0,i.__)("First Name","surecart"),value:"first_name"},{label:(0,i.__)("Last Name","surecart"),value:"last_name"},{label:(0,i.__)("First Name Last Name","surecart"),value:"first_last"}],onChange:e=>r({format:e})}))),React.createElement("div",a,(()=>{if(!o?.customer)return(0,i.__)("Reviewer Name","surecart");const e=o?.customer;switch(l){case"first_name":return e?.first_name||e?.name||"";case"last_name":return e?.last_name||e?.name||"";case"first_last":const t=e?.first_name||"",r=e?.last_name||"";return t&&r?`${t} ${r}`:e?.name||"";default:return e?.name||""}})()))}})},1609:function(e){e.exports=window.React}},r={};function n(e){var a=r[e];if(void 0!==a)return a.exports;var o=r[e]={exports:{}};return t[e](o,o.exports,n),o.exports}n.m=t,e=[],n.O=function(t,r,a,o){if(!r){var l=1/0;for(u=0;u<e.length;u++){r=e[u][0],a=e[u][1],o=e[u][2];for(var c=!0,s=0;s<r.length;s++)(!1&o||l>=o)&&Object.keys(n.O).every((function(e){return n.O[e](r[s])}))?r.splice(s--,1):(c=!1,o<l&&(l=o));if(c){e.splice(u--,1);var i=a();void 0!==i&&(t=i)}}return t}o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[r,a,o]},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={1395:0,427:0};n.O.j=function(t){return 0===e[t]};var t=function(t,r){var a,o,l=r[0],c=r[1],s=r[2],i=0;if(l.some((function(t){return 0!==e[t]}))){for(a in c)n.o(c,a)&&(n.m[a]=c[a]);if(s)var u=s(n)}for(t&&t(r);i<l.length;i++)o=l[i],n.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return n.O(u)},r=self.webpackChunk_surecart_blocks_next=self.webpackChunk_surecart_blocks_next||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var a=n.O(void 0,[427],(function(){return n(5459)}));a=n.O(a)}();